Payline - Version 1.7.8

Version Notes

Ajout du support Magento CE 1.8 et Magento EE 1.13

Download this release

Release Info

Developer Payline
Extension Payline
Version 1.7.8
Comparing to
See all releases


Code changes from version 1.7.7 to 1.7.8

app/code/community/Monext/Payline/Model/Datasource/Status.php CHANGED
@@ -7,22 +7,29 @@ class Monext_Payline_Model_Datasource_Status extends Mage_Adminhtml_Model_System
7
  if (class_exists('Mage_Sales_Model_Mysql4_Order_Status_Collection')) {
8
  $collection = Mage::getResourceModel('sales/order_status_collection')
9
  ->orderByLabel();
 
10
  foreach ($collection as $status) {
 
 
 
 
11
  $options[] = array(
12
- 'value' => $status->getStatus(),
13
  'label' => $status->getStoreLabel()
14
  );
15
  }
16
  } else {
17
  $statuses = Mage::getSingleton('sales/order_config')->getStatuses();
18
  foreach ($statuses as $code=>$label) {
 
 
 
19
  $options[] = array(
20
  'value' => $code,
21
  'label' => $label
22
  );
23
  }
24
  }
25
-
26
  return $options;
27
  }
28
  }
7
  if (class_exists('Mage_Sales_Model_Mysql4_Order_Status_Collection')) {
8
  $collection = Mage::getResourceModel('sales/order_status_collection')
9
  ->orderByLabel();
10
+ $statusValue = '';
11
  foreach ($collection as $status) {
12
+ $statusValue = $status->getStatus();
13
+ if( $statusValue === 'complete' || $statusValue === 'closed' ) {
14
+ continue;
15
+ }
16
  $options[] = array(
17
+ 'value' => $statusValue,
18
  'label' => $status->getStoreLabel()
19
  );
20
  }
21
  } else {
22
  $statuses = Mage::getSingleton('sales/order_config')->getStatuses();
23
  foreach ($statuses as $code=>$label) {
24
+ if( $code === 'complete' || $code === 'closed' ) {
25
+ continue;
26
+ }
27
  $options[] = array(
28
  'value' => $code,
29
  'label' => $label
30
  );
31
  }
32
  }
 
33
  return $options;
34
  }
35
  }
app/code/community/Monext/Payline/Model/Datasource/Statusrowempty.php CHANGED
@@ -11,15 +11,23 @@ class Monext_Payline_Model_Datasource_Statusrowempty extends Mage_Adminhtml_Mode
11
  if (class_exists('Mage_Sales_Model_Mysql4_Order_Status_Collection')) {
12
  $collection = Mage::getResourceModel('sales/order_status_collection')
13
  ->orderByLabel();
 
14
  foreach ($collection as $status) {
 
 
 
 
15
  $options[] = array(
16
- 'value' => $status->getStatus(),
17
  'label' => $status->getStoreLabel()
18
  );
19
  }
20
  } else {
21
  $statuses = Mage::getSingleton('sales/order_config')->getStatuses();
22
  foreach ($statuses as $code=>$label) {
 
 
 
23
  $options[] = array(
24
  'value' => $code,
25
  'label' => $label
11
  if (class_exists('Mage_Sales_Model_Mysql4_Order_Status_Collection')) {
12
  $collection = Mage::getResourceModel('sales/order_status_collection')
13
  ->orderByLabel();
14
+ $statusValue = '';
15
  foreach ($collection as $status) {
16
+ $statusValue = $status->getStatus();
17
+ if( $statusValue === 'complete' || $statusValue === 'closed' ) {
18
+ continue;
19
+ }
20
  $options[] = array(
21
+ 'value' => $statusValue,
22
  'label' => $status->getStoreLabel()
23
  );
24
  }
25
  } else {
26
  $statuses = Mage::getSingleton('sales/order_config')->getStatuses();
27
  foreach ($statuses as $code=>$label) {
28
+ if( $code === 'complete' || $code === 'closed' ) {
29
+ continue;
30
+ }
31
  $options[] = array(
32
  'value' => $code,
33
  'label' => $label
app/code/community/Monext/Payline/PaylinePHPKit/lib/paylineSDK.php CHANGED
@@ -1,1789 +1,1789 @@
1
- <?php
2
- //
3
- // Payline Class
4
- // Copyright Monext
5
- //
6
- require_once('jIniFileModifier.php');
7
- //
8
- // OBJECTS DEFINITIONS
9
- //
10
-
11
-
12
- class util{
13
-
14
- /**
15
- * make an array from a payline server response object.
16
- * @params : $response : Objet response from payline
17
- * @return : Object convert in an array
18
- **/
19
- static function responseToArray($response){
20
-
21
- $array = array();
22
- foreach($response as $k=>$v){
23
- if (is_object($v)) {
24
- $array[$k] = util::responseToArray($v);
25
- }
26
- else { $array[$k] = $v;
27
- }
28
- }
29
- return $array;
30
-
31
- return $response;
32
- }
33
-
34
- static function responseToArrayForGetCards($response){
35
-
36
- $array = array();
37
- foreach($response as $k=>$v){
38
-
39
- if (is_object($v) && ($k != 'cards' ) ) {
40
- $array[$k] = util::responseToArrayForGetCards($v);
41
- }
42
- else {
43
- if($k == 'cards' && count($v) == 1 ){
44
- $array[$k][0] = $v;
45
- }else{
46
- $array[$k] = $v;
47
- }
48
- }
49
- }
50
- return $array;
51
-
52
- return $response;
53
- }
54
- }
55
-
56
- //
57
- // PL_PAYMENT OBJECT DEFINITION
58
- //
59
- class pl_payment{
60
-
61
- // ATTRIBUTES LISTING
62
- public $amount;
63
- public $currency;
64
- public $action;
65
- public $mode;
66
- public $contractNumber;
67
- public $differedActionDate;
68
- }
69
-
70
- //
71
- // PL_ORDER OBJECT DEFINITION
72
- //
73
- class pl_order{
74
-
75
- // ATTRIBUTES LISTING
76
- public $ref;
77
- public $origin;
78
- public $country;
79
- public $taxes;
80
- public $amount;
81
- public $currency;
82
- public $date;
83
- public $quantity;
84
- public $comment;
85
- public $details;
86
-
87
- function __construct() {
88
- $this->date = date('d/m/Y H:i', time());
89
- $this->details = array();
90
- }
91
- }
92
-
93
- //
94
- // PL_PRIVATEDATA OBJECT DEFINITION
95
- //
96
- class pl_privateData{
97
-
98
- // ATTRIBUTES LISTING
99
- public $key ;
100
- public $value;
101
- }
102
-
103
- //
104
- // PL_AUTHORIZATION OBJECT DEFINITION
105
- //
106
- class pl_authorization{
107
-
108
- // ATTRIBUTES LISTING
109
- public $number;
110
- public $date;
111
- }
112
-
113
- //
114
- // PL_ADDRESS OBJECT DEFINITION
115
- //
116
- class pl_address{
117
-
118
- // ATTRIBUTES LISTING
119
- public $name;
120
- public $street1;
121
- public $street2;
122
- public $cityName;
123
- public $zipCode;
124
- public $country;
125
- public $phone;
126
- }
127
-
128
- //
129
- // PL_BUYER OBJECT DEFINITION
130
- //
131
- class pl_buyer{
132
-
133
- // ATTRIBUTES LISTING
134
- public $lastName;
135
- public $firstName;
136
- public $email;
137
- public $customerId;
138
- public $walletId;
139
- public $walletDisplayed;
140
- public $walletSecured;
141
- public $walletCardInd;
142
- public $shippingAdress;
143
- public $billingAddress;
144
- public $accountCreateDate;
145
- public $accountAverageAmount;
146
- public $accountOrderCount;
147
- public $ip;
148
- public $mobilePhone;
149
-
150
- function __construct() {
151
- $this->accountCreateDate = date('d/m/y', time());
152
- }
153
- }
154
-
155
- //
156
- // PL_OWNER OBJECT DEFINITION
157
- //
158
- class pl_owner{
159
-
160
- // ATTRIBUTES LISTING
161
- public $lastName;
162
- public $firstName;
163
- public $billingAddress;
164
- public $issueCardDate;
165
- }
166
-
167
- //
168
- // PL_ORDERDETAIL OBJECT DEFINITION
169
- //
170
- class pl_orderDetail{
171
-
172
- // ATTRIBUTES LISTING
173
- public $ref;
174
- public $price;
175
- public $quantity;
176
- public $comment;
177
- }
178
-
179
- //
180
- // PL_CARD OBJECT DEFINITION
181
- //
182
- class pl_card{
183
-
184
- // ATTRIBUTES LISTING
185
- public $number;
186
- public $type;
187
- public $expirationDate;
188
- public $cvx;
189
- public $ownerBirthdayDate;
190
- public $password;
191
- public $cardholder; //added by smile
192
- public $token;
193
-
194
- function __construct($type) {
195
- $this->accountCreateDate = date('d/m/y', time());
196
- }
197
- }
198
-
199
-
200
- //
201
- // PL_TRANSACTION OBJECT DEFINITION
202
- //
203
- class pl_transaction{
204
-
205
- // ATTRIBUTES LISTING
206
- public $id;
207
- public $isPossibleFraud;
208
- public $isDuplicated;
209
- public $date;
210
- }
211
-
212
-
213
- //
214
- // PL_RESULT OBJECT DEFINITION
215
- //
216
- class pl_result{
217
-
218
- // ATTRIBUTES LISTING
219
- public $code;
220
- public $shortMessage;
221
- public $longMessage;
222
- }
223
-
224
- //
225
- // PL_CAPTURE OBJECT DEFINITION
226
- //
227
- class pl_capture{
228
-
229
- // ATTRIBUTES LISTING
230
- public $transactionID;
231
- public $payment;
232
- public $sequenceNumber;
233
-
234
- function __construct() {
235
- $this->payment = new pl_payment();
236
- }
237
- }
238
-
239
- //
240
- // PL_REFUND OBJECT DEFINITION
241
- //
242
- class pl_refund extends pl_capture {
243
- function __construct() {
244
- parent::__construct();
245
- }
246
- }
247
-
248
- //
249
- // PL_WALLET OBJECT DEFINITION
250
- //
251
- class pl_wallet{
252
-
253
- // ATTRIBUTES LISTING
254
- public $walletId;
255
- public $lastName;
256
- public $firstName;
257
- public $email;
258
- public $shippingAddress;
259
- public $card;
260
- public $comment;
261
-
262
- function __construct() {
263
- }
264
- }
265
-
266
- //
267
- // PL_RECURRING OBJECT DEFINITION
268
- //
269
- class pl_recurring{
270
-
271
- // ATTRIBUTES LISTING
272
- public $firstAmount;
273
- public $amount;
274
- public $billingCycle;
275
- public $billingLeft;
276
- public $billingDay;
277
- public $startDate;
278
-
279
- function __construct() {
280
- }
281
- }
282
-
283
- //
284
- // PL_AUTHENTIFICATION 3D SECURE
285
- //
286
- class pl_authentication3DSecure{
287
-
288
- // ATTRIBUTES LISTING
289
- public $md ;
290
- public $pares ;
291
- public $xid ;
292
- public $eci ;
293
- public $cavv ;
294
- public $cavvAlgorithm ;
295
- public $vadsResult ;
296
-
297
- function __construct() {
298
- }
299
- }
300
-
301
- //
302
- // PL_BANKACCOUNTDATA
303
- //
304
- class pl_bankAccountData{
305
-
306
-
307
- // ATTRIBUTES LISTING
308
- public $countryCode ;
309
- public $bankCode ;
310
- public $accountNumber ;
311
- public $key ;
312
-
313
-
314
- function __construct() {
315
- }
316
- }
317
-
318
- //
319
- // PL_CHEQUE
320
- //
321
- class pl_cheque{
322
-
323
- // ATTRIBUTES LISTING
324
- public $number ;
325
-
326
- function __construct() {
327
- }
328
- }
329
-
330
- final class Log {
331
- private $filename;
332
- private $path;
333
-
334
- public function __construct($filename) {
335
- $this->filename = $filename;
336
- $tmp = explode(DIRECTORY_SEPARATOR ,dirname(__FILE__));
337
-
338
- // up one level from the current directory
339
- for($i=0,$s = sizeof($tmp)-1; $i<$s; $i++){
340
- $this->path .= $tmp[$i].DIRECTORY_SEPARATOR;
341
- }
342
- $this->path .= 'logs'.DIRECTORY_SEPARATOR;
343
- }
344
-
345
- public function write($message) {
346
- $file = $this->path.$this->filename;
347
- $handle = fopen($file, 'a+');
348
- fwrite($handle, date('Y-m-d G:i:s') . ' - ' . $message . "\n");
349
- fclose($handle);
350
- }
351
- }
352
-
353
- //
354
- // PAYLINESDK CLASS
355
- //
356
- class paylineSDK{
357
-
358
- // kit version
359
- const KIT_VERSION = 'module Magento 1.7.7';
360
-
361
- // trace log
362
- var $paylineTrace;
363
-
364
- // SOAP URL's
365
- const PAYLINE_NAMESPACE = 'http://obj.ws.payline.experian.com';
366
- const WSDL = 'Payline.wsdl';
367
- const PROD_ENDPOINT = 'https://services.payline.com/V4/services/';
368
- const PROD_ENDPOINT_HD = 'https://services.payline.com/V4/services/';
369
- const HOMO_ENDPOINT = 'https://homologation.payline.com/V4/services/';
370
- const HOMO_ENDPOINT_HD = 'https://homologation.payline.com/V4/services/';
371
-
372
- const DIRECT_API = 'DirectPaymentAPI';
373
- const EXTENDED_API = 'ExtendedAPI';
374
- const WEB_API = 'WebPaymentAPI';
375
-
376
- // current endpoint
377
- private $webServicesEndpoint;
378
-
379
- // version of web service
380
- private $version = '';
381
-
382
- // devise used by the customer
383
- private $media = '';
384
-
385
- // SOAP ACTIONS CONSTANTS
386
- const soap_result = 'result';
387
- const soap_authorization = 'authorization';
388
- const soap_card = 'card';
389
- const soap_order = 'order';
390
- const soap_orderDetail = 'orderDetail';
391
- const soap_payment = 'payment';
392
- const soap_transaction = 'transaction';
393
- const soap_privateData = 'privateData';
394
- const soap_buyer = 'buyer';
395
- const soap_owner = 'owner';
396
- const soap_address = 'address';
397
- const soap_capture = 'capture';
398
- const soap_refund = 'refund';
399
- const soap_refund_auth = 'refundAuthorization';
400
- const soap_authentication3DSecure = 'authentication3DSecure';
401
- const soap_bankAccountData = 'bankAccountData';
402
- const soap_cheque = 'cheque';
403
-
404
- // Target environment
405
- public $production;
406
-
407
- // ARRAY
408
- public $header_soap;
409
- public $items;
410
- public $privates;
411
-
412
- // OPTIONS
413
- public $cancelURL;
414
- public $securityMode;
415
- public $notificationURL;
416
- public $returnURL;
417
- public $customPaymentTemplateURL;
418
- public $customPaymentPageCode;
419
- public $languageCode;
420
-
421
- // WALLET
422
- public $walletIdList;
423
-
424
- // SWITCHING VAR
425
- public $NMAX_TENTATIVE = '';
426
- public $CALL_TIMEOUT = '';
427
- public $RETRY_TIMEOUT = '';
428
- public $PRIMARY = true ;
429
- public $CURRENT_NUMBER_CALL = 0;
430
- public $DEFAULT_SOCKET_TIMEOUT = 0;
431
-
432
- /**
433
- * contructor of PAYLINESDK CLASS
434
- **/
435
- function __construct($merchant_id, $acess_key, $proxy_host, $proxy_port, $proxy_login, $proxy_password, $production) {
436
- $this->writeTrace('----------------------------------------------------------');
437
- $this->writeTrace("paylineSDK::__construct($merchant_id, ".$this->maskAccessKey($acess_key).", $proxy_host, $proxy_port, $proxy_login, $proxy_password, $production)");
438
- $this->header_soap = array();
439
- $this->header_soap['login'] = $merchant_id;
440
- $this->header_soap['password'] = $acess_key;
441
- if($proxy_host != ''){
442
- $this->header_soap['proxy_host'] = $proxy_host;
443
- $this->header_soap['proxy_port'] = $proxy_port;
444
- $this->header_soap['proxy_login'] = $proxy_login;
445
- $this->header_soap['proxy_password'] = $proxy_password;
446
- }
447
- $this->production = $production;
448
- if($production){
449
- $this->webServicesEndpoint = paylineSDK::PROD_ENDPOINT;
450
- }else{
451
- $this->webServicesEndpoint = paylineSDK::HOMO_ENDPOINT;
452
- }
453
- $this->header_soap['style'] = SOAP_DOCUMENT;
454
- $this->header_soap['use'] = SOAP_LITERAL;
455
- $this->header_soap['version'] = paylineSDK::KIT_VERSION;
456
- $this->items = array();
457
- $this->privates = array();
458
- $this->walletIdList = array();
459
-
460
- ini_set('user_agent', "PHP\r\nversion: ".paylineSDK::KIT_VERSION);
461
- }
462
-
463
- /**
464
- * function payment
465
- * @params : $array : array. the array keys are listed in pl_payment CLASS.
466
- * @return : SoapVar : object
467
- * @description : build pl_payment instance from $array and make SoapVar object for payment.
468
- **/
469
- protected function payment($array) {
470
- $payment = new pl_payment();
471
- if($array && is_array($array)){
472
- foreach($array as $k=>$v){
473
- if(array_key_exists($k, $payment)&&(strlen($v))){
474
- $payment->$k = $v;
475
- }
476
- }
477
- }
478
- return new SoapVar($payment, SOAP_ENC_OBJECT, paylineSDK::soap_payment, paylineSDK::PAYLINE_NAMESPACE);
479
- }
480
-
481
- /**
482
- * function order
483
- * @params : $array : array. the array keys are listed in pl_order CLASS.
484
- * @return : SoapVar : object
485
- * @description : build pl_order instance from $array and make SoapVar object for order.
486
- **/
487
- protected function order($array) {
488
- $order = new pl_order();
489
- if($array && is_array($array)){
490
- foreach($array as $k=>$v){
491
- if(array_key_exists($k, $order)&&(strlen($v))){
492
- $order->$k = $v;
493
- }
494
- }
495
- }
496
- $allDetails = array();
497
- // insert orderDetails
498
- $order->details = $this->items;
499
- return new SoapVar($order, SOAP_ENC_OBJECT, paylineSDK::soap_order, paylineSDK::PAYLINE_NAMESPACE);
500
- }
501
-
502
- /**
503
- * function address
504
- * @params : $address : array. the array keys are listed in pl_address CLASS.
505
- * @return : SoapVar : object
506
- * @description : build pl_address instance from $array and make SoapVar object for address.
507
- **/
508
- protected function address($array) {
509
- $address = new pl_address();
510
- if($array && is_array($array)){
511
- foreach($array as $k=>$v){
512
- if(array_key_exists($k, $address)&&(strlen($v)))$address->$k = $v;
513
- }
514
- }
515
- return new SoapVar($address, SOAP_ENC_OBJECT, paylineSDK::soap_address, paylineSDK::PAYLINE_NAMESPACE);
516
- }
517
-
518
- /**
519
- * function buyer
520
- * @params : $array : array. the array keys are listed in pl_buyer CLASS.
521
- * @params : $shippingAdress : array. the array keys are listed in pl_address CLASS.
522
- * @params : $billingAddress : array. the array keys are listed in pl_address CLASS.
523
- * @return : SoapVar : object
524
- * @description : build pl_buyer instance from $array and $address and make SoapVar object for buyer.
525
- **/
526
- protected function buyer($array,$shippingAdress,$billingAddress) {
527
- $buyer = new pl_buyer();
528
- if($array && is_array($array)){
529
- foreach($array as $k=>$v){
530
- if(array_key_exists($k, $buyer)&&(strlen($v)))$buyer->$k = $v;
531
- }
532
- }
533
- $buyer->shippingAdress = $this->address($shippingAdress);
534
- $buyer->billingAddress = $this->address($billingAddress);
535
- return new SoapVar($buyer, SOAP_ENC_OBJECT, paylineSDK::soap_buyer, paylineSDK::PAYLINE_NAMESPACE);
536
- }
537
-
538
- /**
539
- * function owner
540
- * @params : $array : array. the array keys are listed in pl_buyer CLASS.
541
- * @params : $shippingAdress : array. the array keys are listed in pl_address CLASS.
542
- * @params : $billingAddress : array. the array keys are listed in pl_address CLASS.
543
- * @return : SoapVar : object
544
- * @description : build pl_buyer instance from $array and $address and make SoapVar object for buyer.
545
- **/
546
- protected function owner($array,$Address) {
547
- if($array != null){
548
- $owner = new pl_owner();
549
- if($array && is_array($array)){
550
- foreach($array as $k=>$v){
551
- if(array_key_exists($k, $owner)&&(strlen($v)))$owner->$k = $v;
552
- }
553
- }
554
- $owner->billingAddress = $this->address($Address);
555
- return new SoapVar($owner, SOAP_ENC_OBJECT, paylineSDK::soap_owner, paylineSDK::PAYLINE_NAMESPACE);
556
- }else{
557
- return null;
558
- }
559
- }
560
-
561
- /**
562
- * function contracts
563
- * @params : $contracts : array. array of contracts
564
- * @return : $contracts : array. the same as params if exist, or an array with default contract defined in
565
- * configuration
566
- * @description : Add datas to contract array
567
- **/
568
- protected function contracts($contracts) {
569
- if($contracts && is_array($contracts)){
570
- return $contracts;
571
- }
572
- return explode(';',(string)Mage::helper('payline')->contractNumberList);
573
- }
574
-
575
- /**
576
- * function secondContracts
577
- * @params : $secondContracts : array. array of contracts
578
- * @return : $secondContracts : array. the same as params if exist, null otherwise
579
- * @description : Add datas to contract array
580
- **/
581
- protected function secondContracts($secondContracts) {
582
- if($secondContracts && is_array($secondContracts)){
583
- return $secondContracts;
584
- }
585
- return null;
586
- }
587
-
588
- /**
589
- * function authentification 3Dsecure
590
- * @params : $array : array. the array keys are listed in pl_card CLASS.
591
- * @return : SoapVar : object
592
- * @description : build pl_authentication3DSecure instance from $array and make SoapVar object for authentication3DSecure.
593
- **/
594
- protected function authentication3DSecure($array) {
595
- $authentication3DSecure = new pl_authentication3DSecure($array);
596
- if($array && is_array($array)){
597
- foreach($array as $k=>$v){
598
- if(array_key_exists($k, $authentication3DSecure)&&(strlen($v))){
599
- $authentication3DSecure->$k = $v;
600
- }
601
- }
602
- }
603
- return new SoapVar($authentication3DSecure, SOAP_ENC_OBJECT, paylineSDK::soap_authentication3DSecure, paylineSDK::PAYLINE_NAMESPACE);
604
- }
605
-
606
- /**
607
- * function authorization
608
- * @params : $array : array. the array keys are listed in pl_card CLASS.
609
- * @return : SoapVar : object
610
- * @description : build pl_authentication3DSecure instance from $array and make SoapVar object for authentication3DSecure.
611
- **/
612
- protected function authorization($array) {
613
- $authorization = new pl_authorization($array);
614
- if($array && is_array($array)){
615
- foreach($array as $k=>$v){
616
- if(array_key_exists($k, $authorization)&&(strlen($v))){
617
- $authorization->$k = $v;
618
- }
619
- }
620
- }
621
- return new SoapVar($authorization, SOAP_ENC_OBJECT, paylineSDK::soap_authorization, paylineSDK::PAYLINE_NAMESPACE);
622
- }
623
-
624
- /**
625
- * function card
626
- * @params : $array : array. the array keys are listed in pl_card CLASS.
627
- * @return : SoapVar : object
628
- * @description : build pl_card instance from $array and make SoapVar object for card.
629
- **/
630
- protected function card($array) {
631
- $card = new pl_card($array['type']);
632
- if($array && is_array($array)){
633
- foreach($array as $k=>$v){
634
- if(array_key_exists($k, $card)&&(strlen($v))){
635
- $card->$k = $v;
636
- }
637
- }
638
- }
639
- return new SoapVar($card, SOAP_ENC_OBJECT, paylineSDK::soap_card, paylineSDK::PAYLINE_NAMESPACE);
640
- }
641
-
642
-
643
-
644
- /**
645
- * function bankAccountData
646
- * @params : $array : array. the array keys are listed in pl_bankAccountData CLASS.
647
- * @return : SoapVar : object
648
- * @description : build pl_bankAccountData instance from $array and make SoapVar object for bankAccountData.
649
- **/
650
- protected function bankAccountData($array) {
651
- $bankAccountData = new pl_bankAccountData($array);
652
- if($array && is_array($array)){
653
- foreach($array as $k=>$v){
654
- if(array_key_exists($k, $bankAccountData)&&(strlen($v))){
655
- $bankAccountData->$k = $v;
656
- }
657
- }
658
- }
659
- return new SoapVar(null, SOAP_ENC_OBJECT, paylineSDK::soap_bankAccountData, paylineSDK::PAYLINE_NAMESPACE);
660
- }
661
-
662
- /**
663
- * function cheque
664
- * @params : $array : array. the array keys are listed in pl_cheque CLASS.
665
- * @return : SoapVar : object
666
- * @description : build pl_authentication3DSecure instance from $array and make SoapVar object for cheque.
667
- **/
668
- protected function cheque($array) {
669
- $cheque = new pl_cheque($array);
670
- if($array && is_array($array)){
671
- foreach($array as $k=>$v){
672
- if(array_key_exists($k, $cheque)&&(strlen($v))){
673
- $cheque->$k = $v;
674
- }
675
- }
676
- }
677
- return new SoapVar($cheque, SOAP_ENC_OBJECT, paylineSDK::soap_cheque, paylineSDK::PAYLINE_NAMESPACE);
678
- }
679
-
680
- /****************************************************/
681
- // WALLET //
682
- /****************************************************/
683
-
684
- /**
685
- * function wallet
686
- * @params : array : array. the array keys are listed in pl_wallet CLASS.
687
- * @params : address : array. the array keys are listed in pl_address CLASS.
688
- * @params : card : array. the array keys are listed in pl_card CLASS.
689
- * @return : wallet: pl_wallet Object.
690
- * @description : build a wallet object.
691
- **/
692
- protected function wallet($array,$address,$card) {
693
- $wallet = new pl_wallet();
694
- if($array && is_array($array)){
695
- foreach($array as $k=>$v){
696
- if(array_key_exists($k, $wallet)&&(strlen($v)))$wallet->$k = $v;
697
- }
698
- }
699
-
700
- $wallet->shippingAddress = $this->address($address);
701
- $wallet->card = $this->card($card);
702
-
703
- return $wallet;
704
- }
705
-
706
- /**
707
- * function recurring
708
- * @params : array : array. the array keys are listed in pl_recurring CLASS.
709
- * @return : recurring object.
710
- * @description : build a recurring object.
711
- **/
712
- protected function recurring($array) {
713
- if($array){
714
- $recurring = new pl_recurring();
715
- if($array && is_array($array)){
716
- foreach($array as $k=>$v){
717
- if(array_key_exists($k, $recurring)&&(strlen($v)))$recurring->$k = $v;
718
- }
719
- }
720
- return $recurring;
721
- }
722
- else return null;
723
- }
724
-
725
- /**
726
- * function setItem
727
- * @params : $item : array. the array keys are listed in PL_ORDERDETAIL CLASS.
728
- * @description : Make $item SoapVar object and insert in items array
729
- **/
730
- public function setItem($item) {
731
- $orderDetail = new pl_orderDetail();
732
- if($item && is_array($item)){
733
- foreach($item as $k=>$v){
734
- if(array_key_exists($k, $orderDetail)&&(strlen($v)))$orderDetail->$k = $v;
735
- }
736
- }
737
- $this->items[] = new SoapVar($orderDetail, SOAP_ENC_OBJECT, paylineSDK::soap_orderDetail, paylineSDK::PAYLINE_NAMESPACE);
738
- }
739
-
740
- /**
741
- * function setPrivate
742
- * @params : $private : array. the array keys are listed in PRIVATE CLASS.
743
- * @description : Make $setPrivate SoapVar object and insert in privates array
744
- **/
745
- public function setPrivate($array) {
746
- $private = new pl_privateData();
747
- if($array && is_array($array)){
748
- foreach($array as $k=>$v){
749
- if(array_key_exists($k, $private)&&(strlen($v)))$private->$k = $v;
750
- }
751
- }
752
- $this->privates[] = new SoapVar($private, SOAP_ENC_OBJECT, paylineSDK::soap_privateData, paylineSDK::PAYLINE_NAMESPACE);
753
- }
754
-
755
- /**
756
- * function setWalletIdList
757
- * @params : sting : string if wallet id separated by ';'.
758
- * @return :
759
- * @description : make an array of wallet id .
760
- **/
761
- public function setWalletIdList($walletIdList) {
762
- if ($walletIdList) $this->walletIdList = explode(";", $walletIdList);
763
- if(empty($walletIdList))$this->walletIdList = array(0) ;
764
- }
765
-
766
- private function maskAccessKey($accessKey){
767
- $maskedAccessKey = substr($accessKey,0,2);
768
- $maskedAccessKey .= substr("********************",0,strlen($accessKey)-4);
769
- $maskedAccessKey .= substr($accessKey,-2);
770
- return $maskedAccessKey;
771
- }
772
-
773
- private function IsSwitchingEnabled($Method){
774
- $Enabled = false;
775
- $ListeWS = (string)Mage::helper('payline')->contractNumber;
776
- $ArrayWS = explode(",",$ListeWS);
777
- foreach($ArrayWS as $Key => $Value){
778
- if($Method === $Value){
779
- $Enabled = true;
780
- }
781
- }
782
- return $Enabled;
783
- }
784
-
785
- // Paramétrage Switch Primary
786
- private function SwitchToPrimary(){
787
- $this->NMAX_TENTATIVE = (string)Mage::helper('payline')->primaryMaxfailRetry;
788
- $this->CALL_TIMEOUT = (string)Mage::helper('payline')->primaryCallTimeout;
789
- $this->RETRY_TIMEOUT = (string)Mage::helper('payline')->primaryReplayTimer;
790
- $this->PRIMARY = true;
791
- $this->CURRENT_NUMBER_CALL = 0;
792
- $this->header_soap['connection_timeout'] = $this->CALL_TIMEOUT;
793
- if($this->production){
794
- $this->webServicesEndpoint = paylineSDK::PROD_ENDPOINT;
795
- }else{
796
- $this->webServicesEndpoint = paylineSDK::HOMO_ENDPOINT;
797
- }
798
- }
799
-
800
- // Paramétrage Switch Secondary
801
- private function SwitchToSecondary(){
802
- $this->NMAX_TENTATIVE = (string)Mage::helper('payline')->secondaryMaxfailRetry;
803
- $this->CALL_TIMEOUT = (string)Mage::helper('payline')->secondaryCallTimeout;
804
- $this->RETRY_TIMEOUT = (string)Mage::helper('payline')->secondaryReplayTimer;
805
- $this->PRIMARY = false;
806
- $this->CURRENT_NUMBER_CALL = 0;
807
- $this->header_soap['connection_timeout'] = $this->CALL_TIMEOUT;
808
- if($this->production){
809
- $this->webServicesEndpoint = paylineSDK::PROD_ENDPOINT_HD;
810
- }else{
811
- $this->webServicesEndpoint = paylineSDK::HOMO_ENDPOINT_HD;
812
- }
813
- }
814
-
815
- private function IsForceSwitch($Force){
816
- $bool = false;
817
- if(isset($Force) && !empty($Force)){
818
- $bool = true;
819
- }else{
820
- $bool = false;
821
- }
822
- return $bool;
823
- }
824
-
825
- private function CheckForSwitching(){
826
- $bool = false ;
827
- $ini_array = parse_ini_file((string)Mage::helper('payline')->ini_file);
828
- $TimeEndSwitch = $ini_array['TimeEndSwitch'];
829
- $CurrentTime = time();
830
- if(isset($TimeEndSwitch) && !empty($TimeEndSwitch)){
831
- if($TimeEndSwitch > $CurrentTime){
832
- $bool = true;
833
- return $bool;
834
- }else{
835
- $bool = false;
836
- return $bool;
837
- }
838
- }else{
839
- $bool = false;
840
- return $bool;
841
- }
842
- }
843
-
844
- private function CheckForError($response){
845
- $ErrCheck = false;
846
- $ErrList = (string)Mage::helper('payline')->paylineErrCode;
847
- $ArrayErr = explode(",",$ErrList);
848
- foreach($ArrayErr as $Key => $Value){
849
- if($response['result']['code'] === $Value){
850
- $ErrCheck = true;
851
- }
852
- }
853
- return $ErrCheck;
854
- }
855
-
856
- private function CheckForTokenError($response){
857
- $ErrCheck = false;
858
- $ErrList = (string)Mage::helper('payline')->paylineErrToken;
859
- $ArrayErr = explode(",",$ErrList);
860
- foreach($ArrayErr as $Key => $Value){
861
- if($response['result']['code'] === $Value){
862
- $ErrCheck = true;
863
- }
864
- }
865
- return $ErrCheck;
866
- }
867
-
868
- private function init_config($Method,$ForceSwitch,$ForceValue){
869
- if($this->IsSwitchingEnabled($Method)){
870
- if(isset($ForceSwitch) && $this->IsForceSwitch($ForceSwitch)){
871
- if(isset($ForceValue) && $ForceValue == "Primaire"){
872
- $this->SwitchToPrimary();
873
- }else if(isset($ForceValue) && $ForceValue == "Secondaire"){
874
- $this->SwitchToSecondary();
875
- }
876
- }else{
877
- if($this->CheckForSwitching()){
878
- $this->SwitchToSecondary();
879
- }else{
880
- $this->SwitchToPrimary();
881
- }
882
- }
883
- }else{
884
- if(isset($ForceSwitch) && $this->IsForceSwitch($ForceSwitch)){
885
- if(isset($ForceValue) && $ForceValue == "Primaire"){
886
- $this->SwitchToPrimary();
887
- }else if(isset($ForceValue) && $ForceValue == "Secondaire"){
888
- $this->SwitchToSecondary();
889
- }
890
- }else{
891
- $this->SwitchToPrimary();
892
- }
893
- }
894
- }
895
-
896
- private function CheckEndSwitch(){
897
- $bool = false ;
898
- $ini_array = parse_ini_file((string)Mage::helper('payline')->ini_file);
899
- $TimeEndSwitch = $ini_array['TimeEndSwitch'];
900
- $EndSwitch = $ini_array['EndSwitchTry'];
901
- $CurrentTime = time();
902
- if(isset($TimeEndSwitch) && !empty($TimeEndSwitch)){
903
- if(($CurrentTime > $TimeEndSwitch) && $EndSwitch == 1 && $this->PRIMARY){
904
- $bool = true;
905
- }
906
- }
907
- return $bool;
908
- }
909
-
910
-
911
- private function SetCallSocketTimeOut(){
912
- $this->DEFAULT_SOCKET_TIMEOUT = ini_get('default_socket_timeout');
913
- ini_set('default_socket_timeout', $this->CALL_TIMEOUT);
914
- }
915
-
916
- private function SetDefaultSocketTimeOut(){
917
- ini_set('default_socket_timeout', $this->DEFAULT_SOCKET_TIMEOUT);
918
- }
919
-
920
- private function VerifyIfAnotherWShasSwitch($Method){
921
- if($this->IsSwitchingEnabled($Method) && $this->CheckForSwitching() && $this->PRIMARY){
922
- $this->SwitchToSecondary();
923
- }
924
- }
925
- private function AddResponseSwitchingChain($Method,$response){
926
- if($this->IsSwitchingEnabled($Method)){
927
- $response['Switch']['Wsdl File'] = "$this->WSDL_DIRECT_SOAP";
928
- }
929
- return $response;
930
- }
931
-
932
- private function CheckIniValue($key,$value){
933
- $bool = false ;
934
- $ini_array = parse_ini_file((string)Mage::helper('payline')->ini_file);
935
- $EndSwitch = $ini_array[$key];
936
- if(isset($EndSwitch) && !empty($EndSwitch) && $EndSwitch == $value){
937
- $bool = true;
938
- }
939
-
940
- return $bool;
941
- }
942
-
943
- private function Switcher($DateDebut,$Method,$WS,$WSRequest,$WDSL){
944
- $DateFin = time();
945
- $this->SetDefaultSocketTimeOut();
946
- $response = array();
947
- while($this->NMAX_TENTATIVE >= $this->CURRENT_NUMBER_CALL){
948
- if($this->PRIMARY){
949
- if(($this->RETRY_TIMEOUT - ($DateDebut-$DateFin)) >= 0){
950
- sleep(($this->RETRY_TIMEOUT - ($DateDebut-$DateFin)));
951
- $DateDebut = 0;
952
- $DateFin = 0;
953
- }
954
- }else{
955
- sleep($this->RETRY_TIMEOUT);
956
- }
957
- try{
958
- $this->SetCallSocketTimeOut();
959
- $this->VerifyIfAnotherWShasSwitch($Method);
960
- $client = new SoapClient($WDSL, $this->header_soap);
961
- $DateDebut = time();
962
- $WSresponse = $this->WSCall("$WS",$WSRequest,$client);
963
- $this->SetDefaultSocketTimeOut();
964
- $response = util::responseToArray($WSresponse);
965
- $response = $this->AddResponseSwitchingChain($Method,$response);
966
- if($this->CheckForError($response)){
967
- throw new Exception('Technical Error : '+$response['result']['code']+' : '+$response['result']['shortMessage']+' : '+$response['result']['longMessage']);
968
- }else{
969
- if($this->CheckEndSwitch() && $this->IsSwitchingEnabled($Method) && !(isset($array['Switch']['Forced']) && $this->IsForceSwitch($array['Switch']['Forced']))){
970
- if(!$this->CheckIniValue('EndSwitchTry',0)){
971
- $jIniFileModifier = new jIniFileModifier((string)Mage::helper('payline')->ini_file);
972
- $jIniFileModifier->setValue('EndSwitchTry', 0, 'Switcher', null);
973
- $jIniFileModifier->save();
974
- }
975
- }
976
- return $response;
977
- }
978
- }catch (Exception $e){
979
- $DateFin = time();
980
- $this->CURRENT_NUMBER_CALL++;
981
- if(!($this->NMAX_TENTATIVE >= $this->CURRENT_NUMBER_CALL) && $this->PRIMARY){
982
- $this->SwitchToSecondary();
983
- $this->CURRENT_NUMBER_CALL = 0;
984
- $jIniFileModifier = new jIniFileModifier((string)Mage::helper('payline')->ini_file);
985
- $jIniFileModifier->setValue('TimeEndSwitch', time()+((int)Mage::helper('payline')->ini_file), 'Switcher', null);
986
- $jIniFileModifier->save();
987
- if(!$this->CheckIniValue('EndSwitchTry',1)){
988
- $jIniFileModifier = new jIniFileModifier((string)Mage::helper('payline')->ini_file);
989
- $jIniFileModifier->setValue('EndSwitchTry', 1, 'Switcher', null);
990
- $jIniFileModifier->save();
991
- }
992
- }
993
-
994
- }
995
-
996
- }
997
- return $response;
998
- }
999
-
1000
- // Fonction qui permet l'utilisation de la plateforme HD et qui corrige le bug de formatage des données pour le WS getCards
1001
- private function SwitcherFormatResponse($DateDebut,$Method,$WS,$WSRequest,$WDSL){
1002
- $DateFin = time();
1003
- $this->SetDefaultSocketTimeOut();
1004
- $response = array();
1005
- while($this->NMAX_TENTATIVE >= $this->CURRENT_NUMBER_CALL){
1006
- if($this->PRIMARY){
1007
- if(($this->RETRY_TIMEOUT - ($DateDebut-$DateFin)) >= 0){
1008
- sleep(($this->RETRY_TIMEOUT - ($DateDebut-$DateFin)));
1009
- $DateDebut = 0;
1010
- $DateFin = 0;
1011
- }
1012
- }else{
1013
- sleep($this->RETRY_TIMEOUT);
1014
- }
1015
- try{
1016
- $this->SetCallSocketTimeOut();
1017
- $this->VerifyIfAnotherWShasSwitch($Method);
1018
- $client = new SoapClient($WDSL, $this->header_soap);
1019
- $DateDebut = time();
1020
- $WSresponse = $this->WSCall("$WS",$WSRequest,$client);
1021
- $this->SetDefaultSocketTimeOut();
1022
- $response = util::responseToArrayForGetCards($WSresponse);
1023
- $response = $this->AddResponseSwitchingChain($Method,$response);
1024
- if($this->CheckForError($response)){
1025
- throw new Exception('Technical Error : '+$response['result']['code']+' : '+$response['result']['shortMessage']+' : '+$response['result']['longMessage']);
1026
- }else{
1027
- if($this->CheckEndSwitch() && $this->IsSwitchingEnabled($Method) && !(isset($array['Switch']['Forced']) && $this->IsForceSwitch($array['Switch']['Forced']))){
1028
- if(!$this->CheckIniValue('EndSwitchTry',0)){
1029
- $jIniFileModifier = new jIniFileModifier((string)Mage::helper('payline')->ini_file);
1030
- $jIniFileModifier->setValue('EndSwitchTry', 0, 'Switcher', null);
1031
- $jIniFileModifier->save();
1032
- }
1033
- }
1034
- return $response;
1035
- }
1036
- }catch (Exception $e){
1037
- $DateFin = time();
1038
- $this->CURRENT_NUMBER_CALL++;
1039
- if(!($this->NMAX_TENTATIVE >= $this->CURRENT_NUMBER_CALL) && $this->PRIMARY){
1040
- $this->SwitchToSecondary();
1041
- $this->CURRENT_NUMBER_CALL = 0;
1042
- $jIniFileModifier = new jIniFileModifier((string)Mage::helper('payline')->ini_file);
1043
- $jIniFileModifier->setValue('TimeEndSwitch', time()+((int)Mage::helper('payline')->ini_file), 'Switcher', null);
1044
- $jIniFileModifier->save();
1045
- if(!$this->CheckIniValue('EndSwitchTry',1)){
1046
- $jIniFileModifier = new jIniFileModifier((string)Mage::helper('payline')->ini_file);
1047
- $jIniFileModifier->setValue('EndSwitchTry', 1, 'Switcher', null);
1048
- $jIniFileModifier->save();
1049
- }
1050
- }
1051
- }
1052
- }
1053
- return $response;
1054
- }
1055
-
1056
- private function WSCall($Method,$WSRequest,$client){
1057
- $response = null ;
1058
- switch ($Method) {
1059
- case "doWebPayment":
1060
- $response = $client->doWebPayment($WSRequest);
1061
- break;
1062
- case "doAuthorization":
1063
- $response = $client->doAuthorization($WSRequest);
1064
- break;
1065
- case "doCapture":
1066
- $response = $client->doCapture($WSRequest);
1067
- break;
1068
- case "doRefund":
1069
- $response = $client->doRefund($WSRequest);
1070
- break;
1071
- case "doCredit":
1072
- $response = $client->doCredit($WSRequest);
1073
- break;
1074
- case "verifyEnrollment":
1075
- $response = $client->verifyEnrollment($WSRequest);
1076
- break;
1077
- case "doDebit":
1078
- $response = $client->doDebit($WSRequest);
1079
- break;
1080
- case "doReset":
1081
- $response = $client->doReset($WSRequest);
1082
- break;
1083
- case "createWallet":
1084
- $response = $client->createWallet($WSRequest);
1085
- break;
1086
- case "getWallet":
1087
- $response = $client->getWallet($WSRequest);
1088
- break;
1089
- case "updateWallet":
1090
- $response = $client->updateWallet($WSRequest);
1091
- break;
1092
- case "createWebWallet":
1093
- $response = $client->createWebWallet($WSRequest);
1094
- break;
1095
- case "updateWebWallet":
1096
- $response = $client->updateWebWallet($WSRequest);
1097
- break;
1098
- case "disableWallet":
1099
- $response = $client->disableWallet($WSRequest);
1100
- break;
1101
- case "enableWallet":
1102
- $response = $client->enableWallet($WSRequest);
1103
- break;
1104
- case "doImmediateWalletPayment":
1105
- $response = $client->doImmediateWalletPayment($WSRequest);
1106
- break;
1107
- case "doScheduledWalletPayment":
1108
- $response = $client->doScheduledWalletPayment($WSRequest);
1109
- break;
1110
- case "doRecurrentWalletPayment":
1111
- $response = $client->doRecurrentWalletPayment($WSRequest);
1112
- break;
1113
- case "getPaymentRecord":
1114
- $response = $client->getPaymentRecord($WSRequest);
1115
- break;
1116
- case "disablePaymentRecord":
1117
- $response = $client->disablePaymentRecord($WSRequest);
1118
- break;
1119
- case "getTransactionDetails":
1120
- $response = $client->getTransactionDetails($WSRequest);
1121
- break;
1122
- case "transactionsSearch":
1123
- $response = $client->transactionsSearch($WSRequest);
1124
- break;
1125
- case "verifyAuthentication":
1126
- $response = $client->verifyAuthentication($WSRequest);
1127
- break;
1128
- case "getEncryptionKey":
1129
- $response = $client->getEncryptionKey($WSRequest);
1130
- break;
1131
- case "getCards":
1132
- $response = $client->getCards($WSRequest);
1133
- break;
1134
- case "doScoringCheque":
1135
- $response = $client->doScoringCheque($WSRequest);
1136
- break;
1137
- case "doReAuthorization":
1138
- $response = $client->doReAuthorization($WSRequest);
1139
- break;
1140
- }
1141
- return $response;
1142
- }
1143
-
1144
- private function TokenSwitch($token){
1145
- $Check = substr($token,0,1);
1146
- if($Check == (string)Mage::helper('payline')->primaryTokenPrefix){
1147
- $this->SwitchToPrimary();
1148
- }else if($Check == (string)Mage::helper('payline')->secondaryTokenPrefix){
1149
- $this->SwitchToSecondary();
1150
- }
1151
- }
1152
-
1153
- /**
1154
- * @method writeTrace
1155
- * @desc write a trace in Payline log file
1156
- * @param $trace : the string to add in the log file
1157
- */
1158
- public function writeTrace($trace){
1159
- if(!isset($this->paylineTrace)){
1160
- $this->paylineTrace = new Log(date('Y-m-d',time()).'.log');
1161
- }
1162
- $this->paylineTrace->write($trace);
1163
- }
1164
-
1165
- private function webServiceRequest($array,$WSRequest,$PaylineAPI,$Method){
1166
- try{
1167
- if(isset($array['Switch']['Forced'])){
1168
- $this->init_config($Method,$array['Switch']['Forced'],$array['Switch']['Choice']);
1169
- }else{
1170
- $this->init_config($Method,'','');
1171
- }
1172
- if($this->CheckEndSwitch() && $this->IsSwitchingEnabled($Method) && !(isset($array['Switch']['Forced']) && $this->IsForceSwitch($array['Switch']['Forced']))){
1173
- $this->NMAX_TENTATIVE = 1;
1174
- }
1175
- set_time_limit(0);
1176
- $this->SetCallSocketTimeOut();
1177
- $DateDebut = time();
1178
- $this->VerifyIfAnotherWShasSwitch($Method);
1179
- $client = new SoapClient(dirname(__FILE__).'/'.paylineSDK::WSDL, $this->header_soap);
1180
- $client->__setLocation ($this->webServicesEndpoint.$PaylineAPI);
1181
- $this->writeTrace("webServiceRequest($Method) - Location : ".$this->webServicesEndpoint.$PaylineAPI);
1182
- if(isset($array['version'])&& strlen($array['version'])) $this->version = $array['version'];
1183
- if(isset($array['media'])&& strlen($array['media'])) $this->media = $array['media'];
1184
-
1185
- switch($Method){
1186
- case 'createMerchant':
1187
- $WSresponse = $client->createMerchant($WSRequest);
1188
- break;
1189
- case 'createWallet':
1190
- $WSresponse = $client->createWallet($WSRequest);
1191
- break;
1192
- case 'createWebWallet':
1193
- $WSresponse = $client->createWebWallet($WSRequest);
1194
- break;
1195
- case 'disablePaymentRecord':
1196
- $WSresponse = $client->disablePaymentRecord($WSRequest);
1197
- break;
1198
- case 'disableWallet':
1199
- $WSresponse = $client->disableWallet($WSRequest);
1200
- break;
1201
- case 'doAuthorization':
1202
- $WSresponse = $client->doAuthorization($WSRequest);
1203
- break;
1204
- case 'doCapture':
1205
- $WSresponse = $client->doCapture($WSRequest);
1206
- break;
1207
- case 'doCredit':
1208
- $WSresponse = $client->doCredit($WSRequest);
1209
- break;
1210
- case 'doDebit':
1211
- $WSresponse = $client->doDebit($WSRequest);
1212
- break;
1213
- case 'doImmediateWalletPayment':
1214
- $WSresponse = $client->doImmediateWalletPayment($WSRequest);
1215
- break;
1216
- case 'doReAuthorization':
1217
- $WSresponse = $client->doReAuthorization($WSRequest);
1218
- break;
1219
- case 'doRecurrentWalletPayment':
1220
- $WSresponse = $client->doRecurrentWalletPayment($WSRequest);
1221
- break;
1222
- case 'doRefund':
1223
- $WSresponse = $client->doRefund($WSRequest);
1224
- break;
1225
- case 'doReset':
1226
- $WSresponse = $client->doReset($WSRequest);
1227
- break;
1228
- case 'doScheduledWalletPayment':
1229
- $WSresponse = $client->doScheduledWalletPayment($WSRequest);
1230
- break;
1231
- case 'doScoringCheque':
1232
- $WSresponse = $client->doScoringCheque($WSRequest);
1233
- break;
1234
- case 'doWebPayment':
1235
- $WSresponse = $client->doWebPayment($WSRequest);
1236
- break;
1237
- case 'enableWallet':
1238
- $WSresponse = $client->enableWallet($WSRequest);
1239
- break;
1240
- case 'getBalance':
1241
- $WSresponse = $client->getBalance($WSRequest);
1242
- break;
1243
- case 'getCards':
1244
- $WSresponse = $client->getCards($WSRequest);
1245
- break;
1246
- case 'getEncryptionKey':
1247
- $WSresponse = $client->getEncryptionKey($WSRequest);
1248
- break;
1249
- case 'getMerchantSettings':
1250
- $WSresponse = $client->getMerchantSettings($WSRequest);
1251
- break;
1252
- case 'getPaymentRecord':
1253
- $WSresponse = $client->getPaymentRecord($WSRequest);
1254
- break;
1255
- case 'getTransactionDetails':
1256
- $WSresponse = $client->getTransactionDetails($WSRequest);
1257
- break;
1258
- case 'getWallet':
1259
- $WSresponse = $client->getWallet($WSRequest);
1260
- break;
1261
- case 'getWebPaymentDetails':
1262
- $WSresponse = $client->getWebPaymentDetails($WSRequest);
1263
- break;
1264
- case 'getWebWallet':
1265
- $WSresponse = $client->getWebWallet($WSRequest);
1266
- break;
1267
- case 'manageWebWallet' :
1268
- $WSresponse = $client->manageWebWallet($WSRequest);
1269
- break;
1270
- case 'transactionsSearch':
1271
- $WSresponse = $client->transactionsSearch($WSRequest);
1272
- break;
1273
- case 'updateWallet':
1274
- $WSresponse = $client->updateWallet($WSRequest);
1275
- break;
1276
- case 'updateWebWallet':
1277
- $WSresponse = $client->updateWebWallet($WSRequest);
1278
- break;
1279
- case 'verifyAuthentication':
1280
- $WSresponse = $client->verifyAuthentication($WSRequest);
1281
- break;
1282
- case 'verifyEnrollment':
1283
- $WSresponse = $client->verifyEnrollment($WSRequest);
1284
- break;
1285
-
1286
- }
1287
-
1288
- $this->CURRENT_NUMBER_CALL++;
1289
- $this->SetDefaultSocketTimeOut();
1290
- if($Method == 'getCards'){
1291
- $response = util::responseToArrayForGetCards($WSresponse);
1292
-
1293
- }else{
1294
- $response = util::responseToArray($WSresponse);
1295
- }
1296
- $response = $this->AddResponseSwitchingChain($Method,$response);
1297
-
1298
- if($this->CheckForError($response)){
1299
- throw new Exception('Technical Error : '+$response['result']['code']+' : '+$response['result']['shortMessage']+' : '+$response['result']['longMessage']);
1300
- }else{
1301
- if($this->CheckEndSwitch() && $this->IsSwitchingEnabled($Method) && !(isset($array['Switch']['Forced']) && $this->IsForceSwitch($array['Switch']['Forced']))){
1302
- if(!$this->CheckIniValue('EndSwitchTry',0)){
1303
- $jIniFileModifier = new jIniFileModifier((string)Mage::helper('payline')->ini_file);
1304
- $jIniFileModifier->setValue('EndSwitchTry', 0, 'Switcher', null);
1305
- $jIniFileModifier->save();
1306
- }
1307
- }
1308
- $this->writeTrace("response return (code ".$response['result']['code'].")");
1309
- return $response;
1310
- }
1311
- }catch ( Exception $e ) {
1312
- $this->writeTrace("Exception : ".$e->getMessage());
1313
- if($this->IsSwitchingEnabled($Method) && !(isset($array['Switch']['Forced']) && $this->IsForceSwitch($array['Switch']['Forced']))){
1314
- $WS = $Method;
1315
- return $this->Switcher($DateDebut,$Method,$WS,$WSRequest,$this->WSDL_DIRECT_SOAP);
1316
- }
1317
- return $e->getMessage();
1318
- }
1319
- }
1320
-
1321
- public function createWallet($array){
1322
- if(!isset($array['walletContracts'])||!strlen($array['walletContracts'][0]))$array['walletContracts'] = '';
1323
- $WSRequest = array (
1324
- 'version' => $array['version'], // modified by smile
1325
- 'contractNumber' => $array['contractNumber'],
1326
- 'wallet' => $this->wallet($array['wallet'],$array['address'],$array['card']),
1327
- 'buyer' => $this->buyer($array['buyer'],$array['billingAddress'],$array['shippingAddress']),
1328
- 'owner' => $this->owner($array['owner'],$array['ownerAddress']),
1329
- 'privateDataList' => $this->privates,
1330
- 'authentication3DSecure' =>$this->authentication3DSecure($array['3DSecure']),
1331
- 'media' => $this->media,
1332
- 'contractNumberWalletList' => $this->secondContracts($array['walletContracts'])
1333
- );
1334
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'createWallet');
1335
- }
1336
-
1337
- public function createWebWallet($array){
1338
- if(isset($array['customPaymentPageCode'])&& strlen($array['customPaymentPageCode'])) $this->customPaymentPageCode = $array['customPaymentPageCode'];
1339
- if(isset($array['cancelURL'])&& strlen($array['cancelURL'])) $this->cancelURL = $array['cancelURL'];
1340
- if(isset($array['notificationURL']) && strlen($array['notificationURL'])) $this->notificationURL = $array['notificationURL'];
1341
- if(isset($array['returnURL'])&& strlen($array['returnURL'])) $this->returnURL = $array['returnURL'];
1342
- if(isset($array['customPaymentTemplateURL'])&& strlen($array['customPaymentTemplateURL'])) $this->customPaymentTemplateURL = $array['customPaymentTemplateURL'];
1343
- if(isset($array['customPaymentPageCode'])&& strlen($array['customPaymentPageCode'])) $this->customPaymentPageCode = $array['customPaymentPageCode'];
1344
- if(isset($array['languageCode'])&& strlen($array['languageCode'])) $this->languageCode = $array['languageCode'];
1345
- if(isset($array['securityMode'])&& strlen($array['securityMode'])) $this->securityMode = $array['securityMode'];
1346
- if(!isset($array['contracts'])||!strlen($array['contracts'][0]))$array['contracts'] = '';
1347
- if(!isset($array['walletContracts'])||!strlen($array['walletContracts'][0]))$array['walletContracts'] = '';
1348
- $WSRequest = array (
1349
- 'version' => $array['version'], // modified by smile
1350
- 'contractNumber' => $array['contractNumber'],
1351
- 'selectedContractList' => $this->contracts($array['contracts']),
1352
- 'updatePersonalDetails' => $array['updatePersonalDetails'],
1353
- 'buyer' => $this->buyer($array['buyer'],$array['billingAddress'],$array['shippingAddress']),
1354
- 'languageCode' => $this->languageCode,
1355
- 'customPaymentPageCode' => $this->customPaymentPageCode,
1356
- 'securityMode' => $this->securityMode,
1357
- 'returnURL' => $this->returnURL,
1358
- 'cancelURL' => $this->cancelURL,
1359
- 'notificationURL' => $this->notificationURL,
1360
- 'privateDataList' => $this->privates,
1361
- 'customPaymentTemplateURL' => $this->customPaymentTemplateURL,
1362
- 'contractNumberWalletList' => $this->secondContracts($array['walletContracts'])
1363
- );
1364
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::WEB_API,'createWebWallet');
1365
- }
1366
-
1367
- public function disablePaymentRecord($array){
1368
- $WSRequest = array (
1369
- 'contractNumber' => $array['contractNumber'],
1370
- 'paymentRecordId' => $array['paymentRecordId']
1371
- );
1372
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'disablePaymentRecord');
1373
- }
1374
-
1375
- public function disableWallet($array){
1376
- $WSRequest = array (
1377
- 'contractNumber' => $array['contractNumber'],
1378
- 'walletIdList' => $this->walletIdList,
1379
- 'cardInd' => $array['cardInd']
1380
- );
1381
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'disableWallet');
1382
- }
1383
-
1384
- public function doAuthorization($array){
1385
- if(!isset($array['buyer']))$array['buyer'] = null;
1386
- if(!isset($array['billingAddress']))$array['billingAddress'] = null;
1387
- if(!isset($array['shippingAddress']))$array['shippingAddress'] = null;
1388
- $WSRequest = array (
1389
- 'version' => $array['version'], // modified by smile
1390
- 'payment' => $this->payment($array['payment']),
1391
- 'card' => $this->card($array['card']),
1392
- 'order' => $this->order($array['order']),
1393
- 'buyer' => $this->buyer($array['buyer'],$array['billingAddress'],$array['shippingAddress']),
1394
- 'privateDataList' => $this->privates,
1395
- 'authentication3DSecure' =>$this->authentication3DSecure($array['3DSecure']),
1396
- 'bankAccountData' => $this->bankAccountData($array['BankAccountData']),
1397
- 'media' => $this->media
1398
- );
1399
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'doAuthorization');
1400
- }
1401
-
1402
- public function doCapture($array){
1403
- $WSRequest = array (
1404
- 'version' => $array['version'], // modified by smile
1405
- 'transactionID' =>$array['transactionID'],
1406
- 'payment' => $this->payment($array['payment']),
1407
- 'privateDataList' => $this->privates,
1408
- 'sequenceNumber'=>$array['sequenceNumber'],
1409
- 'media' => $this->media
1410
- );
1411
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'doCapture');
1412
- }
1413
-
1414
- public function doCredit($array){
1415
- if(!isset($array['buyer']))$array['buyer'] = null;
1416
- if(!isset($array['billingAddress']))$array['billingAddress'] = null;
1417
- if(!isset($array['shippingAddress']))$array['shippingAddress'] = null;
1418
- $WSRequest = array (
1419
- 'version' => $array['version'], // modified by smile
1420
- 'payment' => $this->payment($array['payment']),
1421
- 'card' => $this->card($array['card']),
1422
- 'buyer' => $this->buyer($array['buyer'],$array['billingAddress'],$array['shippingAddress']),
1423
- 'privateDataList' => $this->privates,
1424
- 'order' => $this->order($array['order']),
1425
- 'comment' =>$array['comment'],
1426
- 'media' => $this->media
1427
- );
1428
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'doCredit');
1429
- }
1430
-
1431
- public function doDebit($array){
1432
- if(!isset($array['buyer']))$array['buyer'] = null;
1433
- if(!isset($array['billingAddress']))$array['billingAddress'] = null;
1434
- if(!isset($array['shippingAddress']))$array['shippingAddress'] = null;
1435
- $WSRequest = array (
1436
- 'version' => $array['version'], // modified by smile
1437
- 'payment' => $this->payment($array['payment']),
1438
- 'card' => $this->card($array['card']),
1439
- 'order' => $this->order($array['order']),
1440
- 'privateDataList' => $this->privates,
1441
- 'buyer' => $this->buyer($array['buyer'],$array['billingAddress'],$array['shippingAddress']),
1442
- 'authentication3DSecure' =>$this->authentication3DSecure($array['3DSecure']),
1443
- 'authorization' =>$this->authorization($array['authorization']),
1444
- 'media' => $this->media
1445
- );
1446
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'doDebit');
1447
- }
1448
-
1449
- public function doImmediateWalletPayment($array){
1450
- $WSRequest = array (
1451
- 'version' => $array['version'], // modified by smile
1452
- 'payment' => $this->payment($array['payment']),
1453
- 'order' => $this->order($array['order']),
1454
- 'walletId' => $array['walletId'],
1455
- 'cardInd' => $array['cardInd'],
1456
- 'privateDataList' => $this->privates,
1457
- 'media' => $this->media,
1458
- );
1459
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'doImmediateWalletPayment');
1460
- }
1461
-
1462
- public function doReAuthorization($array){
1463
- $WSRequest = array (
1464
- 'version' => $array['version'], // modified by smile
1465
- 'transactionID' => $array['transactionID'],
1466
- 'payment' => $this->payment($array['payment']),
1467
- 'order' => $this->order($array['order']),
1468
- 'privateDataList' => $this->privates,
1469
- 'media' => $this->media
1470
- );
1471
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'doReAuthorization');
1472
- }
1473
-
1474
- public function doRecurrentWalletPayment($array){
1475
- $WSRequest = array (
1476
- 'version' => $array['version'], // modified by smile
1477
- 'payment' => $this->payment($array['payment']),
1478
- 'orderRef' => $array['orderRef'],
1479
- 'orderDate' => $array['orderDate'],
1480
- 'scheduledDate' => $array['scheduled'],
1481
- 'walletId' => $array['walletId'],
1482
- 'cardInd' => $array['cardInd'],
1483
- 'recurring' => $this->recurring($array['recurring']),
1484
- 'privateDataList' => $this->privates,
1485
- 'order' => $this->order($array['order']),
1486
- 'media' => $this->media
1487
- );
1488
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'doRecurrentWalletPayment');
1489
- }
1490
-
1491
- public function doRefund($array){
1492
- $WSRequest = array (
1493
- 'version' => $array['version'], // modified by smile
1494
- 'transactionID' =>$array['transactionID'],
1495
- 'payment' =>$this->payment($array['payment']),
1496
- 'comment' =>$array['comment'],
1497
- 'privateDataList' => $this->privates,
1498
- 'sequenceNumber'=>$array['sequenceNumber'],
1499
- 'media' => $this->media
1500
- );
1501
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'doRefund');
1502
- }
1503
-
1504
- public function doReset($array){
1505
- $WSRequest = array (
1506
- 'version' => $array['version'], // modified by smile
1507
- 'transactionID' => $array['transactionID'],
1508
- 'comment' => $array['comment'],
1509
- 'media' => $this->media
1510
- );
1511
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'doReset');
1512
- }
1513
-
1514
- public function doScheduledWalletPayment($array){
1515
- $WSRequest = array (
1516
- 'version' => $array['version'], // modified by smile
1517
- 'payment' => $this->payment($array['payment']),
1518
- 'orderRef' => $array['orderRef'],
1519
- 'orderDate' => $array['orderDate'],
1520
- 'scheduledDate' => $array['scheduled'],
1521
- 'walletId' => $array['walletId'],
1522
- 'cardInd' => $array['cardInd'],
1523
- 'order' => $this->order($array['order']),
1524
- 'privateDataList' => $this->privates,
1525
- 'media' => $this->media
1526
- );
1527
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'doScheduledWalletPayment');
1528
- }
1529
-
1530
- public function doScoringCheque($array){
1531
- $WSRequest = array (
1532
- 'version' => $array['version'], // modified by smile
1533
- 'payment' => $this->payment($array['payment']),
1534
- 'cheque' => $this->cheque($array['cheque']),
1535
- 'order' => $this->order($array['order']),
1536
- 'privateDataList' => $this->privates,
1537
- 'media' => $this->media
1538
- );
1539
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'doScoringCheque');
1540
- }
1541
-
1542
- public function doWebPayment($array){
1543
- if(isset($array['cancelURL'])&& strlen($array['cancelURL'])) $this->cancelURL = $array['cancelURL'];
1544
- if(isset($array['notificationURL']) && strlen($array['notificationURL'])) $this->notificationURL = $array['notificationURL'];
1545
- if(isset($array['returnURL'])&& strlen($array['returnURL'])) $this->returnURL = $array['returnURL'];
1546
- if(isset($array['customPaymentTemplateURL'])&& strlen($array['customPaymentTemplateURL'])) $this->customPaymentTemplateURL = $array['customPaymentTemplateURL'];
1547
- if(isset($array['customPaymentPageCode'])&& strlen($array['customPaymentPageCode'])) $this->customPaymentPageCode = $array['customPaymentPageCode'];
1548
- if(isset($array['languageCode'])&& strlen($array['languageCode'])) $this->languageCode = $array['languageCode'];
1549
- if(isset($array['securityMode'])&& strlen($array['securityMode'])) $this->securityMode = $array['securityMode'];
1550
- if(!isset($array['payment']))$array['payment'] = null;
1551
- if(!isset($array['contracts'])||!strlen($array['contracts'][0]))$array['contracts'] = '';
1552
- if(!isset($array['secondContracts'])||!strlen($array['secondContracts'][0]))$array['secondContracts'] = '';
1553
- if(!isset($array['walletContracts'])||!strlen($array['walletContracts'][0]))$array['walletContracts'] = '';
1554
- if(!isset($array['buyer']))$array['buyer'] = null;
1555
- if(!isset($array['billingAddress']))$array['billingAddress'] = null;
1556
- if(!isset($array['shippingAddress']))$array['shippingAddress'] = null;
1557
- if(!isset($array['recurring']))$array['recurring'] = null;
1558
- $WSRequest = array (
1559
- 'version' => $array['version'], // modified by smile
1560
- 'payment' => $this->payment($array['payment']),
1561
- 'returnURL' => $this->returnURL,
1562
- 'cancelURL' => $this->cancelURL,
1563
- 'order' => $this->order($array['order']),
1564
- 'notificationURL' => $this->notificationURL,
1565
- 'customPaymentTemplateURL' => $this->customPaymentTemplateURL,
1566
- 'selectedContractList' => $this->contracts($array['contracts']),
1567
- 'secondSelectedContractList' => $this->secondContracts($array['secondContracts']),
1568
- 'privateDataList' => $this->privates,
1569
- 'languageCode' => $this->languageCode,
1570
- 'customPaymentPageCode' => $this->customPaymentPageCode,
1571
- 'buyer' => $this->buyer($array['buyer'],$array['billingAddress'],$array['shippingAddress']),
1572
- 'securityMode' => $this->securityMode,
1573
- 'contractNumberWalletList' => $this->secondContracts($array['walletContracts'])
1574
- );
1575
-
1576
- if(isset($array['payment']['mode'])){
1577
- if(($array['payment']['mode'] == "REC") || ($array['payment']['mode'] == "NX")) {
1578
- $WSRequest['recurring'] = $this->recurring($array['recurring']);
1579
- }
1580
- }
1581
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::WEB_API,'doWebPayment');
1582
- }
1583
-
1584
- public function enableWallet($array){
1585
- $WSRequest = array (
1586
- 'contractNumber' => $array['contractNumber'],
1587
- 'walletId' => $array['walletId'],
1588
- 'cardInd' => $array['cardInd']
1589
- );
1590
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'enableWallet');
1591
- }
1592
-
1593
- public function getBalance($array){
1594
- $WSRequest = array(
1595
- 'contractNumber' => $array['contractNumber'],
1596
- 'cardID' => $array['cardID']
1597
- );
1598
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'getBalance');
1599
- }
1600
-
1601
- public function getCards($array){
1602
- $WSRequest = array (
1603
- 'contractNumber' => $array['contractNumber'],
1604
- 'walletId' => $array['walletId'],
1605
- 'cardInd' => $array['cardInd']
1606
- );
1607
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'getCards');
1608
- }
1609
-
1610
- public function getEncryptionKey($array){
1611
- $WSRequest = array();
1612
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'getEncryptionKey');
1613
- }
1614
-
1615
- public function getMerchantSettings($array){
1616
- $WSRequest = array(
1617
- 'version' => $array['version'] // modified by smile
1618
- );
1619
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'getMerchantSettings');
1620
- }
1621
-
1622
- public function getPaymentRecord($array){
1623
- $WSRequest = array (
1624
- 'version' => $array['version'], // modified by smile
1625
- 'contractNumber' => $array['contractNumber'],
1626
- 'paymentRecordId' => $array['paymentRecordId']
1627
- );
1628
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'getPaymentRecord');
1629
- }
1630
- public function getTransactionDetails($array){
1631
- $WSRequest = array (
1632
- 'version' => $array['version'], // modified by smile
1633
- 'transactionId' => $array['transactionId'],
1634
- 'orderRef' => $array['orderRef'],
1635
- 'startDate' => $array['startDate'],
1636
- 'endDate' => $array['endDate'],
1637
- 'transactionHistory' => $array['transactionHistory'],
1638
- 'archiveSearch' => $array['archiveSearch']
1639
- );
1640
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::EXTENDED_API,'getTransactionDetails');
1641
- }
1642
- public function getWallet($array){
1643
- $WSRequest = array (
1644
- 'version' => $array['version'], // modified by smile
1645
- 'contractNumber' => $array['contractNumber'],
1646
- 'walletId' => $array['walletId'],
1647
- 'cardInd' => $array['cardInd'],
1648
- 'media' => $this->media
1649
- );
1650
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'getWallet');
1651
- }
1652
-
1653
- public function getWebPaymentDetails($array){
1654
- $this->TokenSwitch($array['token']);
1655
- return $this->webServiceRequest($array,$array,paylineSDK::WEB_API,'getWebPaymentDetails');
1656
- }
1657
-
1658
- public function getWebWallet($array){
1659
- $this->TokenSwitch($array['token']);
1660
- return $this->webServiceRequest($array,$array,paylineSDK::WEB_API,'getWebWallet');
1661
- }
1662
-
1663
- public function manageWebWallet($array){
1664
- if(isset($array['cancelURL'])&& strlen($array['cancelURL'])) $this->cancelURL = $array['cancelURL'];
1665
- if(isset($array['notificationURL']) && strlen($array['notificationURL'])) $this->notificationURL = $array['notificationURL'];
1666
- if(isset($array['returnURL'])&& strlen($array['returnURL'])) $this->returnURL = $array['returnURL'];
1667
- if(!isset($array['buyer']))$array['buyer'] = null;
1668
- if(!isset($array['billingAddress']))$array['billingAddress'] = null;
1669
- if(!isset($array['shippingAddress']))$array['shippingAddress'] = null;
1670
- if(!isset($array['owner']))$array['owner'] = null;
1671
- if(!isset($array['ownerAddress']))$array['ownerAddress'] = null;
1672
- if(!isset($array['contracts'])||!strlen($array['contracts'][0]))$array['contracts'] = '';
1673
- if(!isset($array['walletContracts'])||!strlen($array['walletContracts'][0]))$array['walletContracts'] = '';
1674
- if(isset($array['customPaymentPageCode'])&& strlen($array['customPaymentPageCode'])) $this->customPaymentPageCode = $array['customPaymentPageCode'];
1675
- if(isset($array['customPaymentTemplateURL'])&& strlen($array['customPaymentTemplateURL'])) $this->customPaymentTemplateURL = $array['customPaymentTemplateURL'];
1676
- $WSRequest = array (
1677
- 'version' => $array['version'], // modified by smile
1678
- 'contractNumber' => $array['contractNumber'],
1679
- 'selectedContractList' => $this->contracts($array['contracts']),
1680
- 'updatePersonalDetails' => $array['updatePersonalDetails'],
1681
- 'buyer' => $this->buyer($array['buyer'],$array['billingAddress'],$array['shippingAddress']),
1682
- 'owner' => $this->owner($array['owner'],$array['ownerAddress']),
1683
- 'languageCode' => $array['languageCode'],
1684
- 'customPaymentPageCode' => $array['customPaymentPageCode'],
1685
- 'securityMode' => $array['securityMode'],
1686
- 'returnURL' => $this->returnURL,
1687
- 'cancelURL' => $this->cancelURL,
1688
- 'notificationURL' => $this->notificationURL,
1689
- 'privateDataList' => $this->privates,
1690
- 'customPaymentTemplateURL' => $array['customPaymentTemplateURL'],
1691
- 'contractNumberWalletList' => $this->secondContracts($array['walletContracts'])
1692
- );
1693
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::WEB_API,'manageWebWallet');
1694
- }
1695
-
1696
- public function transactionsSearch($array){
1697
- $WSRequest = array (
1698
- 'version' => $array['version'], // modified by smile
1699
- 'transactionId' => $array['transactionId'],
1700
- 'orderRef' => $array['orderRef'],
1701
- 'startDate' => $array['startDate'],
1702
- 'endDate' => $array['endDate'],
1703
- 'contractNumber' => $array['contractNumber'],
1704
- 'authorizationNumber' => $array['authorizationNumber'],
1705
- 'returnCode' => $array['returnCode'],
1706
- 'paymentMean' => $array['paymentMean'],
1707
- 'transactionType' => $array['transactionType'],
1708
- 'name' => $array['name'],
1709
- 'firstName' => $array['firstName'],
1710
- 'email' => $array['email'],
1711
- 'cardNumber' => $array['cardNumber'],
1712
- 'currency' => $array['currency'],
1713
- 'minAmount' => $array['minAmount'],
1714
- 'maxAmount' => $array['maxAmount'],
1715
- 'walletId' => $array['walletId'],
1716
- 'sequenceNumber' => $array['sequenceNumber'],
1717
- 'token' => $array['token']
1718
- );
1719
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::EXTENDED_API,'transactionsSearch');
1720
- }
1721
-
1722
- public function updateWallet($array){
1723
- $WSRequest = array (
1724
- 'version' => $array['version'], // modified by smile
1725
- 'contractNumber' => $array['contractNumber'],
1726
- 'cardInd' => $array['cardInd'],
1727
- 'wallet' => $this->wallet($array['wallet'],$array['address'],$array['card']),
1728
- 'buyer' => $this->buyer($array['buyer'], $array['billingAddress'],$array['shippingAddress']),
1729
- 'owner' => $this->owner($array['owner'],$array['ownerAddress']),
1730
- 'privateDataList' => $this->privates,
1731
- 'authentication3DSecure' =>$this->authentication3DSecure($array['3DSecure']),
1732
- 'media' => $this->media,
1733
- 'contractNumberWalletList' => $this->secondContracts($array['walletContracts'])
1734
- );
1735
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'updateWallet');
1736
- }
1737
-
1738
- public function updateWebWallet($array){
1739
- if(isset($array['cancelURL'])&& strlen($array['cancelURL'])) $this->cancelURL = $array['cancelURL'];
1740
- if(isset($array['notificationURL']) && strlen($array['notificationURL'])) $this->notificationURL = $array['notificationURL'];
1741
- if(isset($array['returnURL'])&& strlen($array['returnURL'])) $this->returnURL = $array['returnURL'];
1742
- if(isset($array['customPaymentTemplateURL'])&& strlen($array['customPaymentTemplateURL'])) $this->customPaymentTemplateURL = $array['customPaymentTemplateURL'];
1743
- if(isset($array['customPaymentPageCode'])&& strlen($array['customPaymentPageCode'])) $this->customPaymentPageCode = $array['customPaymentPageCode'];
1744
- if(isset($array['languageCode'])&& strlen($array['languageCode'])) $this->languageCode = $array['languageCode'];
1745
- if(isset($array['securityMode'])&& strlen($array['securityMode'])) $this->securityMode = $array['securityMode'];
1746
- if(!isset($array['walletContracts'])||!strlen($array['walletContracts'][0]))$array['walletContracts'] = '';
1747
- $WSRequest = array (
1748
- 'version' => $array['version'], // modified by smile
1749
- 'contractNumber' => $array['contractNumber'],
1750
- 'cardInd' => $array['cardInd'],
1751
- 'walletId' => $array['walletId'],
1752
- 'updatePersonalDetails' => $array['updatePersonalDetails'],
1753
- 'updateOwnerDetails' => $array['updateOwnerDetails'],
1754
- 'updatePaymentDetails' => $array['updatePaymentDetails'],
1755
- 'buyer' => $this->buyer($array['buyer'],$array['billingAddress'],$array['shippingAddress']),
1756
- 'languageCode' => $this->languageCode,
1757
- 'customPaymentPageCode' => $this->customPaymentPageCode,
1758
- 'securityMode' => $this->securityMode,
1759
- 'returnURL' => $this->returnURL,
1760
- 'cancelURL' => $this->cancelURL,
1761
- 'notificationURL' => $this->notificationURL,
1762
- 'privateDataList' => $this->privates,
1763
- 'customPaymentTemplateURL' => $this->customPaymentTemplateURL,
1764
- 'contractNumberWalletList' => $this->secondContracts($array['walletContracts'])
1765
- );
1766
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::WEB_API,'updateWebWallet');
1767
- }
1768
-
1769
- public function verifyAuthentication($array){
1770
- $WSRequest = array (
1771
- 'contractNumber' => $array['contractNumber'],
1772
- 'pares' => $array['pares'],
1773
- 'md' => $array['md'],
1774
- 'card' => $this->card($array['card'])
1775
- );
1776
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'verifyAuthentication');
1777
- }
1778
-
1779
- public function verifyEnrollment($array){
1780
- $WSRequest = array (
1781
- 'payment' => $this->payment($array['payment']),
1782
- 'card' => $this->card($array['card']),
1783
- 'orderRef' => $array['orderRef'],
1784
- 'userAgent' => $array['userAgent']
1785
- );
1786
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'verifyEnrollment');
1787
- }
1788
- }
1789
- ?>
1
+ <?php
2
+ //
3
+ // Payline Class
4
+ // Copyright Monext
5
+ //
6
+ require_once('jIniFileModifier.php');
7
+ //
8
+ // OBJECTS DEFINITIONS
9
+ //
10
+
11
+
12
+ class util{
13
+
14
+ /**
15
+ * make an array from a payline server response object.
16
+ * @params : $response : Objet response from payline
17
+ * @return : Object convert in an array
18
+ **/
19
+ static function responseToArray($response){
20
+
21
+ $array = array();
22
+ foreach($response as $k=>$v){
23
+ if (is_object($v)) {
24
+ $array[$k] = util::responseToArray($v);
25
+ }
26
+ else { $array[$k] = $v;
27
+ }
28
+ }
29
+ return $array;
30
+
31
+ return $response;
32
+ }
33
+
34
+ static function responseToArrayForGetCards($response){
35
+
36
+ $array = array();
37
+ foreach($response as $k=>$v){
38
+
39
+ if (is_object($v) && ($k != 'cards' ) ) {
40
+ $array[$k] = util::responseToArrayForGetCards($v);
41
+ }
42
+ else {
43
+ if($k == 'cards' && count($v) == 1 ){
44
+ $array[$k][0] = $v;
45
+ }else{
46
+ $array[$k] = $v;
47
+ }
48
+ }
49
+ }
50
+ return $array;
51
+
52
+ return $response;
53
+ }
54
+ }
55
+
56
+ //
57
+ // PL_PAYMENT OBJECT DEFINITION
58
+ //
59
+ class pl_payment{
60
+
61
+ // ATTRIBUTES LISTING
62
+ public $amount;
63
+ public $currency;
64
+ public $action;
65
+ public $mode;
66
+ public $contractNumber;
67
+ public $differedActionDate;
68
+ }
69
+
70
+ //
71
+ // PL_ORDER OBJECT DEFINITION
72
+ //
73
+ class pl_order{
74
+
75
+ // ATTRIBUTES LISTING
76
+ public $ref;
77
+ public $origin;
78
+ public $country;
79
+ public $taxes;
80
+ public $amount;
81
+ public $currency;
82
+ public $date;
83
+ public $quantity;
84
+ public $comment;
85
+ public $details;
86
+
87
+ function __construct() {
88
+ $this->date = date('d/m/Y H:i', time());
89
+ $this->details = array();
90
+ }
91
+ }
92
+
93
+ //
94
+ // PL_PRIVATEDATA OBJECT DEFINITION
95
+ //
96
+ class pl_privateData{
97
+
98
+ // ATTRIBUTES LISTING
99
+ public $key ;
100
+ public $value;
101
+ }
102
+
103
+ //
104
+ // PL_AUTHORIZATION OBJECT DEFINITION
105
+ //
106
+ class pl_authorization{
107
+
108
+ // ATTRIBUTES LISTING
109
+ public $number;
110
+ public $date;
111
+ }
112
+
113
+ //
114
+ // PL_ADDRESS OBJECT DEFINITION
115
+ //
116
+ class pl_address{
117
+
118
+ // ATTRIBUTES LISTING
119
+ public $name;
120
+ public $street1;
121
+ public $street2;
122
+ public $cityName;
123
+ public $zipCode;
124
+ public $country;
125
+ public $phone;
126
+ }
127
+
128
+ //
129
+ // PL_BUYER OBJECT DEFINITION
130
+ //
131
+ class pl_buyer{
132
+
133
+ // ATTRIBUTES LISTING
134
+ public $lastName;
135
+ public $firstName;
136
+ public $email;
137
+ public $customerId;
138
+ public $walletId;
139
+ public $walletDisplayed;
140
+ public $walletSecured;
141
+ public $walletCardInd;
142
+ public $shippingAdress;
143
+ public $billingAddress;
144
+ public $accountCreateDate;
145
+ public $accountAverageAmount;
146
+ public $accountOrderCount;
147
+ public $ip;
148
+ public $mobilePhone;
149
+
150
+ function __construct() {
151
+ $this->accountCreateDate = date('d/m/y', time());
152
+ }
153
+ }
154
+
155
+ //
156
+ // PL_OWNER OBJECT DEFINITION
157
+ //
158
+ class pl_owner{
159
+
160
+ // ATTRIBUTES LISTING
161
+ public $lastName;
162
+ public $firstName;
163
+ public $billingAddress;
164
+ public $issueCardDate;
165
+ }
166
+
167
+ //
168
+ // PL_ORDERDETAIL OBJECT DEFINITION
169
+ //
170
+ class pl_orderDetail{
171
+
172
+ // ATTRIBUTES LISTING
173
+ public $ref;
174
+ public $price;
175
+ public $quantity;
176
+ public $comment;
177
+ }
178
+
179
+ //
180
+ // PL_CARD OBJECT DEFINITION
181
+ //
182
+ class pl_card{
183
+
184
+ // ATTRIBUTES LISTING
185
+ public $number;
186
+ public $type;
187
+ public $expirationDate;
188
+ public $cvx;
189
+ public $ownerBirthdayDate;
190
+ public $password;
191
+ public $cardholder; //added by smile
192
+ public $token;
193
+
194
+ function __construct($type) {
195
+ $this->accountCreateDate = date('d/m/y', time());
196
+ }
197
+ }
198
+
199
+
200
+ //
201
+ // PL_TRANSACTION OBJECT DEFINITION
202
+ //
203
+ class pl_transaction{
204
+
205
+ // ATTRIBUTES LISTING
206
+ public $id;
207
+ public $isPossibleFraud;
208
+ public $isDuplicated;
209
+ public $date;
210
+ }
211
+
212
+
213
+ //
214
+ // PL_RESULT OBJECT DEFINITION
215
+ //
216
+ class pl_result{
217
+
218
+ // ATTRIBUTES LISTING
219
+ public $code;
220
+ public $shortMessage;
221
+ public $longMessage;
222
+ }
223
+
224
+ //
225
+ // PL_CAPTURE OBJECT DEFINITION
226
+ //
227
+ class pl_capture{
228
+
229
+ // ATTRIBUTES LISTING
230
+ public $transactionID;
231
+ public $payment;
232
+ public $sequenceNumber;
233
+
234
+ function __construct() {
235
+ $this->payment = new pl_payment();
236
+ }
237
+ }
238
+
239
+ //
240
+ // PL_REFUND OBJECT DEFINITION
241
+ //
242
+ class pl_refund extends pl_capture {
243
+ function __construct() {
244
+ parent::__construct();
245
+ }
246
+ }
247
+
248
+ //
249
+ // PL_WALLET OBJECT DEFINITION
250
+ //
251
+ class pl_wallet{
252
+
253
+ // ATTRIBUTES LISTING
254
+ public $walletId;
255
+ public $lastName;
256
+ public $firstName;
257
+ public $email;
258
+ public $shippingAddress;
259
+ public $card;
260
+ public $comment;
261
+
262
+ function __construct() {
263
+ }
264
+ }
265
+
266
+ //
267
+ // PL_RECURRING OBJECT DEFINITION
268
+ //
269
+ class pl_recurring{
270
+
271
+ // ATTRIBUTES LISTING
272
+ public $firstAmount;
273
+ public $amount;
274
+ public $billingCycle;
275
+ public $billingLeft;
276
+ public $billingDay;
277
+ public $startDate;
278
+
279
+ function __construct() {
280
+ }
281
+ }
282
+
283
+ //
284
+ // PL_AUTHENTIFICATION 3D SECURE
285
+ //
286
+ class pl_authentication3DSecure{
287
+
288
+ // ATTRIBUTES LISTING
289
+ public $md ;
290
+ public $pares ;
291
+ public $xid ;
292
+ public $eci ;
293
+ public $cavv ;
294
+ public $cavvAlgorithm ;
295
+ public $vadsResult ;
296
+
297
+ function __construct() {
298
+ }
299
+ }
300
+
301
+ //
302
+ // PL_BANKACCOUNTDATA
303
+ //
304
+ class pl_bankAccountData{
305
+
306
+
307
+ // ATTRIBUTES LISTING
308
+ public $countryCode ;
309
+ public $bankCode ;
310
+ public $accountNumber ;
311
+ public $key ;
312
+
313
+
314
+ function __construct() {
315
+ }
316
+ }
317
+
318
+ //
319
+ // PL_CHEQUE
320
+ //
321
+ class pl_cheque{
322
+
323
+ // ATTRIBUTES LISTING
324
+ public $number ;
325
+
326
+ function __construct() {
327
+ }
328
+ }
329
+
330
+ final class Log {
331
+ private $filename;
332
+ private $path;
333
+
334
+ public function __construct($filename) {
335
+ $this->filename = $filename;
336
+ $tmp = explode(DIRECTORY_SEPARATOR ,dirname(__FILE__));
337
+
338
+ // up one level from the current directory
339
+ for($i=0,$s = sizeof($tmp)-1; $i<$s; $i++){
340
+ $this->path .= $tmp[$i].DIRECTORY_SEPARATOR;
341
+ }
342
+ $this->path .= 'logs'.DIRECTORY_SEPARATOR;
343
+ }
344
+
345
+ public function write($message) {
346
+ $file = $this->path.$this->filename;
347
+ $handle = fopen($file, 'a+');
348
+ fwrite($handle, date('Y-m-d G:i:s') . ' - ' . $message . "\n");
349
+ fclose($handle);
350
+ }
351
+ }
352
+
353
+ //
354
+ // PAYLINESDK CLASS
355
+ //
356
+ class paylineSDK{
357
+
358
+ // kit version
359
+ const KIT_VERSION = 'module Magento 1.7.8';
360
+
361
+ // trace log
362
+ var $paylineTrace;
363
+
364
+ // SOAP URL's
365
+ const PAYLINE_NAMESPACE = 'http://obj.ws.payline.experian.com';
366
+ const WSDL = 'Payline.wsdl';
367
+ const PROD_ENDPOINT = 'https://services.payline.com/V4/services/';
368
+ const PROD_ENDPOINT_HD = 'https://services.payline.com/V4/services/';
369
+ const HOMO_ENDPOINT = 'https://homologation.payline.com/V4/services/';
370
+ const HOMO_ENDPOINT_HD = 'https://homologation.payline.com/V4/services/';
371
+
372
+ const DIRECT_API = 'DirectPaymentAPI';
373
+ const EXTENDED_API = 'ExtendedAPI';
374
+ const WEB_API = 'WebPaymentAPI';
375
+
376
+ // current endpoint
377
+ private $webServicesEndpoint;
378
+
379
+ // version of web service
380
+ private $version = '';
381
+
382
+ // devise used by the customer
383
+ private $media = '';
384
+
385
+ // SOAP ACTIONS CONSTANTS
386
+ const soap_result = 'result';
387
+ const soap_authorization = 'authorization';
388
+ const soap_card = 'card';
389
+ const soap_order = 'order';
390
+ const soap_orderDetail = 'orderDetail';
391
+ const soap_payment = 'payment';
392
+ const soap_transaction = 'transaction';
393
+ const soap_privateData = 'privateData';
394
+ const soap_buyer = 'buyer';
395
+ const soap_owner = 'owner';
396
+ const soap_address = 'address';
397
+ const soap_capture = 'capture';
398
+ const soap_refund = 'refund';
399
+ const soap_refund_auth = 'refundAuthorization';
400
+ const soap_authentication3DSecure = 'authentication3DSecure';
401
+ const soap_bankAccountData = 'bankAccountData';
402
+ const soap_cheque = 'cheque';
403
+
404
+ // Target environment
405
+ public $production;
406
+
407
+ // ARRAY
408
+ public $header_soap;
409
+ public $items;
410
+ public $privates;
411
+
412
+ // OPTIONS
413
+ public $cancelURL;
414
+ public $securityMode;
415
+ public $notificationURL;
416
+ public $returnURL;
417
+ public $customPaymentTemplateURL;
418
+ public $customPaymentPageCode;
419
+ public $languageCode;
420
+
421
+ // WALLET
422
+ public $walletIdList;
423
+
424
+ // SWITCHING VAR
425
+ public $NMAX_TENTATIVE = '';
426
+ public $CALL_TIMEOUT = '';
427
+ public $RETRY_TIMEOUT = '';
428
+ public $PRIMARY = true ;
429
+ public $CURRENT_NUMBER_CALL = 0;
430
+ public $DEFAULT_SOCKET_TIMEOUT = 0;
431
+
432
+ /**
433
+ * contructor of PAYLINESDK CLASS
434
+ **/
435
+ function __construct($merchant_id, $acess_key, $proxy_host, $proxy_port, $proxy_login, $proxy_password, $production) {
436
+ $this->writeTrace('----------------------------------------------------------');
437
+ $this->writeTrace("paylineSDK::__construct($merchant_id, ".$this->maskAccessKey($acess_key).", $proxy_host, $proxy_port, $proxy_login, $proxy_password, $production)");
438
+ $this->header_soap = array();
439
+ $this->header_soap['login'] = $merchant_id;
440
+ $this->header_soap['password'] = $acess_key;
441
+ if($proxy_host != ''){
442
+ $this->header_soap['proxy_host'] = $proxy_host;
443
+ $this->header_soap['proxy_port'] = $proxy_port;
444
+ $this->header_soap['proxy_login'] = $proxy_login;
445
+ $this->header_soap['proxy_password'] = $proxy_password;
446
+ }
447
+ $this->production = $production;
448
+ if($production){
449
+ $this->webServicesEndpoint = paylineSDK::PROD_ENDPOINT;
450
+ }else{
451
+ $this->webServicesEndpoint = paylineSDK::HOMO_ENDPOINT;
452
+ }
453
+ $this->header_soap['style'] = SOAP_DOCUMENT;
454
+ $this->header_soap['use'] = SOAP_LITERAL;
455
+ $this->header_soap['version'] = paylineSDK::KIT_VERSION;
456
+ $this->items = array();
457
+ $this->privates = array();
458
+ $this->walletIdList = array();
459
+
460
+ ini_set('user_agent', "PHP\r\nversion: ".paylineSDK::KIT_VERSION);
461
+ }
462
+
463
+ /**
464
+ * function payment
465
+ * @params : $array : array. the array keys are listed in pl_payment CLASS.
466
+ * @return : SoapVar : object
467
+ * @description : build pl_payment instance from $array and make SoapVar object for payment.
468
+ **/
469
+ protected function payment($array) {
470
+ $payment = new pl_payment();
471
+ if($array && is_array($array)){
472
+ foreach($array as $k=>$v){
473
+ if(array_key_exists($k, $payment)&&(strlen($v))){
474
+ $payment->$k = $v;
475
+ }
476
+ }
477
+ }
478
+ return new SoapVar($payment, SOAP_ENC_OBJECT, paylineSDK::soap_payment, paylineSDK::PAYLINE_NAMESPACE);
479
+ }
480
+
481
+ /**
482
+ * function order
483
+ * @params : $array : array. the array keys are listed in pl_order CLASS.
484
+ * @return : SoapVar : object
485
+ * @description : build pl_order instance from $array and make SoapVar object for order.
486
+ **/
487
+ protected function order($array) {
488
+ $order = new pl_order();
489
+ if($array && is_array($array)){
490
+ foreach($array as $k=>$v){
491
+ if(array_key_exists($k, $order)&&(strlen($v))){
492
+ $order->$k = $v;
493
+ }
494
+ }
495
+ }
496
+ $allDetails = array();
497
+ // insert orderDetails
498
+ $order->details = $this->items;
499
+ return new SoapVar($order, SOAP_ENC_OBJECT, paylineSDK::soap_order, paylineSDK::PAYLINE_NAMESPACE);
500
+ }
501
+
502
+ /**
503
+ * function address
504
+ * @params : $address : array. the array keys are listed in pl_address CLASS.
505
+ * @return : SoapVar : object
506
+ * @description : build pl_address instance from $array and make SoapVar object for address.
507
+ **/
508
+ protected function address($array) {
509
+ $address = new pl_address();
510
+ if($array && is_array($array)){
511
+ foreach($array as $k=>$v){
512
+ if(array_key_exists($k, $address)&&(strlen($v)))$address->$k = $v;
513
+ }
514
+ }
515
+ return new SoapVar($address, SOAP_ENC_OBJECT, paylineSDK::soap_address, paylineSDK::PAYLINE_NAMESPACE);
516
+ }
517
+
518
+ /**
519
+ * function buyer
520
+ * @params : $array : array. the array keys are listed in pl_buyer CLASS.
521
+ * @params : $shippingAdress : array. the array keys are listed in pl_address CLASS.
522
+ * @params : $billingAddress : array. the array keys are listed in pl_address CLASS.
523
+ * @return : SoapVar : object
524
+ * @description : build pl_buyer instance from $array and $address and make SoapVar object for buyer.
525
+ **/
526
+ protected function buyer($array,$shippingAdress,$billingAddress) {
527
+ $buyer = new pl_buyer();
528
+ if($array && is_array($array)){
529
+ foreach($array as $k=>$v){
530
+ if(array_key_exists($k, $buyer)&&(strlen($v)))$buyer->$k = $v;
531
+ }
532
+ }
533
+ $buyer->shippingAdress = $this->address($shippingAdress);
534
+ $buyer->billingAddress = $this->address($billingAddress);
535
+ return new SoapVar($buyer, SOAP_ENC_OBJECT, paylineSDK::soap_buyer, paylineSDK::PAYLINE_NAMESPACE);
536
+ }
537
+
538
+ /**
539
+ * function owner
540
+ * @params : $array : array. the array keys are listed in pl_buyer CLASS.
541
+ * @params : $shippingAdress : array. the array keys are listed in pl_address CLASS.
542
+ * @params : $billingAddress : array. the array keys are listed in pl_address CLASS.
543
+ * @return : SoapVar : object
544
+ * @description : build pl_buyer instance from $array and $address and make SoapVar object for buyer.
545
+ **/
546
+ protected function owner($array,$Address) {
547
+ if($array != null){
548
+ $owner = new pl_owner();
549
+ if($array && is_array($array)){
550
+ foreach($array as $k=>$v){
551
+ if(array_key_exists($k, $owner)&&(strlen($v)))$owner->$k = $v;
552
+ }
553
+ }
554
+ $owner->billingAddress = $this->address($Address);
555
+ return new SoapVar($owner, SOAP_ENC_OBJECT, paylineSDK::soap_owner, paylineSDK::PAYLINE_NAMESPACE);
556
+ }else{
557
+ return null;
558
+ }
559
+ }
560
+
561
+ /**
562
+ * function contracts
563
+ * @params : $contracts : array. array of contracts
564
+ * @return : $contracts : array. the same as params if exist, or an array with default contract defined in
565
+ * configuration
566
+ * @description : Add datas to contract array
567
+ **/
568
+ protected function contracts($contracts) {
569
+ if($contracts && is_array($contracts)){
570
+ return $contracts;
571
+ }
572
+ return explode(';',(string)Mage::helper('payline')->contractNumberList);
573
+ }
574
+
575
+ /**
576
+ * function secondContracts
577
+ * @params : $secondContracts : array. array of contracts
578
+ * @return : $secondContracts : array. the same as params if exist, null otherwise
579
+ * @description : Add datas to contract array
580
+ **/
581
+ protected function secondContracts($secondContracts) {
582
+ if($secondContracts && is_array($secondContracts)){
583
+ return $secondContracts;
584
+ }
585
+ return null;
586
+ }
587
+
588
+ /**
589
+ * function authentification 3Dsecure
590
+ * @params : $array : array. the array keys are listed in pl_card CLASS.
591
+ * @return : SoapVar : object
592
+ * @description : build pl_authentication3DSecure instance from $array and make SoapVar object for authentication3DSecure.
593
+ **/
594
+ protected function authentication3DSecure($array) {
595
+ $authentication3DSecure = new pl_authentication3DSecure($array);
596
+ if($array && is_array($array)){
597
+ foreach($array as $k=>$v){
598
+ if(array_key_exists($k, $authentication3DSecure)&&(strlen($v))){
599
+ $authentication3DSecure->$k = $v;
600
+ }
601
+ }
602
+ }
603
+ return new SoapVar($authentication3DSecure, SOAP_ENC_OBJECT, paylineSDK::soap_authentication3DSecure, paylineSDK::PAYLINE_NAMESPACE);
604
+ }
605
+
606
+ /**
607
+ * function authorization
608
+ * @params : $array : array. the array keys are listed in pl_card CLASS.
609
+ * @return : SoapVar : object
610
+ * @description : build pl_authentication3DSecure instance from $array and make SoapVar object for authentication3DSecure.
611
+ **/
612
+ protected function authorization($array) {
613
+ $authorization = new pl_authorization($array);
614
+ if($array && is_array($array)){
615
+ foreach($array as $k=>$v){
616
+ if(array_key_exists($k, $authorization)&&(strlen($v))){
617
+ $authorization->$k = $v;
618
+ }
619
+ }
620
+ }
621
+ return new SoapVar($authorization, SOAP_ENC_OBJECT, paylineSDK::soap_authorization, paylineSDK::PAYLINE_NAMESPACE);
622
+ }
623
+
624
+ /**
625
+ * function card
626
+ * @params : $array : array. the array keys are listed in pl_card CLASS.
627
+ * @return : SoapVar : object
628
+ * @description : build pl_card instance from $array and make SoapVar object for card.
629
+ **/
630
+ protected function card($array) {
631
+ $card = new pl_card($array['type']);
632
+ if($array && is_array($array)){
633
+ foreach($array as $k=>$v){
634
+ if(array_key_exists($k, $card)&&(strlen($v))){
635
+ $card->$k = $v;
636
+ }
637
+ }
638
+ }
639
+ return new SoapVar($card, SOAP_ENC_OBJECT, paylineSDK::soap_card, paylineSDK::PAYLINE_NAMESPACE);
640
+ }
641
+
642
+
643
+
644
+ /**
645
+ * function bankAccountData
646
+ * @params : $array : array. the array keys are listed in pl_bankAccountData CLASS.
647
+ * @return : SoapVar : object
648
+ * @description : build pl_bankAccountData instance from $array and make SoapVar object for bankAccountData.
649
+ **/
650
+ protected function bankAccountData($array) {
651
+ $bankAccountData = new pl_bankAccountData($array);
652
+ if($array && is_array($array)){
653
+ foreach($array as $k=>$v){
654
+ if(array_key_exists($k, $bankAccountData)&&(strlen($v))){
655
+ $bankAccountData->$k = $v;
656
+ }
657
+ }
658
+ }
659
+ return new SoapVar(null, SOAP_ENC_OBJECT, paylineSDK::soap_bankAccountData, paylineSDK::PAYLINE_NAMESPACE);
660
+ }
661
+
662
+ /**
663
+ * function cheque
664
+ * @params : $array : array. the array keys are listed in pl_cheque CLASS.
665
+ * @return : SoapVar : object
666
+ * @description : build pl_authentication3DSecure instance from $array and make SoapVar object for cheque.
667
+ **/
668
+ protected function cheque($array) {
669
+ $cheque = new pl_cheque($array);
670
+ if($array && is_array($array)){
671
+ foreach($array as $k=>$v){
672
+ if(array_key_exists($k, $cheque)&&(strlen($v))){
673
+ $cheque->$k = $v;
674
+ }
675
+ }
676
+ }
677
+ return new SoapVar($cheque, SOAP_ENC_OBJECT, paylineSDK::soap_cheque, paylineSDK::PAYLINE_NAMESPACE);
678
+ }
679
+
680
+ /****************************************************/
681
+ // WALLET //
682
+ /****************************************************/
683
+
684
+ /**
685
+ * function wallet
686
+ * @params : array : array. the array keys are listed in pl_wallet CLASS.
687
+ * @params : address : array. the array keys are listed in pl_address CLASS.
688
+ * @params : card : array. the array keys are listed in pl_card CLASS.
689
+ * @return : wallet: pl_wallet Object.
690
+ * @description : build a wallet object.
691
+ **/
692
+ protected function wallet($array,$address,$card) {
693
+ $wallet = new pl_wallet();
694
+ if($array && is_array($array)){
695
+ foreach($array as $k=>$v){
696
+ if(array_key_exists($k, $wallet)&&(strlen($v)))$wallet->$k = $v;
697
+ }
698
+ }
699
+
700
+ $wallet->shippingAddress = $this->address($address);
701
+ $wallet->card = $this->card($card);
702
+
703
+ return $wallet;
704
+ }
705
+
706
+ /**
707
+ * function recurring
708
+ * @params : array : array. the array keys are listed in pl_recurring CLASS.
709
+ * @return : recurring object.
710
+ * @description : build a recurring object.
711
+ **/
712
+ protected function recurring($array) {
713
+ if($array){
714
+ $recurring = new pl_recurring();
715
+ if($array && is_array($array)){
716
+ foreach($array as $k=>$v){
717
+ if(array_key_exists($k, $recurring)&&(strlen($v)))$recurring->$k = $v;
718
+ }
719
+ }
720
+ return $recurring;
721
+ }
722
+ else return null;
723
+ }
724
+
725
+ /**
726
+ * function setItem
727
+ * @params : $item : array. the array keys are listed in PL_ORDERDETAIL CLASS.
728
+ * @description : Make $item SoapVar object and insert in items array
729
+ **/
730
+ public function setItem($item) {
731
+ $orderDetail = new pl_orderDetail();
732
+ if($item && is_array($item)){
733
+ foreach($item as $k=>$v){
734
+ if(array_key_exists($k, $orderDetail)&&(strlen($v)))$orderDetail->$k = $v;
735
+ }
736
+ }
737
+ $this->items[] = new SoapVar($orderDetail, SOAP_ENC_OBJECT, paylineSDK::soap_orderDetail, paylineSDK::PAYLINE_NAMESPACE);
738
+ }
739
+
740
+ /**
741
+ * function setPrivate
742
+ * @params : $private : array. the array keys are listed in PRIVATE CLASS.
743
+ * @description : Make $setPrivate SoapVar object and insert in privates array
744
+ **/
745
+ public function setPrivate($array) {
746
+ $private = new pl_privateData();
747
+ if($array && is_array($array)){
748
+ foreach($array as $k=>$v){
749
+ if(array_key_exists($k, $private)&&(strlen($v)))$private->$k = $v;
750
+ }
751
+ }
752
+ $this->privates[] = new SoapVar($private, SOAP_ENC_OBJECT, paylineSDK::soap_privateData, paylineSDK::PAYLINE_NAMESPACE);
753
+ }
754
+
755
+ /**
756
+ * function setWalletIdList
757
+ * @params : sting : string if wallet id separated by ';'.
758
+ * @return :
759
+ * @description : make an array of wallet id .
760
+ **/
761
+ public function setWalletIdList($walletIdList) {
762
+ if ($walletIdList) $this->walletIdList = explode(";", $walletIdList);
763
+ if(empty($walletIdList))$this->walletIdList = array(0) ;
764
+ }
765
+
766
+ private function maskAccessKey($accessKey){
767
+ $maskedAccessKey = substr($accessKey,0,2);
768
+ $maskedAccessKey .= substr("********************",0,strlen($accessKey)-4);
769
+ $maskedAccessKey .= substr($accessKey,-2);
770
+ return $maskedAccessKey;
771
+ }
772
+
773
+ private function IsSwitchingEnabled($Method){
774
+ $Enabled = false;
775
+ $ListeWS = (string)Mage::helper('payline')->contractNumber;
776
+ $ArrayWS = explode(",",$ListeWS);
777
+ foreach($ArrayWS as $Key => $Value){
778
+ if($Method === $Value){
779
+ $Enabled = true;
780
+ }
781
+ }
782
+ return $Enabled;
783
+ }
784
+
785
+ // Paramétrage Switch Primary
786
+ private function SwitchToPrimary(){
787
+ $this->NMAX_TENTATIVE = (string)Mage::helper('payline')->primaryMaxfailRetry;
788
+ $this->CALL_TIMEOUT = (string)Mage::helper('payline')->primaryCallTimeout;
789
+ $this->RETRY_TIMEOUT = (string)Mage::helper('payline')->primaryReplayTimer;
790
+ $this->PRIMARY = true;
791
+ $this->CURRENT_NUMBER_CALL = 0;
792
+ $this->header_soap['connection_timeout'] = $this->CALL_TIMEOUT;
793
+ if($this->production){
794
+ $this->webServicesEndpoint = paylineSDK::PROD_ENDPOINT;
795
+ }else{
796
+ $this->webServicesEndpoint = paylineSDK::HOMO_ENDPOINT;
797
+ }
798
+ }
799
+
800
+ // Paramétrage Switch Secondary
801
+ private function SwitchToSecondary(){
802
+ $this->NMAX_TENTATIVE = (string)Mage::helper('payline')->secondaryMaxfailRetry;
803
+ $this->CALL_TIMEOUT = (string)Mage::helper('payline')->secondaryCallTimeout;
804
+ $this->RETRY_TIMEOUT = (string)Mage::helper('payline')->secondaryReplayTimer;
805
+ $this->PRIMARY = false;
806
+ $this->CURRENT_NUMBER_CALL = 0;
807
+ $this->header_soap['connection_timeout'] = $this->CALL_TIMEOUT;
808
+ if($this->production){
809
+ $this->webServicesEndpoint = paylineSDK::PROD_ENDPOINT_HD;
810
+ }else{
811
+ $this->webServicesEndpoint = paylineSDK::HOMO_ENDPOINT_HD;
812
+ }
813
+ }
814
+
815
+ private function IsForceSwitch($Force){
816
+ $bool = false;
817
+ if(isset($Force) && !empty($Force)){
818
+ $bool = true;
819
+ }else{
820
+ $bool = false;
821
+ }
822
+ return $bool;
823
+ }
824
+
825
+ private function CheckForSwitching(){
826
+ $bool = false ;
827
+ $ini_array = parse_ini_file((string)Mage::helper('payline')->ini_file);
828
+ $TimeEndSwitch = $ini_array['TimeEndSwitch'];
829
+ $CurrentTime = time();
830
+ if(isset($TimeEndSwitch) && !empty($TimeEndSwitch)){
831
+ if($TimeEndSwitch > $CurrentTime){
832
+ $bool = true;
833
+ return $bool;
834
+ }else{
835
+ $bool = false;
836
+ return $bool;
837
+ }
838
+ }else{
839
+ $bool = false;
840
+ return $bool;
841
+ }
842
+ }
843
+
844
+ private function CheckForError($response){
845
+ $ErrCheck = false;
846
+ $ErrList = (string)Mage::helper('payline')->paylineErrCode;
847
+ $ArrayErr = explode(",",$ErrList);
848
+ foreach($ArrayErr as $Key => $Value){
849
+ if($response['result']['code'] === $Value){
850
+ $ErrCheck = true;
851
+ }
852
+ }
853
+ return $ErrCheck;
854
+ }
855
+
856
+ private function CheckForTokenError($response){
857
+ $ErrCheck = false;
858
+ $ErrList = (string)Mage::helper('payline')->paylineErrToken;
859
+ $ArrayErr = explode(",",$ErrList);
860
+ foreach($ArrayErr as $Key => $Value){
861
+ if($response['result']['code'] === $Value){
862
+ $ErrCheck = true;
863
+ }
864
+ }
865
+ return $ErrCheck;
866
+ }
867
+
868
+ private function init_config($Method,$ForceSwitch,$ForceValue){
869
+ if($this->IsSwitchingEnabled($Method)){
870
+ if(isset($ForceSwitch) && $this->IsForceSwitch($ForceSwitch)){
871
+ if(isset($ForceValue) && $ForceValue == "Primaire"){
872
+ $this->SwitchToPrimary();
873
+ }else if(isset($ForceValue) && $ForceValue == "Secondaire"){
874
+ $this->SwitchToSecondary();
875
+ }
876
+ }else{
877
+ if($this->CheckForSwitching()){
878
+ $this->SwitchToSecondary();
879
+ }else{
880
+ $this->SwitchToPrimary();
881
+ }
882
+ }
883
+ }else{
884
+ if(isset($ForceSwitch) && $this->IsForceSwitch($ForceSwitch)){
885
+ if(isset($ForceValue) && $ForceValue == "Primaire"){
886
+ $this->SwitchToPrimary();
887
+ }else if(isset($ForceValue) && $ForceValue == "Secondaire"){
888
+ $this->SwitchToSecondary();
889
+ }
890
+ }else{
891
+ $this->SwitchToPrimary();
892
+ }
893
+ }
894
+ }
895
+
896
+ private function CheckEndSwitch(){
897
+ $bool = false ;
898
+ $ini_array = parse_ini_file((string)Mage::helper('payline')->ini_file);
899
+ $TimeEndSwitch = $ini_array['TimeEndSwitch'];
900
+ $EndSwitch = $ini_array['EndSwitchTry'];
901
+ $CurrentTime = time();
902
+ if(isset($TimeEndSwitch) && !empty($TimeEndSwitch)){
903
+ if(($CurrentTime > $TimeEndSwitch) && $EndSwitch == 1 && $this->PRIMARY){
904
+ $bool = true;
905
+ }
906
+ }
907
+ return $bool;
908
+ }
909
+
910
+
911
+ private function SetCallSocketTimeOut(){
912
+ $this->DEFAULT_SOCKET_TIMEOUT = ini_get('default_socket_timeout');
913
+ ini_set('default_socket_timeout', $this->CALL_TIMEOUT);
914
+ }
915
+
916
+ private function SetDefaultSocketTimeOut(){
917
+ ini_set('default_socket_timeout', $this->DEFAULT_SOCKET_TIMEOUT);
918
+ }
919
+
920
+ private function VerifyIfAnotherWShasSwitch($Method){
921
+ if($this->IsSwitchingEnabled($Method) && $this->CheckForSwitching() && $this->PRIMARY){
922
+ $this->SwitchToSecondary();
923
+ }
924
+ }
925
+ private function AddResponseSwitchingChain($Method,$response){
926
+ if($this->IsSwitchingEnabled($Method)){
927
+ $response['Switch']['Wsdl File'] = "$this->WSDL_DIRECT_SOAP";
928
+ }
929
+ return $response;
930
+ }
931
+
932
+ private function CheckIniValue($key,$value){
933
+ $bool = false ;
934
+ $ini_array = parse_ini_file((string)Mage::helper('payline')->ini_file);
935
+ $EndSwitch = $ini_array[$key];
936
+ if(isset($EndSwitch) && !empty($EndSwitch) && $EndSwitch == $value){
937
+ $bool = true;
938
+ }
939
+
940
+ return $bool;
941
+ }
942
+
943
+ private function Switcher($DateDebut,$Method,$WS,$WSRequest,$WDSL){
944
+ $DateFin = time();
945
+ $this->SetDefaultSocketTimeOut();
946
+ $response = array();
947
+ while($this->NMAX_TENTATIVE >= $this->CURRENT_NUMBER_CALL){
948
+ if($this->PRIMARY){
949
+ if(($this->RETRY_TIMEOUT - ($DateDebut-$DateFin)) >= 0){
950
+ sleep(($this->RETRY_TIMEOUT - ($DateDebut-$DateFin)));
951
+ $DateDebut = 0;
952
+ $DateFin = 0;
953
+ }
954
+ }else{
955
+ sleep($this->RETRY_TIMEOUT);
956
+ }
957
+ try{
958
+ $this->SetCallSocketTimeOut();
959
+ $this->VerifyIfAnotherWShasSwitch($Method);
960
+ $client = new SoapClient($WDSL, $this->header_soap);
961
+ $DateDebut = time();
962
+ $WSresponse = $this->WSCall("$WS",$WSRequest,$client);
963
+ $this->SetDefaultSocketTimeOut();
964
+ $response = util::responseToArray($WSresponse);
965
+ $response = $this->AddResponseSwitchingChain($Method,$response);
966
+ if($this->CheckForError($response)){
967
+ throw new Exception('Technical Error : '+$response['result']['code']+' : '+$response['result']['shortMessage']+' : '+$response['result']['longMessage']);
968
+ }else{
969
+ if($this->CheckEndSwitch() && $this->IsSwitchingEnabled($Method) && !(isset($array['Switch']['Forced']) && $this->IsForceSwitch($array['Switch']['Forced']))){
970
+ if(!$this->CheckIniValue('EndSwitchTry',0)){
971
+ $jIniFileModifier = new jIniFileModifier((string)Mage::helper('payline')->ini_file);
972
+ $jIniFileModifier->setValue('EndSwitchTry', 0, 'Switcher', null);
973
+ $jIniFileModifier->save();
974
+ }
975
+ }
976
+ return $response;
977
+ }
978
+ }catch (Exception $e){
979
+ $DateFin = time();
980
+ $this->CURRENT_NUMBER_CALL++;
981
+ if(!($this->NMAX_TENTATIVE >= $this->CURRENT_NUMBER_CALL) && $this->PRIMARY){
982
+ $this->SwitchToSecondary();
983
+ $this->CURRENT_NUMBER_CALL = 0;
984
+ $jIniFileModifier = new jIniFileModifier((string)Mage::helper('payline')->ini_file);
985
+ $jIniFileModifier->setValue('TimeEndSwitch', time()+((int)Mage::helper('payline')->ini_file), 'Switcher', null);
986
+ $jIniFileModifier->save();
987
+ if(!$this->CheckIniValue('EndSwitchTry',1)){
988
+ $jIniFileModifier = new jIniFileModifier((string)Mage::helper('payline')->ini_file);
989
+ $jIniFileModifier->setValue('EndSwitchTry', 1, 'Switcher', null);
990
+ $jIniFileModifier->save();
991
+ }
992
+ }
993
+
994
+ }
995
+
996
+ }
997
+ return $response;
998
+ }
999
+
1000
+ // Fonction qui permet l'utilisation de la plateforme HD et qui corrige le bug de formatage des données pour le WS getCards
1001
+ private function SwitcherFormatResponse($DateDebut,$Method,$WS,$WSRequest,$WDSL){
1002
+ $DateFin = time();
1003
+ $this->SetDefaultSocketTimeOut();
1004
+ $response = array();
1005
+ while($this->NMAX_TENTATIVE >= $this->CURRENT_NUMBER_CALL){
1006
+ if($this->PRIMARY){
1007
+ if(($this->RETRY_TIMEOUT - ($DateDebut-$DateFin)) >= 0){
1008
+ sleep(($this->RETRY_TIMEOUT - ($DateDebut-$DateFin)));
1009
+ $DateDebut = 0;
1010
+ $DateFin = 0;
1011
+ }
1012
+ }else{
1013
+ sleep($this->RETRY_TIMEOUT);
1014
+ }
1015
+ try{
1016
+ $this->SetCallSocketTimeOut();
1017
+ $this->VerifyIfAnotherWShasSwitch($Method);
1018
+ $client = new SoapClient($WDSL, $this->header_soap);
1019
+ $DateDebut = time();
1020
+ $WSresponse = $this->WSCall("$WS",$WSRequest,$client);
1021
+ $this->SetDefaultSocketTimeOut();
1022
+ $response = util::responseToArrayForGetCards($WSresponse);
1023
+ $response = $this->AddResponseSwitchingChain($Method,$response);
1024
+ if($this->CheckForError($response)){
1025
+ throw new Exception('Technical Error : '+$response['result']['code']+' : '+$response['result']['shortMessage']+' : '+$response['result']['longMessage']);
1026
+ }else{
1027
+ if($this->CheckEndSwitch() && $this->IsSwitchingEnabled($Method) && !(isset($array['Switch']['Forced']) && $this->IsForceSwitch($array['Switch']['Forced']))){
1028
+ if(!$this->CheckIniValue('EndSwitchTry',0)){
1029
+ $jIniFileModifier = new jIniFileModifier((string)Mage::helper('payline')->ini_file);
1030
+ $jIniFileModifier->setValue('EndSwitchTry', 0, 'Switcher', null);
1031
+ $jIniFileModifier->save();
1032
+ }
1033
+ }
1034
+ return $response;
1035
+ }
1036
+ }catch (Exception $e){
1037
+ $DateFin = time();
1038
+ $this->CURRENT_NUMBER_CALL++;
1039
+ if(!($this->NMAX_TENTATIVE >= $this->CURRENT_NUMBER_CALL) && $this->PRIMARY){
1040
+ $this->SwitchToSecondary();
1041
+ $this->CURRENT_NUMBER_CALL = 0;
1042
+ $jIniFileModifier = new jIniFileModifier((string)Mage::helper('payline')->ini_file);
1043
+ $jIniFileModifier->setValue('TimeEndSwitch', time()+((int)Mage::helper('payline')->ini_file), 'Switcher', null);
1044
+ $jIniFileModifier->save();
1045
+ if(!$this->CheckIniValue('EndSwitchTry',1)){
1046
+ $jIniFileModifier = new jIniFileModifier((string)Mage::helper('payline')->ini_file);
1047
+ $jIniFileModifier->setValue('EndSwitchTry', 1, 'Switcher', null);
1048
+ $jIniFileModifier->save();
1049
+ }
1050
+ }
1051
+ }
1052
+ }
1053
+ return $response;
1054
+ }
1055
+
1056
+ private function WSCall($Method,$WSRequest,$client){
1057
+ $response = null ;
1058
+ switch ($Method) {
1059
+ case "doWebPayment":
1060
+ $response = $client->doWebPayment($WSRequest);
1061
+ break;
1062
+ case "doAuthorization":
1063
+ $response = $client->doAuthorization($WSRequest);
1064
+ break;
1065
+ case "doCapture":
1066
+ $response = $client->doCapture($WSRequest);
1067
+ break;
1068
+ case "doRefund":
1069
+ $response = $client->doRefund($WSRequest);
1070
+ break;
1071
+ case "doCredit":
1072
+ $response = $client->doCredit($WSRequest);
1073
+ break;
1074
+ case "verifyEnrollment":
1075
+ $response = $client->verifyEnrollment($WSRequest);
1076
+ break;
1077
+ case "doDebit":
1078
+ $response = $client->doDebit($WSRequest);
1079
+ break;
1080
+ case "doReset":
1081
+ $response = $client->doReset($WSRequest);
1082
+ break;
1083
+ case "createWallet":
1084
+ $response = $client->createWallet($WSRequest);
1085
+ break;
1086
+ case "getWallet":
1087
+ $response = $client->getWallet($WSRequest);
1088
+ break;
1089
+ case "updateWallet":
1090
+ $response = $client->updateWallet($WSRequest);
1091
+ break;
1092
+ case "createWebWallet":
1093
+ $response = $client->createWebWallet($WSRequest);
1094
+ break;
1095
+ case "updateWebWallet":
1096
+ $response = $client->updateWebWallet($WSRequest);
1097
+ break;
1098
+ case "disableWallet":
1099
+ $response = $client->disableWallet($WSRequest);
1100
+ break;
1101
+ case "enableWallet":
1102
+ $response = $client->enableWallet($WSRequest);
1103
+ break;
1104
+ case "doImmediateWalletPayment":
1105
+ $response = $client->doImmediateWalletPayment($WSRequest);
1106
+ break;
1107
+ case "doScheduledWalletPayment":
1108
+ $response = $client->doScheduledWalletPayment($WSRequest);
1109
+ break;
1110
+ case "doRecurrentWalletPayment":
1111
+ $response = $client->doRecurrentWalletPayment($WSRequest);
1112
+ break;
1113
+ case "getPaymentRecord":
1114
+ $response = $client->getPaymentRecord($WSRequest);
1115
+ break;
1116
+ case "disablePaymentRecord":
1117
+ $response = $client->disablePaymentRecord($WSRequest);
1118
+ break;
1119
+ case "getTransactionDetails":
1120
+ $response = $client->getTransactionDetails($WSRequest);
1121
+ break;
1122
+ case "transactionsSearch":
1123
+ $response = $client->transactionsSearch($WSRequest);
1124
+ break;
1125
+ case "verifyAuthentication":
1126
+ $response = $client->verifyAuthentication($WSRequest);
1127
+ break;
1128
+ case "getEncryptionKey":
1129
+ $response = $client->getEncryptionKey($WSRequest);
1130
+ break;
1131
+ case "getCards":
1132
+ $response = $client->getCards($WSRequest);
1133
+ break;
1134
+ case "doScoringCheque":
1135
+ $response = $client->doScoringCheque($WSRequest);
1136
+ break;
1137
+ case "doReAuthorization":
1138
+ $response = $client->doReAuthorization($WSRequest);
1139
+ break;
1140
+ }
1141
+ return $response;
1142
+ }
1143
+
1144
+ private function TokenSwitch($token){
1145
+ $Check = substr($token,0,1);
1146
+ if($Check == (string)Mage::helper('payline')->primaryTokenPrefix){
1147
+ $this->SwitchToPrimary();
1148
+ }else if($Check == (string)Mage::helper('payline')->secondaryTokenPrefix){
1149
+ $this->SwitchToSecondary();
1150
+ }
1151
+ }
1152
+
1153
+ /**
1154
+ * @method writeTrace
1155
+ * @desc write a trace in Payline log file
1156
+ * @param $trace : the string to add in the log file
1157
+ */
1158
+ public function writeTrace($trace){
1159
+ if(!isset($this->paylineTrace)){
1160
+ $this->paylineTrace = new Log(date('Y-m-d',time()).'.log');
1161
+ }
1162
+ $this->paylineTrace->write($trace);
1163
+ }
1164
+
1165
+ private function webServiceRequest($array,$WSRequest,$PaylineAPI,$Method){
1166
+ try{
1167
+ if(isset($array['Switch']['Forced'])){
1168
+ $this->init_config($Method,$array['Switch']['Forced'],$array['Switch']['Choice']);
1169
+ }else{
1170
+ $this->init_config($Method,'','');
1171
+ }
1172
+ if($this->CheckEndSwitch() && $this->IsSwitchingEnabled($Method) && !(isset($array['Switch']['Forced']) && $this->IsForceSwitch($array['Switch']['Forced']))){
1173
+ $this->NMAX_TENTATIVE = 1;
1174
+ }
1175
+ set_time_limit(0);
1176
+ $this->SetCallSocketTimeOut();
1177
+ $DateDebut = time();
1178
+ $this->VerifyIfAnotherWShasSwitch($Method);
1179
+ $client = new SoapClient(dirname(__FILE__).'/'.paylineSDK::WSDL, $this->header_soap);
1180
+ $client->__setLocation ($this->webServicesEndpoint.$PaylineAPI);
1181
+ $this->writeTrace("webServiceRequest($Method) - Location : ".$this->webServicesEndpoint.$PaylineAPI);
1182
+ if(isset($array['version'])&& strlen($array['version'])) $this->version = $array['version'];
1183
+ if(isset($array['media'])&& strlen($array['media'])) $this->media = $array['media'];
1184
+
1185
+ switch($Method){
1186
+ case 'createMerchant':
1187
+ $WSresponse = $client->createMerchant($WSRequest);
1188
+ break;
1189
+ case 'createWallet':
1190
+ $WSresponse = $client->createWallet($WSRequest);
1191
+ break;
1192
+ case 'createWebWallet':
1193
+ $WSresponse = $client->createWebWallet($WSRequest);
1194
+ break;
1195
+ case 'disablePaymentRecord':
1196
+ $WSresponse = $client->disablePaymentRecord($WSRequest);
1197
+ break;
1198
+ case 'disableWallet':
1199
+ $WSresponse = $client->disableWallet($WSRequest);
1200
+ break;
1201
+ case 'doAuthorization':
1202
+ $WSresponse = $client->doAuthorization($WSRequest);
1203
+ break;
1204
+ case 'doCapture':
1205
+ $WSresponse = $client->doCapture($WSRequest);
1206
+ break;
1207
+ case 'doCredit':
1208
+ $WSresponse = $client->doCredit($WSRequest);
1209
+ break;
1210
+ case 'doDebit':
1211
+ $WSresponse = $client->doDebit($WSRequest);
1212
+ break;
1213
+ case 'doImmediateWalletPayment':
1214
+ $WSresponse = $client->doImmediateWalletPayment($WSRequest);
1215
+ break;
1216
+ case 'doReAuthorization':
1217
+ $WSresponse = $client->doReAuthorization($WSRequest);
1218
+ break;
1219
+ case 'doRecurrentWalletPayment':
1220
+ $WSresponse = $client->doRecurrentWalletPayment($WSRequest);
1221
+ break;
1222
+ case 'doRefund':
1223
+ $WSresponse = $client->doRefund($WSRequest);
1224
+ break;
1225
+ case 'doReset':
1226
+ $WSresponse = $client->doReset($WSRequest);
1227
+ break;
1228
+ case 'doScheduledWalletPayment':
1229
+ $WSresponse = $client->doScheduledWalletPayment($WSRequest);
1230
+ break;
1231
+ case 'doScoringCheque':
1232
+ $WSresponse = $client->doScoringCheque($WSRequest);
1233
+ break;
1234
+ case 'doWebPayment':
1235
+ $WSresponse = $client->doWebPayment($WSRequest);
1236
+ break;
1237
+ case 'enableWallet':
1238
+ $WSresponse = $client->enableWallet($WSRequest);
1239
+ break;
1240
+ case 'getBalance':
1241
+ $WSresponse = $client->getBalance($WSRequest);
1242
+ break;
1243
+ case 'getCards':
1244
+ $WSresponse = $client->getCards($WSRequest);
1245
+ break;
1246
+ case 'getEncryptionKey':
1247
+ $WSresponse = $client->getEncryptionKey($WSRequest);
1248
+ break;
1249
+ case 'getMerchantSettings':
1250
+ $WSresponse = $client->getMerchantSettings($WSRequest);
1251
+ break;
1252
+ case 'getPaymentRecord':
1253
+ $WSresponse = $client->getPaymentRecord($WSRequest);
1254
+ break;
1255
+ case 'getTransactionDetails':
1256
+ $WSresponse = $client->getTransactionDetails($WSRequest);
1257
+ break;
1258
+ case 'getWallet':
1259
+ $WSresponse = $client->getWallet($WSRequest);
1260
+ break;
1261
+ case 'getWebPaymentDetails':
1262
+ $WSresponse = $client->getWebPaymentDetails($WSRequest);
1263
+ break;
1264
+ case 'getWebWallet':
1265
+ $WSresponse = $client->getWebWallet($WSRequest);
1266
+ break;
1267
+ case 'manageWebWallet' :
1268
+ $WSresponse = $client->manageWebWallet($WSRequest);
1269
+ break;
1270
+ case 'transactionsSearch':
1271
+ $WSresponse = $client->transactionsSearch($WSRequest);
1272
+ break;
1273
+ case 'updateWallet':
1274
+ $WSresponse = $client->updateWallet($WSRequest);
1275
+ break;
1276
+ case 'updateWebWallet':
1277
+ $WSresponse = $client->updateWebWallet($WSRequest);
1278
+ break;
1279
+ case 'verifyAuthentication':
1280
+ $WSresponse = $client->verifyAuthentication($WSRequest);
1281
+ break;
1282
+ case 'verifyEnrollment':
1283
+ $WSresponse = $client->verifyEnrollment($WSRequest);
1284
+ break;
1285
+
1286
+ }
1287
+
1288
+ $this->CURRENT_NUMBER_CALL++;
1289
+ $this->SetDefaultSocketTimeOut();
1290
+ if($Method == 'getCards'){
1291
+ $response = util::responseToArrayForGetCards($WSresponse);
1292
+
1293
+ }else{
1294
+ $response = util::responseToArray($WSresponse);
1295
+ }
1296
+ $response = $this->AddResponseSwitchingChain($Method,$response);
1297
+
1298
+ if($this->CheckForError($response)){
1299
+ throw new Exception('Technical Error : '+$response['result']['code']+' : '+$response['result']['shortMessage']+' : '+$response['result']['longMessage']);
1300
+ }else{
1301
+ if($this->CheckEndSwitch() && $this->IsSwitchingEnabled($Method) && !(isset($array['Switch']['Forced']) && $this->IsForceSwitch($array['Switch']['Forced']))){
1302
+ if(!$this->CheckIniValue('EndSwitchTry',0)){
1303
+ $jIniFileModifier = new jIniFileModifier((string)Mage::helper('payline')->ini_file);
1304
+ $jIniFileModifier->setValue('EndSwitchTry', 0, 'Switcher', null);
1305
+ $jIniFileModifier->save();
1306
+ }
1307
+ }
1308
+ $this->writeTrace("response return (code ".$response['result']['code'].")");
1309
+ return $response;
1310
+ }
1311
+ }catch ( Exception $e ) {
1312
+ $this->writeTrace("Exception : ".$e->getMessage());
1313
+ if($this->IsSwitchingEnabled($Method) && !(isset($array['Switch']['Forced']) && $this->IsForceSwitch($array['Switch']['Forced']))){
1314
+ $WS = $Method;
1315
+ return $this->Switcher($DateDebut,$Method,$WS,$WSRequest,$this->WSDL_DIRECT_SOAP);
1316
+ }
1317
+ return $e->getMessage();
1318
+ }
1319
+ }
1320
+
1321
+ public function createWallet($array){
1322
+ if(!isset($array['walletContracts'])||!strlen($array['walletContracts'][0]))$array['walletContracts'] = '';
1323
+ $WSRequest = array (
1324
+ 'version' => $array['version'], // modified by smile
1325
+ 'contractNumber' => $array['contractNumber'],
1326
+ 'wallet' => $this->wallet($array['wallet'],$array['address'],$array['card']),
1327
+ 'buyer' => $this->buyer($array['buyer'],$array['billingAddress'],$array['shippingAddress']),
1328
+ 'owner' => $this->owner($array['owner'],$array['ownerAddress']),
1329
+ 'privateDataList' => $this->privates,
1330
+ 'authentication3DSecure' =>$this->authentication3DSecure($array['3DSecure']),
1331
+ 'media' => $this->media,
1332
+ 'contractNumberWalletList' => $this->secondContracts($array['walletContracts'])
1333
+ );
1334
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'createWallet');
1335
+ }
1336
+
1337
+ public function createWebWallet($array){
1338
+ if(isset($array['customPaymentPageCode'])&& strlen($array['customPaymentPageCode'])) $this->customPaymentPageCode = $array['customPaymentPageCode'];
1339
+ if(isset($array['cancelURL'])&& strlen($array['cancelURL'])) $this->cancelURL = $array['cancelURL'];
1340
+ if(isset($array['notificationURL']) && strlen($array['notificationURL'])) $this->notificationURL = $array['notificationURL'];
1341
+ if(isset($array['returnURL'])&& strlen($array['returnURL'])) $this->returnURL = $array['returnURL'];
1342
+ if(isset($array['customPaymentTemplateURL'])&& strlen($array['customPaymentTemplateURL'])) $this->customPaymentTemplateURL = $array['customPaymentTemplateURL'];
1343
+ if(isset($array['customPaymentPageCode'])&& strlen($array['customPaymentPageCode'])) $this->customPaymentPageCode = $array['customPaymentPageCode'];
1344
+ if(isset($array['languageCode'])&& strlen($array['languageCode'])) $this->languageCode = $array['languageCode'];
1345
+ if(isset($array['securityMode'])&& strlen($array['securityMode'])) $this->securityMode = $array['securityMode'];
1346
+ if(!isset($array['contracts'])||!strlen($array['contracts'][0]))$array['contracts'] = '';
1347
+ if(!isset($array['walletContracts'])||!strlen($array['walletContracts'][0]))$array['walletContracts'] = '';
1348
+ $WSRequest = array (
1349
+ 'version' => $array['version'], // modified by smile
1350
+ 'contractNumber' => $array['contractNumber'],
1351
+ 'selectedContractList' => $this->contracts($array['contracts']),
1352
+ 'updatePersonalDetails' => $array['updatePersonalDetails'],
1353
+ 'buyer' => $this->buyer($array['buyer'],$array['billingAddress'],$array['shippingAddress']),
1354
+ 'languageCode' => $this->languageCode,
1355
+ 'customPaymentPageCode' => $this->customPaymentPageCode,
1356
+ 'securityMode' => $this->securityMode,
1357
+ 'returnURL' => $this->returnURL,
1358
+ 'cancelURL' => $this->cancelURL,
1359
+ 'notificationURL' => $this->notificationURL,
1360
+ 'privateDataList' => $this->privates,
1361
+ 'customPaymentTemplateURL' => $this->customPaymentTemplateURL,
1362
+ 'contractNumberWalletList' => $this->secondContracts($array['walletContracts'])
1363
+ );
1364
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::WEB_API,'createWebWallet');
1365
+ }
1366
+
1367
+ public function disablePaymentRecord($array){
1368
+ $WSRequest = array (
1369
+ 'contractNumber' => $array['contractNumber'],
1370
+ 'paymentRecordId' => $array['paymentRecordId']
1371
+ );
1372
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'disablePaymentRecord');
1373
+ }
1374
+
1375
+ public function disableWallet($array){
1376
+ $WSRequest = array (
1377
+ 'contractNumber' => $array['contractNumber'],
1378
+ 'walletIdList' => $this->walletIdList,
1379
+ 'cardInd' => $array['cardInd']
1380
+ );
1381
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'disableWallet');
1382
+ }
1383
+
1384
+ public function doAuthorization($array){
1385
+ if(!isset($array['buyer']))$array['buyer'] = null;
1386
+ if(!isset($array['billingAddress']))$array['billingAddress'] = null;
1387
+ if(!isset($array['shippingAddress']))$array['shippingAddress'] = null;
1388
+ $WSRequest = array (
1389
+ 'version' => $array['version'], // modified by smile
1390
+ 'payment' => $this->payment($array['payment']),
1391
+ 'card' => $this->card($array['card']),
1392
+ 'order' => $this->order($array['order']),
1393
+ 'buyer' => $this->buyer($array['buyer'],$array['billingAddress'],$array['shippingAddress']),
1394
+ 'privateDataList' => $this->privates,
1395
+ 'authentication3DSecure' =>$this->authentication3DSecure($array['3DSecure']),
1396
+ 'bankAccountData' => $this->bankAccountData($array['BankAccountData']),
1397
+ 'media' => $this->media
1398
+ );
1399
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'doAuthorization');
1400
+ }
1401
+
1402
+ public function doCapture($array){
1403
+ $WSRequest = array (
1404
+ 'version' => $array['version'], // modified by smile
1405
+ 'transactionID' =>$array['transactionID'],
1406
+ 'payment' => $this->payment($array['payment']),
1407
+ 'privateDataList' => $this->privates,
1408
+ 'sequenceNumber'=>$array['sequenceNumber'],
1409
+ 'media' => $this->media
1410
+ );
1411
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'doCapture');
1412
+ }
1413
+
1414
+ public function doCredit($array){
1415
+ if(!isset($array['buyer']))$array['buyer'] = null;
1416
+ if(!isset($array['billingAddress']))$array['billingAddress'] = null;
1417
+ if(!isset($array['shippingAddress']))$array['shippingAddress'] = null;
1418
+ $WSRequest = array (
1419
+ 'version' => $array['version'], // modified by smile
1420
+ 'payment' => $this->payment($array['payment']),
1421
+ 'card' => $this->card($array['card']),
1422
+ 'buyer' => $this->buyer($array['buyer'],$array['billingAddress'],$array['shippingAddress']),
1423
+ 'privateDataList' => $this->privates,
1424
+ 'order' => $this->order($array['order']),
1425
+ 'comment' =>$array['comment'],
1426
+ 'media' => $this->media
1427
+ );
1428
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'doCredit');
1429
+ }
1430
+
1431
+ public function doDebit($array){
1432
+ if(!isset($array['buyer']))$array['buyer'] = null;
1433
+ if(!isset($array['billingAddress']))$array['billingAddress'] = null;
1434
+ if(!isset($array['shippingAddress']))$array['shippingAddress'] = null;
1435
+ $WSRequest = array (
1436
+ 'version' => $array['version'], // modified by smile
1437
+ 'payment' => $this->payment($array['payment']),
1438
+ 'card' => $this->card($array['card']),
1439
+ 'order' => $this->order($array['order']),
1440
+ 'privateDataList' => $this->privates,
1441
+ 'buyer' => $this->buyer($array['buyer'],$array['billingAddress'],$array['shippingAddress']),
1442
+ 'authentication3DSecure' =>$this->authentication3DSecure($array['3DSecure']),
1443
+ 'authorization' =>$this->authorization($array['authorization']),
1444
+ 'media' => $this->media
1445
+ );
1446
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'doDebit');
1447
+ }
1448
+
1449
+ public function doImmediateWalletPayment($array){
1450
+ $WSRequest = array (
1451
+ 'version' => $array['version'], // modified by smile
1452
+ 'payment' => $this->payment($array['payment']),
1453
+ 'order' => $this->order($array['order']),
1454
+ 'walletId' => $array['walletId'],
1455
+ 'cardInd' => $array['cardInd'],
1456
+ 'privateDataList' => $this->privates,
1457
+ 'media' => $this->media,
1458
+ );
1459
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'doImmediateWalletPayment');
1460
+ }
1461
+
1462
+ public function doReAuthorization($array){
1463
+ $WSRequest = array (
1464
+ 'version' => $array['version'], // modified by smile
1465
+ 'transactionID' => $array['transactionID'],
1466
+ 'payment' => $this->payment($array['payment']),
1467
+ 'order' => $this->order($array['order']),
1468
+ 'privateDataList' => $this->privates,
1469
+ 'media' => $this->media
1470
+ );
1471
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'doReAuthorization');
1472
+ }
1473
+
1474
+ public function doRecurrentWalletPayment($array){
1475
+ $WSRequest = array (
1476
+ 'version' => $array['version'], // modified by smile
1477
+ 'payment' => $this->payment($array['payment']),
1478
+ 'orderRef' => $array['orderRef'],
1479
+ 'orderDate' => $array['orderDate'],
1480
+ 'scheduledDate' => $array['scheduled'],
1481
+ 'walletId' => $array['walletId'],
1482
+ 'cardInd' => $array['cardInd'],
1483
+ 'recurring' => $this->recurring($array['recurring']),
1484
+ 'privateDataList' => $this->privates,
1485
+ 'order' => $this->order($array['order']),
1486
+ 'media' => $this->media
1487
+ );
1488
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'doRecurrentWalletPayment');
1489
+ }
1490
+
1491
+ public function doRefund($array){
1492
+ $WSRequest = array (
1493
+ 'version' => $array['version'], // modified by smile
1494
+ 'transactionID' =>$array['transactionID'],
1495
+ 'payment' =>$this->payment($array['payment']),
1496
+ 'comment' =>$array['comment'],
1497
+ 'privateDataList' => $this->privates,
1498
+ 'sequenceNumber'=>$array['sequenceNumber'],
1499
+ 'media' => $this->media
1500
+ );
1501
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'doRefund');
1502
+ }
1503
+
1504
+ public function doReset($array){
1505
+ $WSRequest = array (
1506
+ 'version' => $array['version'], // modified by smile
1507
+ 'transactionID' => $array['transactionID'],
1508
+ 'comment' => $array['comment'],
1509
+ 'media' => $this->media
1510
+ );
1511
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'doReset');
1512
+ }
1513
+
1514
+ public function doScheduledWalletPayment($array){
1515
+ $WSRequest = array (
1516
+ 'version' => $array['version'], // modified by smile
1517
+ 'payment' => $this->payment($array['payment']),
1518
+ 'orderRef' => $array['orderRef'],
1519
+ 'orderDate' => $array['orderDate'],
1520
+ 'scheduledDate' => $array['scheduled'],
1521
+ 'walletId' => $array['walletId'],
1522
+ 'cardInd' => $array['cardInd'],
1523
+ 'order' => $this->order($array['order']),
1524
+ 'privateDataList' => $this->privates,
1525
+ 'media' => $this->media
1526
+ );
1527
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'doScheduledWalletPayment');
1528
+ }
1529
+
1530
+ public function doScoringCheque($array){
1531
+ $WSRequest = array (
1532
+ 'version' => $array['version'], // modified by smile
1533
+ 'payment' => $this->payment($array['payment']),
1534
+ 'cheque' => $this->cheque($array['cheque']),
1535
+ 'order' => $this->order($array['order']),
1536
+ 'privateDataList' => $this->privates,
1537
+ 'media' => $this->media
1538
+ );
1539
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'doScoringCheque');
1540
+ }
1541
+
1542
+ public function doWebPayment($array){
1543
+ if(isset($array['cancelURL'])&& strlen($array['cancelURL'])) $this->cancelURL = $array['cancelURL'];
1544
+ if(isset($array['notificationURL']) && strlen($array['notificationURL'])) $this->notificationURL = $array['notificationURL'];
1545
+ if(isset($array['returnURL'])&& strlen($array['returnURL'])) $this->returnURL = $array['returnURL'];
1546
+ if(isset($array['customPaymentTemplateURL'])&& strlen($array['customPaymentTemplateURL'])) $this->customPaymentTemplateURL = $array['customPaymentTemplateURL'];
1547
+ if(isset($array['customPaymentPageCode'])&& strlen($array['customPaymentPageCode'])) $this->customPaymentPageCode = $array['customPaymentPageCode'];
1548
+ if(isset($array['languageCode'])&& strlen($array['languageCode'])) $this->languageCode = $array['languageCode'];
1549
+ if(isset($array['securityMode'])&& strlen($array['securityMode'])) $this->securityMode = $array['securityMode'];
1550
+ if(!isset($array['payment']))$array['payment'] = null;
1551
+ if(!isset($array['contracts'])||!strlen($array['contracts'][0]))$array['contracts'] = '';
1552
+ if(!isset($array['secondContracts'])||!strlen($array['secondContracts'][0]))$array['secondContracts'] = '';
1553
+ if(!isset($array['walletContracts'])||!strlen($array['walletContracts'][0]))$array['walletContracts'] = '';
1554
+ if(!isset($array['buyer']))$array['buyer'] = null;
1555
+ if(!isset($array['billingAddress']))$array['billingAddress'] = null;
1556
+ if(!isset($array['shippingAddress']))$array['shippingAddress'] = null;
1557
+ if(!isset($array['recurring']))$array['recurring'] = null;
1558
+ $WSRequest = array (
1559
+ 'version' => $array['version'], // modified by smile
1560
+ 'payment' => $this->payment($array['payment']),
1561
+ 'returnURL' => $this->returnURL,
1562
+ 'cancelURL' => $this->cancelURL,
1563
+ 'order' => $this->order($array['order']),
1564
+ 'notificationURL' => $this->notificationURL,
1565
+ 'customPaymentTemplateURL' => $this->customPaymentTemplateURL,
1566
+ 'selectedContractList' => $this->contracts($array['contracts']),
1567
+ 'secondSelectedContractList' => $this->secondContracts($array['secondContracts']),
1568
+ 'privateDataList' => $this->privates,
1569
+ 'languageCode' => $this->languageCode,
1570
+ 'customPaymentPageCode' => $this->customPaymentPageCode,
1571
+ 'buyer' => $this->buyer($array['buyer'],$array['billingAddress'],$array['shippingAddress']),
1572
+ 'securityMode' => $this->securityMode,
1573
+ 'contractNumberWalletList' => $this->secondContracts($array['walletContracts'])
1574
+ );
1575
+
1576
+ if(isset($array['payment']['mode'])){
1577
+ if(($array['payment']['mode'] == "REC") || ($array['payment']['mode'] == "NX")) {
1578
+ $WSRequest['recurring'] = $this->recurring($array['recurring']);
1579
+ }
1580
+ }
1581
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::WEB_API,'doWebPayment');
1582
+ }
1583
+
1584
+ public function enableWallet($array){
1585
+ $WSRequest = array (
1586
+ 'contractNumber' => $array['contractNumber'],
1587
+ 'walletId' => $array['walletId'],
1588
+ 'cardInd' => $array['cardInd']
1589
+ );
1590
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'enableWallet');
1591
+ }
1592
+
1593
+ public function getBalance($array){
1594
+ $WSRequest = array(
1595
+ 'contractNumber' => $array['contractNumber'],
1596
+ 'cardID' => $array['cardID']
1597
+ );
1598
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'getBalance');
1599
+ }
1600
+
1601
+ public function getCards($array){
1602
+ $WSRequest = array (
1603
+ 'contractNumber' => $array['contractNumber'],
1604
+ 'walletId' => $array['walletId'],
1605
+ 'cardInd' => $array['cardInd']
1606
+ );
1607
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'getCards');
1608
+ }
1609
+
1610
+ public function getEncryptionKey($array){
1611
+ $WSRequest = array();
1612
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'getEncryptionKey');
1613
+ }
1614
+
1615
+ public function getMerchantSettings($array){
1616
+ $WSRequest = array(
1617
+ 'version' => $array['version'] // modified by smile
1618
+ );
1619
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'getMerchantSettings');
1620
+ }
1621
+
1622
+ public function getPaymentRecord($array){
1623
+ $WSRequest = array (
1624
+ 'version' => $array['version'], // modified by smile
1625
+ 'contractNumber' => $array['contractNumber'],
1626
+ 'paymentRecordId' => $array['paymentRecordId']
1627
+ );
1628
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'getPaymentRecord');
1629
+ }
1630
+ public function getTransactionDetails($array){
1631
+ $WSRequest = array (
1632
+ 'version' => $array['version'], // modified by smile
1633
+ 'transactionId' => $array['transactionId'],
1634
+ 'orderRef' => $array['orderRef'],
1635
+ 'startDate' => $array['startDate'],
1636
+ 'endDate' => $array['endDate'],
1637
+ 'transactionHistory' => $array['transactionHistory'],
1638
+ 'archiveSearch' => $array['archiveSearch']
1639
+ );
1640
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::EXTENDED_API,'getTransactionDetails');
1641
+ }
1642
+ public function getWallet($array){
1643
+ $WSRequest = array (
1644
+ 'version' => $array['version'], // modified by smile
1645
+ 'contractNumber' => $array['contractNumber'],
1646
+ 'walletId' => $array['walletId'],
1647
+ 'cardInd' => $array['cardInd'],
1648
+ 'media' => $this->media
1649
+ );
1650
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'getWallet');
1651
+ }
1652
+
1653
+ public function getWebPaymentDetails($array){
1654
+ $this->TokenSwitch($array['token']);
1655
+ return $this->webServiceRequest($array,$array,paylineSDK::WEB_API,'getWebPaymentDetails');
1656
+ }
1657
+
1658
+ public function getWebWallet($array){
1659
+ $this->TokenSwitch($array['token']);
1660
+ return $this->webServiceRequest($array,$array,paylineSDK::WEB_API,'getWebWallet');
1661
+ }
1662
+
1663
+ public function manageWebWallet($array){
1664
+ if(isset($array['cancelURL'])&& strlen($array['cancelURL'])) $this->cancelURL = $array['cancelURL'];
1665
+ if(isset($array['notificationURL']) && strlen($array['notificationURL'])) $this->notificationURL = $array['notificationURL'];
1666
+ if(isset($array['returnURL'])&& strlen($array['returnURL'])) $this->returnURL = $array['returnURL'];
1667
+ if(!isset($array['buyer']))$array['buyer'] = null;
1668
+ if(!isset($array['billingAddress']))$array['billingAddress'] = null;
1669
+ if(!isset($array['shippingAddress']))$array['shippingAddress'] = null;
1670
+ if(!isset($array['owner']))$array['owner'] = null;
1671
+ if(!isset($array['ownerAddress']))$array['ownerAddress'] = null;
1672
+ if(!isset($array['contracts'])||!strlen($array['contracts'][0]))$array['contracts'] = '';
1673
+ if(!isset($array['walletContracts'])||!strlen($array['walletContracts'][0]))$array['walletContracts'] = '';
1674
+ if(isset($array['customPaymentPageCode'])&& strlen($array['customPaymentPageCode'])) $this->customPaymentPageCode = $array['customPaymentPageCode'];
1675
+ if(isset($array['customPaymentTemplateURL'])&& strlen($array['customPaymentTemplateURL'])) $this->customPaymentTemplateURL = $array['customPaymentTemplateURL'];
1676
+ $WSRequest = array (
1677
+ 'version' => $array['version'], // modified by smile
1678
+ 'contractNumber' => $array['contractNumber'],
1679
+ 'selectedContractList' => $this->contracts($array['contracts']),
1680
+ 'updatePersonalDetails' => $array['updatePersonalDetails'],
1681
+ 'buyer' => $this->buyer($array['buyer'],$array['billingAddress'],$array['shippingAddress']),
1682
+ 'owner' => $this->owner($array['owner'],$array['ownerAddress']),
1683
+ 'languageCode' => $array['languageCode'],
1684
+ 'customPaymentPageCode' => $array['customPaymentPageCode'],
1685
+ 'securityMode' => $array['securityMode'],
1686
+ 'returnURL' => $this->returnURL,
1687
+ 'cancelURL' => $this->cancelURL,
1688
+ 'notificationURL' => $this->notificationURL,
1689
+ 'privateDataList' => $this->privates,
1690
+ 'customPaymentTemplateURL' => $array['customPaymentTemplateURL'],
1691
+ 'contractNumberWalletList' => $this->secondContracts($array['walletContracts'])
1692
+ );
1693
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::WEB_API,'manageWebWallet');
1694
+ }
1695
+
1696
+ public function transactionsSearch($array){
1697
+ $WSRequest = array (
1698
+ 'version' => $array['version'], // modified by smile
1699
+ 'transactionId' => $array['transactionId'],
1700
+ 'orderRef' => $array['orderRef'],
1701
+ 'startDate' => $array['startDate'],
1702
+ 'endDate' => $array['endDate'],
1703
+ 'contractNumber' => $array['contractNumber'],
1704
+ 'authorizationNumber' => $array['authorizationNumber'],
1705
+ 'returnCode' => $array['returnCode'],
1706
+ 'paymentMean' => $array['paymentMean'],
1707
+ 'transactionType' => $array['transactionType'],
1708
+ 'name' => $array['name'],
1709
+ 'firstName' => $array['firstName'],
1710
+ 'email' => $array['email'],
1711
+ 'cardNumber' => $array['cardNumber'],
1712
+ 'currency' => $array['currency'],
1713
+ 'minAmount' => $array['minAmount'],
1714
+ 'maxAmount' => $array['maxAmount'],
1715
+ 'walletId' => $array['walletId'],
1716
+ 'sequenceNumber' => $array['sequenceNumber'],
1717
+ 'token' => $array['token']
1718
+ );
1719
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::EXTENDED_API,'transactionsSearch');
1720
+ }
1721
+
1722
+ public function updateWallet($array){
1723
+ $WSRequest = array (
1724
+ 'version' => $array['version'], // modified by smile
1725
+ 'contractNumber' => $array['contractNumber'],
1726
+ 'cardInd' => $array['cardInd'],
1727
+ 'wallet' => $this->wallet($array['wallet'],$array['address'],$array['card']),
1728
+ 'buyer' => $this->buyer($array['buyer'], $array['billingAddress'],$array['shippingAddress']),
1729
+ 'owner' => $this->owner($array['owner'],$array['ownerAddress']),
1730
+ 'privateDataList' => $this->privates,
1731
+ 'authentication3DSecure' =>$this->authentication3DSecure($array['3DSecure']),
1732
+ 'media' => $this->media,
1733
+ 'contractNumberWalletList' => $this->secondContracts($array['walletContracts'])
1734
+ );
1735
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'updateWallet');
1736
+ }
1737
+
1738
+ public function updateWebWallet($array){
1739
+ if(isset($array['cancelURL'])&& strlen($array['cancelURL'])) $this->cancelURL = $array['cancelURL'];
1740
+ if(isset($array['notificationURL']) && strlen($array['notificationURL'])) $this->notificationURL = $array['notificationURL'];
1741
+ if(isset($array['returnURL'])&& strlen($array['returnURL'])) $this->returnURL = $array['returnURL'];
1742
+ if(isset($array['customPaymentTemplateURL'])&& strlen($array['customPaymentTemplateURL'])) $this->customPaymentTemplateURL = $array['customPaymentTemplateURL'];
1743
+ if(isset($array['customPaymentPageCode'])&& strlen($array['customPaymentPageCode'])) $this->customPaymentPageCode = $array['customPaymentPageCode'];
1744
+ if(isset($array['languageCode'])&& strlen($array['languageCode'])) $this->languageCode = $array['languageCode'];
1745
+ if(isset($array['securityMode'])&& strlen($array['securityMode'])) $this->securityMode = $array['securityMode'];
1746
+ if(!isset($array['walletContracts'])||!strlen($array['walletContracts'][0]))$array['walletContracts'] = '';
1747
+ $WSRequest = array (
1748
+ 'version' => $array['version'], // modified by smile
1749
+ 'contractNumber' => $array['contractNumber'],
1750
+ 'cardInd' => $array['cardInd'],
1751
+ 'walletId' => $array['walletId'],
1752
+ 'updatePersonalDetails' => $array['updatePersonalDetails'],
1753
+ 'updateOwnerDetails' => $array['updateOwnerDetails'],
1754
+ 'updatePaymentDetails' => $array['updatePaymentDetails'],
1755
+ 'buyer' => $this->buyer($array['buyer'],$array['billingAddress'],$array['shippingAddress']),
1756
+ 'languageCode' => $this->languageCode,
1757
+ 'customPaymentPageCode' => $this->customPaymentPageCode,
1758
+ 'securityMode' => $this->securityMode,
1759
+ 'returnURL' => $this->returnURL,
1760
+ 'cancelURL' => $this->cancelURL,
1761
+ 'notificationURL' => $this->notificationURL,
1762
+ 'privateDataList' => $this->privates,
1763
+ 'customPaymentTemplateURL' => $this->customPaymentTemplateURL,
1764
+ 'contractNumberWalletList' => $this->secondContracts($array['walletContracts'])
1765
+ );
1766
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::WEB_API,'updateWebWallet');
1767
+ }
1768
+
1769
+ public function verifyAuthentication($array){
1770
+ $WSRequest = array (
1771
+ 'contractNumber' => $array['contractNumber'],
1772
+ 'pares' => $array['pares'],
1773
+ 'md' => $array['md'],
1774
+ 'card' => $this->card($array['card'])
1775
+ );
1776
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'verifyAuthentication');
1777
+ }
1778
+
1779
+ public function verifyEnrollment($array){
1780
+ $WSRequest = array (
1781
+ 'payment' => $this->payment($array['payment']),
1782
+ 'card' => $this->card($array['card']),
1783
+ 'orderRef' => $array['orderRef'],
1784
+ 'userAgent' => $array['userAgent']
1785
+ );
1786
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'verifyEnrollment');
1787
+ }
1788
+ }
1789
+ ?>
app/code/community/Monext/Payline/PaylinePHPKit/logs/2013-07-10.log ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 2013-07-10 11:43:42 - ----------------------------------------------------------
2
+ 2013-07-10 11:43:42 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
3
+ 2013-07-10 11:43:43 - webServiceRequest(getWallet) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
4
+ 2013-07-10 11:43:44 - response return (code 02303)
5
+ 2013-07-10 11:46:20 - ----------------------------------------------------------
6
+ 2013-07-10 11:46:20 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
7
+ 2013-07-10 11:46:20 - webServiceRequest(getWallet) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
8
+ 2013-07-10 11:46:21 - response return (code 02303)
9
+ 2013-07-10 11:46:21 - ----------------------------------------------------------
10
+ 2013-07-10 11:46:21 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
11
+ 2013-07-10 11:46:21 - webServiceRequest(getWallet) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
12
+ 2013-07-10 11:46:22 - response return (code 02303)
13
+ 2013-07-10 11:46:31 - ----------------------------------------------------------
14
+ 2013-07-10 11:46:31 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
15
+ 2013-07-10 11:46:31 - webServiceRequest(getWallet) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
16
+ 2013-07-10 11:46:32 - response return (code 02303)
17
+ 2013-07-10 11:47:17 - ----------------------------------------------------------
18
+ 2013-07-10 11:47:17 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
19
+ 2013-07-10 11:47:17 - webServiceRequest(getWallet) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
20
+ 2013-07-10 11:47:18 - response return (code 02303)
21
+ 2013-07-10 11:47:18 - ----------------------------------------------------------
22
+ 2013-07-10 11:47:18 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
23
+ 2013-07-10 11:47:18 - webServiceRequest(getWallet) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
24
+ 2013-07-10 11:47:19 - response return (code 02303)
25
+ 2013-07-10 12:19:29 - ----------------------------------------------------------
26
+ 2013-07-10 12:19:29 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
27
+ 2013-07-10 12:19:29 - webServiceRequest(getMerchantSettings) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
28
+ 2013-07-10 12:19:30 - response return (code 00000)
29
+ 2013-07-10 12:19:51 - ----------------------------------------------------------
30
+ 2013-07-10 12:19:51 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
31
+ 2013-07-10 12:19:51 - webServiceRequest(getMerchantSettings) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
32
+ 2013-07-10 12:19:52 - response return (code 00000)
33
+ 2013-07-10 12:21:30 - ----------------------------------------------------------
34
+ 2013-07-10 12:21:30 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
35
+ 2013-07-10 12:21:30 - webServiceRequest(getMerchantSettings) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
36
+ 2013-07-10 12:21:31 - response return (code 00000)
37
+ 2013-07-10 12:22:21 - ----------------------------------------------------------
38
+ 2013-07-10 12:22:21 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
39
+ 2013-07-10 12:22:21 - webServiceRequest(getWallet) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
40
+ 2013-07-10 12:22:22 - response return (code 02500)
41
+ 2013-07-10 13:35:34 - ----------------------------------------------------------
42
+ 2013-07-10 13:35:34 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
43
+ 2013-07-10 13:35:34 - webServiceRequest(getWallet) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
44
+ 2013-07-10 13:35:35 - response return (code 02500)
app/code/community/Monext/Payline/PaylinePHPKit/logs/2014-01-21.log ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 2014-01-21 16:38:48 - ----------------------------------------------------------
2
+ 2014-01-21 16:38:48 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
3
+ 2014-01-21 16:38:49 - webServiceRequest(getMerchantSettings) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
4
+ 2014-01-21 16:38:49 - response return (code 00000)
5
+ 2014-01-21 16:38:57 - ----------------------------------------------------------
6
+ 2014-01-21 16:38:57 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
7
+ 2014-01-21 16:38:57 - webServiceRequest(getMerchantSettings) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
8
+ 2014-01-21 16:38:58 - response return (code 00000)
9
+ 2014-01-21 16:44:36 - ----------------------------------------------------------
10
+ 2014-01-21 16:44:36 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
11
+ 2014-01-21 16:44:36 - webServiceRequest(doAuthorization) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
12
+ 2014-01-21 16:44:38 - response return (code 00000)
13
+ 2014-01-21 16:44:38 - webServiceRequest(getTransactionDetails) - Location : https://homologation.payline.com/V4/services/ExtendedAPI
14
+ 2014-01-21 16:44:38 - response return (code 00000)
15
+ 2014-01-21 16:44:39 - webServiceRequest(createWallet) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
16
+ 2014-01-21 16:44:40 - response return (code 02500)
17
+ 2014-01-21 16:50:33 - ----------------------------------------------------------
18
+ 2014-01-21 16:50:33 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
19
+ 2014-01-21 16:50:33 - webServiceRequest(getWallet) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
20
+ 2014-01-21 16:50:34 - response return (code 02500)
21
+ 2014-01-21 16:54:58 - ----------------------------------------------------------
22
+ 2014-01-21 16:54:58 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
23
+ 2014-01-21 16:54:58 - webServiceRequest(doAuthorization) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
24
+ 2014-01-21 16:54:59 - response return (code 00000)
25
+ 2014-01-21 16:54:59 - webServiceRequest(getTransactionDetails) - Location : https://homologation.payline.com/V4/services/ExtendedAPI
26
+ 2014-01-21 16:55:00 - response return (code 00000)
27
+ 2014-01-21 16:56:10 - ----------------------------------------------------------
28
+ 2014-01-21 16:56:10 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
29
+ 2014-01-21 16:56:10 - webServiceRequest(doImmediateWalletPayment) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
30
+ 2014-01-21 16:56:12 - response return (code 00000)
31
+ 2014-01-21 16:56:12 - webServiceRequest(getTransactionDetails) - Location : https://homologation.payline.com/V4/services/ExtendedAPI
32
+ 2014-01-21 16:56:12 - response return (code 00000)
33
+ 2014-01-21 16:56:59 - ----------------------------------------------------------
34
+ 2014-01-21 16:56:59 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
35
+ 2014-01-21 16:56:59 - webServiceRequest(updateWebWallet) - Location : https://homologation.payline.com/V4/services/WebPaymentAPI
36
+ 2014-01-21 16:57:00 - response return (code 00000)
37
+ 2014-01-21 16:57:19 - ----------------------------------------------------------
38
+ 2014-01-21 16:57:19 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
39
+ 2014-01-21 16:57:19 - webServiceRequest(updateWebWallet) - Location : https://homologation.payline.com/V4/services/WebPaymentAPI
40
+ 2014-01-21 16:57:20 - response return (code 00000)
41
+ 2014-01-21 16:57:56 - ----------------------------------------------------------
42
+ 2014-01-21 16:57:56 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
43
+ 2014-01-21 16:57:56 - webServiceRequest(getWebWallet) - Location : https://homologation.payline.com/V4/services/WebPaymentAPI
44
+ 2014-01-21 16:57:57 - response return (code 02500)
45
+ 2014-01-21 16:57:57 - ----------------------------------------------------------
46
+ 2014-01-21 16:57:57 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
47
+ 2014-01-21 16:57:57 - webServiceRequest(getWallet) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
48
+ 2014-01-21 16:57:58 - response return (code 02500)
49
+ 2014-01-21 16:58:25 - ----------------------------------------------------------
50
+ 2014-01-21 16:58:25 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
51
+ 2014-01-21 16:58:25 - webServiceRequest(doImmediateWalletPayment) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
52
+ 2014-01-21 16:58:26 - response return (code 00000)
53
+ 2014-01-21 16:58:26 - webServiceRequest(getTransactionDetails) - Location : https://homologation.payline.com/V4/services/ExtendedAPI
54
+ 2014-01-21 16:58:26 - response return (code 00000)
55
+ 2014-01-21 16:59:50 - ----------------------------------------------------------
56
+ 2014-01-21 16:59:50 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
57
+ 2014-01-21 16:59:50 - webServiceRequest(disableWallet) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
58
+ 2014-01-21 16:59:51 - response return (code 02500)
59
+ 2014-01-21 16:59:54 - ----------------------------------------------------------
60
+ 2014-01-21 16:59:54 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
61
+ 2014-01-21 16:59:54 - webServiceRequest(createWebWallet) - Location : https://homologation.payline.com/V4/services/WebPaymentAPI
62
+ 2014-01-21 16:59:55 - response return (code 00000)
63
+ 2014-01-21 17:00:15 - ----------------------------------------------------------
64
+ 2014-01-21 17:00:15 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
65
+ 2014-01-21 17:00:15 - webServiceRequest(getWebWallet) - Location : https://homologation.payline.com/V4/services/WebPaymentAPI
66
+ 2014-01-21 17:00:16 - response return (code 02500)
67
+ 2014-01-21 17:00:16 - ----------------------------------------------------------
68
+ 2014-01-21 17:00:16 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
69
+ 2014-01-21 17:00:16 - webServiceRequest(getWallet) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
70
+ 2014-01-21 17:00:17 - response return (code 02500)
71
+ 2014-01-21 17:00:42 - ----------------------------------------------------------
72
+ 2014-01-21 17:00:42 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
73
+ 2014-01-21 17:00:42 - webServiceRequest(doImmediateWalletPayment) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
74
+ 2014-01-21 17:00:44 - response return (code 00000)
75
+ 2014-01-21 17:00:44 - webServiceRequest(getTransactionDetails) - Location : https://homologation.payline.com/V4/services/ExtendedAPI
76
+ 2014-01-21 17:00:44 - response return (code 00000)
77
+ 2014-01-21 17:02:12 - ----------------------------------------------------------
78
+ 2014-01-21 17:02:12 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
79
+ 2014-01-21 17:02:12 - webServiceRequest(doWebPayment) - Location : https://homologation.payline.com/V4/services/WebPaymentAPI
80
+ 2014-01-21 17:02:14 - response return (code 00000)
81
+ 2014-01-21 17:02:20 - ----------------------------------------------------------
82
+ 2014-01-21 17:02:20 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
83
+ 2014-01-21 17:02:20 - webServiceRequest(getWebPaymentDetails) - Location : https://homologation.payline.com/V4/services/WebPaymentAPI
84
+ 2014-01-21 17:02:22 - response return (code 02500)
85
+ 2014-01-21 17:10:35 - ----------------------------------------------------------
86
+ 2014-01-21 17:10:35 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
87
+ 2014-01-21 17:10:35 - webServiceRequest(doAuthorization) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
88
+ 2014-01-21 17:10:36 - response return (code 00000)
89
+ 2014-01-21 17:10:36 - webServiceRequest(getTransactionDetails) - Location : https://homologation.payline.com/V4/services/ExtendedAPI
90
+ 2014-01-21 17:10:37 - response return (code 00000)
91
+ 2014-01-21 17:15:25 - ----------------------------------------------------------
92
+ 2014-01-21 17:15:25 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
93
+ 2014-01-21 17:15:25 - webServiceRequest(doAuthorization) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
94
+ 2014-01-21 17:15:26 - response return (code 00000)
95
+ 2014-01-21 17:15:26 - webServiceRequest(getTransactionDetails) - Location : https://homologation.payline.com/V4/services/ExtendedAPI
96
+ 2014-01-21 17:15:26 - response return (code 00000)
97
+ 2014-01-21 17:15:28 - webServiceRequest(createWallet) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
98
+ 2014-01-21 17:15:30 - response return (code 02500)
99
+ 2014-01-21 17:27:39 - ----------------------------------------------------------
100
+ 2014-01-21 17:27:39 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
101
+ 2014-01-21 17:27:39 - webServiceRequest(doWebPayment) - Location : https://homologation.payline.com/V4/services/WebPaymentAPI
102
+ 2014-01-21 17:27:40 - response return (code 00000)
103
+ 2014-01-21 17:27:44 - ----------------------------------------------------------
104
+ 2014-01-21 17:27:44 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
105
+ 2014-01-21 17:27:44 - webServiceRequest(getWebPaymentDetails) - Location : https://homologation.payline.com/V4/services/WebPaymentAPI
106
+ 2014-01-21 17:27:45 - Exception : 2101
app/code/community/Monext/Payline/PaylinePHPKit/logs/2014-01-28.log ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 2014-01-28 14:12:49 - ----------------------------------------------------------
2
+ 2014-01-28 14:12:49 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
3
+ 2014-01-28 14:12:49 - webServiceRequest(getWallet) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
4
+ 2014-01-28 14:12:50 - response return (code 02500)
5
+ 2014-01-28 14:13:21 - ----------------------------------------------------------
6
+ 2014-01-28 14:13:21 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
7
+ 2014-01-28 14:13:21 - webServiceRequest(doWebPayment) - Location : https://homologation.payline.com/V4/services/WebPaymentAPI
8
+ 2014-01-28 14:13:22 - response return (code 00000)
9
+ 2014-01-28 14:14:13 - ----------------------------------------------------------
10
+ 2014-01-28 14:14:13 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
11
+ 2014-01-28 14:14:13 - webServiceRequest(getWebPaymentDetails) - Location : https://homologation.payline.com/V4/services/WebPaymentAPI
12
+ 2014-01-28 14:14:16 - response return (code 21000)
13
+ 2014-01-28 14:14:55 - ----------------------------------------------------------
14
+ 2014-01-28 14:14:55 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
15
+ 2014-01-28 14:14:55 - webServiceRequest(doWebPayment) - Location : https://homologation.payline.com/V4/services/WebPaymentAPI
16
+ 2014-01-28 14:14:56 - response return (code 00000)
17
+ 2014-01-28 14:14:59 - ----------------------------------------------------------
18
+ 2014-01-28 14:14:59 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
19
+ 2014-01-28 14:14:59 - webServiceRequest(getWebPaymentDetails) - Location : https://homologation.payline.com/V4/services/WebPaymentAPI
20
+ 2014-01-28 14:15:00 - Exception : 2101
21
+ 2014-01-28 16:51:13 - ----------------------------------------------------------
22
+ 2014-01-28 16:51:13 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
23
+ 2014-01-28 16:51:13 - webServiceRequest(getMerchantSettings) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
24
+ 2014-01-28 16:51:14 - response return (code 00000)
25
+ 2014-01-28 17:10:20 - ----------------------------------------------------------
26
+ 2014-01-28 17:10:20 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
27
+ 2014-01-28 17:10:20 - webServiceRequest(doAuthorization) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
28
+ 2014-01-28 17:10:21 - response return (code 00000)
29
+ 2014-01-28 17:10:21 - webServiceRequest(getTransactionDetails) - Location : https://homologation.payline.com/V4/services/ExtendedAPI
30
+ 2014-01-28 17:10:22 - response return (code 00000)
31
+ 2014-01-28 17:10:22 - webServiceRequest(createWallet) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
32
+ 2014-01-28 17:10:23 - response return (code 02500)
33
+ 2014-01-28 17:13:11 - ----------------------------------------------------------
34
+ 2014-01-28 17:13:11 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
35
+ 2014-01-28 17:13:11 - webServiceRequest(getWallet) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
36
+ 2014-01-28 17:13:12 - response return (code 02500)
37
+ 2014-01-28 17:15:56 - ----------------------------------------------------------
38
+ 2014-01-28 17:15:56 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
39
+ 2014-01-28 17:15:56 - webServiceRequest(doAuthorization) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
40
+ 2014-01-28 17:15:57 - response return (code 00000)
41
+ 2014-01-28 17:15:57 - webServiceRequest(getTransactionDetails) - Location : https://homologation.payline.com/V4/services/ExtendedAPI
42
+ 2014-01-28 17:15:58 - response return (code 00000)
43
+ 2014-01-28 17:16:20 - ----------------------------------------------------------
44
+ 2014-01-28 17:16:20 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
45
+ 2014-01-28 17:16:20 - webServiceRequest(getWallet) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
46
+ 2014-01-28 17:16:21 - response return (code 02500)
47
+ 2014-01-28 17:18:38 - ----------------------------------------------------------
48
+ 2014-01-28 17:18:38 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
49
+ 2014-01-28 17:18:38 - webServiceRequest(doImmediateWalletPayment) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
50
+ 2014-01-28 17:18:40 - response return (code 00000)
51
+ 2014-01-28 17:18:40 - webServiceRequest(getTransactionDetails) - Location : https://homologation.payline.com/V4/services/ExtendedAPI
52
+ 2014-01-28 17:18:41 - response return (code 00000)
53
+ 2014-01-28 17:19:35 - ----------------------------------------------------------
54
+ 2014-01-28 17:19:35 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
55
+ 2014-01-28 17:19:35 - webServiceRequest(doWebPayment) - Location : https://homologation.payline.com/V4/services/WebPaymentAPI
56
+ 2014-01-28 17:19:36 - response return (code 00000)
57
+ 2014-01-28 17:19:43 - ----------------------------------------------------------
58
+ 2014-01-28 17:19:43 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
59
+ 2014-01-28 17:19:43 - webServiceRequest(getWebPaymentDetails) - Location : https://homologation.payline.com/V4/services/WebPaymentAPI
60
+ 2014-01-28 17:19:44 - response return (code 00000)
61
+ 2014-01-28 17:21:22 - ----------------------------------------------------------
62
+ 2014-01-28 17:21:22 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
63
+ 2014-01-28 17:21:22 - webServiceRequest(updateWebWallet) - Location : https://homologation.payline.com/V4/services/WebPaymentAPI
64
+ 2014-01-28 17:21:23 - response return (code 00000)
65
+ 2014-01-28 17:21:54 - ----------------------------------------------------------
66
+ 2014-01-28 17:21:54 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
67
+ 2014-01-28 17:21:54 - webServiceRequest(getWebWallet) - Location : https://homologation.payline.com/V4/services/WebPaymentAPI
68
+ 2014-01-28 17:21:55 - response return (code 02500)
69
+ 2014-01-28 17:21:56 - ----------------------------------------------------------
70
+ 2014-01-28 17:21:56 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
71
+ 2014-01-28 17:21:56 - webServiceRequest(getWallet) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
72
+ 2014-01-28 17:21:57 - response return (code 02500)
73
+ 2014-01-28 17:22:13 - ----------------------------------------------------------
74
+ 2014-01-28 17:22:13 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
75
+ 2014-01-28 17:22:13 - webServiceRequest(disableWallet) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
76
+ 2014-01-28 17:22:14 - response return (code 02500)
77
+ 2014-01-28 17:22:22 - ----------------------------------------------------------
78
+ 2014-01-28 17:22:22 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
79
+ 2014-01-28 17:22:22 - webServiceRequest(createWebWallet) - Location : https://homologation.payline.com/V4/services/WebPaymentAPI
80
+ 2014-01-28 17:22:23 - response return (code 00000)
81
+ 2014-01-28 17:22:44 - ----------------------------------------------------------
82
+ 2014-01-28 17:22:44 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
83
+ 2014-01-28 17:22:44 - webServiceRequest(getWebWallet) - Location : https://homologation.payline.com/V4/services/WebPaymentAPI
84
+ 2014-01-28 17:22:45 - response return (code 02500)
85
+ 2014-01-28 17:22:46 - ----------------------------------------------------------
86
+ 2014-01-28 17:22:46 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
87
+ 2014-01-28 17:22:46 - webServiceRequest(getWallet) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
88
+ 2014-01-28 17:22:47 - response return (code 02500)
89
+ 2014-01-28 17:22:51 - ----------------------------------------------------------
90
+ 2014-01-28 17:22:51 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
91
+ 2014-01-28 17:22:51 - webServiceRequest(updateWebWallet) - Location : https://homologation.payline.com/V4/services/WebPaymentAPI
92
+ 2014-01-28 17:22:52 - response return (code 00000)
93
+ 2014-01-28 17:23:13 - ----------------------------------------------------------
94
+ 2014-01-28 17:23:13 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
95
+ 2014-01-28 17:23:13 - webServiceRequest(updateWebWallet) - Location : https://homologation.payline.com/V4/services/WebPaymentAPI
96
+ 2014-01-28 17:23:14 - response return (code 00000)
97
+ 2014-01-28 17:23:32 - ----------------------------------------------------------
98
+ 2014-01-28 17:23:32 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
99
+ 2014-01-28 17:23:32 - webServiceRequest(updateWebWallet) - Location : https://homologation.payline.com/V4/services/WebPaymentAPI
100
+ 2014-01-28 17:23:33 - response return (code 00000)
101
+ 2014-01-28 17:24:07 - ----------------------------------------------------------
102
+ 2014-01-28 17:24:07 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
103
+ 2014-01-28 17:24:07 - webServiceRequest(getWebWallet) - Location : https://homologation.payline.com/V4/services/WebPaymentAPI
104
+ 2014-01-28 17:24:08 - response return (code 02500)
105
+ 2014-01-28 17:24:09 - ----------------------------------------------------------
106
+ 2014-01-28 17:24:09 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
107
+ 2014-01-28 17:24:09 - webServiceRequest(getWallet) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
108
+ 2014-01-28 17:24:09 - response return (code 02500)
app/code/community/Monext/Payline/PaylinePHPKit/logs/2014-02-03.log ADDED
@@ -0,0 +1,134 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 2014-02-03 8:55:42 - ----------------------------------------------------------
2
+ 2014-02-03 8:55:42 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
3
+ 2014-02-03 8:55:43 - webServiceRequest(getWallet) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
4
+ 2014-02-03 8:55:44 - response return (code 02500)
5
+ 2014-02-03 8:57:22 - ----------------------------------------------------------
6
+ 2014-02-03 8:57:22 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
7
+ 2014-02-03 8:57:22 - webServiceRequest(getWallet) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
8
+ 2014-02-03 8:57:23 - response return (code 02500)
9
+ 2014-02-03 8:58:59 - ----------------------------------------------------------
10
+ 2014-02-03 8:58:59 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
11
+ 2014-02-03 8:58:59 - webServiceRequest(doWebPayment) - Location : https://homologation.payline.com/V4/services/WebPaymentAPI
12
+ 2014-02-03 8:59:00 - response return (code 00000)
13
+ 2014-02-03 9:02:27 - ----------------------------------------------------------
14
+ 2014-02-03 9:02:27 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
15
+ 2014-02-03 9:02:27 - webServiceRequest(getWebPaymentDetails) - Location : https://homologation.payline.com/V4/services/WebPaymentAPI
16
+ 2014-02-03 9:02:27 - response return (code 00000)
17
+ 2014-02-03 9:11:47 - ----------------------------------------------------------
18
+ 2014-02-03 9:11:47 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
19
+ 2014-02-03 9:11:47 - webServiceRequest(doWebPayment) - Location : https://homologation.payline.com/V4/services/WebPaymentAPI
20
+ 2014-02-03 9:11:48 - response return (code 00000)
21
+ 2014-02-03 9:13:34 - ----------------------------------------------------------
22
+ 2014-02-03 9:13:34 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
23
+ 2014-02-03 9:13:34 - webServiceRequest(getWebPaymentDetails) - Location : https://homologation.payline.com/V4/services/WebPaymentAPI
24
+ 2014-02-03 9:13:34 - response return (code 00000)
25
+ 2014-02-03 9:23:47 - ----------------------------------------------------------
26
+ 2014-02-03 9:23:47 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
27
+ 2014-02-03 9:23:47 - webServiceRequest(doWebPayment) - Location : https://homologation.payline.com/V4/services/WebPaymentAPI
28
+ 2014-02-03 9:23:48 - response return (code 00000)
29
+ 2014-02-03 9:24:04 - ----------------------------------------------------------
30
+ 2014-02-03 9:24:04 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
31
+ 2014-02-03 9:24:04 - webServiceRequest(getWebPaymentDetails) - Location : https://homologation.payline.com/V4/services/WebPaymentAPI
32
+ 2014-02-03 9:24:06 - response return (code 02500)
33
+ 2014-02-03 9:42:10 - ----------------------------------------------------------
34
+ 2014-02-03 9:42:10 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
35
+ 2014-02-03 9:42:11 - webServiceRequest(doImmediateWalletPayment) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
36
+ 2014-02-03 9:42:12 - response return (code 00000)
37
+ 2014-02-03 9:42:12 - webServiceRequest(getTransactionDetails) - Location : https://homologation.payline.com/V4/services/ExtendedAPI
38
+ 2014-02-03 9:42:13 - response return (code 00000)
39
+ 2014-02-03 9:56:27 - ----------------------------------------------------------
40
+ 2014-02-03 9:56:27 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
41
+ 2014-02-03 9:56:27 - webServiceRequest(doImmediateWalletPayment) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
42
+ 2014-02-03 9:56:29 - response return (code 00000)
43
+ 2014-02-03 9:56:29 - webServiceRequest(getTransactionDetails) - Location : https://homologation.payline.com/V4/services/ExtendedAPI
44
+ 2014-02-03 9:56:31 - response return (code 00000)
45
+ 2014-02-03 10:35:17 - ----------------------------------------------------------
46
+ 2014-02-03 10:35:17 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
47
+ 2014-02-03 10:35:17 - webServiceRequest(doAuthorization) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
48
+ 2014-02-03 10:35:20 - response return (code 00000)
49
+ 2014-02-03 10:35:20 - webServiceRequest(getTransactionDetails) - Location : https://homologation.payline.com/V4/services/ExtendedAPI
50
+ 2014-02-03 10:35:21 - response return (code 00000)
51
+ 2014-02-03 10:44:18 - ----------------------------------------------------------
52
+ 2014-02-03 10:44:18 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
53
+ 2014-02-03 10:44:18 - webServiceRequest(doImmediateWalletPayment) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
54
+ 2014-02-03 10:44:20 - response return (code 00000)
55
+ 2014-02-03 10:44:20 - webServiceRequest(getTransactionDetails) - Location : https://homologation.payline.com/V4/services/ExtendedAPI
56
+ 2014-02-03 10:44:21 - response return (code 00000)
57
+ 2014-02-03 10:50:31 - ----------------------------------------------------------
58
+ 2014-02-03 10:50:31 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
59
+ 2014-02-03 10:50:31 - webServiceRequest(doImmediateWalletPayment) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
60
+ 2014-02-03 10:50:32 - response return (code 00000)
61
+ 2014-02-03 10:50:32 - webServiceRequest(getTransactionDetails) - Location : https://homologation.payline.com/V4/services/ExtendedAPI
62
+ 2014-02-03 10:50:34 - response return (code 00000)
63
+ 2014-02-03 10:53:09 - ----------------------------------------------------------
64
+ 2014-02-03 10:53:09 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
65
+ 2014-02-03 10:53:09 - webServiceRequest(doImmediateWalletPayment) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
66
+ 2014-02-03 10:53:10 - response return (code 00000)
67
+ 2014-02-03 10:53:10 - webServiceRequest(getTransactionDetails) - Location : https://homologation.payline.com/V4/services/ExtendedAPI
68
+ 2014-02-03 10:53:11 - response return (code 00000)
69
+ 2014-02-03 10:53:57 - ----------------------------------------------------------
70
+ 2014-02-03 10:53:57 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
71
+ 2014-02-03 10:53:57 - webServiceRequest(doImmediateWalletPayment) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
72
+ 2014-02-03 10:53:59 - response return (code 00000)
73
+ 2014-02-03 10:53:59 - webServiceRequest(getTransactionDetails) - Location : https://homologation.payline.com/V4/services/ExtendedAPI
74
+ 2014-02-03 10:54:00 - response return (code 00000)
75
+ 2014-02-03 11:00:34 - ----------------------------------------------------------
76
+ 2014-02-03 11:00:34 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
77
+ 2014-02-03 11:00:34 - webServiceRequest(doImmediateWalletPayment) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
78
+ 2014-02-03 11:00:35 - response return (code 00000)
79
+ 2014-02-03 11:00:35 - webServiceRequest(getTransactionDetails) - Location : https://homologation.payline.com/V4/services/ExtendedAPI
80
+ 2014-02-03 11:00:37 - response return (code 00000)
81
+ 2014-02-03 11:07:05 - ----------------------------------------------------------
82
+ 2014-02-03 11:07:05 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
83
+ 2014-02-03 11:07:05 - webServiceRequest(doImmediateWalletPayment) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
84
+ 2014-02-03 11:07:06 - response return (code 00000)
85
+ 2014-02-03 11:07:06 - webServiceRequest(getTransactionDetails) - Location : https://homologation.payline.com/V4/services/ExtendedAPI
86
+ 2014-02-03 11:07:07 - response return (code 00000)
87
+ 2014-02-03 11:09:14 - ----------------------------------------------------------
88
+ 2014-02-03 11:09:14 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
89
+ 2014-02-03 11:09:14 - webServiceRequest(doImmediateWalletPayment) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
90
+ 2014-02-03 11:09:15 - response return (code 00000)
91
+ 2014-02-03 11:09:15 - webServiceRequest(getTransactionDetails) - Location : https://homologation.payline.com/V4/services/ExtendedAPI
92
+ 2014-02-03 11:09:16 - response return (code 00000)
93
+ 2014-02-03 11:11:11 - ----------------------------------------------------------
94
+ 2014-02-03 11:11:11 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
95
+ 2014-02-03 11:11:11 - webServiceRequest(doAuthorization) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
96
+ 2014-02-03 11:11:13 - response return (code 00000)
97
+ 2014-02-03 11:11:13 - webServiceRequest(getTransactionDetails) - Location : https://homologation.payline.com/V4/services/ExtendedAPI
98
+ 2014-02-03 11:11:15 - response return (code 00000)
99
+ 2014-02-03 11:13:29 - ----------------------------------------------------------
100
+ 2014-02-03 11:13:29 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
101
+ 2014-02-03 11:13:29 - webServiceRequest(getWallet) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
102
+ 2014-02-03 11:13:30 - response return (code 02500)
103
+ 2014-02-03 11:13:46 - ----------------------------------------------------------
104
+ 2014-02-03 11:13:46 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
105
+ 2014-02-03 11:13:46 - webServiceRequest(doImmediateWalletPayment) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
106
+ 2014-02-03 11:13:47 - response return (code 00000)
107
+ 2014-02-03 11:13:47 - webServiceRequest(getTransactionDetails) - Location : https://homologation.payline.com/V4/services/ExtendedAPI
108
+ 2014-02-03 11:13:48 - response return (code 00000)
109
+ 2014-02-03 11:16:05 - ----------------------------------------------------------
110
+ 2014-02-03 11:16:05 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
111
+ 2014-02-03 11:16:05 - webServiceRequest(doAuthorization) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
112
+ 2014-02-03 11:16:05 - response return (code 00000)
113
+ 2014-02-03 11:16:05 - webServiceRequest(getTransactionDetails) - Location : https://homologation.payline.com/V4/services/ExtendedAPI
114
+ 2014-02-03 11:16:06 - response return (code 00000)
115
+ 2014-02-03 13:23:45 - ----------------------------------------------------------
116
+ 2014-02-03 13:23:45 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
117
+ 2014-02-03 13:23:45 - webServiceRequest(getWallet) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
118
+ 2014-02-03 13:23:46 - response return (code 02500)
119
+ 2014-02-03 13:23:59 - ----------------------------------------------------------
120
+ 2014-02-03 13:23:59 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
121
+ 2014-02-03 13:23:59 - webServiceRequest(doImmediateWalletPayment) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
122
+ 2014-02-03 13:24:00 - response return (code 00000)
123
+ 2014-02-03 13:24:00 - webServiceRequest(getTransactionDetails) - Location : https://homologation.payline.com/V4/services/ExtendedAPI
124
+ 2014-02-03 13:24:01 - response return (code 00000)
125
+ 2014-02-03 13:25:20 - ----------------------------------------------------------
126
+ 2014-02-03 13:25:20 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
127
+ 2014-02-03 13:25:20 - webServiceRequest(doImmediateWalletPayment) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
128
+ 2014-02-03 13:25:21 - response return (code 00000)
129
+ 2014-02-03 13:25:21 - webServiceRequest(getTransactionDetails) - Location : https://homologation.payline.com/V4/services/ExtendedAPI
130
+ 2014-02-03 13:25:23 - response return (code 00000)
131
+ 2014-02-03 13:27:33 - ----------------------------------------------------------
132
+ 2014-02-03 13:27:33 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
133
+ 2014-02-03 13:27:33 - webServiceRequest(getWallet) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
134
+ 2014-02-03 13:27:33 - response return (code 02500)
app/code/community/Monext/Payline/PaylinePHPKit/logs/2014-02-10.log ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 2014-02-10 14:31:10 - ----------------------------------------------------------
2
+ 2014-02-10 14:31:10 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
3
+ 2014-02-10 14:31:10 - webServiceRequest(doAuthorization) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
4
+ 2014-02-10 14:31:12 - response return (code 00000)
5
+ 2014-02-10 14:31:12 - webServiceRequest(getTransactionDetails) - Location : https://homologation.payline.com/V4/services/ExtendedAPI
6
+ 2014-02-10 14:31:13 - response return (code 00000)
7
+ 2014-02-10 14:47:27 - ----------------------------------------------------------
8
+ 2014-02-10 14:47:27 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
9
+ 2014-02-10 14:47:28 - webServiceRequest(doAuthorization) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
10
+ 2014-02-10 14:47:29 - response return (code 01913)
11
+ 2014-02-10 15:45:15 - ----------------------------------------------------------
12
+ 2014-02-10 15:45:15 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
13
+ 2014-02-10 15:45:15 - webServiceRequest(getWallet) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
14
+ 2014-02-10 15:45:17 - response return (code 02500)
15
+ 2014-02-10 16:01:49 - ----------------------------------------------------------
16
+ 2014-02-10 16:01:49 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
17
+ 2014-02-10 16:01:49 - webServiceRequest(getWallet) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
18
+ 2014-02-10 16:01:50 - response return (code 02500)
19
+ 2014-02-10 16:30:28 - ----------------------------------------------------------
20
+ 2014-02-10 16:30:28 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
21
+ 2014-02-10 16:30:28 - webServiceRequest(createWebWallet) - Location : https://homologation.payline.com/V4/services/WebPaymentAPI
22
+ 2014-02-10 16:30:31 - response return (code 00000)
23
+ 2014-02-10 16:31:03 - ----------------------------------------------------------
24
+ 2014-02-10 16:31:03 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
25
+ 2014-02-10 16:31:03 - webServiceRequest(getWebWallet) - Location : https://homologation.payline.com/V4/services/WebPaymentAPI
26
+ 2014-02-10 16:31:04 - response return (code 02500)
27
+ 2014-02-10 16:31:20 - ----------------------------------------------------------
28
+ 2014-02-10 16:31:20 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
29
+ 2014-02-10 16:31:20 - webServiceRequest(getWebWallet) - Location : https://homologation.payline.com/V4/services/WebPaymentAPI
30
+ 2014-02-10 16:31:21 - response return (code 02500)
31
+ 2014-02-10 16:32:12 - ----------------------------------------------------------
32
+ 2014-02-10 16:32:12 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
33
+ 2014-02-10 16:32:12 - webServiceRequest(doAuthorization) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
34
+ 2014-02-10 16:32:15 - response return (code 00000)
35
+ 2014-02-10 16:32:15 - webServiceRequest(getTransactionDetails) - Location : https://homologation.payline.com/V4/services/ExtendedAPI
36
+ 2014-02-10 16:32:17 - response return (code 00000)
37
+ 2014-02-10 16:33:11 - ----------------------------------------------------------
38
+ 2014-02-10 16:33:11 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
39
+ 2014-02-10 16:33:11 - webServiceRequest(doAuthorization) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
40
+ 2014-02-10 16:33:12 - response return (code 01913)
41
+ 2014-02-10 16:33:53 - ----------------------------------------------------------
42
+ 2014-02-10 16:33:53 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
43
+ 2014-02-10 16:33:53 - webServiceRequest(doAuthorization) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
44
+ 2014-02-10 16:33:54 - response return (code 00000)
45
+ 2014-02-10 16:33:54 - webServiceRequest(getTransactionDetails) - Location : https://homologation.payline.com/V4/services/ExtendedAPI
46
+ 2014-02-10 16:33:55 - response return (code 00000)
47
+ 2014-02-10 16:33:56 - webServiceRequest(createWallet) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
48
+ 2014-02-10 16:33:59 - response return (code 02500)
49
+ 2014-02-10 16:34:11 - ----------------------------------------------------------
50
+ 2014-02-10 16:34:11 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
51
+ 2014-02-10 16:34:11 - webServiceRequest(getWallet) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
52
+ 2014-02-10 16:34:13 - response return (code 02500)
53
+ 2014-02-10 16:46:55 - ----------------------------------------------------------
54
+ 2014-02-10 16:46:55 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
55
+ 2014-02-10 16:46:55 - webServiceRequest(getWallet) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
56
+ 2014-02-10 16:46:57 - response return (code 02500)
app/code/community/Monext/Payline/PaylinePHPKit/logs/2014-02-11.log ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 2014-02-11 16:30:12 - ----------------------------------------------------------
2
+ 2014-02-11 16:30:12 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
3
+ 2014-02-11 16:30:12 - webServiceRequest(getWallet) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
4
+ 2014-02-11 16:30:13 - response return (code 02500)
5
+ 2014-02-11 16:30:53 - ----------------------------------------------------------
6
+ 2014-02-11 16:30:53 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
7
+ 2014-02-11 16:30:53 - webServiceRequest(getWallet) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
8
+ 2014-02-11 16:30:54 - response return (code 02500)
9
+ 2014-02-11 16:31:30 - ----------------------------------------------------------
10
+ 2014-02-11 16:31:30 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
11
+ 2014-02-11 16:31:30 - webServiceRequest(doImmediateWalletPayment) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
12
+ 2014-02-11 16:31:33 - response return (code 00000)
13
+ 2014-02-11 16:31:33 - webServiceRequest(getTransactionDetails) - Location : https://homologation.payline.com/V4/services/ExtendedAPI
14
+ 2014-02-11 16:31:35 - response return (code 00000)
15
+ 2014-02-11 16:38:50 - ----------------------------------------------------------
16
+ 2014-02-11 16:38:50 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
17
+ 2014-02-11 16:38:50 - webServiceRequest(getWallet) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
18
+ 2014-02-11 16:38:53 - response return (code 02500)
app/code/community/Monext/Payline/PaylinePHPKit/logs/2014-02-17.log ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 2014-02-17 8:43:18 - ----------------------------------------------------------
2
+ 2014-02-17 8:43:18 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
3
+ 2014-02-17 8:43:18 - webServiceRequest(getWallet) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
4
+ 2014-02-17 8:43:19 - response return (code 02500)
5
+ 2014-02-17 9:07:02 - ----------------------------------------------------------
6
+ 2014-02-17 9:07:02 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
7
+ 2014-02-17 9:07:02 - webServiceRequest(getWallet) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
8
+ 2014-02-17 9:07:04 - response return (code 02500)
9
+ 2014-02-17 9:47:50 - ----------------------------------------------------------
10
+ 2014-02-17 9:47:50 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
11
+ 2014-02-17 9:47:50 - webServiceRequest(getWallet) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
12
+ 2014-02-17 9:47:51 - response return (code 02500)
13
+ 2014-02-17 10:05:10 - ----------------------------------------------------------
14
+ 2014-02-17 10:05:10 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
15
+ 2014-02-17 10:05:10 - webServiceRequest(doImmediateWalletPayment) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
16
+ 2014-02-17 10:05:11 - response return (code 00000)
17
+ 2014-02-17 10:05:11 - webServiceRequest(getTransactionDetails) - Location : https://homologation.payline.com/V4/services/ExtendedAPI
18
+ 2014-02-17 10:05:12 - response return (code 00000)
19
+ 2014-02-17 10:07:36 - ----------------------------------------------------------
20
+ 2014-02-17 10:07:36 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
21
+ 2014-02-17 10:07:36 - webServiceRequest(doImmediateWalletPayment) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
22
+ 2014-02-17 10:07:38 - response return (code 00000)
23
+ 2014-02-17 10:07:38 - webServiceRequest(getTransactionDetails) - Location : https://homologation.payline.com/V4/services/ExtendedAPI
24
+ 2014-02-17 10:07:41 - response return (code 00000)
25
+ 2014-02-17 12:58:00 - ----------------------------------------------------------
26
+ 2014-02-17 12:58:00 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
27
+ 2014-02-17 12:58:00 - webServiceRequest(getWallet) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
28
+ 2014-02-17 12:58:01 - response return (code 02500)
29
+ 2014-02-17 14:39:30 - ----------------------------------------------------------
30
+ 2014-02-17 14:39:30 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
31
+ 2014-02-17 14:39:30 - webServiceRequest(getWallet) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
32
+ 2014-02-17 14:39:31 - response return (code 02500)
33
+ 2014-02-17 14:40:02 - ----------------------------------------------------------
34
+ 2014-02-17 14:40:02 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
35
+ 2014-02-17 14:40:02 - webServiceRequest(getWallet) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
36
+ 2014-02-17 14:40:02 - response return (code 02500)
37
+ 2014-02-17 15:50:36 - ----------------------------------------------------------
38
+ 2014-02-17 15:50:36 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
39
+ 2014-02-17 15:50:36 - webServiceRequest(getWallet) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
40
+ 2014-02-17 15:50:37 - response return (code 02500)
app/code/community/Monext/Payline/PaylinePHPKit/logs/2014-02-25.log ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 2014-02-25 14:27:17 - ----------------------------------------------------------
2
+ 2014-02-25 14:27:17 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
3
+ 2014-02-25 14:27:17 - webServiceRequest(getWallet) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
4
+ 2014-02-25 14:27:18 - response return (code 02500)
5
+ 2014-02-25 14:27:41 - ----------------------------------------------------------
6
+ 2014-02-25 14:27:41 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
7
+ 2014-02-25 14:27:41 - webServiceRequest(doImmediateWalletPayment) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
8
+ 2014-02-25 14:27:42 - response return (code 00000)
9
+ 2014-02-25 14:27:42 - webServiceRequest(getTransactionDetails) - Location : https://homologation.payline.com/V4/services/ExtendedAPI
10
+ 2014-02-25 14:27:43 - response return (code 00000)
11
+ 2014-02-25 14:29:04 - ----------------------------------------------------------
12
+ 2014-02-25 14:29:04 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
13
+ 2014-02-25 14:29:04 - webServiceRequest(doImmediateWalletPayment) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
14
+ 2014-02-25 14:29:05 - response return (code 00000)
15
+ 2014-02-25 14:29:05 - webServiceRequest(getTransactionDetails) - Location : https://homologation.payline.com/V4/services/ExtendedAPI
16
+ 2014-02-25 14:29:06 - response return (code 00000)
17
+ 2014-02-25 15:37:26 - ----------------------------------------------------------
18
+ 2014-02-25 15:37:26 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
19
+ 2014-02-25 15:37:26 - webServiceRequest(getWallet) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
20
+ 2014-02-25 15:37:27 - response return (code 02500)
21
+ 2014-02-25 15:41:34 - ----------------------------------------------------------
22
+ 2014-02-25 15:41:34 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
23
+ 2014-02-25 15:41:34 - webServiceRequest(getWallet) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
24
+ 2014-02-25 15:41:34 - response return (code 02500)
25
+ 2014-02-25 15:44:49 - ----------------------------------------------------------
26
+ 2014-02-25 15:44:49 - paylineSDK::__construct(36472284953602, Ka****************ot, , , , , 0)
27
+ 2014-02-25 15:44:49 - webServiceRequest(doImmediateWalletPayment) - Location : https://homologation.payline.com/V4/services/DirectPaymentAPI
28
+ 2014-02-25 15:44:50 - response return (code 00000)
29
+ 2014-02-25 15:44:50 - webServiceRequest(getTransactionDetails) - Location : https://homologation.payline.com/V4/services/ExtendedAPI
30
+ 2014-02-25 15:44:51 - response return (code 00000)
app/code/community/Monext/Payline/controllers/CheckoutonepageController.php CHANGED
@@ -15,18 +15,18 @@ class Monext_Payline_CheckoutonepageController extends Mage_Checkout_OnepageCont
15
  }
16
  //INIT
17
  $customer=Mage::getSingleton('customer/session')->getCustomer();
18
-
19
  //Customer has wallet?
20
  if (!(Mage::getSingleton('customer/session')->isLoggedIn())){
21
  $this->_redirect('customer/account/login');
22
  return;
23
  }
24
-
25
  if (!($walletId=$customer->getWalletId())){
26
  $this->_redirect('checkout/onepage');
27
  return;
28
  }
29
-
30
  if (!Mage::helper('checkout')->canOnepageCheckout()) {
31
  Mage::getSingleton('checkout/session')->addError($this->__('The onepage checkout is disabled.'));
32
  $this->_redirect('checkout/cart');
@@ -45,7 +45,7 @@ class Monext_Payline_CheckoutonepageController extends Mage_Checkout_OnepageCont
45
  $this->_redirect('checkout/cart');
46
  return;
47
  }
48
-
49
  //Check if the wallet payment is available
50
  /* @var $walletPaymentMethod Monext_Payline_Model_Wallet */
51
  $walletPaymentMethod=Mage::getModel('payline/wallet');
@@ -55,7 +55,7 @@ class Monext_Payline_CheckoutonepageController extends Mage_Checkout_OnepageCont
55
  $error.='<a href="'.Mage::getUrl('payline/wallet/manage').'">'.
56
  $this->__('Update your wallet information').'</a>'.
57
  $this->__(' or process your order below.');
58
- Mage::getSingleton('checkout/session')->addError($error);
59
  $this->_redirect('checkout/cart');
60
  return;
61
  }elseif(!$walletPaymentMethod->isAvailable()){
@@ -64,11 +64,11 @@ class Monext_Payline_CheckoutonepageController extends Mage_Checkout_OnepageCont
64
  $this->_redirect('checkout/cart');
65
  return;
66
  }
67
-
68
  Mage::getSingleton('checkout/session')->setCartWasUpdated(false);
69
  Mage::getSingleton('customer/session')->setBeforeAuthUrl(Mage::getUrl('*/*/*', array('_secure'=>true)));
70
  //Init customer quote, isMultiShipping false
71
- $onepage->initCheckout();
72
 
73
  //Checkout enabled?
74
  if (!Mage::helper('checkout')->canOnepageCheckout()) {
@@ -81,12 +81,12 @@ class Monext_Payline_CheckoutonepageController extends Mage_Checkout_OnepageCont
81
  $onepage->saveCheckoutMethod(Mage_Checkout_Model_Type_Onepage::METHOD_CUSTOMER);
82
  }
83
 
84
-
85
  //Get rid of a few problems if order not completed
86
  //$onepage->getQuote()->re//moveAllAddresses();
87
  $shippingAddressId = $this->getRequest()->getPost('shipping_address_id', false);
88
  $billingAddressId = $this->getRequest()->getPost('billing_address_id', false);
89
- /* PATCH for 1clic btn on checkout/cart */
90
  if (empty($shippingAddressId)){
91
  if($customer->getPrimaryShippingAddress()){
92
  $shippingAddressId = $customer->getPrimaryShippingAddress()->getId();
@@ -105,7 +105,7 @@ class Monext_Payline_CheckoutonepageController extends Mage_Checkout_OnepageCont
105
  return;
106
  }
107
  }
108
- /* PATCH end */
109
  $billingAddress=Mage::getModel('customer/address')->load($billingAddressId)->getData();
110
  $shippingAddress=Mage::getModel('customer/address')->load($shippingAddressId)->getData();
111
  $billingAddressForCheckout=array(
@@ -114,9 +114,9 @@ class Monext_Payline_CheckoutonepageController extends Mage_Checkout_OnepageCont
114
  $shippingAddressForCheckout=array(
115
  'address_id' => $shippingAddress['entity_id'],
116
  );
117
-
118
  $onepage->saveBilling($billingAddressForCheckout, $billingAddressId);
119
-
120
  $onepage->saveShipping($shippingAddressForCheckout, $shippingAddressId);
121
 
122
  // Get available shipping rates; if one is available by default then use it, otherwise ask customer
@@ -124,24 +124,31 @@ class Monext_Payline_CheckoutonepageController extends Mage_Checkout_OnepageCont
124
  //Needed to get shipping methods
125
  $onepage->getQuote()->getShippingAddress()->collectShippingRates()->save();
126
  $array=$onepage->saveShippingMethod($methodCode);
127
-
128
  Mage::dispatchEvent('checkout_controller_onepage_save_shipping_method', array('request'=>$this->getRequest(), 'quote'=>$quote));
129
  }
130
  $shippingMethod=$onepage->getQuote()->getShippingAddress()->getShippingMethod();
131
-
132
  $data=array('method'=>'PaylineWALLET');
133
  $array=$onepage->savePayment($data);
134
  $this->loadLayout();
135
  $this->_initLayoutMessages('customer/session');
136
  $this->_getChargeProgress();
137
-
138
  $gotoSection = 'review';
139
- //If the shipping method is not configured, or the shipping address doesn't fit,
140
  //the shipping method template is different : when the form is validated, the payment method will be validated as well
141
  if (!isset($shippingMethod) || empty($shippingMethod)){
142
  $this->getLayout()->getBlock('checkout.onepage.shipping_method')->setTemplate('payline/checkout/onepage/shipping-method.phtml');
143
  $gotoSection = 'shipping_method';
144
  }
 
 
 
 
 
 
 
145
  Mage::register('payline-goto-section', $gotoSection);
146
  $this->getLayout()->getBlock('head')->setTitle($this->__('Checkout'));
147
  $this->renderLayout();
15
  }
16
  //INIT
17
  $customer=Mage::getSingleton('customer/session')->getCustomer();
18
+
19
  //Customer has wallet?
20
  if (!(Mage::getSingleton('customer/session')->isLoggedIn())){
21
  $this->_redirect('customer/account/login');
22
  return;
23
  }
24
+
25
  if (!($walletId=$customer->getWalletId())){
26
  $this->_redirect('checkout/onepage');
27
  return;
28
  }
29
+
30
  if (!Mage::helper('checkout')->canOnepageCheckout()) {
31
  Mage::getSingleton('checkout/session')->addError($this->__('The onepage checkout is disabled.'));
32
  $this->_redirect('checkout/cart');
45
  $this->_redirect('checkout/cart');
46
  return;
47
  }
48
+
49
  //Check if the wallet payment is available
50
  /* @var $walletPaymentMethod Monext_Payline_Model_Wallet */
51
  $walletPaymentMethod=Mage::getModel('payline/wallet');
55
  $error.='<a href="'.Mage::getUrl('payline/wallet/manage').'">'.
56
  $this->__('Update your wallet information').'</a>'.
57
  $this->__(' or process your order below.');
58
+ Mage::getSingleton('checkout/session')->addError($error);
59
  $this->_redirect('checkout/cart');
60
  return;
61
  }elseif(!$walletPaymentMethod->isAvailable()){
64
  $this->_redirect('checkout/cart');
65
  return;
66
  }
67
+
68
  Mage::getSingleton('checkout/session')->setCartWasUpdated(false);
69
  Mage::getSingleton('customer/session')->setBeforeAuthUrl(Mage::getUrl('*/*/*', array('_secure'=>true)));
70
  //Init customer quote, isMultiShipping false
71
+ $onepage->initCheckout();
72
 
73
  //Checkout enabled?
74
  if (!Mage::helper('checkout')->canOnepageCheckout()) {
81
  $onepage->saveCheckoutMethod(Mage_Checkout_Model_Type_Onepage::METHOD_CUSTOMER);
82
  }
83
 
84
+
85
  //Get rid of a few problems if order not completed
86
  //$onepage->getQuote()->re//moveAllAddresses();
87
  $shippingAddressId = $this->getRequest()->getPost('shipping_address_id', false);
88
  $billingAddressId = $this->getRequest()->getPost('billing_address_id', false);
89
+ /* PATCH for 1clic btn on checkout/cart */
90
  if (empty($shippingAddressId)){
91
  if($customer->getPrimaryShippingAddress()){
92
  $shippingAddressId = $customer->getPrimaryShippingAddress()->getId();
105
  return;
106
  }
107
  }
108
+ /* PATCH end */
109
  $billingAddress=Mage::getModel('customer/address')->load($billingAddressId)->getData();
110
  $shippingAddress=Mage::getModel('customer/address')->load($shippingAddressId)->getData();
111
  $billingAddressForCheckout=array(
114
  $shippingAddressForCheckout=array(
115
  'address_id' => $shippingAddress['entity_id'],
116
  );
117
+
118
  $onepage->saveBilling($billingAddressForCheckout, $billingAddressId);
119
+
120
  $onepage->saveShipping($shippingAddressForCheckout, $shippingAddressId);
121
 
122
  // Get available shipping rates; if one is available by default then use it, otherwise ask customer
124
  //Needed to get shipping methods
125
  $onepage->getQuote()->getShippingAddress()->collectShippingRates()->save();
126
  $array=$onepage->saveShippingMethod($methodCode);
127
+
128
  Mage::dispatchEvent('checkout_controller_onepage_save_shipping_method', array('request'=>$this->getRequest(), 'quote'=>$quote));
129
  }
130
  $shippingMethod=$onepage->getQuote()->getShippingAddress()->getShippingMethod();
131
+
132
  $data=array('method'=>'PaylineWALLET');
133
  $array=$onepage->savePayment($data);
134
  $this->loadLayout();
135
  $this->_initLayoutMessages('customer/session');
136
  $this->_getChargeProgress();
137
+
138
  $gotoSection = 'review';
139
+ //If the shipping method is not configured, or the shipping address doesn't fit,
140
  //the shipping method template is different : when the form is validated, the payment method will be validated as well
141
  if (!isset($shippingMethod) || empty($shippingMethod)){
142
  $this->getLayout()->getBlock('checkout.onepage.shipping_method')->setTemplate('payline/checkout/onepage/shipping-method.phtml');
143
  $gotoSection = 'shipping_method';
144
  }
145
+
146
+ if (version_compare(Mage::getVersion(), '1.8', 'ge')) {
147
+ $this->getLayout()->getBlock('checkout.onepage.shipping_method')->setTemplate('payline/checkout/onepage/shipping-method.phtml');
148
+ $this->getLayout()->getBlock('checkout.payment.methods')->setTemplate('payline/checkout/onepage/payment/methods.phtml');
149
+ Mage::register('payline-magento-version', 1.8);
150
+ }
151
+
152
  Mage::register('payline-goto-section', $gotoSection);
153
  $this->getLayout()->getBlock('head')->setTitle($this->__('Checkout'));
154
  $this->renderLayout();
app/code/community/Monext/Payline/controllers/IndexController.php CHANGED
@@ -1,1168 +1,1168 @@
1
- <?php
2
-
3
- /**
4
- * This controller manage all payline payment
5
- * cptAction, directAction, nxAction & walletAction are called just after the checkout validation
6
- * the return/notify/cancel are the urls called by Payline
7
- * An exception for notifyAction : it's not directly called by Payline, since it couldn't work in a local environment; it's then called by the returnAction.
8
- * @author fague
9
- *
10
- */
11
- class Monext_Payline_IndexController extends Mage_Core_Controller_Front_Action
12
- {
13
- /* @var $order Mage_Sales_Model_Order */
14
- private $order;
15
-
16
- protected function _getCustomerSession()
17
- {
18
- return Mage::getSingleton('customer/session');
19
- }
20
-
21
- /**
22
- * Add a transaction to the current order, depending on the payment type (Auth or Auth+Capture)
23
- * @param string $transactionId
24
- * @param string $paymentAction
25
- * @return null
26
- */
27
- private function addTransaction($transactionId,$paymentAction){
28
- if (version_compare(Mage::getVersion(), '1.4', 'ge')){
29
- /* @var $payment Mage_Payment_Model_Method_Abstract */
30
- $payment=$this->order->getPayment();
31
- if(!$payment->getTransaction($transactionId)){ // if transaction isn't saved yet
32
- $transaction = Mage::getModel('sales/order_payment_transaction');
33
- $transaction->setTxnId($transactionId);
34
- $transaction->setOrderPaymentObject($this->order->getPayment());
35
- if($paymentAction == '100'){
36
-
37
- }else if ($paymentAction == '101'){
38
- $transaction->setTxnType(Mage_Sales_Model_Order_Payment_Transaction::TYPE_PAYMENT);
39
- }
40
- $transaction->save();
41
- $this->order->sendNewOrderEmail();
42
- }
43
- }else{
44
- $this->order->getPayment()->setLastTransId($transactionId);
45
- $this->order->sendNewOrderEmail();
46
- }
47
- }
48
-
49
- /**
50
- *
51
- * Set the order's status to the provided status (must be part of the cancelled state)
52
- * Reinit stocks & redirect to checkout
53
- * @param string $cancelStatus
54
- */
55
- private function cancelOrder($cancelStatus, $resCode = '',$message = ''){
56
- $this->order->setState(Mage_Sales_Model_Order::STATE_CANCELED,$cancelStatus,$message,false);
57
- $this->updateStock();
58
- $this->order->save();
59
-
60
- $this->_redirectUrl($this->_getPaymentRefusedRedirectUrl());
61
- }
62
-
63
- /**
64
- * Check if the customer is logged, and if it has a wallet
65
- * If not & if there is a walletId in the result from Payline, we save it
66
- */
67
- public function saveWallet($walletId){
68
- if (!Mage::getStoreConfig('payment/payline_common/automate_wallet_subscription')){
69
- return;
70
- }
71
- $customer=Mage::getSingleton('customer/session');
72
- if ($customer->isLoggedIn()){
73
- $customer=Mage::getModel('customer/customer')->load($customer->getId());
74
- if (!$customer->getWalletId()){
75
- $customer->setWalletId($walletId);
76
- $customer->save();
77
- }
78
- }
79
- }
80
-
81
- /**
82
- *
83
- * Initialise the requests param array
84
- * @return array
85
- */
86
- private function init(){
87
- $array = array();
88
-
89
- $_session = Mage::getSingleton('checkout/session');
90
-
91
- $this->order = Mage::getModel('sales/order')->loadByIncrementId($_session->getLastRealOrderId());
92
- $_numericCurrencyCode = Mage::helper('payline')->getNumericCurrencyCode($this->order->getBaseCurrencyCode());
93
-
94
- // PAYMENT
95
- $array['payment']['amount'] = round($this->order->getBaseGrandTotal()*100);
96
- $array['payment']['currency'] = $_numericCurrencyCode;
97
-
98
- // ORDER
99
- //
100
- $array['order']['ref'] = substr($this->order->getRealOrderId(),0,50);
101
- $array['order']['amount'] = $array['payment']['amount'];
102
- $array['order']['currency'] = $_numericCurrencyCode;
103
-
104
- $billingAddress = $this->order->getBillingAddress();
105
-
106
- // BUYER
107
- $buyerLastName = substr($this->order->getCustomerLastname(),0,50);
108
- if($buyerLastName == null || $buyerLastName == ''){
109
- $buyerLastName = substr($billingAddress->getLastname(),0,50);
110
- }
111
- $buyerFirstName = substr($this->order->getCustomerFirstname(),0,50);
112
- if($buyerFirstName == null || $buyerFirstName == ''){
113
- $buyerFirstName = substr($billingAddress->getFirstname(),0,50);
114
- }
115
- $array['buyer']['lastName'] = Mage::helper('payline')->encodeString($buyerLastName);
116
- $array['buyer']['firstName'] = Mage::helper('payline')->encodeString($buyerFirstName);
117
-
118
-
119
- $email=$this->order->getCustomerEmail();
120
- $pattern = '/\+/i';
121
- $charPlusExist = preg_match($pattern, $email);
122
- if (strlen($email)<=50 && Zend_Validate::is($email, 'EmailAddress') && !$charPlusExist) {
123
- $array['buyer']['email']=Mage::helper('payline')->encodeString($email);
124
- }else{
125
- $array['buyer']['email'] = '';
126
- }
127
- $array['buyer']['customerId'] = Mage::helper('payline')->encodeString($email);
128
-
129
- // ADDRESS : !!!WARNING!!! PaylineSDK v4.33 reverse billingAddress & shippingAdress.
130
- // Take this : https://www.youtube.com/watch?v=MA6kXUgZ7lE&list=PLpyrjJvJ7GJ7bM5GjzwHvZIqe6c5l3iF6
131
- $array['shippingAddress']['name'] = Mage::helper('payline')->encodeString(substr($billingAddress->getName(),0,100));
132
- $array['shippingAddress']['street1'] = Mage::helper('payline')->encodeString(substr($billingAddress->getStreet1(),0,100));
133
- $array['shippingAddress']['street2'] = Mage::helper('payline')->encodeString(substr($billingAddress->getStreet2(),0,100));
134
- $array['shippingAddress']['cityName'] = Mage::helper('payline')->encodeString(substr($billingAddress->getCity(),0,40));
135
- $array['shippingAddress']['zipCode'] = substr($billingAddress->getPostcode(),0,12);
136
- //The $billing->getCountry() returns a 2 letter ISO2, should be fine
137
- $array['shippingAddress']['country'] = $billingAddress->getCountry();
138
- $forbidenCars = array(' ','.','(',')','-');
139
- $phone = str_replace($forbidenCars,'',$billingAddress->getTelephone());
140
- $regexpTel='/^\+?[0-9]{1,14}$/';
141
- if (preg_match($regexpTel, $phone)){
142
- $array['shippingAddress']['phone']=$phone;
143
- }else{
144
- $array['shippingAddress']['phone']='';
145
- }
146
- $array['billingAddress'] = null;
147
- return $array;
148
- }
149
-
150
- /**
151
- * Add payment transaction to the order, reinit stocks if needed
152
- * @param $res array result of a request
153
- * @param $transactionId
154
- * @return boolean (true=>valid payment, false => invalid payment)
155
- */
156
- private function updateOrder($res,$transactionId, $paymentType='CPT'){
157
- Mage::helper('payline/logger')->log("[updateOrder] Mise à jour commande ".$this->order->getIncrementId()." (mode $paymentType) avec la transaction $transactionId");
158
- $orderOk = false;
159
- if( $res['result']['code'] ) {
160
- $resultCode = $res['result']['code'];
161
- $acceptedCodes = array('00000','02500','02501','04003');
162
- if( in_array( $resultCode, $acceptedCodes ) ) { // transaction OK
163
- $orderOk = true;
164
- if($paymentType == 'NX') {
165
- Mage::helper('payline/logger')->log("[updateOrder] Cas du paiement NX");
166
- if (isset($res['billingRecordList']['billingRecord'][0])) {
167
- $code_echeance = $res['billingRecordList']['billingRecord'][0]->result->code;
168
- if($code_echeance == '00000' || $code_echeance == '02501'){
169
- Mage::helper('payline/logger')->log("[updateOrder] première échéance paiement NX OK");
170
- $orderOk = true;
171
- }else{
172
- Mage::helper('payline/logger')->log("[updateOrder] première échéance paiement NX refusée, code ".$code_echeance);
173
- $orderOk = false;
174
- }
175
- }else{
176
- Mage::helper('payline/logger')->log("[updateOrder] La première échéance de paiement est à venir");
177
- }
178
- }
179
-
180
- $this->order->getPayment()->setCcTransId($transactionId);
181
- if (isset($res['payment']) && isset($res['payment']['action'])){
182
- $paymentAction=$res['payment']['action'];
183
- }else{
184
- $paymentAction= Mage::getStoreConfig('payment/Payline'.$paymentType.'/payline_payment_action');
185
- }
186
- $this->addTransaction($transactionId, $paymentAction);
187
- }else{
188
- $this->updateStock();
189
- }
190
- }
191
- $this->order->save();
192
- return $orderOk;
193
- }
194
-
195
- /**
196
- * Reinit stocks
197
- */
198
- private function updateStock(){
199
- if(Mage::getStoreConfig(Mage_CatalogInventory_Model_Stock_Item::XML_PATH_CAN_SUBTRACT) == 1){ // le stock a été décrémenté à la commande
200
- // ré-incrémentation du stock
201
- $items = $this->order->getAllItems();
202
- if ($items) {
203
- foreach($items as $item) {
204
- $quantity = $item->getQtyOrdered(); // get Qty ordered
205
- $product_id = $item->getProductId(); // get its ID
206
- $stock = Mage::getModel('cataloginventory/stock_item')->loadByProduct($product_id); // Load the stock for this product
207
- $stock->setQty($stock->getQty()+$quantity); // Set to new Qty
208
- //if qtty = 0 after order and order fails, set stock status is_in_stock to true
209
- if ( $stock->getQty() > $stock->getMinQty() && !$stock->getIsInStock() ) {
210
- $stock->setIsInStock( 1 );
211
- }
212
- $stock->save(); // Save
213
- continue;
214
- }
215
- }
216
- }
217
- }
218
-
219
- /**
220
- * Force this action code of some payment methods to the given action code
221
- * @param $paymentMethod {string}
222
- * @param $array {array} conf array. $array is a reference, so no need to return it.
223
- * @param $actionCode {string} forced action code set in $array
224
- */
225
- private function forcePaymentActionTo($paymentMethod, &$array, $actionCode)
226
- {
227
- switch( $paymentMethod ) {
228
- case 'UKASH':
229
- case 'MONEYCLIC':
230
- case 'TICKETSURF':
231
- case 'SKRILL(MONEYBOOKERS)':
232
- case 'LEETCHI':
233
- Mage::helper('payline/logger')->log('[cptAction] order '.$array['order']['ref'].' - '.$paymentMethod.' selected => payment action is forced to '.$actionCode);
234
- $array['payment']['action'] = $actionCode;
235
- break;
236
- default: break;
237
- }
238
- }
239
-
240
- /**
241
- * Initialize the cpt payment request
242
- */
243
- public function cptAction(){
244
- //Check if wallet is sendable
245
- //Must be done before call to Payline helper initialisation
246
- $expiredWalletId=false;
247
- if(Mage::getSingleton('customer/session')->isLoggedIn()){
248
- $customer=Mage::getSingleton('customer/session')->getCustomer();
249
- $customer=Mage::getModel('customer/customer')->load($customer->getId());
250
- if ($customer->getWalletId() && !Mage::getModel('payline/wallet')->checkExpirationDate()){
251
- $expiredWalletId=true;
252
- }
253
- }
254
-
255
- $array = $this->init();
256
- /* @var $paylineSDK PaylineSDK */
257
- $helperPayline = Mage::helper('payline');
258
- $paylineSDK = $helperPayline->initPayline('CPT',$array['payment']['currency']);
259
- $paymentMethod = $this->order->getPayment()->getCcType();
260
- $array['payment']['action'] = Mage::getStoreConfig('payment/PaylineCPT/payline_payment_action');
261
- $array['version'] = Monext_Payline_Helper_Data::VERSION;
262
- if($paymentMethod) {
263
- // debut ajout FSZ 15/11/2012
264
- Mage::helper('payline/logger')->log('[cptAction] order '.$array['order']['ref'].' - customer selected contract '.$paymentMethod);
265
-
266
- $contractCPT = Mage::getModel('payline/contract')
267
- ->getCollection()
268
- ->addFieldToFilter( 'number', $paymentMethod )
269
- ->getFirstItem();
270
-
271
- // $paymentMethod = contract number. Filter must be on contract type
272
- $this->forcePaymentActionTo( $contractCPT->getContractType(), $array, '101' );
273
-
274
- // fin ajout FSZ 15/11/2012
275
- $array['payment']['contractNumber'] = $paymentMethod;
276
- $array['contracts'] = array($paymentMethod);
277
- } else {
278
- $array['payment']['contractNumber'] = $helperPayline->contractNumber;
279
- }
280
- $array['payment']['mode'] = 'CPT';
281
-
282
- //second contracts
283
- $array['secondContracts'] = explode(';',$helperPayline->secondaryContractNumberList);
284
-
285
-
286
- //If wallet isn't sendable...
287
- if ($expiredWalletId){
288
- $helperPayline->walletId=null;
289
- }
290
-
291
- // PRIVATE DATA
292
- $privateData = array();
293
- $privateData['key'] = "orderRef";
294
- $privateData['value'] = substr(str_replace(array("\r","\n","\t"), array('','',''),$array['order']['ref']), 0,255);
295
- $paylineSDK->setPrivate($privateData);
296
-
297
- //ORDER DETAILS (optional)
298
- $items = $this->order->getAllItems();
299
- if ($items) {
300
- if(count($items)>100) $items=array_slice($items,0,100);
301
- foreach($items as $item) {
302
- $itemPrice = round($item->getPrice()*100);
303
- if($itemPrice > 0){
304
- $product = array();
305
- $product['ref'] = Mage::helper('payline')->encodeString(substr(str_replace(array("\r","\n","\t"), array('','',''),$item->getName()),0,50));
306
- $product['price'] = round($item->getPrice()*100);
307
- $product['quantity'] = round($item->getQtyOrdered());
308
- $product['comment'] = Mage::helper('payline')->encodeString(substr(str_replace(array("\r","\n","\t"), array('','',''),$item->getDescription()), 0,255));
309
- $paylineSDK->setItem($product);
310
- }
311
- continue;
312
- }
313
- }
314
-
315
- //WALLET
316
- if(Mage::getStoreConfig('payment/PaylineCPT/send_wallet_id')) {
317
- if (!isset($array['buyer']['walletId'])) {
318
- if (isset($helperPayline->walletId)) {
319
- $array['buyer']['walletId'] = $helperPayline->walletId;
320
- }
321
- }
322
- if ($helperPayline->canSubscribeWallet()) {
323
- //If the wallet is new (registered during payment), we must save it in the private data since it's not sent back by default
324
- if ($helperPayline->isNewWallet) {
325
- if ($helperPayline->walletId) {
326
- $paylineSDK->setPrivate(array('key'=>'newWalletId','value'=>$helperPayline->walletId));
327
- }
328
- }
329
- }
330
- }
331
-
332
- // ADD CONTRACT WALLET ARRAY TO $array
333
- $array['walletContracts'] = Mage::helper('payline')->buildContractNumberWalletList();
334
-
335
- // EXECUTE
336
- try{
337
- $result = $paylineSDK->doWebPayment($array);
338
- }catch(Exception $e){
339
- Mage::logException($e);
340
- $this->updateStock();
341
- $msg=Mage::helper('payline')->__('Error during payment');
342
- Mage::getSingleton('core/session')->addError($msg);
343
- $msgLog='Unknown PAYLINE ERROR (payline unreachable?)';
344
- Mage::helper('payline/logger')->log('[cptAction] ' .$this->order->getIncrementId().' '. $msgLog);
345
- $this->_redirect('checkout/onepage');
346
- return;
347
- }
348
- // RESPONSE
349
- $initStatus = Mage::getStoreConfig('payment/payline_common/init_order_status');
350
- if(isset($result) && is_array($result) && $result['result']['code'] == '00000'){
351
- $this->order->setState(Mage_Sales_Model_Order::STATE_NEW,$initStatus,'',false);
352
- $this->order->save();
353
- header("location:".$result['redirectURL']);
354
- exit();
355
- }else {//Payline error
356
- $this->updateStock();
357
- $msg=Mage::helper('payline')->__('Error during payment');
358
- Mage::getSingleton('core/session')->addError($msg);
359
- if (isset($result) && is_array($result)){
360
- $msgLog='PAYLINE ERROR : '.$result['result']['code']. ' ' . $result['result']['shortMessage'] . ' ('.$result['result']['longMessage'] . ')';
361
- } elseif (isset($result) && is_string($result)){
362
- $msgLog='PAYLINE ERROR : '.$result;
363
- } else{
364
- $msgLog='Unknown PAYLINE ERROR';
365
- }
366
- $this->order->setState(Mage_Sales_Model_Order::STATE_NEW,$initStatus,$msgLog,false);
367
- $this->order->save();
368
- Mage::helper('payline/logger')->log('[cptAction] ' .$this->order->getIncrementId().' '.$msgLog);
369
- $this->_redirect('checkout/onepage');
370
- return;
371
- }
372
- }
373
-
374
- /**
375
- * Initialize & process the direct payment request
376
- */
377
- public function directAction(){
378
- $array = $this->init();
379
- $paylineSDK = Mage::helper('payline')->initPayline('DIRECT',$array['payment']['currency']);
380
-
381
- //PAYMENT
382
- $array['payment']['action'] = Mage::getStoreConfig('payment/PaylineDIRECT/payline_payment_action');
383
- $array['payment']['mode'] = 'CPT';
384
-
385
- $contract = Mage::getModel('payline/contract')->load($_SESSION['payline_ccdata']->cc_type);
386
- $array['payment']['contractNumber'] = $contract->getNumber();
387
-
388
- //ORDER
389
- $array['order']['date'] = date("d/m/Y H:i");
390
-
391
- //PRIVATE DATA
392
- $privateData1 = array();
393
- $privateData1['key'] = 'orderRef';
394
- $privateData1['value'] = substr(str_replace(array("\r","\n","\t"), array('','',''),$array['order']['ref']), 0,255);
395
- $paylineSDK->setPrivate($privateData1);
396
-
397
- //ORDER DETAILS (optional)
398
- $items = $this->order->getAllItems();
399
- if ($items) {
400
- if(count($items)>100) $items=array_slice($items,0,100);
401
- foreach($items as $item) {
402
- $itemPrice = round($item->getPrice()*100);
403
- if($itemPrice > 0){
404
- $product = array();
405
- $product['ref'] = Mage::helper('payline')->encodeString(substr(str_replace(array("\r","\n","\t"), array('','',''),$item->getName()),0,50));
406
- $product['price'] = round($item->getPrice()*100);
407
- $product['quantity'] = round($item->getQtyOrdered());
408
- $product['comment'] = Mage::helper('payline')->encodeString(substr(str_replace(array("\r","\n","\t"), array('','',''),$item->getDescription()), 0,255));
409
- $paylineSDK->setItem($product);
410
- }
411
- continue;
412
- }
413
- }
414
- // CARD INFO
415
- $array['card']['number'] = $_SESSION['payline_ccdata']->cc_number;
416
- $array['card']['cardholder'] = $_SESSION['payline_ccdata']->cc_owner;
417
- $array['card']['type'] = $contract->getContractType();
418
- $array['card']['expirationDate'] = $_SESSION['payline_ccdata']->cc_exp_month.$_SESSION['payline_ccdata']->cc_exp_year;
419
- $array['card']['cvx'] = $_SESSION['payline_ccdata']->cc_cid;
420
-
421
- // Customer IP
422
- $array['buyer']['ip'] = Mage::helper('core/http')->getRemoteAddr();
423
-
424
- //3D secure
425
- $array['3DSecure'] = array();
426
-
427
- //BANK ACCOUNT DATA
428
- $array['BankAccountData'] = array();
429
-
430
- //version
431
- $array['version'] = Monext_Payline_Helper_Data::VERSION;
432
- // OWNER
433
- $array['owner']['lastName'] = Mage::helper('payline')->encodeString($_SESSION['payline_ccdata']->cc_owner);
434
-
435
- try{
436
- $author_result = $paylineSDK->doAuthorization($array);
437
- }catch(Exception $e){
438
- Mage::logException($e);
439
- $this->updateStock();
440
- $msg=Mage::helper('payline')->__('Error during payment');
441
- Mage::getSingleton('core/session')->addError($msg);
442
- $msgLog='Unknown PAYLINE ERROR (payline unreachable?)';
443
- Mage::helper('payline/logger')->log('[directAction] ' .$this->order->getIncrementId().$msgLog);
444
- $this->_redirect('checkout/onepage');
445
- return;
446
- }
447
- // RESPONSE
448
- $failedOrderStatus = Mage::getStoreConfig('payment/payline_common/failed_order_status');
449
- if(isset($author_result) && is_array($author_result) && $author_result['result']['code'] == '00000'){
450
- $array_details = array();
451
- $array_details['orderRef'] = $this->order->getRealOrderId();
452
- $array_details['transactionId'] = $author_result['transaction']['id'];
453
- $array_details['startDate'] = '';
454
- $array_details['endDate'] = '';
455
- $array_details['transactionHistory']= '';
456
- $array_details['version'] = Monext_Payline_Helper_Data::VERSION;
457
- $array_details['archiveSearch'] = '';
458
- $detail_result = $paylineSDK->getTransactionDetails($array_details);
459
-
460
- if($this->updateOrder($detail_result,$detail_result['transaction']['id'], 'DIRECT')){
461
- $redirectUrl = Mage::getBaseUrl()."checkout/onepage/success/";
462
- if($detail_result['result']['code'] == '04003') {
463
- $newOrderStatus = Mage::getStoreConfig('payment/payline_common/fraud_order_status');
464
- Mage::helper('payline')->setOrderStatus($this->order, $newOrderStatus);
465
- } else {
466
- Mage::helper('payline')->setOrderStatusAccordingToPaymentMode(
467
- $this->order, $array['payment']['action'] );
468
- }
469
-
470
- $array['wallet']['lastName'] = $array['buyer']['lastName'];
471
- $array['wallet']['firstName'] = $array['buyer']['firstName'];
472
- $array['wallet']['email'] = $array['buyer']['email'];
473
- // remember, the Beast is not so far
474
- $array['address'] = $array['shippingAddress'];
475
- $array['ownerAddress'] = null;
476
-
477
- Mage::helper('payline')->createWalletForCurrentCustomer($paylineSDK, $array);
478
- Mage::helper('payline')->automateCreateInvoiceAtShopReturn('DIRECT', $this->order);
479
- $this->order->save();
480
- Mage_Core_Controller_Varien_Action::_redirectSuccess($redirectUrl);
481
- }else{
482
- $msgLog='Error during order update (#'.$this->order->getIncrementId().')'."\n";
483
- $this->order->setState(Mage_Sales_Model_Order::STATE_CANCELED,$failedOrderStatus,$msgLog,false);
484
- $this->order->save();
485
-
486
- $msg=Mage::helper('payline')->__('Error during payment');
487
- Mage::getSingleton('core/session')->addError($msg);
488
- Mage::helper('payline/logger')->log('[directAction] ' .$this->order->getIncrementId().$msgLog);
489
- $this->_redirectUrl($this->_getPaymentRefusedRedirectUrl());
490
- return;
491
- }
492
- }else {
493
- if(isset($author_result) && is_array($author_result)){
494
- $msgLog='PAYLINE ERROR : '.$author_result['result']['code']. ' ' . $author_result['result']['shortMessage'] . ' ('.$author_result['result']['longMessage'].')';
495
- } elseif(isset($author_result) && is_string($author_result)){
496
- $msgLog='PAYLINE ERROR : '. $author_result;
497
- } else{
498
- $msgLog='Unknown PAYLINE ERROR';
499
- }
500
-
501
- $this->updateStock();
502
- $this->order->setState(Mage_Sales_Model_Order::STATE_CANCELED,$failedOrderStatus,$msgLog,false);
503
- $this->order->save();
504
-
505
- $msg=Mage::helper('payline')->__('Error during payment');
506
- Mage::getSingleton('core/session')->addError($msg);
507
- Mage::helper('payline/logger')->log('[directAction] ' .$this->order->getIncrementId().$msgLog);
508
- $this->_redirectUrl($this->_getPaymentRefusedRedirectUrl());
509
- return;
510
- }
511
- }
512
-
513
- /** Initialisize a WALLET payment request
514
- *
515
- */
516
- /**
517
- * Initialize & process a wallet direct payment request
518
- */
519
- public function walletAction(){
520
- $array = $this->init();
521
- $paylineSDK = Mage::helper('payline')->initPayline('WALLET',$array['payment']['currency']);
522
-
523
- //PAYMENT
524
- $array['payment']['action'] = Mage::getStoreConfig('payment/PaylineWALLET/payline_payment_action');
525
- $array['payment']['mode'] = 'CPT';
526
-
527
- //Get the wallet contract number from card type
528
- $wallet=Mage::getModel('payline/wallet')->getWalletData();
529
- $contract = Mage::getModel('payline/contract')
530
- ->getCollection()
531
- ->addFilterStatus(true,Mage::app()->getStore()->getId())
532
- ->addFieldToFilter('contract_type',$wallet['card']['type'])
533
- ->getFirstItem();
534
-
535
- $array['payment']['contractNumber']= $contract->getNumber();
536
-
537
- //ORDER
538
- $array['order']['date'] = date("d/m/Y H:i");
539
-
540
- //PRIVATE DATA
541
- $privateData1 = array();
542
- $privateData1['key'] = 'orderRef';
543
- $privateData1['value'] = substr(str_replace(array("\r","\n","\t"), array('','',''),$array['order']['ref']), 0,255);
544
- $paylineSDK->setPrivate($privateData1);
545
-
546
- //ORDER DETAILS (optional)
547
- $items = $this->order->getAllItems();
548
- if ($items) {
549
- if(count($items)>100) $items=array_slice($items,0,100);
550
- foreach($items as $item) {
551
- $itemPrice = round($item->getPrice()*100);
552
- if($itemPrice > 0){
553
- $product = array();
554
- $product['ref'] = Mage::helper('payline')->encodeString(substr(str_replace(array("\r","\n","\t"), array('','',''),$item->getName()),0,50));
555
- $product['price'] = round($item->getPrice()*100);
556
- $product['quantity'] = round($item->getQtyOrdered());
557
- $product['comment'] = Mage::helper('payline')->encodeString(substr(str_replace(array("\r","\n","\t"), array('','',''),$item->getDescription()), 0,255));
558
- $paylineSDK->setItem($product);
559
- }
560
- continue;
561
- }
562
- }
563
-
564
- $customerId=Mage::getSingleton('customer/session')->getId();
565
- $customer=Mage::getModel('customer/customer')->load($customerId);
566
- $walletId=$customer->getWalletId();
567
- $array['walletId']=$walletId;
568
- $array['cardInd'] = '';
569
- $array['version'] = Monext_Payline_Helper_Data::VERSION;
570
-
571
- try{
572
- $author_result = $paylineSDK->doImmediateWalletPayment($array);
573
- }catch(Exception $e){
574
- Mage::logException($e);
575
- $this->updateStock();
576
- $msg=Mage::helper('payline')->__('Error during payment');
577
- Mage::getSingleton('core/session')->addError($msg);
578
- $msgLog='Unknown PAYLINE ERROR (payline unreachable?) during wallet payment';
579
- Mage::helper('payline/logger')->log('[walletAction] ' .$this->order->getIncrementId().$msgLog);
580
- $this->_redirect('checkout/onepage');
581
- return;
582
- }
583
- // RESPONSE
584
- $failedOrderStatus = Mage::getStoreConfig('payment/payline_common/failed_order_status');
585
- if(isset($author_result) && is_array($author_result) && $author_result['result']['code'] == '00000'){
586
- $array_details = array();
587
- $array_details['orderRef'] = $this->order->getRealOrderId();
588
- $array_details['transactionId'] = $author_result['transaction']['id'];
589
- $array_details['startDate'] = '';
590
- $array_details['endDate'] = '';
591
- $array_details['transactionHistory']= '';
592
- $array_details['version'] = Monext_Payline_Helper_Data::VERSION;
593
- $array_details['archiveSearch'] = '';
594
- $detail_result = $paylineSDK->getTransactionDetails($array_details);
595
-
596
- if(is_array($detail_result) && $this->updateOrder($detail_result,$detail_result['transaction']['id'], 'WALLET')){
597
- $redirectUrl = Mage::getBaseUrl()."checkout/onepage/success/";
598
- if($detail_result['result']['code'] == '04003') {
599
- $newOrderStatus = Mage::getStoreConfig('payment/payline_common/fraud_order_status');
600
- Mage::helper('payline')->setOrderStatus($this->order, $newOrderStatus);
601
- } else {
602
- Mage::helper('payline')->setOrderStatusAccordingToPaymentMode(
603
- $this->order, $array['payment']['action'] );
604
- }
605
- Mage::helper('payline')->automateCreateInvoiceAtShopReturn('WALLET', $this->order);
606
- $this->order->save();
607
- Mage_Core_Controller_Varien_Action::_redirectSuccess($redirectUrl);
608
- }else{
609
- $msgLog='Error during order update (#'.$this->order->getIncrementId().')';
610
- $this->order->setState(Mage_Sales_Model_Order::STATE_CANCELED,$failedOrderStatus,$msgLog,false);
611
- $this->order->save();
612
- $msg=Mage::helper('payline')->__('Error during payment');
613
- Mage::getSingleton('core/session')->addError($msg);
614
- Mage::helper('payline/logger')->log('[walletAction] ' .$this->order->getIncrementId().$msgLog);
615
- $this->_redirectUrl($this->_getPaymentRefusedRedirectUrl());
616
- return;
617
- }
618
-
619
- }else {
620
- $this->updateStock();
621
- if(isset($author_result) && is_array($author_result)){
622
- $msgLog='PAYLINE ERROR during doImmediateWalletPayment: '.$author_result['result']['code']. ' ' . $author_result['result']['shortMessage'] . ' ('.$author_result['result']['longMessage'].')';
623
- }elseif(isset($author_result) && is_string($author_result)){
624
- $msgLog='PAYLINE ERROR during doImmediateWalletPayment: '.$author_result;
625
- } else {
626
- $msgLog='Unknown PAYLINE ERROR during doImmediateWalletPayment';
627
- }
628
-
629
- $this->order->setState(Mage_Sales_Model_Order::STATE_CANCELED,$failedOrderStatus,$msgLog,false);
630
- $this->order->save();
631
-
632
- $msg=Mage::helper('payline')->__('Error during payment');
633
- Mage::getSingleton('core/session')->addError($msg);
634
- Mage::helper('payline/logger')->log('[walletAction] ' .$this->order->getIncrementId().$msgLog);
635
- $this->_redirectUrl($this->_getPaymentRefusedRedirectUrl());
636
- return;
637
- }
638
- }
639
- /**
640
- * Initialize the NX payment request
641
- */
642
- public function nxAction(){
643
- //Check if wallet is sendable
644
- //Must be done before call to Payline helper initialisation
645
- $expiredWalletId=false;
646
- if(Mage::getSingleton('customer/session')->isLoggedIn()){
647
- $customer=Mage::getSingleton('customer/session')->getCustomer();
648
- $customer=Mage::getModel('customer/customer')->load($customer->getId());
649
- if ($customer->getWalletId() && !Mage::getModel('payline/wallet')->checkExpirationDate()){
650
- $expiredWalletId=true;
651
- }
652
- }
653
-
654
- $array = $this->init();
655
- $helperPayline = Mage::helper('payline');
656
- $paylineSDK = $helperPayline->initPayline('NX',$array['payment']['currency']);
657
- $array['version'] = Monext_Payline_Helper_Data::VERSION;
658
-
659
- //If wallet isn't sendable...
660
- if ($expiredWalletId){
661
- Mage::helper('payline')->walletId=null;
662
- }
663
-
664
- $nx = Mage::getStoreConfig('payment/PaylineNX/billing_occurrences');
665
- $array['payment']['mode'] = 'NX';
666
- $array['payment']['action'] = 101;
667
- $array['payment']['contractNumber'] = $helperPayline->contractNumber;
668
- $array['recurring']['amount'] = round($array['payment']['amount']/$nx);
669
- $array['recurring']['firstAmount'] = $array['payment']['amount']-($array['recurring']['amount']*($nx-1));
670
- $array['recurring']['billingCycle'] = Mage::getStoreConfig('payment/PaylineNX/billing_cycle');
671
- $array['recurring']['billingLeft'] = $nx;
672
- $array['recurring']['billingDay'] = '';
673
- $array['recurring']['startDate'] = '';
674
-
675
- //second contracts
676
- $array['secondContracts'] = explode(';',$helperPayline->secondaryContractNumberList);
677
-
678
- // PRIVATE DATA
679
- $privateData = array();
680
- $privateData['key'] = "orderRef";
681
- $privateData['value'] = substr(str_replace(array("\r","\n","\t"), array('','',''),$array['order']['ref']), 0,255);
682
- $paylineSDK->setPrivate($privateData);
683
-
684
- //ORDER DETAILS (optional)
685
- $items = $this->order->getAllItems();
686
- if ($items) {
687
- if(count($items)>100) $items=array_slice($items,0,100);
688
- foreach($items as $item) {
689
- $itemPrice = round($item->getPrice()*100);
690
- if($itemPrice > 0){
691
- $product = array();
692
- $product['ref'] = Mage::helper('payline')->encodeString(substr(str_replace(array("\r","\n","\t"), array('','',''),$item->getName()),0,50));
693
- $product['price'] = round($item->getPrice()*100);
694
- $product['quantity'] = round($item->getQtyOrdered());
695
- $product['comment'] = Mage::helper('payline')->encodeString(substr(str_replace(array("\r","\n","\t"), array('','',''),$item->getDescription()), 0,255));
696
- $paylineSDK->setItem($product);
697
- }
698
- continue;
699
- }
700
- }
701
-
702
- //WALLET
703
- if(Mage::getStoreConfig('payment/PaylineCPT/send_wallet_id')) {
704
- if (!isset($array['buyer']['walletId'])) {
705
- if (isset($helperPayline->walletId)) {
706
- $array['buyer']['walletId'] = $helperPayline->walletId;
707
- }
708
- }
709
- if ($helperPayline->canSubscribeWallet()) {
710
- //If the wallet is new (registered during payment), we must save it in the private data since it's not sent back by default
711
- if ($helperPayline->isNewWallet) {
712
- if ($helperPayline->walletId) {
713
- $paylineSDK->setPrivate(array('key'=>'newWalletId','value'=>$helperPayline->walletId));
714
- }
715
- }
716
- }
717
- }
718
-
719
- // ADD CONTRACT WALLET ARRAY TO $array
720
- $array['walletContracts'] = Mage::helper('payline')->buildContractNumberWalletList();
721
-
722
- // EXECUTE
723
- try{
724
- $result = $paylineSDK->doWebPayment($array);
725
- }catch(Exception $e){
726
- Mage::logException($e);
727
- $this->updateStock();
728
- $msg=Mage::helper('payline')->__('Error during payment');
729
- Mage::getSingleton('core/session')->addError($msg);
730
- $msgLog='Unknown PAYLINE ERROR (payline unreachable?)';
731
- Mage::helper('payline/logger')->log('[nxAction] ' .$this->order->getIncrementId().$msgLog);
732
- $this->_redirect('checkout/onepage');
733
- return;
734
- }
735
- // RESPONSE
736
- $initStatus = Mage::getStoreConfig('payment/payline_common/init_order_status');
737
- if(isset($result) && is_array($result) && $result['result']['code'] == '00000'){
738
- $this->order->setState(Mage_Sales_Model_Order::STATE_NEW,$initStatus,'',false);
739
- $this->order->save();
740
- header("location:".$result['redirectURL']);
741
- exit();
742
- }else {
743
- $this->updateStock();
744
- if(isset($result) && is_array($result)){
745
- $msgLog='PAYLINE ERROR : '.$result['result']['code']. ' ' . $result['result']['shortMessage'] . ' ('.$result['result']['longMessage'].')';
746
- } elseif(isset($result) && is_string($result)){
747
- $msgLog='PAYLINE ERROR : '.$result;
748
- } else{
749
- $msgLog='Unknown PAYLINE ERROR';
750
- }
751
- $this->order->setState(Mage_Sales_Model_Order::STATE_NEW,$initStatus,$msgLog,false);
752
- $this->order->save();
753
- $msg=Mage::helper('payline')->__('Error during payment');
754
- Mage::helper('payline/logger')->log('[nxAction] ' .$this->order->getIncrementId().$msgLog);
755
- Mage::getSingleton('core/session')->addError($msg);
756
- $this->_redirect('checkout/onepage');
757
- return;
758
-
759
- }
760
- }
761
-
762
- /**
763
- * Action called on the customer's return form the Payline website.
764
- */
765
- public function cptReturnAction(){
766
- $res = Mage::helper('payline')->initPayline('CPT')->getWebPaymentDetails(array('token' => $_GET['token'], 'version' => Monext_Payline_Helper_Data::VERSION));
767
-
768
- $this->_getCustomerSession()->setWebPaymentDetails($res);
769
-
770
- if (isset($res['privateDataList']['privateData']['value'])){
771
- $orderRef=$res['privateDataList']['privateData']['value'];
772
- }else{
773
- foreach ($res['privateDataList']['privateData'] as $privateDataList){
774
- if($privateDataList->key == 'orderRef'){
775
- $orderRef = $privateDataList->value;
776
- }
777
- }
778
- }
779
-
780
- if (!isset($orderRef)){
781
- $msgLog='Couldn\'t find order increment id in cpt payment result';
782
- Mage::helper('payline/logger')->log('[cptNotifAction] ' .$this->order->getIncrementId().$msgLog);
783
- $this->_redirectUrl($this->_getPaymentRefusedRedirectUrl());
784
- return;
785
- }
786
- $this->order = Mage::getModel('sales/order')->loadByIncrementId($orderRef);
787
-
788
- //If order is still new, notifAction haven't been called yet
789
- if ($this->order->getState()==Mage_Sales_Model_Order::STATE_NEW){
790
- Mage_Core_Controller_Varien_Action::_redirectSuccess($this->cptNotifAction());
791
- }
792
-
793
- if($res['result']['code'] == '00000' || $res['result']['code'] == '04003'){
794
- $this->_redirect('checkout/onepage/success');
795
- }else{
796
- Mage::getSingleton('core/session')->addError(Mage::helper('payline')->__('Your payment is refused'));
797
- $this->_redirectUrl($this->_getPaymentRefusedRedirectUrl());
798
- }
799
- }
800
-
801
- /**
802
- * Action called on the customer's return form the Payline website.
803
- */
804
- public function nxReturnAction(){
805
- Mage_Core_Controller_Varien_Action::_redirectSuccess($this->nxNotifAction());
806
- }
807
-
808
- /**
809
- * Save CPT payment result, called by the bank when the transaction is done
810
- */
811
- public function cptNotifAction(){
812
- $res = $this->_getCustomerSession()->getWebPaymentDetails(true);
813
- if (empty($res)) {
814
- $res = Mage::helper('payline')->initPayline('CPT')->getWebPaymentDetails(array('token' => $_GET['token'], 'version' => Monext_Payline_Helper_Data::VERSION));
815
- }
816
-
817
- if (isset($res['privateDataList']['privateData']['value'])){
818
- $orderRef=$res['privateDataList']['privateData']['value'];
819
- }else{
820
- foreach ($res['privateDataList']['privateData'] as $privateDataList){
821
- if($privateDataList->key == 'orderRef'){
822
- $orderRef = $privateDataList->value;
823
- }
824
- if($privateDataList->key == 'newWalletId'){
825
- $newWalletId = $privateDataList->value;
826
- }
827
- }
828
- }
829
- if (!isset($orderRef)){
830
- $msgLog='Couldn\'t find order increment id in cpt payment result';
831
- Mage::helper('payline/logger')->log('[cptNotifAction] ' .$this->order->getIncrementId().$msgLog);
832
- $redirectUrl = Mage::getBaseUrl()."checkout/onepage/";
833
- }
834
- $this->order = Mage::getModel('sales/order')->loadByIncrementId($orderRef);
835
- $payment = $this->order->getPayment();
836
- if ($payment->getBaseAmountPaid() != $payment->getBaseAmountOrdered()) {
837
-
838
- $failedOrderStatus = Mage::getStoreConfig('payment/payline_common/failed_order_status');
839
-
840
- if(is_array($res) && $this->updateOrder($res,$res['transaction']['id'], 'CPT')){
841
- $redirectUrl = Mage::getBaseUrl()."checkout/onepage/success/";
842
-
843
- if($res['result']['code'] == '04003') {
844
- $newOrderStatus = Mage::getStoreConfig('payment/payline_common/fraud_order_status');
845
- Mage::helper('payline')->setOrderStatus($this->order, $newOrderStatus);
846
- } else {
847
- Mage::helper('payline')->setOrderStatusAccordingToPaymentMode(
848
- $this->order, $res['payment']['action'] );
849
- }
850
-
851
- if(isset($newWalletId)){
852
- $this->saveWallet($newWalletId);
853
- }
854
- Mage::helper('payline')->automateCreateInvoiceAtShopReturn('CPT', $this->order);
855
- }else{
856
- if(isset($res) && is_array($res)){
857
- $msgLog='PAYLINE ERROR : '.$res['result']['code']. ' ' . $res['result']['shortMessage'] . ' ('.$res['result']['longMessage'].')';
858
- } elseif(isset($res) && is_string($res)){
859
- $msgLog='PAYLINE ERROR : '.$res;
860
- } else{
861
- $msgLog='Error during order update (#'.$this->order->getIncrementId().')';
862
- }
863
-
864
- if (is_array($res) && !($res['result']['code'] == '02306' || $res['result']['code'] == '02533')) {
865
- if ($res['result']['code'] == '02304' || $res['result']['code'] == '02324' || $res['result']['code'] == '02534') {
866
- $abandonedStatus = Mage::getStoreConfig('payment/payline_common/resignation_order_status');
867
- $this->order->setState(Mage_Sales_Model_Order::STATE_CANCELED,$abandonedStatus,$msgLog,false);
868
- } else {
869
- $this->order->setState(Mage_Sales_Model_Order::STATE_CANCELED,$failedOrderStatus,$msgLog,false);
870
- }
871
- }
872
-
873
- Mage::helper('payline/logger')->log('[cptNotifAction] ' .$this->order->getIncrementId().$msgLog);
874
- $redirectUrl = $this->_getPaymentRefusedRedirectUrl();
875
- }
876
- $this->order->save();
877
- } else {
878
- $redirectUrl = Mage::getBaseUrl()."checkout/onepage/success/";
879
- }
880
- return $redirectUrl;
881
- }
882
-
883
- /**
884
- * Save NX payment result, called by the bank when the transaction is done
885
- */
886
- public function nxNotifAction(){
887
- $res = Mage::helper('payline')->initPayline('NX')->getWebPaymentDetails(array('token' => $_GET['token'], 'version' => Monext_Payline_Helper_Data::VERSION));
888
- if (isset($res['privateDataList']['privateData']['value'])){
889
- $orderRef=$res['privateDataList']['privateData']['value'];
890
- }else{
891
- foreach ($res['privateDataList']['privateData'] as $privateDataList){
892
- if($privateDataList->key == 'orderRef'){
893
- $orderRef = $privateDataList->value;
894
- }
895
- }
896
- }
897
- if (!isset($orderRef)){
898
- $msgLog='Référence commande introuvable dans le résultat du paiement Nx';
899
- Mage::helper('payline/logger')->log('[nxNotifAction] ' .$this->order->getIncrementId().' '.$msgLog);
900
- $redirectUrl = Mage::getBaseUrl()."checkout/onepage/";
901
- }
902
- $this->order = Mage::getModel('sales/order')->loadByIncrementId($orderRef);
903
-
904
- $failedOrderStatus = Mage::getStoreConfig('payment/payline_common/failed_order_status');
905
-
906
- if(isset($res['billingRecordList']['billingRecord'])){
907
- $size = sizeof($res['billingRecordList']['billingRecord']);
908
- }else{
909
- $size = 0;
910
- }
911
- $billingRecord = false;
912
- for($i=0;$i<$size;$i++){
913
- if($res['billingRecordList']['billingRecord'][$i]->status == 1){
914
- $txnId = $res['billingRecordList']['billingRecord'][$i]->transaction->id;
915
- if(!$this->order->getTransaction($txnId)){
916
- $billingRecord = $res['billingRecordList']['billingRecord'][$i];
917
- }
918
- }
919
- }
920
- if($billingRecord && $this->updateOrder($res,$billingRecord->transaction->id,'NX')) {
921
- $redirectUrl = Mage::getBaseUrl()."checkout/onepage/success/";
922
-
923
- if($res['result']['code'] == '04003') {
924
- $newOrderStatus = Mage::getStoreConfig('payment/payline_common/fraud_order_status');
925
- Mage::helper('payline')->setOrderStatus($this->order, $newOrderStatus);
926
- } else if( $res['result']['code'] == '02501' ) { // credit card (CC) will expire
927
- $statusScheduleAlert = Mage::getStoreConfig('payment/PaylineNX/status_when_payline_schedule_alert');
928
- Mage::helper('payline')->setOrderStatus( $this->order, $statusScheduleAlert );
929
- } else {
930
- Mage::helper('payline')->setOrderStatusAccordingToPaymentMode(
931
- $this->order, $res['payment']['action'] );
932
- }
933
-
934
- if (isset($res['privateDataList']['privateData'][1]) && $res['privateDataList']['privateData'][1]->key=="newWalletId" && $res['privateDataList']['privateData'][1]->value!=''){
935
- $this->saveWallet($res['privateDataList']['privateData'][1]->value);
936
- }
937
- $payment = $this->order->getPayment();
938
- if ($payment->getBaseAmountPaid() != $payment->getBaseAmountOrdered()) {
939
- Mage::helper('payline')->automateCreateInvoiceAtShopReturn('NX', $this->order);
940
- }
941
- }else{
942
- if(isset($res) && is_array($res)){
943
- $msgLog='PAYLINE ERROR : '.$res['result']['code']. ' ' . $res['result']['shortMessage'] . ' ('.$res['result']['longMessage'].')';
944
- } elseif(isset($res) && is_string($res)){
945
- $msgLog='PAYLINE ERROR : '.$res;
946
- } else{
947
- $msgLog='Error during order update (#'.$this->order->getIncrementId().')';
948
- }
949
-
950
- if (is_array($res) && !($res['result']['code'] == '02306' || $res['result']['code'] == '02533')) {
951
- if (is_array($res) && ($res['result']['code'] == '02304' || $res['result']['code'] == '02324' || $res['result']['code'] == '02534')) {
952
- $abandonedStatus = Mage::getStoreConfig('payment/payline_common/resignation_order_status');
953
- $this->order->setState(Mage_Sales_Model_Order::STATE_CANCELED,$abandonedStatus,$msgLog,false);
954
- } else {
955
- $statusScheduleAlert = Mage::getStoreConfig('payment/PaylineNX/status_when_payline_schedule_alert');
956
- if( !empty( $statusScheduleAlert ) ) { // if user conf is set
957
- $failedOrderStatus = $statusScheduleAlert;
958
- }
959
- $this->order->setState(Mage_Sales_Model_Order::STATE_CANCELED,$failedOrderStatus,$msgLog,false);
960
- }
961
- }
962
-
963
- Mage::helper('payline/logger')->log('[nxNotifAction] ' .$this->order->getIncrementId().$msgLog);
964
- Mage::getSingleton('core/session')->addError(Mage::helper('payline')->__('Your payment is refused'));
965
- $redirectUrl = $this->_getPaymentRefusedRedirectUrl();
966
- }
967
- $this->order->save();
968
- return $redirectUrl;
969
- }
970
-
971
- /**
972
- * Method called by Payline to notify (except first) each term payment.
973
- * Url to this action must be set in Payline personnal account.
974
- */
975
- public function nxTermNotifAction()
976
- {
977
- $statusScheduleAlert = Mage::getStoreConfig('payment/PaylineNX/status_when_payline_schedule_alert');
978
- $statusCCExpired = Mage::getStoreConfig('payment/PaylineNX/status_when_credit_card_schedule_is_expired');
979
- if( !empty( $statusScheduleAlert ) || !empty( $statusCCExpired ) ) {
980
- if( $this->isNxTermParamsOk( $_GET ) ) {
981
- /* BILL = value required for terms notifications
982
- WEBTRS = value for cash web payment */
983
- if( $_GET['notificationType'] == 'BILL' ) { //
984
- $transactionParams = array();
985
- $transactionParams['transactionId'] = $_GET['transactionId'];
986
- $transactionParams['orderRef'] = $_GET['orderRef'];
987
- $transactionParams['version'] = Monext_Payline_Helper_Data::VERSION;
988
- $transactionParams['startDate'] = '';
989
- $transactionParams['endDate'] = '';
990
- $transactionParams['transactionHistory']= '';
991
- $transactionParams['archiveSearch'] = '';
992
-
993
- $res = Mage::helper('payline')->initPayline('NX')->getTransactionDetails( $transactionParams );
994
-
995
- if( isset( $res )
996
- && is_array( $res )
997
- && isset( $res['result'] )
998
- && isset( $res['result']['code'] ) )
999
- {
1000
- $mustSave = true;
1001
- switch( $res['result']['code'] ) {
1002
- case '00000':
1003
- case '02500':
1004
- case '04003':
1005
- $mustSave = false;
1006
- break;
1007
- case '02501': // payment card will expire
1008
- if( !empty( $statusScheduleAlert ) ) {
1009
- $this->order = $this->setOrderStatus( $statusScheduleAlert, $_GET['orderRef'] );
1010
- break;
1011
- }
1012
- default: // if default => error (cc expired or other errors)
1013
- if( !empty( $statusCCExpired ) ) {
1014
- $this->order = $this->setOrderStatus( $statusCCExpired, $_GET['orderRef'] );
1015
- } else {
1016
- $mustSave = false;
1017
- }
1018
- break;
1019
- }
1020
- if( $mustSave ) { $this->order->save(); }
1021
- } // end if ( isset($res) ...
1022
- } // end if BILL
1023
- } // end if $this->isNxTermParamsOk
1024
- } // end if !empty( $statusScheduleAlert ) || !empty( $statusCCExpired )
1025
- } // end func
1026
-
1027
- /**
1028
- * Check if $params contains all the required keys for PaylineSDK#getTransactionDetails()
1029
- * @param $params {array} array params for PaylineSDK#getTransactionDetails(), should contain all keys required.
1030
- * @return bool true if $params ok, otherwise false
1031
- */
1032
- private function isNxTermParamsOk($params)
1033
- {
1034
- if( !isset( $params['notificationType'] ) ) return false;
1035
- if( !isset( $params['paymentRecordId'] ) ) return false;
1036
- if( !isset( $params['walletId'] ) ) return false;
1037
- if( !isset( $params['transactionId'] ) ) return false;
1038
- if( !isset( $params['billingRecordDate'] ) ) return false;
1039
- if( !isset( $params['orderRef'] ) ) return false;
1040
- return true;
1041
- }
1042
-
1043
- /**
1044
- * Set an order status. If !isset($this->order) process order model from $orderRef
1045
- * @param $status {string} status order to assign
1046
- * @param $orderRef {string} entity_id order
1047
- * @return Mage_Sales_Model_Order Return the order object with new status set
1048
- */
1049
- private function setOrderStatus($status, $orderRef)
1050
- {
1051
- if( isset( $this->order ) ) {
1052
- $order = $this->order;
1053
- } else {
1054
- $order = Mage::getModel('sales/order')
1055
- ->getCollection()
1056
- ->addFieldToFilter('increment_id', $orderRef)
1057
- ->getFirstItem();
1058
- }
1059
- Mage::helper('payline')->setOrderStatus( $order, $status );
1060
- return $order;
1061
- }
1062
-
1063
- /**
1064
- * Cancel a CPT payment request /order
1065
- */
1066
- public function cptCancelAction(){
1067
- $res = Mage::helper('payline')->initPayline('CPT')->getWebPaymentDetails(array('token' => $_GET['token'], 'version' => Monext_Payline_Helper_Data::VERSION));
1068
-
1069
- if (isset($res['privateDataList']['privateData']['value'])){
1070
- $orderRef=$res['privateDataList']['privateData']['value'];
1071
- }else{
1072
- foreach ($res['privateDataList']['privateData'] as $privateDataList){
1073
- if($privateDataList->key == 'orderRef'){
1074
- $orderRef = $privateDataList->value;
1075
- }
1076
- }
1077
- }
1078
- if (!isset($orderRef)){
1079
- $msgLog='Couldn\'t find order increment id in cpt payment cancel result';
1080
- Mage::helper('payline/logger')->log('[cptCancelAction] ' .$this->order->getIncrementId().$msgLog);
1081
- $redirectUrl = Mage::getBaseUrl()."checkout/onepage/";
1082
- $this->_redirect($redirectUrl);
1083
- return;
1084
- }
1085
- $this->order = Mage::getModel('sales/order')->loadByIncrementId($orderRef);
1086
- $msg = '';
1087
- if(is_string($res)) {
1088
- $msg='PAYLINE ERROR : '.$res;
1089
- Mage::helper('payline/logger')->log('[cptCancelAction] ' .$this->order->getIncrementId(). ' ' . $msg);
1090
- $cancelStatus=Mage::getStoreConfig('payment/payline_common/failed_order_status');
1091
- } elseif (substr($res['result']['code'], 0, 2)=='01' || substr($res['result']['code'],0,3)=='021'){
1092
- //Invalid transaction or error during the process on Payline side
1093
- //No error display, the customer is already told on the Payline side
1094
- Mage::getSingleton('core/session')->addError(Mage::helper('payline')->__('Your payment is refused'));
1095
- $msg='PAYLINE ERROR : '.$res['result']['code']. ' '.$res['result']['shortMessage'] . ' (' . $res['result']['longMessage'].')';
1096
- Mage::helper('payline/logger')->log('[cptCancelAction] ' .$this->order->getIncrementId().$msg);
1097
- $cancelStatus=Mage::getStoreConfig('payment/payline_common/failed_order_status');
1098
- }else{
1099
- Mage::getSingleton('core/session')->addError(Mage::helper('payline')->__('Your payment is canceled'));
1100
- $msg='PAYLINE INFO : '.$res['result']['code']. ' '.$res['result']['shortMessage'] . ' (' . $res['result']['longMessage'].')';
1101
- //Transaction cancelled by customer
1102
- $cancelStatus = Mage::getStoreConfig('payment/payline_common/canceled_order_status');
1103
- }
1104
- $this->cancelOrder($cancelStatus, $res['result']['code'], $msg);
1105
- }
1106
-
1107
- /**
1108
- * Cancel a NX payment request /order
1109
- */
1110
- public function nxCancelAction(){
1111
- $res = Mage::helper('payline')->initPayline('NX')->getWebPaymentDetails(array('token' => $_GET['token'], 'version' => Monext_Payline_Helper_Data::VERSION));
1112
- if (isset($res['privateDataList']['privateData']['value'])){
1113
- $orderRef=$res['privateDataList']['privateData']['value'];
1114
- }else{
1115
- foreach ($res['privateDataList']['privateData'] as $privateDataList){
1116
- if($privateDataList->key == 'orderRef'){
1117
- $orderRef = $privateDataList->value;
1118
- }
1119
- }
1120
- }
1121
- if (!isset($orderRef)){
1122
- $msgLog='Couldn\'t find order increment id in nx payment cancel result';
1123
- Mage::helper('payline/logger')->log('[nxCancelAction] ' .$this->order->getIncrementId().$msgLog);
1124
- $redirectUrl = Mage::getBaseUrl()."checkout/onepage/";
1125
- }
1126
- $this->order = Mage::getModel('sales/order')->loadByIncrementId($orderRef);
1127
-
1128
- if (is_string($res)) {
1129
- $msg='PAYLINE ERROR : '.$res;
1130
- Mage::helper('payline/logger')->log('[nxCancelAction] ' .$this->order->getIncrementId(). ' ' . $msg);
1131
- $cancelStatus=Mage::getStoreConfig('payment/payline_common/failed_order_status');
1132
- } elseif (substr($res['result']['code'], 0, 2)=='01' || substr($res['result']['code'],0,3)=='021'){
1133
- //Invalid transaction or error during the process on Payline side
1134
- //No error display, the customer is already told on the Payline side
1135
- Mage::getSingleton('core/session')->addError(Mage::helper('payline')->__('Your payment is refused'));
1136
- $msg='PAYLINE ERROR : '.$res['result']['code']. ' '.$res['result']['shortMessage'] . ' (' . $res['result']['longMessage'].')';
1137
- Mage::helper('payline/logger')->log('[nxCancelAction] ' .$this->order->getIncrementId().$msg);
1138
- $cancelStatus=Mage::getStoreConfig('payment/payline_common/failed_order_status');
1139
- }else{
1140
- Mage::getSingleton('core/session')->addError(Mage::helper('payline')->__('Your payment is canceled'));
1141
- $msg='PAYLINE INFO : '.$res['result']['code']. ' '.$res['result']['shortMessage'] . ' (' . $res['result']['longMessage'].')';
1142
- //Transaction cancelled by customer
1143
- $cancelStatus = Mage::getStoreConfig('payment/payline_common/canceled_order_status');
1144
- }
1145
- $this->cancelOrder($cancelStatus, $res['result']['code'],$msg);
1146
- }
1147
-
1148
- protected function _getPaymentRefusedRedirectUrl()
1149
- {
1150
- $option = Mage::getStoreConfig('payment/payline_common/return_payment_refused');
1151
- switch($option) {
1152
- case Monext_Payline_Model_Datasource_Return::CART_EMPTY :
1153
- $url = Mage::getUrl('checkout/onepage');
1154
- break;
1155
- case Monext_Payline_Model_Datasource_Return::HISTORY_ORDERS :
1156
- $url = Mage::getUrl('sales/order/history');
1157
- break;
1158
- case Monext_Payline_Model_Datasource_Return::CART_FULL :
1159
- $url = Mage::getUrl('sales/order/reorder', array('order_id' => $this->order->getId()));
1160
- break;
1161
- default :
1162
- $url = Mage::getUrl('checkout/onepage');
1163
-
1164
- }
1165
-
1166
- return $url;
1167
- }
1168
- }
1
+ <?php
2
+
3
+ /**
4
+ * This controller manage all payline payment
5
+ * cptAction, directAction, nxAction & walletAction are called just after the checkout validation
6
+ * the return/notify/cancel are the urls called by Payline
7
+ * An exception for notifyAction : it's not directly called by Payline, since it couldn't work in a local environment; it's then called by the returnAction.
8
+ * @author fague
9
+ *
10
+ */
11
+ class Monext_Payline_IndexController extends Mage_Core_Controller_Front_Action
12
+ {
13
+ /* @var $order Mage_Sales_Model_Order */
14
+ private $order;
15
+
16
+ protected function _getCustomerSession()
17
+ {
18
+ return Mage::getSingleton('customer/session');
19
+ }
20
+
21
+ /**
22
+ * Add a transaction to the current order, depending on the payment type (Auth or Auth+Capture)
23
+ * @param string $transactionId
24
+ * @param string $paymentAction
25
+ * @return null
26
+ */
27
+ private function addTransaction($transactionId,$paymentAction){
28
+ if (version_compare(Mage::getVersion(), '1.4', 'ge')){
29
+ /* @var $payment Mage_Payment_Model_Method_Abstract */
30
+ $payment=$this->order->getPayment();
31
+ if(!$payment->getTransaction($transactionId)){ // if transaction isn't saved yet
32
+ $transaction = Mage::getModel('sales/order_payment_transaction');
33
+ $transaction->setTxnId($transactionId);
34
+ $transaction->setOrderPaymentObject($this->order->getPayment());
35
+ if($paymentAction == '100'){
36
+
37
+ }else if ($paymentAction == '101'){
38
+ $transaction->setTxnType(Mage_Sales_Model_Order_Payment_Transaction::TYPE_PAYMENT);
39
+ }
40
+ $transaction->save();
41
+ $this->order->sendNewOrderEmail();
42
+ }
43
+ }else{
44
+ $this->order->getPayment()->setLastTransId($transactionId);
45
+ $this->order->sendNewOrderEmail();
46
+ }
47
+ }
48
+
49
+ /**
50
+ *
51
+ * Set the order's status to the provided status (must be part of the cancelled state)
52
+ * Reinit stocks & redirect to checkout
53
+ * @param string $cancelStatus
54
+ */
55
+ private function cancelOrder($cancelStatus, $resCode = '',$message = ''){
56
+ $this->order->setState(Mage_Sales_Model_Order::STATE_CANCELED,$cancelStatus,$message,false);
57
+ $this->updateStock();
58
+ $this->order->save();
59
+
60
+ $this->_redirectUrl($this->_getPaymentRefusedRedirectUrl());
61
+ }
62
+
63
+ /**
64
+ * Check if the customer is logged, and if it has a wallet
65
+ * If not & if there is a walletId in the result from Payline, we save it
66
+ */
67
+ public function saveWallet($walletId){
68
+ if (!Mage::getStoreConfig('payment/payline_common/automate_wallet_subscription')){
69
+ return;
70
+ }
71
+ $customer=Mage::getSingleton('customer/session');
72
+ if ($customer->isLoggedIn()){
73
+ $customer=Mage::getModel('customer/customer')->load($customer->getId());
74
+ if (!$customer->getWalletId()){
75
+ $customer->setWalletId($walletId);
76
+ $customer->save();
77
+ }
78
+ }
79
+ }
80
+
81
+ /**
82
+ *
83
+ * Initialise the requests param array
84
+ * @return array
85
+ */
86
+ private function init(){
87
+ $array = array();
88
+
89
+ $_session = Mage::getSingleton('checkout/session');
90
+
91
+ $this->order = Mage::getModel('sales/order')->loadByIncrementId($_session->getLastRealOrderId());
92
+ $_numericCurrencyCode = Mage::helper('payline')->getNumericCurrencyCode($this->order->getBaseCurrencyCode());
93
+
94
+ // PAYMENT
95
+ $array['payment']['amount'] = round($this->order->getBaseGrandTotal()*100);
96
+ $array['payment']['currency'] = $_numericCurrencyCode;
97
+
98
+ // ORDER
99
+ //
100
+ $array['order']['ref'] = substr($this->order->getRealOrderId(),0,50);
101
+ $array['order']['amount'] = $array['payment']['amount'];
102
+ $array['order']['currency'] = $_numericCurrencyCode;
103
+
104
+ $billingAddress = $this->order->getBillingAddress();
105
+
106
+ // BUYER
107
+ $buyerLastName = substr($this->order->getCustomerLastname(),0,50);
108
+ if($buyerLastName == null || $buyerLastName == ''){
109
+ $buyerLastName = substr($billingAddress->getLastname(),0,50);
110
+ }
111
+ $buyerFirstName = substr($this->order->getCustomerFirstname(),0,50);
112
+ if($buyerFirstName == null || $buyerFirstName == ''){
113
+ $buyerFirstName = substr($billingAddress->getFirstname(),0,50);
114
+ }
115
+ $array['buyer']['lastName'] = Mage::helper('payline')->encodeString($buyerLastName);
116
+ $array['buyer']['firstName'] = Mage::helper('payline')->encodeString($buyerFirstName);
117
+
118
+
119
+ $email=$this->order->getCustomerEmail();
120
+ $pattern = '/\+/i';
121
+ $charPlusExist = preg_match($pattern, $email);
122
+ if (strlen($email)<=50 && Zend_Validate::is($email, 'EmailAddress') && !$charPlusExist) {
123
+ $array['buyer']['email']=Mage::helper('payline')->encodeString($email);
124
+ }else{
125
+ $array['buyer']['email'] = '';
126
+ }
127
+ $array['buyer']['customerId'] = Mage::helper('payline')->encodeString($email);
128
+
129
+ // ADDRESS : !!!WARNING!!! PaylineSDK v4.33 reverse billingAddress & shippingAdress.
130
+ // Take this : https://www.youtube.com/watch?v=MA6kXUgZ7lE&list=PLpyrjJvJ7GJ7bM5GjzwHvZIqe6c5l3iF6
131
+ $array['shippingAddress']['name'] = Mage::helper('payline')->encodeString(substr($billingAddress->getName(),0,100));
132
+ $array['shippingAddress']['street1'] = Mage::helper('payline')->encodeString(substr($billingAddress->getStreet1(),0,100));
133
+ $array['shippingAddress']['street2'] = Mage::helper('payline')->encodeString(substr($billingAddress->getStreet2(),0,100));
134
+ $array['shippingAddress']['cityName'] = Mage::helper('payline')->encodeString(substr($billingAddress->getCity(),0,40));
135
+ $array['shippingAddress']['zipCode'] = substr($billingAddress->getPostcode(),0,12);
136
+ //The $billing->getCountry() returns a 2 letter ISO2, should be fine
137
+ $array['shippingAddress']['country'] = $billingAddress->getCountry();
138
+ $forbidenCars = array(' ','.','(',')','-');
139
+ $phone = str_replace($forbidenCars,'',$billingAddress->getTelephone());
140
+ $regexpTel='/^\+?[0-9]{1,14}$/';
141
+ if (preg_match($regexpTel, $phone)){
142
+ $array['shippingAddress']['phone']=$phone;
143
+ }else{
144
+ $array['shippingAddress']['phone']='';
145
+ }
146
+ $array['billingAddress'] = null;
147
+ return $array;
148
+ }
149
+
150
+ /**
151
+ * Add payment transaction to the order, reinit stocks if needed
152
+ * @param $res array result of a request
153
+ * @param $transactionId
154
+ * @return boolean (true=>valid payment, false => invalid payment)
155
+ */
156
+ private function updateOrder($res,$transactionId, $paymentType='CPT'){
157
+ Mage::helper('payline/logger')->log("[updateOrder] Mise à jour commande ".$this->order->getIncrementId()." (mode $paymentType) avec la transaction $transactionId");
158
+ $orderOk = false;
159
+ if( $res['result']['code'] ) {
160
+ $resultCode = $res['result']['code'];
161
+ $acceptedCodes = array('00000','02500','02501','04003');
162
+ if( in_array( $resultCode, $acceptedCodes ) ) { // transaction OK
163
+ $orderOk = true;
164
+ if($paymentType == 'NX') {
165
+ Mage::helper('payline/logger')->log("[updateOrder] Cas du paiement NX");
166
+ if (isset($res['billingRecordList']['billingRecord'][0])) {
167
+ $code_echeance = $res['billingRecordList']['billingRecord'][0]->result->code;
168
+ if($code_echeance == '00000' || $code_echeance == '02501'){
169
+ Mage::helper('payline/logger')->log("[updateOrder] première échéance paiement NX OK");
170
+ $orderOk = true;
171
+ }else{
172
+ Mage::helper('payline/logger')->log("[updateOrder] première échéance paiement NX refusée, code ".$code_echeance);
173
+ $orderOk = false;
174
+ }
175
+ }else{
176
+ Mage::helper('payline/logger')->log("[updateOrder] La première échéance de paiement est à venir");
177
+ }
178
+ }
179
+
180
+ $this->order->getPayment()->setCcTransId($transactionId);
181
+ if (isset($res['payment']) && isset($res['payment']['action'])){
182
+ $paymentAction=$res['payment']['action'];
183
+ }else{
184
+ $paymentAction= Mage::getStoreConfig('payment/Payline'.$paymentType.'/payline_payment_action');
185
+ }
186
+ $this->addTransaction($transactionId, $paymentAction);
187
+ }else{
188
+ $this->updateStock();
189
+ }
190
+ }
191
+ $this->order->save();
192
+ return $orderOk;
193
+ }
194
+
195
+ /**
196
+ * Reinit stocks
197
+ */
198
+ private function updateStock(){
199
+ if(Mage::getStoreConfig(Mage_CatalogInventory_Model_Stock_Item::XML_PATH_CAN_SUBTRACT) == 1){ // le stock a été décrémenté à la commande
200
+ // ré-incrémentation du stock
201
+ $items = $this->order->getAllItems();
202
+ if ($items) {
203
+ foreach($items as $item) {
204
+ $quantity = $item->getQtyOrdered(); // get Qty ordered
205
+ $product_id = $item->getProductId(); // get its ID
206
+ $stock = Mage::getModel('cataloginventory/stock_item')->loadByProduct($product_id); // Load the stock for this product
207
+ $stock->setQty($stock->getQty()+$quantity); // Set to new Qty
208
+ //if qtty = 0 after order and order fails, set stock status is_in_stock to true
209
+ if ( $stock->getQty() > $stock->getMinQty() && !$stock->getIsInStock() ) {
210
+ $stock->setIsInStock( 1 );
211
+ }
212
+ $stock->save(); // Save
213
+ continue;
214
+ }
215
+ }
216
+ }
217
+ }
218
+
219
+ /**
220
+ * Force this action code of some payment methods to the given action code
221
+ * @param $paymentMethod {string}
222
+ * @param $array {array} conf array. $array is a reference, so no need to return it.
223
+ * @param $actionCode {string} forced action code set in $array
224
+ */
225
+ private function forcePaymentActionTo($paymentMethod, &$array, $actionCode)
226
+ {
227
+ switch( $paymentMethod ) {
228
+ case 'UKASH':
229
+ case 'MONEYCLIC':
230
+ case 'TICKETSURF':
231
+ case 'SKRILL(MONEYBOOKERS)':
232
+ case 'LEETCHI':
233
+ Mage::helper('payline/logger')->log('[cptAction] order '.$array['order']['ref'].' - '.$paymentMethod.' selected => payment action is forced to '.$actionCode);
234
+ $array['payment']['action'] = $actionCode;
235
+ break;
236
+ default: break;
237
+ }
238
+ }
239
+
240
+ /**
241
+ * Initialize the cpt payment request
242
+ */
243
+ public function cptAction(){
244
+ //Check if wallet is sendable
245
+ //Must be done before call to Payline helper initialisation
246
+ $expiredWalletId=false;
247
+ if(Mage::getSingleton('customer/session')->isLoggedIn()){
248
+ $customer=Mage::getSingleton('customer/session')->getCustomer();
249
+ $customer=Mage::getModel('customer/customer')->load($customer->getId());
250
+ if ($customer->getWalletId() && !Mage::getModel('payline/wallet')->checkExpirationDate()){
251
+ $expiredWalletId=true;
252
+ }
253
+ }
254
+
255
+ $array = $this->init();
256
+ /* @var $paylineSDK PaylineSDK */
257
+ $helperPayline = Mage::helper('payline');
258
+ $paylineSDK = $helperPayline->initPayline('CPT',$array['payment']['currency']);
259
+ $paymentMethod = $this->order->getPayment()->getCcType();
260
+ $array['payment']['action'] = Mage::getStoreConfig('payment/PaylineCPT/payline_payment_action');
261
+ $array['version'] = Monext_Payline_Helper_Data::VERSION;
262
+ if($paymentMethod) {
263
+ // debut ajout FSZ 15/11/2012
264
+ Mage::helper('payline/logger')->log('[cptAction] order '.$array['order']['ref'].' - customer selected contract '.$paymentMethod);
265
+
266
+ $contractCPT = Mage::getModel('payline/contract')
267
+ ->getCollection()
268
+ ->addFieldToFilter( 'number', $paymentMethod )
269
+ ->getFirstItem();
270
+
271
+ // $paymentMethod = contract number. Filter must be on contract type
272
+ $this->forcePaymentActionTo( $contractCPT->getContractType(), $array, '101' );
273
+
274
+ // fin ajout FSZ 15/11/2012
275
+ $array['payment']['contractNumber'] = $paymentMethod;
276
+ $array['contracts'] = array($paymentMethod);
277
+ } else {
278
+ $array['payment']['contractNumber'] = $helperPayline->contractNumber;
279
+ }
280
+ $array['payment']['mode'] = 'CPT';
281
+
282
+ //second contracts
283
+ $array['secondContracts'] = explode(';',$helperPayline->secondaryContractNumberList);
284
+
285
+
286
+ //If wallet isn't sendable...
287
+ if ($expiredWalletId){
288
+ $helperPayline->walletId=null;
289
+ }
290
+
291
+ // PRIVATE DATA
292
+ $privateData = array();
293
+ $privateData['key'] = "orderRef";
294
+ $privateData['value'] = substr(str_replace(array("\r","\n","\t"), array('','',''),$array['order']['ref']), 0,255);
295
+ $paylineSDK->setPrivate($privateData);
296
+
297
+ //ORDER DETAILS (optional)
298
+ $items = $this->order->getAllItems();
299
+ if ($items) {
300
+ if(count($items)>100) $items=array_slice($items,0,100);
301
+ foreach($items as $item) {
302
+ $itemPrice = round($item->getPrice()*100);
303
+ if($itemPrice > 0){
304
+ $product = array();
305
+ $product['ref'] = Mage::helper('payline')->encodeString(substr(str_replace(array("\r","\n","\t"), array('','',''),$item->getName()),0,50));
306
+ $product['price'] = round($item->getPrice()*100);
307
+ $product['quantity'] = round($item->getQtyOrdered());
308
+ $product['comment'] = Mage::helper('payline')->encodeString(substr(str_replace(array("\r","\n","\t"), array('','',''),$item->getDescription()), 0,255));
309
+ $paylineSDK->setItem($product);
310
+ }
311
+ continue;
312
+ }
313
+ }
314
+
315
+ //WALLET
316
+ if(Mage::getStoreConfig('payment/PaylineCPT/send_wallet_id')) {
317
+ if (!isset($array['buyer']['walletId'])) {
318
+ if (isset($helperPayline->walletId)) {
319
+ $array['buyer']['walletId'] = $helperPayline->walletId;
320
+ }
321
+ }
322
+ if ($helperPayline->canSubscribeWallet()) {
323
+ //If the wallet is new (registered during payment), we must save it in the private data since it's not sent back by default
324
+ if ($helperPayline->isNewWallet) {
325
+ if ($helperPayline->walletId) {
326
+ $paylineSDK->setPrivate(array('key'=>'newWalletId','value'=>$helperPayline->walletId));
327
+ }
328
+ }
329
+ }
330
+ }
331
+
332
+ // ADD CONTRACT WALLET ARRAY TO $array
333
+ $array['walletContracts'] = Mage::helper('payline')->buildContractNumberWalletList();
334
+
335
+ // EXECUTE
336
+ try{
337
+ $result = $paylineSDK->doWebPayment($array);
338
+ }catch(Exception $e){
339
+ Mage::logException($e);
340
+ $this->updateStock();
341
+ $msg=Mage::helper('payline')->__('Error during payment');
342
+ Mage::getSingleton('core/session')->addError($msg);
343
+ $msgLog='Unknown PAYLINE ERROR (payline unreachable?)';
344
+ Mage::helper('payline/logger')->log('[cptAction] ' .$this->order->getIncrementId().' '. $msgLog);
345
+ $this->_redirect('checkout/onepage');
346
+ return;
347
+ }
348
+ // RESPONSE
349
+ $initStatus = Mage::getStoreConfig('payment/payline_common/init_order_status');
350
+ if(isset($result) && is_array($result) && $result['result']['code'] == '00000'){
351
+ $this->order->setState(Mage_Sales_Model_Order::STATE_NEW,$initStatus,'',false);
352
+ $this->order->save();
353
+ header("location:".$result['redirectURL']);
354
+ exit();
355
+ }else {//Payline error
356
+ $this->updateStock();
357
+ $msg=Mage::helper('payline')->__('Error during payment');
358
+ Mage::getSingleton('core/session')->addError($msg);
359
+ if (isset($result) && is_array($result)){
360
+ $msgLog='PAYLINE ERROR : '.$result['result']['code']. ' ' . $result['result']['shortMessage'] . ' ('.$result['result']['longMessage'] . ')';
361
+ } elseif (isset($result) && is_string($result)){
362
+ $msgLog='PAYLINE ERROR : '.$result;
363
+ } else{
364
+ $msgLog='Unknown PAYLINE ERROR';
365
+ }
366
+ $this->order->setState(Mage_Sales_Model_Order::STATE_NEW,$initStatus,$msgLog,false);
367
+ $this->order->save();
368
+ Mage::helper('payline/logger')->log('[cptAction] ' .$this->order->getIncrementId().' '.$msgLog);
369
+ $this->_redirect('checkout/onepage');
370
+ return;
371
+ }
372
+ }
373
+
374
+ /**
375
+ * Initialize & process the direct payment request
376
+ */
377
+ public function directAction(){
378
+ $array = $this->init();
379
+ $paylineSDK = Mage::helper('payline')->initPayline('DIRECT',$array['payment']['currency']);
380
+
381
+ //PAYMENT
382
+ $array['payment']['action'] = Mage::getStoreConfig('payment/PaylineDIRECT/payline_payment_action');
383
+ $array['payment']['mode'] = 'CPT';
384
+
385
+ $contract = Mage::getModel('payline/contract')->load($_SESSION['payline_ccdata']->cc_type);
386
+ $array['payment']['contractNumber'] = $contract->getNumber();
387
+
388
+ //ORDER
389
+ $array['order']['date'] = date("d/m/Y H:i");
390
+
391
+ //PRIVATE DATA
392
+ $privateData1 = array();
393
+ $privateData1['key'] = 'orderRef';
394
+ $privateData1['value'] = substr(str_replace(array("\r","\n","\t"), array('','',''),$array['order']['ref']), 0,255);
395
+ $paylineSDK->setPrivate($privateData1);
396
+
397
+ //ORDER DETAILS (optional)
398
+ $items = $this->order->getAllItems();
399
+ if ($items) {
400
+ if(count($items)>100) $items=array_slice($items,0,100);
401
+ foreach($items as $item) {
402
+ $itemPrice = round($item->getPrice()*100);
403
+ if($itemPrice > 0){
404
+ $product = array();
405
+ $product['ref'] = Mage::helper('payline')->encodeString(substr(str_replace(array("\r","\n","\t"), array('','',''),$item->getName()),0,50));
406
+ $product['price'] = round($item->getPrice()*100);
407
+ $product['quantity'] = round($item->getQtyOrdered());
408
+ $product['comment'] = Mage::helper('payline')->encodeString(substr(str_replace(array("\r","\n","\t"), array('','',''),$item->getDescription()), 0,255));
409
+ $paylineSDK->setItem($product);
410
+ }
411
+ continue;
412
+ }
413
+ }
414
+ // CARD INFO
415
+ $array['card']['number'] = $_SESSION['payline_ccdata']->cc_number;
416
+ $array['card']['cardholder'] = $_SESSION['payline_ccdata']->cc_owner;
417
+ $array['card']['type'] = $contract->getContractType();
418
+ $array['card']['expirationDate'] = $_SESSION['payline_ccdata']->cc_exp_month.$_SESSION['payline_ccdata']->cc_exp_year;
419
+ $array['card']['cvx'] = $_SESSION['payline_ccdata']->cc_cid;
420
+
421
+ // Customer IP
422
+ $array['buyer']['ip'] = Mage::helper('core/http')->getRemoteAddr();
423
+
424
+ //3D secure
425
+ $array['3DSecure'] = array();
426
+
427
+ //BANK ACCOUNT DATA
428
+ $array['BankAccountData'] = array();
429
+
430
+ //version
431
+ $array['version'] = Monext_Payline_Helper_Data::VERSION;
432
+ // OWNER
433
+ $array['owner']['lastName'] = Mage::helper('payline')->encodeString($_SESSION['payline_ccdata']->cc_owner);
434
+
435
+ try{
436
+ $author_result = $paylineSDK->doAuthorization($array);
437
+ }catch(Exception $e){
438
+ Mage::logException($e);
439
+ $this->updateStock();
440
+ $msg=Mage::helper('payline')->__('Error during payment');
441
+ Mage::getSingleton('core/session')->addError($msg);
442
+ $msgLog='Unknown PAYLINE ERROR (payline unreachable?)';
443
+ Mage::helper('payline/logger')->log('[directAction] ' .$this->order->getIncrementId().$msgLog);
444
+ $this->_redirect('checkout/onepage');
445
+ return;
446
+ }
447
+ // RESPONSE
448
+ $failedOrderStatus = Mage::getStoreConfig('payment/payline_common/failed_order_status');
449
+ if(isset($author_result) && is_array($author_result) && $author_result['result']['code'] == '00000'){
450
+ $array_details = array();
451
+ $array_details['orderRef'] = $this->order->getRealOrderId();
452
+ $array_details['transactionId'] = $author_result['transaction']['id'];
453
+ $array_details['startDate'] = '';
454
+ $array_details['endDate'] = '';
455
+ $array_details['transactionHistory']= '';
456
+ $array_details['version'] = Monext_Payline_Helper_Data::VERSION;
457
+ $array_details['archiveSearch'] = '';
458
+ $detail_result = $paylineSDK->getTransactionDetails($array_details);
459
+
460
+ if($this->updateOrder($detail_result,$detail_result['transaction']['id'], 'DIRECT')){
461
+ $redirectUrl = Mage::getBaseUrl()."checkout/onepage/success/";
462
+ if($detail_result['result']['code'] == '04003') {
463
+ $newOrderStatus = Mage::getStoreConfig('payment/payline_common/fraud_order_status');
464
+ Mage::helper('payline')->setOrderStatus($this->order, $newOrderStatus);
465
+ } else {
466
+ Mage::helper('payline')->setOrderStatusAccordingToPaymentMode(
467
+ $this->order, $array['payment']['action'] );
468
+ }
469
+
470
+ $array['wallet']['lastName'] = $array['buyer']['lastName'];
471
+ $array['wallet']['firstName'] = $array['buyer']['firstName'];
472
+ $array['wallet']['email'] = $array['buyer']['email'];
473
+ // remember, the Beast is not so far
474
+ $array['address'] = $array['shippingAddress'];
475
+ $array['ownerAddress'] = null;
476
+
477
+ Mage::helper('payline')->createWalletForCurrentCustomer($paylineSDK, $array);
478
+ Mage::helper('payline')->automateCreateInvoiceAtShopReturn('DIRECT', $this->order);
479
+ $this->order->save();
480
+ Mage_Core_Controller_Varien_Action::_redirectSuccess($redirectUrl);
481
+ }else{
482
+ $msgLog='Error during order update (#'.$this->order->getIncrementId().')'."\n";
483
+ $this->order->setState(Mage_Sales_Model_Order::STATE_CANCELED,$failedOrderStatus,$msgLog,false);
484
+ $this->order->save();
485
+
486
+ $msg=Mage::helper('payline')->__('Error during payment');
487
+ Mage::getSingleton('core/session')->addError($msg);
488
+ Mage::helper('payline/logger')->log('[directAction] ' .$this->order->getIncrementId().$msgLog);
489
+ $this->_redirectUrl($this->_getPaymentRefusedRedirectUrl());
490
+ return;
491
+ }
492
+ }else {
493
+ if(isset($author_result) && is_array($author_result)){
494
+ $msgLog='PAYLINE ERROR : '.$author_result['result']['code']. ' ' . $author_result['result']['shortMessage'] . ' ('.$author_result['result']['longMessage'].')';
495
+ } elseif(isset($author_result) && is_string($author_result)){
496
+ $msgLog='PAYLINE ERROR : '. $author_result;
497
+ } else{
498
+ $msgLog='Unknown PAYLINE ERROR';
499
+ }
500
+
501
+ $this->updateStock();
502
+ $this->order->setState(Mage_Sales_Model_Order::STATE_CANCELED,$failedOrderStatus,$msgLog,false);
503
+ $this->order->save();
504
+
505
+ $msg=Mage::helper('payline')->__('Error during payment');
506
+ Mage::getSingleton('core/session')->addError($msg);
507
+ Mage::helper('payline/logger')->log('[directAction] ' .$this->order->getIncrementId().$msgLog);
508
+ $this->_redirectUrl($this->_getPaymentRefusedRedirectUrl());
509
+ return;
510
+ }
511
+ }
512
+
513
+ /** Initialisize a WALLET payment request
514
+ *
515
+ */
516
+ /**
517
+ * Initialize & process a wallet direct payment request
518
+ */
519
+ public function walletAction(){
520
+ $array = $this->init();
521
+ $paylineSDK = Mage::helper('payline')->initPayline('WALLET',$array['payment']['currency']);
522
+
523
+ //PAYMENT
524
+ $array['payment']['action'] = Mage::getStoreConfig('payment/PaylineWALLET/payline_payment_action');
525
+ $array['payment']['mode'] = 'CPT';
526
+
527
+ //Get the wallet contract number from card type
528
+ $wallet=Mage::getModel('payline/wallet')->getWalletData();
529
+ $contract = Mage::getModel('payline/contract')
530
+ ->getCollection()
531
+ ->addFilterStatus(true,Mage::app()->getStore()->getId())
532
+ ->addFieldToFilter('contract_type',$wallet['card']['type'])
533
+ ->getFirstItem();
534
+
535
+ $array['payment']['contractNumber']= $contract->getNumber();
536
+
537
+ //ORDER
538
+ $array['order']['date'] = date("d/m/Y H:i");
539
+
540
+ //PRIVATE DATA
541
+ $privateData1 = array();
542
+ $privateData1['key'] = 'orderRef';
543
+ $privateData1['value'] = substr(str_replace(array("\r","\n","\t"), array('','',''),$array['order']['ref']), 0,255);
544
+ $paylineSDK->setPrivate($privateData1);
545
+
546
+ //ORDER DETAILS (optional)
547
+ $items = $this->order->getAllItems();
548
+ if ($items) {
549
+ if(count($items)>100) $items=array_slice($items,0,100);
550
+ foreach($items as $item) {
551
+ $itemPrice = round($item->getPrice()*100);
552
+ if($itemPrice > 0){
553
+ $product = array();
554
+ $product['ref'] = Mage::helper('payline')->encodeString(substr(str_replace(array("\r","\n","\t"), array('','',''),$item->getName()),0,50));
555
+ $product['price'] = round($item->getPrice()*100);
556
+ $product['quantity'] = round($item->getQtyOrdered());
557
+ $product['comment'] = Mage::helper('payline')->encodeString(substr(str_replace(array("\r","\n","\t"), array('','',''),$item->getDescription()), 0,255));
558
+ $paylineSDK->setItem($product);
559
+ }
560
+ continue;
561
+ }
562
+ }
563
+
564
+ $customerId=Mage::getSingleton('customer/session')->getId();
565
+ $customer=Mage::getModel('customer/customer')->load($customerId);
566
+ $walletId=$customer->getWalletId();
567
+ $array['walletId']=$walletId;
568
+ $array['cardInd'] = '';
569
+ $array['version'] = Monext_Payline_Helper_Data::VERSION;
570
+
571
+ try{
572
+ $author_result = $paylineSDK->doImmediateWalletPayment($array);
573
+ }catch(Exception $e){
574
+ Mage::logException($e);
575
+ $this->updateStock();
576
+ $msg=Mage::helper('payline')->__('Error during payment');
577
+ Mage::getSingleton('core/session')->addError($msg);
578
+ $msgLog='Unknown PAYLINE ERROR (payline unreachable?) during wallet payment';
579
+ Mage::helper('payline/logger')->log('[walletAction] ' .$this->order->getIncrementId().$msgLog);
580
+ $this->_redirect('checkout/onepage');
581
+ return;
582
+ }
583
+ // RESPONSE
584
+ $failedOrderStatus = Mage::getStoreConfig('payment/payline_common/failed_order_status');
585
+ if(isset($author_result) && is_array($author_result) && $author_result['result']['code'] == '00000'){
586
+ $array_details = array();
587
+ $array_details['orderRef'] = $this->order->getRealOrderId();
588
+ $array_details['transactionId'] = $author_result['transaction']['id'];
589
+ $array_details['startDate'] = '';
590
+ $array_details['endDate'] = '';
591
+ $array_details['transactionHistory']= '';
592
+ $array_details['version'] = Monext_Payline_Helper_Data::VERSION;
593
+ $array_details['archiveSearch'] = '';
594
+ $detail_result = $paylineSDK->getTransactionDetails($array_details);
595
+
596
+ if(is_array($detail_result) && $this->updateOrder($detail_result,$detail_result['transaction']['id'], 'WALLET')){
597
+ $redirectUrl = Mage::getBaseUrl()."checkout/onepage/success/";
598
+ if($detail_result['result']['code'] == '04003') {
599
+ $newOrderStatus = Mage::getStoreConfig('payment/payline_common/fraud_order_status');
600
+ Mage::helper('payline')->setOrderStatus($this->order, $newOrderStatus);
601
+ } else {
602
+ Mage::helper('payline')->setOrderStatusAccordingToPaymentMode(
603
+ $this->order, $array['payment']['action'] );
604
+ }
605
+ Mage::helper('payline')->automateCreateInvoiceAtShopReturn('WALLET', $this->order);
606
+ $this->order->save();
607
+ Mage_Core_Controller_Varien_Action::_redirectSuccess($redirectUrl);
608
+ }else{
609
+ $msgLog='Error during order update (#'.$this->order->getIncrementId().')';
610
+ $this->order->setState(Mage_Sales_Model_Order::STATE_CANCELED,$failedOrderStatus,$msgLog,false);
611
+ $this->order->save();
612
+ $msg=Mage::helper('payline')->__('Error during payment');
613
+ Mage::getSingleton('core/session')->addError($msg);
614
+ Mage::helper('payline/logger')->log('[walletAction] ' .$this->order->getIncrementId().$msgLog);
615
+ $this->_redirectUrl($this->_getPaymentRefusedRedirectUrl());
616
+ return;
617
+ }
618
+
619
+ }else {
620
+ $this->updateStock();
621
+ if(isset($author_result) && is_array($author_result)){
622
+ $msgLog='PAYLINE ERROR during doImmediateWalletPayment: '.$author_result['result']['code']. ' ' . $author_result['result']['shortMessage'] . ' ('.$author_result['result']['longMessage'].')';
623
+ }elseif(isset($author_result) && is_string($author_result)){
624
+ $msgLog='PAYLINE ERROR during doImmediateWalletPayment: '.$author_result;
625
+ } else {
626
+ $msgLog='Unknown PAYLINE ERROR during doImmediateWalletPayment';
627
+ }
628
+
629
+ $this->order->setState(Mage_Sales_Model_Order::STATE_CANCELED,$failedOrderStatus,$msgLog,false);
630
+ $this->order->save();
631
+
632
+ $msg=Mage::helper('payline')->__('Error during payment');
633
+ Mage::getSingleton('core/session')->addError($msg);
634
+ Mage::helper('payline/logger')->log('[walletAction] ' .$this->order->getIncrementId().$msgLog);
635
+ $this->_redirectUrl($this->_getPaymentRefusedRedirectUrl());
636
+ return;
637
+ }
638
+ }
639
+ /**
640
+ * Initialize the NX payment request
641
+ */
642
+ public function nxAction(){
643
+ //Check if wallet is sendable
644
+ //Must be done before call to Payline helper initialisation
645
+ $expiredWalletId=false;
646
+ if(Mage::getSingleton('customer/session')->isLoggedIn()){
647
+ $customer=Mage::getSingleton('customer/session')->getCustomer();
648
+ $customer=Mage::getModel('customer/customer')->load($customer->getId());
649
+ if ($customer->getWalletId() && !Mage::getModel('payline/wallet')->checkExpirationDate()){
650
+ $expiredWalletId=true;
651
+ }
652
+ }
653
+
654
+ $array = $this->init();
655
+ $helperPayline = Mage::helper('payline');
656
+ $paylineSDK = $helperPayline->initPayline('NX',$array['payment']['currency']);
657
+ $array['version'] = Monext_Payline_Helper_Data::VERSION;
658
+
659
+ //If wallet isn't sendable...
660
+ if ($expiredWalletId){
661
+ Mage::helper('payline')->walletId=null;
662
+ }
663
+
664
+ $nx = Mage::getStoreConfig('payment/PaylineNX/billing_occurrences');
665
+ $array['payment']['mode'] = 'NX';
666
+ $array['payment']['action'] = 101;
667
+ $array['payment']['contractNumber'] = $helperPayline->contractNumber;
668
+ $array['recurring']['amount'] = round($array['payment']['amount']/$nx);
669
+ $array['recurring']['firstAmount'] = $array['payment']['amount']-($array['recurring']['amount']*($nx-1));
670
+ $array['recurring']['billingCycle'] = Mage::getStoreConfig('payment/PaylineNX/billing_cycle');
671
+ $array['recurring']['billingLeft'] = $nx;
672
+ $array['recurring']['billingDay'] = '';
673
+ $array['recurring']['startDate'] = '';
674
+
675
+ //second contracts
676
+ $array['secondContracts'] = explode(';',$helperPayline->secondaryContractNumberList);
677
+
678
+ // PRIVATE DATA
679
+ $privateData = array();
680
+ $privateData['key'] = "orderRef";
681
+ $privateData['value'] = substr(str_replace(array("\r","\n","\t"), array('','',''),$array['order']['ref']), 0,255);
682
+ $paylineSDK->setPrivate($privateData);
683
+
684
+ //ORDER DETAILS (optional)
685
+ $items = $this->order->getAllItems();
686
+ if ($items) {
687
+ if(count($items)>100) $items=array_slice($items,0,100);
688
+ foreach($items as $item) {
689
+ $itemPrice = round($item->getPrice()*100);
690
+ if($itemPrice > 0){
691
+ $product = array();
692
+ $product['ref'] = Mage::helper('payline')->encodeString(substr(str_replace(array("\r","\n","\t"), array('','',''),$item->getName()),0,50));
693
+ $product['price'] = round($item->getPrice()*100);
694
+ $product['quantity'] = round($item->getQtyOrdered());
695
+ $product['comment'] = Mage::helper('payline')->encodeString(substr(str_replace(array("\r","\n","\t"), array('','',''),$item->getDescription()), 0,255));
696
+ $paylineSDK->setItem($product);
697
+ }
698
+ continue;
699
+ }
700
+ }
701
+
702
+ //WALLET
703
+ if(Mage::getStoreConfig('payment/PaylineCPT/send_wallet_id')) {
704
+ if (!isset($array['buyer']['walletId'])) {
705
+ if (isset($helperPayline->walletId)) {
706
+ $array['buyer']['walletId'] = $helperPayline->walletId;
707
+ }
708
+ }
709
+ if ($helperPayline->canSubscribeWallet()) {
710
+ //If the wallet is new (registered during payment), we must save it in the private data since it's not sent back by default
711
+ if ($helperPayline->isNewWallet) {
712
+ if ($helperPayline->walletId) {
713
+ $paylineSDK->setPrivate(array('key'=>'newWalletId','value'=>$helperPayline->walletId));
714
+ }
715
+ }
716
+ }
717
+ }
718
+
719
+ // ADD CONTRACT WALLET ARRAY TO $array
720
+ $array['walletContracts'] = Mage::helper('payline')->buildContractNumberWalletList();
721
+
722
+ // EXECUTE
723
+ try{
724
+ $result = $paylineSDK->doWebPayment($array);
725
+ }catch(Exception $e){
726
+ Mage::logException($e);
727
+ $this->updateStock();
728
+ $msg=Mage::helper('payline')->__('Error during payment');
729
+ Mage::getSingleton('core/session')->addError($msg);
730
+ $msgLog='Unknown PAYLINE ERROR (payline unreachable?)';
731
+ Mage::helper('payline/logger')->log('[nxAction] ' .$this->order->getIncrementId().$msgLog);
732
+ $this->_redirect('checkout/onepage');
733
+ return;
734
+ }
735
+ // RESPONSE
736
+ $initStatus = Mage::getStoreConfig('payment/payline_common/init_order_status');
737
+ if(isset($result) && is_array($result) && $result['result']['code'] == '00000'){
738
+ $this->order->setState(Mage_Sales_Model_Order::STATE_NEW,$initStatus,'',false);
739
+ $this->order->save();
740
+ header("location:".$result['redirectURL']);
741
+ exit();
742
+ }else {
743
+ $this->updateStock();
744
+ if(isset($result) && is_array($result)){
745
+ $msgLog='PAYLINE ERROR : '.$result['result']['code']. ' ' . $result['result']['shortMessage'] . ' ('.$result['result']['longMessage'].')';
746
+ } elseif(isset($result) && is_string($result)){
747
+ $msgLog='PAYLINE ERROR : '.$result;
748
+ } else{
749
+ $msgLog='Unknown PAYLINE ERROR';
750
+ }
751
+ $this->order->setState(Mage_Sales_Model_Order::STATE_NEW,$initStatus,$msgLog,false);
752
+ $this->order->save();
753
+ $msg=Mage::helper('payline')->__('Error during payment');
754
+ Mage::helper('payline/logger')->log('[nxAction] ' .$this->order->getIncrementId().$msgLog);
755
+ Mage::getSingleton('core/session')->addError($msg);
756
+ $this->_redirect('checkout/onepage');
757
+ return;
758
+
759
+ }
760
+ }
761
+
762
+ /**
763
+ * Action called on the customer's return form the Payline website.
764
+ */
765
+ public function cptReturnAction(){
766
+ $res = Mage::helper('payline')->initPayline('CPT')->getWebPaymentDetails(array('token' => $_GET['token'], 'version' => Monext_Payline_Helper_Data::VERSION));
767
+
768
+ $this->_getCustomerSession()->setWebPaymentDetails($res);
769
+
770
+ if (isset($res['privateDataList']['privateData']['value'])){
771
+ $orderRef=$res['privateDataList']['privateData']['value'];
772
+ }else{
773
+ foreach ($res['privateDataList']['privateData'] as $privateDataList){
774
+ if($privateDataList->key == 'orderRef'){
775
+ $orderRef = $privateDataList->value;
776
+ }
777
+ }
778
+ }
779
+
780
+ if (!isset($orderRef)){
781
+ $msgLog='Couldn\'t find order increment id in cpt payment result';
782
+ Mage::helper('payline/logger')->log('[cptNotifAction] ' .$this->order->getIncrementId().$msgLog);
783
+ $this->_redirectUrl($this->_getPaymentRefusedRedirectUrl());
784
+ return;
785
+ }
786
+ $this->order = Mage::getModel('sales/order')->loadByIncrementId($orderRef);
787
+
788
+ //If order is still new, notifAction haven't been called yet
789
+ if ($this->order->getState()==Mage_Sales_Model_Order::STATE_NEW){
790
+ Mage_Core_Controller_Varien_Action::_redirectSuccess($this->cptNotifAction());
791
+ }
792
+
793
+ if($res['result']['code'] == '00000' || $res['result']['code'] == '04003'){
794
+ $this->_redirect('checkout/onepage/success');
795
+ }else{
796
+ Mage::getSingleton('core/session')->addError(Mage::helper('payline')->__('Your payment is refused'));
797
+ $this->_redirectUrl($this->_getPaymentRefusedRedirectUrl());
798
+ }
799
+ }
800
+
801
+ /**
802
+ * Action called on the customer's return form the Payline website.
803
+ */
804
+ public function nxReturnAction(){
805
+ Mage_Core_Controller_Varien_Action::_redirectSuccess($this->nxNotifAction());
806
+ }
807
+
808
+ /**
809
+ * Save CPT payment result, called by the bank when the transaction is done
810
+ */
811
+ public function cptNotifAction(){
812
+ $res = $this->_getCustomerSession()->getWebPaymentDetails(true);
813
+ if (empty($res)) {
814
+ $res = Mage::helper('payline')->initPayline('CPT')->getWebPaymentDetails(array('token' => $_GET['token'], 'version' => Monext_Payline_Helper_Data::VERSION));
815
+ }
816
+
817
+ if (isset($res['privateDataList']['privateData']['value'])){
818
+ $orderRef=$res['privateDataList']['privateData']['value'];
819
+ }else{
820
+ foreach ($res['privateDataList']['privateData'] as $privateDataList){
821
+ if($privateDataList->key == 'orderRef'){
822
+ $orderRef = $privateDataList->value;
823
+ }
824
+ if($privateDataList->key == 'newWalletId'){
825
+ $newWalletId = $privateDataList->value;
826
+ }
827
+ }
828
+ }
829
+ if (!isset($orderRef)){
830
+ $msgLog='Couldn\'t find order increment id in cpt payment result';
831
+ Mage::helper('payline/logger')->log('[cptNotifAction] ' .$this->order->getIncrementId().$msgLog);
832
+ $redirectUrl = Mage::getBaseUrl()."checkout/onepage/";
833
+ }
834
+ $this->order = Mage::getModel('sales/order')->loadByIncrementId($orderRef);
835
+ $payment = $this->order->getPayment();
836
+ if ($payment->getBaseAmountPaid() != $payment->getBaseAmountOrdered()) {
837
+
838
+ $failedOrderStatus = Mage::getStoreConfig('payment/payline_common/failed_order_status');
839
+
840
+ if(is_array($res) && $this->updateOrder($res,$res['transaction']['id'], 'CPT')){
841
+ $redirectUrl = Mage::getBaseUrl()."checkout/onepage/success/";
842
+
843
+ if($res['result']['code'] == '04003') {
844
+ $newOrderStatus = Mage::getStoreConfig('payment/payline_common/fraud_order_status');
845
+ Mage::helper('payline')->setOrderStatus($this->order, $newOrderStatus);
846
+ } else {
847
+ Mage::helper('payline')->setOrderStatusAccordingToPaymentMode(
848
+ $this->order, $res['payment']['action'] );
849
+ }
850
+
851
+ if(isset($newWalletId)){
852
+ $this->saveWallet($newWalletId);
853
+ }
854
+ Mage::helper('payline')->automateCreateInvoiceAtShopReturn('CPT', $this->order);
855
+ }else{
856
+ if(isset($res) && is_array($res)){
857
+ $msgLog='PAYLINE ERROR : '.$res['result']['code']. ' ' . $res['result']['shortMessage'] . ' ('.$res['result']['longMessage'].')';
858
+ } elseif(isset($res) && is_string($res)){
859
+ $msgLog='PAYLINE ERROR : '.$res;
860
+ } else{
861
+ $msgLog='Error during order update (#'.$this->order->getIncrementId().')';
862
+ }
863
+
864
+ if (is_array($res) && !($res['result']['code'] == '02306' || $res['result']['code'] == '02533')) {
865
+ if ($res['result']['code'] == '02304' || $res['result']['code'] == '02324' || $res['result']['code'] == '02534') {
866
+ $abandonedStatus = Mage::getStoreConfig('payment/payline_common/resignation_order_status');
867
+ $this->order->setState(Mage_Sales_Model_Order::STATE_CANCELED,$abandonedStatus,$msgLog,false);
868
+ } else {
869
+ $this->order->setState(Mage_Sales_Model_Order::STATE_CANCELED,$failedOrderStatus,$msgLog,false);
870
+ }
871
+ }
872
+
873
+ Mage::helper('payline/logger')->log('[cptNotifAction] ' .$this->order->getIncrementId().$msgLog);
874
+ $redirectUrl = $this->_getPaymentRefusedRedirectUrl();
875
+ }
876
+ $this->order->save();
877
+ } else {
878
+ $redirectUrl = Mage::getBaseUrl()."checkout/onepage/success/";
879
+ }
880
+ return $redirectUrl;
881
+ }
882
+
883
+ /**
884
+ * Save NX payment result, called by the bank when the transaction is done
885
+ */
886
+ public function nxNotifAction(){
887
+ $res = Mage::helper('payline')->initPayline('NX')->getWebPaymentDetails(array('token' => $_GET['token'], 'version' => Monext_Payline_Helper_Data::VERSION));
888
+ if (isset($res['privateDataList']['privateData']['value'])){
889
+ $orderRef=$res['privateDataList']['privateData']['value'];
890
+ }else{
891
+ foreach ($res['privateDataList']['privateData'] as $privateDataList){
892
+ if($privateDataList->key == 'orderRef'){
893
+ $orderRef = $privateDataList->value;
894
+ }
895
+ }
896
+ }
897
+ if (!isset($orderRef)){
898
+ $msgLog='Référence commande introuvable dans le résultat du paiement Nx';
899
+ Mage::helper('payline/logger')->log('[nxNotifAction] ' .$this->order->getIncrementId().' '.$msgLog);
900
+ $redirectUrl = Mage::getBaseUrl()."checkout/onepage/";
901
+ }
902
+ $this->order = Mage::getModel('sales/order')->loadByIncrementId($orderRef);
903
+
904
+ $failedOrderStatus = Mage::getStoreConfig('payment/payline_common/failed_order_status');
905
+
906
+ if(isset($res['billingRecordList']['billingRecord'])){
907
+ $size = sizeof($res['billingRecordList']['billingRecord']);
908
+ }else{
909
+ $size = 0;
910
+ }
911
+ $billingRecord = false;
912
+ for($i=0;$i<$size;$i++){
913
+ if($res['billingRecordList']['billingRecord'][$i]->status == 1){
914
+ $txnId = $res['billingRecordList']['billingRecord'][$i]->transaction->id;
915
+ if(!$this->order->getTransaction($txnId)){
916
+ $billingRecord = $res['billingRecordList']['billingRecord'][$i];
917
+ }
918
+ }
919
+ }
920
+ if($billingRecord && $this->updateOrder($res,$billingRecord->transaction->id,'NX')) {
921
+ $redirectUrl = Mage::getBaseUrl()."checkout/onepage/success/";
922
+
923
+ if($res['result']['code'] == '04003') {
924
+ $newOrderStatus = Mage::getStoreConfig('payment/payline_common/fraud_order_status');
925
+ Mage::helper('payline')->setOrderStatus($this->order, $newOrderStatus);
926
+ } else if( $res['result']['code'] == '02501' ) { // credit card (CC) will expire
927
+ $statusScheduleAlert = Mage::getStoreConfig('payment/PaylineNX/status_when_payline_schedule_alert');
928
+ Mage::helper('payline')->setOrderStatus( $this->order, $statusScheduleAlert );
929
+ } else {
930
+ Mage::helper('payline')->setOrderStatusAccordingToPaymentMode(
931
+ $this->order, $res['payment']['action'] );
932
+ }
933
+
934
+ if (isset($res['privateDataList']['privateData'][1]) && $res['privateDataList']['privateData'][1]->key=="newWalletId" && $res['privateDataList']['privateData'][1]->value!=''){
935
+ $this->saveWallet($res['privateDataList']['privateData'][1]->value);
936
+ }
937
+ $payment = $this->order->getPayment();
938
+ if ($payment->getBaseAmountPaid() != $payment->getBaseAmountOrdered()) {
939
+ Mage::helper('payline')->automateCreateInvoiceAtShopReturn('NX', $this->order);
940
+ }
941
+ }else{
942
+ if(isset($res) && is_array($res)){
943
+ $msgLog='PAYLINE ERROR : '.$res['result']['code']. ' ' . $res['result']['shortMessage'] . ' ('.$res['result']['longMessage'].')';
944
+ } elseif(isset($res) && is_string($res)){
945
+ $msgLog='PAYLINE ERROR : '.$res;
946
+ } else{
947
+ $msgLog='Error during order update (#'.$this->order->getIncrementId().')';
948
+ }
949
+
950
+ if (is_array($res) && !($res['result']['code'] == '02306' || $res['result']['code'] == '02533')) {
951
+ if (is_array($res) && ($res['result']['code'] == '02304' || $res['result']['code'] == '02324' || $res['result']['code'] == '02534')) {
952
+ $abandonedStatus = Mage::getStoreConfig('payment/payline_common/resignation_order_status');
953
+ $this->order->setState(Mage_Sales_Model_Order::STATE_CANCELED,$abandonedStatus,$msgLog,false);
954
+ } else {
955
+ $statusScheduleAlert = Mage::getStoreConfig('payment/PaylineNX/status_when_payline_schedule_alert');
956
+ if( !empty( $statusScheduleAlert ) ) { // if user conf is set
957
+ $failedOrderStatus = $statusScheduleAlert;
958
+ }
959
+ $this->order->setState(Mage_Sales_Model_Order::STATE_CANCELED,$failedOrderStatus,$msgLog,false);
960
+ }
961
+ }
962
+
963
+ Mage::helper('payline/logger')->log('[nxNotifAction] ' .$this->order->getIncrementId().$msgLog);
964
+ Mage::getSingleton('core/session')->addError(Mage::helper('payline')->__('Your payment is refused'));
965
+ $redirectUrl = $this->_getPaymentRefusedRedirectUrl();
966
+ }
967
+ $this->order->save();
968
+ return $redirectUrl;
969
+ }
970
+
971
+ /**
972
+ * Method called by Payline to notify (except first) each term payment.
973
+ * Url to this action must be set in Payline personnal account.
974
+ */
975
+ public function nxTermNotifAction()
976
+ {
977
+ $statusScheduleAlert = Mage::getStoreConfig('payment/PaylineNX/status_when_payline_schedule_alert');
978
+ $statusCCExpired = Mage::getStoreConfig('payment/PaylineNX/status_when_credit_card_schedule_is_expired');
979
+ if( !empty( $statusScheduleAlert ) || !empty( $statusCCExpired ) ) {
980
+ if( $this->isNxTermParamsOk( $_GET ) ) {
981
+ /* BILL = value required for terms notifications
982
+ WEBTRS = value for cash web payment */
983
+ if( $_GET['notificationType'] == 'BILL' ) { //
984
+ $transactionParams = array();
985
+ $transactionParams['transactionId'] = $_GET['transactionId'];
986
+ $transactionParams['orderRef'] = $_GET['orderRef'];
987
+ $transactionParams['version'] = Monext_Payline_Helper_Data::VERSION;
988
+ $transactionParams['startDate'] = '';
989
+ $transactionParams['endDate'] = '';
990
+ $transactionParams['transactionHistory']= '';
991
+ $transactionParams['archiveSearch'] = '';
992
+
993
+ $res = Mage::helper('payline')->initPayline('NX')->getTransactionDetails( $transactionParams );
994
+
995
+ if( isset( $res )
996
+ && is_array( $res )
997
+ && isset( $res['result'] )
998
+ && isset( $res['result']['code'] ) )
999
+ {
1000
+ $mustSave = true;
1001
+ switch( $res['result']['code'] ) {
1002
+ case '00000':
1003
+ case '02500':
1004
+ case '04003':
1005
+ $mustSave = false;
1006
+ break;
1007
+ case '02501': // payment card will expire
1008
+ if( !empty( $statusScheduleAlert ) ) {
1009
+ $this->order = $this->setOrderStatus( $statusScheduleAlert, $_GET['orderRef'] );
1010
+ break;
1011
+ }
1012
+ default: // if default => error (cc expired or other errors)
1013
+ if( !empty( $statusCCExpired ) ) {
1014
+ $this->order = $this->setOrderStatus( $statusCCExpired, $_GET['orderRef'] );
1015
+ } else {
1016
+ $mustSave = false;
1017
+ }
1018
+ break;
1019
+ }
1020
+ if( $mustSave ) { $this->order->save(); }
1021
+ } // end if ( isset($res) ...
1022
+ } // end if BILL
1023
+ } // end if $this->isNxTermParamsOk
1024
+ } // end if !empty( $statusScheduleAlert ) || !empty( $statusCCExpired )
1025
+ } // end func
1026
+
1027
+ /**
1028
+ * Check if $params contains all the required keys for PaylineSDK#getTransactionDetails()
1029
+ * @param $params {array} array params for PaylineSDK#getTransactionDetails(), should contain all keys required.
1030
+ * @return bool true if $params ok, otherwise false
1031
+ */
1032
+ private function isNxTermParamsOk($params)
1033
+ {
1034
+ if( !isset( $params['notificationType'] ) ) return false;
1035
+ if( !isset( $params['paymentRecordId'] ) ) return false;
1036
+ if( !isset( $params['walletId'] ) ) return false;
1037
+ if( !isset( $params['transactionId'] ) ) return false;
1038
+ if( !isset( $params['billingRecordDate'] ) ) return false;
1039
+ if( !isset( $params['orderRef'] ) ) return false;
1040
+ return true;
1041
+ }
1042
+
1043
+ /**
1044
+ * Set an order status. If !isset($this->order) process order model from $orderRef
1045
+ * @param $status {string} status order to assign
1046
+ * @param $orderRef {string} entity_id order
1047
+ * @return Mage_Sales_Model_Order Return the order object with new status set
1048
+ */
1049
+ private function setOrderStatus($status, $orderRef)
1050
+ {
1051
+ if( isset( $this->order ) ) {
1052
+ $order = $this->order;
1053
+ } else {
1054
+ $order = Mage::getModel('sales/order')
1055
+ ->getCollection()
1056
+ ->addFieldToFilter('increment_id', $orderRef)
1057
+ ->getFirstItem();
1058
+ }
1059
+ Mage::helper('payline')->setOrderStatus( $order, $status );
1060
+ return $order;
1061
+ }
1062
+
1063
+ /**
1064
+ * Cancel a CPT payment request /order
1065
+ */
1066
+ public function cptCancelAction(){
1067
+ $res = Mage::helper('payline')->initPayline('CPT')->getWebPaymentDetails(array('token' => $_GET['token'], 'version' => Monext_Payline_Helper_Data::VERSION));
1068
+
1069
+ if (isset($res['privateDataList']['privateData']['value'])){
1070
+ $orderRef=$res['privateDataList']['privateData']['value'];
1071
+ }else{
1072
+ foreach ($res['privateDataList']['privateData'] as $privateDataList){
1073
+ if($privateDataList->key == 'orderRef'){
1074
+ $orderRef = $privateDataList->value;
1075
+ }
1076
+ }
1077
+ }
1078
+ if (!isset($orderRef)){
1079
+ $msgLog='Couldn\'t find order increment id in cpt payment cancel result';
1080
+ Mage::helper('payline/logger')->log('[cptCancelAction] ' .$this->order->getIncrementId().$msgLog);
1081
+ $redirectUrl = Mage::getBaseUrl()."checkout/onepage/";
1082
+ $this->_redirect($redirectUrl);
1083
+ return;
1084
+ }
1085
+ $this->order = Mage::getModel('sales/order')->loadByIncrementId($orderRef);
1086
+ $msg = '';
1087
+ if(is_string($res)) {
1088
+ $msg='PAYLINE ERROR : '.$res;
1089
+ Mage::helper('payline/logger')->log('[cptCancelAction] ' .$this->order->getIncrementId(). ' ' . $msg);
1090
+ $cancelStatus=Mage::getStoreConfig('payment/payline_common/failed_order_status');
1091
+ } elseif (substr($res['result']['code'], 0, 2)=='01' || substr($res['result']['code'],0,3)=='021'){
1092
+ //Invalid transaction or error during the process on Payline side
1093
+ //No error display, the customer is already told on the Payline side
1094
+ Mage::getSingleton('core/session')->addError(Mage::helper('payline')->__('Your payment is refused'));
1095
+ $msg='PAYLINE ERROR : '.$res['result']['code']. ' '.$res['result']['shortMessage'] . ' (' . $res['result']['longMessage'].')';
1096
+ Mage::helper('payline/logger')->log('[cptCancelAction] ' .$this->order->getIncrementId().$msg);
1097
+ $cancelStatus=Mage::getStoreConfig('payment/payline_common/failed_order_status');
1098
+ }else{
1099
+ Mage::getSingleton('core/session')->addError(Mage::helper('payline')->__('Your payment is canceled'));
1100
+ $msg='PAYLINE INFO : '.$res['result']['code']. ' '.$res['result']['shortMessage'] . ' (' . $res['result']['longMessage'].')';
1101
+ //Transaction cancelled by customer
1102
+ $cancelStatus = Mage::getStoreConfig('payment/payline_common/canceled_order_status');
1103
+ }
1104
+ $this->cancelOrder($cancelStatus, $res['result']['code'], $msg);
1105
+ }
1106
+
1107
+ /**
1108
+ * Cancel a NX payment request /order
1109
+ */
1110
+ public function nxCancelAction(){
1111
+ $res = Mage::helper('payline')->initPayline('NX')->getWebPaymentDetails(array('token' => $_GET['token'], 'version' => Monext_Payline_Helper_Data::VERSION));
1112
+ if (isset($res['privateDataList']['privateData']['value'])){
1113
+ $orderRef=$res['privateDataList']['privateData']['value'];
1114
+ }else{
1115
+ foreach ($res['privateDataList']['privateData'] as $privateDataList){
1116
+ if($privateDataList->key == 'orderRef'){
1117
+ $orderRef = $privateDataList->value;
1118
+ }
1119
+ }
1120
+ }
1121
+ if (!isset($orderRef)){
1122
+ $msgLog='Couldn\'t find order increment id in nx payment cancel result';
1123
+ Mage::helper('payline/logger')->log('[nxCancelAction] ' .$this->order->getIncrementId().$msgLog);
1124
+ $redirectUrl = Mage::getBaseUrl()."checkout/onepage/";
1125
+ }
1126
+ $this->order = Mage::getModel('sales/order')->loadByIncrementId($orderRef);
1127
+
1128
+ if (is_string($res)) {
1129
+ $msg='PAYLINE ERROR : '.$res;
1130
+ Mage::helper('payline/logger')->log('[nxCancelAction] ' .$this->order->getIncrementId(). ' ' . $msg);
1131
+ $cancelStatus=Mage::getStoreConfig('payment/payline_common/failed_order_status');
1132
+ } elseif (substr($res['result']['code'], 0, 2)=='01' || substr($res['result']['code'],0,3)=='021'){
1133
+ //Invalid transaction or error during the process on Payline side
1134
+ //No error display, the customer is already told on the Payline side
1135
+ Mage::getSingleton('core/session')->addError(Mage::helper('payline')->__('Your payment is refused'));
1136
+ $msg='PAYLINE ERROR : '.$res['result']['code']. ' '.$res['result']['shortMessage'] . ' (' . $res['result']['longMessage'].')';
1137
+ Mage::helper('payline/logger')->log('[nxCancelAction] ' .$this->order->getIncrementId().$msg);
1138
+ $cancelStatus=Mage::getStoreConfig('payment/payline_common/failed_order_status');
1139
+ }else{
1140
+ Mage::getSingleton('core/session')->addError(Mage::helper('payline')->__('Your payment is canceled'));
1141
+ $msg='PAYLINE INFO : '.$res['result']['code']. ' '.$res['result']['shortMessage'] . ' (' . $res['result']['longMessage'].')';
1142
+ //Transaction cancelled by customer
1143
+ $cancelStatus = Mage::getStoreConfig('payment/payline_common/canceled_order_status');
1144
+ }
1145
+ $this->cancelOrder($cancelStatus, $res['result']['code'],$msg);
1146
+ }
1147
+
1148
+ protected function _getPaymentRefusedRedirectUrl()
1149
+ {
1150
+ $option = Mage::getStoreConfig('payment/payline_common/return_payment_refused');
1151
+ switch($option) {
1152
+ case Monext_Payline_Model_Datasource_Return::CART_EMPTY :
1153
+ $url = Mage::getUrl('checkout/onepage');
1154
+ break;
1155
+ case Monext_Payline_Model_Datasource_Return::HISTORY_ORDERS :
1156
+ $url = Mage::getUrl('sales/order/history');
1157
+ break;
1158
+ case Monext_Payline_Model_Datasource_Return::CART_FULL :
1159
+ $url = Mage::getUrl('sales/order/reorder', array('order_id' => $this->order->getId()));
1160
+ break;
1161
+ default :
1162
+ $url = Mage::getUrl('checkout/onepage');
1163
+
1164
+ }
1165
+
1166
+ return $url;
1167
+ }
1168
+ }
app/code/community/Monext/Payline/etc/config.xml CHANGED
@@ -1,272 +1,272 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <modules>
4
- <Monext_Payline>
5
- <version>1.7.7</version>
6
- </Monext_Payline>
7
- </modules>
8
- <global>
9
- <blocks>
10
- <payline>
11
- <class>Monext_Payline_Block</class>
12
- </payline>
13
- <adminhtml>
14
- <!-- Needed for Magento Enterprise 1.9 -->
15
- <rewrite>
16
- <sales_order_creditmemo_create_items>Monext_Payline_Block_Adminhtml_Sales_Order_Creditmemo_Create_Items</sales_order_creditmemo_create_items>
17
- <customer_grid>Monext_Payline_Block_Adminhtml_Customer_Grid</customer_grid>
18
- </rewrite>
19
- </adminhtml>
20
- </blocks>
21
- <models>
22
- <payline>
23
- <class>Monext_Payline_Model</class>
24
- <resourceModel>payline_mysql4</resourceModel>
25
- </payline>
26
-
27
- <payline_mysql4>
28
- <class>Monext_Payline_Model_Mysql4</class>
29
- <entities>
30
- <contract>
31
- <table>payline_contract</table>
32
- </contract>
33
- <contract_status>
34
- <table>payline_contract_status</table>
35
- </contract_status>
36
- <fees>
37
- <table>payline_nx_fees</table>
38
- </fees>
39
- </entities>
40
- </payline_mysql4>
41
-
42
- <sales>
43
- <rewrite>
44
- <order_invoice>Monext_Payline_Model_Order_Invoice</order_invoice>
45
- <order_payment>Monext_Payline_Model_Order_Payment</order_payment>
46
- </rewrite>
47
- </sales>
48
- </models>
49
- <helpers>
50
- <payline>
51
- <class>Monext_Payline_Helper</class>
52
- </payline>
53
- </helpers>
54
-
55
- <resources>
56
- <payline_setup>
57
- <setup>
58
- <module>Monext_Payline</module>
59
- <class>Monext_Payline_Model_Resource_Eav_Mysql4_Setup</class>
60
- </setup>
61
- <connection>
62
- <use>core_setup</use>
63
- </connection>
64
- </payline_setup>
65
- <payline_write>
66
- <connection>
67
- <use>core_write</use>
68
- </connection>
69
- </payline_write>
70
- <payline_read>
71
- <connection>
72
- <use>core_read</use>
73
- </connection>
74
- </payline_read>
75
- </resources>
76
- <events>
77
- <sales_order_save_after>
78
- <observers>
79
- <payline>
80
- <class>payline/observer</class>
81
- <method>createInvoiceWhenStatusChange</method>
82
- </payline>
83
- <payline_fees>
84
- <class>payline/observer</class>
85
- <method>saveOrderNxFees</method>
86
- </payline_fees>
87
- </observers>
88
- </sales_order_save_after>
89
- <sales_quote_collect_totals_before>
90
- <observers>
91
- <payline>
92
- <class>payline/observer</class>
93
- <method>saveQuoteNxFees</method>
94
- </payline>
95
- </observers>
96
- </sales_quote_collect_totals_before>
97
- <sales_order_invoice_save_after>
98
- <observers>
99
- <payline>
100
- <class>payline/observer</class>
101
- <method>saveInvoiceNxFees</method>
102
- </payline>
103
- </observers>
104
- </sales_order_invoice_save_after>
105
- <controller_action_postdispatch_checkout_onepage_saveShippingMethod>
106
- <observers>
107
- <payline>
108
- <class>payline/observer</class>
109
- <method>afterSaveShippingAction</method>
110
- </payline>
111
- </observers>
112
- </controller_action_postdispatch_checkout_onepage_saveShippingMethod>
113
- </events>
114
-
115
- <sales>
116
- <quote>
117
- <totals>
118
- <payline_nx>
119
- <class>payline/total_nx_quote</class>
120
- <after>subtotal</after>
121
- <before>grand_total,tax</before>
122
- <renderer>payline/checkout_total</renderer>
123
- </payline_nx>
124
- </totals>
125
- </quote>
126
- <order_invoice>
127
- <totals>
128
- <payline_nx>
129
- <class>payline/total_nx_invoice</class>
130
- <after>subtotal</after>
131
- <before>grand_total,tax</before>
132
- </payline_nx>
133
- </totals>
134
- </order_invoice>
135
- </sales>
136
- </global>
137
- <frontend>
138
- <routers>
139
- <payline>
140
- <use>standard</use>
141
- <args>
142
- <module>Monext_Payline</module>
143
- <frontName>payline</frontName>
144
- </args>
145
- </payline>
146
- </routers>
147
- <translate>
148
- <modules>
149
- <Monext_Payline>
150
- <files>
151
- <default>Monext_Payline.csv</default>
152
- </files>
153
- </Monext_Payline>
154
- </modules>
155
- </translate>
156
- <layout>
157
- <updates>
158
- <payline module="Monext_Payline">
159
- <file>payline.xml</file>
160
- </payline>
161
- </updates>
162
- </layout>
163
- </frontend>
164
- <admin>
165
- <routers>
166
- <payline>
167
- <use>admin</use>
168
- <args>
169
- <module>Monext_Payline</module>
170
- <frontName>payline</frontName>
171
- </args>
172
- </payline>
173
- </routers>
174
- </admin>
175
- <adminhtml>
176
- <translate>
177
- <modules>
178
- <Monext_Payline>
179
- <files>
180
- <default>Monext_Payline.csv</default>
181
- </files>
182
- </Monext_Payline>
183
- </modules>
184
- </translate>
185
- <layout>
186
- <updates>
187
- <payline module="Monext_Payline">
188
- <file>payline.xml</file>
189
- </payline>
190
- </updates>
191
- </layout>
192
- <menu>
193
- <system>
194
- <children>
195
- <payline translate="title" module="payline">
196
- <title>Manage Payline Contracts</title>
197
- <sort_order>10</sort_order>
198
- <action>payline/adminhtml_managecontracts</action>
199
- </payline>
200
- </children>
201
- </system>
202
- </menu>
203
- <acl>
204
- <resources>
205
- <admin>
206
- <children>
207
- <system>
208
- <children>
209
- <payline>
210
- <title>Manage Payline Contracts</title>
211
- <sort_order>10</sort_order>
212
- </payline>
213
- </children>
214
- </system>
215
- </children>
216
- </admin>
217
- </resources>
218
- </acl>
219
- </adminhtml>
220
- <default>
221
- <payment>
222
- <payline_common>
223
- <title>Common settings</title>
224
- <failed_order_status>holded</failed_order_status>
225
- <canceled_order_status>canceled</canceled_order_status>
226
- <new_order_status>processing</new_order_status>
227
- <init_order_status>pending</init_order_status>
228
- <fraud_order_status>pending</fraud_order_status>
229
- <automate_wallet_subscription>1</automate_wallet_subscription>
230
- <primary_max_fail_retry>1</primary_max_fail_retry>
231
- <primary_call_timeout>15</primary_call_timeout>
232
- <primary_replay_timer>15</primary_replay_timer>
233
- <secondary_max_fail_retry>2</secondary_max_fail_retry>
234
- <secondary_call_timeout>15</secondary_call_timeout>
235
- <secondary_replay_timer>15</secondary_replay_timer>
236
- <switch_back_timer>600</switch_back_timer>
237
- <payline_ws_switch_enable></payline_ws_switch_enable>
238
- <payline_err_code>02101,02102,02103</payline_err_code>
239
- <payline_err_token>02317,02318</payline_err_token>
240
- <primary_token_prefix>1</primary_token_prefix>
241
- <secondary_token_prefix>2</secondary_token_prefix>
242
- <return_payment_refused>0</return_payment_refused>
243
- </payline_common>
244
- <PaylineCPT>
245
- <model>payline/cpt</model>
246
- <!-- Auth+Capture, 100 is capture only -->
247
- <payline_payment_action>101</payline_payment_action>
248
- <send_wallet_id>1</send_wallet_id>
249
- </PaylineCPT>
250
- <PaylineNX>
251
- <model>payline/nx</model>
252
- <send_wallet_id>1</send_wallet_id>
253
- </PaylineNX>
254
- <PaylineDIRECT>
255
- <model>payline/direct</model>
256
- <!-- Auth+Capture, 100 is capture only -->
257
- <payline_payment_action>101</payline_payment_action>
258
- <send_wallet_id>1</send_wallet_id>
259
- </PaylineDIRECT>
260
- <PaylineWALLET>
261
- <model>payline/wallet</model>
262
- <payline_register-oneclick_customeraccount>payline_register-oneclick_customeraccount</payline_register-oneclick_customeraccount>
263
- <payline_register-oneclick_catalog>payline_register-oneclick_catalog</payline_register-oneclick_catalog>
264
- <update_payment_details>1</update_payment_details>
265
- <update_personal_details>0</update_personal_details>
266
- <one_clic_block_title>One Click Checkout</one_clic_block_title>
267
- <!-- Auth+Capture, 100 is capture only -->
268
- <payline_payment_action>101</payline_payment_action>
269
- </PaylineWALLET>
270
- </payment>
271
- </default>
272
- </config>
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Monext_Payline>
5
+ <version>1.7.8</version>
6
+ </Monext_Payline>
7
+ </modules>
8
+ <global>
9
+ <blocks>
10
+ <payline>
11
+ <class>Monext_Payline_Block</class>
12
+ </payline>
13
+ <adminhtml>
14
+ <!-- Needed for Magento Enterprise 1.9 -->
15
+ <rewrite>
16
+ <sales_order_creditmemo_create_items>Monext_Payline_Block_Adminhtml_Sales_Order_Creditmemo_Create_Items</sales_order_creditmemo_create_items>
17
+ <customer_grid>Monext_Payline_Block_Adminhtml_Customer_Grid</customer_grid>
18
+ </rewrite>
19
+ </adminhtml>
20
+ </blocks>
21
+ <models>
22
+ <payline>
23
+ <class>Monext_Payline_Model</class>
24
+ <resourceModel>payline_mysql4</resourceModel>
25
+ </payline>
26
+
27
+ <payline_mysql4>
28
+ <class>Monext_Payline_Model_Mysql4</class>
29
+ <entities>
30
+ <contract>
31
+ <table>payline_contract</table>
32
+ </contract>
33
+ <contract_status>
34
+ <table>payline_contract_status</table>
35
+ </contract_status>
36
+ <fees>
37
+ <table>payline_nx_fees</table>
38
+ </fees>
39
+ </entities>
40
+ </payline_mysql4>
41
+
42
+ <sales>
43
+ <rewrite>
44
+ <order_invoice>Monext_Payline_Model_Order_Invoice</order_invoice>
45
+ <order_payment>Monext_Payline_Model_Order_Payment</order_payment>
46
+ </rewrite>
47
+ </sales>
48
+ </models>
49
+ <helpers>
50
+ <payline>
51
+ <class>Monext_Payline_Helper</class>
52
+ </payline>
53
+ </helpers>
54
+
55
+ <resources>
56
+ <payline_setup>
57
+ <setup>
58
+ <module>Monext_Payline</module>
59
+ <class>Monext_Payline_Model_Resource_Eav_Mysql4_Setup</class>
60
+ </setup>
61
+ <connection>
62
+ <use>core_setup</use>
63
+ </connection>
64
+ </payline_setup>
65
+ <payline_write>
66
+ <connection>
67
+ <use>core_write</use>
68
+ </connection>
69
+ </payline_write>
70
+ <payline_read>
71
+ <connection>
72
+ <use>core_read</use>
73
+ </connection>
74
+ </payline_read>
75
+ </resources>
76
+ <events>
77
+ <sales_order_save_after>
78
+ <observers>
79
+ <payline>
80
+ <class>payline/observer</class>
81
+ <method>createInvoiceWhenStatusChange</method>
82
+ </payline>
83
+ <payline_fees>
84
+ <class>payline/observer</class>
85
+ <method>saveOrderNxFees</method>
86
+ </payline_fees>
87
+ </observers>
88
+ </sales_order_save_after>
89
+ <sales_quote_collect_totals_before>
90
+ <observers>
91
+ <payline>
92
+ <class>payline/observer</class>
93
+ <method>saveQuoteNxFees</method>
94
+ </payline>
95
+ </observers>
96
+ </sales_quote_collect_totals_before>
97
+ <sales_order_invoice_save_after>
98
+ <observers>
99
+ <payline>
100
+ <class>payline/observer</class>
101
+ <method>saveInvoiceNxFees</method>
102
+ </payline>
103
+ </observers>
104
+ </sales_order_invoice_save_after>
105
+ <controller_action_postdispatch_checkout_onepage_saveShippingMethod>
106
+ <observers>
107
+ <payline>
108
+ <class>payline/observer</class>
109
+ <method>afterSaveShippingAction</method>
110
+ </payline>
111
+ </observers>
112
+ </controller_action_postdispatch_checkout_onepage_saveShippingMethod>
113
+ </events>
114
+
115
+ <sales>
116
+ <quote>
117
+ <totals>
118
+ <payline_nx>
119
+ <class>payline/total_nx_quote</class>
120
+ <after>subtotal</after>
121
+ <before>grand_total,tax</before>
122
+ <renderer>payline/checkout_total</renderer>
123
+ </payline_nx>
124
+ </totals>
125
+ </quote>
126
+ <order_invoice>
127
+ <totals>
128
+ <payline_nx>
129
+ <class>payline/total_nx_invoice</class>
130
+ <after>subtotal</after>
131
+ <before>grand_total,tax</before>
132
+ </payline_nx>
133
+ </totals>
134
+ </order_invoice>
135
+ </sales>
136
+ </global>
137
+ <frontend>
138
+ <routers>
139
+ <payline>
140
+ <use>standard</use>
141
+ <args>
142
+ <module>Monext_Payline</module>
143
+ <frontName>payline</frontName>
144
+ </args>
145
+ </payline>
146
+ </routers>
147
+ <translate>
148
+ <modules>
149
+ <Monext_Payline>
150
+ <files>
151
+ <default>Monext_Payline.csv</default>
152
+ </files>
153
+ </Monext_Payline>
154
+ </modules>
155
+ </translate>
156
+ <layout>
157
+ <updates>
158
+ <payline module="Monext_Payline">
159
+ <file>payline.xml</file>
160
+ </payline>
161
+ </updates>
162
+ </layout>
163
+ </frontend>
164
+ <admin>
165
+ <routers>
166
+ <payline>
167
+ <use>admin</use>
168
+ <args>
169
+ <module>Monext_Payline</module>
170
+ <frontName>payline</frontName>
171
+ </args>
172
+ </payline>
173
+ </routers>
174
+ </admin>
175
+ <adminhtml>
176
+ <translate>
177
+ <modules>
178
+ <Monext_Payline>
179
+ <files>
180
+ <default>Monext_Payline.csv</default>
181
+ </files>
182
+ </Monext_Payline>
183
+ </modules>
184
+ </translate>
185
+ <layout>
186
+ <updates>
187
+ <payline module="Monext_Payline">
188
+ <file>payline.xml</file>
189
+ </payline>
190
+ </updates>
191
+ </layout>
192
+ <menu>
193
+ <system>
194
+ <children>
195
+ <payline translate="title" module="payline">
196
+ <title>Manage Payline Contracts</title>
197
+ <sort_order>10</sort_order>
198
+ <action>payline/adminhtml_managecontracts</action>
199
+ </payline>
200
+ </children>
201
+ </system>
202
+ </menu>
203
+ <acl>
204
+ <resources>
205
+ <admin>
206
+ <children>
207
+ <system>
208
+ <children>
209
+ <payline>
210
+ <title>Manage Payline Contracts</title>
211
+ <sort_order>10</sort_order>
212
+ </payline>
213
+ </children>
214
+ </system>
215
+ </children>
216
+ </admin>
217
+ </resources>
218
+ </acl>
219
+ </adminhtml>
220
+ <default>
221
+ <payment>
222
+ <payline_common>
223
+ <title>Common settings</title>
224
+ <failed_order_status>holded</failed_order_status>
225
+ <canceled_order_status>canceled</canceled_order_status>
226
+ <new_order_status>processing</new_order_status>
227
+ <init_order_status>pending</init_order_status>
228
+ <fraud_order_status>pending</fraud_order_status>
229
+ <automate_wallet_subscription>1</automate_wallet_subscription>
230
+ <primary_max_fail_retry>1</primary_max_fail_retry>
231
+ <primary_call_timeout>15</primary_call_timeout>
232
+ <primary_replay_timer>15</primary_replay_timer>
233
+ <secondary_max_fail_retry>2</secondary_max_fail_retry>
234
+ <secondary_call_timeout>15</secondary_call_timeout>
235
+ <secondary_replay_timer>15</secondary_replay_timer>
236
+ <switch_back_timer>600</switch_back_timer>
237
+ <payline_ws_switch_enable></payline_ws_switch_enable>
238
+ <payline_err_code>02101,02102,02103</payline_err_code>
239
+ <payline_err_token>02317,02318</payline_err_token>
240
+ <primary_token_prefix>1</primary_token_prefix>
241
+ <secondary_token_prefix>2</secondary_token_prefix>
242
+ <return_payment_refused>0</return_payment_refused>
243
+ </payline_common>
244
+ <PaylineCPT>
245
+ <model>payline/cpt</model>
246
+ <!-- Auth+Capture, 100 is capture only -->
247
+ <payline_payment_action>101</payline_payment_action>
248
+ <send_wallet_id>1</send_wallet_id>
249
+ </PaylineCPT>
250
+ <PaylineNX>
251
+ <model>payline/nx</model>
252
+ <send_wallet_id>1</send_wallet_id>
253
+ </PaylineNX>
254
+ <PaylineDIRECT>
255
+ <model>payline/direct</model>
256
+ <!-- Auth+Capture, 100 is capture only -->
257
+ <payline_payment_action>101</payline_payment_action>
258
+ <send_wallet_id>1</send_wallet_id>
259
+ </PaylineDIRECT>
260
+ <PaylineWALLET>
261
+ <model>payline/wallet</model>
262
+ <payline_register-oneclick_customeraccount>payline_register-oneclick_customeraccount</payline_register-oneclick_customeraccount>
263
+ <payline_register-oneclick_catalog>payline_register-oneclick_catalog</payline_register-oneclick_catalog>
264
+ <update_payment_details>1</update_payment_details>
265
+ <update_personal_details>0</update_personal_details>
266
+ <one_clic_block_title>One Click Checkout</one_clic_block_title>
267
+ <!-- Auth+Capture, 100 is capture only -->
268
+ <payline_payment_action>101</payline_payment_action>
269
+ </PaylineWALLET>
270
+ </payment>
271
+ </default>
272
+ </config>
app/design/frontend/default/default/layout/payline.xml CHANGED
@@ -30,6 +30,7 @@
30
  </reference>
31
  </cms_index_index>
32
 
 
33
  <checkout_onepage_progress>
34
  <reference name="payment_info">
35
  <action method="setInfoTemplate"><method>PaylineCPT</method><template>payline/checkout/onepage/info/default.phtml</template></action>
@@ -39,6 +40,16 @@
39
  </reference>
40
  </checkout_onepage_progress>
41
 
 
 
 
 
 
 
 
 
 
 
42
  <customer_account>
43
  <reference name="customer_account_navigation">
44
  <action method="addLink" translate="label" module="payline" ifconfig="payment/PaylineWALLET/active"><name>payline</name><path>payline/wallet/manage</path><label>Wallet management</label></action>
30
  </reference>
31
  </cms_index_index>
32
 
33
+ <!-- magento CE 1.5 -->
34
  <checkout_onepage_progress>
35
  <reference name="payment_info">
36
  <action method="setInfoTemplate"><method>PaylineCPT</method><template>payline/checkout/onepage/info/default.phtml</template></action>
40
  </reference>
41
  </checkout_onepage_progress>
42
 
43
+ <!-- magento CE 1.8 + EE 1.13 -->
44
+ <checkout_onepage_progress_payment>
45
+ <reference name="payment_info">
46
+ <action method="setInfoTemplate"><method>PaylineCPT</method><template>payline/checkout/onepage/info/default.phtml</template></action>
47
+ <action method="setInfoTemplate"><method>PaylineDIRECT</method><template>payline/checkout/onepage/info/default.phtml</template></action>
48
+ <action method="setInfoTemplate"><method>PaylineNX</method><template>payline/checkout/onepage/info/default.phtml</template></action>
49
+ <action method="setInfoTemplate"><method>PaylineWALLET</method><template>payline/checkout/onepage/info/default.phtml</template></action>
50
+ </reference>
51
+ </checkout_onepage_progress_payment>
52
+
53
  <customer_account>
54
  <reference name="customer_account_navigation">
55
  <action method="addLink" translate="label" module="payline" ifconfig="payment/PaylineWALLET/active"><name>payline</name><path>payline/wallet/manage</path><label>Wallet management</label></action>
app/design/frontend/default/default/template/payline/Direct.phtml CHANGED
@@ -1,60 +1,62 @@
1
  <?php $_code=$this->getMethodCode() ?>
2
- <ul class="form-list" id="payment_form_<?php echo $_code ?>" style="display:none;">
3
- <li>
4
- <label for="<?php echo $_code ?>_cc_owner" class="required"><em>*</em><?php echo $this->__('Name on Card') ?></label>
5
- <div class="input-box">
6
- <input type="text" title="<?php echo $this->__('Name on Card') ?>" class="input-text required-entry" id="<?php echo $_code ?>_cc_owner" name="payment[cc_owner]" value="<?php echo $this->htmlEscape($this->getInfoData('cc_owner')) ?>" />
7
- </div>
8
- </li>
9
- <li>
10
- <label for="<?php echo $_code ?>_cc_type" class="required"><em>*</em><?php echo $this->__('Credit Card Type') ?></label>
11
- <div class="input-box">
12
- <select id="<?php echo $_code ?>_cc_type" name="payment[cc_type]" title="<?php echo $this->__('Credit Card Type') ?>" class="required-entry">
13
- <option value=""><?php echo $this->__('--Please Select--') ?></option>
14
- <?php $_ccType = $this->getInfoData('cc_type') ?>
15
- <?php foreach ($this->getCcAvailableTypes() as $_typeCode => $_typeName): ?>
16
- <option value="<?php echo $_typeCode ?>"<?php if($_typeCode==$_ccType): ?> selected="selected"<?php endif ?>><?php echo $_typeName ?></option>
17
- <?php endforeach ?>
18
- </select>
19
- </div>
20
- </li>
21
- <li>
22
- <label for="<?php echo $_code ?>_cc_number" class="required"><em>*</em><?php echo $this->__('Credit Card Number') ?></label>
23
- <div class="input-box">
24
- <input type="text" id="<?php echo $_code ?>_cc_number" name="payment[cc_number]" title="<?php echo $this->__('Credit Card Number') ?>" class="input-text required-entry" value="" />
25
- </div>
26
- </li>
27
- <li>
28
- <label for="<?php echo $_code ?>_expiration" class="required"><em>*</em><?php echo $this->__('Expiration Date') ?></label>
29
- <div class="input-box">
30
- <div class="v-fix">
31
- <select id="<?php echo $_code ?>_expiration" name="payment[cc_exp_month]" class="month validate-cc-exp required-entry">
32
- <?php $_ccExpMonth = $this->getInfoData('cc_exp_month') ?>
33
- <?php foreach ($this->getCcMonths() as $k=>$v): ?>
34
- <option value="<?php echo $k?$k:'' ?>"<?php if($k==$_ccExpMonth): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
35
- <?php endforeach ?>
36
- </select>
37
- </div>
38
- <div class="v-fix">
39
- <?php $_ccExpYear = $this->getInfoData('cc_exp_year') ?>
40
- <select id="<?php echo $_code ?>_expiration_yr" name="payment[cc_exp_year]" class="year required-entry">
41
- <?php foreach ($this->getCcYears() as $k=>$v): ?>
42
- <option value="<?php echo $k?$k:'' ?>"<?php if($k==$_ccExpYear): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
43
- <?php endforeach ?>
44
- </select>
45
- </div>
46
- </div>
47
- </li>
48
- <?php echo $this->getChildHtml() ?>
49
- <?php if($this->hasVerification()): ?>
50
- <li>
51
- <label for="<?php echo $_code ?>_cc_cid" class="required"><em>*</em><?php echo $this->__('Card Verification Number') ?></label>
52
- <div class="input-box">
53
- <div class="v-fix">
54
- <input type="text" title="<?php echo $this->__('Card Verification Number') ?>" class="input-text cvv required-entry" id="<?php echo $_code ?>_cc_cid" name="payment[cc_cid]" value="" />
55
- </div>
56
- <a href="#" class="cvv-what-is-this"><?php echo $this->__('What is this?') ?></a>
57
- </div>
58
- </li>
59
- <?php endif; ?>
60
- </ul>
 
 
1
  <?php $_code=$this->getMethodCode() ?>
2
+ <fieldset class="form-list" >
3
+ <ul id="payment_form_<?php echo $_code ?>" style="display:none;">
4
+ <li>
5
+ <label for="<?php echo $_code ?>_cc_owner" class="required"><em>*</em><?php echo $this->__('Name on Card') ?></label>
6
+ <div class="input-box">
7
+ <input type="text" title="<?php echo $this->__('Name on Card') ?>" class="input-text required-entry" id="<?php echo $_code ?>_cc_owner" name="payment[cc_owner]" value="<?php echo $this->htmlEscape($this->getInfoData('cc_owner')) ?>" />
8
+ </div>
9
+ </li>
10
+ <li>
11
+ <label for="<?php echo $_code ?>_cc_type" class="required"><em>*</em><?php echo $this->__('Credit Card Type') ?></label>
12
+ <div class="input-box">
13
+ <select id="<?php echo $_code ?>_cc_type" name="payment[cc_type]" title="<?php echo $this->__('Credit Card Type') ?>" class="required-entry">
14
+ <option value=""><?php echo $this->__('--Please Select--') ?></option>
15
+ <?php $_ccType = $this->getInfoData('cc_type') ?>
16
+ <?php foreach ($this->getCcAvailableTypes() as $_typeCode => $_typeName): ?>
17
+ <option value="<?php echo $_typeCode ?>"<?php if($_typeCode==$_ccType): ?> selected="selected"<?php endif ?>><?php echo $_typeName ?></option>
18
+ <?php endforeach ?>
19
+ </select>
20
+ </div>
21
+ </li>
22
+ <li>
23
+ <label for="<?php echo $_code ?>_cc_number" class="required"><em>*</em><?php echo $this->__('Credit Card Number') ?></label>
24
+ <div class="input-box">
25
+ <input type="text" id="<?php echo $_code ?>_cc_number" name="payment[cc_number]" title="<?php echo $this->__('Credit Card Number') ?>" class="input-text required-entry" value="" />
26
+ </div>
27
+ </li>
28
+ <li>
29
+ <label for="<?php echo $_code ?>_expiration" class="required"><em>*</em><?php echo $this->__('Expiration Date') ?></label>
30
+ <div class="input-box">
31
+ <div class="v-fix">
32
+ <select id="<?php echo $_code ?>_expiration" name="payment[cc_exp_month]" class="month validate-cc-exp required-entry">
33
+ <?php $_ccExpMonth = $this->getInfoData('cc_exp_month') ?>
34
+ <?php foreach ($this->getCcMonths() as $k=>$v): ?>
35
+ <option value="<?php echo $k?$k:'' ?>"<?php if($k==$_ccExpMonth): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
36
+ <?php endforeach ?>
37
+ </select>
38
+ </div>
39
+ <div class="v-fix">
40
+ <?php $_ccExpYear = $this->getInfoData('cc_exp_year') ?>
41
+ <select id="<?php echo $_code ?>_expiration_yr" name="payment[cc_exp_year]" class="year required-entry">
42
+ <?php foreach ($this->getCcYears() as $k=>$v): ?>
43
+ <option value="<?php echo $k?$k:'' ?>"<?php if($k==$_ccExpYear): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
44
+ <?php endforeach ?>
45
+ </select>
46
+ </div>
47
+ </div>
48
+ </li>
49
+ <?php echo $this->getChildHtml() ?>
50
+ <?php if($this->hasVerification()): ?>
51
+ <li>
52
+ <label for="<?php echo $_code ?>_cc_cid" class="required"><em>*</em><?php echo $this->__('Card Verification Number') ?></label>
53
+ <div class="input-box">
54
+ <div class="v-fix">
55
+ <input type="text" title="<?php echo $this->__('Card Verification Number') ?>" class="input-text cvv required-entry" id="<?php echo $_code ?>_cc_cid" name="payment[cc_cid]" value="" />
56
+ </div>
57
+ <a href="#" class="cvv-what-is-this"><?php echo $this->__('What is this?') ?></a>
58
+ </div>
59
+ </li>
60
+ <?php endif; ?>
61
+ </ul>
62
+ </fieldset>
app/design/frontend/default/default/template/payline/checkout/onepage.phtml CHANGED
@@ -4,7 +4,10 @@
4
  </span>
5
  <script type="text/javascript">
6
  //<![CDATA[
7
- <?php $gotoSection = Mage::registry('payline-goto-section')?>
 
 
 
8
  checkout.gotoSection('<?php echo $gotoSection?>');
9
  var updater = new Ajax.Updater(
10
  'checkout-review-load',
@@ -17,7 +20,12 @@
17
  }
18
  }
19
  );
20
- checkout.reloadProgressBlock();
21
-
 
 
 
 
 
22
  //]]>
23
  </script>
4
  </span>
5
  <script type="text/javascript">
6
  //<![CDATA[
7
+ <?php
8
+ $gotoSection = Mage::registry('payline-goto-section');
9
+ $filter = Mage::registry('payline-magento-version');
10
+ ?>
11
  checkout.gotoSection('<?php echo $gotoSection?>');
12
  var updater = new Ajax.Updater(
13
  'checkout-review-load',
20
  }
21
  }
22
  );
23
+
24
+ <?php if( $filter && $filter >= 1.8 ) : ?>
25
+ checkout.reloadStep('payment');
26
+ <?php else: ?>
27
+ checkout.reloadProgressBlock();
28
+ <?php endif; ?>
29
+
30
  //]]>
31
  </script>
app/design/frontend/default/default/template/payline/checkout/onepage/payment/methods.phtml ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2013 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php
28
+ /**
29
+ * One page checkout payment methods
30
+ *
31
+ * @var $this Mage_Checkout_Block_Onepage_Payment_Methods
32
+ */
33
+ ?>
34
+ <dl class="sp-methods" id="checkout-payment-method-load">
35
+ <?php
36
+ $methods = $this->getMethods();
37
+ $oneMethod = count($methods) <= 1;
38
+ ?>
39
+ <?php if (empty($methods)): ?>
40
+ <dt>
41
+ <?php echo $this->__('No Payment Methods') ?>
42
+ </dt>
43
+ <?php else:
44
+ foreach ($methods as $_method):
45
+ $_code = $_method->getCode();
46
+ ?>
47
+ <dt>
48
+ <?php if(!$oneMethod): ?>
49
+ <input id="p_method_<?php echo $_code ?>" value="<?php echo $_code ?>" type="radio" name="payment[method]" title="<?php echo $this->escapeHtml($_method->getTitle()) ?>" onclick="payment.switchMethod('<?php echo $_code ?>')"<?php if($this->getSelectedMethodCode()==$_code): ?> checked="checked"<?php endif; ?> class="radio" />
50
+ <?php else: ?>
51
+ <span class="no-display"><input id="p_method_<?php echo $_code ?>" value="<?php echo $_code ?>" type="radio" name="payment[method]" checked="checked" class="radio" /></span>
52
+ <?php $oneMethod = $_code; ?>
53
+ <?php endif; ?>
54
+ <label for="p_method_<?php echo $_code ?>"><?php echo $this->escapeHtml($this->getMethodTitle($_method)) ?> <?php echo $this->getMethodLabelAfterHtml($_method) ?></label>
55
+ </dt>
56
+ <?php if ($html = $this->getPaymentMethodFormHtml($_method)): ?>
57
+ <dd>
58
+ <?php echo $html; ?>
59
+ </dd>
60
+ <?php endif; ?>
61
+ <?php endforeach;
62
+ endif;
63
+ ?>
64
+ <?php echo $this->getChildChildHtml('additional'); ?>
65
+ <script type="text/javascript">
66
+ //<![CDATA[
67
+ <?php echo $this->getChildChildHtml('scripts'); ?>
68
+ payment.init();
69
+ <?php if (is_string($oneMethod)): ?>
70
+ payment.switchMethod('<?php echo $oneMethod ?>');
71
+ <?php endif; ?>
72
+ //]]>
73
+ </script>
74
+ </dl>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Payline</name>
4
- <version>1.7.7</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/gpl-license.php">GNU General Public License (GPL)</license>
7
  <channel>community</channel>
@@ -10,12 +10,11 @@
10
  <description>Profitez d&#xE8;s &#xE0; pr&#xE9;sent de l&#x2019;essor du march&#xE9; de la vente &#xE0; distance en proposant &#xE0; vos clients une solution de paiement totalement s&#xE9;curis&#xE9;e. Gr&#xE2;ce &#xE0; Payline vous permettez &#xE0; vos clients de r&#xE9;gler avec leur moyen de paiement habituel, quel que soit votre canal de vente. Vous leur proposez une interface de paiement facile &#xE0; utiliser, en mesure de vous accompagner dans votre d&#xE9;veloppement &#xE0; l&#x2019;international, en toute simplicit&#xE9;.&#xD;
11
  &#xD;
12
  Fonctionnalit&#xE9;s : autorisation, autorisation + validation, paiement en n fois, paiement par portefeuille et en 1 clic, validation et remboursement partiels, multi-boutique...</description>
13
- <notes>Prise en compte des codes retour 02324, 02534 et 02533&#xD;
14
- </notes>
15
  <authors><author><name>Payline</name><user>Payline</user><email>support@payline.com</email></author></authors>
16
- <date>2014-01-06</date>
17
- <time>08:59:23</time>
18
- <contents><target name="magecommunity"><dir name="Monext"><dir name="Payline"><dir name="Block"><dir name="Adminhtml"><dir name="Customer"><file name="Grid.php" hash="13b7c449e07ef729fbac8caa708decd1"/></dir><dir name="Managecontracts"><dir name="Edit"><file name="Form.php" hash="05040427f41fb110db974ff5a3eb6ba9"/></dir><file name="Edit.php" hash="7f026d56bfd7a7b03e9e1ad9263a008e"/><file name="Grid.php" hash="de14d88f9c299895168e5d1a214e267f"/></dir><file name="Managecontracts.php" hash="343434dde00ba5d5ba35ed255c44a98e"/><dir name="Sales"><dir name="Order"><dir name="Creditmemo"><dir name="Create"><file name="Items.php" hash="c7cd82866d8788ff32d42df8fcdc11f8"/></dir></dir><dir name="Total"><file name="Nxfees.php" hash="cd28c26f717481421bfab12c55ab5378"/></dir></dir></dir></dir><dir name="Checkout"><file name="Total.php" hash="df9fd2acea6ca2be213bfd5e335cedd6"/></dir><file name="Cpt.php" hash="85df4f91ef5ca13f14ca3c15a6ff29e3"/><file name="Direct.php" hash="a176d97fe09a830fbb82d517a71c7049"/><dir name="Info"><file name="Default.php" hash="028809c8e83cd97df32d3fe15833e609"/><file name="Direct.php" hash="f3a87e79429f581e2c896cc99f169aed"/></dir><file name="Logo.php" hash="2b7784f040f04489448fbc13b05ffe74"/><file name="Nx.php" hash="e4fd920c944abe9963f76e111e90ba48"/><dir name="Wallet"><file name="Checkoutbtn.php" hash="bbd8b30f2a37e83ce295295f0fe10ebf"/><file name="Details.php" hash="03cb96bd76d2265b842677b2a6825303"/><file name="Infos.php" hash="ae673ceafb630efbf0308657f766a816"/><file name="Sidebar.php" hash="db70b60be9aa20316f91b3fa3a23a2b9"/></dir><file name="Wallet.php" hash="6326c9e76c84777597f30a89d718ccb4"/></dir><dir name="Helper"><file name="Data.php" hash="4edd6778b8a3342cdbeae5b1493bb649"/><file name="Logger.php" hash="6b7cf036fdf2e6df2cb7fa645c8912b9"/></dir><dir name="Model"><dir name="Contract"><file name="Status.php" hash="67919f148f5d50a266b92e8a32e833f1"/></dir><file name="Contract.php" hash="75ac4b82964f0b87f7b30c4fb0f6b638"/><file name="Cpt.php" hash="94254eb4113dc8a0a6cc1d4c8521a602"/><dir name="Datasource"><file name="Actions.php" hash="2152344a8bd5fbf7dbe711c58f97356c"/><file name="Billingcycles.php" hash="bef244e6d9e744fbbc3afed9cc2050f9"/><file name="Billingoccurrences.php" hash="581ce23ec626ed71791b13c7b11fe6db"/><file name="Capturepaymentoptions.php" hash="8095a47418aa5d7f0cea91718de2323f"/><dir name="Cms"><file name="Block.php" hash="eee43f517c9e29e51f0ca21fdc7b74ed"/></dir><file name="Costs.php" hash="ac09cf06fbe9a1fabddb2a4727dd696f"/><file name="Languages.php" hash="17053eec4880c5c5b1f233a3ca9f0bda"/><file name="Paymentactions.php" hash="6c4aae3b1b4e8b987a4da7393a3a92eb"/><file name="Paymentactionsreauth.php" hash="ef87674b1742240f9c2af17eb38fd994"/><file name="Return.php" hash="d8fac75b41a931a4714ed8acf846d9a2"/><file name="Securitymodes.php" hash="06c55b65e9254d96fa87595322839932"/><file name="Shippingmethods.php" hash="1c67f2af87583aae049c86cb4dcdf881"/><dir name="Status"><file name="Canceled.php" hash="c4e799efcb052536081339520c7b72c2"/><file name="Invoice.php" hash="b2cbeeaf4e78ec4545f6d45faba1922e"/></dir><file name="Status.php" hash="893648bdaa413d2ec2e5243a2f63c9d8"/><file name="Statusrowempty.php" hash="5d342031d511a204b15d2d9c8c852162"/></dir><file name="Direct.php" hash="d7bde5b06b400fb9362a527d556287c2"/><file name="Fees.php" hash="d51c983f019b43e70516b71e163e9a28"/><dir name="Mysql4"><dir name="Contract"><file name="Collection.php" hash="7d71121cac131f11dc012375b4412d85"/><dir name="Status"><file name="Collection.php" hash="3a76926bcab21729191a4045fa9662f7"/></dir><file name="Status.php" hash="3deb3f63a199b110a3fa581ff777172f"/></dir><file name="Contract.php" hash="33cbc24553f2d90ba164363172e2f4c7"/><dir name="Fees"><file name="Collection.php" hash="b00bb0ec3e0a75a2435f6c55d3eea02c"/></dir><file name="Fees.php" hash="c398d9290276806d03af8631a09eac63"/></dir><file name="Nx.php" hash="830433cc06e92665fd554fe0030070f0"/><file name="Observer.php" hash="94824604b2ea364b1bed23bbaa01033b"/><dir name="Order"><file name="Invoice.php" hash="4b1a7d53444ad7069479ac617d7396b6"/><file name="Payment.php" hash="c8207b103d284bde7e511c57d9a5399c"/></dir><dir name="Resource"><dir name="Eav"><dir name="Mysql4"><file name="Setup.php" hash="f0cb886cd65e23ec397e651d7913ea9e"/></dir></dir></dir><dir name="Total"><dir name="Nx"><file name="Invoice.php" hash="6ead6df53b6169709797d6c08cd4d16c"/><file name="Quote.php" hash="8e7ab3cc36d180c600bb28192193567b"/></dir></dir><file name="Wallet.php" hash="b114d566bd102eb6e25c3070be79303f"/></dir><dir name="PaylinePHPKit"><dir name="configuration"><file name="HighDefinition.ini" hash="689dc8f1ba03e0c04ae6a8758df38f1b"/></dir><dir name="lib"><file name="Payline.wsdl" hash="b22b4ddfb2751c886e25d7202731c686"/><file name="jIniFileModifier.php" hash="f7d309bd1fb8f408528151b0555b188c"/><file name="lib_debug.php" hash="9cec1fd5e55fd625b98b03ca336214d1"/><file name="paylineSDK.php" hash="83cf41dbebef28d215c31b0061f0ef29"/></dir><dir name="logs"><file name="empty.log" hash=""/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="ManagecontractsController.php" hash="f5c8ac2227e34766baed1e3e0af4bf87"/></dir><file name="CheckoutonepageController.php" hash="da35bdb14ac62a258479b44011dacc01"/><file name="IndexController.php" hash="0a25a5e88c7cfd760795e49c94f93939"/><file name="UnloggedwalletController.php" hash="90af5be8a8fa8dd1b2e29a442c0b7aab"/><file name="WalletController.php" hash="9bedfe037d2d845d4b1fe2acbbf69033"/></dir><dir name="etc"><file name="config.xml" hash="9b429b0a1d4c5428996127164ce63bc2"/><file name="system.xml" hash="0d83d9a3b18a03bbc71191da32c22bc2"/></dir><dir name="sql"><dir name="payline_setup"><file name="mysql4-install-1.6.0.php" hash="ed5013f743ba36a7b2884fc432f97e16"/><file name="mysql4-upgrade-1.7.2-1.7.3.php" hash="7eeb0f5cfc6c379d8300428a5ec39c46"/><file name="mysql4-upgrade-1.7.5-1.7.6.php" hash="0ebfd38e90a8139c67087fc1e16f1aba"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="css"><file name="payline.css" hash="414432db8dc1d0682f4988917bd8dd6f"/></dir><dir name="images"><dir name="payline_moyens_paiement"><file name="1euro.png" hash="8d5e4917497ba61120090e166014886d"/><file name="3xcb.png" hash="c76c834e238d3a8e3b3b4a2c116f189c"/><file name="amex.png" hash="a47d6bfc7eb4e06f3e3acb8a55cfd3c9"/><file name="amexoneclick.png" hash="a47d6bfc7eb4e06f3e3acb8a55cfd3c9"/><file name="aurore.png" hash="e2be3e130bd1212d9375a3bdb354cb78"/><file name="buyster.png" hash="8ec0f280dccd1c18c84cfbd368c6f579"/><file name="casino.png" hash="ce5b159bc98c7f71e8149e1d8b256dbd"/><file name="cb.png" hash="a5d9178bc831cbc78238dff27f79a48b"/><file name="cofinoga.png" hash="1dd7025dd22ac998aa968b38693a6a71"/><file name="cyrillus.png" hash="f762ad007f552bf409f5baa610f6746a"/><file name="default.png" hash="26c2dff177e1f8a94994352f6a7cec88"/><file name="diners.png" hash="6c907b8f0233b035ec4c27c2e9542406"/><file name="elv.png" hash="d0bd93c59ef64709b9a5cd81ff557e28"/><file name="fnac.png" hash="c0a7aa595b18fb52105d9337fda3eb1c"/><file name="ideal.png" hash="e0594aed23073daab150d8288a81103c"/><file name="internetplus.png" hash="fe1bc34531cfd6fd3dab6a6614e7ca3f"/><file name="jcb.png" hash="9801aeed2550ffccbdc3fe88b5292a60"/><file name="kangourou.png" hash="5fac97aa8f70380ec3b601ff32fdc012"/><file name="leetchi.png" hash="ecf6612b0228b889c723498f476c4309"/><file name="maestro.png" hash="19d331ae4783d590dba694cbcbb26da9"/><file name="mandarine.png" hash="745a8999468f60753c9c51a0052c527a"/><file name="mastercard.png" hash="cb7aa4a6f3870145295c4ce16a602d1e"/><file name="maxicheque.png" hash="fc3e2988c9944467fc8d4e44b4118a32"/><file name="mcvisa.png" hash="ba6349155be595d6da5ee584241c2946"/><file name="moneo.png" hash="283cf98332a5c05521229282875a158d"/><file name="neosurf.png" hash="9a747833ce3d9cbb3c26d4a11d7e4b4b"/><file name="okshopping.png" hash="8498bd45cf87124d12c4bfbf81272f14"/><file name="pass.png" hash="adb923e16cd9419960a51d0d41f26f97"/><file name="passvisa.png" hash="bd88d99714e9a3ba5000f881a0289f58"/><file name="payfair.png" hash="82f5dc87ea6f43f386b0e4887f33e5e8"/><file name="paypal.png" hash="2e9a634ffb111e1ce20b5e9017a35b29"/><file name="paysafecard.png" hash="a6776e5140ad443596587e3de12cd6a2"/><file name="printemps.png" hash="072cde23d8600c39457cf02a983b6d7f"/><file name="privilege.png" hash="883c70c0ce1c5bac23865397b0b63c5c"/><file name="skrill.png" hash="5d77ac7b63309a8691c27628aad9f60a"/><file name="sofinco.png" hash="93081c5cb7ce8ba216bbc42019cde8d3"/><file name="surcouf.png" hash="d8633f7d4b47460faac4e8657ce42f4d"/><file name="switch.png" hash="e2924bb36ad3de3d3ee61fa4dc3ffa8b"/><file name="ticketpremium.png" hash="5146987c213691e20a5461d7eed59f09"/><file name="ticketsurf.png" hash="bcd9aeb8b2784ea6a06e80cc2b2393ec"/><file name="visa.png" hash="bd8890f0147d451bf1a488d4e268332c"/><file name="wexpay.png" hash="1f3bb2ec092f283a8b27c66e2c32f22f"/></dir><file name="payline-logo.png" hash="553b387e92d95aef92a35f332e75cac4"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="payline.xml" hash="0488c4cfab8321f91ec7a9adaf482837"/></dir><dir name="template"><dir name="payline"><file name="contracts.phtml" hash="6d398a529e799880533d954f53f6df96"/><dir name="customer"><dir name="tab"><file name="view.phtml" hash="1c3d9c842c802967bc867ff2be008504"/></dir></dir><dir name="payment"><dir name="info"><file name="monext.phtml" hash="6daa4bb0bc10c81fcf2a099dd789903d"/></dir></dir><file name="switcher.phtml" hash="ced863f3f520e271497c0a6bcc4b38e4"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="payline.xml" hash="d23c6df56d32a39b55a9780245036d75"/></dir><dir name="template"><dir name="payline"><file name="Cpt.phtml" hash="d5a78eb6488ad0985a4fd62bd10e05e3"/><file name="Direct.phtml" hash="08167b333ce1380879ebaea26c1362ca"/><file name="Payline.phtml" hash="dc264172e5a6c5ae627b697208dff65d"/><dir name="checkout"><dir name="onepage"><file name="addjs.phtml" hash="8baee7d7d804635a6062bbb41ad4f162"/><dir name="info"><file name="default.phtml" hash="4689f891bab252ff10bb789d37e9bc2b"/></dir><file name="shipping-method.phtml" hash="a81a9f308f15008842bfd9ba69852aa9"/></dir><file name="onepage.phtml" hash="1f19d5af1a65cd7b5f4debf785bba49a"/><file name="total.phtml" hash="24170fbb2b43da6fc3d4a51db4b80d7a"/></dir><file name="iframe.phtml" hash="4a841413fa569be79b31464fc8f9a88a"/><file name="iframeleaver.phtml" hash="b617751653aa68ada738385a3959e863"/><file name="logo.phtml" hash="b850cc0f8b99d4486dedebc7c913d363"/><dir name="page"><file name="empty.phtml" hash="02134361869217c7445f46af028a050a"/></dir><dir name="payment"><dir name="info"><file name="monext.phtml" hash="ce3c565c9cdae42debacb267e2c9a9ea"/></dir></dir><dir name="wallet"><file name="checkoutbtn.phtml" hash="612617f342e05a34f6a2a618e3bf9162"/><file name="details.phtml" hash="b8d7e336b994261f66f1a9af5841661e"/><file name="form.phtml" hash="7358f21e31266c65982afb15239e659f"/><file name="manage.phtml" hash="994c98abd9b4f2f68f76eefe20c637d1"/><dir name="sidebar"><file name="form.phtml" hash="b7662b515f5195faada2736cf38b01aa"/><file name="notlogged.phtml" hash="169ccfe11034a47c74a9a78e0eac6046"/></dir><file name="sidebar.phtml" hash="2113b8dba864cd94b241dc7ecd6dff0a"/><file name="subscribe.phtml" hash="a737e95240e262e91ec01a02e2ce97a2"/><file name="update.phtml" hash="1b7048c9a839b0b0994beaf5e72b755c"/></dir></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Monext_Payline.csv" hash="b972d5544df49c367f96e7fecc2ec3eb"/></dir><dir name="fr_FR"><file name="Monext_Payline.csv" hash="f32aeede40718e91cc4ff927f05f93e1"/></dir></target><target name="mageetc"><dir name="modules"><file name="Monext_Payline.xml" hash="d6ff98113ab17d2b19ee89d7a80cf7e9"/></dir></target></contents>
19
  <compatible/>
20
  <dependencies><required><php><min>5.0.0</min><max>6.0.0</max></php></required></dependencies>
21
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Payline</name>
4
+ <version>1.7.8</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/gpl-license.php">GNU General Public License (GPL)</license>
7
  <channel>community</channel>
10
  <description>Profitez d&#xE8;s &#xE0; pr&#xE9;sent de l&#x2019;essor du march&#xE9; de la vente &#xE0; distance en proposant &#xE0; vos clients une solution de paiement totalement s&#xE9;curis&#xE9;e. Gr&#xE2;ce &#xE0; Payline vous permettez &#xE0; vos clients de r&#xE9;gler avec leur moyen de paiement habituel, quel que soit votre canal de vente. Vous leur proposez une interface de paiement facile &#xE0; utiliser, en mesure de vous accompagner dans votre d&#xE9;veloppement &#xE0; l&#x2019;international, en toute simplicit&#xE9;.&#xD;
11
  &#xD;
12
  Fonctionnalit&#xE9;s : autorisation, autorisation + validation, paiement en n fois, paiement par portefeuille et en 1 clic, validation et remboursement partiels, multi-boutique...</description>
13
+ <notes>Ajout du support Magento CE 1.8 et Magento EE 1.13</notes>
 
14
  <authors><author><name>Payline</name><user>Payline</user><email>support@payline.com</email></author></authors>
15
+ <date>2014-02-27</date>
16
+ <time>13:46:01</time>
17
+ <contents><target name="magecommunity"><dir name="Monext"><dir name="Payline"><dir name="Block"><dir name="Adminhtml"><dir name="Customer"><file name="Grid.php" hash="13b7c449e07ef729fbac8caa708decd1"/></dir><dir name="Managecontracts"><dir name="Edit"><file name="Form.php" hash="05040427f41fb110db974ff5a3eb6ba9"/></dir><file name="Edit.php" hash="7f026d56bfd7a7b03e9e1ad9263a008e"/><file name="Grid.php" hash="de14d88f9c299895168e5d1a214e267f"/></dir><file name="Managecontracts.php" hash="343434dde00ba5d5ba35ed255c44a98e"/><dir name="Sales"><dir name="Order"><dir name="Creditmemo"><dir name="Create"><file name="Items.php" hash="c7cd82866d8788ff32d42df8fcdc11f8"/></dir></dir><dir name="Total"><file name="Nxfees.php" hash="cd28c26f717481421bfab12c55ab5378"/></dir></dir></dir></dir><dir name="Checkout"><file name="Total.php" hash="df9fd2acea6ca2be213bfd5e335cedd6"/></dir><file name="Cpt.php" hash="85df4f91ef5ca13f14ca3c15a6ff29e3"/><file name="Direct.php" hash="a176d97fe09a830fbb82d517a71c7049"/><dir name="Info"><file name="Default.php" hash="028809c8e83cd97df32d3fe15833e609"/><file name="Direct.php" hash="f3a87e79429f581e2c896cc99f169aed"/></dir><file name="Logo.php" hash="2b7784f040f04489448fbc13b05ffe74"/><file name="Nx.php" hash="e4fd920c944abe9963f76e111e90ba48"/><dir name="Wallet"><file name="Checkoutbtn.php" hash="bbd8b30f2a37e83ce295295f0fe10ebf"/><file name="Details.php" hash="03cb96bd76d2265b842677b2a6825303"/><file name="Infos.php" hash="ae673ceafb630efbf0308657f766a816"/><file name="Sidebar.php" hash="db70b60be9aa20316f91b3fa3a23a2b9"/></dir><file name="Wallet.php" hash="6326c9e76c84777597f30a89d718ccb4"/></dir><dir name="Helper"><file name="Data.php" hash="4edd6778b8a3342cdbeae5b1493bb649"/><file name="Logger.php" hash="6b7cf036fdf2e6df2cb7fa645c8912b9"/></dir><dir name="Model"><dir name="Contract"><file name="Status.php" hash="67919f148f5d50a266b92e8a32e833f1"/></dir><file name="Contract.php" hash="75ac4b82964f0b87f7b30c4fb0f6b638"/><file name="Cpt.php" hash="94254eb4113dc8a0a6cc1d4c8521a602"/><dir name="Datasource"><file name="Actions.php" hash="2152344a8bd5fbf7dbe711c58f97356c"/><file name="Billingcycles.php" hash="bef244e6d9e744fbbc3afed9cc2050f9"/><file name="Billingoccurrences.php" hash="581ce23ec626ed71791b13c7b11fe6db"/><file name="Capturepaymentoptions.php" hash="8095a47418aa5d7f0cea91718de2323f"/><dir name="Cms"><file name="Block.php" hash="eee43f517c9e29e51f0ca21fdc7b74ed"/></dir><file name="Costs.php" hash="ac09cf06fbe9a1fabddb2a4727dd696f"/><file name="Languages.php" hash="17053eec4880c5c5b1f233a3ca9f0bda"/><file name="Paymentactions.php" hash="6c4aae3b1b4e8b987a4da7393a3a92eb"/><file name="Paymentactionsreauth.php" hash="ef87674b1742240f9c2af17eb38fd994"/><file name="Return.php" hash="d8fac75b41a931a4714ed8acf846d9a2"/><file name="Securitymodes.php" hash="06c55b65e9254d96fa87595322839932"/><file name="Shippingmethods.php" hash="1c67f2af87583aae049c86cb4dcdf881"/><dir name="Status"><file name="Canceled.php" hash="c4e799efcb052536081339520c7b72c2"/><file name="Invoice.php" hash="b2cbeeaf4e78ec4545f6d45faba1922e"/></dir><file name="Status.php" hash="ec9086907481960aa7c669de0db470c3"/><file name="Statusrowempty.php" hash="94532e5d65ff502ccfaf995f2993ad10"/></dir><file name="Direct.php" hash="d7bde5b06b400fb9362a527d556287c2"/><file name="Fees.php" hash="d51c983f019b43e70516b71e163e9a28"/><dir name="Mysql4"><dir name="Contract"><file name="Collection.php" hash="7d71121cac131f11dc012375b4412d85"/><dir name="Status"><file name="Collection.php" hash="3a76926bcab21729191a4045fa9662f7"/></dir><file name="Status.php" hash="3deb3f63a199b110a3fa581ff777172f"/></dir><file name="Contract.php" hash="33cbc24553f2d90ba164363172e2f4c7"/><dir name="Fees"><file name="Collection.php" hash="b00bb0ec3e0a75a2435f6c55d3eea02c"/></dir><file name="Fees.php" hash="c398d9290276806d03af8631a09eac63"/></dir><file name="Nx.php" hash="830433cc06e92665fd554fe0030070f0"/><file name="Observer.php" hash="94824604b2ea364b1bed23bbaa01033b"/><dir name="Order"><file name="Invoice.php" hash="4b1a7d53444ad7069479ac617d7396b6"/><file name="Payment.php" hash="c8207b103d284bde7e511c57d9a5399c"/></dir><dir name="Resource"><dir name="Eav"><dir name="Mysql4"><file name="Setup.php" hash="f0cb886cd65e23ec397e651d7913ea9e"/></dir></dir></dir><dir name="Total"><dir name="Nx"><file name="Invoice.php" hash="6ead6df53b6169709797d6c08cd4d16c"/><file name="Quote.php" hash="8e7ab3cc36d180c600bb28192193567b"/></dir></dir><file name="Wallet.php" hash="b114d566bd102eb6e25c3070be79303f"/></dir><dir name="PaylinePHPKit"><dir name="configuration"><file name="HighDefinition.ini" hash="689dc8f1ba03e0c04ae6a8758df38f1b"/></dir><dir name="lib"><file name="Payline.wsdl" hash="b22b4ddfb2751c886e25d7202731c686"/><file name="jIniFileModifier.php" hash="f7d309bd1fb8f408528151b0555b188c"/><file name="lib_debug.php" hash="9cec1fd5e55fd625b98b03ca336214d1"/><file name="paylineSDK.php" hash="ad351f993cad972269e320ece22d9231"/></dir><dir name="logs"><file name="2013-07-10.log" hash="43313ee0a50423965a813c2d890c522a"/><file name="2014-01-21.log" hash="e5981e2520850eaa20e5a2dae4b70bf2"/><file name="2014-01-28.log" hash="7dab9bb2d068931a6505da6203c56e62"/><file name="2014-02-03.log" hash="d4089bef110ef9ec7ab212728a290084"/><file name="2014-02-10.log" hash="3f5b62bc33538c9b0faf6770fd3ad5a8"/><file name="2014-02-11.log" hash="5abc8163ccda393902a81c28376f0ec7"/><file name="2014-02-17.log" hash="352c1e1e2552defa39a75b4c8be85d2b"/><file name="2014-02-25.log" hash="217eb08611a1c95b9f6995ee49dc57d7"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="ManagecontractsController.php" hash="f5c8ac2227e34766baed1e3e0af4bf87"/></dir><file name="CheckoutonepageController.php" hash="77772924163d5b5a2bc90f1b1ead6020"/><file name="IndexController.php" hash="2304134c659d77cd7a4d31d15cda4ea2"/><file name="UnloggedwalletController.php" hash="90af5be8a8fa8dd1b2e29a442c0b7aab"/><file name="WalletController.php" hash="9bedfe037d2d845d4b1fe2acbbf69033"/></dir><dir name="etc"><file name="config.xml" hash="c19f127b3e4926628495888d22f63a7f"/><file name="system.xml" hash="0d83d9a3b18a03bbc71191da32c22bc2"/></dir><dir name="sql"><dir name="payline_setup"><file name="mysql4-install-1.6.0.php" hash="ed5013f743ba36a7b2884fc432f97e16"/><file name="mysql4-upgrade-1.7.2-1.7.3.php" hash="7eeb0f5cfc6c379d8300428a5ec39c46"/><file name="mysql4-upgrade-1.7.5-1.7.6.php" hash="0ebfd38e90a8139c67087fc1e16f1aba"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="css"><file name="payline.css" hash="414432db8dc1d0682f4988917bd8dd6f"/></dir><dir name="images"><dir name="payline_moyens_paiement"><file name="1euro.png" hash="8d5e4917497ba61120090e166014886d"/><file name="3xcb.png" hash="c76c834e238d3a8e3b3b4a2c116f189c"/><file name="amex.png" hash="a47d6bfc7eb4e06f3e3acb8a55cfd3c9"/><file name="amexoneclick.png" hash="a47d6bfc7eb4e06f3e3acb8a55cfd3c9"/><file name="aurore.png" hash="e2be3e130bd1212d9375a3bdb354cb78"/><file name="buyster.png" hash="8ec0f280dccd1c18c84cfbd368c6f579"/><file name="casino.png" hash="ce5b159bc98c7f71e8149e1d8b256dbd"/><file name="cb.png" hash="a5d9178bc831cbc78238dff27f79a48b"/><file name="cofinoga.png" hash="1dd7025dd22ac998aa968b38693a6a71"/><file name="cyrillus.png" hash="f762ad007f552bf409f5baa610f6746a"/><file name="default.png" hash="26c2dff177e1f8a94994352f6a7cec88"/><file name="diners.png" hash="6c907b8f0233b035ec4c27c2e9542406"/><file name="elv.png" hash="d0bd93c59ef64709b9a5cd81ff557e28"/><file name="fnac.png" hash="c0a7aa595b18fb52105d9337fda3eb1c"/><file name="ideal.png" hash="e0594aed23073daab150d8288a81103c"/><file name="internetplus.png" hash="fe1bc34531cfd6fd3dab6a6614e7ca3f"/><file name="jcb.png" hash="9801aeed2550ffccbdc3fe88b5292a60"/><file name="kangourou.png" hash="5fac97aa8f70380ec3b601ff32fdc012"/><file name="leetchi.png" hash="ecf6612b0228b889c723498f476c4309"/><file name="maestro.png" hash="19d331ae4783d590dba694cbcbb26da9"/><file name="mandarine.png" hash="745a8999468f60753c9c51a0052c527a"/><file name="mastercard.png" hash="cb7aa4a6f3870145295c4ce16a602d1e"/><file name="maxicheque.png" hash="fc3e2988c9944467fc8d4e44b4118a32"/><file name="mcvisa.png" hash="ba6349155be595d6da5ee584241c2946"/><file name="moneo.png" hash="283cf98332a5c05521229282875a158d"/><file name="neosurf.png" hash="9a747833ce3d9cbb3c26d4a11d7e4b4b"/><file name="okshopping.png" hash="8498bd45cf87124d12c4bfbf81272f14"/><file name="pass.png" hash="adb923e16cd9419960a51d0d41f26f97"/><file name="passvisa.png" hash="bd88d99714e9a3ba5000f881a0289f58"/><file name="payfair.png" hash="82f5dc87ea6f43f386b0e4887f33e5e8"/><file name="paypal.png" hash="2e9a634ffb111e1ce20b5e9017a35b29"/><file name="paysafecard.png" hash="a6776e5140ad443596587e3de12cd6a2"/><file name="printemps.png" hash="072cde23d8600c39457cf02a983b6d7f"/><file name="privilege.png" hash="883c70c0ce1c5bac23865397b0b63c5c"/><file name="skrill.png" hash="5d77ac7b63309a8691c27628aad9f60a"/><file name="sofinco.png" hash="93081c5cb7ce8ba216bbc42019cde8d3"/><file name="surcouf.png" hash="d8633f7d4b47460faac4e8657ce42f4d"/><file name="switch.png" hash="e2924bb36ad3de3d3ee61fa4dc3ffa8b"/><file name="ticketpremium.png" hash="5146987c213691e20a5461d7eed59f09"/><file name="ticketsurf.png" hash="bcd9aeb8b2784ea6a06e80cc2b2393ec"/><file name="visa.png" hash="bd8890f0147d451bf1a488d4e268332c"/><file name="wexpay.png" hash="1f3bb2ec092f283a8b27c66e2c32f22f"/></dir><file name="payline-logo.png" hash="553b387e92d95aef92a35f332e75cac4"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="payline.xml" hash="0488c4cfab8321f91ec7a9adaf482837"/></dir><dir name="template"><dir name="payline"><file name="contracts.phtml" hash="6d398a529e799880533d954f53f6df96"/><dir name="customer"><dir name="tab"><file name="view.phtml" hash="1c3d9c842c802967bc867ff2be008504"/></dir></dir><dir name="payment"><dir name="info"><file name="monext.phtml" hash="6daa4bb0bc10c81fcf2a099dd789903d"/></dir></dir><file name="switcher.phtml" hash="ced863f3f520e271497c0a6bcc4b38e4"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="payline.xml" hash="7ec509d128fc9e459dd2bc0134500e2e"/></dir><dir name="template"><dir name="payline"><file name="Cpt.phtml" hash="d5a78eb6488ad0985a4fd62bd10e05e3"/><file name="Direct.phtml" hash="714ea31d44c8b6b25246fd97783aaad0"/><file name="Payline.phtml" hash="dc264172e5a6c5ae627b697208dff65d"/><dir name="checkout"><dir name="onepage"><file name="addjs.phtml" hash="8baee7d7d804635a6062bbb41ad4f162"/><dir name="info"><file name="default.phtml" hash="4689f891bab252ff10bb789d37e9bc2b"/></dir><dir name="payment"><file name="methods.phtml" hash="1194131c240a1154e8d0cf1c95a1e74e"/></dir><file name="shipping-method.phtml" hash="a81a9f308f15008842bfd9ba69852aa9"/></dir><file name="onepage.phtml" hash="5f159dfc756fce0ee5f80a211ae4136d"/><file name="total.phtml" hash="24170fbb2b43da6fc3d4a51db4b80d7a"/></dir><file name="iframe.phtml" hash="4a841413fa569be79b31464fc8f9a88a"/><file name="iframeleaver.phtml" hash="b617751653aa68ada738385a3959e863"/><file name="logo.phtml" hash="b850cc0f8b99d4486dedebc7c913d363"/><dir name="page"><file name="empty.phtml" hash="02134361869217c7445f46af028a050a"/></dir><dir name="payment"><dir name="info"><file name="monext.phtml" hash="ce3c565c9cdae42debacb267e2c9a9ea"/></dir></dir><dir name="wallet"><file name="checkoutbtn.phtml" hash="612617f342e05a34f6a2a618e3bf9162"/><file name="details.phtml" hash="b8d7e336b994261f66f1a9af5841661e"/><file name="form.phtml" hash="7358f21e31266c65982afb15239e659f"/><file name="manage.phtml" hash="994c98abd9b4f2f68f76eefe20c637d1"/><dir name="sidebar"><file name="form.phtml" hash="b7662b515f5195faada2736cf38b01aa"/><file name="notlogged.phtml" hash="169ccfe11034a47c74a9a78e0eac6046"/></dir><file name="sidebar.phtml" hash="2113b8dba864cd94b241dc7ecd6dff0a"/><file name="subscribe.phtml" hash="a737e95240e262e91ec01a02e2ce97a2"/><file name="update.phtml" hash="1b7048c9a839b0b0994beaf5e72b755c"/></dir></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Monext_Payline.csv" hash="b972d5544df49c367f96e7fecc2ec3eb"/></dir><dir name="fr_FR"><file name="Monext_Payline.csv" hash="f32aeede40718e91cc4ff927f05f93e1"/></dir></target><target name="mageetc"><dir name="modules"><file name="Monext_Payline.xml" hash="d6ff98113ab17d2b19ee89d7a80cf7e9"/></dir></target></contents>
18
  <compatible/>
19
  <dependencies><required><php><min>5.0.0</min><max>6.0.0</max></php></required></dependencies>
20
  </package>