@@ -30,7 +30,7 @@ |
||
30 | 30 | /** |
31 | 31 | * @var array $allowedCountries |
32 | 32 | */ |
33 | - private $allowedCountries = array('IT', 'ES', 'PT', 'FR'); |
|
33 | + private $allowedCountries = array('IT', 'ES', 'PT', 'FR'); |
|
34 | 34 | |
35 | 35 | /** |
36 | 36 | * Configuration constructor. |
@@ -68,26 +68,26 @@ discard block |
||
68 | 68 | $orderShippingAddress = new \Pagantis\OrdersApiClient\Model\Order\User\Address(); |
69 | 69 | |
70 | 70 | $orderShippingAddress->setZipCode('08029') |
71 | - ->setFullName('Alberto Escudero Sanchez') |
|
72 | - ->setCountryCode('ES') |
|
73 | - ->setCity('Barcelona') |
|
74 | - ->setAddress('Avenida de la diagonal 525') |
|
75 | - ->setDni('77695544A') |
|
76 | - ->setNationalId('59661738Z') |
|
77 | - ->setFixPhone('931232345') |
|
78 | - ->setMobilePhone('600123124'); |
|
71 | + ->setFullName('Alberto Escudero Sanchez') |
|
72 | + ->setCountryCode('ES') |
|
73 | + ->setCity('Barcelona') |
|
74 | + ->setAddress('Avenida de la diagonal 525') |
|
75 | + ->setDni('77695544A') |
|
76 | + ->setNationalId('59661738Z') |
|
77 | + ->setFixPhone('931232345') |
|
78 | + ->setMobilePhone('600123124'); |
|
79 | 79 | writeLog('Adding the information of the user', $logsFileName, $logsWithDate); |
80 | 80 | $orderUser = new \Pagantis\OrdersApiClient\Model\Order\User(); |
81 | 81 | $orderUser->setFullName('María Sanchez Escudero') |
82 | - ->setAddress($userAddress) |
|
83 | - ->setBillingAddress($orderBillingAddress) |
|
84 | - ->setShippingAddress($orderShippingAddress) |
|
85 | - ->setDateOfBirth('1985-12-30') |
|
86 | - ->setEmail('[email protected]') |
|
87 | - ->setFixPhone('911231234') |
|
88 | - ->setMobilePhone('600123123') |
|
89 | - ->setDni('59661738Z') |
|
90 | - ->setNationalId('59661738Z'); |
|
82 | + ->setAddress($userAddress) |
|
83 | + ->setBillingAddress($orderBillingAddress) |
|
84 | + ->setShippingAddress($orderShippingAddress) |
|
85 | + ->setDateOfBirth('1985-12-30') |
|
86 | + ->setEmail('[email protected]') |
|
87 | + ->setFixPhone('911231234') |
|
88 | + ->setMobilePhone('600123123') |
|
89 | + ->setDni('59661738Z') |
|
90 | + ->setNationalId('59661738Z'); |
|
91 | 91 | writeLog('User object created', $logsFileName, $logsWithDate); |
92 | 92 | |
93 | 93 | //2. ShoppingCart Object |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | writeLog('Adding the purchases of the customer, if there are any.', $logsFileName, $logsWithDate); |
96 | 96 | $orderHistory = new \Pagantis\OrdersApiClient\Model\Order\User\OrderHistory(); |
97 | 97 | $orderHistory->setAmount('2499') |
98 | - ->setDate('2010-01-31'); |
|
98 | + ->setDate('2010-01-31'); |
|
99 | 99 | |
100 | 100 | $orderUser->addOrderHistory($orderHistory); |
101 | 101 | |
@@ -111,9 +111,9 @@ discard block |
||
111 | 111 | |
112 | 112 | $orderShoppingCart = new \Pagantis\OrdersApiClient\Model\Order\ShoppingCart(); |
113 | 113 | $orderShoppingCart->setDetails($details) |
114 | - ->setOrderReference(ORDER_ID) |
|
115 | - ->setPromotedAmount(0) // This amount means that the merchant will assume the interests. |
|
116 | - ->setTotalAmount('59999'); |
|
114 | + ->setOrderReference(ORDER_ID) |
|
115 | + ->setPromotedAmount(0) // This amount means that the merchant will assume the interests. |
|
116 | + ->setTotalAmount('59999'); |
|
117 | 117 | writeLog('Created OrderShoppingCart object', $logsFileName, $logsWithDate); |
118 | 118 | |
119 | 119 | //3. Configuration Object |
@@ -125,26 +125,26 @@ discard block |
||
125 | 125 | |
126 | 126 | $orderConfigurationUrls = new \Pagantis\OrdersApiClient\Model\Order\Configuration\Urls(); |
127 | 127 | $orderConfigurationUrls->setCancel($errorUrl) |
128 | - ->setKo($errorUrl) |
|
129 | - ->setAuthorizedNotificationCallback($confirmUrl) |
|
130 | - ->setRejectedNotificationCallback($confirmUrl) |
|
131 | - ->setOk($confirmUrl); |
|
128 | + ->setKo($errorUrl) |
|
129 | + ->setAuthorizedNotificationCallback($confirmUrl) |
|
130 | + ->setRejectedNotificationCallback($confirmUrl) |
|
131 | + ->setOk($confirmUrl); |
|
132 | 132 | writeLog('Adding channel info', $logsFileName, $logsWithDate); |
133 | 133 | |
134 | 134 | $orderChannel = new \Pagantis\OrdersApiClient\Model\Order\Configuration\Channel(); |
135 | 135 | $orderChannel->setAssistedSale(false) |
136 | - ->setType(\Pagantis\OrdersApiClient\Model\Order\Configuration\Channel::ONLINE); |
|
136 | + ->setType(\Pagantis\OrdersApiClient\Model\Order\Configuration\Channel::ONLINE); |
|
137 | 137 | |
138 | 138 | $orderConfiguration = new \Pagantis\OrdersApiClient\Model\Order\Configuration(); |
139 | 139 | $orderConfiguration->setChannel($orderChannel) |
140 | - ->setUrls($orderConfigurationUrls); |
|
140 | + ->setUrls($orderConfigurationUrls); |
|
141 | 141 | |
142 | 142 | writeLog('Created Configuration object', $logsFileName, $logsWithDate); |
143 | 143 | |
144 | 144 | $order = new \Pagantis\OrdersApiClient\Model\Order(); |
145 | 145 | $order->setConfiguration($orderConfiguration) |
146 | - ->setShoppingCart($orderShoppingCart) |
|
147 | - ->setUser($orderUser); |
|
146 | + ->setShoppingCart($orderShoppingCart) |
|
147 | + ->setUser($orderUser); |
|
148 | 148 | |
149 | 149 | writeLog('Creating OrdersApiClient', $logsFileName, $logsWithDate); |
150 | 150 | $orderClient = getOrderApiClient(); |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | |
171 | 171 | writeLog(jsonEncoded($order->export()), basename(__FILE__), $logsWithDate); |
172 | 172 | $formUrl = $order->getActionUrls() |
173 | - ->getForm(); |
|
173 | + ->getForm(); |
|
174 | 174 | // You can use our test credit cards to fill the Pagantis form |
175 | 175 | writeLog("Redirecting to Pagantis form => $formUrl", $logsFileName, $logsWithDate); |
176 | 176 | header('Location:' . $formUrl); |