-
Notifications
You must be signed in to change notification settings - Fork 252
Expand file tree
/
Copy pathPaymentGatewayInterface.php
More file actions
123 lines (108 loc) · 3.37 KB
/
PaymentGatewayInterface.php
File metadata and controls
123 lines (108 loc) · 3.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<?php
namespace Drupal\commerce_payment\Plugin\Commerce\PaymentGateway;
use Drupal\commerce_payment\Entity\PaymentInterface;
use Drupal\Component\Plugin\ConfigurablePluginInterface;
use Drupal\Component\Plugin\DerivativeInspectionInterface;
use Drupal\Core\Plugin\PluginFormInterface;
use Drupal\Core\Plugin\PluginWithFormsInterface;
/**
* Defines the base interface for payment gateways.
*/
interface PaymentGatewayInterface extends PluginWithFormsInterface, ConfigurablePluginInterface, PluginFormInterface, DerivativeInspectionInterface {
/**
* Gets the payment gateway label.
*
* The label is admin-facing and usually includes the name of the used API.
* For example: "Braintree (Hosted Fields)".
*
* @return mixed
* The payment gateway label.
*/
public function getLabel();
/**
* Gets the payment gateway display label.
*
* The display label is customer-facing and more generic.
* For example: "Braintree".
*
* @return string
* The payment gateway display label.
*/
public function getDisplayLabel();
/**
* Gets the mode in which the payment gateway is operating.
*
* @return string
* The machine name of the mode.
*/
public function getMode();
/**
* Gets the supported modes.
*
* @return string[]
* The mode labels keyed by machine name.
*/
public function getSupportedModes();
/**
* Gets the details of the payment gateway or NULL if not defined..
*
* @return array|null
* The details definition or NULL.
*/
public function getDetails();
/**
* Gets the JS library ID.
*
* This is usually an external library defined in the module's
* libraries.yml file. Included by the PaymentInformation pane
* to get around core bug #1988968.
* Example: 'commerce_braintree/braintree'.
*
* @return string|null
* The JS library ID, or NULL if not available.
*/
public function getJsLibrary();
/**
* Gets the payment type used by the payment gateway.
*
* @return \Drupal\commerce_payment\Plugin\Commerce\PaymentType\PaymentTypeInterface
* The payment type.
*/
public function getPaymentType();
/**
* Gets the payment method types handled by the payment gateway.
*
* @return \Drupal\commerce_payment\Plugin\Commerce\PaymentMethodType\PaymentMethodTypeInterface[]
* The payment method types.
*/
public function getPaymentMethodTypes();
/**
* Gets the default payment method type.
*
* @return \Drupal\commerce_payment\Plugin\Commerce\PaymentMethodType\PaymentMethodTypeInterface
* The default payment method type.
*/
public function getDefaultPaymentMethodType();
/**
* Gets the credit card types handled by the gateway.
*
* @return \Drupal\commerce_payment\CreditCardType[]
* The credit card types.
*/
public function getCreditCardTypes();
/**
* Builds the available operations for the given payment.
*
* @param \Drupal\commerce_payment\Entity\PaymentInterface $payment
* The payment.
*
* @return array
* The operations.
* Keyed by operation ID, each value is an array with the following keys:
* - title: The operation title.
* - page_title: The operation page title.
* - plugin_form: The plugin form ID.
* - access: Whether the operation is allowed for the given payment.
*/
public function buildPaymentOperations(PaymentInterface $payment);
}