Gateway::getDefaultParameters()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 1
cts 1
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
crap 1
1
<?php
2
3
/*
4
 * PayPal driver for Omnipay PHP payment library
5
 *
6
 * @link      https://github.com/hiqdev/omnipay-paypal
7
 * @package   omnipay-paypal
8
 * @license   MIT
9
 * @copyright Copyright (c) 2015-2016, HiQDev (http://hiqdev.com/)
10
 */
11
12
namespace Omnipay\PayPal;
13
14
use Omnipay\Common\AbstractGateway;
15
16
/**
17
 * Gateway for PayPal.
18
 */
19
class Gateway extends AbstractGateway
20
{
21
    /**
22
     * {@inheritdoc}
23 1
     */
24
    public function getName()
25 1
    {
26
        return 'PayPal';
27
    }
28
29
    /**
30
     * {@inheritdoc}
31 29
     */
32
    public function getDefaultParameters()
33
    {
34 29
        return [
35
            'purse'     => '',
36
            'testMode'  => false,
37
        ];
38
    }
39
40
    /**
41
     * Get the merchant purse.
42
     *
43
     * @return string merchant purse - email associated with the merchant account.
44 2
     */
45
    public function getPurse()
46 2
    {
47
        return $this->getParameter('purse');
48
    }
49
50
    /**
51
     * Set the merchant purse.
52
     *
53
     * @param string $value merchant purse - email associated with the merchant account.
54
     * @return self
55 29
     */
56
    public function setPurse($value)
57 29
    {
58
        return $this->setParameter('purse', $value);
59
    }
60
61
    /**
62
     * Get the merchant secret. Actually not used.
63
     *
64
     * @return string merchant secret
65 1
     */
66
    public function getSecret()
67 1
    {
68
        return $this->getParameter('secret');
69
    }
70
71
    /**
72
     * Set the merchant secret. Actually not used.
73
     *
74
     * @param string $value merchant secret
75
     * @return self
76 29
     */
77
    public function setSecret($value)
78 29
    {
79
        return $this->setParameter('secret', $value);
80
    }
81
82
    /**
83
     * @param array $parameters
84
     *
85
     * @return \Omnipay\PayPal\Message\PurchaseRequest
86 3
     */
87
    public function purchase(array $parameters = [])
88 3
    {
89
        return $this->createRequest('\Omnipay\PayPal\Message\PurchaseRequest', $parameters);
90
    }
91
92
    /**
93
     * @param array $parameters
94
     *
95
     * @return \Omnipay\PayPal\Message\CompletePurchaseRequest
96 3
     */
97
    public function completePurchase(array $parameters = [])
98 3
    {
99
        return $this->createRequest('\Omnipay\PayPal\Message\CompletePurchaseRequest', $parameters);
100
    }
101
}
102