1 | <?php |
||
21 | class DirectDebit |
||
22 | extends \Aimeos\MShop\Service\Provider\Payment\Base |
||
|
|||
23 | implements \Aimeos\MShop\Service\Provider\Payment\Iface |
||
24 | { |
||
25 | private $feConfig = array( |
||
26 | 'directdebit.accountowner' => array( |
||
27 | 'code' => 'directdebit.accountowner', |
||
28 | 'internalcode' => 'accountowner', |
||
29 | 'label' => 'Account owner', |
||
30 | 'type' => 'string', |
||
31 | 'internaltype' => 'string', |
||
32 | 'default' => '', |
||
33 | 'required' => true |
||
34 | ), |
||
35 | 'directdebit.accountno' => array( |
||
36 | 'code' => 'directdebit.accountno', |
||
37 | 'internalcode' => 'accountno', |
||
38 | 'label' => 'Account number', |
||
39 | 'type' => 'string', |
||
40 | 'internaltype' => 'string', |
||
41 | 'default' => '', |
||
42 | 'required' => true |
||
43 | ), |
||
44 | 'directdebit.bankcode' => array( |
||
45 | 'code' => 'directdebit.bankcode', |
||
46 | 'internalcode' => 'bankcode', |
||
47 | 'label' => 'Bank code', |
||
48 | 'type' => 'string', |
||
49 | 'internaltype' => 'string', |
||
50 | 'default' => '', |
||
51 | 'required' => true |
||
52 | ), |
||
53 | 'directdebit.bankname' => array( |
||
54 | 'code' => 'directdebit.bankname', |
||
55 | 'internalcode' => 'bankname', |
||
56 | 'label' => 'Bank name', |
||
57 | 'type' => 'string', |
||
58 | 'internaltype' => 'string', |
||
59 | 'default' => '', |
||
60 | 'required' => true |
||
61 | ), |
||
62 | ); |
||
63 | |||
64 | |||
65 | /** |
||
66 | * Returns the configuration attribute definitions of the provider to generate a list of available fields and |
||
67 | * rules for the value of each field in the frontend. |
||
68 | * |
||
69 | * @param \Aimeos\MShop\Order\Item\Base\Iface $basket Basket object |
||
70 | * @return array List of attribute definitions implementing \Aimeos\MW\Common\Critera\Attribute\Iface |
||
71 | */ |
||
72 | public function getConfigFE( \Aimeos\MShop\Order\Item\Base\Iface $basket ) |
||
88 | |||
89 | |||
90 | /** |
||
91 | * Checks the frontend configuration attributes for validity. |
||
92 | * |
||
93 | * @param array $attributes Attributes entered by the customer during the checkout process |
||
94 | * @return array An array with the attribute keys as key and an error message as values for all attributes that are |
||
95 | * known by the provider but aren't valid resp. null for attributes whose values are OK |
||
96 | */ |
||
97 | public function checkConfigFE( array $attributes ) |
||
101 | |||
102 | |||
103 | /** |
||
104 | * Sets the payment attributes in the given service. |
||
105 | * |
||
106 | * @param \Aimeos\MShop\Order\Item\Base\Service\Iface $orderServiceItem Order service item that will be added to the basket |
||
107 | * @param array $attributes Attribute key/value pairs entered by the customer during the checkout process |
||
108 | */ |
||
109 | public function setConfigFE( \Aimeos\MShop\Order\Item\Base\Service\Iface $orderServiceItem, array $attributes ) |
||
126 | |||
127 | |||
128 | /** |
||
129 | * Executes the payment again for the given order if supported. |
||
130 | * This requires support of the payment gateway and token based payment |
||
131 | * |
||
132 | * @param \Aimeos\MShop\Order\Item\Iface $order Order invoice object |
||
133 | * @return void |
||
134 | */ |
||
135 | public function repay( \Aimeos\MShop\Order\Item\Iface $order ) |
||
138 | |||
139 | |||
140 | /** |
||
141 | * Updates the orders for whose status updates have been received by the confirmation page |
||
142 | * |
||
143 | * @param \Psr\Http\Message\ServerRequestInterface $request Request object with parameters and request body |
||
144 | * @param \Aimeos\MShop\Order\Item\Iface $order Order item that should be updated |
||
145 | * @return \Aimeos\MShop\Order\Item\Iface Updated order item |
||
146 | * @throws \Aimeos\MShop\Service\Exception If updating the orders failed |
||
147 | */ |
||
148 | public function updateSync( \Psr\Http\Message\ServerRequestInterface $request, \Aimeos\MShop\Order\Item\Iface $order ) |
||
155 | } |