File tree Expand file tree Collapse file tree 14 files changed +185
-1
lines changed Expand file tree Collapse file tree 14 files changed +185
-1
lines changed Original file line number Diff line number Diff line change 2
2
composer.lock
3
3
composer.phar
4
4
phpunit.xml
5
+ .directory
6
+ reports /
7
+ documents /
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ mkdir -p ./reports
4
+ mkdir -p ./documents/apigen
5
+
6
+ if [ -z " $1 " ]; then
7
+ apigen \
8
+ --title ' Onmipay Common API documentation' \
9
+ --source ./src \
10
+ --destination ./documents/apigen \
11
+ --report ./reports/apigen.xml
12
+
13
+ #
14
+ # Left here for further expansion, ignore this for the time being.
15
+ #
16
+ elif [ " $1 " = " common" ]; then
17
+ apigen \
18
+ --title ' Omnipay Common API documentation' \
19
+ --source ./src/Omnipay/Common \
20
+ --destination ./documents/apigen \
21
+ --report ./reports/apigen.xml
22
+
23
+ fi
Original file line number Diff line number Diff line change 1
1
<?php
2
+ /**
3
+ * Base payment gateway class
4
+ */
2
5
3
6
namespace Omnipay \Common ;
4
7
9
12
10
13
/**
11
14
* Base payment gateway class
15
+ *
16
+ * This abstract class should be extended by all payment gateways
17
+ * throughout the Omnipay system. It enforces implementation of
18
+ * the GatewayInterface interface and defines various common attibutes
19
+ * and methods that all gateways should have.
12
20
*/
13
21
abstract class AbstractGateway implements GatewayInterface
14
22
{
Original file line number Diff line number Diff line change 1
1
<?php
2
+ /**
3
+ * Credit Card class
4
+ */
2
5
3
6
namespace Omnipay \Common ;
4
7
9
12
10
13
/**
11
14
* Credit Card class
15
+ *
16
+ * This class defines and abstracts all of the credit card types used
17
+ * throughout the Omnipay system.
12
18
*/
13
19
class CreditCard
14
20
{
Original file line number Diff line number Diff line change 1
1
<?php
2
+ /**
3
+ * Currency class
4
+ */
2
5
3
6
namespace Omnipay \Common ;
4
7
5
8
/**
6
9
* Currency class
10
+ *
11
+ * This class abstracts certain functionality around currency objects,
12
+ * currency codes and currency numbers relating to global currencies used
13
+ * in the Omnipay system.
7
14
*/
8
15
class Currency
9
16
{
Original file line number Diff line number Diff line change 1
1
<?php
2
+ /**
3
+ * Omnipay Gateway Factory class
4
+ */
2
5
3
6
namespace Omnipay \Common ;
4
7
5
8
use Guzzle \Http \ClientInterface ;
6
9
use Omnipay \Common \Exception \RuntimeException ;
7
10
use Symfony \Component \HttpFoundation \Request as HttpRequest ;
8
11
12
+ /**
13
+ * Omnipay Gateway Factory class
14
+ *
15
+ * This class abstracts a set of gateways that can be independently
16
+ * registered, accessed, and used.
17
+ */
9
18
class GatewayFactory
10
19
{
20
+ /**
21
+ * Internal storage for all available gateways
22
+ *
23
+ * @var array
24
+ */
11
25
private $ gateways = array ();
12
26
13
27
/**
Original file line number Diff line number Diff line change 1
1
<?php
2
+ /**
3
+ * Payment gateway interface
4
+ */
2
5
3
6
namespace Omnipay \Common ;
4
7
5
8
/**
6
9
* Payment gateway interface
10
+ *
11
+ * This interface class defines the standard functions that any
12
+ * Omnipay gateway needs to define.
7
13
*/
8
14
interface GatewayInterface
9
15
{
Original file line number Diff line number Diff line change 1
1
<?php
2
+ /**
3
+ * Helper class
4
+ */
2
5
3
6
namespace Omnipay \Common ;
4
7
5
8
/**
6
9
* Helper class
10
+ *
11
+ * This class defines various static utility functions that are in use
12
+ * throughout the Omnipay system.
7
13
*/
8
14
class Helper
9
15
{
10
16
/**
11
17
* Convert a string to camelCase. Strings already in camelCase will not be harmed.
18
+ *
19
+ * @param string $str The input string
20
+ * @return string camelCased output string
12
21
*/
13
22
public static function camelCase ($ str )
14
23
{
@@ -88,6 +97,9 @@ public static function getGatewayShortName($className)
88
97
* Stripe => \Omnipay\Stripe\Gateway
89
98
* PayPal\Express => \Omnipay\PayPal\ExpressGateway
90
99
* PayPal_Express => \Omnipay\PayPal\ExpressGateway
100
+ *
101
+ * @param string $shortName The short gateway name
102
+ * @return string The fully namespaced gateway class name
91
103
*/
92
104
public static function getGatewayClassName ($ shortName )
93
105
{
Original file line number Diff line number Diff line change 1
1
<?php
2
+ /**
3
+ * Issuer
4
+ */
2
5
3
6
namespace Omnipay \Common ;
4
7
5
8
/**
6
9
* Issuer
10
+ *
11
+ * This class abstracts some functionality around card issuers used in the
12
+ * Omnipay system.
7
13
*/
8
14
class Issuer
9
15
{
16
+ /**
17
+ * The identifier of the issuer.
18
+ *
19
+ * @var string
20
+ */
10
21
protected $ id ;
22
+
23
+ /**
24
+ * The full name of the issuer.
25
+ *
26
+ * @var string
27
+ */
11
28
protected $ name ;
29
+
30
+ /**
31
+ * The ID of a payment method that the issuer belongs to.
32
+ *
33
+ * @see PaymentMethod
34
+ *
35
+ * @var string
36
+ */
12
37
protected $ paymentMethod ;
13
38
14
39
/**
15
40
* Create a new Issuer
16
41
*
42
+ * @see PaymentMethod
43
+ *
17
44
* @param string $id The identifier of this issuer
18
45
* @param string $name The name of this issuer
19
46
* @param string|null $paymentMethod The ID of a payment method this issuer belongs to
@@ -48,6 +75,8 @@ public function getName()
48
75
/**
49
76
* The ID of a payment method this issuer belongs to
50
77
*
78
+ * @see PaymentMethod
79
+ *
51
80
* @return string
52
81
*/
53
82
public function getPaymentMethod ()
Original file line number Diff line number Diff line change 1
1
<?php
2
+ /**
3
+ * Cart Item
4
+ */
2
5
3
6
namespace Omnipay \Common ;
4
7
5
8
use Symfony \Component \HttpFoundation \ParameterBag ;
6
9
7
10
/**
8
11
* Cart Item
12
+ *
13
+ * This class defines a single cart item in the Omnipay system.
14
+ *
15
+ * @see ItemInterface
9
16
*/
10
17
class Item implements ItemInterface
11
18
{
You can’t perform that action at this time.
0 commit comments