Payline - Version 1.8.5.1

Version Notes

Distinction des commandes dont le paiement est en attente

Download this release

Release Info

Developer Payline
Extension Payline
Version 1.8.5.1
Comparing to
See all releases


Code changes from version 1.8.5 to 1.8.5.1

Files changed (133) hide show
  1. app/code/community/Monext/Payline/.DS_Store +0 -0
  2. app/code/community/Monext/Payline/Block/Adminhtml/Customer/Grid.php +199 -199
  3. app/code/community/Monext/Payline/Block/Adminhtml/Managecontracts.php +57 -57
  4. app/code/community/Monext/Payline/Block/Adminhtml/Managecontracts/Edit.php +28 -28
  5. app/code/community/Monext/Payline/Block/Adminhtml/Managecontracts/Edit/Form.php +96 -96
  6. app/code/community/Monext/Payline/Block/Adminhtml/Managecontracts/Grid.php +175 -175
  7. app/code/community/Monext/Payline/Block/Adminhtml/Manageproductcategories.php +59 -59
  8. app/code/community/Monext/Payline/Block/Adminhtml/Manageproductcategories/Assign/Form.php +73 -73
  9. app/code/community/Monext/Payline/Block/Adminhtml/Manageproductcategories/Grid.php +96 -96
  10. app/code/community/Monext/Payline/Block/Adminhtml/Sales/Order/Creditmemo/Create/Items.php +59 -59
  11. app/code/community/Monext/Payline/Block/Adminhtml/Sales/Order/Total/Nxfees.php +38 -38
  12. app/code/community/Monext/Payline/Block/Adminhtml/System/Config/Fieldset/Group.php +57 -57
  13. app/code/community/Monext/Payline/Block/Adminhtml/System/Config/Fieldset/Payment.php +99 -99
  14. app/code/community/Monext/Payline/Block/Adminhtml/System/Config/Fieldset/Welcome.php +97 -97
  15. app/code/community/Monext/Payline/Block/Adminhtml/System/Config/Form/Field/Contracts.php +132 -132
  16. app/code/community/Monext/Payline/Block/Adminhtml/System/Config/Html/Onoffswitch.php +30 -30
  17. app/code/community/Monext/Payline/Block/Checkout/Head.php +13 -13
  18. app/code/community/Monext/Payline/Block/Checkout/Total.php +20 -20
  19. app/code/community/Monext/Payline/Block/Checkout/Widget/Header.php +14 -14
  20. app/code/community/Monext/Payline/Block/Checkout/Widget/Opcheckout.php +116 -116
  21. app/code/community/Monext/Payline/Block/Cpt.php +0 -0
  22. app/code/community/Monext/Payline/Block/Direct.php +1 -1
  23. app/code/community/Monext/Payline/Block/Info/Default.php +12 -12
  24. app/code/community/Monext/Payline/Block/Info/Direct.php +54 -54
  25. app/code/community/Monext/Payline/Block/Logo.php +15 -15
  26. app/code/community/Monext/Payline/Block/Nx.php +0 -0
  27. app/code/community/Monext/Payline/Block/Wallet.php +23 -23
  28. app/code/community/Monext/Payline/Block/Wallet/Checkoutbtn.php +27 -27
  29. app/code/community/Monext/Payline/Block/Wallet/Details.php +20 -20
  30. app/code/community/Monext/Payline/Block/Wallet/Infos.php +37 -37
  31. app/code/community/Monext/Payline/Block/Wallet/Sidebar.php +131 -131
  32. app/code/community/Monext/Payline/Helper/Category.php +42 -42
  33. app/code/community/Monext/Payline/Helper/Data.php +0 -0
  34. app/code/community/Monext/Payline/Helper/Logger.php +65 -65
  35. app/code/community/Monext/Payline/Helper/Payment.php +557 -557
  36. app/code/community/Monext/Payline/Helper/Widget.php +110 -110
  37. app/code/community/Monext/Payline/Model/.DS_Store +0 -0
  38. app/code/community/Monext/Payline/Model/Adminhtml/System/Config/Backend/Common.php +28 -28
  39. app/code/community/Monext/Payline/Model/Adminhtml/System/Config/Backend/Contract.php +40 -40
  40. app/code/community/Monext/Payline/Model/Adminhtml/System/Config/Backend/Enabled.php +22 -22
  41. app/code/community/Monext/Payline/Model/Adminhtml/System/Config/Source/Environment.php +34 -34
  42. app/code/community/Monext/Payline/Model/Contract.php +14 -14
  43. app/code/community/Monext/Payline/Model/Contract/Status.php +14 -14
  44. app/code/community/Monext/Payline/Model/Cpt.php +2 -2
  45. app/code/community/Monext/Payline/Model/Datasource/Actions.php +0 -0
  46. app/code/community/Monext/Payline/Model/Datasource/Billingcycles.php +0 -0
  47. app/code/community/Monext/Payline/Model/Datasource/Billingoccurrences.php +0 -0
  48. app/code/community/Monext/Payline/Model/Datasource/Capturepaymentoptions.php +42 -42
  49. app/code/community/Monext/Payline/Model/Datasource/Cms/Block.php +32 -32
  50. app/code/community/Monext/Payline/Model/Datasource/Costs.php +0 -0
  51. app/code/community/Monext/Payline/Model/Datasource/Datatemplate.php +17 -17
  52. app/code/community/Monext/Payline/Model/Datasource/Environment.php +16 -16
  53. app/code/community/Monext/Payline/Model/Datasource/Languages.php +0 -0
  54. app/code/community/Monext/Payline/Model/Datasource/Paylineproductcategories.php +46 -46
  55. app/code/community/Monext/Payline/Model/Datasource/Paymentactions.php +0 -0
  56. app/code/community/Monext/Payline/Model/Datasource/Paymentactionsreauth.php +14 -14
  57. app/code/community/Monext/Payline/Model/Datasource/Return.php +0 -0
  58. app/code/community/Monext/Payline/Model/Datasource/Securitymodes.php +0 -0
  59. app/code/community/Monext/Payline/Model/Datasource/Shippingmethods.php +21 -21
  60. app/code/community/Monext/Payline/Model/Datasource/Status.php +40 -40
  61. app/code/community/Monext/Payline/Model/Datasource/Status/Canceled.php +11 -11
  62. app/code/community/Monext/Payline/Model/Datasource/Status/Invoice.php +40 -40
  63. app/code/community/Monext/Payline/Model/Datasource/Statusrowempty.php +45 -45
  64. app/code/community/Monext/Payline/Model/Datasource/Walletsecurity.php +16 -16
  65. app/code/community/Monext/Payline/Model/Datasource/Widgettemplate.php +16 -16
  66. app/code/community/Monext/Payline/Model/Direct.php +19 -19
  67. app/code/community/Monext/Payline/Model/Fees.php +14 -14
  68. app/code/community/Monext/Payline/Model/Mysql4/Contract.php +137 -137
  69. app/code/community/Monext/Payline/Model/Mysql4/Contract/Collection.php +111 -111
  70. app/code/community/Monext/Payline/Model/Mysql4/Contract/Status.php +279 -279
  71. app/code/community/Monext/Payline/Model/Mysql4/Contract/Status/Collection.php +13 -13
  72. app/code/community/Monext/Payline/Model/Mysql4/Fees.php +13 -13
  73. app/code/community/Monext/Payline/Model/Mysql4/Fees/Collection.php +12 -12
  74. app/code/community/Monext/Payline/Model/Mysql4/Productcategories.php +13 -13
  75. app/code/community/Monext/Payline/Model/Mysql4/Productcategories/Collection.php +35 -35
  76. app/code/community/Monext/Payline/Model/Mysql4/Token.php +13 -13
  77. app/code/community/Monext/Payline/Model/Mysql4/Token/Collection.php +12 -12
  78. app/code/community/Monext/Payline/Model/Nx.php +0 -0
  79. app/code/community/Monext/Payline/Model/Observer.php +523 -523
  80. app/code/community/Monext/Payline/Model/Order/Invoice.php +31 -31
  81. app/code/community/Monext/Payline/Model/Order/Payment.php +55 -55
  82. app/code/community/Monext/Payline/Model/Productcategories.php +22 -22
  83. app/code/community/Monext/Payline/Model/Resource/Eav/Mysql4/Setup.php +26 -26
  84. app/code/community/Monext/Payline/Model/Session.php +33 -33
  85. app/code/community/Monext/Payline/Model/Token.php +14 -14
  86. app/code/community/Monext/Payline/Model/Total/Nx/Invoice.php +23 -23
  87. app/code/community/Monext/Payline/Model/Total/Nx/Quote.php +87 -87
  88. app/code/community/Monext/Payline/Model/Wallet.php +242 -242
  89. app/code/community/Monext/Payline/controllers/Adminhtml/Payline/ManagecontractsController.php +244 -244
  90. app/code/community/Monext/Payline/controllers/Adminhtml/Payline/ManageproductcategoriesController.php +114 -114
  91. app/code/community/Monext/Payline/controllers/CheckoutonepageController.php +172 -172
  92. app/code/community/Monext/Payline/controllers/IndexController.php +21 -4
  93. app/code/community/Monext/Payline/controllers/UnloggedwalletController.php +114 -114
  94. app/code/community/Monext/Payline/controllers/WalletController.php +296 -296
  95. app/code/community/Monext/Payline/etc/adminhtml.xml +0 -0
  96. app/code/community/Monext/Payline/etc/config.xml +1 -1
  97. app/code/community/Monext/Payline/etc/system.xml +13 -2
  98. app/code/community/Monext/Payline/lib/PaylineByMonext.wsdl +168 -168
  99. app/code/community/Monext/Payline/lib/paylineSDK.php +2053 -2053
  100. app/code/community/Monext/Payline/lib/v4.44.wsdl +3452 -3452
  101. app/code/community/Monext/Payline/sql/payline_setup/mysql4-install-1.6.0.php +65 -65
  102. app/code/community/Monext/Payline/sql/payline_setup/mysql4-upgrade-1.7.2-1.7.3.php +87 -87
  103. app/code/community/Monext/Payline/sql/payline_setup/mysql4-upgrade-1.7.5-1.7.6.php +16 -16
  104. app/code/community/Monext/Payline/sql/payline_setup/mysql4-upgrade-1.7.7-1.8.1.php +0 -0
  105. app/code/community/Monext/Payline/sql/payline_setup/mysql4-upgrade-1.8.1-1.8.3.php +18 -18
  106. app/code/community/Monext/Payline/sql/payline_setup/mysql4-upgrade-1.8.3.1-1.8.4.php +23 -23
  107. app/design/adminhtml/base/default/layout/payline.xml +75 -75
  108. app/design/adminhtml/base/default/template/payline/Cpt.phtml +0 -0
  109. app/design/adminhtml/base/default/template/payline/Direct.phtml +0 -0
  110. app/design/adminhtml/base/default/template/payline/Payline.phtml +0 -0
  111. app/design/adminhtml/base/default/template/payline/assignProductCategories.phtml +20 -20
  112. app/design/adminhtml/base/default/template/payline/contracts.phtml +21 -21
  113. app/design/adminhtml/base/default/template/payline/customer/tab/view.phtml +61 -61
  114. app/design/adminhtml/base/default/template/payline/payment/info/monext.phtml +21 -21
  115. app/design/adminhtml/base/default/template/payline/productcategories.phtml +18 -18
  116. app/design/adminhtml/base/default/template/payline/switcher.phtml +17 -17
  117. app/design/adminhtml/base/default/template/payline/system/config/fieldset/welcome.phtml +46 -46
  118. app/design/adminhtml/base/default/template/payline/system/config/form/field/array.phtml +105 -105
  119. app/design/adminhtml/base/default/template/payline/wallet/form.phtml +0 -0
  120. app/design/frontend/base/default/layout/payline.xml +211 -211
  121. app/design/frontend/base/default/template/payline/Cpt.phtml +0 -0
  122. app/design/frontend/base/default/template/payline/Direct.phtml +0 -0
  123. app/design/frontend/base/default/template/payline/Payline.phtml +0 -0
  124. app/design/frontend/base/default/template/payline/checkout/directsecurized.phtml +25 -25
  125. app/design/frontend/base/default/template/payline/checkout/onepage.phtml +30 -30
  126. app/design/frontend/base/default/template/payline/checkout/onepage/info/default.phtml +18 -18
  127. app/design/frontend/base/default/template/payline/checkout/onepage/payment/methods.phtml +73 -73
  128. app/design/frontend/base/default/template/payline/checkout/onepage/progress/order.phtml +4 -4
  129. app/design/frontend/base/default/template/payline/checkout/onepage/shipping-method.phtml +20 -20
  130. app/design/frontend/base/default/template/payline/checkout/onepage/widget-opcheckout-js-init.phtml +93 -93
  131. app/design/frontend/base/default/template/payline/checkout/onepage/widget-opcheckout-js-update.phtml +13 -13
  132. app/design/frontend/base/default/template/payline/checkout/onepage/widget-opcheckout-js.phtml +94 -94
  133. app/design/frontend/base/default/template/payline/checkout/onepage/widget-update.phtml +6 -13
app/code/community/Monext/Payline/.DS_Store CHANGED
File without changes
app/code/community/Monext/Payline/Block/Adminhtml/Customer/Grid.php CHANGED
@@ -1,200 +1,200 @@
1
- <?php
2
- /*
3
- * $Id: Grid.php 27 2012-01-24 09:56:23Z cesav $
4
- * $HeadURL: https://sources.mpl.intranet/svn/monext/trunk/Payline/Monext/Payline/Block/Adminhtml/Customer/Grid.php $
5
- *
6
- */
7
-
8
- class Monext_Payline_Block_Adminhtml_Customer_Grid extends Mage_Adminhtml_Block_Widget_Grid
9
- {
10
- public function __construct()
11
- {
12
- parent::__construct();
13
- $this->setId('customerGrid');
14
- $this->setUseAjax(true);
15
- $this->setDefaultSort('entity_id');
16
- $this->setSaveParametersInSession(true);
17
- }
18
-
19
- protected function _prepareCollection()
20
- {
21
- $collection = Mage::getResourceModel('customer/customer_collection')
22
- ->addNameToSelect()
23
- ->addAttributeToSelect('email')
24
- ->addAttributeToSelect('created_at')
25
- ->addAttributeToSelect('group_id')
26
- ->addAttributeToSelect('wallet_id')
27
- ->joinAttribute('billing_postcode', 'customer_address/postcode', 'default_billing', null, 'left')
28
- ->joinAttribute('billing_city', 'customer_address/city', 'default_billing', null, 'left')
29
- ->joinAttribute('billing_telephone', 'customer_address/telephone', 'default_billing', null, 'left')
30
- ->joinAttribute('billing_region', 'customer_address/region', 'default_billing', null, 'left')
31
- ->joinAttribute('billing_country_id', 'customer_address/country_id', 'default_billing', null, 'left');
32
-
33
- $this->setCollection($collection);
34
-
35
- return parent::_prepareCollection();
36
- }
37
-
38
- protected function _prepareColumns()
39
- {
40
- $this->addColumn('entity_id', array(
41
- 'header' => Mage::helper('customer')->__('ID'),
42
- 'width' => '50px',
43
- 'index' => 'entity_id',
44
- 'type' => 'number',
45
- ));
46
- /*$this->addColumn('firstname', array(
47
- 'header' => Mage::helper('customer')->__('First Name'),
48
- 'index' => 'firstname'
49
- ));
50
- $this->addColumn('lastname', array(
51
- 'header' => Mage::helper('customer')->__('Last Name'),
52
- 'index' => 'lastname'
53
- ));*/
54
- $this->addColumn('name', array(
55
- 'header' => Mage::helper('customer')->__('Name'),
56
- 'index' => 'name'
57
- ));
58
- $this->addColumn('email', array(
59
- 'header' => Mage::helper('customer')->__('Email'),
60
- 'width' => '150',
61
- 'index' => 'email'
62
- ));
63
- $this->addColumn('wallet_id', array(
64
- 'header' => Mage::helper('payline')->__('Wallet Payline'),
65
- 'width' => '150',
66
- 'index' => 'wallet_id'
67
- ));
68
-
69
- $groups = Mage::getResourceModel('customer/group_collection')
70
- ->addFieldToFilter('customer_group_id', array('gt'=> 0))
71
- ->load()
72
- ->toOptionHash();
73
-
74
- $this->addColumn('group', array(
75
- 'header' => Mage::helper('customer')->__('Group'),
76
- 'width' => '100',
77
- 'index' => 'group_id',
78
- 'type' => 'options',
79
- 'options' => $groups,
80
- ));
81
-
82
- $this->addColumn('Telephone', array(
83
- 'header' => Mage::helper('customer')->__('Telephone'),
84
- 'width' => '100',
85
- 'index' => 'billing_telephone'
86
- ));
87
-
88
- $this->addColumn('billing_postcode', array(
89
- 'header' => Mage::helper('customer')->__('ZIP'),
90
- 'width' => '90',
91
- 'index' => 'billing_postcode',
92
- ));
93
-
94
- $this->addColumn('billing_country_id', array(
95
- 'header' => Mage::helper('customer')->__('Country'),
96
- 'width' => '100',
97
- 'type' => 'country',
98
- 'index' => 'billing_country_id',
99
- ));
100
-
101
- $this->addColumn('billing_region', array(
102
- 'header' => Mage::helper('customer')->__('State/Province'),
103
- 'width' => '100',
104
- 'index' => 'billing_region',
105
- ));
106
-
107
- $this->addColumn('customer_since', array(
108
- 'header' => Mage::helper('customer')->__('Customer Since'),
109
- 'type' => 'datetime',
110
- 'align' => 'center',
111
- 'index' => 'created_at',
112
- 'gmtoffset' => true
113
- ));
114
-
115
- if (!Mage::app()->isSingleStoreMode()) {
116
- $this->addColumn('website_id', array(
117
- 'header' => Mage::helper('customer')->__('Website'),
118
- 'align' => 'center',
119
- 'width' => '80px',
120
- 'type' => 'options',
121
- 'options' => Mage::getSingleton('adminhtml/system_store')->getWebsiteOptionHash(true),
122
- 'index' => 'website_id',
123
- ));
124
- }
125
-
126
- $this->addColumn('action',
127
- array(
128
- 'header' => Mage::helper('customer')->__('Action'),
129
- 'width' => '100',
130
- 'type' => 'action',
131
- 'getter' => 'getId',
132
- 'actions' => array(
133
- array(
134
- 'caption' => Mage::helper('customer')->__('Edit'),
135
- 'url' => array('base'=> '*/*/edit'),
136
- 'field' => 'id'
137
- )
138
- ),
139
- 'filter' => false,
140
- 'sortable' => false,
141
- 'index' => 'stores',
142
- 'is_system' => true,
143
- ));
144
-
145
- $this->addExportType('*/*/exportCsv', Mage::helper('customer')->__('CSV'));
146
- $this->addExportType('*/*/exportXml', Mage::helper('customer')->__('Excel XML'));
147
- return parent::_prepareColumns();
148
- }
149
-
150
- protected function _prepareMassaction()
151
- {
152
- $this->setMassactionIdField('entity_id');
153
- $this->getMassactionBlock()->setFormFieldName('customer');
154
-
155
- $this->getMassactionBlock()->addItem('delete', array(
156
- 'label' => Mage::helper('customer')->__('Delete'),
157
- 'url' => $this->getUrl('*/*/massDelete'),
158
- 'confirm' => Mage::helper('customer')->__('Are you sure?')
159
- ));
160
-
161
- $this->getMassactionBlock()->addItem('newsletter_subscribe', array(
162
- 'label' => Mage::helper('customer')->__('Subscribe to Newsletter'),
163
- 'url' => $this->getUrl('*/*/massSubscribe')
164
- ));
165
-
166
- $this->getMassactionBlock()->addItem('newsletter_unsubscribe', array(
167
- 'label' => Mage::helper('customer')->__('Unsubscribe from Newsletter'),
168
- 'url' => $this->getUrl('*/*/massUnsubscribe')
169
- ));
170
-
171
- $groups = $this->helper('customer')->getGroups()->toOptionArray();
172
-
173
- array_unshift($groups, array('label'=> '', 'value'=> ''));
174
- $this->getMassactionBlock()->addItem('assign_group', array(
175
- 'label' => Mage::helper('customer')->__('Assign a Customer Group'),
176
- 'url' => $this->getUrl('*/*/massAssignGroup'),
177
- 'additional' => array(
178
- 'visibility' => array(
179
- 'name' => 'group',
180
- 'type' => 'select',
181
- 'class' => 'required-entry',
182
- 'label' => Mage::helper('customer')->__('Group'),
183
- 'values' => $groups
184
- )
185
- )
186
- ));
187
-
188
- return $this;
189
- }
190
-
191
- public function getGridUrl()
192
- {
193
- return $this->getUrl('*/*/grid', array('_current'=> true));
194
- }
195
-
196
- public function getRowUrl($row)
197
- {
198
- return $this->getUrl('*/*/edit', array('id'=>$row->getId()));
199
- }
200
  }
1
+ <?php
2
+ /*
3
+ * $Id: Grid.php 27 2012-01-24 09:56:23Z cesav $
4
+ * $HeadURL: https://sources.mpl.intranet/svn/monext/trunk/Payline/Monext/Payline/Block/Adminhtml/Customer/Grid.php $
5
+ *
6
+ */
7
+
8
+ class Monext_Payline_Block_Adminhtml_Customer_Grid extends Mage_Adminhtml_Block_Widget_Grid
9
+ {
10
+ public function __construct()
11
+ {
12
+ parent::__construct();
13
+ $this->setId('customerGrid');
14
+ $this->setUseAjax(true);
15
+ $this->setDefaultSort('entity_id');
16
+ $this->setSaveParametersInSession(true);
17
+ }
18
+
19
+ protected function _prepareCollection()
20
+ {
21
+ $collection = Mage::getResourceModel('customer/customer_collection')
22
+ ->addNameToSelect()
23
+ ->addAttributeToSelect('email')
24
+ ->addAttributeToSelect('created_at')
25
+ ->addAttributeToSelect('group_id')
26
+ ->addAttributeToSelect('wallet_id')
27
+ ->joinAttribute('billing_postcode', 'customer_address/postcode', 'default_billing', null, 'left')
28
+ ->joinAttribute('billing_city', 'customer_address/city', 'default_billing', null, 'left')
29
+ ->joinAttribute('billing_telephone', 'customer_address/telephone', 'default_billing', null, 'left')
30
+ ->joinAttribute('billing_region', 'customer_address/region', 'default_billing', null, 'left')
31
+ ->joinAttribute('billing_country_id', 'customer_address/country_id', 'default_billing', null, 'left');
32
+
33
+ $this->setCollection($collection);
34
+
35
+ return parent::_prepareCollection();
36
+ }
37
+
38
+ protected function _prepareColumns()
39
+ {
40
+ $this->addColumn('entity_id', array(
41
+ 'header' => Mage::helper('customer')->__('ID'),
42
+ 'width' => '50px',
43
+ 'index' => 'entity_id',
44
+ 'type' => 'number',
45
+ ));
46
+ /*$this->addColumn('firstname', array(
47
+ 'header' => Mage::helper('customer')->__('First Name'),
48
+ 'index' => 'firstname'
49
+ ));
50
+ $this->addColumn('lastname', array(
51
+ 'header' => Mage::helper('customer')->__('Last Name'),
52
+ 'index' => 'lastname'
53
+ ));*/
54
+ $this->addColumn('name', array(
55
+ 'header' => Mage::helper('customer')->__('Name'),
56
+ 'index' => 'name'
57
+ ));
58
+ $this->addColumn('email', array(
59
+ 'header' => Mage::helper('customer')->__('Email'),
60
+ 'width' => '150',
61
+ 'index' => 'email'
62
+ ));
63
+ $this->addColumn('wallet_id', array(
64
+ 'header' => Mage::helper('payline')->__('Wallet Payline'),
65
+ 'width' => '150',
66
+ 'index' => 'wallet_id'
67
+ ));
68
+
69
+ $groups = Mage::getResourceModel('customer/group_collection')
70
+ ->addFieldToFilter('customer_group_id', array('gt'=> 0))
71
+ ->load()
72
+ ->toOptionHash();
73
+
74
+ $this->addColumn('group', array(
75
+ 'header' => Mage::helper('customer')->__('Group'),
76
+ 'width' => '100',
77
+ 'index' => 'group_id',
78
+ 'type' => 'options',
79
+ 'options' => $groups,
80
+ ));
81
+
82
+ $this->addColumn('Telephone', array(
83
+ 'header' => Mage::helper('customer')->__('Telephone'),
84
+ 'width' => '100',
85
+ 'index' => 'billing_telephone'
86
+ ));
87
+
88
+ $this->addColumn('billing_postcode', array(
89
+ 'header' => Mage::helper('customer')->__('ZIP'),
90
+ 'width' => '90',
91
+ 'index' => 'billing_postcode',
92
+ ));
93
+
94
+ $this->addColumn('billing_country_id', array(
95
+ 'header' => Mage::helper('customer')->__('Country'),
96
+ 'width' => '100',
97
+ 'type' => 'country',
98
+ 'index' => 'billing_country_id',
99
+ ));
100
+
101
+ $this->addColumn('billing_region', array(
102
+ 'header' => Mage::helper('customer')->__('State/Province'),
103
+ 'width' => '100',
104
+ 'index' => 'billing_region',
105
+ ));
106
+
107
+ $this->addColumn('customer_since', array(
108
+ 'header' => Mage::helper('customer')->__('Customer Since'),
109
+ 'type' => 'datetime',
110
+ 'align' => 'center',
111
+ 'index' => 'created_at',
112
+ 'gmtoffset' => true
113
+ ));
114
+
115
+ if (!Mage::app()->isSingleStoreMode()) {
116
+ $this->addColumn('website_id', array(
117
+ 'header' => Mage::helper('customer')->__('Website'),
118
+ 'align' => 'center',
119
+ 'width' => '80px',
120
+ 'type' => 'options',
121
+ 'options' => Mage::getSingleton('adminhtml/system_store')->getWebsiteOptionHash(true),
122
+ 'index' => 'website_id',
123
+ ));
124
+ }
125
+
126
+ $this->addColumn('action',
127
+ array(
128
+ 'header' => Mage::helper('customer')->__('Action'),
129
+ 'width' => '100',
130
+ 'type' => 'action',
131
+ 'getter' => 'getId',
132
+ 'actions' => array(
133
+ array(
134
+ 'caption' => Mage::helper('customer')->__('Edit'),
135
+ 'url' => array('base'=> '*/*/edit'),
136
+ 'field' => 'id'
137
+ )
138
+ ),
139
+ 'filter' => false,
140
+ 'sortable' => false,
141
+ 'index' => 'stores',
142
+ 'is_system' => true,
143
+ ));
144
+
145
+ $this->addExportType('*/*/exportCsv', Mage::helper('customer')->__('CSV'));
146
+ $this->addExportType('*/*/exportXml', Mage::helper('customer')->__('Excel XML'));
147
+ return parent::_prepareColumns();
148
+ }
149
+
150
+ protected function _prepareMassaction()
151
+ {
152
+ $this->setMassactionIdField('entity_id');
153
+ $this->getMassactionBlock()->setFormFieldName('customer');
154
+
155
+ $this->getMassactionBlock()->addItem('delete', array(
156
+ 'label' => Mage::helper('customer')->__('Delete'),
157
+ 'url' => $this->getUrl('*/*/massDelete'),
158
+ 'confirm' => Mage::helper('customer')->__('Are you sure?')
159
+ ));
160
+
161
+ $this->getMassactionBlock()->addItem('newsletter_subscribe', array(
162
+ 'label' => Mage::helper('customer')->__('Subscribe to Newsletter'),
163
+ 'url' => $this->getUrl('*/*/massSubscribe')
164
+ ));
165
+
166
+ $this->getMassactionBlock()->addItem('newsletter_unsubscribe', array(
167
+ 'label' => Mage::helper('customer')->__('Unsubscribe from Newsletter'),
168
+ 'url' => $this->getUrl('*/*/massUnsubscribe')
169
+ ));
170
+
171
+ $groups = $this->helper('customer')->getGroups()->toOptionArray();
172
+
173
+ array_unshift($groups, array('label'=> '', 'value'=> ''));
174
+ $this->getMassactionBlock()->addItem('assign_group', array(
175
+ 'label' => Mage::helper('customer')->__('Assign a Customer Group'),
176
+ 'url' => $this->getUrl('*/*/massAssignGroup'),
177
+ 'additional' => array(
178
+ 'visibility' => array(
179
+ 'name' => 'group',
180
+ 'type' => 'select',
181
+ 'class' => 'required-entry',
182
+ 'label' => Mage::helper('customer')->__('Group'),
183
+ 'values' => $groups
184
+ )
185
+ )
186
+ ));
187
+
188
+ return $this;
189
+ }
190
+
191
+ public function getGridUrl()
192
+ {
193
+ return $this->getUrl('*/*/grid', array('_current'=> true));
194
+ }
195
+
196
+ public function getRowUrl($row)
197
+ {
198
+ return $this->getUrl('*/*/edit', array('id'=>$row->getId()));
199
+ }
200
  }
app/code/community/Monext/Payline/Block/Adminhtml/Managecontracts.php CHANGED
@@ -1,57 +1,57 @@
1
- <?php
2
-
3
- class Monext_Payline_Block_Adminhtml_Managecontracts extends Mage_Adminhtml_Block_Widget_Container
4
- {
5
-
6
- /**
7
- * Set template
8
- */
9
- public function __construct()
10
- {
11
- parent::__construct();
12
- $this->setTemplate('payline/contracts.phtml');
13
- }
14
-
15
- /**
16
- * Prepare button and grid
17
- *
18
- * @return Monext_Payline_Block_Adminhtml_Managecontracts
19
- */
20
- protected function _prepareLayout()
21
- {
22
- $this->_removeButton('add');
23
-
24
- $this->_addButton('import_contract', array(
25
- 'label' => Mage::helper('payline')->__('Import contracts'),
26
- 'onclick' => "setLocation('".$this->getUrl('*/*/import')."')",
27
- 'class' => 'add')
28
- );
29
-
30
- $this->setChild('grid', $this->getLayout()->createBlock('payline/adminhtml_managecontracts_grid', 'contract.grid'));
31
- return parent::_prepareLayout();
32
- }
33
-
34
-
35
- /**
36
- * Render grid
37
- *
38
- * @return string
39
- */
40
- public function getGridHtml()
41
- {
42
- return $this->getChildHtml('grid');
43
- }
44
-
45
- /**
46
- * Check whether it is single store mode
47
- *
48
- * @return bool
49
- */
50
- public function isSingleStoreMode()
51
- {
52
- if (!Mage::app()->isSingleStoreMode()) {
53
- return false;
54
- }
55
- return true;
56
- }
57
- }
1
+ <?php
2
+
3
+ class Monext_Payline_Block_Adminhtml_Managecontracts extends Mage_Adminhtml_Block_Widget_Container
4
+ {
5
+
6
+ /**
7
+ * Set template
8
+ */
9
+ public function __construct()
10
+ {
11
+ parent::__construct();
12
+ $this->setTemplate('payline/contracts.phtml');
13
+ }
14
+
15
+ /**
16
+ * Prepare button and grid
17
+ *
18
+ * @return Monext_Payline_Block_Adminhtml_Managecontracts
19
+ */
20
+ protected function _prepareLayout()
21
+ {
22
+ $this->_removeButton('add');
23
+
24
+ $this->_addButton('import_contract', array(
25
+ 'label' => Mage::helper('payline')->__('Import contracts'),
26
+ 'onclick' => "setLocation('".$this->getUrl('*/*/import')."')",
27
+ 'class' => 'add')
28
+ );
29
+
30
+ $this->setChild('grid', $this->getLayout()->createBlock('payline/adminhtml_managecontracts_grid', 'contract.grid'));
31
+ return parent::_prepareLayout();
32
+ }
33
+
34
+
35
+ /**
36
+ * Render grid
37
+ *
38
+ * @return string
39
+ */
40
+ public function getGridHtml()
41
+ {
42
+ return $this->getChildHtml('grid');
43
+ }
44
+
45
+ /**
46
+ * Check whether it is single store mode
47
+ *
48
+ * @return bool
49
+ */
50
+ public function isSingleStoreMode()
51
+ {
52
+ if (!Mage::app()->isSingleStoreMode()) {
53
+ return false;
54
+ }
55
+ return true;
56
+ }
57
+ }
app/code/community/Monext/Payline/Block/Adminhtml/Managecontracts/Edit.php CHANGED
@@ -1,28 +1,28 @@
1
- <?php
2
-
3
- class Monext_Payline_Block_Adminhtml_Managecontracts_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
4
- {
5
- public function __construct()
6
- {
7
- $this->_objectId = 'id';
8
- $this->_blockGroup = 'payline';
9
- $this->_controller = 'adminhtml_managecontracts';
10
-
11
- parent::__construct();
12
-
13
- $this->setData('form_action_url', Mage::getUrl('*/payline_managecontracts/save'));
14
-
15
- $this->_updateButton('save', 'label', Mage::helper('payline')->__('Save contract'));
16
- $this->_removeButton('delete');
17
- }
18
-
19
- /**
20
- * Get edit form container header text
21
- *
22
- * @return string
23
- */
24
- public function getHeaderText()
25
- {
26
- return Mage::helper('payline')->__('Edit contract');
27
- }
28
- }
1
+ <?php
2
+
3
+ class Monext_Payline_Block_Adminhtml_Managecontracts_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
4
+ {
5
+ public function __construct()
6
+ {
7
+ $this->_objectId = 'id';
8
+ $this->_blockGroup = 'payline';
9
+ $this->_controller = 'adminhtml_managecontracts';
10
+
11
+ parent::__construct();
12
+
13
+ $this->setData('form_action_url', Mage::getUrl('*/payline_managecontracts/save'));
14
+
15
+ $this->_updateButton('save', 'label', Mage::helper('payline')->__('Save contract'));
16
+ $this->_removeButton('delete');
17
+ }
18
+
19
+ /**
20
+ * Get edit form container header text
21
+ *
22
+ * @return string
23
+ */
24
+ public function getHeaderText()
25
+ {
26
+ return Mage::helper('payline')->__('Edit contract');
27
+ }
28
+ }
app/code/community/Monext/Payline/Block/Adminhtml/Managecontracts/Edit/Form.php CHANGED
@@ -1,79 +1,79 @@
1
- <?php
2
-
3
- class Monext_Payline_Block_Adminhtml_Managecontracts_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
4
- {
5
- /**
6
- * Init form
7
- */
8
- public function __construct()
9
- {
10
- parent::__construct();
11
- $this->setId('contract_form');
12
- $this->setTitle(Mage::helper('payline')->__('Contract Informations'));
13
- }
14
-
15
- protected function _prepareForm()
16
- {
17
- $model = Mage::registry('current_contract');
18
-
19
- $form = new Varien_Data_Form(array(
20
- 'id' => 'edit_form',
21
- 'action' => $this->getData('action'),
22
- 'method' => 'post',
23
- 'enctype' => 'multipart/form-data'
24
- ));
25
-
26
- /*************************************************************************************************************/
27
- /* Fieldset */
28
- /*************************************************************************************************************/
29
- $fieldset = $form->addFieldset('base_fieldset', array(
30
- 'legend' => Mage::helper('payline')->__('Contract Informations'),
31
- 'class' => 'fieldset-wide'
32
- ));
33
-
34
-
35
- $fieldset->addField('name', 'text', array(
36
- 'name' => 'name',
37
- 'label' => Mage::helper('payline')->__('Name'),
38
- 'title' => Mage::helper('payline')->__('Name'),
39
- 'required' => true,
40
- 'disabled' => true
41
- ));
42
-
43
- $fieldset->addField('number', 'text', array(
44
- 'name' => 'number',
45
- 'label' => Mage::helper('payline')->__('Number'),
46
- 'title' => Mage::helper('payline')->__('Number'),
47
- 'required' => true,
48
- 'disabled' => true
49
- ));
50
-
51
- $fieldset->addField('point_of_sell', 'text', array(
52
- 'name' => 'point_of_sell',
53
- 'label' => Mage::helper('payline')->__('Point Of Sell'),
54
- 'title' => Mage::helper('payline')->__('Point Of Sell'),
55
- 'required' => true,
56
- 'disabled' => true
57
- ));
58
-
59
- $fieldset->addField('is_primary', 'checkbox', array(
60
- 'name' => 'is_primary',
61
- 'label' => Mage::helper('payline')->__('Primary'),
62
- 'title' => Mage::helper('payline')->__('Primary'),
63
- 'required' => false,
64
- 'checked' => ($model->getIsPrimary() ? true : false),
65
- 'onclick' => 'this.value = this.checked ? 1 : 0'
66
- ));
67
-
68
- $fieldset->addField('is_secondary', 'checkbox', array(
69
- 'name' => 'is_secondary',
70
- 'label' => Mage::helper('payline')->__('Secondary'),
71
- 'title' => Mage::helper('payline')->__('Secondary'),
72
- 'required' => false,
73
- 'checked' => ($model->getIsSecondary() ? true : false),
74
- 'onclick' => 'this.value = this.checked ? 1 : 0'
75
- ));
76
-
77
 
78
  $fieldset->addField('is_secure', 'checkbox', array(
79
  'name' => 'is_secure',
@@ -82,24 +82,24 @@ class Monext_Payline_Block_Adminhtml_Managecontracts_Edit_Form extends Mage_Admi
82
  'required' => false,
83
  'checked' => ($model->getIsSecure() ? true : false),
84
  'onclick' => 'this.value = this.checked ? 1 : 0'
85
- ));
86
-
87
- /*************************************************************************************************************/
88
- /* Id */
89
- /*************************************************************************************************************/
90
-
91
- // Process id is transmitted when editting processes
92
- if ($model->getId()) {
93
- $fieldset->addField('id', 'hidden', array(
94
- 'name' => 'id',
95
- ));
96
- }
97
-
98
- $form->setValues($model->getData());
99
- $form->setUseContainer(true);
100
- $this->setForm($form);
101
-
102
- return parent::_prepareForm();
103
- }
104
-
105
  }
1
+ <?php
2
+
3
+ class Monext_Payline_Block_Adminhtml_Managecontracts_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
4
+ {
5
+ /**
6
+ * Init form
7
+ */
8
+ public function __construct()
9
+ {
10
+ parent::__construct();
11
+ $this->setId('contract_form');
12
+ $this->setTitle(Mage::helper('payline')->__('Contract Informations'));
13
+ }
14
+
15
+ protected function _prepareForm()
16
+ {
17
+ $model = Mage::registry('current_contract');
18
+
19
+ $form = new Varien_Data_Form(array(
20
+ 'id' => 'edit_form',
21
+ 'action' => $this->getData('action'),
22
+ 'method' => 'post',
23
+ 'enctype' => 'multipart/form-data'
24
+ ));
25
+
26
+ /*************************************************************************************************************/
27
+ /* Fieldset */
28
+ /*************************************************************************************************************/
29
+ $fieldset = $form->addFieldset('base_fieldset', array(
30
+ 'legend' => Mage::helper('payline')->__('Contract Informations'),
31
+ 'class' => 'fieldset-wide'
32
+ ));
33
+
34
+
35
+ $fieldset->addField('name', 'text', array(
36
+ 'name' => 'name',
37
+ 'label' => Mage::helper('payline')->__('Name'),
38
+ 'title' => Mage::helper('payline')->__('Name'),
39
+ 'required' => true,
40
+ 'disabled' => true
41
+ ));
42
+
43
+ $fieldset->addField('number', 'text', array(
44
+ 'name' => 'number',
45
+ 'label' => Mage::helper('payline')->__('Number'),
46
+ 'title' => Mage::helper('payline')->__('Number'),
47
+ 'required' => true,
48
+ 'disabled' => true
49
+ ));
50
+
51
+ $fieldset->addField('point_of_sell', 'text', array(
52
+ 'name' => 'point_of_sell',
53
+ 'label' => Mage::helper('payline')->__('Point Of Sell'),
54
+ 'title' => Mage::helper('payline')->__('Point Of Sell'),
55
+ 'required' => true,
56
+ 'disabled' => true
57
+ ));
58
+
59
+ $fieldset->addField('is_primary', 'checkbox', array(
60
+ 'name' => 'is_primary',
61
+ 'label' => Mage::helper('payline')->__('Primary'),
62
+ 'title' => Mage::helper('payline')->__('Primary'),
63
+ 'required' => false,
64
+ 'checked' => ($model->getIsPrimary() ? true : false),
65
+ 'onclick' => 'this.value = this.checked ? 1 : 0'
66
+ ));
67
+
68
+ $fieldset->addField('is_secondary', 'checkbox', array(
69
+ 'name' => 'is_secondary',
70
+ 'label' => Mage::helper('payline')->__('Secondary'),
71
+ 'title' => Mage::helper('payline')->__('Secondary'),
72
+ 'required' => false,
73
+ 'checked' => ($model->getIsSecondary() ? true : false),
74
+ 'onclick' => 'this.value = this.checked ? 1 : 0'
75
+ ));
76
+
77
 
78
  $fieldset->addField('is_secure', 'checkbox', array(
79
  'name' => 'is_secure',
82
  'required' => false,
83
  'checked' => ($model->getIsSecure() ? true : false),
84
  'onclick' => 'this.value = this.checked ? 1 : 0'
85
+ ));
86
+
87
+ /*************************************************************************************************************/
88
+ /* Id */
89
+ /*************************************************************************************************************/
90
+
91
+ // Process id is transmitted when editting processes
92
+ if ($model->getId()) {
93
+ $fieldset->addField('id', 'hidden', array(
94
+ 'name' => 'id',
95
+ ));
96
+ }
97
+
98
+ $form->setValues($model->getData());
99
+ $form->setUseContainer(true);
100
+ $this->setForm($form);
101
+
102
+ return parent::_prepareForm();
103
+ }
104
+
105
  }
app/code/community/Monext/Payline/Block/Adminhtml/Managecontracts/Grid.php CHANGED
@@ -1,89 +1,89 @@
1
- <?php
2
-
3
- class Monext_Payline_Block_Adminhtml_Managecontracts_Grid extends Mage_Adminhtml_Block_Widget_Grid
4
- {
5
-
6
- public function __construct()
7
- {
8
- parent::__construct();
9
- $this->setId('paylineManageContractsGrid');
10
- $this->setUseAjax(true);
11
- //$this->setVarNameFilter('contract_filter');
12
- $this->setDefaultLimit(50);
13
- }
14
-
15
- protected function _getStore()
16
- {
17
- $storeId = (int) $this->getRequest()->getParam('store', 0);
18
- return Mage::app()->getStore($storeId);
19
- }
20
-
21
-
22
- protected function _prepareCollection()
23
- {
24
- $collection = Mage::getModel('payline/contract')->getCollection();
25
- $store = $this->getRequest()->getParam('store', '');
26
- $website = $this->getRequest()->getParam('website', '');
27
- if($store) {
28
- $storeId = Mage::getModel('core/store')->load($store)->getId();
29
- $collection->addStoreFilter($storeId);
30
- } elseif ($website) {
31
- $websiteId = Mage::getModel('core/website')->load($website)->getId();
32
- $collection->addWebsiteFilter($websiteId);
33
- }
34
-
35
- $this->setCollection($collection);
36
-
37
- $temp = clone($collection);
38
- foreach($temp as $c) {
39
- if($c->getIsPrimary()) {
40
- $this->setDefaultFilter(array('point_of_sell'=>$c->getPointOfSell()));
41
- break;
42
- }
43
- }
44
-
45
- return parent::_prepareCollection();
46
- }
47
-
48
- protected function _prepareColumns()
49
- {
50
- $this->addColumn('name', array(
51
- 'header' => Mage::helper('payline')->__('Name'),
52
- 'index' => 'name',
53
- 'filter' => false,
54
- 'type' => 'text'
55
- ));
56
-
57
- $this->addColumn('number', array(
58
- 'header' => Mage::helper('payline')->__('Number'),
59
- 'index' => 'number',
60
- 'filter' => false,
61
- 'type' => 'text'
62
- ));
63
-
64
- $this->addColumn('point_of_sell', array(
65
- 'header' => Mage::helper('payline')->__('Point Of Sell'),
66
- 'index' => 'point_of_sell',
67
- 'type' => 'text',
68
- 'filter' => false
69
- ));
70
-
71
- $this->addColumn('is_primary', array(
72
- 'header' => Mage::helper('payline')->__('Primary'),
73
- 'index' => 'is_primary',
74
- 'type' => 'options',
75
- 'filter' => false,
76
- 'options' => array('1' => Mage::helper('payline')->__('X'), '0' => Mage::helper('payline')->__('-'))
77
- ));
78
-
79
- $this->addColumn('is_secondary', array(
80
- 'header' => Mage::helper('payline')->__('Secondary'),
81
- 'index' => 'is_secondary',
82
- 'type' => 'options',
83
- 'filter' => false,
84
- 'options' => array('1' => Mage::helper('payline')->__('X'), '0' => Mage::helper('payline')->__('-'))
85
- ));
86
-
87
 
88
  $this->addColumn('is_secure', array(
89
  'header' => Mage::helper('payline')->__('Secure'),
@@ -91,78 +91,78 @@ class Monext_Payline_Block_Adminhtml_Managecontracts_Grid extends Mage_Adminhtml
91
  'type' => 'options',
92
  'filter' => false,
93
  'options' => array('1' => Mage::helper('payline')->__('X'), '0' => Mage::helper('payline')->__('-'))
94
- ));
95
-
96
- $this->addColumn('is_included_wallet_list', array(
97
- 'header' => Mage::helper('payline')->__('Wallet'),
98
- 'index' => 'is_included_wallet_list',
99
- 'type' => 'options',
100
- 'filter' => false,
101
- 'options' => array('1' => Mage::helper('payline')->__('X'), '0' => Mage::helper('payline')->__('-'))
102
- ));
103
- $this->setDefaultSort('point_of_sell', 'desc');
104
- $this->setDefaultDir('ASC');
105
-
106
- return parent::_prepareColumns();
107
- }
108
-
109
-
110
-
111
- protected function _preparePointOfSell() {
112
- $pointOfSells = Mage::getModel('payline/contract')->getCollection()
113
- ->getSelect()
114
- ->reset(Zend_Db_Select::COLUMNS)
115
- ->columns('point_of_sell', 'main_table')
116
- ->distinct();
117
- $result = $pointOfSells->query()->fetchAll();
118
-
119
- $res = array();
120
- foreach ($result as $p) {
121
- $res[$p['point_of_sell']] = $p['point_of_sell'];
122
- }
123
-
124
- return $res;
125
- }
126
-
127
- protected function _prepareMassaction()
128
- {
129
- $this->setMassactionIdField('id');
130
- $this->getMassactionBlock()->setFormFieldName('contract');
131
-
132
- $this->getMassactionBlock()->addItem('walletList', array(
133
- 'label' => Mage::helper('payline')->__('Subscribe to wallet'),
134
- 'url' => $this->getUrl('*/*/massWallet', array('_current'=>true)),
135
- 'additional' => array(
136
- 'visibility' => array(
137
- 'name' => 'walletList',
138
- 'type' => 'select',
139
- 'class' => 'required-entry',
140
- 'label' => Mage::helper('payline')->__('Set'),
141
- 'values' => array(
142
- 1 => 'On',
143
- 0 => 'Off'
144
- )
145
- )
146
- )
147
- ) );
148
-
149
- $this->getMassactionBlock()->addItem('status', array(
150
- 'label'=> Mage::helper('payline')->__('Change status'),
151
- 'url' => $this->getUrl('*/*/massStatus', array('_current'=>true)),
152
- 'additional' => array(
153
- 'visibility' => array(
154
- 'name' => 'status',
155
- 'type' => 'select',
156
- 'class' => 'required-entry',
157
- 'label' => Mage::helper('catalog')->__('Status'),
158
- 'values' => array(0 => Mage::helper('payline')->__('Primary'),
159
- 1 => Mage::helper('payline')->__('Secondary'),
160
- 2 => Mage::helper('payline')->__('Primary') . ' & ' . Mage::helper('payline')->__('Secondary'),
161
- 3 => Mage::helper('payline')->__('Nothing'))
162
- )
163
- )
164
- ));
165
-
166
  $this->getMassactionBlock()->addItem('setSecure', array(
167
  'label' => Mage::helper('payline')->__('Set as secured'),
168
  'url' => $this->getUrl('*/*/massSecure', array('_current'=>true)),
@@ -178,20 +178,20 @@ class Monext_Payline_Block_Adminhtml_Managecontracts_Grid extends Mage_Adminhtml
178
  )
179
  )
180
  )
181
- ) );
182
-
183
-
184
- return $this;
185
- }
186
-
187
- public function getGridUrl()
188
- {
189
- return $this->getUrl('*/*/grid', array('_current'=>true));
190
- }
191
-
192
- public function getRowUrl($row)
193
- {
194
-
195
- }
196
-
197
- }
1
+ <?php
2
+
3
+ class Monext_Payline_Block_Adminhtml_Managecontracts_Grid extends Mage_Adminhtml_Block_Widget_Grid
4
+ {
5
+
6
+ public function __construct()
7
+ {
8
+ parent::__construct();
9
+ $this->setId('paylineManageContractsGrid');
10
+ $this->setUseAjax(true);
11
+ //$this->setVarNameFilter('contract_filter');
12
+ $this->setDefaultLimit(50);
13
+ }
14
+
15
+ protected function _getStore()
16
+ {
17
+ $storeId = (int) $this->getRequest()->getParam('store', 0);
18
+ return Mage::app()->getStore($storeId);
19
+ }
20
+
21
+
22
+ protected function _prepareCollection()
23
+ {
24
+ $collection = Mage::getModel('payline/contract')->getCollection();
25
+ $store = $this->getRequest()->getParam('store', '');
26
+ $website = $this->getRequest()->getParam('website', '');
27
+ if($store) {
28
+ $storeId = Mage::getModel('core/store')->load($store)->getId();
29
+ $collection->addStoreFilter($storeId);
30
+ } elseif ($website) {
31
+ $websiteId = Mage::getModel('core/website')->load($website)->getId();
32
+ $collection->addWebsiteFilter($websiteId);
33
+ }
34
+
35
+ $this->setCollection($collection);
36
+
37
+ $temp = clone($collection);
38
+ foreach($temp as $c) {
39
+ if($c->getIsPrimary()) {
40
+ $this->setDefaultFilter(array('point_of_sell'=>$c->getPointOfSell()));
41
+ break;
42
+ }
43
+ }
44
+
45
+ return parent::_prepareCollection();
46
+ }
47
+
48
+ protected function _prepareColumns()
49
+ {
50
+ $this->addColumn('name', array(
51
+ 'header' => Mage::helper('payline')->__('Name'),
52
+ 'index' => 'name',
53
+ 'filter' => false,
54
+ 'type' => 'text'
55
+ ));
56
+
57
+ $this->addColumn('number', array(
58
+ 'header' => Mage::helper('payline')->__('Number'),
59
+ 'index' => 'number',
60
+ 'filter' => false,
61
+ 'type' => 'text'
62
+ ));
63
+
64
+ $this->addColumn('point_of_sell', array(
65
+ 'header' => Mage::helper('payline')->__('Point Of Sell'),
66
+ 'index' => 'point_of_sell',
67
+ 'type' => 'text',
68
+ 'filter' => false
69
+ ));
70
+
71
+ $this->addColumn('is_primary', array(
72
+ 'header' => Mage::helper('payline')->__('Primary'),
73
+ 'index' => 'is_primary',
74
+ 'type' => 'options',
75
+ 'filter' => false,
76
+ 'options' => array('1' => Mage::helper('payline')->__('X'), '0' => Mage::helper('payline')->__('-'))
77
+ ));
78
+
79
+ $this->addColumn('is_secondary', array(
80
+ 'header' => Mage::helper('payline')->__('Secondary'),
81
+ 'index' => 'is_secondary',
82
+ 'type' => 'options',
83
+ 'filter' => false,
84
+ 'options' => array('1' => Mage::helper('payline')->__('X'), '0' => Mage::helper('payline')->__('-'))
85
+ ));
86
+
87
 
88
  $this->addColumn('is_secure', array(
89
  'header' => Mage::helper('payline')->__('Secure'),
91
  'type' => 'options',
92
  'filter' => false,
93
  'options' => array('1' => Mage::helper('payline')->__('X'), '0' => Mage::helper('payline')->__('-'))
94
+ ));
95
+
96
+ $this->addColumn('is_included_wallet_list', array(
97
+ 'header' => Mage::helper('payline')->__('Wallet'),
98
+ 'index' => 'is_included_wallet_list',
99
+ 'type' => 'options',
100
+ 'filter' => false,
101
+ 'options' => array('1' => Mage::helper('payline')->__('X'), '0' => Mage::helper('payline')->__('-'))
102
+ ));
103
+ $this->setDefaultSort('point_of_sell', 'desc');
104
+ $this->setDefaultDir('ASC');
105
+
106
+ return parent::_prepareColumns();
107
+ }
108
+
109
+
110
+
111
+ protected function _preparePointOfSell() {
112
+ $pointOfSells = Mage::getModel('payline/contract')->getCollection()
113
+ ->getSelect()
114
+ ->reset(Zend_Db_Select::COLUMNS)
115
+ ->columns('point_of_sell', 'main_table')
116
+ ->distinct();
117
+ $result = $pointOfSells->query()->fetchAll();
118
+
119
+ $res = array();
120
+ foreach ($result as $p) {
121
+ $res[$p['point_of_sell']] = $p['point_of_sell'];
122
+ }
123
+
124
+ return $res;
125
+ }
126
+
127
+ protected function _prepareMassaction()
128
+ {
129
+ $this->setMassactionIdField('id');
130
+ $this->getMassactionBlock()->setFormFieldName('contract');
131
+
132
+ $this->getMassactionBlock()->addItem('walletList', array(
133
+ 'label' => Mage::helper('payline')->__('Subscribe to wallet'),
134
+ 'url' => $this->getUrl('*/*/massWallet', array('_current'=>true)),
135
+ 'additional' => array(
136
+ 'visibility' => array(
137
+ 'name' => 'walletList',
138
+ 'type' => 'select',
139
+ 'class' => 'required-entry',
140
+ 'label' => Mage::helper('payline')->__('Set'),
141
+ 'values' => array(
142
+ 1 => 'On',
143
+ 0 => 'Off'
144
+ )
145
+ )
146
+ )
147
+ ) );
148
+
149
+ $this->getMassactionBlock()->addItem('status', array(
150
+ 'label'=> Mage::helper('payline')->__('Change status'),
151
+ 'url' => $this->getUrl('*/*/massStatus', array('_current'=>true)),
152
+ 'additional' => array(
153
+ 'visibility' => array(
154
+ 'name' => 'status',
155
+ 'type' => 'select',
156
+ 'class' => 'required-entry',
157
+ 'label' => Mage::helper('catalog')->__('Status'),
158
+ 'values' => array(0 => Mage::helper('payline')->__('Primary'),
159
+ 1 => Mage::helper('payline')->__('Secondary'),
160
+ 2 => Mage::helper('payline')->__('Primary') . ' & ' . Mage::helper('payline')->__('Secondary'),
161
+ 3 => Mage::helper('payline')->__('Nothing'))
162
+ )
163
+ )
164
+ ));
165
+
166
  $this->getMassactionBlock()->addItem('setSecure', array(
167
  'label' => Mage::helper('payline')->__('Set as secured'),
168
  'url' => $this->getUrl('*/*/massSecure', array('_current'=>true)),
178
  )
179
  )
180
  )
181
+ ) );
182
+
183
+
184
+ return $this;
185
+ }
186
+
187
+ public function getGridUrl()
188
+ {
189
+ return $this->getUrl('*/*/grid', array('_current'=>true));
190
+ }
191
+
192
+ public function getRowUrl($row)
193
+ {
194
+
195
+ }
196
+
197
+ }
app/code/community/Monext/Payline/Block/Adminhtml/Manageproductcategories.php CHANGED
@@ -1,59 +1,59 @@
1
- <?php
2
- class Monext_Payline_Block_Adminhtml_Manageproductcategories extends Mage_Adminhtml_Block_Widget_Container
3
- {
4
-
5
- /**
6
- * Set template
7
- */
8
- public function __construct()
9
- {
10
- parent::__construct();
11
- $this->setTemplate('payline/productcategories.phtml');
12
- }
13
-
14
- /**
15
- * Prepare button and grid
16
- *
17
- * @return Monext_Payline_Block_Adminhtml_Manageproductcategories
18
- */
19
- protected function _prepareLayout()
20
- {
21
- $this->_removeButton('add');
22
-
23
- $this->_addButton('update', array(
24
- 'label' => Mage::helper('payline')->__('Insert unassigned categories'),
25
- 'onclick' => "setLocation('" . $this->getUrl('*/*/update') . "')"));
26
-
27
- $this->_addButton('reset', array(
28
- 'label' => Mage::helper('payline')->__('Reset all assignments'),
29
- 'onclick' => "setLocation('" . $this->getUrl('*/*/reset') . "')"));
30
-
31
- $this->setChild('grid', $this->getLayout()
32
- ->createBlock('payline/adminhtml_manageproductcategories_grid', 'productcategories.grid'));
33
-
34
- return parent::_prepareLayout();
35
- }
36
-
37
- /**
38
- * Render grid
39
- *
40
- * @return string
41
- */
42
- public function getGridHtml()
43
- {
44
- return $this->getChildHtml('grid');
45
- }
46
-
47
- /**
48
- * Check whether it is single store mode
49
- *
50
- * @return bool
51
- */
52
- public function isSingleStoreMode()
53
- {
54
- if (! Mage::app()->isSingleStoreMode()) {
55
- return false;
56
- }
57
- return true;
58
- }
59
- }
1
+ <?php
2
+ class Monext_Payline_Block_Adminhtml_Manageproductcategories extends Mage_Adminhtml_Block_Widget_Container
3
+ {
4
+
5
+ /**
6
+ * Set template
7
+ */
8
+ public function __construct()
9
+ {
10
+ parent::__construct();
11
+ $this->setTemplate('payline/productcategories.phtml');
12
+ }
13
+
14
+ /**
15
+ * Prepare button and grid
16
+ *
17
+ * @return Monext_Payline_Block_Adminhtml_Manageproductcategories
18
+ */
19
+ protected function _prepareLayout()
20
+ {
21
+ $this->_removeButton('add');
22
+
23
+ $this->_addButton('update', array(
24
+ 'label' => Mage::helper('payline')->__('Insert unassigned categories'),
25
+ 'onclick' => "setLocation('" . $this->getUrl('*/*/update') . "')"));
26
+
27
+ $this->_addButton('reset', array(
28
+ 'label' => Mage::helper('payline')->__('Reset all assignments'),
29
+ 'onclick' => "setLocation('" . $this->getUrl('*/*/reset') . "')"));
30
+
31
+ $this->setChild('grid', $this->getLayout()
32
+ ->createBlock('payline/adminhtml_manageproductcategories_grid', 'productcategories.grid'));
33
+
34
+ return parent::_prepareLayout();
35
+ }
36
+
37
+ /**
38
+ * Render grid
39
+ *
40
+ * @return string
41
+ */
42
+ public function getGridHtml()
43
+ {
44
+ return $this->getChildHtml('grid');
45
+ }
46
+
47
+ /**
48
+ * Check whether it is single store mode
49
+ *
50
+ * @return bool
51
+ */
52
+ public function isSingleStoreMode()
53
+ {
54
+ if (! Mage::app()->isSingleStoreMode()) {
55
+ return false;
56
+ }
57
+ return true;
58
+ }
59
+ }
app/code/community/Monext/Payline/Block/Adminhtml/Manageproductcategories/Assign/Form.php CHANGED
@@ -1,73 +1,73 @@
1
- <?php
2
- /**
3
- * Assign store product category to Payline product category
4
- */
5
- class Monext_Payline_Block_Adminhtml_Manageproductcategories_Assign_Form extends Mage_Adminhtml_Block_Widget_Form
6
- {
7
-
8
- private $_storeCatLabel;
9
-
10
- /**
11
- * Prepare form fields
12
- *
13
- * @return Monext_Payline_Block_Adminhtml_Manageproductcategories_Assign_Form
14
- */
15
- protected function _prepareForm()
16
- {
17
- $rowId = Mage::getSingleton('core/session')->getData('rowCatToAssign');
18
- $assignment = Mage::getModel('payline/productcategories')->load($rowId)->getData();
19
- $this->_storeCatLabel = $assignment['store_category_label'];
20
-
21
- $form = new Varien_Data_Form(array(
22
- 'id' => 'edit_form',
23
- 'action' => $this->getUrl('*/payline_manageproductcategories/assignPost'),
24
- 'method' => 'post'
25
- ));
26
-
27
- $form->setUseContainer(true);
28
- $this->setForm($form);
29
-
30
- $fieldset = $form->addFieldset('base_fieldset', array(
31
- 'legend' => Mage::helper('payline')->__('Choose a category for').' '.$this->_storeCatLabel,
32
- 'class' => 'fieldset-wide'
33
- ));
34
-
35
- $paylinecat = Mage::getModel('payline/datasource_paylineproductcategories')->toOptionArray();
36
-
37
- $fieldset->addField('paylinecat', 'select',
38
- array(
39
- 'name' => 'paylinecat',
40
- 'label' => Mage::helper('payline')->__('Payline category'),
41
- 'class' => 'required-entry',
42
- 'values' => $paylinecat,
43
- 'required' => true,
44
- )
45
- );
46
-
47
- return parent::_prepareForm();
48
- }
49
-
50
- /**
51
- * Retrieve text for header element
52
- *
53
- * @return string
54
- */
55
- public function getHeaderText()
56
- {
57
- return Mage::helper('payline')->__('Assign Payline product category to').' '.$this->_storeCatLabel;
58
- }
59
-
60
- /**
61
- *
62
- * Add submit button
63
- */
64
- public function getButtonsHtml()
65
- {
66
- $addButtonData = array(
67
- 'label' => Mage::helper('payline')->__('Save assignment'),
68
- 'onclick' => 'edit_form.submit()',
69
- 'class' => 'add',
70
- );
71
- return $this->getLayout()->createBlock('adminhtml/widget_button')->setData($addButtonData)->toHtml();
72
- }
73
- }
1
+ <?php
2
+ /**
3
+ * Assign store product category to Payline product category
4
+ */
5
+ class Monext_Payline_Block_Adminhtml_Manageproductcategories_Assign_Form extends Mage_Adminhtml_Block_Widget_Form
6
+ {
7
+
8
+ private $_storeCatLabel;
9
+
10
+ /**
11
+ * Prepare form fields
12
+ *
13
+ * @return Monext_Payline_Block_Adminhtml_Manageproductcategories_Assign_Form
14
+ */
15
+ protected function _prepareForm()
16
+ {
17
+ $rowId = Mage::getSingleton('core/session')->getData('rowCatToAssign');
18
+ $assignment = Mage::getModel('payline/productcategories')->load($rowId)->getData();
19
+ $this->_storeCatLabel = $assignment['store_category_label'];
20
+
21
+ $form = new Varien_Data_Form(array(
22
+ 'id' => 'edit_form',
23
+ 'action' => $this->getUrl('*/payline_manageproductcategories/assignPost'),
24
+ 'method' => 'post'
25
+ ));
26
+
27
+ $form->setUseContainer(true);
28
+ $this->setForm($form);
29
+
30
+ $fieldset = $form->addFieldset('base_fieldset', array(
31
+ 'legend' => Mage::helper('payline')->__('Choose a category for').' '.$this->_storeCatLabel,
32
+ 'class' => 'fieldset-wide'
33
+ ));
34
+
35
+ $paylinecat = Mage::getModel('payline/datasource_paylineproductcategories')->toOptionArray();
36
+
37
+ $fieldset->addField('paylinecat', 'select',
38
+ array(
39
+ 'name' => 'paylinecat',
40
+ 'label' => Mage::helper('payline')->__('Payline category'),
41
+ 'class' => 'required-entry',
42
+ 'values' => $paylinecat,
43
+ 'required' => true,
44
+ )
45
+ );
46
+
47
+ return parent::_prepareForm();
48
+ }
49
+
50
+ /**
51
+ * Retrieve text for header element
52
+ *
53
+ * @return string
54
+ */
55
+ public function getHeaderText()
56
+ {
57
+ return Mage::helper('payline')->__('Assign Payline product category to').' '.$this->_storeCatLabel;
58
+ }
59
+
60
+ /**
61
+ *
62
+ * Add submit button
63
+ */
64
+ public function getButtonsHtml()
65
+ {
66
+ $addButtonData = array(
67
+ 'label' => Mage::helper('payline')->__('Save assignment'),
68
+ 'onclick' => 'edit_form.submit()',
69
+ 'class' => 'add',
70
+ );
71
+ return $this->getLayout()->createBlock('adminhtml/widget_button')->setData($addButtonData)->toHtml();
72
+ }
73
+ }
app/code/community/Monext/Payline/Block/Adminhtml/Manageproductcategories/Grid.php CHANGED
@@ -1,96 +1,96 @@
1
- <?php
2
- class Monext_Payline_Block_Adminhtml_Manageproductcategories_Grid extends Mage_Adminhtml_Block_Widget_Grid
3
- {
4
-
5
- public function __construct()
6
- {
7
- parent::__construct();
8
- $this->setId('paylineManageProductCategoriesGrid');
9
- $this->setUseAjax(true);
10
- $this->setDefaultLimit(50);
11
- }
12
-
13
- protected function _getStore()
14
- {
15
- $storeId = (int) $this->getRequest()->getParam('store', 0);
16
- return Mage::app()->getStore($storeId);
17
- }
18
-
19
- protected function _prepareCollection()
20
- {
21
- $collection = Mage::getModel('payline/productcategories')->getCollection();
22
- // $store = $this->getRequest()->getParam('store', '');
23
- // $website = $this->getRequest()->getParam('website', '');
24
- // if ($store) {
25
- // $storeId = Mage::getModel('core/store')->load($store)->getId();
26
- // $collection->addStoreFilter($storeId);
27
- // } elseif ($website) {
28
- // $websiteId = Mage::getModel('core/website')->load($website)->getId();
29
- // $collection->addWebsiteFilter($websiteId);
30
- // }
31
- $this->setCollection($collection);
32
- return parent::_prepareCollection();
33
- }
34
-
35
- protected function _prepareColumns()
36
- {
37
-
38
- $this->addColumn('storecat', array(
39
- 'header' => Mage::helper('payline')->__('Store category'),
40
- 'index' => 'store_category_label',
41
- 'filter' => false,
42
- 'type' => 'text'));
43
- $this->addColumn('paylinecat', array(
44
- 'header' => Mage::helper('payline')->__('Payline category'),
45
- 'index' => 'payline_category_label',
46
- 'filter' => false,
47
- 'type' => 'text'));
48
- $this->addColumn('action', array(
49
- 'header' => Mage::helper('sales')->__('Action'),
50
- 'width' => '50px',
51
- 'type' => 'action',
52
- 'getter' => 'getId',
53
- 'actions' => array(
54
- array(
55
- 'caption' => Mage::helper('payline')->__('Assign'),
56
- 'url' => array(
57
- 'base' => '*/*/assign'),
58
- 'field' => 'id',
59
- 'data-column' => 'action'),
60
- array(
61
- 'caption' => Mage::helper('payline')->__('Unassign'),
62
- 'url' => array(
63
- 'base' => '*/*/unassign'),
64
- 'field' => 'id',
65
- 'data-column' => 'action')),
66
- 'filter' => false,
67
- 'sortable' => false,
68
- 'index' => 'store_category_id',
69
- 'is_system' => true));
70
- $this->setDefaultSort('storecat', 'desc');
71
- $this->setDefaultDir('ASC');
72
- return parent::_prepareColumns();
73
- }
74
-
75
- public function getGridUrl()
76
- {
77
- return $this->getUrl('*/*/grid', array('_current' => true));
78
- }
79
-
80
-
81
- public function getRowUrl($row)
82
- {
83
- return $this->getUrl('*/*/assign', array('id' => $row->getId()));
84
- }
85
-
86
- /**
87
- * Get children of specified item
88
- *
89
- * @param Varien_Object $item
90
- * @return array
91
- */
92
- public function getMultipleRows($item)
93
- {
94
- return false;
95
- }
96
- }
1
+ <?php
2
+ class Monext_Payline_Block_Adminhtml_Manageproductcategories_Grid extends Mage_Adminhtml_Block_Widget_Grid
3
+ {
4
+
5
+ public function __construct()
6
+ {
7
+ parent::__construct();
8
+ $this->setId('paylineManageProductCategoriesGrid');
9
+ $this->setUseAjax(true);
10
+ $this->setDefaultLimit(50);
11
+ }
12
+
13
+ protected function _getStore()
14
+ {
15
+ $storeId = (int) $this->getRequest()->getParam('store', 0);
16
+ return Mage::app()->getStore($storeId);
17
+ }
18
+
19
+ protected function _prepareCollection()
20
+ {
21
+ $collection = Mage::getModel('payline/productcategories')->getCollection();
22
+ // $store = $this->getRequest()->getParam('store', '');
23
+ // $website = $this->getRequest()->getParam('website', '');
24
+ // if ($store) {
25
+ // $storeId = Mage::getModel('core/store')->load($store)->getId();
26
+ // $collection->addStoreFilter($storeId);
27
+ // } elseif ($website) {
28
+ // $websiteId = Mage::getModel('core/website')->load($website)->getId();
29
+ // $collection->addWebsiteFilter($websiteId);
30
+ // }
31
+ $this->setCollection($collection);
32
+ return parent::_prepareCollection();
33
+ }
34
+
35
+ protected function _prepareColumns()
36
+ {
37
+
38
+ $this->addColumn('storecat', array(
39
+ 'header' => Mage::helper('payline')->__('Store category'),
40
+ 'index' => 'store_category_label',
41
+ 'filter' => false,
42
+ 'type' => 'text'));
43
+ $this->addColumn('paylinecat', array(
44
+ 'header' => Mage::helper('payline')->__('Payline category'),
45
+ 'index' => 'payline_category_label',
46
+ 'filter' => false,
47
+ 'type' => 'text'));
48
+ $this->addColumn('action', array(
49
+ 'header' => Mage::helper('sales')->__('Action'),
50
+ 'width' => '50px',
51
+ 'type' => 'action',
52
+ 'getter' => 'getId',
53
+ 'actions' => array(
54
+ array(
55
+ 'caption' => Mage::helper('payline')->__('Assign'),
56
+ 'url' => array(
57
+ 'base' => '*/*/assign'),
58
+ 'field' => 'id',
59
+ 'data-column' => 'action'),
60
+ array(
61
+ 'caption' => Mage::helper('payline')->__('Unassign'),
62
+ 'url' => array(
63
+ 'base' => '*/*/unassign'),
64
+ 'field' => 'id',
65
+ 'data-column' => 'action')),
66
+ 'filter' => false,
67
+ 'sortable' => false,
68
+ 'index' => 'store_category_id',
69
+ 'is_system' => true));
70
+ $this->setDefaultSort('storecat', 'desc');
71
+ $this->setDefaultDir('ASC');
72
+ return parent::_prepareColumns();
73
+ }
74
+
75
+ public function getGridUrl()
76
+ {
77
+ return $this->getUrl('*/*/grid', array('_current' => true));
78
+ }
79
+
80
+
81
+ public function getRowUrl($row)
82
+ {
83
+ return $this->getUrl('*/*/assign', array('id' => $row->getId()));
84
+ }
85
+
86
+ /**
87
+ * Get children of specified item
88
+ *
89
+ * @param Varien_Object $item
90
+ * @return array
91
+ */
92
+ public function getMultipleRows($item)
93
+ {
94
+ return false;
95
+ }
96
+ }
app/code/community/Monext/Payline/Block/Adminhtml/Sales/Order/Creditmemo/Create/Items.php CHANGED
@@ -1,60 +1,60 @@
1
- <?php
2
-
3
- /**
4
- * This class corrects an unexpected behavour on Magento EE 1.9
5
- * (looks like invoice MUST be captured online to do a refund)
6
- */
7
- class Monext_Payline_Block_Adminhtml_Sales_Order_Creditmemo_Create_Items extends Mage_Adminhtml_Block_Sales_Order_Creditmemo_Create_Items{
8
- /**
9
- * Prepare child blocks
10
- *
11
- * @return Monext_Payline_Block_Adminhtml_Sales_Order_Creditmemo_Create_Items
12
- */
13
- protected function _prepareLayout()
14
- {
15
- $onclick = "submitAndReloadArea($('creditmemo_item_container'),'".$this->getUpdateUrl()."')";
16
- $this->setChild(
17
- 'update_button',
18
- $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array(
19
- 'label' => Mage::helper('sales')->__('Update Qty\'s'),
20
- 'class' => 'update-button',
21
- 'onclick' => $onclick,
22
- ))
23
- );
24
- $isNotMagento1_3=version_compare(Mage::getVersion(), '1.4', 'ge');
25
- if ($this->getCreditmemo()->canRefund()) {
26
- //No transaction for an invoice
27
- if ($this->getCreditmemo()->getInvoice()){// && $this->getCreditmemo()->getInvoice()->getTransactionId()) {
28
- $this->setChild(
29
- 'submit_button',
30
- $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array(
31
- 'label' => Mage::helper('sales')->__('Refund'),
32
- 'class' => 'save submit-button',
33
- 'onclick' => $isNotMagento1_3?'disableElements(\'submit-button\');submitCreditMemo()':'editForm.submit();',
34
- ))
35
- );
36
- }
37
- $this->setChild(
38
- 'submit_offline',
39
- $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array(
40
- 'label' => Mage::helper('sales')->__('Refund offline'),
41
- 'class' => 'save submit-button',
42
- 'onclick' => $isNotMagento1_3?'disableElements(\'submit-button\');submitCreditMemoOffline()':'editForm.submit();',
43
- ))
44
- );
45
-
46
- }
47
- else {
48
- $this->setChild(
49
- 'submit_button',
50
- $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array(
51
- 'label' => Mage::helper('sales')->__('Refund Offline'),
52
- 'class' => 'save submit-button',
53
- 'onclick' => $isNotMagento1_3?'disableElements(\'submit-button\');editForm.submit()':'editForm.submit();',
54
- ))
55
- );
56
- }
57
-
58
- return $this;
59
- }
60
  }
1
+ <?php
2
+
3
+ /**
4
+ * This class corrects an unexpected behavour on Magento EE 1.9
5
+ * (looks like invoice MUST be captured online to do a refund)
6
+ */
7
+ class Monext_Payline_Block_Adminhtml_Sales_Order_Creditmemo_Create_Items extends Mage_Adminhtml_Block_Sales_Order_Creditmemo_Create_Items{
8
+ /**
9
+ * Prepare child blocks
10
+ *
11
+ * @return Monext_Payline_Block_Adminhtml_Sales_Order_Creditmemo_Create_Items
12
+ */
13
+ protected function _prepareLayout()
14
+ {
15
+ $onclick = "submitAndReloadArea($('creditmemo_item_container'),'".$this->getUpdateUrl()."')";
16
+ $this->setChild(
17
+ 'update_button',
18
+ $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array(
19
+ 'label' => Mage::helper('sales')->__('Update Qty\'s'),
20
+ 'class' => 'update-button',
21
+ 'onclick' => $onclick,
22
+ ))
23
+ );
24
+ $isNotMagento1_3=version_compare(Mage::getVersion(), '1.4', 'ge');
25
+ if ($this->getCreditmemo()->canRefund()) {
26
+ //No transaction for an invoice
27
+ if ($this->getCreditmemo()->getInvoice()){// && $this->getCreditmemo()->getInvoice()->getTransactionId()) {
28
+ $this->setChild(
29
+ 'submit_button',
30
+ $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array(
31
+ 'label' => Mage::helper('sales')->__('Refund'),
32
+ 'class' => 'save submit-button',
33
+ 'onclick' => $isNotMagento1_3?'disableElements(\'submit-button\');submitCreditMemo()':'editForm.submit();',
34
+ ))
35
+ );
36
+ }
37
+ $this->setChild(
38
+ 'submit_offline',
39
+ $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array(
40
+ 'label' => Mage::helper('sales')->__('Refund offline'),
41
+ 'class' => 'save submit-button',
42
+ 'onclick' => $isNotMagento1_3?'disableElements(\'submit-button\');submitCreditMemoOffline()':'editForm.submit();',
43
+ ))
44
+ );
45
+
46
+ }
47
+ else {
48
+ $this->setChild(
49
+ 'submit_button',
50
+ $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array(
51
+ 'label' => Mage::helper('sales')->__('Refund Offline'),
52
+ 'class' => 'save submit-button',
53
+ 'onclick' => $isNotMagento1_3?'disableElements(\'submit-button\');editForm.submit()':'editForm.submit();',
54
+ ))
55
+ );
56
+ }
57
+
58
+ return $this;
59
+ }
60
  }
app/code/community/Monext/Payline/Block/Adminhtml/Sales/Order/Total/Nxfees.php CHANGED
@@ -1,39 +1,39 @@
1
- <?php
2
-
3
- /**
4
- * Block to display payline nx payment fees on order and invoice
5
- */
6
-
7
- class Monext_Payline_Block_Adminhtml_Sales_Order_Total_Nxfees extends Mage_Core_Block_Abstract
8
- {
9
- public function initTotals()
10
- {
11
- $parent = $this->getParentBlock();
12
-
13
- $entity = $parent->getSource();
14
- $orderId = $entity->getOrderId(); //invoice
15
- $order = false;
16
- if(!$orderId) {
17
- $orderId = $entity->getId(); //order
18
- $order = true;
19
- }
20
-
21
- $fee = Mage::getModel('payline/fees')->getCollection()
22
- ->addFieldtoFilter('order_id',$orderId)->getFirstItem();
23
-
24
- if ($fee->getId() &&
25
- ($order || (!$order && $fee->getInvoiceId()==$entity->getId())))
26
- {
27
- $total = new Varien_Object(array(
28
- 'code' => 'payline_nx',
29
- 'value' => $fee->getAmount(),
30
- 'base_value' => $fee->getBaseAmount(),
31
- 'label' => Mage::helper('payline')->__('Payline fees'),
32
- 'field' => 'payline_nx'
33
- ));
34
- $parent->addTotal($total, 'payline_nx');
35
- }
36
-
37
- return $this;
38
- }
39
  }
1
+ <?php
2
+
3
+ /**
4
+ * Block to display payline nx payment fees on order and invoice
5
+ */
6
+
7
+ class Monext_Payline_Block_Adminhtml_Sales_Order_Total_Nxfees extends Mage_Core_Block_Abstract
8
+ {
9
+ public function initTotals()
10
+ {
11
+ $parent = $this->getParentBlock();
12
+
13
+ $entity = $parent->getSource();
14
+ $orderId = $entity->getOrderId(); //invoice
15
+ $order = false;
16
+ if(!$orderId) {
17
+ $orderId = $entity->getId(); //order
18
+ $order = true;
19
+ }
20
+
21
+ $fee = Mage::getModel('payline/fees')->getCollection()
22
+ ->addFieldtoFilter('order_id',$orderId)->getFirstItem();
23
+
24
+ if ($fee->getId() &&
25
+ ($order || (!$order && $fee->getInvoiceId()==$entity->getId())))
26
+ {
27
+ $total = new Varien_Object(array(
28
+ 'code' => 'payline_nx',
29
+ 'value' => $fee->getAmount(),
30
+ 'base_value' => $fee->getBaseAmount(),
31
+ 'label' => Mage::helper('payline')->__('Payline fees'),
32
+ 'field' => 'payline_nx'
33
+ ));
34
+ $parent->addTotal($total, 'payline_nx');
35
+ }
36
+
37
+ return $this;
38
+ }
39
  }
app/code/community/Monext/Payline/Block/Adminhtml/System/Config/Fieldset/Group.php CHANGED
@@ -1,55 +1,55 @@
1
- <?php
2
- /**
3
- * Fieldset renderer for PayPal solutions group
4
- *
5
- * @category Mage
6
- * @package Mage_Paypal
7
- * @author Magento Core Team <core@magentocommerce.com>
8
- */
9
- class Monext_Payline_Block_Adminhtml_System_Config_Fieldset_Group
10
- extends Mage_Adminhtml_Block_System_Config_Form_Fieldset
11
- {
12
- /**
13
- * Return header comment part of html for fieldset
14
- *
15
- * @param Varien_Data_Form_Element_Abstract $element
16
- * @return string
17
- */
18
- protected function _getHeaderCommentHtml($element)
19
- {
20
- $groupConfig = $this->getGroup($element)->asArray();
21
-
22
- if (empty($groupConfig['help_url']) || !$element->getComment()) {
23
- return parent::_getHeaderCommentHtml($element);
24
- }
25
-
26
- $html = '<div class="comment">' . $element->getComment()
27
- . ' <a target="_blank" href="' . $groupConfig['help_url'] . '">'
28
- . Mage::helper('paypal')->__('Help') . '</a></div>';
29
-
30
- return $html;
31
- }
32
-
33
- /**
34
- * Return collapse state
35
- *
36
- * @param Varien_Data_Form_Element_Abstract $element
37
- * @return bool
38
- */
39
- protected function _getCollapseState($element)
40
- {
41
- $extra = Mage::getSingleton('admin/session')->getUser()->getExtra();
42
- if (isset($extra['configState'][$element->getId()])) {
43
- return $extra['configState'][$element->getId()];
44
- }
45
-
46
- if ($element->getExpanded() !== null) {
47
- return 1;
48
- }
49
-
50
- return false;
51
- }
52
-
53
  /**
54
  * Return header title part of html for fieldset
55
  *
@@ -57,12 +57,12 @@ class Monext_Payline_Block_Adminhtml_System_Config_Fieldset_Group
57
  * @return string
58
  */
59
  protected function _getHeaderTitleHtml($element)
60
- {
61
  // return '<div class="entry-edit-head collapseable disabled" ><a id="' . $element->getHtmlId()
62
- // . '-head" href="#" onclick="return false;">' . $element->getLegend() . '</a></div>';
63
-
64
  return '<div class="entry-edit-head can-be-disabled collapseable" ><a id="' . $element->getHtmlId()
65
  . '-head" href="#" onclick="paylineToggleSection(this, \'' . $element->getHtmlId() . '\', \''
66
  . $this->getUrl('*/*/state') . '\'); return false;">' . $element->getLegend() . '</a></div>';
67
- }
68
- }
1
+ <?php
2
+ /**
3
+ * Fieldset renderer for PayPal solutions group
4
+ *
5
+ * @category Mage
6
+ * @package Mage_Paypal
7
+ * @author Magento Core Team <core@magentocommerce.com>
8
+ */
9
+ class Monext_Payline_Block_Adminhtml_System_Config_Fieldset_Group
10
+ extends Mage_Adminhtml_Block_System_Config_Form_Fieldset
11
+ {
12
+ /**
13
+ * Return header comment part of html for fieldset
14
+ *
15
+ * @param Varien_Data_Form_Element_Abstract $element
16
+ * @return string
17
+ */
18
+ protected function _getHeaderCommentHtml($element)
19
+ {
20
+ $groupConfig = $this->getGroup($element)->asArray();
21
+
22
+ if (empty($groupConfig['help_url']) || !$element->getComment()) {
23
+ return parent::_getHeaderCommentHtml($element);
24
+ }
25
+
26
+ $html = '<div class="comment">' . $element->getComment()
27
+ . ' <a target="_blank" href="' . $groupConfig['help_url'] . '">'
28
+ . Mage::helper('paypal')->__('Help') . '</a></div>';
29
+
30
+ return $html;
31
+ }
32
+
33
+ /**
34
+ * Return collapse state
35
+ *
36
+ * @param Varien_Data_Form_Element_Abstract $element
37
+ * @return bool
38
+ */
39
+ protected function _getCollapseState($element)
40
+ {
41
+ $extra = Mage::getSingleton('admin/session')->getUser()->getExtra();
42
+ if (isset($extra['configState'][$element->getId()])) {
43
+ return $extra['configState'][$element->getId()];
44
+ }
45
+
46
+ if ($element->getExpanded() !== null) {
47
+ return 1;
48
+ }
49
+
50
+ return false;
51
+ }
52
+
53
  /**
54
  * Return header title part of html for fieldset
55
  *
57
  * @return string
58
  */
59
  protected function _getHeaderTitleHtml($element)
60
+ {
61
  // return '<div class="entry-edit-head collapseable disabled" ><a id="' . $element->getHtmlId()
62
+ // . '-head" href="#" onclick="return false;">' . $element->getLegend() . '</a></div>';
63
+
64
  return '<div class="entry-edit-head can-be-disabled collapseable" ><a id="' . $element->getHtmlId()
65
  . '-head" href="#" onclick="paylineToggleSection(this, \'' . $element->getHtmlId() . '\', \''
66
  . $this->getUrl('*/*/state') . '\'); return false;">' . $element->getLegend() . '</a></div>';
67
+ }
68
+ }
app/code/community/Monext/Payline/Block/Adminhtml/System/Config/Fieldset/Payment.php CHANGED
@@ -1,99 +1,99 @@
1
- <?php
2
-
3
- class Monext_Payline_Block_Adminhtml_System_Config_Fieldset_Payment
4
- extends Mage_Adminhtml_Block_System_Config_Form_Fieldset
5
- {
6
- /**
7
- * Add custom css class
8
- *
9
- * @param Varien_Data_Form_Element_Abstract $element
10
- * @return string
11
- */
12
- protected function _getFrontendClass($element)
13
- {
14
- return parent::_getFrontendClass($element) . ' with-button '
15
- . ($this->_isPaymentEnabled($element) ? ' enabled' : '');
16
- }
17
-
18
- /**
19
- * Check whether current payment method is enabled
20
- *
21
- * @param Varien_Data_Form_Element_Abstract $element
22
- * @return bool
23
- */
24
- protected function _isPaymentEnabled($element)
25
- {
26
- $groupConfig = $this->getGroup($element)->asArray();
27
- $activityPath = isset($groupConfig['activity_path']) ? $groupConfig['activity_path'] : '';
28
-
29
- if (empty($activityPath)) {
30
- return false;
31
- }
32
-
33
- $isPaymentEnabled = (string)Mage::getSingleton('adminhtml/config_data')->getConfigDataValue($activityPath);
34
-
35
- return (bool)$isPaymentEnabled;
36
- }
37
-
38
- /**
39
- * Return header title part of html for payment solution
40
- *
41
- * @param Varien_Data_Form_Element_Abstract $element
42
- * @return string
43
- */
44
- protected function _getHeaderTitleHtml($element)
45
- {
46
- $html = '<div class="config-heading" ><div class="heading"><strong>' . $element->getLegend();
47
-
48
- $groupConfig = $this->getGroup($element)->asArray();
49
- if (!empty($groupConfig['learn_more_link'])) {
50
- $html .= '<a class="link-more" href="' . $groupConfig['learn_more_link'] . '" target="_blank">'
51
- . $this->__('Learn More') . '</a>';
52
- }
53
- if (!empty($groupConfig['demo_link'])) {
54
- $html .= '<a class="link-demo" href="' . $groupConfig['demo_link'] . '" target="_blank">'
55
- . $this->__('View Demo') . '</a>';
56
- }
57
- $html .= '</strong>';
58
-
59
- if ($element->getComment()) {
60
- $html .= '<span class="heading-intro">' . $element->getComment() . '</span>';
61
- }
62
- $html .= '</div>';
63
-
64
- $html .= '<div class="button-container"><button type="button"'
65
- //. ($this->_isPaymentEnabled($element) ? '' : ' disabled="disabled"')
66
- . ' class="button'
67
- //. (empty($groupConfig['payline_ec_separate']) ? '' : ' payline-ec-separate')
68
- //. ($this->_isPaymentEnabled($element) ? '' : ' disabled')
69
- . '" id="' . $element->getHtmlId()
70
- . '-head" onclick="paylineToggleSolution.call(this, \'' . $element->getHtmlId() . '\', \''
71
- . $this->getUrl('*/*/state') . '\'); return false;"><span class="state-closed">'
72
- . $this->__('Configure') . '</span><span class="state-opened">'
73
- . $this->__('Close') . '</span></button></div></div>';
74
-
75
- return $html;
76
- }
77
-
78
- /**
79
- * Return header comment part of html for payment solution
80
- *
81
- * @param Varien_Data_Form_Element_Abstract $element
82
- * @return string
83
- */
84
- protected function _getHeaderCommentHtml($element)
85
- {
86
- return '';
87
- }
88
-
89
- /**
90
- * Get collapsed state on-load
91
- *
92
- * @param Varien_Data_Form_Element_Abstract $element
93
- * @return bool
94
- */
95
- protected function _getCollapseState($element)
96
- {
97
- return false;
98
- }
99
- }
1
+ <?php
2
+
3
+ class Monext_Payline_Block_Adminhtml_System_Config_Fieldset_Payment
4
+ extends Mage_Adminhtml_Block_System_Config_Form_Fieldset
5
+ {
6
+ /**
7
+ * Add custom css class
8
+ *
9
+ * @param Varien_Data_Form_Element_Abstract $element
10
+ * @return string
11
+ */
12
+ protected function _getFrontendClass($element)
13
+ {
14
+ return parent::_getFrontendClass($element) . ' with-button '
15
+ . ($this->_isPaymentEnabled($element) ? ' enabled' : '');
16
+ }
17
+
18
+ /**
19
+ * Check whether current payment method is enabled
20
+ *
21
+ * @param Varien_Data_Form_Element_Abstract $element
22
+ * @return bool
23
+ */
24
+ protected function _isPaymentEnabled($element)
25
+ {
26
+ $groupConfig = $this->getGroup($element)->asArray();
27
+ $activityPath = isset($groupConfig['activity_path']) ? $groupConfig['activity_path'] : '';
28
+
29
+ if (empty($activityPath)) {
30
+ return false;
31
+ }
32
+
33
+ $isPaymentEnabled = (string)Mage::getSingleton('adminhtml/config_data')->getConfigDataValue($activityPath);
34
+
35
+ return (bool)$isPaymentEnabled;
36
+ }
37
+
38
+ /**
39
+ * Return header title part of html for payment solution
40
+ *
41
+ * @param Varien_Data_Form_Element_Abstract $element
42
+ * @return string
43
+ */
44
+ protected function _getHeaderTitleHtml($element)
45
+ {
46
+ $html = '<div class="config-heading" ><div class="heading"><strong>' . $element->getLegend();
47
+
48
+ $groupConfig = $this->getGroup($element)->asArray();
49
+ if (!empty($groupConfig['learn_more_link'])) {
50
+ $html .= '<a class="link-more" href="' . $groupConfig['learn_more_link'] . '" target="_blank">'
51
+ . $this->__('Learn More') . '</a>';
52
+ }
53
+ if (!empty($groupConfig['demo_link'])) {
54
+ $html .= '<a class="link-demo" href="' . $groupConfig['demo_link'] . '" target="_blank">'
55
+ . $this->__('View Demo') . '</a>';
56
+ }
57
+ $html .= '</strong>';
58
+
59
+ if ($element->getComment()) {
60
+ $html .= '<span class="heading-intro">' . $element->getComment() . '</span>';
61
+ }
62
+ $html .= '</div>';
63
+
64
+ $html .= '<div class="button-container"><button type="button"'
65
+ //. ($this->_isPaymentEnabled($element) ? '' : ' disabled="disabled"')
66
+ . ' class="button'
67
+ //. (empty($groupConfig['payline_ec_separate']) ? '' : ' payline-ec-separate')
68
+ //. ($this->_isPaymentEnabled($element) ? '' : ' disabled')
69
+ . '" id="' . $element->getHtmlId()
70
+ . '-head" onclick="paylineToggleSolution.call(this, \'' . $element->getHtmlId() . '\', \''
71
+ . $this->getUrl('*/*/state') . '\'); return false;"><span class="state-closed">'
72
+ . $this->__('Configure') . '</span><span class="state-opened">'
73
+ . $this->__('Close') . '</span></button></div></div>';
74
+
75
+ return $html;
76
+ }
77
+
78
+ /**
79
+ * Return header comment part of html for payment solution
80
+ *
81
+ * @param Varien_Data_Form_Element_Abstract $element
82
+ * @return string
83
+ */
84
+ protected function _getHeaderCommentHtml($element)
85
+ {
86
+ return '';
87
+ }
88
+
89
+ /**
90
+ * Get collapsed state on-load
91
+ *
92
+ * @param Varien_Data_Form_Element_Abstract $element
93
+ * @return bool
94
+ */
95
+ protected function _getCollapseState($element)
96
+ {
97
+ return false;
98
+ }
99
+ }
app/code/community/Monext/Payline/Block/Adminhtml/System/Config/Fieldset/Welcome.php CHANGED
@@ -1,114 +1,114 @@
1
- <?php
2
-
3
  require_once(Mage::getBaseDir() . '/app/code/community/Monext/Payline/lib/paylineSDK.php');
4
-
5
-
6
- /**
7
- * Renderer for Payline banner in System Configuration
8
- *
9
- */
10
- class Monext_Payline_Block_Adminhtml_System_Config_Fieldset_Welcome
11
- extends Mage_Adminhtml_Block_Abstract
12
- implements Varien_Data_Form_Element_Renderer_Interface
13
- {
14
- protected $_template = 'payline/system/config/fieldset/welcome.phtml';
15
-
16
- /**
17
- * Render fieldset html
18
- *
19
- * @param Varien_Data_Form_Element_Abstract $element
20
- * @return string
21
- */
22
- public function render(Varien_Data_Form_Element_Abstract $element)
23
- {
24
- $elementOriginalData = $element->getOriginalData();
25
- if (isset($elementOriginalData['help_link'])) {
26
- $this->setHelpLink($elementOriginalData['help_link']);
27
- }
28
- $js = '
29
- paylineToggleSection = function(section, id, url) {
30
- if (section.up("div").hasClassName("can-be-disabled") && section.up("div").hasClassName("disabled")) {
31
- return false;
32
- }
33
- Fieldset.toggleCollapse(id, url);
34
- }
35
-
36
-
37
- paylineToggleSolution = function(id, url) {
38
- var doScroll = false;
39
- Fieldset.toggleCollapse(id, url);
40
- if ($(this).hasClassName("open")) {
41
- $$(".with-button button.button").each(function(anotherButton) {
42
- if (anotherButton != this && $(anotherButton).hasClassName("open")) {
43
- $(anotherButton).click();
44
- doScroll = true;
45
- }
46
- }.bind(this));
47
- }
48
- if (doScroll) {
49
- var pos = Element.cumulativeOffset($(this));
50
- window.scrollTo(pos[0], pos[1] - 45);
51
- }
52
- }
53
-
54
- paylineToggleAllSections = function()
55
- {
56
- var isEnabled = $("payline_payline_common_payline_enabled").value
57
- $$(".can-be-disabled").each(function(elem) {
58
- if (isEnabled>0) {
59
- elem.removeClassName("disabled");
60
- } else {
61
- if( elem.adjacent("fieldset")) {
62
- var sectionId = elem.adjacent("fieldset")[0].id;
63
- var state = $(sectionId+"-state").value;
64
- if(state>0) {
65
- Fieldset.toggleCollapse(sectionId);
66
- }
67
- }
68
- elem.addClassName("disabled");
69
- }
70
- })
71
- }
72
-
73
-
74
- document.observe("dom:loaded", function() {
75
- paylineToggleAllSections();
76
- $("payline_payline_common_payline_enabled").observe("change", paylineToggleAllSections);
77
- });
78
- ';
79
- return $this->toHtml() . $this->helper('adminhtml/js')->getScript($js);
80
- }
81
-
82
- public function getVersion()
83
- {
84
- $version = (string) $this->_getModuleConfig()->version;
85
-
86
- return $version;
87
- }
88
-
89
  public function getRelease()
90
  {
91
  $release = (string) $this->_getModuleConfig()->release;
92
 
93
  return $release;
94
- }
95
-
96
  protected function _getModuleConfig()
97
  {
98
  $config = Mage::getConfig();
99
  return $config->getModuleConfig('Monext_Payline');
100
- }
101
 
102
  public function getPaylineLogo()
103
  {
104
- return $this->getSkinUrl('images/monext/payline-logo.png', array('_area'=>'frontend'));
105
- }
106
-
107
  public function isProduction()
108
  {
109
  return Mage::helper('payline')->isProduction();
110
  }
111
-
112
-
113
-
114
- }
1
+ <?php
2
+
3
  require_once(Mage::getBaseDir() . '/app/code/community/Monext/Payline/lib/paylineSDK.php');
4
+
5
+
6
+ /**
7
+ * Renderer for Payline banner in System Configuration
8
+ *
9
+ */
10
+ class Monext_Payline_Block_Adminhtml_System_Config_Fieldset_Welcome
11
+ extends Mage_Adminhtml_Block_Abstract
12
+ implements Varien_Data_Form_Element_Renderer_Interface
13
+ {
14
+ protected $_template = 'payline/system/config/fieldset/welcome.phtml';
15
+
16
+ /**
17
+ * Render fieldset html
18
+ *
19
+ * @param Varien_Data_Form_Element_Abstract $element
20
+ * @return string
21
+ */
22
+ public function render(Varien_Data_Form_Element_Abstract $element)
23
+ {
24
+ $elementOriginalData = $element->getOriginalData();
25
+ if (isset($elementOriginalData['help_link'])) {
26
+ $this->setHelpLink($elementOriginalData['help_link']);
27
+ }
28
+ $js = '
29
+ paylineToggleSection = function(section, id, url) {
30
+ if (section.up("div").hasClassName("can-be-disabled") && section.up("div").hasClassName("disabled")) {
31
+ return false;
32
+ }
33
+ Fieldset.toggleCollapse(id, url);
34
+ }
35
+
36
+
37
+ paylineToggleSolution = function(id, url) {
38
+ var doScroll = false;
39
+ Fieldset.toggleCollapse(id, url);
40
+ if ($(this).hasClassName("open")) {
41
+ $$(".with-button button.button").each(function(anotherButton) {
42
+ if (anotherButton != this && $(anotherButton).hasClassName("open")) {
43
+ $(anotherButton).click();
44
+ doScroll = true;
45
+ }
46
+ }.bind(this));
47
+ }
48
+ if (doScroll) {
49
+ var pos = Element.cumulativeOffset($(this));
50
+ window.scrollTo(pos[0], pos[1] - 45);
51
+ }
52
+ }
53
+
54
+ paylineToggleAllSections = function()
55
+ {
56
+ var isEnabled = $("payline_payline_common_payline_enabled").value
57
+ $$(".can-be-disabled").each(function(elem) {
58
+ if (isEnabled>0) {
59
+ elem.removeClassName("disabled");
60
+ } else {
61
+ if( elem.adjacent("fieldset")) {
62
+ var sectionId = elem.adjacent("fieldset")[0].id;
63
+ var state = $(sectionId+"-state").value;
64
+ if(state>0) {
65
+ Fieldset.toggleCollapse(sectionId);
66
+ }
67
+ }
68
+ elem.addClassName("disabled");
69
+ }
70
+ })
71
+ }
72
+
73
+
74
+ document.observe("dom:loaded", function() {
75
+ paylineToggleAllSections();
76
+ $("payline_payline_common_payline_enabled").observe("change", paylineToggleAllSections);
77
+ });
78
+ ';
79
+ return $this->toHtml() . $this->helper('adminhtml/js')->getScript($js);
80
+ }
81
+
82
+ public function getVersion()
83
+ {
84
+ $version = (string) $this->_getModuleConfig()->version;
85
+
86
+ return $version;
87
+ }
88
+
89
  public function getRelease()
90
  {
91
  $release = (string) $this->_getModuleConfig()->release;
92
 
93
  return $release;
94
+ }
95
+
96
  protected function _getModuleConfig()
97
  {
98
  $config = Mage::getConfig();
99
  return $config->getModuleConfig('Monext_Payline');
100
+ }
101
 
102
  public function getPaylineLogo()
103
  {
104
+ return $this->getSkinUrl('images/monext/payline-logo.png', array('_area'=>'frontend'));
105
+ }
106
+
107
  public function isProduction()
108
  {
109
  return Mage::helper('payline')->isProduction();
110
  }
111
+
112
+
113
+
114
+ }
app/code/community/Monext/Payline/Block/Adminhtml/System/Config/Form/Field/Contracts.php CHANGED
@@ -1,27 +1,27 @@
1
- <?php
2
-
3
-
4
- class Monext_Payline_Block_Adminhtml_System_Config_Form_Field_Contracts extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
5
- {
6
- protected $_yesNoRenderer=array();
7
-
8
- //protected $_renderer = 'select';
9
- protected $_renderer = 'onoffswitch';
10
-
11
  public function __construct()
12
  {
13
  $this->setTemplate('payline/system/config/form/field/array.phtml');
14
  parent::__construct();
15
- }
16
-
17
  protected function _getYesnoRenderer($input)
18
  {
19
  if (empty($this->_yesNoRenderer[$input])) {
20
  $this->_yesNoRenderer[$input] = $this->getLayout()->createBlock(
21
- (($this->_renderer == 'select') ?'core/html_select' :'payline/adminhtml_system_config_html_onoffswitch'),
22
  'contract_yesno_' . $input,
23
  array('is_render_to_js_template' => true, 'name'=>'contract_list[#{id}]['.$input.']', 'id'=>$input)
24
- );
25
  $this->_yesNoRenderer[$input]->setOptions(array('1' => Mage::helper('payline')->__('X'), '0' => Mage::helper('payline')->__('-')));
26
  $this->_yesNoRenderer[$input]->setExtraParams('style="width:60px"');
27
  }
@@ -32,146 +32,146 @@ class Monext_Payline_Block_Adminhtml_System_Config_Form_Field_Contracts extends
32
  * Prepare to render
33
  */
34
  protected function _prepareToRender()
35
- {
36
- $this->addColumn('name', array(
37
- 'label' => Mage::helper('payline')->__('Name'),
38
- ));
39
-
40
- $this->addColumn('number', array(
41
- 'label' => Mage::helper('payline')->__('Number'),
42
- ));
43
-
44
- $this->addColumn('point_of_sell', array(
45
- 'label' => Mage::helper('payline')->__('Point Of Sell'),
46
- ));
47
-
48
- $this->addColumn('is_primary', array(
49
- 'label' => Mage::helper('payline')->__('Primary'),
50
- 'renderer' => $this->_getYesnoRenderer('is_primary'),
51
- 'options' => array('1' => Mage::helper('payline')->__('X'), '0' => Mage::helper('payline')->__('-'))
52
- ));
53
-
54
- $this->addColumn('is_secondary', array(
55
- 'label' => Mage::helper('payline')->__('Secondary'),
56
- 'renderer' => $this->_getYesnoRenderer('is_secondary'),
57
- 'options' => array('1' => Mage::helper('payline')->__('X'), '0' => Mage::helper('payline')->__('-'))
58
- ));
59
-
60
- $this->addColumn('is_secure', array(
61
- 'label' => Mage::helper('payline')->__('Secure'),
62
- 'renderer' => $this->_getYesnoRenderer('is_secure'),
63
- 'options' => array('1' => Mage::helper('payline')->__('X'), '0' => Mage::helper('payline')->__('-'))
64
- ));
65
-
66
- $this->addColumn('is_included_wallet_list', array(
67
- 'label' => Mage::helper('payline')->__('Wallet'),
68
- 'renderer' => $this->_getYesnoRenderer('is_included_wallet_list'),
69
- 'options' => array('1' => Mage::helper('payline')->__('X'), '0' => Mage::helper('payline')->__('-'))
70
- ));
71
-
72
  $this->_addAfter = false;
73
- }
74
-
75
- /**
76
- * Add type property to column
77
- *
78
- * @param string $name
79
- * @param array $params
80
- */
81
- public function addColumn($name, $params)
82
- {
83
- parent::addColumn($name, $params);
84
- if(array_key_exists($name,$this->_columns))
85
- $this->_columns[$name]['type'] = empty($params['type']) ? 'readonly' : $params['type'];
86
- }
87
-
88
-
89
  /**
90
  * Prepare existing row data object
91
  *
92
  * @param Varien_Object
93
  */
94
  protected function _prepareArrayRow(Varien_Object $row)
95
- {
96
-
97
- if ($this->_renderer == 'select') {
98
- $defaultOptionSet = 'selected="selected"';
99
- } else {
100
- $defaultOptionSet = 'checked="checked"';
101
- }
102
-
103
-
104
- if ($row->getData('is_primary')) {
105
  $row->setData(
106
  'option_extra_attr_' . $this->_getYesnoRenderer('is_primary')->calcOptionHash(1),
107
  $defaultOptionSet
108
- );
109
- }
110
-
111
  if ($row->getData('is_secondary')) {
112
  $row->setData(
113
  'option_extra_attr_' . $this->_getYesnoRenderer('is_secondary')->calcOptionHash(1),
114
  $defaultOptionSet
115
  );
116
- }
117
-
118
  if ($row->getData('is_secure')) {
119
  $row->setData(
120
  'option_extra_attr_' . $this->_getYesnoRenderer('is_secure')->calcOptionHash(1),
121
  $defaultOptionSet
122
  );
123
- }
124
-
125
  if ($row->getData('is_included_wallet_list')) {
126
  $row->setData(
127
  'option_extra_attr_' . $this->_getYesnoRenderer('is_included_wallet_list')->calcOptionHash(1),
128
  $defaultOptionSet
129
  );
130
- }
131
-
132
- }
133
-
134
- /**
135
- * Check if type property is defined and render array cell for prototypeJS template
136
- *
137
- * @param string $columnName
138
- * @return string
139
- */
140
- protected function _renderCellTemplate($columnName)
141
- {
142
- if (empty($this->_columns[$columnName])) {
143
- throw new Exception('Wrong column name specified.');
144
- }
145
- $column = $this->_columns[$columnName];
146
- if(!array_key_exists('type',$column) || $column['type'] == 'text' || $column['renderer'])
147
- return parent::_renderCellTemplate($columnName);
148
-
149
- $inputName = $this->getElement()->getName() . '[#{_id}][' . $columnName . ']';
150
- if (!empty($column['type'])) {
151
- if ($column['type']=='readonly') {
152
- return '#{' . $columnName . '}';
153
- }
154
- }
155
-
156
- return '<input type="' . $column['type'] . '" name="' . $inputName . '" value="#{' . $columnName . '}" ' .
157
- ($column['size'] ? 'size="' . $column['size'] . '"' : '') . ' class="' .
158
- (isset($column['class']) ? $column['class'] : 'input-text') . '"'.
159
- (isset($column['style']) ? ' style="'.$column['style'] . '"' : '') . '/>';
160
-
161
- }
162
-
163
- /**
164
- *
165
- */
166
- public function getImportContractUrl()
167
- {
168
- return Mage::helper("adminhtml")->getUrl('adminhtml/payline_managecontracts/importFromConfig');
169
- }
170
-
171
- public function canDisplayImportButton()
172
- {
173
- $element = $this->getElement();
174
-
175
- return (!$element->getCanUseWebsiteValue() && !$element->getCanUseDefaultValue());
176
- }
177
- }
1
+ <?php
2
+
3
+
4
+ class Monext_Payline_Block_Adminhtml_System_Config_Form_Field_Contracts extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
5
+ {
6
+ protected $_yesNoRenderer=array();
7
+
8
+ //protected $_renderer = 'select';
9
+ protected $_renderer = 'onoffswitch';
10
+
11
  public function __construct()
12
  {
13
  $this->setTemplate('payline/system/config/form/field/array.phtml');
14
  parent::__construct();
15
+ }
16
+
17
  protected function _getYesnoRenderer($input)
18
  {
19
  if (empty($this->_yesNoRenderer[$input])) {
20
  $this->_yesNoRenderer[$input] = $this->getLayout()->createBlock(
21
+ (($this->_renderer == 'select') ?'core/html_select' :'payline/adminhtml_system_config_html_onoffswitch'),
22
  'contract_yesno_' . $input,
23
  array('is_render_to_js_template' => true, 'name'=>'contract_list[#{id}]['.$input.']', 'id'=>$input)
24
+ );
25
  $this->_yesNoRenderer[$input]->setOptions(array('1' => Mage::helper('payline')->__('X'), '0' => Mage::helper('payline')->__('-')));
26
  $this->_yesNoRenderer[$input]->setExtraParams('style="width:60px"');
27
  }
32
  * Prepare to render
33
  */
34
  protected function _prepareToRender()
35
+ {
36
+ $this->addColumn('name', array(
37
+ 'label' => Mage::helper('payline')->__('Name'),
38
+ ));
39
+
40
+ $this->addColumn('number', array(
41
+ 'label' => Mage::helper('payline')->__('Number'),
42
+ ));
43
+
44
+ $this->addColumn('point_of_sell', array(
45
+ 'label' => Mage::helper('payline')->__('Point Of Sell'),
46
+ ));
47
+
48
+ $this->addColumn('is_primary', array(
49
+ 'label' => Mage::helper('payline')->__('Primary'),
50
+ 'renderer' => $this->_getYesnoRenderer('is_primary'),
51
+ 'options' => array('1' => Mage::helper('payline')->__('X'), '0' => Mage::helper('payline')->__('-'))
52
+ ));
53
+
54
+ $this->addColumn('is_secondary', array(
55
+ 'label' => Mage::helper('payline')->__('Secondary'),
56
+ 'renderer' => $this->_getYesnoRenderer('is_secondary'),
57
+ 'options' => array('1' => Mage::helper('payline')->__('X'), '0' => Mage::helper('payline')->__('-'))
58
+ ));
59
+
60
+ $this->addColumn('is_secure', array(
61
+ 'label' => Mage::helper('payline')->__('Secure'),
62
+ 'renderer' => $this->_getYesnoRenderer('is_secure'),
63
+ 'options' => array('1' => Mage::helper('payline')->__('X'), '0' => Mage::helper('payline')->__('-'))
64
+ ));
65
+
66
+ $this->addColumn('is_included_wallet_list', array(
67
+ 'label' => Mage::helper('payline')->__('Wallet'),
68
+ 'renderer' => $this->_getYesnoRenderer('is_included_wallet_list'),
69
+ 'options' => array('1' => Mage::helper('payline')->__('X'), '0' => Mage::helper('payline')->__('-'))
70
+ ));
71
+
72
  $this->_addAfter = false;
73
+ }
74
+
75
+ /**
76
+ * Add type property to column
77
+ *
78
+ * @param string $name
79
+ * @param array $params
80
+ */
81
+ public function addColumn($name, $params)
82
+ {
83
+ parent::addColumn($name, $params);
84
+ if(array_key_exists($name,$this->_columns))
85
+ $this->_columns[$name]['type'] = empty($params['type']) ? 'readonly' : $params['type'];
86
+ }
87
+
88
+
89
  /**
90
  * Prepare existing row data object
91
  *
92
  * @param Varien_Object
93
  */
94
  protected function _prepareArrayRow(Varien_Object $row)
95
+ {
96
+
97
+ if ($this->_renderer == 'select') {
98
+ $defaultOptionSet = 'selected="selected"';
99
+ } else {
100
+ $defaultOptionSet = 'checked="checked"';
101
+ }
102
+
103
+
104
+ if ($row->getData('is_primary')) {
105
  $row->setData(
106
  'option_extra_attr_' . $this->_getYesnoRenderer('is_primary')->calcOptionHash(1),
107
  $defaultOptionSet
108
+ );
109
+ }
110
+
111
  if ($row->getData('is_secondary')) {
112
  $row->setData(
113
  'option_extra_attr_' . $this->_getYesnoRenderer('is_secondary')->calcOptionHash(1),
114
  $defaultOptionSet
115
  );
116
+ }
117
+
118
  if ($row->getData('is_secure')) {
119
  $row->setData(
120
  'option_extra_attr_' . $this->_getYesnoRenderer('is_secure')->calcOptionHash(1),
121
  $defaultOptionSet
122
  );
123
+ }
124
+
125
  if ($row->getData('is_included_wallet_list')) {
126
  $row->setData(
127
  'option_extra_attr_' . $this->_getYesnoRenderer('is_included_wallet_list')->calcOptionHash(1),
128
  $defaultOptionSet
129
  );
130
+ }
131
+
132
+ }
133
+
134
+ /**
135
+ * Check if type property is defined and render array cell for prototypeJS template
136
+ *
137
+ * @param string $columnName
138
+ * @return string
139
+ */
140
+ protected function _renderCellTemplate($columnName)
141
+ {
142
+ if (empty($this->_columns[$columnName])) {
143
+ throw new Exception('Wrong column name specified.');
144
+ }
145
+ $column = $this->_columns[$columnName];
146
+ if(!array_key_exists('type',$column) || $column['type'] == 'text' || $column['renderer'])
147
+ return parent::_renderCellTemplate($columnName);
148
+
149
+ $inputName = $this->getElement()->getName() . '[#{_id}][' . $columnName . ']';
150
+ if (!empty($column['type'])) {
151
+ if ($column['type']=='readonly') {
152
+ return '#{' . $columnName . '}';
153
+ }
154
+ }
155
+
156
+ return '<input type="' . $column['type'] . '" name="' . $inputName . '" value="#{' . $columnName . '}" ' .
157
+ ($column['size'] ? 'size="' . $column['size'] . '"' : '') . ' class="' .
158
+ (isset($column['class']) ? $column['class'] : 'input-text') . '"'.
159
+ (isset($column['style']) ? ' style="'.$column['style'] . '"' : '') . '/>';
160
+
161
+ }
162
+
163
+ /**
164
+ *
165
+ */
166
+ public function getImportContractUrl()
167
+ {
168
+ return Mage::helper("adminhtml")->getUrl('adminhtml/payline_managecontracts/importFromConfig');
169
+ }
170
+
171
+ public function canDisplayImportButton()
172
+ {
173
+ $element = $this->getElement();
174
+
175
+ return (!$element->getCanUseWebsiteValue() && !$element->getCanUseDefaultValue());
176
+ }
177
+ }
app/code/community/Monext/Payline/Block/Adminhtml/System/Config/Html/Onoffswitch.php CHANGED
@@ -1,30 +1,30 @@
1
- <?php
2
-
3
- class Monext_Payline_Block_Adminhtml_System_Config_Html_Onoffswitch extends Mage_Core_Block_Html_Select
4
- {
5
- /**
6
- * Render HTML
7
- *
8
- * @return string
9
- */
10
- protected function _toHtml()
11
- {
12
- if (!$this->_beforeToHtml()) {
13
- return '';
14
- }
15
-
16
- $html = '<div class="onoffswitch">' .
17
- '<input type="checkbox" name="' . $this->getName() . '" class="onoffswitch-checkbox" id="' . preg_replace('/[\[\]]+/', '_', $this->getName()) . '" value="1" ' .
18
- '#{option_extra_attr_' . self::calcOptionHash(1) . '}' .
19
- '>' .
20
- '<label class="onoffswitch-label" for="' . preg_replace('/[\[\]]+/', '_', $this->getName()) . '">' .
21
- '<span class="onoffswitch-inner"></span>' .
22
- '<span class="onoffswitch-switch"></span>' .
23
- '</label>' .
24
- '</div>';
25
-
26
- return $html;
27
- }
28
-
29
-
30
- }
1
+ <?php
2
+
3
+ class Monext_Payline_Block_Adminhtml_System_Config_Html_Onoffswitch extends Mage_Core_Block_Html_Select
4
+ {
5
+ /**
6
+ * Render HTML
7
+ *
8
+ * @return string
9
+ */
10
+ protected function _toHtml()
11
+ {
12
+ if (!$this->_beforeToHtml()) {
13
+ return '';
14
+ }
15
+
16
+ $html = '<div class="onoffswitch">' .
17
+ '<input type="checkbox" name="' . $this->getName() . '" class="onoffswitch-checkbox" id="' . preg_replace('/[\[\]]+/', '_', $this->getName()) . '" value="1" ' .
18
+ '#{option_extra_attr_' . self::calcOptionHash(1) . '}' .
19
+ '>' .
20
+ '<label class="onoffswitch-label" for="' . preg_replace('/[\[\]]+/', '_', $this->getName()) . '">' .
21
+ '<span class="onoffswitch-inner"></span>' .
22
+ '<span class="onoffswitch-switch"></span>' .
23
+ '</label>' .
24
+ '</div>';
25
+
26
+ return $html;
27
+ }
28
+
29
+
30
+ }
app/code/community/Monext/Payline/Block/Checkout/Head.php CHANGED
@@ -1,13 +1,13 @@
1
- <?php
2
-
3
- /**
4
- * payline fees total block for checkout
5
- *
6
- */
7
- class Monext_Payline_Block_Checkout_Total extends Mage_Checkout_Block_Total_Default
8
- {
9
- /**
10
- * @var string
11
- */
12
- protected $_template = 'payline/checkout/total.phtml';
13
- }
1
+ <?php
2
+
3
+ /**
4
+ * payline fees total block for checkout
5
+ *
6
+ */
7
+ class Monext_Payline_Block_Checkout_Total extends Mage_Checkout_Block_Total_Default
8
+ {
9
+ /**
10
+ * @var string
11
+ */
12
+ protected $_template = 'payline/checkout/total.phtml';
13
+ }
app/code/community/Monext/Payline/Block/Checkout/Total.php CHANGED
@@ -1,20 +1,20 @@
1
- <?php
2
- class Monext_Payline_Block_Checkout_Head extends Mage_Core_Block_Template
3
- {
4
- /**
5
- * Adding JS scripts and styles to block
6
- *
7
- * @throws Mage_Core_Exception
8
- * @return Mage_Adminhtml_Block_Widget_Form_Container
9
- */
10
- protected function _prepareLayout()
11
- {
12
- if (!Mage::helper('payline')->disableOnepagePaymentStep()) {
13
- return $this;
14
- }
15
-
16
- $blockHead = $this->getLayout()->getBlock('head');
17
-
18
- return parent::_prepareLayout();
19
- }
20
- }
1
+ <?php
2
+ class Monext_Payline_Block_Checkout_Head extends Mage_Core_Block_Template
3
+ {
4
+ /**
5
+ * Adding JS scripts and styles to block
6
+ *
7
+ * @throws Mage_Core_Exception
8
+ * @return Mage_Adminhtml_Block_Widget_Form_Container
9
+ */
10
+ protected function _prepareLayout()
11
+ {
12
+ if (!Mage::helper('payline')->disableOnepagePaymentStep()) {
13
+ return $this;
14
+ }
15
+
16
+ $blockHead = $this->getLayout()->getBlock('head');
17
+
18
+ return parent::_prepareLayout();
19
+ }
20
+ }
app/code/community/Monext/Payline/Block/Checkout/Widget/Header.php CHANGED
@@ -1,15 +1,15 @@
1
- <?php
2
- class Monext_Payline_Block_Checkout_Widget_Header extends Mage_Core_Block_Text {
3
-
4
-
5
- public function getText()
6
- {
7
- $paylineSDK = Mage::helper('payline')->initPayline('CPT');
8
-
9
- $text = array();
10
- $text []= '<script src="' . $paylineSDK->getWidgetJavascriptUrl() .'"></script>';
11
- $text []= '<link rel="stylesheet" href="' . $paylineSDK->getWidgetCssUrl() .'">';
12
-
13
- return implode(PHP_EOL, $text);
14
- }
15
  }
1
+ <?php
2
+ class Monext_Payline_Block_Checkout_Widget_Header extends Mage_Core_Block_Text {
3
+
4
+
5
+ public function getText()
6
+ {
7
+ $paylineSDK = Mage::helper('payline')->initPayline('CPT');
8
+
9
+ $text = array();
10
+ $text []= '<script src="' . $paylineSDK->getWidgetJavascriptUrl() .'"></script>';
11
+ $text []= '<link rel="stylesheet" href="' . $paylineSDK->getWidgetCssUrl() .'">';
12
+
13
+ return implode(PHP_EOL, $text);
14
+ }
15
  }
app/code/community/Monext/Payline/Block/Checkout/Widget/Opcheckout.php CHANGED
@@ -1,116 +1,116 @@
1
- <?php
2
-
3
- class Monext_Payline_Block_Checkout_Widget_Opcheckout extends Mage_Checkout_Block_Onepage_Payment_Methods
4
- {
5
- protected $_custom_methods;
6
-
7
- public function __construct()
8
- {
9
- parent::__construct();
10
- $this->setTemplate('payline/checkout/onepage/widget-opcheckout-js.phtml');
11
- }
12
-
13
- /**
14
- *
15
- * @param Mage_Sales_Block_Order_History $block
16
- * @param Varien_Object $transport
17
- */
18
- public function addHtmlAsChild($block, $transport)
19
- {
20
- $transport->setHtml($transport->getHtml() . $this->_toHtml());
21
- }
22
-
23
-
24
-
25
- /**
26
- * Retrieve available payment methods
27
- *
28
- * @return array
29
- */
30
- public function getAllMethods()
31
- {
32
- $quote = $this->getQuote();
33
- $store = $quote ? $quote->getStoreId() : null;
34
- $methods = array();
35
- foreach ($this->helper('payment')->getStoreMethods($store, $quote) as $method) {
36
- $methods[] = $method;
37
- }
38
- return $methods;
39
- }
40
-
41
-
42
-
43
-
44
- public function getJsonAllMethods()
45
- {
46
- if (is_null($this->_custom_methods)) {
47
- $customMethods = array();
48
- $methods = $this->getAllMethods();
49
- if (!empty($methods)) {
50
- foreach ($methods as $_method) {
51
- $_code = $_method->getCode();
52
- if(stripos($_code,'payline')!==false) {
53
- continue;
54
- }
55
- $html = preg_replace('/display:none;/', '', $this->getPaymentMethodFormHtml($_method));
56
- $html = str_replace(array("\r\n","\r","\n"),"",$this->jsQuoteEscape($html));
57
-
58
- //$html = $this->getPaymentMethodFormHtml($_method);
59
- $customMethods[] = array('code'=>$_code,
60
- 'title'=>$this->escapeHtml($this->getMethodTitle($_method)),
61
- 'label'=>$this->getMethodLabelAfterHtml($_method),
62
- 'html' => ($html) ? $html : $this->getMethodTitle($_method)
63
- );
64
- }
65
- }
66
-
67
- $this->_custom_methods = $customMethods;
68
- }
69
- return Mage::helper('core')->jsonEncode($this->_custom_methods);
70
- }
71
-
72
- public function getJsonCurrentMethods()
73
- {
74
- $currentMethods = array();
75
- $methods = $this->getMethods();
76
- if (!empty($methods)) {
77
- foreach ($methods as $_method) {
78
- $_code = $_method->getCode();
79
- if(stripos($_code,'payline')!==false) {
80
- continue;
81
- } else {
82
- $currentMethods[$_code] = $_code;
83
- }
84
- }
85
- }
86
-
87
- return Mage::helper('core')->jsonEncode($currentMethods);
88
- }
89
-
90
- public function getSaveUrl()
91
- {
92
- return Mage::getUrl('payline/index/cptWidgetCustom');
93
- }
94
-
95
- /**
96
- * Getter
97
- *
98
- * @return string
99
- */
100
- public function getCurrencyCode()
101
- {
102
- return $this->getQuote()->getBaseCurrencyCode();
103
- }
104
-
105
- /**
106
- * Getter
107
- *
108
- * @return float
109
- */
110
- public function getQuoteBaseGrandTotal()
111
- {
112
- return (float)$this->getQuote()->getBaseGrandTotal();
113
- }
114
-
115
-
116
- }
1
+ <?php
2
+
3
+ class Monext_Payline_Block_Checkout_Widget_Opcheckout extends Mage_Checkout_Block_Onepage_Payment_Methods
4
+ {
5
+ protected $_custom_methods;
6
+
7
+ public function __construct()
8
+ {
9
+ parent::__construct();
10
+ $this->setTemplate('payline/checkout/onepage/widget-opcheckout-js.phtml');
11
+ }
12
+
13
+ /**
14
+ *
15
+ * @param Mage_Sales_Block_Order_History $block
16
+ * @param Varien_Object $transport
17
+ */
18
+ public function addHtmlAsChild($block, $transport)
19
+ {
20
+ $transport->setHtml($transport->getHtml() . $this->_toHtml());
21
+ }
22
+
23
+
24
+
25
+ /**
26
+ * Retrieve available payment methods
27
+ *
28
+ * @return array
29
+ */
30
+ public function getAllMethods()
31
+ {
32
+ $quote = $this->getQuote();
33
+ $store = $quote ? $quote->getStoreId() : null;
34
+ $methods = array();
35
+ foreach ($this->helper('payment')->getStoreMethods($store, $quote) as $method) {
36
+ $methods[] = $method;
37
+ }
38
+ return $methods;
39
+ }
40
+
41
+
42
+
43
+
44
+ public function getJsonAllMethods()
45
+ {
46
+ if (is_null($this->_custom_methods)) {
47
+ $customMethods = array();
48
+ $methods = $this->getAllMethods();
49
+ if (!empty($methods)) {
50
+ foreach ($methods as $_method) {
51
+ $_code = $_method->getCode();
52
+ if(stripos($_code,'payline')!==false) {
53
+ continue;
54
+ }
55
+ $html = preg_replace('/display:none;/', '', $this->getPaymentMethodFormHtml($_method));
56
+ $html = str_replace(array("\r\n","\r","\n"),"",$this->jsQuoteEscape($html));
57
+
58
+ //$html = $this->getPaymentMethodFormHtml($_method);
59
+ $customMethods[] = array('code'=>$_code,
60
+ 'title'=>$this->escapeHtml($this->getMethodTitle($_method)),
61
+ 'label'=>$this->getMethodLabelAfterHtml($_method),
62
+ 'html' => ($html) ? $html : $this->getMethodTitle($_method)
63
+ );
64
+ }
65
+ }
66
+
67
+ $this->_custom_methods = $customMethods;
68
+ }
69
+ return Mage::helper('core')->jsonEncode($this->_custom_methods);
70
+ }
71
+
72
+ public function getJsonCurrentMethods()
73
+ {
74
+ $currentMethods = array();
75
+ $methods = $this->getMethods();
76
+ if (!empty($methods)) {
77
+ foreach ($methods as $_method) {
78
+ $_code = $_method->getCode();
79
+ if(stripos($_code,'payline')!==false) {
80
+ continue;
81
+ } else {
82
+ $currentMethods[$_code] = $_code;
83
+ }
84
+ }
85
+ }
86
+
87
+ return Mage::helper('core')->jsonEncode($currentMethods);
88
+ }
89
+
90
+ public function getSaveUrl()
91
+ {
92
+ return Mage::getUrl('payline/index/cptWidgetCustom');
93
+ }
94
+
95
+ /**
96
+ * Getter
97
+ *
98
+ * @return string
99
+ */
100
+ public function getCurrencyCode()
101
+ {
102
+ return $this->getQuote()->getBaseCurrencyCode();
103
+ }
104
+
105
+ /**
106
+ * Getter
107
+ *
108
+ * @return float
109
+ */
110
+ public function getQuoteBaseGrandTotal()
111
+ {
112
+ return (float)$this->getQuote()->getBaseGrandTotal();
113
+ }
114
+
115
+
116
+ }
app/code/community/Monext/Payline/Block/Cpt.php CHANGED
File without changes
app/code/community/Monext/Payline/Block/Direct.php CHANGED
@@ -95,7 +95,7 @@ class Monext_Payline_Block_Direct extends Mage_Payment_Block_Form
95
  public function hasVerification()
96
  {
97
  return true;
98
- }
99
 
100
  public function getAjaxErrors()
101
  {
95
  public function hasVerification()
96
  {
97
  return true;
98
+ }
99
 
100
  public function getAjaxErrors()
101
  {
app/code/community/Monext/Payline/Block/Info/Default.php CHANGED
@@ -1,13 +1,13 @@
1
- <?php
2
- /**
3
- * Base payment iformation block
4
- *
5
- */
6
- class Monext_Payline_Block_Info_Default extends Mage_Payment_Block_Info
7
- {
8
- protected function _construct()
9
- {
10
- parent::_construct();
11
- $this->setTemplate('payline/payment/info/monext.phtml');
12
- }
13
  }
1
+ <?php
2
+ /**
3
+ * Base payment iformation block
4
+ *
5
+ */
6
+ class Monext_Payline_Block_Info_Default extends Mage_Payment_Block_Info
7
+ {
8
+ protected function _construct()
9
+ {
10
+ parent::_construct();
11
+ $this->setTemplate('payline/payment/info/monext.phtml');
12
+ }
13
  }
app/code/community/Monext/Payline/Block/Info/Direct.php CHANGED
@@ -1,55 +1,55 @@
1
- <?php
2
-
3
- class Monext_Payline_Block_Info_Direct extends Mage_Payment_Block_Info_Cc
4
- {
5
-
6
- protected function _construct()
7
- {
8
- parent::_construct();
9
- $this->setTemplate('payline/payment/info/monext.phtml');
10
- }
11
-
12
- protected function _prepareSpecificInformation($transport = null)
13
- {
14
- if (null !== $this->_paymentSpecificInformation) {
15
- return $this->_paymentSpecificInformation;
16
- }
17
- $transport = new Varien_Object($transport);
18
- $data = array();
19
- if ($this->getInfo()->getCcType()) {
20
- $contract = $this->_getContract($this->getInfo());
21
- $ccType = strtolower($contract->getContractType());
22
-
23
- // Force to the frontend area
24
- $currentArea = Mage::getDesign()->getArea();
25
- Mage::getDesign()->setArea(Mage_Core_Model_Design_Package::DEFAULT_AREA);
26
-
27
- // The images are only in the rontend skin directory
28
- $img = '<img src="'.$this->getSkinUrl('images/monext/'.$ccType.'.gif').'" />';
29
-
30
- // Un-Force the area
31
- Mage::getDesign()->setArea($currentArea);
32
-
33
- $data[Mage::helper('payline')->__('Credit Card Type')] = $img;
34
- }
35
- if ($this->getInfo()->getCcLast4()) {
36
- $data[Mage::helper('payment')->__('Number')] = sprintf('xxxx-%s', $this->getInfo()->getCcLast4());
37
- }
38
- $year = $this->getInfo()->getCcExpYear();
39
- $month = $this->getInfo()->getCcExpMonth();
40
- if ($year && $month) {
41
- $data[Mage::helper('payline')->__('Exp date')] = $this->_formatCardDate($year, $month);
42
- }
43
- $this->_paymentSpecificInformation = $transport;
44
- return $transport->setData(array_merge($data, $transport->getData()));
45
- }
46
-
47
- /**
48
- * Get the contract
49
- * @return Monext_Payline_Model_Contract
50
- */
51
- protected function _getContract(Varien_Object $info)
52
- {
53
- return Mage::helper('payline/payment')->getContractByData($info);
54
- }
55
  }
1
+ <?php
2
+
3
+ class Monext_Payline_Block_Info_Direct extends Mage_Payment_Block_Info_Cc
4
+ {
5
+
6
+ protected function _construct()
7
+ {
8
+ parent::_construct();
9
+ $this->setTemplate('payline/payment/info/monext.phtml');
10
+ }
11
+
12
+ protected function _prepareSpecificInformation($transport = null)
13
+ {
14
+ if (null !== $this->_paymentSpecificInformation) {
15
+ return $this->_paymentSpecificInformation;
16
+ }
17
+ $transport = new Varien_Object($transport);
18
+ $data = array();
19
+ if ($this->getInfo()->getCcType()) {
20
+ $contract = $this->_getContract($this->getInfo());
21
+ $ccType = strtolower($contract->getContractType());
22
+
23
+ // Force to the frontend area
24
+ $currentArea = Mage::getDesign()->getArea();
25
+ Mage::getDesign()->setArea(Mage_Core_Model_Design_Package::DEFAULT_AREA);
26
+
27
+ // The images are only in the rontend skin directory
28
+ $img = '<img src="'.$this->getSkinUrl('images/monext/'.$ccType.'.gif').'" />';
29
+
30
+ // Un-Force the area
31
+ Mage::getDesign()->setArea($currentArea);
32
+
33
+ $data[Mage::helper('payline')->__('Credit Card Type')] = $img;
34
+ }
35
+ if ($this->getInfo()->getCcLast4()) {
36
+ $data[Mage::helper('payment')->__('Number')] = sprintf('xxxx-%s', $this->getInfo()->getCcLast4());
37
+ }
38
+ $year = $this->getInfo()->getCcExpYear();
39
+ $month = $this->getInfo()->getCcExpMonth();
40
+ if ($year && $month) {
41
+ $data[Mage::helper('payline')->__('Exp date')] = $this->_formatCardDate($year, $month);
42
+ }
43
+ $this->_paymentSpecificInformation = $transport;
44
+ return $transport->setData(array_merge($data, $transport->getData()));
45
+ }
46
+
47
+ /**
48
+ * Get the contract
49
+ * @return Monext_Payline_Model_Contract
50
+ */
51
+ protected function _getContract(Varien_Object $info)
52
+ {
53
+ return Mage::helper('payline/payment')->getContractByData($info);
54
+ }
55
  }
app/code/community/Monext/Payline/Block/Logo.php CHANGED
@@ -1,15 +1,15 @@
1
- <?php
2
- class Monext_Payline_Block_Logo extends Mage_Core_Block_Template{
3
- protected function isPaylineAvailable(){
4
- if (
5
- Mage::getStoreConfig('payment/PaylineCPT/active') ||
6
- Mage::getStoreConfig('payment/PaylineNX/active') ||
7
- Mage::getStoreConfig('payment/PaylineDIRECT/active') ||
8
- Mage::getStoreConfig('payment/PaylineWALLET/active'))
9
- {
10
- return true;
11
- }else{
12
- return false;
13
- }
14
- }
15
- }
1
+ <?php
2
+ class Monext_Payline_Block_Logo extends Mage_Core_Block_Template{
3
+ protected function isPaylineAvailable(){
4
+ if (
5
+ Mage::getStoreConfig('payment/PaylineCPT/active') ||
6
+ Mage::getStoreConfig('payment/PaylineNX/active') ||
7
+ Mage::getStoreConfig('payment/PaylineDIRECT/active') ||
8
+ Mage::getStoreConfig('payment/PaylineWALLET/active'))
9
+ {
10
+ return true;
11
+ }else{
12
+ return false;
13
+ }
14
+ }
15
+ }
app/code/community/Monext/Payline/Block/Nx.php CHANGED
File without changes
app/code/community/Monext/Payline/Block/Wallet.php CHANGED
@@ -1,24 +1,24 @@
1
- <?php
2
- class Monext_Payline_Block_Wallet extends Mage_Payment_Block_Form {
3
- protected $_walletData;
4
-
5
- protected function _construct() {
6
- parent::_construct();
7
-
8
- $this->setTemplate('payline/wallet/form.phtml');
9
- }
10
-
11
- public function getWalletData(){
12
- if (!empty($this->_walletData)){
13
- return $this->_walletData;
14
- }
15
- $wallet=$this->getMethod()->getWalletData();
16
- $data=array(
17
- $this->__('Card type')=>$wallet['card']['type'],
18
- $this->__('Number')=>$wallet['card']['number'],
19
- $this->__('Exp. date')=>$wallet['card']['expirationDate']
20
- );
21
- $this->_walletData=$data;
22
- return $data;
23
- }
24
  }
1
+ <?php
2
+ class Monext_Payline_Block_Wallet extends Mage_Payment_Block_Form {
3
+ protected $_walletData;
4
+
5
+ protected function _construct() {
6
+ parent::_construct();
7
+
8
+ $this->setTemplate('payline/wallet/form.phtml');
9
+ }
10
+
11
+ public function getWalletData(){
12
+ if (!empty($this->_walletData)){
13
+ return $this->_walletData;
14
+ }
15
+ $wallet=$this->getMethod()->getWalletData();
16
+ $data=array(
17
+ $this->__('Card type')=>$wallet['card']['type'],
18
+ $this->__('Number')=>$wallet['card']['number'],
19
+ $this->__('Exp. date')=>$wallet['card']['expirationDate']
20
+ );
21
+ $this->_walletData=$data;
22
+ return $data;
23
+ }
24
  }
app/code/community/Monext/Payline/Block/Wallet/Checkoutbtn.php CHANGED
@@ -1,28 +1,28 @@
1
- <?php
2
- class Monext_Payline_Block_Wallet_Checkoutbtn extends Mage_Core_Block_Template{
3
- protected $_template='payline/wallet/checkoutbtn.phtml';
4
-
5
- public function getRedirectUrl(){
6
- $redirectUrl = Mage::getUrl('payline/wallet/subscribe');
7
- if(Mage::getSingleton('customer/session')->isLoggedIn()){
8
- $customer=Mage::getSingleton('customer/session')->getCustomer();
9
- if ($customer->getWalletId()){
10
- //Check if the wallet payment is available
11
- /* @var $walletPaymentMethod Monext_Payline_Model_Wallet */
12
- $walletPaymentMethod=Mage::getModel('payline/wallet');
13
- if ($walletPaymentMethod->checkExpirationDate()){
14
- $redirectUrl = Mage::getUrl('payline/checkoutonepage/');
15
- }
16
- }
17
- }
18
- return $redirectUrl;
19
- }
20
-
21
- public function hasToDisplay()
22
- {
23
- $walletEnable = Mage::getStoreConfig('payment/PaylineWALLET/active');
24
- $oneClicEnable = Mage::getStoreConfig('payment/PaylineWALLET/enable_one_clic');
25
- $customer = Mage::getSingleton('customer/session')->getCustomer();
26
- return $walletEnable && $oneClicEnable && $customer->getWalletId() != '';
27
- }
28
  }
1
+ <?php
2
+ class Monext_Payline_Block_Wallet_Checkoutbtn extends Mage_Core_Block_Template{
3
+ protected $_template='payline/wallet/checkoutbtn.phtml';
4
+
5
+ public function getRedirectUrl(){
6
+ $redirectUrl = Mage::getUrl('payline/wallet/subscribe');
7
+ if(Mage::getSingleton('customer/session')->isLoggedIn()){
8
+ $customer=Mage::getSingleton('customer/session')->getCustomer();
9
+ if ($customer->getWalletId()){
10
+ //Check if the wallet payment is available
11
+ /* @var $walletPaymentMethod Monext_Payline_Model_Wallet */
12
+ $walletPaymentMethod=Mage::getModel('payline/wallet');
13
+ if ($walletPaymentMethod->checkExpirationDate()){
14
+ $redirectUrl = Mage::getUrl('payline/checkoutonepage/');
15
+ }
16
+ }
17
+ }
18
+ return $redirectUrl;
19
+ }
20
+
21
+ public function hasToDisplay()
22
+ {
23
+ $walletEnable = Mage::getStoreConfig('payment/PaylineWALLET/active');
24
+ $oneClicEnable = Mage::getStoreConfig('payment/PaylineWALLET/enable_one_clic');
25
+ $customer = Mage::getSingleton('customer/session')->getCustomer();
26
+ return $walletEnable && $oneClicEnable && $customer->getWalletId() != '';
27
+ }
28
  }
app/code/community/Monext/Payline/Block/Wallet/Details.php CHANGED
@@ -1,20 +1,20 @@
1
- <?php
2
-
3
- class Monext_Payline_Block_Wallet_Details extends Mage_Core_Block_Template
4
- {
5
-
6
- public $wallet = array();
7
- public $showShippingDetails;
8
-
9
- public function _construct($flag = null)
10
- {
11
- if ($flag === null) {
12
- $flag = (bool) Mage::getStoreConfig('payment/PaylineWALLET/update_personal_details');
13
- }
14
- $this->showShippingDetails = $flag;
15
-
16
- parent::_construct();
17
- $this->setTemplate('payline/wallet/details.phtml');
18
- }
19
-
20
- }
1
+ <?php
2
+
3
+ class Monext_Payline_Block_Wallet_Details extends Mage_Core_Block_Template
4
+ {
5
+
6
+ public $wallet = array();
7
+ public $showShippingDetails;
8
+
9
+ public function _construct($flag = null)
10
+ {
11
+ if ($flag === null) {
12
+ $flag = (bool) Mage::getStoreConfig('payment/PaylineWALLET/update_personal_details');
13
+ }
14
+ $this->showShippingDetails = $flag;
15
+
16
+ parent::_construct();
17
+ $this->setTemplate('payline/wallet/details.phtml');
18
+ }
19
+
20
+ }
app/code/community/Monext/Payline/Block/Wallet/Infos.php CHANGED
@@ -1,42 +1,42 @@
1
- <?php
2
- /** Display wallet payment info (usually in the checkout progress bar
3
- */
4
- class Monext_Payline_Block_Wallet_Infos extends Mage_Payment_Block_Info{
5
-
6
  protected function _construct()
7
  {
8
  parent::_construct();
9
  $this->setTemplate('payline/payment/info/monext.phtml');
10
- }
11
-
12
- /**
13
- * Prepare credit card related payment info
14
- *
15
- * @param Varien_Object|array $transport
16
- * @return Varien_Object
17
- */
18
- protected function _prepareSpecificInformation($transport = null)
19
- {
20
- if (null !== $this->_paymentSpecificInformation) {
21
- return $this->_paymentSpecificInformation;
22
- }
23
- $transport = parent::_prepareSpecificInformation($transport);
24
- $wallet=$this->getInfo()->getMethodInstance()->getWalletData();
25
- $data=array();
26
- if (!empty($wallet)){
27
- $cardNumber = substr($wallet['card']['number'], -4);
28
- $expMonth = substr($wallet['card']['expirationDate'], 0, 2);
29
- $expYear = substr($wallet['card']['expirationDate'], -2);
30
- $cardType = $wallet['card']['type'];
31
- $cardType = strtolower($cardType);
32
- $img = '<img src="'.$this->getSkinUrl('images/monext/'.$cardType.'.gif').'" />';
33
- $data=array(
34
- $this->__('Card type') => $img,
35
- $this->__('Number') => sprintf('xxxx-%s', $cardNumber),
36
- $this->__('Exp date') => $expMonth.'/'.$expYear
37
- );
38
- }
39
-
40
- return $transport->setData(array_merge($transport->getData(),$data));
41
- }
42
  }
1
+ <?php
2
+ /** Display wallet payment info (usually in the checkout progress bar
3
+ */
4
+ class Monext_Payline_Block_Wallet_Infos extends Mage_Payment_Block_Info{
5
+
6
  protected function _construct()
7
  {
8
  parent::_construct();
9
  $this->setTemplate('payline/payment/info/monext.phtml');
10
+ }
11
+
12
+ /**
13
+ * Prepare credit card related payment info
14
+ *
15
+ * @param Varien_Object|array $transport
16
+ * @return Varien_Object
17
+ */
18
+ protected function _prepareSpecificInformation($transport = null)
19
+ {
20
+ if (null !== $this->_paymentSpecificInformation) {
21
+ return $this->_paymentSpecificInformation;
22
+ }
23
+ $transport = parent::_prepareSpecificInformation($transport);
24
+ $wallet=$this->getInfo()->getMethodInstance()->getWalletData();
25
+ $data=array();
26
+ if (!empty($wallet)){
27
+ $cardNumber = substr($wallet['card']['number'], -4);
28
+ $expMonth = substr($wallet['card']['expirationDate'], 0, 2);
29
+ $expYear = substr($wallet['card']['expirationDate'], -2);
30
+ $cardType = $wallet['card']['type'];
31
+ $cardType = strtolower($cardType);
32
+ $img = '<img src="'.$this->getSkinUrl('images/monext/'.$cardType.'.gif').'" />';
33
+ $data=array(
34
+ $this->__('Card type') => $img,
35
+ $this->__('Number') => sprintf('xxxx-%s', $cardNumber),
36
+ $this->__('Exp date') => $expMonth.'/'.$expYear
37
+ );
38
+ }
39
+
40
+ return $transport->setData(array_merge($transport->getData(),$data));
41
+ }
42
  }
app/code/community/Monext/Payline/Block/Wallet/Sidebar.php CHANGED
@@ -1,131 +1,131 @@
1
- <?php
2
- class Monext_Payline_Block_Wallet_Sidebar extends Mage_Core_Block_Template{
3
-
4
- protected $_customer;
5
-
6
- /**
7
- * Get logged in customer
8
- *
9
- * @return Mage_Customer_Model_Customer
10
- */
11
- public function getCustomer()
12
- {
13
- if (empty($this->_customer)) {
14
- $this->_customer = Mage::getSingleton('customer/session')->getCustomer();
15
- }
16
- return $this->_customer;
17
- }
18
-
19
- /**
20
- * @return bool
21
- */
22
- public function isCustomerLoggedIn()
23
- {
24
- return Mage::getSingleton('customer/session')->isLoggedIn();
25
- }
26
-
27
- /**
28
- * Define if the sidebar is displayed
29
- *
30
- * @return bool
31
- */
32
- public function getIsNeedToDisplaySideBar()
33
- {
34
- if (Mage::getStoreConfig('payment/PaylineWALLET/active')){
35
- if (Mage::getStoreConfig('payment/PaylineWALLET/payline_register-oneclick_catalog') != ''){
36
- $showCmsBlock=true;
37
- }else{
38
- $showCmsBlock=false;
39
- }
40
- if($this->isCustomerLoggedIn()){
41
- $quote = Mage::getSingleton('checkout/session')->getQuote();
42
- $customer=$this->getCustomer();
43
- if ($customer->getWalletId() && $quote !== null && $quote->hasItems()){
44
- //if user doesn't have addresses, we don't display block
45
- if ($this->getAddressesHtmlSelect()){
46
- return true;
47
- }
48
- }else{
49
- //Customer doesn't have walletId, the CMS block will be shown if config is OK
50
- return $showCmsBlock;
51
- }
52
- }else{
53
- //Customer isn't logged in, the CMS blcok will be shown if config is OK
54
- return $showCmsBlock;
55
- }
56
- }
57
- return false;
58
- }
59
-
60
- /**
61
- * If customer logged & registered to wallet, display form
62
- * Otherwise, display configured static CMS bloc
63
- * @return string html code
64
- */
65
- public function getContent(){
66
- $hasWallet = false;
67
- if($this->isCustomerLoggedIn()){
68
- $customer=$this->getCustomer();
69
- if ($walletId=$customer->getWalletId()){
70
- $hasWallet = true;
71
- $quote = Mage::getSingleton('checkout/session')->getQuote();
72
- if ($quote !== null && $quote->hasItems()) {
73
- $formBlock=$this->getLayout()->createBlock('core/template');
74
- $formBlock->setTemplate('payline/wallet/sidebar/form.phtml');
75
- $formBlock->setBillingAddresses($this->getAddressesHtmlSelect('billing'));
76
- $formBlock->setShippingAddresses($this->getAddressesHtmlSelect('shipping'));
77
-
78
- return $formBlock->toHtml();
79
- }
80
- }
81
- }
82
- $blockId=Mage::getStoreConfig('payment/PaylineWALLET/payline_register-oneclick_catalog');
83
- /* @var $cmsBlock Mage_Cms_Block_Block */
84
- $cmsBlock=$this->getLayout()->createBlock('cms/block')->setBlockId($blockId);
85
- /* @var $notLoggedBlock Mage_Core_Block_Template */
86
- $notLoggedBlock = $this->getLayout()->createBlock('core/template')
87
- ->setTemplate('payline/wallet/sidebar/notlogged.phtml')
88
- ->setHasWallet($hasWallet);
89
- $notLoggedBlock->append($cmsBlock);
90
- return $notLoggedBlock->toHtml();
91
- }
92
-
93
- /**
94
- * Return a html select with the customer addresses
95
- * Retrieve wether billing or shipping addresses, depending on the $type param
96
- * @param string $type
97
- */
98
- public function getAddressesHtmlSelect($type=null)
99
- {
100
- if ($this->getCustomer()!=null) {
101
- $options = array();
102
- foreach ($this->getCustomer()->getAddresses() as $address) {
103
- $options[] = array(
104
- 'value'=>$address->getId(),
105
- 'label'=>$address->format('oneline')
106
- );
107
- }
108
- if (count($options)==0){
109
- return '';
110
- }
111
- if ($type=='billing') {
112
- $address = $this->getCustomer()->getPrimaryBillingAddress();
113
- } else {
114
- $address = $this->getCustomer()->getPrimaryShippingAddress();
115
- }
116
-
117
- $select = $this->getLayout()->createBlock('core/html_select')
118
- ->setName($type.'_address_id')
119
- ->setId($type.'-address-select')
120
- ->setClass('address-select')
121
- ->setOptions($options);
122
-
123
- if ($address) {
124
- $select->setValue($address->getId());
125
- }
126
-
127
- return $select->getHtml();
128
- }
129
- return '';
130
- }
131
- }
1
+ <?php
2
+ class Monext_Payline_Block_Wallet_Sidebar extends Mage_Core_Block_Template{
3
+
4
+ protected $_customer;
5
+
6
+ /**
7
+ * Get logged in customer
8
+ *
9
+ * @return Mage_Customer_Model_Customer
10
+ */
11
+ public function getCustomer()
12
+ {
13
+ if (empty($this->_customer)) {
14
+ $this->_customer = Mage::getSingleton('customer/session')->getCustomer();
15
+ }
16
+ return $this->_customer;
17
+ }
18
+
19
+ /**
20
+ * @return bool
21
+ */
22
+ public function isCustomerLoggedIn()
23
+ {
24
+ return Mage::getSingleton('customer/session')->isLoggedIn();
25
+ }
26
+
27
+ /**
28
+ * Define if the sidebar is displayed
29
+ *
30
+ * @return bool
31
+ */
32
+ public function getIsNeedToDisplaySideBar()
33
+ {
34
+ if (Mage::getStoreConfig('payment/PaylineWALLET/active')){
35
+ if (Mage::getStoreConfig('payment/PaylineWALLET/payline_register-oneclick_catalog') != ''){
36
+ $showCmsBlock=true;
37
+ }else{
38
+ $showCmsBlock=false;
39
+ }
40
+ if($this->isCustomerLoggedIn()){
41
+ $quote = Mage::getSingleton('checkout/session')->getQuote();
42
+ $customer=$this->getCustomer();
43
+ if ($customer->getWalletId() && $quote !== null && $quote->hasItems()){
44
+ //if user doesn't have addresses, we don't display block
45
+ if ($this->getAddressesHtmlSelect()){
46
+ return true;
47
+ }
48
+ }else{
49
+ //Customer doesn't have walletId, the CMS block will be shown if config is OK
50
+ return $showCmsBlock;
51
+ }
52
+ }else{
53
+ //Customer isn't logged in, the CMS blcok will be shown if config is OK
54
+ return $showCmsBlock;
55
+ }
56
+ }
57
+ return false;
58
+ }
59
+
60
+ /**
61
+ * If customer logged & registered to wallet, display form
62
+ * Otherwise, display configured static CMS bloc
63
+ * @return string html code
64
+ */
65
+ public function getContent(){
66
+ $hasWallet = false;
67
+ if($this->isCustomerLoggedIn()){
68
+ $customer=$this->getCustomer();
69
+ if ($walletId=$customer->getWalletId()){
70
+ $hasWallet = true;
71
+ $quote = Mage::getSingleton('checkout/session')->getQuote();
72
+ if ($quote !== null && $quote->hasItems()) {
73
+ $formBlock=$this->getLayout()->createBlock('core/template');
74
+ $formBlock->setTemplate('payline/wallet/sidebar/form.phtml');
75
+ $formBlock->setBillingAddresses($this->getAddressesHtmlSelect('billing'));
76
+ $formBlock->setShippingAddresses($this->getAddressesHtmlSelect('shipping'));
77
+
78
+ return $formBlock->toHtml();
79
+ }
80
+ }
81
+ }
82
+ $blockId=Mage::getStoreConfig('payment/PaylineWALLET/payline_register-oneclick_catalog');
83
+ /* @var $cmsBlock Mage_Cms_Block_Block */
84
+ $cmsBlock=$this->getLayout()->createBlock('cms/block')->setBlockId($blockId);
85
+ /* @var $notLoggedBlock Mage_Core_Block_Template */
86
+ $notLoggedBlock = $this->getLayout()->createBlock('core/template')
87
+ ->setTemplate('payline/wallet/sidebar/notlogged.phtml')
88
+ ->setHasWallet($hasWallet);
89
+ $notLoggedBlock->append($cmsBlock);
90
+ return $notLoggedBlock->toHtml();
91
+ }
92
+
93
+ /**
94
+ * Return a html select with the customer addresses
95
+ * Retrieve wether billing or shipping addresses, depending on the $type param
96
+ * @param string $type
97
+ */
98
+ public function getAddressesHtmlSelect($type=null)
99
+ {
100
+ if ($this->getCustomer()!=null) {
101
+ $options = array();
102
+ foreach ($this->getCustomer()->getAddresses() as $address) {
103
+ $options[] = array(
104
+ 'value'=>$address->getId(),
105
+ 'label'=>$address->format('oneline')
106
+ );
107
+ }
108
+ if (count($options)==0){
109
+ return '';
110
+ }
111
+ if ($type=='billing') {
112
+ $address = $this->getCustomer()->getPrimaryBillingAddress();
113
+ } else {
114
+ $address = $this->getCustomer()->getPrimaryShippingAddress();
115
+ }
116
+
117
+ $select = $this->getLayout()->createBlock('core/html_select')
118
+ ->setName($type.'_address_id')
119
+ ->setId($type.'-address-select')
120
+ ->setClass('address-select')
121
+ ->setOptions($options);
122
+
123
+ if ($address) {
124
+ $select->setValue($address->getId());
125
+ }
126
+
127
+ return $select->getHtml();
128
+ }
129
+ return '';
130
+ }
131
+ }
app/code/community/Monext/Payline/Helper/Category.php CHANGED
@@ -1,42 +1,42 @@
1
- <?php
2
-
3
- class Monext_Payline_Helper_Category extends Mage_Core_Helper_Data
4
- {
5
- protected $_category_tree;
6
-
7
- public function getAllCategoriesWithFullpathName()
8
- {
9
- if (is_null($this->_category_tree)) {
10
- $this->_category_tree = array();
11
-
12
- $categoryCollection = Mage::getModel('catalog/category')->getCollection()
13
- ->addAttributeToSelect('name')
14
- ->addAttributeToFilter('is_active','1');
15
-
16
- foreach ($categoryCollection as $category)
17
- {
18
- $path = explode('/', $category->getPath());
19
- $categoryFullPath = array();
20
- foreach ($path as $pathId)
21
- {
22
- $categoryByPath = $categoryCollection->getItemById($pathId);
23
- if($categoryByPath) {
24
- $categoryFullPath[] = $categoryByPath->getName();
25
- }
26
- }
27
- $this->_category_tree[$category->getId()] = implode('/', $categoryFullPath);
28
- }
29
- }
30
-
31
- return $this->_category_tree;
32
- }
33
-
34
- public function getCategoryFullpathName($category_id)
35
- {
36
- $categoryTree = $this->getAllCategoriesWithFullpathName();
37
-
38
- return (!empty($categoryTree[$category_id])) ? $categoryTree[$category_id] : '';
39
- }
40
-
41
-
42
- } // end class
1
+ <?php
2
+
3
+ class Monext_Payline_Helper_Category extends Mage_Core_Helper_Data
4
+ {
5
+ protected $_category_tree;
6
+
7
+ public function getAllCategoriesWithFullpathName()
8
+ {
9
+ if (is_null($this->_category_tree)) {
10
+ $this->_category_tree = array();
11
+
12
+ $categoryCollection = Mage::getModel('catalog/category')->getCollection()
13
+ ->addAttributeToSelect('name')
14
+ ->addAttributeToFilter('is_active','1');
15
+
16
+ foreach ($categoryCollection as $category)
17
+ {
18
+ $path = explode('/', $category->getPath());
19
+ $categoryFullPath = array();
20
+ foreach ($path as $pathId)
21
+ {
22
+ $categoryByPath = $categoryCollection->getItemById($pathId);
23
+ if($categoryByPath) {
24
+ $categoryFullPath[] = $categoryByPath->getName();
25
+ }
26
+ }
27
+ $this->_category_tree[$category->getId()] = implode('/', $categoryFullPath);
28
+ }
29
+ }
30
+
31
+ return $this->_category_tree;
32
+ }
33
+
34
+ public function getCategoryFullpathName($category_id)
35
+ {
36
+ $categoryTree = $this->getAllCategoriesWithFullpathName();
37
+
38
+ return (!empty($categoryTree[$category_id])) ? $categoryTree[$category_id] : '';
39
+ }
40
+
41
+
42
+ } // end class
app/code/community/Monext/Payline/Helper/Data.php CHANGED
File without changes
app/code/community/Monext/Payline/Helper/Logger.php CHANGED
@@ -1,66 +1,66 @@
1
- <?php
2
- /**
3
- * On Magento 1.3.2.4, the Mage::log method don't allow us to force log, so we've to log by an other way
4
- */
5
- require_once(Mage::getModuleDir('',"Monext_Payline") . '/lib/paylineSDK.php');
6
-
7
- class Monext_Payline_Helper_Logger extends Mage_Core_Helper_Abstract{
8
- const FILE = 'payline.log';
9
- const LEVEL = Zend_Log::DEBUG;
10
-
11
- protected static $loggers=array();
12
-
13
-
14
- /**
15
- * forced log facility
16
- *
17
- * @param string $message
18
- * @param integer $level
19
- * @param string $file
20
- * @param bool $forceLog
21
- */
22
- public function log($message, $level=null, $file=null){
23
- $level = is_null($level) ? self::LEVEL : $level;
24
- $file = empty($file) ? self::FILE : $file;
25
-
26
- try {
27
- if (!isset(self::$loggers[$file])) {
28
- $logFile = Mage::getBaseDir('var') . DS . 'log' . DS . $file;
29
-
30
- if (!is_dir(Mage::getBaseDir('var').DS.'log')) {
31
- mkdir(Mage::getBaseDir('var').DS.'log', 0777);
32
- }
33
-
34
- if (!file_exists($logFile)) {
35
- file_put_contents($logFile, '');
36
- chmod($logFile, 0777);
37
- }
38
-
39
- $format = '%timestamp% %priorityName% (%priority%): %message%' . PHP_EOL;
40
- $formatter = new Zend_Log_Formatter_Simple($format);
41
- $writerModel = Mage::getStoreConfig('global/log/core/writer_model');
42
- if (!$writerModel) {
43
- $writer = new Zend_Log_Writer_Stream($logFile);
44
- }
45
- else {
46
- $writer = new $writerModel($logFile);
47
- }
48
- $writer->setFormatter($formatter);
49
- self::$loggers[$file] = new Zend_Log($writer);
50
- }
51
-
52
- if (is_array($message) || is_object($message)) {
53
- $message = print_r($message, true);
54
- }
55
-
56
- if(Mage::getStoreConfig('payment/payline_common/environment') != paylineSDK::ENV_PROD and $level==Zend_Log::ERR) {
57
- Mage::getSingleton('core/session')->addError($message);
58
- }
59
-
60
- self::$loggers[$file]->log($message, $level);
61
-
62
- } catch (Exception $e) {
63
-
64
- }
65
- }
66
  }
1
+ <?php
2
+ /**
3
+ * On Magento 1.3.2.4, the Mage::log method don't allow us to force log, so we've to log by an other way
4
+ */
5
+ require_once(Mage::getModuleDir('',"Monext_Payline") . '/lib/paylineSDK.php');
6
+
7
+ class Monext_Payline_Helper_Logger extends Mage_Core_Helper_Abstract{
8
+ const FILE = 'payline.log';
9
+ const LEVEL = Zend_Log::DEBUG;
10
+
11
+ protected static $loggers=array();
12
+
13
+
14
+ /**
15
+ * forced log facility
16
+ *
17
+ * @param string $message
18
+ * @param integer $level
19
+ * @param string $file
20
+ * @param bool $forceLog
21
+ */
22
+ public function log($message, $level=null, $file=null){
23
+ $level = is_null($level) ? self::LEVEL : $level;
24
+ $file = empty($file) ? self::FILE : $file;
25
+
26
+ try {
27
+ if (!isset(self::$loggers[$file])) {
28
+ $logFile = Mage::getBaseDir('var') . DS . 'log' . DS . $file;
29
+
30
+ if (!is_dir(Mage::getBaseDir('var').DS.'log')) {
31
+ mkdir(Mage::getBaseDir('var').DS.'log', 0777);
32
+ }
33
+
34
+ if (!file_exists($logFile)) {
35
+ file_put_contents($logFile, '');
36
+ chmod($logFile, 0777);
37
+ }
38
+
39
+ $format = '%timestamp% %priorityName% (%priority%): %message%' . PHP_EOL;
40
+ $formatter = new Zend_Log_Formatter_Simple($format);
41
+ $writerModel = Mage::getStoreConfig('global/log/core/writer_model');
42
+ if (!$writerModel) {
43
+ $writer = new Zend_Log_Writer_Stream($logFile);
44
+ }
45
+ else {
46
+ $writer = new $writerModel($logFile);
47
+ }
48
+ $writer->setFormatter($formatter);
49
+ self::$loggers[$file] = new Zend_Log($writer);
50
+ }
51
+
52
+ if (is_array($message) || is_object($message)) {
53
+ $message = print_r($message, true);
54
+ }
55
+
56
+ if(Mage::getStoreConfig('payment/payline_common/environment') != paylineSDK::ENV_PROD and $level==Zend_Log::ERR) {
57
+ Mage::getSingleton('core/session')->addError($message);
58
+ }
59
+
60
+ self::$loggers[$file]->log($message, $level);
61
+
62
+ } catch (Exception $e) {
63
+
64
+ }
65
+ }
66
  }
app/code/community/Monext/Payline/Helper/Payment.php CHANGED
@@ -1,557 +1,557 @@
1
- <?php
2
-
3
- /**
4
- * This file is part of Monext_Payline for Magento.
5
- *
6
- * @license GNU General Public License (GPL) v3
7
- * @author Jacques Bodin-Hullin <j.bodinhullin@monsieurbiz.com> <@jacquesbh>
8
- * @category Monext
9
- * @package Monext_Payline
10
- * @copyright Copyright (c) 2014 Monsieur Biz (http://monsieurbiz.com)
11
- */
12
-
13
- /**
14
- * Payment Helper
15
- * @package Monext_Payline
16
- */
17
- class Monext_Payline_Helper_Payment extends Mage_Core_Helper_Abstract
18
- {
19
- /**
20
- * Init a payment
21
- *
22
- * @return array
23
- */
24
- public function initWithQuote(Mage_Sales_Model_Quote $quote)
25
- {
26
- return $this->_init($quote);
27
- }
28
-
29
- /**
30
- * Init a payment
31
- *
32
- * @return array
33
- */
34
- public function init(Mage_Sales_Model_Order $order)
35
- {
36
- return $this->_init($order);
37
- }
38
-
39
- /**
40
- * Init a payment
41
- *
42
- * @return array
43
- */
44
- protected function _init($salesObject)
45
- {
46
- $array = array();
47
- $_numericCurrencyCode = Mage::helper('payline')->getNumericCurrencyCode($salesObject->getBaseCurrencyCode());
48
- // PAYMENT
49
- $array['payment']['amount'] = round($salesObject->getBaseGrandTotal() * 100);
50
- $array['payment']['currency'] = $_numericCurrencyCode;
51
-
52
- // ORDER
53
- $array['order']['ref'] = substr($salesObject->getRealOrderId(), 0, 50);
54
-
55
- $array['order']['amount'] = $array['payment']['amount'];
56
- $array['order']['currency'] = $_numericCurrencyCode;
57
- $billingAddress = $salesObject->getBillingAddress();
58
- // BUYER
59
- $customer = Mage::getModel('customer/customer')->load($salesObject->getCustomerId());
60
- $buyerLastName = substr($customer->getLastname(), 0, 50);
61
- if ($buyerLastName == null || $buyerLastName == '') {
62
- $buyerLastName = substr($billingAddress->getLastname(), 0, 50);
63
- }
64
- $buyerFirstName = substr($customer->getFirstname(), 0, 50);
65
- if ($buyerFirstName == null || $buyerFirstName == '') {
66
- $buyerFirstName = substr($billingAddress->getFirstname(), 0, 50);
67
- }
68
- $array['buyer']['lastName'] = Mage::helper('payline')->encodeString($buyerLastName);
69
- $array['buyer']['firstName'] = Mage::helper('payline')->encodeString($buyerFirstName);
70
- $email = $customer->getEmail();
71
- if ($email == null || $email == '') {
72
- $email = $salesObject->getCustomerEmail();
73
- }
74
- $pattern = '/\+/i';
75
- $charPlusExist = preg_match($pattern, $email);
76
- if (strlen($email) <= 50 && Zend_Validate::is($email, 'EmailAddress') && ! $charPlusExist) {
77
- $array['buyer']['email'] = Mage::helper('payline')->encodeString($email);
78
- } else {
79
- $array['buyer']['email'] = '';
80
- }
81
- $array['buyer']['customerId'] = Mage::helper('payline')->encodeString($email);
82
- $array['buyer']['accountCreateDate'] = date('d/m/y', $customer->getCreatedAtTimestamp());
83
- $ordersHistory = Mage::getModel('sales/order')->getCollection()->addFieldToFilter('customer_id', $salesObject->getCustomerId());
84
- $cumulAmount = 0;
85
- $maxEntity = 0;
86
- foreach ($ordersHistory as $oldOrder) {
87
- $oldOrderData = $oldOrder->getData();
88
- if ($oldOrderData['entity_id'] > $maxEntity && $oldOrderData['state'] == Mage_Sales_Model_Order::STATE_COMPLETE) {
89
- $maxEntity = $oldOrderData['entity_id'];
90
- $array['plnLastCompleteOrderAge'] = round((time() - strtotime($oldOrderData['created_at'])) / (60 * 60 * 24));
91
- }
92
- $cumulAmount += $oldOrder->getBaseGrandTotal();
93
- }
94
- $ordersHistoryCount = $ordersHistory->count();
95
- $array['buyer']['accountOrderCount'] = $ordersHistory->count(); // orders
96
- // count
97
- if($ordersHistoryCount>0) {
98
- $array['buyer']['accountAverageAmount'] = round(($cumulAmount / $ordersHistoryCount) * 100); // average
99
- // order
100
- // amount,
101
- // in
102
- // cents
103
- } else {
104
- $array['buyer']['accountAverageAmount'] = 0;
105
- }
106
- $forbidenPhoneCars = array(
107
- ' ',
108
- '.',
109
- '(',
110
- ')',
111
- '-',
112
- '/',
113
- '\\',
114
- '#');
115
- $regexpPhone = '/^\+?[0-9]{1,14}$/';
116
- $shippingAddress = $salesObject->getShippingAddress();
117
- if ($shippingAddress != null) {
118
- $array['shippingAddress']['name'] = Mage::helper('payline')->encodeString(substr($shippingAddress->getName(), 0, 100));
119
- $array['shippingAddress']['title'] = Mage::helper('payline')->encodeString($shippingAddress->getPrefix());
120
- $array['shippingAddress']['firstName'] = Mage::helper('payline')->encodeString(substr($shippingAddress->getFirstname(), 0, 100));
121
- $array['shippingAddress']['lastName'] = Mage::helper('payline')->encodeString(substr($shippingAddress->getLastname(), 0, 100));
122
- $array['shippingAddress']['street1'] = Mage::helper('payline')->encodeString(substr($shippingAddress->getStreet1(), 0, 100));
123
- $array['shippingAddress']['street2'] = Mage::helper('payline')->encodeString(substr($shippingAddress->getStreet2(), 0, 100));
124
- $array['shippingAddress']['cityName'] = Mage::helper('payline')->encodeString(substr($shippingAddress->getCity(), 0, 40));
125
- $array['shippingAddress']['zipCode'] = substr($shippingAddress->getPostcode(), 0, 12);
126
- $array['shippingAddress']['country'] = $shippingAddress->getCountry();
127
- $array['shippingAddress']['state'] = Mage::helper('payline')->encodeString($shippingAddress->getRegion());
128
- $shippingPhone = str_replace($forbidenPhoneCars, '', $shippingAddress->getTelephone());
129
- if (preg_match($regexpPhone, $shippingPhone)) {
130
- $array['shippingAddress']['phone'] = $shippingPhone;
131
- }
132
- }
133
- $array['billingAddress']['name'] = Mage::helper('payline')->encodeString(substr($billingAddress->getName(), 0, 100));
134
- $array['billingAddress']['title'] = Mage::helper('payline')->encodeString($billingAddress->getPrefix());
135
- $array['billingAddress']['firstName'] = Mage::helper('payline')->encodeString(substr($billingAddress->getFirstname(), 0, 100));
136
- $array['billingAddress']['lastName'] = Mage::helper('payline')->encodeString(substr($billingAddress->getLastname(), 0, 100));
137
- $array['billingAddress']['street1'] = Mage::helper('payline')->encodeString(substr($billingAddress->getStreet1(), 0, 100));
138
- $array['billingAddress']['street2'] = Mage::helper('payline')->encodeString(substr($billingAddress->getStreet2(), 0, 100));
139
- $array['billingAddress']['cityName'] = Mage::helper('payline')->encodeString(substr($billingAddress->getCity(), 0, 40));
140
- $array['billingAddress']['zipCode'] = substr($billingAddress->getPostcode(), 0, 12);
141
- $array['billingAddress']['country'] = $billingAddress->getCountry();
142
- $array['billingAddress']['state'] = Mage::helper('payline')->encodeString($billingAddress->getRegion());
143
- $billingPhone = str_replace($forbidenPhoneCars, '', $billingAddress->getTelephone());
144
- if (preg_match($regexpPhone, $billingPhone)) {
145
- $array['billingAddress']['phone'] = $billingPhone;
146
- }
147
- return $array;
148
- }
149
-
150
- /**
151
- * Get User payment data collected by Monext_Payline_Model_Direct::assignData
152
- *
153
- * @return Varien_Object
154
- */
155
- public function getPaymentUserData()
156
- {
157
- //If we do not have CardTokenPan
158
- if(Mage::registry('current_payment_data')) {
159
- $paymentData = Mage::registry('current_payment_data');
160
- } else {
161
- $paymentData = Mage::getSingleton('payline/session');
162
- }
163
-
164
- return $paymentData;
165
- }
166
-
167
-
168
- /**
169
- * Check for a securized contract
170
- */
171
- public function switchToSecureContract()
172
- {
173
- $paymentData = $this->getPaymentUserData();
174
-
175
- $currentCcType = $paymentData->getCcType();
176
-
177
- $currentContractType = false;
178
- $allAvailableContracts = Mage::helper('payline')->getCcContracts();
179
- foreach ($allAvailableContracts as $contract) {
180
-
181
- if($contract->getId()==$currentCcType) {
182
- $currentContractType = $contract->getContractType();
183
- break;
184
- }
185
- }
186
-
187
- $contract = Mage::helper('payline')->getContractByType($currentContractType,true);
188
- if($contract) {
189
- $paymentData->setCcType($contract->getId());
190
- if(Mage::registry('current_payment_data')) {
191
- Mage::unregister('current_payment_data');
192
- Mage::register('current_payment_data', $paymentData);
193
- }
194
- return true;
195
- } else {
196
- return false;
197
- }
198
- }
199
-
200
- /**
201
- * check if current contract is securized
202
- */
203
- public function useSecureContract()
204
- {
205
- $paymentData = $this->getPaymentUserData();
206
- $currentId = $paymentData->getCcType();
207
- $contracts = Mage::helper('payline')->getCcContracts(true);
208
- foreach ($contracts as $contract) {
209
- if($contract->getId()==$currentId) {
210
- return true;
211
- }
212
- }
213
-
214
- return false;
215
- }
216
-
217
-
218
- /**
219
- * Initialise the requests param array to share common information between doAuthorization and verifyEnrollment
220
- *
221
- * @return array
222
- */
223
- public function getDirectActionHeader(Mage_Sales_Model_Order_Payment $payment = null)
224
- {
225
- if($payment) {
226
- $order = $payment->getOrder();
227
- } else {
228
- $_session = Mage::getSingleton('checkout/session');
229
- $order = Mage::getModel('sales/order')->loadByIncrementId($_session->getLastRealOrderId());
230
- $payment = $order->getPayment();
231
- }
232
-
233
- $array = Mage::helper('payline/payment')->init($order);
234
-
235
- // Get user data
236
- $paymentData = $this->getPaymentUserData();
237
-
238
- // Init the SDK with the currency and for DIRECT method
239
- $paylineSDK = Mage::helper('payline')->initPayline('DIRECT', $array['payment']['currency']);
240
-
241
- // PAYMENT
242
- $array['payment']['action'] = Mage::getStoreConfig('payment/PaylineDIRECT/payline_payment_action');
243
- $array['payment']['mode'] = 'CPT';
244
-
245
- // Get the contract
246
- $contract = Mage::getModel('payline/contract')->load($paymentData->getCcType());
247
-
248
-
249
- $array['payment']['contractNumber'] = $contract->getNumber();
250
-
251
- // Set the order date
252
- $array['order']['date'] = date("d/m/Y H:i");
253
-
254
- // Set private data (usefull in the payline admin)
255
- $privateData1 = array();
256
- $privateData1['key'] = 'orderRef';
257
- $privateData1['value'] = substr(str_replace(array("\r", "\n", "\t"), array('', '', ''), $array['order']['ref']), 0, 255);
258
- $paylineSDK->setPrivate($privateData1);
259
-
260
- // Set the order details (each item, optional)
261
- $items = $order->getAllItems();
262
- if ($items) {
263
- if (count($items) > 100)
264
- $items = array_slice($items, 0, 100);
265
- foreach ($items as $item) {
266
- $itemPrice = round($item->getPrice() * 100);
267
- if ($itemPrice > 0) {
268
- $product = array();
269
- $product['ref'] = Mage::helper('payline')->encodeString(substr(str_replace(array("\r", "\n", "\t"), array('', '', ''), $item->getName()), 0, 50));
270
- $product['price'] = round($item->getPrice() * 100);
271
- $product['quantity'] = round($item->getQtyOrdered());
272
- $product['comment'] = Mage::helper('payline')->encodeString(substr(str_replace(array("\r", "\n", "\t"), array('', '', ''), $item->getDescription()), 0, 255));
273
- $paylineSDK->setItem($product);
274
- }
275
- }
276
- }
277
-
278
- // Set the card info
279
- $array['owner']['lastName'] = Mage::helper('payline')->encodeString($paymentData->getCcOwner());
280
-
281
- // CARD INFO
282
- if ($paymentData->getCardTokenPan()) {
283
- $paymenTokentData = Mage::helper('payline')->getDecryptedCardTokenPan($paymentData->getCardTokenPan(), $order);
284
-
285
- if ($paymenTokentData['orderRef'] != $order->getIncrementId()) {
286
- Mage::logException('Payline error: Order incrementId in crypted token "%s" do not match with current order "%s"', $paymenTokentData['orderRef'], $order->getIncrementId());
287
- }
288
- $array['card']['token'] = $paymenTokentData['cardTokenPan'];
289
- $array['card']['cvx'] = $paymenTokentData['vCVV'];
290
- $array['card']['expirationDate'] = $paymenTokentData['cardExp'];
291
- $array['card']['type'] = $paymenTokentData['cardType'];
292
- } else {
293
- // Should not be used any more
294
- $array['card']['number'] = $paymentData->getCcNumber();
295
- $array['card']['cvx'] = $paymentData->getCcId();
296
- $array['card']['expirationDate'] = $paymentData->getCcExpMonth() . $paymentData->getCcExpYear();
297
- $array['card']['type'] = $contract->getContractType();
298
- }
299
- $array['card']['cardholder'] = $paymentData->getCcOwner();
300
-
301
- // Customer IP
302
- $array['buyer']['ip'] = Mage::helper('core/http')->getRemoteAddr();
303
-
304
- // 3D secure
305
- $array['3DSecure'] = array();
306
-
307
- // BANK ACCOUNT DATA
308
- $array['BankAccountData'] = array();
309
-
310
- // version
311
- $array['version'] = Monext_Payline_Helper_Data::VERSION;
312
-
313
- return $array;
314
- }
315
-
316
- /**
317
- * Finalize the final redirection from directAction or return from validateAcs
318
- *
319
- * @param array $author_result
320
- * @param paylineSDK $paylineSDK
321
- * @param array $array
322
- * @param Mage_Sales_Model_Order_Payment $payment
323
- */
324
- public function finalizeDirectAction($author_result, $paylineSDK, $array, Mage_Sales_Model_Order_Payment $payment = null)
325
- {
326
- if($payment) {
327
- $order = $payment->getOrder();
328
- } else {
329
- $_session = Mage::getSingleton('checkout/session');
330
- $order = Mage::getModel('sales/order')->loadByIncrementId($_session->getLastRealOrderId());
331
- $payment = $order->getPayment();
332
- }
333
-
334
- $paymentData = $this->getPaymentUserData();
335
-
336
- /**
337
- * Process the authorization response
338
- */
339
-
340
- // The failed order status
341
- $failedOrderStatus = Mage::getStoreConfig('payment/payline_common/failed_order_status');
342
-
343
- // Authorization succeed
344
- if (isset($author_result) && is_array($author_result) && $author_result['result']['code'] == '00000') {
345
- /**
346
- * Update the order with the new transaction
347
- */
348
- // If everything is OK
349
- if (Mage::helper('payline/payment')->updateOrder($order, $author_result, $author_result['transaction']['id'], 'DIRECT')) {
350
-
351
- // Code 04003 - Fraud detected - BUT Transaction approved (04002 is Fraud with payment refused)
352
- if ($author_result['result']['code'] == '04003') {
353
- // Fraud suspected
354
- $payment->setIsFraudDetected(true);
355
- $newOrderStatus = Mage::getStoreConfig('payment/payline_common/fraud_order_status');
356
- Mage::helper('payline')->setOrderStatus($order, $newOrderStatus);
357
- } else {
358
- Mage::helper('payline')->setOrderStatusAccordingToPaymentMode($order, $array['payment']['action']);
359
- }
360
-
361
- if (Mage::getStoreConfig('payment/PaylineWALLET/active') and ($paymentData->getSubscribeWallet() or Mage::getStoreConfig('payment/payline_common/automate_wallet_subscription'))) {
362
- // Create the wallet!
363
- $array['wallet']['lastName'] = $array['buyer']['lastName'];
364
- $array['wallet']['firstName'] = $array['buyer']['firstName'];
365
- $array['wallet']['email'] = $array['buyer']['email'];
366
- if (! empty($array['card']['token'])) {
367
- $array['wallet']['token'] = $array['card']['token'];
368
- // TODO: Supprimer le ccid
369
- $array['card']['cvx'] = $paymentData->getCcCid();
370
- }
371
- // remember, the Beast is not so far
372
- $array['address'] = $array['shippingAddress'];
373
- $array['ownerAddress'] = null;
374
- Mage::helper('payline')->createWalletForCurrentCustomer($paylineSDK, $array);
375
- }
376
- Mage::helper('payline')->automateCreateInvoiceAtShopReturn('DIRECT', $order);
377
-
378
- Mage::getSingleton('payline/session')->clear();
379
- return true;
380
-
381
- } else {
382
- $msgLog = 'Error during order update (#' . $order->getIncrementId() . ')' . "\n";
383
- $order->setState(Mage_Sales_Model_Order::STATE_CANCELED, $failedOrderStatus, $msgLog, false);
384
- //$order->save();
385
-
386
- $payment->setSkipOrderProcessing(true);
387
- $msg = Mage::helper('payline')->__('An error occured during the payment. Please retry or use an other payment method.');
388
- Mage::getSingleton('core/session')->addError($msg);
389
- Mage::throwException($msg);
390
- return false;
391
- }
392
- } else {
393
- if (isset($author_result) && is_array($author_result)) {
394
- $msgLog = 'PAYLINE ERROR : ' . $author_result['result']['code'] . ' ' . $author_result['result']['shortMessage'] . ' (' . $author_result['result']['longMessage'] . ')';
395
- } elseif (isset($author_result) && is_string($author_result)) {
396
- $msgLog = 'PAYLINE ERROR : ' . $author_result;
397
- } else {
398
- $msgLog = 'Unknown PAYLINE ERROR';
399
- }
400
- Mage::helper('payline/payment')->updateStock($order);
401
- $order->setState(Mage_Sales_Model_Order::STATE_CANCELED, $failedOrderStatus, $msgLog, false);
402
-
403
- // Error
404
- $payment->setSkipOrderProcessing(true);
405
- $msg = Mage::helper('payline')->__('An error occured during the payment. Please retry or use an other payment method.');
406
- Mage::throwException($msg);
407
- Mage::getSingleton('core/session')->addError($msg);
408
- return false;
409
- }
410
- }
411
-
412
- /**
413
- * Add payment transaction to the order, reinit stocks if needed
414
- * @param $res array result of a request
415
- * @param $transactionId
416
- * @return boolean (true=>valid payment, false => invalid payment)
417
- */
418
- public function updateOrder($order, $res, $transactionId, $paymentType = 'CPT')
419
- {
420
- // First, log message which says that we are updating the order
421
- Mage::helper('payline/logger')->log("[updateOrder] Mise à jour commande " . $order->getIncrementId() . " (mode $paymentType) avec la transaction $transactionId");
422
-
423
- // By default this process isn't OK
424
- $orderOk = false;
425
-
426
- // If we have a result code
427
- if ($resultCode = $res['result']['code']) {
428
-
429
- // List of accepted codes
430
- $acceptedCodes = array(
431
- '00000', // Credit card -> Transaction approved
432
- '02500', // Wallet -> Operation successfull
433
- '02501', // Wallet -> Operation Successfull with warning / Operation Successfull but wallet will expire
434
- '04003', // Fraud detected - BUT Transaction approved (04002 is Fraud with payment refused)
435
- '00100',
436
- '03000',
437
- '34230', // signature SDD
438
- '34330' // prélèvement SDD
439
- );
440
-
441
- // Transaction OK
442
- if (in_array($resultCode, $acceptedCodes)) {
443
-
444
- // This process is not OK
445
- $orderOk = true;
446
-
447
- // N time payment?
448
- if ($paymentType == 'NX') {
449
- Mage::helper('payline/logger')->log("[updateOrder] Cas du paiement NX");
450
- if (isset($res['billingRecordList']['billingRecord'][0])) {
451
- $code_echeance = $res['billingRecordList']['billingRecord'][0]->result->code;
452
- if ($code_echeance == '00000' || $code_echeance == '02501') {
453
- Mage::helper('payline/logger')->log("[updateOrder] première échéance paiement NX OK");
454
- $orderOk = true;
455
- } else {
456
- Mage::helper('payline/logger')->log("[updateOrder] première échéance paiement NX refusée, code " . $code_echeance);
457
- $orderOk = false;
458
- }
459
- } else {
460
- Mage::helper('payline/logger')->log("[updateOrder] La première échéance de paiement est à venir");
461
- }
462
- }
463
-
464
- // Set the transaction in the payment object
465
- $order->getPayment()->setCcTransId($transactionId);
466
- if (isset($res['payment']) && isset($res['payment']['action'])) {
467
- $paymentAction = $res['payment']['action'];
468
- } else {
469
- $paymentAction = Mage::getStoreConfig('payment/Payline' . $paymentType . '/payline_payment_action');
470
- }
471
-
472
- // Add transaction (with payment action)
473
- $this->addTransaction($order, $transactionId, $paymentAction);
474
-
475
- // Save the order
476
- $order->save();
477
- }
478
-
479
- // Transaction NOT OK
480
- else {
481
-
482
- // Update the stock
483
- $this->updateStock($order);
484
- }
485
- }
486
-
487
- return $orderOk;
488
- }
489
-
490
- /**
491
- * Reinit stocks
492
- */
493
- public function updateStock($order)
494
- {
495
- if (Mage::getStoreConfig(Mage_CatalogInventory_Model_Stock_Item::XML_PATH_CAN_SUBTRACT) == 1) { // le stock a été décrémenté à la commande
496
- // ré-incrémentation du stock
497
- $items = $order->getAllItems();
498
- if ($items) {
499
- foreach ($items as $item) {
500
- $quantity = $item->getQtyOrdered(); // get Qty ordered
501
- $product_id = $item->getProductId(); // get its ID
502
- $stock = Mage::getModel('cataloginventory/stock_item')->loadByProduct($product_id); // Load the stock for this product
503
- $stock->setQty($stock->getQty() + $quantity); // Set to new Qty
504
- //if qtty = 0 after order and order fails, set stock status is_in_stock to true
505
- if ($stock->getQty() > $stock->getMinQty() && !$stock->getIsInStock()) {
506
- $stock->setIsInStock(1);
507
- }
508
- $stock->save(); // Save
509
- }
510
- Mage::helper('payline/logger')->log('[updateStock] done for order '.$order->getIncrementId());
511
- }
512
- }
513
- }
514
-
515
- /**
516
- * Add a transaction to the current order, depending on the payment type (Auth or Auth+Capture)
517
- * @param string $transactionId
518
- * @param string $paymentAction
519
- * @return null
520
- */
521
- public function addTransaction($order, $transactionId, $paymentAction)
522
- {
523
- if (version_compare(Mage::getVersion(), '1.4', 'ge')) {
524
- /* @var $payment Mage_Payment_Model_Method_Abstract */
525
- $payment = $order->getPayment();
526
- if (!$payment->getTransaction($transactionId)) { // if transaction isn't saved yet
527
- $transaction = Mage::getModel('sales/order_payment_transaction');
528
- $transaction->setTxnId($transactionId);
529
- $transaction->setOrderPaymentObject($order->getPayment());
530
- if ($paymentAction == '100') {
531
-
532
- } else if ($paymentAction == '101') {
533
- $transaction->setTxnType(Mage_Sales_Model_Order_Payment_Transaction::TYPE_PAYMENT);
534
- }
535
- $transaction->save();
536
- $order->sendNewOrderEmail();
537
- }
538
- } else {
539
- $order->getPayment()->setLastTransId($transactionId);
540
- $order->sendNewOrderEmail();
541
- }
542
- }
543
-
544
- /**
545
- * Retrieve the contract object for specified data.
546
- * We store the contract in the data and we load it only if it doesn't exist.
547
- * @return Monext_Payline_Model_Contract The contract
548
- */
549
- public function getContractByData(Varien_Object $data)
550
- {
551
- if (!$contract = $data->getContract()) {
552
- $contract = Mage::getModel('payline/contract')->load($data->getCcType());
553
- $data->setContract($contract);
554
- }
555
- return $contract;
556
- }
557
- }
1
+ <?php
2
+
3
+ /**
4
+ * This file is part of Monext_Payline for Magento.
5
+ *
6
+ * @license GNU General Public License (GPL) v3
7
+ * @author Jacques Bodin-Hullin <j.bodinhullin@monsieurbiz.com> <@jacquesbh>
8
+ * @category Monext
9
+ * @package Monext_Payline
10
+ * @copyright Copyright (c) 2014 Monsieur Biz (http://monsieurbiz.com)
11
+ */
12
+
13
+ /**
14
+ * Payment Helper
15
+ * @package Monext_Payline
16
+ */
17
+ class Monext_Payline_Helper_Payment extends Mage_Core_Helper_Abstract
18
+ {
19
+ /**
20
+ * Init a payment
21
+ *
22
+ * @return array
23
+ */
24
+ public function initWithQuote(Mage_Sales_Model_Quote $quote)
25
+ {
26
+ return $this->_init($quote);
27
+ }
28
+
29
+ /**
30
+ * Init a payment
31
+ *
32
+ * @return array
33
+ */
34
+ public function init(Mage_Sales_Model_Order $order)
35
+ {
36
+ return $this->_init($order);
37
+ }
38
+
39
+ /**
40
+ * Init a payment
41
+ *
42
+ * @return array
43
+ */
44
+ protected function _init($salesObject)
45
+ {
46
+ $array = array();
47
+ $_numericCurrencyCode = Mage::helper('payline')->getNumericCurrencyCode($salesObject->getBaseCurrencyCode());
48
+ // PAYMENT
49
+ $array['payment']['amount'] = round($salesObject->getBaseGrandTotal() * 100);
50
+ $array['payment']['currency'] = $_numericCurrencyCode;
51
+
52
+ // ORDER
53
+ $array['order']['ref'] = substr($salesObject->getRealOrderId(), 0, 50);
54
+
55
+ $array['order']['amount'] = $array['payment']['amount'];
56
+ $array['order']['currency'] = $_numericCurrencyCode;
57
+ $billingAddress = $salesObject->getBillingAddress();
58
+ // BUYER
59
+ $customer = Mage::getModel('customer/customer')->load($salesObject->getCustomerId());
60
+ $buyerLastName = substr($customer->getLastname(), 0, 50);
61
+ if ($buyerLastName == null || $buyerLastName == '') {
62
+ $buyerLastName = substr($billingAddress->getLastname(), 0, 50);
63
+ }
64
+ $buyerFirstName = substr($customer->getFirstname(), 0, 50);
65
+ if ($buyerFirstName == null || $buyerFirstName == '') {
66
+ $buyerFirstName = substr($billingAddress->getFirstname(), 0, 50);
67
+ }
68
+ $array['buyer']['lastName'] = Mage::helper('payline')->encodeString($buyerLastName);
69
+ $array['buyer']['firstName'] = Mage::helper('payline')->encodeString($buyerFirstName);
70
+ $email = $customer->getEmail();
71
+ if ($email == null || $email == '') {
72
+ $email = $salesObject->getCustomerEmail();
73
+ }
74
+ $pattern = '/\+/i';
75
+ $charPlusExist = preg_match($pattern, $email);
76
+ if (strlen($email) <= 50 && Zend_Validate::is($email, 'EmailAddress') && ! $charPlusExist) {
77
+ $array['buyer']['email'] = Mage::helper('payline')->encodeString($email);
78
+ } else {
79
+ $array['buyer']['email'] = '';
80
+ }
81
+ $array['buyer']['customerId'] = Mage::helper('payline')->encodeString($email);
82
+ $array['buyer']['accountCreateDate'] = date('d/m/y', $customer->getCreatedAtTimestamp());
83
+ $ordersHistory = Mage::getModel('sales/order')->getCollection()->addFieldToFilter('customer_id', $salesObject->getCustomerId());
84
+ $cumulAmount = 0;
85
+ $maxEntity = 0;
86
+ foreach ($ordersHistory as $oldOrder) {
87
+ $oldOrderData = $oldOrder->getData();
88
+ if ($oldOrderData['entity_id'] > $maxEntity && $oldOrderData['state'] == Mage_Sales_Model_Order::STATE_COMPLETE) {
89
+ $maxEntity = $oldOrderData['entity_id'];
90
+ $array['plnLastCompleteOrderAge'] = round((time() - strtotime($oldOrderData['created_at'])) / (60 * 60 * 24));
91
+ }
92
+ $cumulAmount += $oldOrder->getBaseGrandTotal();
93
+ }
94
+ $ordersHistoryCount = $ordersHistory->count();
95
+ $array['buyer']['accountOrderCount'] = $ordersHistory->count(); // orders
96
+ // count
97
+ if($ordersHistoryCount>0) {
98
+ $array['buyer']['accountAverageAmount'] = round(($cumulAmount / $ordersHistoryCount) * 100); // average
99
+ // order
100
+ // amount,
101
+ // in
102
+ // cents
103
+ } else {
104
+ $array['buyer']['accountAverageAmount'] = 0;
105
+ }
106
+ $forbidenPhoneCars = array(
107
+ ' ',
108
+ '.',
109
+ '(',
110
+ ')',
111
+ '-',
112
+ '/',
113
+ '\\',
114
+ '#');
115
+ $regexpPhone = '/^\+?[0-9]{1,14}$/';
116
+ $shippingAddress = $salesObject->getShippingAddress();
117
+ if ($shippingAddress != null) {
118
+ $array['shippingAddress']['name'] = Mage::helper('payline')->encodeString(substr($shippingAddress->getName(), 0, 100));
119
+ $array['shippingAddress']['title'] = Mage::helper('payline')->encodeString($shippingAddress->getPrefix());
120
+ $array['shippingAddress']['firstName'] = Mage::helper('payline')->encodeString(substr($shippingAddress->getFirstname(), 0, 100));
121
+ $array['shippingAddress']['lastName'] = Mage::helper('payline')->encodeString(substr($shippingAddress->getLastname(), 0, 100));
122
+ $array['shippingAddress']['street1'] = Mage::helper('payline')->encodeString(substr($shippingAddress->getStreet1(), 0, 100));
123
+ $array['shippingAddress']['street2'] = Mage::helper('payline')->encodeString(substr($shippingAddress->getStreet2(), 0, 100));
124
+ $array['shippingAddress']['cityName'] = Mage::helper('payline')->encodeString(substr($shippingAddress->getCity(), 0, 40));
125
+ $array['shippingAddress']['zipCode'] = substr($shippingAddress->getPostcode(), 0, 12);
126
+ $array['shippingAddress']['country'] = $shippingAddress->getCountry();
127
+ $array['shippingAddress']['state'] = Mage::helper('payline')->encodeString($shippingAddress->getRegion());
128
+ $shippingPhone = str_replace($forbidenPhoneCars, '', $shippingAddress->getTelephone());
129
+ if (preg_match($regexpPhone, $shippingPhone)) {
130
+ $array['shippingAddress']['phone'] = $shippingPhone;
131
+ }
132
+ }
133
+ $array['billingAddress']['name'] = Mage::helper('payline')->encodeString(substr($billingAddress->getName(), 0, 100));
134
+ $array['billingAddress']['title'] = Mage::helper('payline')->encodeString($billingAddress->getPrefix());
135
+ $array['billingAddress']['firstName'] = Mage::helper('payline')->encodeString(substr($billingAddress->getFirstname(), 0, 100));
136
+ $array['billingAddress']['lastName'] = Mage::helper('payline')->encodeString(substr($billingAddress->getLastname(), 0, 100));
137
+ $array['billingAddress']['street1'] = Mage::helper('payline')->encodeString(substr($billingAddress->getStreet1(), 0, 100));
138
+ $array['billingAddress']['street2'] = Mage::helper('payline')->encodeString(substr($billingAddress->getStreet2(), 0, 100));
139
+ $array['billingAddress']['cityName'] = Mage::helper('payline')->encodeString(substr($billingAddress->getCity(), 0, 40));
140
+ $array['billingAddress']['zipCode'] = substr($billingAddress->getPostcode(), 0, 12);
141
+ $array['billingAddress']['country'] = $billingAddress->getCountry();
142
+ $array['billingAddress']['state'] = Mage::helper('payline')->encodeString($billingAddress->getRegion());
143
+ $billingPhone = str_replace($forbidenPhoneCars, '', $billingAddress->getTelephone());
144
+ if (preg_match($regexpPhone, $billingPhone)) {
145
+ $array['billingAddress']['phone'] = $billingPhone;
146
+ }
147
+ return $array;
148
+ }
149
+
150
+ /**
151
+ * Get User payment data collected by Monext_Payline_Model_Direct::assignData
152
+ *
153
+ * @return Varien_Object
154
+ */
155
+ public function getPaymentUserData()
156
+ {
157
+ //If we do not have CardTokenPan
158
+ if(Mage::registry('current_payment_data')) {
159
+ $paymentData = Mage::registry('current_payment_data');
160
+ } else {
161
+ $paymentData = Mage::getSingleton('payline/session');
162
+ }
163
+
164
+ return $paymentData;
165
+ }
166
+
167
+
168
+ /**
169
+ * Check for a securized contract
170
+ */
171
+ public function switchToSecureContract()
172
+ {
173
+ $paymentData = $this->getPaymentUserData();
174
+
175
+ $currentCcType = $paymentData->getCcType();
176
+
177
+ $currentContractType = false;
178
+ $allAvailableContracts = Mage::helper('payline')->getCcContracts();
179
+ foreach ($allAvailableContracts as $contract) {
180
+
181
+ if($contract->getId()==$currentCcType) {
182
+ $currentContractType = $contract->getContractType();
183
+ break;
184
+ }
185
+ }
186
+
187
+ $contract = Mage::helper('payline')->getContractByType($currentContractType,true);
188
+ if($contract) {
189
+ $paymentData->setCcType($contract->getId());
190
+ if(Mage::registry('current_payment_data')) {
191
+ Mage::unregister('current_payment_data');
192
+ Mage::register('current_payment_data', $paymentData);
193
+ }
194
+ return true;
195
+ } else {
196
+ return false;
197
+ }
198
+ }
199
+
200
+ /**
201
+ * check if current contract is securized
202
+ */
203
+ public function useSecureContract()
204
+ {
205
+ $paymentData = $this->getPaymentUserData();
206
+ $currentId = $paymentData->getCcType();
207
+ $contracts = Mage::helper('payline')->getCcContracts(true);
208
+ foreach ($contracts as $contract) {
209
+ if($contract->getId()==$currentId) {
210
+ return true;
211
+ }
212
+ }
213
+
214
+ return false;
215
+ }
216
+
217
+
218
+ /**
219
+ * Initialise the requests param array to share common information between doAuthorization and verifyEnrollment
220
+ *
221
+ * @return array
222
+ */
223
+ public function getDirectActionHeader(Mage_Sales_Model_Order_Payment $payment = null)
224
+ {
225
+ if($payment) {
226
+ $order = $payment->getOrder();
227
+ } else {
228
+ $_session = Mage::getSingleton('checkout/session');
229
+ $order = Mage::getModel('sales/order')->loadByIncrementId($_session->getLastRealOrderId());
230
+ $payment = $order->getPayment();
231
+ }
232
+
233
+ $array = Mage::helper('payline/payment')->init($order);
234
+
235
+ // Get user data
236
+ $paymentData = $this->getPaymentUserData();
237
+
238
+ // Init the SDK with the currency and for DIRECT method
239
+ $paylineSDK = Mage::helper('payline')->initPayline('DIRECT', $array['payment']['currency']);
240
+
241
+ // PAYMENT
242
+ $array['payment']['action'] = Mage::getStoreConfig('payment/PaylineDIRECT/payline_payment_action');
243
+ $array['payment']['mode'] = 'CPT';
244
+
245
+ // Get the contract
246
+ $contract = Mage::getModel('payline/contract')->load($paymentData->getCcType());
247
+
248
+
249
+ $array['payment']['contractNumber'] = $contract->getNumber();
250
+
251
+ // Set the order date
252
+ $array['order']['date'] = date("d/m/Y H:i");
253
+
254
+ // Set private data (usefull in the payline admin)
255
+ $privateData1 = array();
256
+ $privateData1['key'] = 'orderRef';
257
+ $privateData1['value'] = substr(str_replace(array("\r", "\n", "\t"), array('', '', ''), $array['order']['ref']), 0, 255);
258
+ $paylineSDK->setPrivate($privateData1);
259
+
260
+ // Set the order details (each item, optional)
261
+ $items = $order->getAllItems();
262
+ if ($items) {
263
+ if (count($items) > 100)
264
+ $items = array_slice($items, 0, 100);
265
+ foreach ($items as $item) {
266
+ $itemPrice = round($item->getPrice() * 100);
267
+ if ($itemPrice > 0) {
268
+ $product = array();
269
+ $product['ref'] = Mage::helper('payline')->encodeString(substr(str_replace(array("\r", "\n", "\t"), array('', '', ''), $item->getName()), 0, 50));
270
+ $product['price'] = round($item->getPrice() * 100);
271
+ $product['quantity'] = round($item->getQtyOrdered());
272
+ $product['comment'] = Mage::helper('payline')->encodeString(substr(str_replace(array("\r", "\n", "\t"), array('', '', ''), $item->getDescription()), 0, 255));
273
+ $paylineSDK->setItem($product);
274
+ }
275
+ }
276
+ }
277
+
278
+ // Set the card info
279
+ $array['owner']['lastName'] = Mage::helper('payline')->encodeString($paymentData->getCcOwner());
280
+
281
+ // CARD INFO
282
+ if ($paymentData->getCardTokenPan()) {
283
+ $paymenTokentData = Mage::helper('payline')->getDecryptedCardTokenPan($paymentData->getCardTokenPan(), $order);
284
+
285
+ if ($paymenTokentData['orderRef'] != $order->getIncrementId()) {
286
+ Mage::logException('Payline error: Order incrementId in crypted token "%s" do not match with current order "%s"', $paymenTokentData['orderRef'], $order->getIncrementId());
287
+ }
288
+ $array['card']['token'] = $paymenTokentData['cardTokenPan'];
289
+ $array['card']['cvx'] = $paymenTokentData['vCVV'];
290
+ $array['card']['expirationDate'] = $paymenTokentData['cardExp'];
291
+ $array['card']['type'] = $paymenTokentData['cardType'];
292
+ } else {
293
+ // Should not be used any more
294
+ $array['card']['number'] = $paymentData->getCcNumber();
295
+ $array['card']['cvx'] = $paymentData->getCcId();
296
+ $array['card']['expirationDate'] = $paymentData->getCcExpMonth() . $paymentData->getCcExpYear();
297
+ $array['card']['type'] = $contract->getContractType();
298
+ }
299
+ $array['card']['cardholder'] = $paymentData->getCcOwner();
300
+
301
+ // Customer IP
302
+ $array['buyer']['ip'] = Mage::helper('core/http')->getRemoteAddr();
303
+
304
+ // 3D secure
305
+ $array['3DSecure'] = array();
306
+
307
+ // BANK ACCOUNT DATA
308
+ $array['BankAccountData'] = array();
309
+
310
+ // version
311
+ $array['version'] = Monext_Payline_Helper_Data::VERSION;
312
+
313
+ return $array;
314
+ }
315
+
316
+ /**
317
+ * Finalize the final redirection from directAction or return from validateAcs
318
+ *
319
+ * @param array $author_result
320
+ * @param paylineSDK $paylineSDK
321
+ * @param array $array
322
+ * @param Mage_Sales_Model_Order_Payment $payment
323
+ */
324
+ public function finalizeDirectAction($author_result, $paylineSDK, $array, Mage_Sales_Model_Order_Payment $payment = null)
325
+ {
326
+ if($payment) {
327
+ $order = $payment->getOrder();
328
+ } else {
329
+ $_session = Mage::getSingleton('checkout/session');
330
+ $order = Mage::getModel('sales/order')->loadByIncrementId($_session->getLastRealOrderId());
331
+ $payment = $order->getPayment();
332
+ }
333
+
334
+ $paymentData = $this->getPaymentUserData();
335
+
336
+ /**
337
+ * Process the authorization response
338
+ */
339
+
340
+ // The failed order status
341
+ $failedOrderStatus = Mage::getStoreConfig('payment/payline_common/failed_order_status');
342
+
343
+ // Authorization succeed
344
+ if (isset($author_result) && is_array($author_result) && $author_result['result']['code'] == '00000') {
345
+ /**
346
+ * Update the order with the new transaction
347
+ */
348
+ // If everything is OK
349
+ if (Mage::helper('payline/payment')->updateOrder($order, $author_result, $author_result['transaction']['id'], 'DIRECT')) {
350
+
351
+ // Code 04003 - Fraud detected - BUT Transaction approved (04002 is Fraud with payment refused)
352
+ if ($author_result['result']['code'] == '04003') {
353
+ // Fraud suspected
354
+ $payment->setIsFraudDetected(true);
355
+ $newOrderStatus = Mage::getStoreConfig('payment/payline_common/fraud_order_status');
356
+ Mage::helper('payline')->setOrderStatus($order, $newOrderStatus);
357
+ } else {
358
+ Mage::helper('payline')->setOrderStatusAccordingToPaymentMode($order, $array['payment']['action']);
359
+ }
360
+
361
+ if (Mage::getStoreConfig('payment/PaylineWALLET/active') and ($paymentData->getSubscribeWallet() or Mage::getStoreConfig('payment/payline_common/automate_wallet_subscription'))) {
362
+ // Create the wallet!
363
+ $array['wallet']['lastName'] = $array['buyer']['lastName'];
364
+ $array['wallet']['firstName'] = $array['buyer']['firstName'];
365
+ $array['wallet']['email'] = $array['buyer']['email'];
366
+ if (! empty($array['card']['token'])) {
367
+ $array['wallet']['token'] = $array['card']['token'];
368
+ // TODO: Supprimer le ccid
369
+ $array['card']['cvx'] = $paymentData->getCcCid();
370
+ }
371
+ // remember, the Beast is not so far
372
+ $array['address'] = $array['shippingAddress'];
373
+ $array['ownerAddress'] = null;
374
+ Mage::helper('payline')->createWalletForCurrentCustomer($paylineSDK, $array);
375
+ }
376
+ Mage::helper('payline')->automateCreateInvoiceAtShopReturn('DIRECT', $order);
377
+
378
+ Mage::getSingleton('payline/session')->clear();
379
+ return true;
380
+
381
+ } else {
382
+ $msgLog = 'Error during order update (#' . $order->getIncrementId() . ')' . "\n";
383
+ $order->setState(Mage_Sales_Model_Order::STATE_CANCELED, $failedOrderStatus, $msgLog, false);
384
+ //$order->save();
385
+
386
+ $payment->setSkipOrderProcessing(true);
387
+ $msg = Mage::helper('payline')->__('An error occured during the payment. Please retry or use an other payment method.');
388
+ Mage::getSingleton('core/session')->addError($msg);
389
+ Mage::throwException($msg);
390
+ return false;
391
+ }
392
+ } else {
393
+ if (isset($author_result) && is_array($author_result)) {
394
+ $msgLog = 'PAYLINE ERROR : ' . $author_result['result']['code'] . ' ' . $author_result['result']['shortMessage'] . ' (' . $author_result['result']['longMessage'] . ')';
395
+ } elseif (isset($author_result) && is_string($author_result)) {
396
+ $msgLog = 'PAYLINE ERROR : ' . $author_result;
397
+ } else {
398
+ $msgLog = 'Unknown PAYLINE ERROR';
399
+ }
400
+ Mage::helper('payline/payment')->updateStock($order);
401
+ $order->setState(Mage_Sales_Model_Order::STATE_CANCELED, $failedOrderStatus, $msgLog, false);
402
+
403
+ // Error
404
+ $payment->setSkipOrderProcessing(true);
405
+ $msg = Mage::helper('payline')->__('An error occured during the payment. Please retry or use an other payment method.');
406
+ Mage::throwException($msg);
407
+ Mage::getSingleton('core/session')->addError($msg);
408
+ return false;
409
+ }
410
+ }
411
+
412
+ /**
413
+ * Add payment transaction to the order, reinit stocks if needed
414
+ * @param $res array result of a request
415
+ * @param $transactionId
416
+ * @return boolean (true=>valid payment, false => invalid payment)
417
+ */
418
+ public function updateOrder($order, $res, $transactionId, $paymentType = 'CPT')
419
+ {
420
+ // First, log message which says that we are updating the order
421
+ Mage::helper('payline/logger')->log("[updateOrder] Mise à jour commande " . $order->getIncrementId() . " (mode $paymentType) avec la transaction $transactionId");
422
+
423
+ // By default this process isn't OK
424
+ $orderOk = false;
425
+
426
+ // If we have a result code
427
+ if ($resultCode = $res['result']['code']) {
428
+
429
+ // List of accepted codes
430
+ $acceptedCodes = array(
431
+ '00000', // Credit card -> Transaction approved
432
+ '02500', // Wallet -> Operation successfull
433
+ '02501', // Wallet -> Operation Successfull with warning / Operation Successfull but wallet will expire
434
+ '04003', // Fraud detected - BUT Transaction approved (04002 is Fraud with payment refused)
435
+ '00100',
436
+ '03000',
437
+ '34230', // signature SDD
438
+ '34330' // prélèvement SDD
439
+ );
440
+
441
+ // Transaction OK
442
+ if (in_array($resultCode, $acceptedCodes)) {
443
+
444
+ // This process is not OK
445
+ $orderOk = true;
446
+
447
+ // N time payment?
448
+ if ($paymentType == 'NX') {
449
+ Mage::helper('payline/logger')->log("[updateOrder] Cas du paiement NX");
450
+ if (isset($res['billingRecordList']['billingRecord'][0])) {
451
+ $code_echeance = $res['billingRecordList']['billingRecord'][0]->result->code;
452
+ if ($code_echeance == '00000' || $code_echeance == '02501') {
453
+ Mage::helper('payline/logger')->log("[updateOrder] première échéance paiement NX OK");
454
+ $orderOk = true;
455
+ } else {
456
+ Mage::helper('payline/logger')->log("[updateOrder] première échéance paiement NX refusée, code " . $code_echeance);
457
+ $orderOk = false;
458
+ }
459
+ } else {
460
+ Mage::helper('payline/logger')->log("[updateOrder] La première échéance de paiement est à venir");
461
+ }
462
+ }
463
+
464
+ // Set the transaction in the payment object
465
+ $order->getPayment()->setCcTransId($transactionId);
466
+ if (isset($res['payment']) && isset($res['payment']['action'])) {
467
+ $paymentAction = $res['payment']['action'];
468
+ } else {
469
+ $paymentAction = Mage::getStoreConfig('payment/Payline' . $paymentType . '/payline_payment_action');
470
+ }
471
+
472
+ // Add transaction (with payment action)
473
+ $this->addTransaction($order, $transactionId, $paymentAction);
474
+
475
+ // Save the order
476
+ $order->save();
477
+ }
478
+
479
+ // Transaction NOT OK
480
+ else {
481
+
482
+ // Update the stock
483
+ $this->updateStock($order);
484
+ }
485
+ }
486
+
487
+ return $orderOk;
488
+ }
489
+
490
+ /**
491
+ * Reinit stocks
492
+ */
493
+ public function updateStock($order)
494
+ {
495
+ if (Mage::getStoreConfig(Mage_CatalogInventory_Model_Stock_Item::XML_PATH_CAN_SUBTRACT) == 1) { // le stock a été décrémenté à la commande
496
+ // ré-incrémentation du stock
497
+ $items = $order->getAllItems();
498
+ if ($items) {
499
+ foreach ($items as $item) {
500
+ $quantity = $item->getQtyOrdered(); // get Qty ordered
501
+ $product_id = $item->getProductId(); // get its ID
502
+ $stock = Mage::getModel('cataloginventory/stock_item')->loadByProduct($product_id); // Load the stock for this product
503
+ $stock->setQty($stock->getQty() + $quantity); // Set to new Qty
504
+ //if qtty = 0 after order and order fails, set stock status is_in_stock to true
505
+ if ($stock->getQty() > $stock->getMinQty() && !$stock->getIsInStock()) {
506
+ $stock->setIsInStock(1);
507
+ }
508
+ $stock->save(); // Save
509
+ }
510
+ Mage::helper('payline/logger')->log('[updateStock] done for order '.$order->getIncrementId());
511
+ }
512
+ }
513
+ }
514
+
515
+ /**
516
+ * Add a transaction to the current order, depending on the payment type (Auth or Auth+Capture)
517
+ * @param string $transactionId
518
+ * @param string $paymentAction
519
+ * @return null
520
+ */
521
+ public function addTransaction($order, $transactionId, $paymentAction)
522
+ {
523
+ if (version_compare(Mage::getVersion(), '1.4', 'ge')) {
524
+ /* @var $payment Mage_Payment_Model_Method_Abstract */
525
+ $payment = $order->getPayment();
526
+ if (!$payment->getTransaction($transactionId)) { // if transaction isn't saved yet
527
+ $transaction = Mage::getModel('sales/order_payment_transaction');
528
+ $transaction->setTxnId($transactionId);
529
+ $transaction->setOrderPaymentObject($order->getPayment());
530
+ if ($paymentAction == '100') {
531
+
532
+ } else if ($paymentAction == '101') {
533
+ $transaction->setTxnType(Mage_Sales_Model_Order_Payment_Transaction::TYPE_PAYMENT);
534
+ }
535
+ $transaction->save();
536
+ $order->sendNewOrderEmail();
537
+ }
538
+ } else {
539
+ $order->getPayment()->setLastTransId($transactionId);
540
+ $order->sendNewOrderEmail();
541
+ }
542
+ }
543
+
544
+ /**
545
+ * Retrieve the contract object for specified data.
546
+ * We store the contract in the data and we load it only if it doesn't exist.
547
+ * @return Monext_Payline_Model_Contract The contract
548
+ */
549
+ public function getContractByData(Varien_Object $data)
550
+ {
551
+ if (!$contract = $data->getContract()) {
552
+ $contract = Mage::getModel('payline/contract')->load($data->getCcType());
553
+ $data->setContract($contract);
554
+ }
555
+ return $contract;
556
+ }
557
+ }
app/code/community/Monext/Payline/Helper/Widget.php CHANGED
@@ -1,110 +1,110 @@
1
- <?php
2
-
3
- class Monext_Payline_Helper_Widget extends Monext_Payline_Helper_Data
4
- {
5
-
6
- protected $_token;
7
-
8
-
9
- /**
10
- * Order increment ID getter (either real from order or a reserved from quote)
11
- *
12
- * @return string
13
- */
14
- protected function _getReservedOrderId($quote)
15
- {
16
- if (!$quote->getReservedOrderId()) {
17
- $quote->reserveOrderId()->save();
18
- }
19
- return $quote->getReservedOrderId();
20
- }
21
-
22
- public function getDataToken()
23
- {
24
- if (is_null($this->_token)) {
25
- $this->_token = false;
26
- try {
27
- $quote = Mage::getSingleton('checkout/session')->getQuote();
28
- $orderId = $this->_getReservedOrderId($quote);
29
- $quote->setRealOrderId($orderId);
30
-
31
- $array = Mage::helper('payline/payment')->initWithQuote($quote);
32
- $array['version'] = Monext_Payline_Helper_Data::VERSION;
33
- $array['payment']['action'] = Mage::getStoreConfig('payment/PaylineCPT/payline_payment_action');
34
- $array['payment']['mode'] = 'CPT';
35
- $array['payment']['contractNumber'] = $this->getDefaultContractNumberForWidget();
36
- $array['contracts'] = $this->getContractsForWidget(true);
37
- $array['secondContracts'] = $this->getContractsForWidget(false);
38
- if(empty($array['secondContracts'])) {
39
- $array['secondContracts'] = array('');
40
- }
41
-
42
-
43
- $paylineSDK = $this->initPayline('CPT', $array['payment']['currency']);
44
- $paylineSDK->returnURL = Mage::getUrl('payline/index/cptReturnWidget');
45
- $paylineSDK->cancelURL = $paylineSDK->returnURL;
46
- $paylineSDK->notificationURL = $paylineSDK->returnURL;
47
-
48
-
49
- // WALLET
50
- // ADD CONTRACT WALLET ARRAY TO $array
51
- $helperPayline = Mage::helper('payline');
52
- $array['walletContracts'] = $helperPayline->buildContractNumberWalletList();
53
-
54
- if (Mage::getStoreConfig('payment/PaylineCPT/send_wallet_id')) {
55
-
56
- if (! isset($array['buyer']['walletId'])) {
57
- if (isset($this->walletId)) {
58
- $array['buyer']['walletId'] = $this->walletId;
59
- }
60
- }
61
-
62
- $expiredWalletId = false;
63
- if (Mage::getSingleton('customer/session')->isLoggedIn()) {
64
- $customer = Mage::getSingleton('customer/session')->getCustomer();
65
- if ($customer->getWalletId() && ! Mage::getModel('payline/wallet')->checkExpirationDate()) {
66
- $expiredWalletId = true;
67
- }
68
- }
69
-
70
- if ($expiredWalletId) {
71
- $this->walletId = null;
72
- }
73
-
74
- if ($helperPayline->canSubscribeWallet()) {
75
- // If the wallet is new (registered during payment), we must
76
- // save it in the private data since it's not sent back by
77
- // default
78
- if ($this->isNewWallet) {
79
- if ($this->walletId) {
80
- $paylineSDK->setPrivate(array('key' => 'newWalletId',
81
- 'value' => $this->walletId));
82
- }
83
- }
84
- }
85
- }
86
-
87
- $response = $paylineSDK->doWebPayment($array);
88
- if(isset($response) and $response['result']['code'] == '00000' and !empty($response['token'])){
89
- $this->_token = $response['token'];
90
- Mage::getModel('payline/token')
91
- ->setOrderId($quote->getRealOrderId())
92
- ->setToken($this->_token)
93
- ->setDateCreate(time())
94
- ->save();
95
- }
96
-
97
- } catch (Exception $e) {
98
- Mage::logException($e);
99
- }
100
- }
101
-
102
- return $this->_token;
103
- }
104
-
105
- public function getDataTemplate()
106
- {
107
- return $this->getCptConfigTemplate();
108
- }
109
-
110
- } // end class
1
+ <?php
2
+
3
+ class Monext_Payline_Helper_Widget extends Monext_Payline_Helper_Data
4
+ {
5
+
6
+ protected $_token;
7
+
8
+
9
+ /**
10
+ * Order increment ID getter (either real from order or a reserved from quote)
11
+ *
12
+ * @return string
13
+ */
14
+ protected function _getReservedOrderId($quote)
15
+ {
16
+ if (!$quote->getReservedOrderId()) {
17
+ $quote->reserveOrderId()->save();
18
+ }
19
+ return $quote->getReservedOrderId();
20
+ }
21
+
22
+ public function getDataToken()
23
+ {
24
+ if (is_null($this->_token)) {
25
+ $this->_token = false;
26
+ try {
27
+ $quote = Mage::getSingleton('checkout/session')->getQuote();
28
+ $orderId = $this->_getReservedOrderId($quote);
29
+ $quote->setRealOrderId($orderId);
30
+
31
+ $array = Mage::helper('payline/payment')->initWithQuote($quote);
32
+ $array['version'] = Monext_Payline_Helper_Data::VERSION;
33
+ $array['payment']['action'] = Mage::getStoreConfig('payment/PaylineCPT/payline_payment_action');
34
+ $array['payment']['mode'] = 'CPT';
35
+ $array['payment']['contractNumber'] = $this->getDefaultContractNumberForWidget();
36
+ $array['contracts'] = $this->getContractsForWidget(true);
37
+ $array['secondContracts'] = $this->getContractsForWidget(false);
38
+ if(empty($array['secondContracts'])) {
39
+ $array['secondContracts'] = array('');
40
+ }
41
+
42
+
43
+ $paylineSDK = $this->initPayline('CPT', $array['payment']['currency']);
44
+ $paylineSDK->returnURL = Mage::getUrl('payline/index/cptReturnWidget');
45
+ $paylineSDK->cancelURL = $paylineSDK->returnURL;
46
+ $paylineSDK->notificationURL = $paylineSDK->returnURL;
47
+
48
+
49
+ // WALLET
50
+ // ADD CONTRACT WALLET ARRAY TO $array
51
+ $helperPayline = Mage::helper('payline');
52
+ $array['walletContracts'] = $helperPayline->buildContractNumberWalletList();
53
+
54
+ if (Mage::getStoreConfig('payment/PaylineCPT/send_wallet_id')) {
55
+
56
+ if (! isset($array['buyer']['walletId'])) {
57
+ if (isset($this->walletId)) {
58
+ $array['buyer']['walletId'] = $this->walletId;
59
+ }
60
+ }
61
+
62
+ $expiredWalletId = false;
63
+ if (Mage::getSingleton('customer/session')->isLoggedIn()) {
64
+ $customer = Mage::getSingleton('customer/session')->getCustomer();
65
+ if ($customer->getWalletId() && ! Mage::getModel('payline/wallet')->checkExpirationDate()) {
66
+ $expiredWalletId = true;
67
+ }
68
+ }
69
+
70
+ if ($expiredWalletId) {
71
+ $this->walletId = null;
72
+ }
73
+
74
+ if ($helperPayline->canSubscribeWallet()) {
75
+ // If the wallet is new (registered during payment), we must
76
+ // save it in the private data since it's not sent back by
77
+ // default
78
+ if ($this->isNewWallet) {
79
+ if ($this->walletId) {
80
+ $paylineSDK->setPrivate(array('key' => 'newWalletId',
81
+ 'value' => $this->walletId));
82
+ }
83
+ }
84
+ }
85
+ }
86
+
87
+ $response = $paylineSDK->doWebPayment($array);
88
+ if(isset($response) and $response['result']['code'] == '00000' and !empty($response['token'])){
89
+ $this->_token = $response['token'];
90
+ Mage::getModel('payline/token')
91
+ ->setOrderId($quote->getRealOrderId())
92
+ ->setToken($this->_token)
93
+ ->setDateCreate(time())
94
+ ->save();
95
+ }
96
+
97
+ } catch (Exception $e) {
98
+ Mage::logException($e);
99
+ }
100
+ }
101
+
102
+ return $this->_token;
103
+ }
104
+
105
+ public function getDataTemplate()
106
+ {
107
+ return $this->getCptConfigTemplate();
108
+ }
109
+
110
+ } // end class
app/code/community/Monext/Payline/Model/.DS_Store CHANGED
File without changes
app/code/community/Monext/Payline/Model/Adminhtml/System/Config/Backend/Common.php CHANGED
@@ -1,28 +1,28 @@
1
- <?php
2
-
3
- class Monext_Payline_Model_Adminhtml_System_Config_Backend_Common extends Mage_Core_Model_Config_Data
4
- {
5
- /**
6
- * Check settings after save
7
- */
8
- protected function _afterSave()
9
- {
10
- if (Mage::getStoreConfig($this->getPath())!=$this->getFieldsetDataValue(basename($this->getPath()))) {
11
-
12
- $change = Mage::registry('payline_config_change');
13
- if (empty($change)) {
14
- $change = array();
15
- } else {
16
- Mage::unregister('payline_config_change');
17
- }
18
-
19
- $change[$this->getPath()] = array('before'=>Mage::getStoreConfig($this->getPath()),
20
- 'after'=>$this->getFieldsetDataValue(basename($this->getPath())),
21
- 'scope_id'=>$this->getScopeId(),
22
- 'scope'=>$this->getScope()
23
- );
24
-
25
- Mage::register('payline_config_change', $change);
26
- }
27
- }
28
- }
1
+ <?php
2
+
3
+ class Monext_Payline_Model_Adminhtml_System_Config_Backend_Common extends Mage_Core_Model_Config_Data
4
+ {
5
+ /**
6
+ * Check settings after save
7
+ */
8
+ protected function _afterSave()
9
+ {
10
+ if (Mage::getStoreConfig($this->getPath())!=$this->getFieldsetDataValue(basename($this->getPath()))) {
11
+
12
+ $change = Mage::registry('payline_config_change');
13
+ if (empty($change)) {
14
+ $change = array();
15
+ } else {
16
+ Mage::unregister('payline_config_change');
17
+ }
18
+
19
+ $change[$this->getPath()] = array('before'=>Mage::getStoreConfig($this->getPath()),
20
+ 'after'=>$this->getFieldsetDataValue(basename($this->getPath())),
21
+ 'scope_id'=>$this->getScopeId(),
22
+ 'scope'=>$this->getScope()
23
+ );
24
+
25
+ Mage::register('payline_config_change', $change);
26
+ }
27
+ }
28
+ }
app/code/community/Monext/Payline/Model/Adminhtml/System/Config/Backend/Contract.php CHANGED
@@ -1,15 +1,15 @@
1
- <?php
2
-
3
- class Monext_Payline_Model_Adminhtml_System_Config_Backend_Contract extends Mage_Adminhtml_Model_System_Config_Backend_Serialized_Array
4
- {
5
- protected $_eventPrefix = 'payline_config_backend_contract';
6
-
7
-
8
- protected function _afterLoad()
9
- {
10
- if (!is_array($this->getValue())) {
11
- $value = $this->getValue();
12
-
13
  $collection = Mage::getModel('payline/contract')->getCollection();
14
  $store = Mage::app()->getRequest()->getParam('store', '');
15
  $website = Mage::app()->getRequest()->getParam('website', '');
@@ -19,34 +19,34 @@ class Monext_Payline_Model_Adminhtml_System_Config_Backend_Contract extends Mage
19
  } elseif ($website) {
20
  $websiteId = Mage::getModel('core/website')->load($website)->getId();
21
  $collection->addWebsiteFilter($websiteId);
22
- }
23
-
24
- $contracts = $collection->toArray();
25
-
26
- $values = $contracts['items'];
27
-
28
- $this->setValue($values);
29
- }
30
- }
31
-
32
  protected function _beforeSave()
33
- {
34
- $contract_lists = Mage::app()->getRequest()->getParam('contract_list');
35
-
36
- $defaultValues=array('is_primary'=>0,'is_secondary'=>0,'is_secure'=>0,'is_included_wallet_list'=>0);
37
- foreach ($contract_lists as $contactId=>$contractValues) {
38
- $contract_lists[$contactId] = array_merge($defaultValues, $contractValues);
39
- }
40
-
41
- $this->setUnserializedValue($contract_lists);
42
- $this->setValue($contract_lists);
43
-
44
  parent::_beforeSave();
45
- }
46
-
47
  protected function _afterSave()
48
- {
49
- if (Mage::getStoreConfig($this->getPath())!=$this->getValue()) {
50
  $contract_lists = $this->getUnserializedValue();
51
 
52
  $store = Mage::app()->getRequest()->getParam('store', '');
@@ -54,9 +54,9 @@ class Monext_Payline_Model_Adminhtml_System_Config_Backend_Contract extends Mage
54
 
55
  Mage::getResourceModel('payline/contract')->updateOptionsContractList(
56
  $contract_lists, $website, $store
57
- );
58
  }
59
 
60
  parent::_afterSave();
61
- }
62
- }
1
+ <?php
2
+
3
+ class Monext_Payline_Model_Adminhtml_System_Config_Backend_Contract extends Mage_Adminhtml_Model_System_Config_Backend_Serialized_Array
4
+ {
5
+ protected $_eventPrefix = 'payline_config_backend_contract';
6
+
7
+
8
+ protected function _afterLoad()
9
+ {
10
+ if (!is_array($this->getValue())) {
11
+ $value = $this->getValue();
12
+
13
  $collection = Mage::getModel('payline/contract')->getCollection();
14
  $store = Mage::app()->getRequest()->getParam('store', '');
15
  $website = Mage::app()->getRequest()->getParam('website', '');
19
  } elseif ($website) {
20
  $websiteId = Mage::getModel('core/website')->load($website)->getId();
21
  $collection->addWebsiteFilter($websiteId);
22
+ }
23
+
24
+ $contracts = $collection->toArray();
25
+
26
+ $values = $contracts['items'];
27
+
28
+ $this->setValue($values);
29
+ }
30
+ }
31
+
32
  protected function _beforeSave()
33
+ {
34
+ $contract_lists = Mage::app()->getRequest()->getParam('contract_list');
35
+
36
+ $defaultValues=array('is_primary'=>0,'is_secondary'=>0,'is_secure'=>0,'is_included_wallet_list'=>0);
37
+ foreach ($contract_lists as $contactId=>$contractValues) {
38
+ $contract_lists[$contactId] = array_merge($defaultValues, $contractValues);
39
+ }
40
+
41
+ $this->setUnserializedValue($contract_lists);
42
+ $this->setValue($contract_lists);
43
+
44
  parent::_beforeSave();
45
+ }
46
+
47
  protected function _afterSave()
48
+ {
49
+ if (Mage::getStoreConfig($this->getPath())!=$this->getValue()) {
50
  $contract_lists = $this->getUnserializedValue();
51
 
52
  $store = Mage::app()->getRequest()->getParam('store', '');
54
 
55
  Mage::getResourceModel('payline/contract')->updateOptionsContractList(
56
  $contract_lists, $website, $store
57
+ );
58
  }
59
 
60
  parent::_afterSave();
61
+ }
62
+ }
app/code/community/Monext/Payline/Model/Adminhtml/System/Config/Backend/Enabled.php CHANGED
@@ -1,22 +1,22 @@
1
- <?php
2
-
3
- class Monext_Payline_Model_Adminhtml_System_Config_Backend_Enabled extends Mage_Core_Model_Config_Data
4
- {
5
- /**
6
- * Check settings after save
7
- */
8
- protected function _afterSave()
9
- {
10
- if (Mage::getStoreConfig($this->getPath())!=$this->getFieldsetDataValue(basename($this->getPath()))) {
11
-
12
- $change = Mage::registry('payline_config_disable_payments');
13
- if (!empty($change)) {
14
- Mage::unregister('payline_config_disable_payments');
15
- }
16
-
17
- if(!$this->getFieldsetDataValue(basename($this->getPath()))) {
18
- Mage::register('payline_config_disable_payments', true);
19
- }
20
- }
21
- }
22
- }
1
+ <?php
2
+
3
+ class Monext_Payline_Model_Adminhtml_System_Config_Backend_Enabled extends Mage_Core_Model_Config_Data
4
+ {
5
+ /**
6
+ * Check settings after save
7
+ */
8
+ protected function _afterSave()
9
+ {
10
+ if (Mage::getStoreConfig($this->getPath())!=$this->getFieldsetDataValue(basename($this->getPath()))) {
11
+
12
+ $change = Mage::registry('payline_config_disable_payments');
13
+ if (!empty($change)) {
14
+ Mage::unregister('payline_config_disable_payments');
15
+ }
16
+
17
+ if(!$this->getFieldsetDataValue(basename($this->getPath()))) {
18
+ Mage::register('payline_config_disable_payments', true);
19
+ }
20
+ }
21
+ }
22
+ }
app/code/community/Monext/Payline/Model/Adminhtml/System/Config/Source/Environment.php CHANGED
@@ -1,34 +1,34 @@
1
- <?php
2
- require_once(Mage::getBaseDir() . '/app/code/community/Monext/Payline/lib/paylineSDK.php');
3
-
4
- class Monext_Payline_Model_Adminhtml_System_Config_Source_Environment
5
- {
6
-
7
- /**
8
- * Options getter
9
- *
10
- * @return array
11
- */
12
- public function toOptionArray()
13
- {
14
- return array(
15
- //array('value' => paylineSDK::ENV_DEV, 'label'=>paylineSDK::ENV_DEV),
16
- array('value' => paylineSDK::ENV_HOMO, 'label'=>paylineSDK::ENV_HOMO),
17
- array('value' => paylineSDK::ENV_PROD, 'label'=>paylineSDK::ENV_PROD)
18
- );
19
- }
20
-
21
- /**
22
- * Get options in "key-value" format
23
- *
24
- * @return array
25
- */
26
- public function toArray()
27
- {
28
- return array(
29
- paylineSDK::ENV_HOMO => Mage::helper('adminhtml')->__(paylineSDK::ENV_HOMO),
30
- paylineSDK::ENV_PROD => Mage::helper('adminhtml')->__(paylineSDK::ENV_PROD),
31
- );
32
- }
33
-
34
- }
1
+ <?php
2
+ require_once(Mage::getBaseDir() . '/app/code/community/Monext/Payline/lib/paylineSDK.php');
3
+
4
+ class Monext_Payline_Model_Adminhtml_System_Config_Source_Environment
5
+ {
6
+
7
+ /**
8
+ * Options getter
9
+ *
10
+ * @return array
11
+ */
12
+ public function toOptionArray()
13
+ {
14
+ return array(
15
+ //array('value' => paylineSDK::ENV_DEV, 'label'=>paylineSDK::ENV_DEV),
16
+ array('value' => paylineSDK::ENV_HOMO, 'label'=>paylineSDK::ENV_HOMO),
17
+ array('value' => paylineSDK::ENV_PROD, 'label'=>paylineSDK::ENV_PROD)
18
+ );
19
+ }
20
+
21
+ /**
22
+ * Get options in "key-value" format
23
+ *
24
+ * @return array
25
+ */
26
+ public function toArray()
27
+ {
28
+ return array(
29
+ paylineSDK::ENV_HOMO => Mage::helper('adminhtml')->__(paylineSDK::ENV_HOMO),
30
+ paylineSDK::ENV_PROD => Mage::helper('adminhtml')->__(paylineSDK::ENV_PROD),
31
+ );
32
+ }
33
+
34
+ }
app/code/community/Monext/Payline/Model/Contract.php CHANGED
@@ -1,14 +1,14 @@
1
- <?php
2
-
3
- /**
4
- * Payline contracts model
5
- */
6
-
7
- class Monext_Payline_Model_Contract extends Mage_Core_Model_Abstract
8
- {
9
- public function _construct()
10
- {
11
- parent::_construct();
12
- $this->_init('payline/contract');
13
- }
14
- }
1
+ <?php
2
+
3
+ /**
4
+ * Payline contracts model
5
+ */
6
+
7
+ class Monext_Payline_Model_Contract extends Mage_Core_Model_Abstract
8
+ {
9
+ public function _construct()
10
+ {
11
+ parent::_construct();
12
+ $this->_init('payline/contract');
13
+ }
14
+ }
app/code/community/Monext/Payline/Model/Contract/Status.php CHANGED
@@ -1,14 +1,14 @@
1
- <?php
2
-
3
- /**
4
- * Payline contracts status model
5
- */
6
-
7
- class Monext_Payline_Model_Contract_Status extends Mage_Core_Model_Abstract
8
- {
9
- public function _construct()
10
- {
11
- parent::_construct();
12
- $this->_init('payline/contract_status');
13
- }
14
- }
1
+ <?php
2
+
3
+ /**
4
+ * Payline contracts status model
5
+ */
6
+
7
+ class Monext_Payline_Model_Contract_Status extends Mage_Core_Model_Abstract
8
+ {
9
+ public function _construct()
10
+ {
11
+ parent::_construct();
12
+ $this->_init('payline/contract_status');
13
+ }
14
+ }
app/code/community/Monext/Payline/Model/Cpt.php CHANGED
@@ -20,7 +20,7 @@ class Monext_Payline_Model_Cpt extends Mage_Payment_Model_Method_Abstract
20
  protected $_canCapture = true;
21
  protected $_canCapturePartial = true;
22
  protected $_canVoid = true;
23
-
24
 
25
  /**
26
  * Check whether payment method can be used
@@ -36,7 +36,7 @@ class Monext_Payline_Model_Cpt extends Mage_Payment_Model_Method_Abstract
36
  }else{
37
  return false;
38
  }
39
- }
40
 
41
  /**
42
  * Return Order place redirect url
20
  protected $_canCapture = true;
21
  protected $_canCapturePartial = true;
22
  protected $_canVoid = true;
23
+
24
 
25
  /**
26
  * Check whether payment method can be used
36
  }else{
37
  return false;
38
  }
39
+ }
40
 
41
  /**
42
  * Return Order place redirect url
app/code/community/Monext/Payline/Model/Datasource/Actions.php CHANGED
File without changes
app/code/community/Monext/Payline/Model/Datasource/Billingcycles.php CHANGED
File without changes
app/code/community/Monext/Payline/Model/Datasource/Billingoccurrences.php CHANGED
File without changes
app/code/community/Monext/Payline/Model/Datasource/Capturepaymentoptions.php CHANGED
@@ -1,43 +1,43 @@
1
- <?php
2
- /**
3
- * Class used as a datasource to display available events to trigger payment capture
4
- */
5
- class Monext_Payline_Model_Datasource_Capturepaymentoptions extends Mage_Adminhtml_Model_System_Config_Source_Order_Status
6
- {
7
-
8
- protected $_options;
9
-
10
- public function toOptionArray()
11
- {
12
- if ($this->_options === null) {
13
- $options = array();
14
- $options[] = array(
15
- 'value' => 'invoice',
16
- 'label' => 'When Invoice is created'
17
- );
18
-
19
- if (class_exists('Mage_Sales_Model_Mysql4_Order_Status_Collection')) {
20
- $collection = Mage::getResourceModel('sales/order_status_collection')
21
- ->orderByLabel();
22
- foreach ($collection as $status) {
23
- $options[] = array(
24
- 'value' => $status->getStatus(),
25
- 'label' => Mage::helper('payline')->__("When order status is '%s'", $status->getStoreLabel())
26
- );
27
- }
28
- } else {
29
- $statuses = Mage::getSingleton('sales/order_config')->getStatuses();
30
- foreach ($statuses as $code=>$label) {
31
- $options[] = array(
32
- 'value' => $code,
33
- 'label' => Mage::helper('payline')->__("When order status is '%s'", $label)
34
- );
35
- }
36
- }
37
-
38
- $this->_options = $options;
39
- }
40
-
41
- return $this->_options;
42
- }
43
  }
1
+ <?php
2
+ /**
3
+ * Class used as a datasource to display available events to trigger payment capture
4
+ */
5
+ class Monext_Payline_Model_Datasource_Capturepaymentoptions extends Mage_Adminhtml_Model_System_Config_Source_Order_Status
6
+ {
7
+
8
+ protected $_options;
9
+
10
+ public function toOptionArray()
11
+ {
12
+ if ($this->_options === null) {
13
+ $options = array();
14
+ $options[] = array(
15
+ 'value' => 'invoice',
16
+ 'label' => 'When Invoice is created'
17
+ );
18
+
19
+ if (class_exists('Mage_Sales_Model_Mysql4_Order_Status_Collection')) {
20
+ $collection = Mage::getResourceModel('sales/order_status_collection')
21
+ ->orderByLabel();
22
+ foreach ($collection as $status) {
23
+ $options[] = array(
24
+ 'value' => $status->getStatus(),
25
+ 'label' => Mage::helper('payline')->__("When order status is '%s'", $status->getStoreLabel())
26
+ );
27
+ }
28
+ } else {
29
+ $statuses = Mage::getSingleton('sales/order_config')->getStatuses();
30
+ foreach ($statuses as $code=>$label) {
31
+ $options[] = array(
32
+ 'value' => $code,
33
+ 'label' => Mage::helper('payline')->__("When order status is '%s'", $label)
34
+ );
35
+ }
36
+ }
37
+
38
+ $this->_options = $options;
39
+ }
40
+
41
+ return $this->_options;
42
+ }
43
  }
app/code/community/Monext/Payline/Model/Datasource/Cms/Block.php CHANGED
@@ -1,32 +1,32 @@
1
- <?php
2
- class Monext_Payline_Model_Datasource_Cms_Block
3
- {
4
- protected $_options;
5
-
6
- public function toOptionArray()
7
- {
8
- if (!$this->_options) {
9
- $options = Mage::getResourceModel('cms/block_collection')
10
- ->load();
11
- $this->_options = $this->_toOptionIdArray($options);
12
- }
13
- return $this->_options;
14
- }
15
-
16
- protected function _toOptionIdArray($options)
17
- {
18
- $res = array();
19
- $res[] = array('value' => '', 'label' => Mage::helper('payline')->__('none'));
20
- foreach ($options as $item) {
21
- $identifier = $item->getData('identifier');
22
-
23
- $data['value'] = $identifier;
24
- $data['label'] = $identifier;
25
-
26
- $res[] = $data;
27
- }
28
-
29
- return $res;
30
- }
31
-
32
- }
1
+ <?php
2
+ class Monext_Payline_Model_Datasource_Cms_Block
3
+ {
4
+ protected $_options;
5
+
6
+ public function toOptionArray()
7
+ {
8
+ if (!$this->_options) {
9
+ $options = Mage::getResourceModel('cms/block_collection')
10
+ ->load();
11
+ $this->_options = $this->_toOptionIdArray($options);
12
+ }
13
+ return $this->_options;
14
+ }
15
+
16
+ protected function _toOptionIdArray($options)
17
+ {
18
+ $res = array();
19
+ $res[] = array('value' => '', 'label' => Mage::helper('payline')->__('none'));
20
+ foreach ($options as $item) {
21
+ $identifier = $item->getData('identifier');
22
+
23
+ $data['value'] = $identifier;
24
+ $data['label'] = $identifier;
25
+
26
+ $res[] = $data;
27
+ }
28
+
29
+ return $res;
30
+ }
31
+
32
+ }
app/code/community/Monext/Payline/Model/Datasource/Costs.php CHANGED
File without changes
app/code/community/Monext/Payline/Model/Datasource/Datatemplate.php CHANGED
@@ -1,17 +1,17 @@
1
- <?php
2
- /**
3
- * Class used as a datasource to display target Payline environment
4
- */
5
-
6
- class Monext_Payline_Model_Datasource_Datatemplate
7
- {
8
- public function toOptionArray()
9
- {
10
- return array(
11
- array('value' => 'redirect', 'label'=> Mage::helper('payline')->__('Redirection')),
12
- array('value' => 'lightbox', 'label'=> Mage::helper('payline')->__('Lightbox')),
13
- array('value' => 'tab', 'label'=> Mage::helper('payline')->__('Embedded tabs')),
14
- array('value' => 'column', 'label'=> Mage::helper('payline')->__('Embedded columns'))
15
- );
16
- }
17
- }
1
+ <?php
2
+ /**
3
+ * Class used as a datasource to display target Payline environment
4
+ */
5
+
6
+ class Monext_Payline_Model_Datasource_Datatemplate
7
+ {
8
+ public function toOptionArray()
9
+ {
10
+ return array(
11
+ array('value' => 'redirect', 'label'=> Mage::helper('payline')->__('Redirection')),
12
+ array('value' => 'lightbox', 'label'=> Mage::helper('payline')->__('Lightbox')),
13
+ array('value' => 'tab', 'label'=> Mage::helper('payline')->__('Embedded tabs')),
14
+ array('value' => 'column', 'label'=> Mage::helper('payline')->__('Embedded columns'))
15
+ );
16
+ }
17
+ }
app/code/community/Monext/Payline/Model/Datasource/Environment.php CHANGED
@@ -1,16 +1,16 @@
1
- <?php
2
- /**
3
- * Class used as a datasource to display target Payline environment
4
- */
5
- require_once(Mage::getBaseDir() . '/app/code/community/Monext/Payline/lib/paylineSDK.php');
6
- class Monext_Payline_Model_Datasource_Environment
7
- {
8
- public function toOptionArray()
9
- {
10
- return array(
11
- //array('value' => paylineSDK::ENV_DEV, 'label'=>paylineSDK::ENV_DEV),
12
- array('value' => paylineSDK::ENV_HOMO, 'label'=>paylineSDK::ENV_HOMO),
13
- array('value' => paylineSDK::ENV_PROD, 'label'=>paylineSDK::ENV_PROD)
14
- );
15
- }
16
- }
1
+ <?php
2
+ /**
3
+ * Class used as a datasource to display target Payline environment
4
+ */
5
+ require_once(Mage::getBaseDir() . '/app/code/community/Monext/Payline/lib/paylineSDK.php');
6
+ class Monext_Payline_Model_Datasource_Environment
7
+ {
8
+ public function toOptionArray()
9
+ {
10
+ return array(
11
+ //array('value' => paylineSDK::ENV_DEV, 'label'=>paylineSDK::ENV_DEV),
12
+ array('value' => paylineSDK::ENV_HOMO, 'label'=>paylineSDK::ENV_HOMO),
13
+ array('value' => paylineSDK::ENV_PROD, 'label'=>paylineSDK::ENV_PROD)
14
+ );
15
+ }
16
+ }
app/code/community/Monext/Payline/Model/Datasource/Languages.php CHANGED
File without changes
app/code/community/Monext/Payline/Model/Datasource/Paylineproductcategories.php CHANGED
@@ -1,46 +1,46 @@
1
- <?php
2
- /**
3
- * Class used as a datasource to display Payline product categories
4
- */
5
- class Monext_Payline_Model_Datasource_Paylineproductcategories
6
- {
7
- private $data = array(
8
- 1 => 'Informatique (matériel et logiciel)',
9
- 2 => 'Electronique',
10
- 3 => 'Téléphone',
11
- 4 => 'Electroménager',
12
- 5 => 'Habitat et jardin',
13
- 6 => 'Mode',
14
- 7 => 'Produit de beauté',
15
- 8 => 'Bijouterie',
16
- 9 => 'Sport',
17
- 10 => 'Loisirs',
18
- 11 => 'Automobiles / motos',
19
- 12 => 'Ammeublement',
20
- 13 => 'Enfants',
21
- 14 => 'Jeux video',
22
- 15 => 'Jouets',
23
- 16 => 'Animaux',
24
- 17 => 'Alimentation',
25
- 18 => 'Cadeaux',
26
- 19 => 'Spectacles',
27
- 20 => 'Voyages',
28
- 21 => 'Enchères',
29
- 22 => 'Services aux particuliers',
30
- 23 => 'Services aux professionnels'
31
- );
32
-
33
- public function toOptionArray()
34
- {
35
- $ret = array();
36
- $n=1;
37
- for($n=1;$n<sizeof($this->data)+1;$n++){
38
- $ret[$n] = array('value' => $n, 'label' => $this->data[$n]);
39
- }
40
- return $ret;
41
- }
42
-
43
- public function getLabelbyId($id){
44
- return $this->data[$id];
45
- }
46
- }
1
+ <?php
2
+ /**
3
+ * Class used as a datasource to display Payline product categories
4
+ */
5
+ class Monext_Payline_Model_Datasource_Paylineproductcategories
6
+ {
7
+ private $data = array(
8
+ 1 => 'Informatique (matériel et logiciel)',
9
+ 2 => 'Electronique',
10
+ 3 => 'Téléphone',
11
+ 4 => 'Electroménager',
12
+ 5 => 'Habitat et jardin',
13
+ 6 => 'Mode',
14
+ 7 => 'Produit de beauté',
15
+ 8 => 'Bijouterie',
16
+ 9 => 'Sport',
17
+ 10 => 'Loisirs',
18
+ 11 => 'Automobiles / motos',
19
+ 12 => 'Ammeublement',
20
+ 13 => 'Enfants',
21
+ 14 => 'Jeux video',
22
+ 15 => 'Jouets',
23
+ 16 => 'Animaux',
24
+ 17 => 'Alimentation',
25
+ 18 => 'Cadeaux',
26
+ 19 => 'Spectacles',
27
+ 20 => 'Voyages',
28
+ 21 => 'Enchères',
29
+ 22 => 'Services aux particuliers',
30
+ 23 => 'Services aux professionnels'
31
+ );
32
+
33
+ public function toOptionArray()
34
+ {
35
+ $ret = array();
36
+ $n=1;
37
+ for($n=1;$n<sizeof($this->data)+1;$n++){
38
+ $ret[$n] = array('value' => $n, 'label' => $this->data[$n]);
39
+ }
40
+ return $ret;
41
+ }
42
+
43
+ public function getLabelbyId($id){
44
+ return $this->data[$id];
45
+ }
46
+ }
app/code/community/Monext/Payline/Model/Datasource/Paymentactions.php CHANGED
File without changes
app/code/community/Monext/Payline/Model/Datasource/Paymentactionsreauth.php CHANGED
@@ -1,14 +1,14 @@
1
- <?php
2
- /**
3
- * Class used as a datasource to display available payment actions
4
- */
5
- class Monext_Payline_Model_Datasource_Paymentactionsreauth
6
- {
7
- public function toOptionArray()
8
- {
9
- return array(
10
- array('value' => 101, 'label'=>Mage::helper('payline')->__('re-authorization + capture')),
11
- array('value' => 100, 'label'=>Mage::helper('payline')->__('re-authorization'))
12
- );
13
- }
14
- }
1
+ <?php
2
+ /**
3
+ * Class used as a datasource to display available payment actions
4
+ */
5
+ class Monext_Payline_Model_Datasource_Paymentactionsreauth
6
+ {
7
+ public function toOptionArray()
8
+ {
9
+ return array(
10
+ array('value' => 101, 'label'=>Mage::helper('payline')->__('re-authorization + capture')),
11
+ array('value' => 100, 'label'=>Mage::helper('payline')->__('re-authorization'))
12
+ );
13
+ }
14
+ }
app/code/community/Monext/Payline/Model/Datasource/Return.php CHANGED
File without changes
app/code/community/Monext/Payline/Model/Datasource/Securitymodes.php CHANGED
File without changes
app/code/community/Monext/Payline/Model/Datasource/Shippingmethods.php CHANGED
@@ -1,22 +1,22 @@
1
- <?php
2
- /**
3
- * Class used as a datasource to display available shipping methods
4
- * Only the 3 basic (no user configuration during checkout process) Magento methods are available
5
- */
6
- class Monext_Payline_Model_Datasource_Shippingmethods
7
- {
8
- public function toOptionArray(){
9
- $availableMethods=array();
10
- $availableMethods[]=array('value'=>'', 'label'=>Mage::helper('payline')->__('- none -'));
11
- if (Mage::getStoreConfig('carriers/flatrate/active')){
12
- $availableMethods[]=array('value'=>'flatrate_flatrate', 'label'=>Mage::helper('payline')->__('Flat Rate'));
13
- }
14
- if (Mage::getStoreConfig('carriers/tablerate/active')){
15
- $availableMethods[]=array('value'=>'tablerate_bestway', 'label'=>Mage::helper('payline')->__('Table Rate'));
16
- }
17
- if (Mage::getStoreConfig('carriers/freeshipping/active')){
18
- $availableMethods[]=array('value'=>'freeshipping_freeshipping', 'label'=>Mage::helper('payline')->__('Free Shipping'));
19
- }
20
- return $availableMethods;
21
- }
22
  }
1
+ <?php
2
+ /**
3
+ * Class used as a datasource to display available shipping methods
4
+ * Only the 3 basic (no user configuration during checkout process) Magento methods are available
5
+ */
6
+ class Monext_Payline_Model_Datasource_Shippingmethods
7
+ {
8
+ public function toOptionArray(){
9
+ $availableMethods=array();
10
+ $availableMethods[]=array('value'=>'', 'label'=>Mage::helper('payline')->__('- none -'));
11
+ if (Mage::getStoreConfig('carriers/flatrate/active')){
12
+ $availableMethods[]=array('value'=>'flatrate_flatrate', 'label'=>Mage::helper('payline')->__('Flat Rate'));
13
+ }
14
+ if (Mage::getStoreConfig('carriers/tablerate/active')){
15
+ $availableMethods[]=array('value'=>'tablerate_bestway', 'label'=>Mage::helper('payline')->__('Table Rate'));
16
+ }
17
+ if (Mage::getStoreConfig('carriers/freeshipping/active')){
18
+ $availableMethods[]=array('value'=>'freeshipping_freeshipping', 'label'=>Mage::helper('payline')->__('Free Shipping'));
19
+ }
20
+ return $availableMethods;
21
+ }
22
  }
app/code/community/Monext/Payline/Model/Datasource/Status.php CHANGED
@@ -1,41 +1,41 @@
1
- <?php
2
- class Monext_Payline_Model_Datasource_Status extends Mage_Adminhtml_Model_System_Config_Source_Order_Status
3
- {
4
- protected $_options;
5
-
6
- public function toOptionArray()
7
- {
8
- if ($this->_options === null) {
9
- $options = array();
10
- if (class_exists('Mage_Sales_Model_Mysql4_Order_Status_Collection')) {
11
- $collection = Mage::getResourceModel('sales/order_status_collection')
12
- ->orderByLabel();
13
- $statusValue = '';
14
- foreach ($collection as $status) {
15
- $statusValue = $status->getStatus();
16
- if( $statusValue === 'complete' || $statusValue === 'closed' ) {
17
- continue;
18
- }
19
- $options[] = array(
20
- 'value' => $statusValue,
21
- 'label' => $status->getStoreLabel()
22
- );
23
- }
24
- } else {
25
- $statuses = Mage::getSingleton('sales/order_config')->getStatuses();
26
- foreach ($statuses as $code=>$label) {
27
- if( $code === 'complete' || $code === 'closed' ) {
28
- continue;
29
- }
30
- $options[] = array(
31
- 'value' => $code,
32
- 'label' => $label
33
- );
34
- }
35
- }
36
- $this->_options = $options;
37
- }
38
-
39
- return $this->_options;
40
- }
41
  }
1
+ <?php
2
+ class Monext_Payline_Model_Datasource_Status extends Mage_Adminhtml_Model_System_Config_Source_Order_Status
3
+ {
4
+ protected $_options;
5
+
6
+ public function toOptionArray()
7
+ {
8
+ if ($this->_options === null) {
9
+ $options = array();
10
+ if (class_exists('Mage_Sales_Model_Mysql4_Order_Status_Collection')) {
11
+ $collection = Mage::getResourceModel('sales/order_status_collection')
12
+ ->orderByLabel();
13
+ $statusValue = '';
14
+ foreach ($collection as $status) {
15
+ $statusValue = $status->getStatus();
16
+ if( $statusValue === 'complete' || $statusValue === 'closed' ) {
17
+ continue;
18
+ }
19
+ $options[] = array(
20
+ 'value' => $statusValue,
21
+ 'label' => $status->getStoreLabel()
22
+ );
23
+ }
24
+ } else {
25
+ $statuses = Mage::getSingleton('sales/order_config')->getStatuses();
26
+ foreach ($statuses as $code=>$label) {
27
+ if( $code === 'complete' || $code === 'closed' ) {
28
+ continue;
29
+ }
30
+ $options[] = array(
31
+ 'value' => $code,
32
+ 'label' => $label
33
+ );
34
+ }
35
+ }
36
+ $this->_options = $options;
37
+ }
38
+
39
+ return $this->_options;
40
+ }
41
  }
app/code/community/Monext/Payline/Model/Datasource/Status/Canceled.php CHANGED
@@ -1,12 +1,12 @@
1
- <?php
2
-
3
- /**
4
- * Class used as a datasource to display available states for canceled/refused orders
5
- */
6
- class Monext_Payline_Model_Datasource_Status_Canceled extends Mage_Adminhtml_Model_System_Config_Source_Order_Status
7
- {
8
- protected $_stateStatuses = array(
9
- Mage_Sales_Model_Order::STATE_CANCELED,
10
- Mage_Sales_Model_Order::STATE_HOLDED,
11
- );
12
  }
1
+ <?php
2
+
3
+ /**
4
+ * Class used as a datasource to display available states for canceled/refused orders
5
+ */
6
+ class Monext_Payline_Model_Datasource_Status_Canceled extends Mage_Adminhtml_Model_System_Config_Source_Order_Status
7
+ {
8
+ protected $_stateStatuses = array(
9
+ Mage_Sales_Model_Order::STATE_CANCELED,
10
+ Mage_Sales_Model_Order::STATE_HOLDED,
11
+ );
12
  }
app/code/community/Monext/Payline/Model/Datasource/Status/Invoice.php CHANGED
@@ -1,41 +1,41 @@
1
- <?php
2
- class Monext_Payline_Model_Datasource_Status_Invoice extends Monext_Payline_Model_Datasource_Status
3
- {
4
- public function toOptionArray()
5
- {
6
-
7
- if ($this->_options === null) {
8
- $options = array();
9
- $options[] = array(
10
- 'value' => '',
11
- 'label' => Mage::helper('adminhtml')->__('No')
12
- );
13
- $options[] = array(
14
- 'value' => 'return',
15
- 'label' => Mage::helper('payline')->__('Back to the shop')
16
- );
17
- if (class_exists('Mage_Sales_Model_Mysql4_Order_Status_Collection')) {
18
- $collection = Mage::getResourceModel('sales/order_status_collection')
19
- ->orderByLabel();
20
- foreach ($collection as $status) {
21
- $options[] = array(
22
- 'value' => $status->getStatus(),
23
- 'label' => Mage::helper('payline')->__("When order status is '%s'", $status->getStoreLabel())
24
- );
25
- }
26
- } else {
27
- $statuses = Mage::getSingleton('sales/order_config')->getStatuses();
28
- foreach ($statuses as $code=>$label) {
29
- $options[] = array(
30
- 'value' => $code,
31
- 'label' => Mage::helper('payline')->__("When order status is '%s'", $label)
32
- );
33
- }
34
- }
35
-
36
- $this->_options = $options;
37
- }
38
-
39
- return $this->_options;
40
- }
41
  }
1
+ <?php
2
+ class Monext_Payline_Model_Datasource_Status_Invoice extends Monext_Payline_Model_Datasource_Status
3
+ {
4
+ public function toOptionArray()
5
+ {
6
+
7
+ if ($this->_options === null) {
8
+ $options = array();
9
+ $options[] = array(
10
+ 'value' => '',
11
+ 'label' => Mage::helper('adminhtml')->__('No')
12
+ );
13
+ $options[] = array(
14
+ 'value' => 'return',
15
+ 'label' => Mage::helper('payline')->__('Back to the shop')
16
+ );
17
+ if (class_exists('Mage_Sales_Model_Mysql4_Order_Status_Collection')) {
18
+ $collection = Mage::getResourceModel('sales/order_status_collection')
19
+ ->orderByLabel();
20
+ foreach ($collection as $status) {
21
+ $options[] = array(
22
+ 'value' => $status->getStatus(),
23
+ 'label' => Mage::helper('payline')->__("When order status is '%s'", $status->getStoreLabel())
24
+ );
25
+ }
26
+ } else {
27
+ $statuses = Mage::getSingleton('sales/order_config')->getStatuses();
28
+ foreach ($statuses as $code=>$label) {
29
+ $options[] = array(
30
+ 'value' => $code,
31
+ 'label' => Mage::helper('payline')->__("When order status is '%s'", $label)
32
+ );
33
+ }
34
+ }
35
+
36
+ $this->_options = $options;
37
+ }
38
+
39
+ return $this->_options;
40
+ }
41
  }
app/code/community/Monext/Payline/Model/Datasource/Statusrowempty.php CHANGED
@@ -1,46 +1,46 @@
1
- <?php
2
- class Monext_Payline_Model_Datasource_Statusrowempty extends Mage_Adminhtml_Model_System_Config_Source_Order_Status
3
- {
4
- protected $_options;
5
-
6
- public function toOptionArray()
7
- {
8
- if ($this->_options === null) {
9
- $options = array();
10
- $options[] = array(
11
- 'value' => '',
12
- 'label' => 'None'
13
- );
14
- if (class_exists('Mage_Sales_Model_Mysql4_Order_Status_Collection')) {
15
- $collection = Mage::getResourceModel('sales/order_status_collection')
16
- ->orderByLabel();
17
- $statusValue = '';
18
- foreach ($collection as $status) {
19
- $statusValue = $status->getStatus();
20
- if( $statusValue === 'complete' || $statusValue === 'closed' ) {
21
- continue;
22
- }
23
- $options[] = array(
24
- 'value' => $statusValue,
25
- 'label' => $status->getStoreLabel()
26
- );
27
- }
28
- } else {
29
- $statuses = Mage::getSingleton('sales/order_config')->getStatuses();
30
- foreach ($statuses as $code=>$label) {
31
- if( $code === 'complete' || $code === 'closed' ) {
32
- continue;
33
- }
34
- $options[] = array(
35
- 'value' => $code,
36
- 'label' => $label
37
- );
38
- }
39
- }
40
-
41
- $this->_options = $options;
42
- }
43
-
44
- return $this->_options;
45
- }
46
  }
1
+ <?php
2
+ class Monext_Payline_Model_Datasource_Statusrowempty extends Mage_Adminhtml_Model_System_Config_Source_Order_Status
3
+ {
4
+ protected $_options;
5
+
6
+ public function toOptionArray()
7
+ {
8
+ if ($this->_options === null) {
9
+ $options = array();
10
+ $options[] = array(
11
+ 'value' => '',
12
+ 'label' => 'None'
13
+ );
14
+ if (class_exists('Mage_Sales_Model_Mysql4_Order_Status_Collection')) {
15
+ $collection = Mage::getResourceModel('sales/order_status_collection')
16
+ ->orderByLabel();
17
+ $statusValue = '';
18
+ foreach ($collection as $status) {
19
+ $statusValue = $status->getStatus();
20
+ if( $statusValue === 'complete' || $statusValue === 'closed' ) {
21
+ continue;
22
+ }
23
+ $options[] = array(
24
+ 'value' => $statusValue,
25
+ 'label' => $status->getStoreLabel()
26
+ );
27
+ }
28
+ } else {
29
+ $statuses = Mage::getSingleton('sales/order_config')->getStatuses();
30
+ foreach ($statuses as $code=>$label) {
31
+ if( $code === 'complete' || $code === 'closed' ) {
32
+ continue;
33
+ }
34
+ $options[] = array(
35
+ 'value' => $code,
36
+ 'label' => $label
37
+ );
38
+ }
39
+ }
40
+
41
+ $this->_options = $options;
42
+ }
43
+
44
+ return $this->_options;
45
+ }
46
  }
app/code/community/Monext/Payline/Model/Datasource/Walletsecurity.php CHANGED
@@ -1,16 +1,16 @@
1
- <?php
2
- /**
3
- * Class used as a datasource to display target Payline environment
4
- */
5
- class Monext_Payline_Model_Datasource_Walletsecurity
6
- {
7
- public function toOptionArray()
8
- {
9
- return array(
10
- array('value' => Monext_Payline_Helper_Data::WALLET_NONE, 'label'=>Mage::helper('payline')->__('- none -')),
11
- // array('value' => Monext_Payline_Helper_Data::WALLET_CVV, 'label'=>Mage::helper('payline')->__('CVV')),
12
- array('value' => Monext_Payline_Helper_Data::WALLET_3DS, 'label'=>Mage::helper('payline')->__('3DS'))
13
- // array('value' => Monext_Payline_Helper_Data::WALLET_BOTH, 'label'=>Mage::helper('payline')->__('CVV + 3DS'))
14
- );
15
- }
16
- }
1
+ <?php
2
+ /**
3
+ * Class used as a datasource to display target Payline environment
4
+ */
5
+ class Monext_Payline_Model_Datasource_Walletsecurity
6
+ {
7
+ public function toOptionArray()
8
+ {
9
+ return array(
10
+ array('value' => Monext_Payline_Helper_Data::WALLET_NONE, 'label'=>Mage::helper('payline')->__('- none -')),
11
+ // array('value' => Monext_Payline_Helper_Data::WALLET_CVV, 'label'=>Mage::helper('payline')->__('CVV')),
12
+ array('value' => Monext_Payline_Helper_Data::WALLET_3DS, 'label'=>Mage::helper('payline')->__('3DS'))
13
+ // array('value' => Monext_Payline_Helper_Data::WALLET_BOTH, 'label'=>Mage::helper('payline')->__('CVV + 3DS'))
14
+ );
15
+ }
16
+ }
app/code/community/Monext/Payline/Model/Datasource/Widgettemplate.php CHANGED
@@ -1,16 +1,16 @@
1
- <?php
2
- /**
3
- * Class used as a datasource to display widget options
4
- */
5
- class Monext_Payline_Model_Datasource_Widgettemplate
6
- {
7
- public function toOptionArray()
8
- {
9
- return array(
10
- array('value' => 0, 'label'=>Mage::helper('payline')->__('disabled')),
11
- array('value' => 'lightbox', 'label'=>Mage::helper('payline')->__('lightbox')),
12
- array('value' => 'column', 'label'=>Mage::helper('payline')->__('column')),
13
- array('value' => 'tab', 'label'=>Mage::helper('payline')->__('tab'))
14
- );
15
- }
16
- }
1
+ <?php
2
+ /**
3
+ * Class used as a datasource to display widget options
4
+ */
5
+ class Monext_Payline_Model_Datasource_Widgettemplate
6
+ {
7
+ public function toOptionArray()
8
+ {
9
+ return array(
10
+ array('value' => 0, 'label'=>Mage::helper('payline')->__('disabled')),
11
+ array('value' => 'lightbox', 'label'=>Mage::helper('payline')->__('lightbox')),
12
+ array('value' => 'column', 'label'=>Mage::helper('payline')->__('column')),
13
+ array('value' => 'tab', 'label'=>Mage::helper('payline')->__('tab'))
14
+ );
15
+ }
16
+ }
app/code/community/Monext/Payline/Model/Direct.php CHANGED
@@ -3,25 +3,25 @@
3
  * Payline direct payment method
4
  */
5
  class Monext_Payline_Model_Direct extends Mage_Payment_Model_Method_Abstract
6
- {
7
- protected $_code = 'PaylineDIRECT';
8
-
9
- protected $_formBlockType = 'payline/direct';
10
-
11
- protected $_infoBlockType = 'payline/info_direct';
12
-
13
- protected $_canCapture = true;
14
-
15
- protected $_canCapturePartial = true;
16
-
17
- protected $_canRefund = true;
18
-
19
- protected $_canRefundInvoicePartial = true;
20
-
21
- protected $_canVoid = true;
22
-
23
  protected $_canOrder = true;
24
-
25
 
26
  /**
27
  * Check whether payment method can be used
@@ -37,7 +37,7 @@ class Monext_Payline_Model_Direct extends Mage_Payment_Model_Method_Abstract
37
  }else{
38
  return false;
39
  }
40
- }
41
 
42
  public function assignData($data)
43
  {
3
  * Payline direct payment method
4
  */
5
  class Monext_Payline_Model_Direct extends Mage_Payment_Model_Method_Abstract
6
+ {
7
+ protected $_code = 'PaylineDIRECT';
8
+
9
+ protected $_formBlockType = 'payline/direct';
10
+
11
+ protected $_infoBlockType = 'payline/info_direct';
12
+
13
+ protected $_canCapture = true;
14
+
15
+ protected $_canCapturePartial = true;
16
+
17
+ protected $_canRefund = true;
18
+
19
+ protected $_canRefundInvoicePartial = true;
20
+
21
+ protected $_canVoid = true;
22
+
23
  protected $_canOrder = true;
24
+
25
 
26
  /**
27
  * Check whether payment method can be used
37
  }else{
38
  return false;
39
  }
40
+ }
41
 
42
  public function assignData($data)
43
  {
app/code/community/Monext/Payline/Model/Fees.php CHANGED
@@ -1,14 +1,14 @@
1
- <?php
2
-
3
- /**
4
- * Payline nx fees model
5
- */
6
-
7
- class Monext_Payline_Model_Fees extends Mage_Core_Model_Abstract
8
- {
9
- public function _construct()
10
- {
11
- parent::_construct();
12
- $this->_init('payline/fees');
13
- }
14
- }
1
+ <?php
2
+
3
+ /**
4
+ * Payline nx fees model
5
+ */
6
+
7
+ class Monext_Payline_Model_Fees extends Mage_Core_Model_Abstract
8
+ {
9
+ public function _construct()
10
+ {
11
+ parent::_construct();
12
+ $this->_init('payline/fees');
13
+ }
14
+ }
app/code/community/Monext/Payline/Model/Mysql4/Contract.php CHANGED
@@ -1,68 +1,68 @@
1
- <?php
2
-
3
- /**
4
- * Payline contracts resource model
5
- */
6
-
7
- class Monext_Payline_Model_Mysql4_Contract extends Mage_Core_Model_Mysql4_Abstract
8
- {
9
- public function _construct()
10
- {
11
- $this->_init('payline/contract', 'id');
12
- }
13
-
14
- /**
15
- * set primary = 0 and secondary = 0 for contracts that are not in $pointOfSell
16
- * @param type $pointOfSell
17
- */
18
- public function removePrimaryAndSecondaryNotIn($pointOfSell)
19
- {
20
- $connection = $this->_getWriteAdapter();
21
- $connection->beginTransaction();
22
- $fields = array();
23
- $fields['is_primary'] = 0;
24
- $fields['is_secondary'] = 0;
25
- $where = $connection->quoteInto('point_of_sell != ?', $pointOfSell);
26
- $connection->update($this->getTable('payline/contract'), $fields, $where);
27
- $connection->commit();
28
- }
29
-
30
  // Use fallback history pattern
31
  public function updateContractSecureList($ids, $optionToSet, $website_code, $store_code)
32
- {
33
  if(!is_array($ids)) {
34
  $ids = array($ids);
35
- }
36
-
37
- $contractOptions= array();
38
- foreach($ids as $contractId) {
39
- $contractOptions[$contractId] = array('is_secure'=>$optionToSet);
40
- }
41
-
42
 
43
- $this->updateOptionsContractList($contractOptions, $website_code, $store_code);
44
- }
 
45
 
46
  // Use fallback history pattern
47
- public function updateContractWalletList($ids, $optionToSet, $website_code, $store_code)
48
- {
49
  if(!is_array($ids)) {
50
  $ids = array($ids);
51
- }
52
-
53
  $contractOptions= array();
54
  foreach($ids as $contractId) {
55
  $contractOptions[$contractId] = array('is_included_wallet_list'=>$optionToSet);
56
- }
57
-
58
- $this->updateOptionsContractList($contractOptions, $website_code, $store_code);
59
- }
60
-
61
  // Use fallback history pattern
62
  public function updateOptionsContractList($contractOptions, $website_code, $store_code)
63
- {
64
-
65
- $ids = array_keys($contractOptions);
66
 
67
  $pointOfSell = $this->getPointOfSell($ids);
68
  $otherContracts = $this->getContractsNotIn($pointOfSell);
@@ -71,10 +71,10 @@ class Monext_Payline_Model_Mysql4_Contract extends Mage_Core_Model_Mysql4_Abstra
71
  $isDefaultLevel = false;
72
  $isWebsiteLevel = false;
73
  $isStoreViewLevel = false;
74
- $connection = $this->_getWriteAdapter();
75
-
76
-
77
- $keepOptionList=array('is_included_wallet_list','is_secure','is_primary','is_secondary');
78
 
79
  // set store & website code
80
  if(!$store_code) {
@@ -89,10 +89,10 @@ class Monext_Payline_Model_Mysql4_Contract extends Mage_Core_Model_Mysql4_Abstra
89
  } else {
90
  $isStoreViewLevel = true;
91
  $storeIds = array(Mage::app()->getStore($store_code)->getId());
92
- }
93
-
94
  $connection->beginTransaction();
95
-
96
  // process update
97
  if($isDefaultLevel) {
98
  // default level override son's options
@@ -102,55 +102,55 @@ class Monext_Payline_Model_Mysql4_Contract extends Mage_Core_Model_Mysql4_Abstra
102
 
103
  //Update contracts
104
  foreach ($contractOptions as $id=>$optionToSet) {
105
- $fields = $optionToSet;
106
- $where = $connection->quoteInto('id in (?)', $id);
107
- $connection->update($this->getTable('payline/contract'), $optionToSet, $where);
108
- }
109
-
110
- //Unset other options
111
- $optionToUnsset = array_fill_keys(array_keys(current($contractOptions)), 0);
112
- $connection->update($this->getTable('payline/contract'), $optionToUnsset, $connection->quoteInto('id not in (?)', array_keys($contractOptions)));
113
-
114
  $count = Mage::getModel('payline/contract')->getCollection()->addFieldToFilter('is_primary',1)->getSize();
115
  } else {
116
  $contractStatusRModel = Mage::getResourceModel('payline/contract_status');
117
 
118
- $conditionContract = 'contract_id in ('.implode(',',$ids).')';
119
  $conditionLevel= '(';
120
  if($isWebsiteLevel) $conditionLevel .= 'website_id = '. $websiteId . ' OR ';
121
  $conditionLevel .= 'store_id in (' . implode(',',$storeIds) . '))';
122
 
123
  // temporarily stock deleted rows to avoid is_primary and is_secondary data lost
124
- $deletedRows = $contractStatusRModel->queryContractStatus($ids, $storeIds, $websiteId);
125
-
126
- $connection->delete($this->getTable('payline/contract_status'), $conditionContract . ' AND ' . $conditionLevel);
127
-
128
  //Unset other options
129
  $optionToUnsset = array_fill_keys(array_keys(current($contractOptions)), 0);
130
  $connection->update($this->getTable('payline/contract_status'), $optionToUnsset, $connection->quoteInto('contract_id not in (?)', array_keys($contractOptions)) . ' AND ' . $conditionLevel);
131
-
132
  $fields=array();
133
  $fields['is_primary'] = 0;
134
  $fields['is_secondary'] = 0;
135
- $fields['is_secure'] = 0;
136
  $fields['is_included_wallet_list'] = 0;
137
 
138
- foreach ($contractOptions as $id=>$optionToSet) {
139
  if($isWebsiteLevel) {
140
  $data = array(
141
  'contract_id' => $id,
142
  'website_id' => $websiteId,
143
  'store_id' => null,
144
- );
145
-
146
  $data=array_merge($data, $fields, $optionToSet);
147
  // time to restore deleted info (if needed)
148
- $backup = $contractStatusRModel->getMatchingRowByKeys( $deletedRows, $data );
149
- foreach($keepOptionList as $fieldToBackup) {
150
- if(!array_key_exists($fieldToBackup, $optionToSet)) {
151
- $data[$fieldToBackup] = $backup[$fieldToBackup];
152
- }
153
- }
154
 
155
  $connection->insert($this->getTable('payline/contract_status'),$data);
156
  }
@@ -159,19 +159,19 @@ class Monext_Payline_Model_Mysql4_Contract extends Mage_Core_Model_Mysql4_Abstra
159
  'contract_id' => $id,
160
  'website_id' => null,
161
  'store_id' => $storeId,
162
- );
163
  $data=array_merge($data, $fields, $optionToSet);
164
- // time to restore deleted info (if needed)
165
- $backup = $contractStatusRModel->getMatchingRowByKeys( $deletedRows, $data );
166
-
167
- foreach($keepOptionList as $fieldToBackup) {
168
- if(!array_key_exists($fieldToBackup, $optionToSet)) {
169
- $data[$fieldToBackup] = $backup[$fieldToBackup];
170
- }
171
- }
172
  $connection->insert($this->getTable('payline/contract_status'),$data);
173
  }
174
- }
175
 
176
  if($isWebsiteLevel) {
177
  $count= Mage::getModel('payline/contract_status')->getCollection()
@@ -187,47 +187,47 @@ class Monext_Payline_Model_Mysql4_Contract extends Mage_Core_Model_Mysql4_Abstra
187
 
188
  Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('payline')->__('Contracts modified successfully'));
189
 
190
- } // end updateContractWalletList()
191
-
192
-
193
- /**
194
- * Get the point of sell of contracts
195
- * @param array $contract_ids
196
- * @return string
197
- */
198
- public function getPointOfSell($contract_ids) {
199
- $read = $this->_getReadAdapter();
200
-
201
- $select = $read->select()
202
- ->distinct()
203
- ->from($this->getTable('payline/contract'),array('point_of_sell'))
204
- ->where('id in (?)', $contract_ids);
205
-
206
- $result = $select->query();
207
- $row = $result->fetchAll();
208
- return $row[0]['point_of_sell'];
209
- }
210
-
211
- /**
212
- * Get contract ids of contracts not int $pointOfSell
213
- * @param string $pointOfSell
214
- * @return array
215
- */
216
- public function getContractsNotIn($pointOfSell) {
217
- $read = $this->_getReadAdapter();
218
-
219
- $select = $read->select()
220
- ->distinct()
221
- ->from($this->getTable('payline/contract'),array('id'))
222
- ->where('point_of_sell != ?', $pointOfSell);
223
-
224
- $result = $select->query();
225
- $row = $result->fetchAll();
226
- $res = array();
227
- foreach($row as $r) {
228
- $res[] = $r['id'];
229
- }
230
- return $res;
231
- }
232
-
233
- } //end class
1
+ <?php
2
+
3
+ /**
4
+ * Payline contracts resource model
5
+ */
6
+
7
+ class Monext_Payline_Model_Mysql4_Contract extends Mage_Core_Model_Mysql4_Abstract
8
+ {
9
+ public function _construct()
10
+ {
11
+ $this->_init('payline/contract', 'id');
12
+ }
13
+
14
+ /**
15
+ * set primary = 0 and secondary = 0 for contracts that are not in $pointOfSell
16
+ * @param type $pointOfSell
17
+ */
18
+ public function removePrimaryAndSecondaryNotIn($pointOfSell)
19
+ {
20
+ $connection = $this->_getWriteAdapter();
21
+ $connection->beginTransaction();
22
+ $fields = array();
23
+ $fields['is_primary'] = 0;
24
+ $fields['is_secondary'] = 0;
25
+ $where = $connection->quoteInto('point_of_sell != ?', $pointOfSell);
26
+ $connection->update($this->getTable('payline/contract'), $fields, $where);
27
+ $connection->commit();
28
+ }
29
+
30
  // Use fallback history pattern
31
  public function updateContractSecureList($ids, $optionToSet, $website_code, $store_code)
32
+ {
33
  if(!is_array($ids)) {
34
  $ids = array($ids);
35
+ }
36
+
37
+ $contractOptions= array();
38
+ foreach($ids as $contractId) {
39
+ $contractOptions[$contractId] = array('is_secure'=>$optionToSet);
40
+ }
 
41
 
42
+
43
+ $this->updateOptionsContractList($contractOptions, $website_code, $store_code);
44
+ }
45
 
46
  // Use fallback history pattern
47
+ public function updateContractWalletList($ids, $optionToSet, $website_code, $store_code)
48
+ {
49
  if(!is_array($ids)) {
50
  $ids = array($ids);
51
+ }
52
+
53
  $contractOptions= array();
54
  foreach($ids as $contractId) {
55
  $contractOptions[$contractId] = array('is_included_wallet_list'=>$optionToSet);
56
+ }
57
+
58
+ $this->updateOptionsContractList($contractOptions, $website_code, $store_code);
59
+ }
60
+
61
  // Use fallback history pattern
62
  public function updateOptionsContractList($contractOptions, $website_code, $store_code)
63
+ {
64
+
65
+ $ids = array_keys($contractOptions);
66
 
67
  $pointOfSell = $this->getPointOfSell($ids);
68
  $otherContracts = $this->getContractsNotIn($pointOfSell);
71
  $isDefaultLevel = false;
72
  $isWebsiteLevel = false;
73
  $isStoreViewLevel = false;
74
+ $connection = $this->_getWriteAdapter();
75
+
76
+
77
+ $keepOptionList=array('is_included_wallet_list','is_secure','is_primary','is_secondary');
78
 
79
  // set store & website code
80
  if(!$store_code) {
89
  } else {
90
  $isStoreViewLevel = true;
91
  $storeIds = array(Mage::app()->getStore($store_code)->getId());
92
+ }
93
+
94
  $connection->beginTransaction();
95
+
96
  // process update
97
  if($isDefaultLevel) {
98
  // default level override son's options
102
 
103
  //Update contracts
104
  foreach ($contractOptions as $id=>$optionToSet) {
105
+ $fields = $optionToSet;
106
+ $where = $connection->quoteInto('id in (?)', $id);
107
+ $connection->update($this->getTable('payline/contract'), $optionToSet, $where);
108
+ }
109
+
110
+ //Unset other options
111
+ $optionToUnsset = array_fill_keys(array_keys(current($contractOptions)), 0);
112
+ $connection->update($this->getTable('payline/contract'), $optionToUnsset, $connection->quoteInto('id not in (?)', array_keys($contractOptions)));
113
+
114
  $count = Mage::getModel('payline/contract')->getCollection()->addFieldToFilter('is_primary',1)->getSize();
115
  } else {
116
  $contractStatusRModel = Mage::getResourceModel('payline/contract_status');
117
 
118
+ $conditionContract = 'contract_id in ('.implode(',',$ids).')';
119
  $conditionLevel= '(';
120
  if($isWebsiteLevel) $conditionLevel .= 'website_id = '. $websiteId . ' OR ';
121
  $conditionLevel .= 'store_id in (' . implode(',',$storeIds) . '))';
122
 
123
  // temporarily stock deleted rows to avoid is_primary and is_secondary data lost
124
+ $deletedRows = $contractStatusRModel->queryContractStatus($ids, $storeIds, $websiteId);
125
+
126
+ $connection->delete($this->getTable('payline/contract_status'), $conditionContract . ' AND ' . $conditionLevel);
127
+
128
  //Unset other options
129
  $optionToUnsset = array_fill_keys(array_keys(current($contractOptions)), 0);
130
  $connection->update($this->getTable('payline/contract_status'), $optionToUnsset, $connection->quoteInto('contract_id not in (?)', array_keys($contractOptions)) . ' AND ' . $conditionLevel);
131
+
132
  $fields=array();
133
  $fields['is_primary'] = 0;
134
  $fields['is_secondary'] = 0;
135
+ $fields['is_secure'] = 0;
136
  $fields['is_included_wallet_list'] = 0;
137
 
138
+ foreach ($contractOptions as $id=>$optionToSet) {
139
  if($isWebsiteLevel) {
140
  $data = array(
141
  'contract_id' => $id,
142
  'website_id' => $websiteId,
143
  'store_id' => null,
144
+ );
145
+
146
  $data=array_merge($data, $fields, $optionToSet);
147
  // time to restore deleted info (if needed)
148
+ $backup = $contractStatusRModel->getMatchingRowByKeys( $deletedRows, $data );
149
+ foreach($keepOptionList as $fieldToBackup) {
150
+ if(!array_key_exists($fieldToBackup, $optionToSet)) {
151
+ $data[$fieldToBackup] = $backup[$fieldToBackup];
152
+ }
153
+ }
154
 
155
  $connection->insert($this->getTable('payline/contract_status'),$data);
156
  }
159
  'contract_id' => $id,
160
  'website_id' => null,
161
  'store_id' => $storeId,
162
+ );
163
  $data=array_merge($data, $fields, $optionToSet);
164
+ // time to restore deleted info (if needed)
165
+ $backup = $contractStatusRModel->getMatchingRowByKeys( $deletedRows, $data );
166
+
167
+ foreach($keepOptionList as $fieldToBackup) {
168
+ if(!array_key_exists($fieldToBackup, $optionToSet)) {
169
+ $data[$fieldToBackup] = $backup[$fieldToBackup];
170
+ }
171
+ }
172
  $connection->insert($this->getTable('payline/contract_status'),$data);
173
  }
174
+ }
175
 
176
  if($isWebsiteLevel) {
177
  $count= Mage::getModel('payline/contract_status')->getCollection()
187
 
188
  Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('payline')->__('Contracts modified successfully'));
189
 
190
+ } // end updateContractWalletList()
191
+
192
+
193
+ /**
194
+ * Get the point of sell of contracts
195
+ * @param array $contract_ids
196
+ * @return string
197
+ */
198
+ public function getPointOfSell($contract_ids) {
199
+ $read = $this->_getReadAdapter();
200
+
201
+ $select = $read->select()
202
+ ->distinct()
203
+ ->from($this->getTable('payline/contract'),array('point_of_sell'))
204
+ ->where('id in (?)', $contract_ids);
205
+
206
+ $result = $select->query();
207
+ $row = $result->fetchAll();
208
+ return $row[0]['point_of_sell'];
209
+ }
210
+
211
+ /**
212
+ * Get contract ids of contracts not int $pointOfSell
213
+ * @param string $pointOfSell
214
+ * @return array
215
+ */
216
+ public function getContractsNotIn($pointOfSell) {
217
+ $read = $this->_getReadAdapter();
218
+
219
+ $select = $read->select()
220
+ ->distinct()
221
+ ->from($this->getTable('payline/contract'),array('id'))
222
+ ->where('point_of_sell != ?', $pointOfSell);
223
+
224
+ $result = $select->query();
225
+ $row = $result->fetchAll();
226
+ $res = array();
227
+ foreach($row as $r) {
228
+ $res[] = $r['id'];
229
+ }
230
+ return $res;
231
+ }
232
+
233
+ } //end class
app/code/community/Monext/Payline/Model/Mysql4/Contract/Collection.php CHANGED
@@ -1,55 +1,55 @@
1
- <?php
2
-
3
- /**
4
- * Payline contracts collection
5
- */
6
-
7
- class Monext_Payline_Model_Mysql4_Contract_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
8
- {
9
- public function _construct() {
10
- $this->_init('payline/contract');
11
- }
12
-
13
- public function addFilterStatus($primary = false,$storeId = null)
14
- {
15
- if($storeId === null) return $this;
16
-
17
- $this->getSelect()
18
- ->joinLeft(
19
- array('status'=>$this->getTable('payline/contract_status')),
20
- '`main_table`.`id`=`status`.`contract_id` AND `status`.`store_id`='.$storeId,
21
- array());
22
-
23
- if($primary) {
24
- $this->getSelect()->where('status.is_primary = 1 or (status.is_primary is null and main_table.is_primary = 1)');
25
- } else {
26
- $this->getSelect()->where('status.is_secondary = 1 or (status.is_secondary is null and main_table.is_secondary = 1)');
27
- }
28
-
29
- $this->getSelect()->reset(Zend_Db_Select::COLUMNS)
30
- ->columns('id', 'main_table')
31
- ->columns('name', 'main_table')
32
- ->columns('number', 'main_table')
33
- ->columns('contract_type', 'main_table')
34
- ->columns('is_secure', 'main_table')
35
- ->columns('is_included_wallet_list', 'main_table')
36
- ->distinct();
37
-
38
- return $this;
39
- }
40
-
41
- /**
42
- * Add a secure filter to retrieve 3DS contract
43
- *
44
- * @param bool $secure
45
- * @param int $storeId
46
- *
47
- * @return Monext_Payline_Model_Mysql4_Contract_Collection
48
- */
49
  public function addFilterSecure($secure = false,$storeId = null)
50
  {
51
- if($storeId === null) {
52
- $storeId = Mage::app()->getStore()->getId();
53
  }
54
 
55
  $this->getSelect()
@@ -74,64 +74,64 @@ class Monext_Payline_Model_Mysql4_Contract_Collection extends Mage_Core_Model_My
74
  ->distinct();
75
 
76
  return $this;
77
- }
78
-
79
- public function addStoreFilter($storeId = null)
80
- {
81
- if($storeId === null) return $this;
82
-
83
- $this->getSelect()
84
- ->joinLeft(
85
- array('status'=>$this->getTable('payline/contract_status')),
86
- '`main_table`.`id`=`status`.`contract_id` AND `status`.`store_id`='.$storeId,
87
- array())
88
- ->reset(Zend_Db_Select::COLUMNS)
89
- ->columns('id', 'main_table')
90
- ->columns('name', 'main_table')
91
- ->columns('number', 'main_table')
92
- ->columns('point_of_sell', 'main_table')
93
- ->columns(array('is_primary' => new Zend_Db_Expr('IFNULL(status.is_primary,main_table.is_primary)')), 'status')
94
- ->columns(array('is_secondary' => new Zend_Db_Expr('IFNULL(status.is_secondary,main_table.is_secondary)')), 'status')
95
- ->columns(array('is_secure' => new Zend_Db_Expr('IFNULL(status.is_secure,main_table.is_secure)')), 'status')
96
- ->columns(array('is_included_wallet_list' => new Zend_Db_Expr('IFNULL(status.is_included_wallet_list,main_table.is_included_wallet_list)')), 'status');
97
-
98
- return $this;
99
- }
100
-
101
- public function addWebsiteFilter($websiteId = null)
102
- {
103
- if($websiteId === null) return $this;
104
-
105
- $this->getSelect()
106
- ->joinLeft(
107
- array('status'=>$this->getTable('payline/contract_status')),
108
- '`main_table`.`id`=`status`.`contract_id` AND `status`.`website_id`='.$websiteId,
109
- array())
110
- ->reset(Zend_Db_Select::COLUMNS)
111
- ->columns('id', 'main_table')
112
- ->columns('name', 'main_table')
113
- ->columns('number', 'main_table')
114
- ->columns('point_of_sell', 'main_table')
115
- ->columns(array('is_primary' => new Zend_Db_Expr('IFNULL(status.is_primary,main_table.is_primary)')), 'status')
116
- ->columns(array('is_secondary' => new Zend_Db_Expr('IFNULL(status.is_secondary,main_table.is_secondary)')), 'status')
117
- ->columns(array('is_secure' => new Zend_Db_Expr('IFNULL(status.is_secure,main_table.is_secure)')), 'status')
118
- ->columns(array('is_included_wallet_list' => new Zend_Db_Expr('IFNULL(status.is_included_wallet_list,main_table.is_included_wallet_list)')), 'status');
119
-
120
- return $this;
121
- }
122
-
123
- /**
124
- * Convert items array to hash for select options
125
- *
126
- * return items hash
127
- * array($value => $label)
128
- *
129
- * @param string $valueField
130
- * @param string $labelField
131
- * @return array
132
- */
133
- public function toOptionHashByContractTypes()
134
- {
135
- return parent::_toOptionHash('id', 'contract_type');
136
- }
137
- }
1
+ <?php
2
+
3
+ /**
4
+ * Payline contracts collection
5
+ */
6
+
7
+ class Monext_Payline_Model_Mysql4_Contract_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
8
+ {
9
+ public function _construct() {
10
+ $this->_init('payline/contract');
11
+ }
12
+
13
+ public function addFilterStatus($primary = false,$storeId = null)
14
+ {
15
+ if($storeId === null) return $this;
16
+
17
+ $this->getSelect()
18
+ ->joinLeft(
19
+ array('status'=>$this->getTable('payline/contract_status')),
20
+ '`main_table`.`id`=`status`.`contract_id` AND `status`.`store_id`='.$storeId,
21
+ array());
22
+
23
+ if($primary) {
24
+ $this->getSelect()->where('status.is_primary = 1 or (status.is_primary is null and main_table.is_primary = 1)');
25
+ } else {
26
+ $this->getSelect()->where('status.is_secondary = 1 or (status.is_secondary is null and main_table.is_secondary = 1)');
27
+ }
28
+
29
+ $this->getSelect()->reset(Zend_Db_Select::COLUMNS)
30
+ ->columns('id', 'main_table')
31
+ ->columns('name', 'main_table')
32
+ ->columns('number', 'main_table')
33
+ ->columns('contract_type', 'main_table')
34
+ ->columns('is_secure', 'main_table')
35
+ ->columns('is_included_wallet_list', 'main_table')
36
+ ->distinct();
37
+
38
+ return $this;
39
+ }
40
+
41
+ /**
42
+ * Add a secure filter to retrieve 3DS contract
43
+ *
44
+ * @param bool $secure
45
+ * @param int $storeId
46
+ *
47
+ * @return Monext_Payline_Model_Mysql4_Contract_Collection
48
+ */
49
  public function addFilterSecure($secure = false,$storeId = null)
50
  {
51
+ if($storeId === null) {
52
+ $storeId = Mage::app()->getStore()->getId();
53
  }
54
 
55
  $this->getSelect()
74
  ->distinct();
75
 
76
  return $this;
77
+ }
78
+
79
+ public function addStoreFilter($storeId = null)
80
+ {
81
+ if($storeId === null) return $this;
82
+
83
+ $this->getSelect()
84
+ ->joinLeft(
85
+ array('status'=>$this->getTable('payline/contract_status')),
86
+ '`main_table`.`id`=`status`.`contract_id` AND `status`.`store_id`='.$storeId,
87
+ array())
88
+ ->reset(Zend_Db_Select::COLUMNS)
89
+ ->columns('id', 'main_table')
90
+ ->columns('name', 'main_table')
91
+ ->columns('number', 'main_table')
92
+ ->columns('point_of_sell', 'main_table')
93
+ ->columns(array('is_primary' => new Zend_Db_Expr('IFNULL(status.is_primary,main_table.is_primary)')), 'status')
94
+ ->columns(array('is_secondary' => new Zend_Db_Expr('IFNULL(status.is_secondary,main_table.is_secondary)')), 'status')
95
+ ->columns(array('is_secure' => new Zend_Db_Expr('IFNULL(status.is_secure,main_table.is_secure)')), 'status')
96
+ ->columns(array('is_included_wallet_list' => new Zend_Db_Expr('IFNULL(status.is_included_wallet_list,main_table.is_included_wallet_list)')), 'status');
97
+
98
+ return $this;
99
+ }
100
+
101
+ public function addWebsiteFilter($websiteId = null)
102
+ {
103
+ if($websiteId === null) return $this;
104
+
105
+ $this->getSelect()
106
+ ->joinLeft(
107
+ array('status'=>$this->getTable('payline/contract_status')),
108
+ '`main_table`.`id`=`status`.`contract_id` AND `status`.`website_id`='.$websiteId,
109
+ array())
110
+ ->reset(Zend_Db_Select::COLUMNS)
111
+ ->columns('id', 'main_table')
112
+ ->columns('name', 'main_table')
113
+ ->columns('number', 'main_table')
114
+ ->columns('point_of_sell', 'main_table')
115
+ ->columns(array('is_primary' => new Zend_Db_Expr('IFNULL(status.is_primary,main_table.is_primary)')), 'status')
116
+ ->columns(array('is_secondary' => new Zend_Db_Expr('IFNULL(status.is_secondary,main_table.is_secondary)')), 'status')
117
+ ->columns(array('is_secure' => new Zend_Db_Expr('IFNULL(status.is_secure,main_table.is_secure)')), 'status')
118
+ ->columns(array('is_included_wallet_list' => new Zend_Db_Expr('IFNULL(status.is_included_wallet_list,main_table.is_included_wallet_list)')), 'status');
119
+
120
+ return $this;
121
+ }
122
+
123
+ /**
124
+ * Convert items array to hash for select options
125
+ *
126
+ * return items hash
127
+ * array($value => $label)
128
+ *
129
+ * @param string $valueField
130
+ * @param string $labelField
131
+ * @return array
132
+ */
133
+ public function toOptionHashByContractTypes()
134
+ {
135
+ return parent::_toOptionHash('id', 'contract_type');
136
+ }
137
+ }
app/code/community/Monext/Payline/Model/Mysql4/Contract/Status.php CHANGED
@@ -1,279 +1,279 @@
1
- <?php
2
-
3
- /**
4
- * Payline contracts status resource model
5
- */
6
-
7
- class Monext_Payline_Model_Mysql4_Contract_Status extends Mage_Core_Model_Mysql4_Abstract
8
- {
9
- public function _construct()
10
- {
11
- $this->_init('payline/contract_status', 'id');
12
- }
13
-
14
- /**
15
- * Update contract status by scope
16
- * @param type $ids
17
- * @param type $status
18
- * @param type $website
19
- * @param type $store
20
- * @return type
21
- */
22
- public function updateContractStatus($ids,$status,$website_code,$store_code)
23
- {
24
- if(!is_array($ids)) {
25
- $ids = array($ids);
26
- }
27
-
28
-
29
- $pointOfSell = $this->getPointOfSell($ids);
30
- $otherContracts = $this->getContractsNotIn($pointOfSell);
31
- $storeIds = array();
32
- $websiteId = null;
33
- $isDefaultLevel = false;
34
- $isWebsiteLevel = false;
35
- $isStoreViewLevel= false;
36
-
37
- if(!$store_code) {
38
- if($website_code) {
39
- $isWebsiteLevel = true;
40
- $website = Mage::app()->getWebsite($website_code);
41
- $websiteId = $website->getId();
42
- $storeIds = $website->getStoreIds();
43
- } else {
44
- $isDefaultLevel = true;
45
- }
46
- } else {
47
- $isStoreViewLevel = true;
48
- $storeIds = array(Mage::app()->getStore($store_code)->getId());
49
- }
50
- $connection = $this->_getWriteAdapter();
51
- $connection->beginTransaction();
52
- $fields = array();
53
- switch($status) {
54
- case 0:
55
- $fields['is_primary'] = 1; $fields['is_secondary'] = 0;
56
- break;
57
- case 1:
58
- $fields['is_primary'] = 0; $fields['is_secondary'] = 1;
59
- break;
60
- case 2:
61
- $fields['is_primary'] = 1; $fields['is_secondary'] = 1;
62
- break;
63
- case 3:
64
- $fields['is_primary'] = 0; $fields['is_secondary'] = 0;
65
- break;
66
- default :
67
- $fields['is_primary'] = 0; $fields['is_secondary'] = 0;
68
- }
69
-
70
- if($isDefaultLevel) {
71
- $conditions = array();
72
- $conditions[] = $connection->quoteInto('contract_id in (?)', $ids);
73
- $connection->delete($this->getTable('payline/contract_status'),$conditions);
74
-
75
- $where = $connection->quoteInto('id in (?)', $ids);
76
- $connection->update($this->getTable('payline/contract'), $fields, $where);
77
-
78
- $this->resetContractStatus($connection, 0, $otherContracts, $websiteId, $storeIds);
79
-
80
- $count = Mage::getModel('payline/contract')->getCollection()->addFieldToFilter('is_primary',1)->getSize();
81
- } else {
82
- $conditions = 'contract_id in ('.implode(',',$ids).') AND (';
83
- if($isWebsiteLevel) $conditions .= 'website_id = '. $websiteId . ' OR ';
84
- $conditions .= 'store_id in (' . implode(',',$storeIds) . '))';
85
- $deletedRows = $this->queryContractStatus($ids, $storeIds, $websiteId);
86
- $connection->delete($this->getTable('payline/contract_status'),$conditions);
87
- foreach ($ids as $id) {
88
- if ($isWebsiteLevel) {
89
- $data = array(
90
- 'contract_id' => $id,
91
- 'website_id' => $websiteId,
92
- 'store_id' => null,
93
- 'is_primary' => $fields['is_primary'],
94
- 'is_secondary' => $fields['is_secondary']
95
- );
96
- $backup = $this->getMatchingRowByKeys($deletedRows, $data);
97
- if ($backup) {
98
- $data['is_included_wallet_list'] = $backup['is_included_wallet_list'];
99
- $data['is_secure'] = $backup['is_secure'];
100
- }
101
- $connection->insert($this->getTable('payline/contract_status'), $data);
102
- }
103
- foreach ($storeIds as $storeId) {
104
- $data = array(
105
- 'contract_id' => $id,
106
- 'store_id' => $storeId,
107
- 'website_id' => null,
108
- 'is_primary' => $fields['is_primary'],
109
- 'is_secondary' => $fields['is_secondary']
110
- );
111
- $backup = $this->getMatchingRowByKeys($deletedRows, $data);
112
- if ($backup) {
113
- $data['is_included_wallet_list'] = $backup['is_included_wallet_list'];
114
- $data['is_secure'] = $backup['is_secure'];
115
- }
116
- $connection->insert($this->getTable('payline/contract_status'), $data);
117
- }
118
- }
119
-
120
- $this->resetContractStatus($connection, ($isWebsiteLevel ? 2 : 3), $otherContracts, $websiteId, $storeIds);
121
-
122
- if($isWebsiteLevel) {
123
- $count= Mage::getModel('payline/contract_status')->getCollection()
124
- ->addFieldToFilter('is_primary',1)
125
- ->addFieldToFilter('store_id',$storeIds)
126
- ->getSize();
127
- } else {
128
- $count = Mage::getModel('payline/contract')->getCollection()->addFilterStatus(true,$storeId)->getSize();
129
- }
130
- }
131
-
132
- //at least one contract must be primary
133
- if(!$count) {
134
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('payline')->__('At leat one contract must be primary'));
135
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('payline')->__('Please set a primary contract beforefor this point of sell'));
136
- return;
137
- }
138
-
139
- $connection->commit();
140
- Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('payline')->__('Contracts modified successfully'));
141
- }
142
-
143
- /**
144
- * Reset contract status for contracts that are not in $pointOfSell
145
- *
146
- * @param type $connection
147
- * @param type $level
148
- * @param type $ids
149
- * @param type $websiteId
150
- * @param type $storeIds
151
- */
152
- public function resetContractStatus($connection,$level,$ids,$websiteId,$storeIds) {
153
-
154
- if(empty($ids)) {
155
- return;
156
- }
157
-
158
- $fields = array();
159
- $fields['is_primary'] = 0;
160
- $fields['is_secondary'] = 0;
161
- if($level == 0) {
162
- $conditions = array();
163
- $conditions[] = $connection->quoteInto('contract_id in (?)', $ids);
164
- $connection->delete($this->getTable('payline/contract_status'),$conditions);
165
-
166
- $where = $connection->quoteInto('id in (?)', $ids);
167
- $connection->update($this->getTable('payline/contract'), $fields, $where);
168
- } else {
169
- $conditions = 'contract_id in ('.implode(',',$ids).') AND (';
170
- if($level == 2) $conditions .= 'website_id = '. $websiteId . ' OR ';
171
- $conditions .= 'store_id in (' . implode(',',$storeIds) . '))';
172
- $deletedRows = $this->queryContractStatus($ids, $storeIds, $websiteId);
173
-
174
- $connection->delete($this->getTable('payline/contract_status'),$conditions);
175
- foreach ($ids as $id) {
176
- if ($level == 2) {
177
- $data = array(
178
- 'contract_id' => $id,
179
- 'website_id' => $websiteId,
180
- 'store_id' => null,
181
- 'is_primary' => $fields['is_primary'],
182
- 'is_secondary' => $fields['is_secondary']
183
- );
184
- $backup = $this->getMatchingRowByKeys($deletedRows, $data);
185
- if ($backup) {
186
- $data['is_included_wallet_list'] = $backup['is_included_wallet_list'];
187
- $data['is_secure'] = $backup['is_secure'];
188
- }
189
- $connection->insert($this->getTable('payline/contract_status'), $data);
190
- }
191
- foreach ($storeIds as $storeId) {
192
- $data = array(
193
- 'contract_id' => $id,
194
- 'store_id' => $storeId,
195
- 'website_id' => null,
196
- 'is_primary' => $fields['is_primary'],
197
- 'is_secondary' => $fields['is_secondary']
198
- );
199
- $backup = $this->getMatchingRowByKeys($deletedRows, $data);
200
- if ($backup) {
201
- $data['is_included_wallet_list'] = $backup['is_included_wallet_list'];
202
- $data['is_secure'] = $backup['is_secure'];
203
- }
204
- $connection->insert($this->getTable('payline/contract_status'), $data);
205
- }
206
- }
207
- }
208
- }
209
-
210
-
211
- /**
212
- * Get contract ids of contracts not int $pointOfSell
213
- * @param string $pointOfSell
214
- * @return array
215
- */
216
- public function getContractsNotIn($pointOfSell) {
217
- return Mage::getResourceModel('payline/contract')->getContractsNotIn( $pointOfSell );
218
- }
219
-
220
-
221
- /**
222
- * Get the point of sell of contracts
223
- * @param array $contract_ids
224
- * @return string
225
- */
226
- public function getPointOfSell($contract_ids) {
227
- return Mage::getResourceModel('payline/contract')->getPointOfSell( $contract_ids );
228
- }
229
-
230
- /**
231
- * Return contract_status rows by contract ids, store ids and website id
232
- * @param $contractIds {array} contain n contract_status.contract_id
233
- * @param $storeIds {array} contain n contact_status.store_id
234
- * @param $websiteId {int} website id
235
- * @return {array} Return an array of rows returned by the query
236
- */
237
- public function queryContractStatus($contractIds, $storeIds, $websiteId)
238
- {
239
- $read = $this->_getReadAdapter();
240
- $select = $read
241
- ->select()
242
- ->from( $this->getTable('payline/contract_status') );
243
-
244
- $condition = 'contract_id IN ('. implode(',',$contractIds) .') AND (';
245
- if( isset( $websiteId ) ) {
246
- $condition .= 'website_id='.$websiteId.' OR ';
247
- }
248
- $condition .= 'store_id IN ('. implode(',', $storeIds) . ') )';
249
-
250
- $select->where( $condition );
251
-
252
- return $select->query()->fetchAll();
253
- }
254
-
255
- /**
256
- * Return the matching array $matchMe in $rows.
257
- *The match is done by checking the contract_status db table keys
258
- * @param $rows
259
- * @param $matchMe
260
- * @return array The matching array or false
261
- */
262
- public function getMatchingRowByKeys($rows, $matchMe)
263
- {
264
- $matchCounter = 0;
265
- foreach( $rows as $row ) {
266
- if( $row['contract_id'] == $matchMe['contract_id'] ) {
267
- $matchCounter++;
268
- $matchCounter = $row['store_id'] == $matchMe['store_id'] ? $matchCounter + 1 : $matchCounter;
269
- $matchCounter = $row['website_id'] == $matchMe['website_id'] ? $matchCounter + 1 : $matchCounter;
270
- }
271
-
272
- if( $matchCounter == 3 ) {return $row; }
273
- else { $matchCounter = 0; }
274
- }
275
- // no match
276
- return false;
277
- }
278
-
279
- }
1
+ <?php
2
+
3
+ /**
4
+ * Payline contracts status resource model
5
+ */
6
+
7
+ class Monext_Payline_Model_Mysql4_Contract_Status extends Mage_Core_Model_Mysql4_Abstract
8
+ {
9
+ public function _construct()
10
+ {
11
+ $this->_init('payline/contract_status', 'id');
12
+ }
13
+
14
+ /**
15
+ * Update contract status by scope
16
+ * @param type $ids
17
+ * @param type $status
18
+ * @param type $website
19
+ * @param type $store
20
+ * @return type
21
+ */
22
+ public function updateContractStatus($ids,$status,$website_code,$store_code)
23
+ {
24
+ if(!is_array($ids)) {
25
+ $ids = array($ids);
26
+ }
27
+
28
+
29
+ $pointOfSell = $this->getPointOfSell($ids);
30
+ $otherContracts = $this->getContractsNotIn($pointOfSell);
31
+ $storeIds = array();
32
+ $websiteId = null;
33
+ $isDefaultLevel = false;
34
+ $isWebsiteLevel = false;
35
+ $isStoreViewLevel= false;
36
+
37
+ if(!$store_code) {
38
+ if($website_code) {
39
+ $isWebsiteLevel = true;
40
+ $website = Mage::app()->getWebsite($website_code);
41
+ $websiteId = $website->getId();
42
+ $storeIds = $website->getStoreIds();
43
+ } else {
44
+ $isDefaultLevel = true;
45
+ }
46
+ } else {
47
+ $isStoreViewLevel = true;
48
+ $storeIds = array(Mage::app()->getStore($store_code)->getId());
49
+ }
50
+ $connection = $this->_getWriteAdapter();
51
+ $connection->beginTransaction();
52
+ $fields = array();
53
+ switch($status) {
54
+ case 0:
55
+ $fields['is_primary'] = 1; $fields['is_secondary'] = 0;
56
+ break;
57
+ case 1:
58
+ $fields['is_primary'] = 0; $fields['is_secondary'] = 1;
59
+ break;
60
+ case 2:
61
+ $fields['is_primary'] = 1; $fields['is_secondary'] = 1;
62
+ break;
63
+ case 3:
64
+ $fields['is_primary'] = 0; $fields['is_secondary'] = 0;
65
+ break;
66
+ default :
67
+ $fields['is_primary'] = 0; $fields['is_secondary'] = 0;
68
+ }
69
+
70
+ if($isDefaultLevel) {
71
+ $conditions = array();
72
+ $conditions[] = $connection->quoteInto('contract_id in (?)', $ids);
73
+ $connection->delete($this->getTable('payline/contract_status'),$conditions);
74
+
75
+ $where = $connection->quoteInto('id in (?)', $ids);
76
+ $connection->update($this->getTable('payline/contract'), $fields, $where);
77
+
78
+ $this->resetContractStatus($connection, 0, $otherContracts, $websiteId, $storeIds);
79
+
80
+ $count = Mage::getModel('payline/contract')->getCollection()->addFieldToFilter('is_primary',1)->getSize();
81
+ } else {
82
+ $conditions = 'contract_id in ('.implode(',',$ids).') AND (';
83
+ if($isWebsiteLevel) $conditions .= 'website_id = '. $websiteId . ' OR ';
84
+ $conditions .= 'store_id in (' . implode(',',$storeIds) . '))';
85
+ $deletedRows = $this->queryContractStatus($ids, $storeIds, $websiteId);
86
+ $connection->delete($this->getTable('payline/contract_status'),$conditions);
87
+ foreach ($ids as $id) {
88
+ if ($isWebsiteLevel) {
89
+ $data = array(
90
+ 'contract_id' => $id,
91
+ 'website_id' => $websiteId,
92
+ 'store_id' => null,
93
+ 'is_primary' => $fields['is_primary'],
94
+ 'is_secondary' => $fields['is_secondary']
95
+ );
96
+ $backup = $this->getMatchingRowByKeys($deletedRows, $data);
97
+ if ($backup) {
98
+ $data['is_included_wallet_list'] = $backup['is_included_wallet_list'];
99
+ $data['is_secure'] = $backup['is_secure'];
100
+ }
101
+ $connection->insert($this->getTable('payline/contract_status'), $data);
102
+ }
103
+ foreach ($storeIds as $storeId) {
104
+ $data = array(
105
+ 'contract_id' => $id,
106
+ 'store_id' => $storeId,
107
+ 'website_id' => null,
108
+ 'is_primary' => $fields['is_primary'],
109
+ 'is_secondary' => $fields['is_secondary']
110
+ );
111
+ $backup = $this->getMatchingRowByKeys($deletedRows, $data);
112
+ if ($backup) {
113
+ $data['is_included_wallet_list'] = $backup['is_included_wallet_list'];
114
+ $data['is_secure'] = $backup['is_secure'];
115
+ }
116
+ $connection->insert($this->getTable('payline/contract_status'), $data);
117
+ }
118
+ }
119
+
120
+ $this->resetContractStatus($connection, ($isWebsiteLevel ? 2 : 3), $otherContracts, $websiteId, $storeIds);
121
+
122
+ if($isWebsiteLevel) {
123
+ $count= Mage::getModel('payline/contract_status')->getCollection()
124
+ ->addFieldToFilter('is_primary',1)
125
+ ->addFieldToFilter('store_id',$storeIds)
126
+ ->getSize();
127
+ } else {
128
+ $count = Mage::getModel('payline/contract')->getCollection()->addFilterStatus(true,$storeId)->getSize();
129
+ }
130
+ }
131
+
132
+ //at least one contract must be primary
133
+ if(!$count) {
134
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('payline')->__('At leat one contract must be primary'));
135
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('payline')->__('Please set a primary contract beforefor this point of sell'));
136
+ return;
137
+ }
138
+
139
+ $connection->commit();
140
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('payline')->__('Contracts modified successfully'));
141
+ }
142
+
143
+ /**
144
+ * Reset contract status for contracts that are not in $pointOfSell
145
+ *
146
+ * @param type $connection
147
+ * @param type $level
148
+ * @param type $ids
149
+ * @param type $websiteId
150
+ * @param type $storeIds
151
+ */
152
+ public function resetContractStatus($connection,$level,$ids,$websiteId,$storeIds) {
153
+
154
+ if(empty($ids)) {
155
+ return;
156
+ }
157
+
158
+ $fields = array();
159
+ $fields['is_primary'] = 0;
160
+ $fields['is_secondary'] = 0;
161
+ if($level == 0) {
162
+ $conditions = array();
163
+ $conditions[] = $connection->quoteInto('contract_id in (?)', $ids);
164
+ $connection->delete($this->getTable('payline/contract_status'),$conditions);
165
+
166
+ $where = $connection->quoteInto('id in (?)', $ids);
167
+ $connection->update($this->getTable('payline/contract'), $fields, $where);
168
+ } else {
169
+ $conditions = 'contract_id in ('.implode(',',$ids).') AND (';
170
+ if($level == 2) $conditions .= 'website_id = '. $websiteId . ' OR ';
171
+ $conditions .= 'store_id in (' . implode(',',$storeIds) . '))';
172
+ $deletedRows = $this->queryContractStatus($ids, $storeIds, $websiteId);
173
+
174
+ $connection->delete($this->getTable('payline/contract_status'),$conditions);
175
+ foreach ($ids as $id) {
176
+ if ($level == 2) {
177
+ $data = array(
178
+ 'contract_id' => $id,
179
+ 'website_id' => $websiteId,
180
+ 'store_id' => null,
181
+ 'is_primary' => $fields['is_primary'],
182
+ 'is_secondary' => $fields['is_secondary']
183
+ );
184
+ $backup = $this->getMatchingRowByKeys($deletedRows, $data);
185
+ if ($backup) {
186
+ $data['is_included_wallet_list'] = $backup['is_included_wallet_list'];
187
+ $data['is_secure'] = $backup['is_secure'];
188
+ }
189
+ $connection->insert($this->getTable('payline/contract_status'), $data);
190
+ }
191
+ foreach ($storeIds as $storeId) {
192
+ $data = array(
193
+ 'contract_id' => $id,
194
+ 'store_id' => $storeId,
195
+ 'website_id' => null,
196
+ 'is_primary' => $fields['is_primary'],
197
+ 'is_secondary' => $fields['is_secondary']
198
+ );
199
+ $backup = $this->getMatchingRowByKeys($deletedRows, $data);
200
+ if ($backup) {
201
+ $data['is_included_wallet_list'] = $backup['is_included_wallet_list'];
202
+ $data['is_secure'] = $backup['is_secure'];
203
+ }
204
+ $connection->insert($this->getTable('payline/contract_status'), $data);
205
+ }
206
+ }
207
+ }
208
+ }
209
+
210
+
211
+ /**
212
+ * Get contract ids of contracts not int $pointOfSell
213
+ * @param string $pointOfSell
214
+ * @return array
215
+ */
216
+ public function getContractsNotIn($pointOfSell) {
217
+ return Mage::getResourceModel('payline/contract')->getContractsNotIn( $pointOfSell );
218
+ }
219
+
220
+
221
+ /**
222
+ * Get the point of sell of contracts
223
+ * @param array $contract_ids
224
+ * @return string
225
+ */
226
+ public function getPointOfSell($contract_ids) {
227
+ return Mage::getResourceModel('payline/contract')->getPointOfSell( $contract_ids );
228
+ }
229
+
230
+ /**
231
+ * Return contract_status rows by contract ids, store ids and website id
232
+ * @param $contractIds {array} contain n contract_status.contract_id
233
+ * @param $storeIds {array} contain n contact_status.store_id
234
+ * @param $websiteId {int} website id
235
+ * @return {array} Return an array of rows returned by the query
236
+ */
237
+ public function queryContractStatus($contractIds, $storeIds, $websiteId)
238
+ {
239
+ $read = $this->_getReadAdapter();
240
+ $select = $read
241
+ ->select()
242
+ ->from( $this->getTable('payline/contract_status') );
243
+
244
+ $condition = 'contract_id IN ('. implode(',',$contractIds) .') AND (';
245
+ if( isset( $websiteId ) ) {
246
+ $condition .= 'website_id='.$websiteId.' OR ';
247
+ }
248
+ $condition .= 'store_id IN ('. implode(',', $storeIds) . ') )';
249
+
250
+ $select->where( $condition );
251
+
252
+ return $select->query()->fetchAll();
253
+ }
254
+
255
+ /**
256
+ * Return the matching array $matchMe in $rows.
257
+ *The match is done by checking the contract_status db table keys
258
+ * @param $rows
259
+ * @param $matchMe
260
+ * @return array The matching array or false
261
+ */
262
+ public function getMatchingRowByKeys($rows, $matchMe)
263
+ {
264
+ $matchCounter = 0;
265
+ foreach( $rows as $row ) {
266
+ if( $row['contract_id'] == $matchMe['contract_id'] ) {
267
+ $matchCounter++;
268
+ $matchCounter = $row['store_id'] == $matchMe['store_id'] ? $matchCounter + 1 : $matchCounter;
269
+ $matchCounter = $row['website_id'] == $matchMe['website_id'] ? $matchCounter + 1 : $matchCounter;
270
+ }
271
+
272
+ if( $matchCounter == 3 ) {return $row; }
273
+ else { $matchCounter = 0; }
274
+ }
275
+ // no match
276
+ return false;
277
+ }
278
+
279
+ }
app/code/community/Monext/Payline/Model/Mysql4/Contract/Status/Collection.php CHANGED
@@ -1,13 +1,13 @@
1
- <?php
2
-
3
- /**
4
- * Payline contracts status collection
5
- */
6
-
7
- class Monext_Payline_Model_Mysql4_Contract_Status_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
8
- {
9
- public function _construct() {
10
- $this->_init('payline/contract_status');
11
- }
12
- }
13
-
1
+ <?php
2
+
3
+ /**
4
+ * Payline contracts status collection
5
+ */
6
+
7
+ class Monext_Payline_Model_Mysql4_Contract_Status_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
8
+ {
9
+ public function _construct() {
10
+ $this->_init('payline/contract_status');
11
+ }
12
+ }
13
+
app/code/community/Monext/Payline/Model/Mysql4/Fees.php CHANGED
@@ -1,13 +1,13 @@
1
- <?php
2
-
3
- /**
4
- * Payline nx fees resource model
5
- */
6
-
7
- class Monext_Payline_Model_Mysql4_Fees extends Mage_Core_Model_Mysql4_Abstract
8
- {
9
- public function _construct()
10
- {
11
- $this->_init('payline/fees', 'id');
12
- }
13
- }
1
+ <?php
2
+
3
+ /**
4
+ * Payline nx fees resource model
5
+ */
6
+
7
+ class Monext_Payline_Model_Mysql4_Fees extends Mage_Core_Model_Mysql4_Abstract
8
+ {
9
+ public function _construct()
10
+ {
11
+ $this->_init('payline/fees', 'id');
12
+ }
13
+ }
app/code/community/Monext/Payline/Model/Mysql4/Fees/Collection.php CHANGED
@@ -1,12 +1,12 @@
1
- <?php
2
-
3
- /**
4
- * Payline nx fees collection
5
- */
6
-
7
- class Monext_Payline_Model_Mysql4_Fees_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
8
- {
9
- public function _construct() {
10
- $this->_init('payline/fees');
11
- }
12
- }
1
+ <?php
2
+
3
+ /**
4
+ * Payline nx fees collection
5
+ */
6
+
7
+ class Monext_Payline_Model_Mysql4_Fees_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
8
+ {
9
+ public function _construct() {
10
+ $this->_init('payline/fees');
11
+ }
12
+ }
app/code/community/Monext/Payline/Model/Mysql4/Productcategories.php CHANGED
@@ -1,13 +1,13 @@
1
- <?php
2
-
3
- /**
4
- * Payline product categories resource model
5
- */
6
-
7
- class Monext_Payline_Model_Mysql4_Productcategories extends Mage_Core_Model_Mysql4_Abstract
8
- {
9
- public function _construct()
10
- {
11
- $this->_init('payline/productcategories', 'id');
12
- }
13
- }
1
+ <?php
2
+
3
+ /**
4
+ * Payline product categories resource model
5
+ */
6
+
7
+ class Monext_Payline_Model_Mysql4_Productcategories extends Mage_Core_Model_Mysql4_Abstract
8
+ {
9
+ public function _construct()
10
+ {
11
+ $this->_init('payline/productcategories', 'id');
12
+ }
13
+ }
app/code/community/Monext/Payline/Model/Mysql4/Productcategories/Collection.php CHANGED
@@ -1,35 +1,35 @@
1
- <?php
2
-
3
- /**
4
- * Payline product categories collection
5
- */
6
-
7
- class Monext_Payline_Model_Mysql4_Productcategories_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
8
- {
9
- public function _construct() {
10
- $this->_init('payline/productcategories');
11
- }
12
-
13
- public function getAssignedPaylineCatId($storeCatId){
14
- $assignmentData = $this->getData();
15
- $continue = true;
16
- $n=0;
17
- $paylineCatId = null;
18
- while($continue){
19
- if($assignmentData[$n]['store_category_id'] == $storeCatId){
20
- $paylineCatId = $assignmentData[$n]['payline_category_id'];
21
- $continue = false;
22
- }
23
- $n++;
24
- }
25
- return $paylineCatId;
26
- }
27
-
28
- public function addStoreFilter($storeId = null)
29
- {
30
- if($storeId === null)
31
- return $this;
32
-
33
- return $this;
34
- }
35
- }
1
+ <?php
2
+
3
+ /**
4
+ * Payline product categories collection
5
+ */
6
+
7
+ class Monext_Payline_Model_Mysql4_Productcategories_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
8
+ {
9
+ public function _construct() {
10
+ $this->_init('payline/productcategories');
11
+ }
12
+
13
+ public function getAssignedPaylineCatId($storeCatId){
14
+ $assignmentData = $this->getData();
15
+ $continue = true;
16
+ $n=0;
17
+ $paylineCatId = null;
18
+ while($continue){
19
+ if($assignmentData[$n]['store_category_id'] == $storeCatId){
20
+ $paylineCatId = $assignmentData[$n]['payline_category_id'];
21
+ $continue = false;
22
+ }
23
+ $n++;
24
+ }
25
+ return $paylineCatId;
26
+ }
27
+
28
+ public function addStoreFilter($storeId = null)
29
+ {
30
+ if($storeId === null)
31
+ return $this;
32
+
33
+ return $this;
34
+ }
35
+ }
app/code/community/Monext/Payline/Model/Mysql4/Token.php CHANGED
@@ -1,13 +1,13 @@
1
- <?php
2
-
3
- /**
4
- * Payline token resource model
5
- */
6
-
7
- class Monext_Payline_Model_Mysql4_Token extends Mage_Core_Model_Mysql4_Abstract
8
- {
9
- public function _construct()
10
- {
11
- $this->_init('payline/token', 'id');
12
- }
13
- }
1
+ <?php
2
+
3
+ /**
4
+ * Payline token resource model
5
+ */
6
+
7
+ class Monext_Payline_Model_Mysql4_Token extends Mage_Core_Model_Mysql4_Abstract
8
+ {
9
+ public function _construct()
10
+ {
11
+ $this->_init('payline/token', 'id');
12
+ }
13
+ }
app/code/community/Monext/Payline/Model/Mysql4/Token/Collection.php CHANGED
@@ -1,12 +1,12 @@
1
- <?php
2
-
3
- /**
4
- * Payline token collection
5
- */
6
-
7
- class Monext_Payline_Model_Mysql4_Token_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
8
- {
9
- public function _construct() {
10
- $this->_init('payline/token');
11
- }
12
- }
1
+ <?php
2
+
3
+ /**
4
+ * Payline token collection
5
+ */
6
+
7
+ class Monext_Payline_Model_Mysql4_Token_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
8
+ {
9
+ public function _construct() {
10
+ $this->_init('payline/token');
11
+ }
12
+ }
app/code/community/Monext/Payline/Model/Nx.php CHANGED
File without changes
app/code/community/Monext/Payline/Model/Observer.php CHANGED
@@ -1,523 +1,523 @@
1
- <?php
2
-
3
- class Monext_Payline_Model_Observer
4
- {
5
-
6
- protected $_mode;
7
-
8
- public function createInvoiceWhenStatusChange(Varien_Event_Observer $observer)
9
- {
10
- // Only if the payment method is one of Payline
11
- $code = $observer->getOrder()->getPayment()->getMethodInstance()->getCode();
12
- if (!Mage::helper('payline')->isPayline($code)) {
13
- return;
14
- }
15
-
16
- // infinite loop protection
17
- if (is_null(Mage::registry('payline_create_invoice'))) {
18
- $order = $observer->getEvent()->getOrder();
19
- if ($this->_canCreateInvoice($order)) {
20
- $this->_createInvoice($order);
21
- }
22
- // capture or not, that is the question
23
- $paymentMethod = $order->getPayment()->getMethod();
24
- $paymentActionConf = Mage::getStoreConfig('payment/' . $paymentMethod . '/payline_payment_action');
25
- // if payment action user conf == authorization => need to capture
26
- if ($paymentActionConf == "100") {
27
- $fireCaptureOption = Mage::getStoreConfig('payment/' . $paymentMethod . '/capture_payment_when_i_said');
28
- // if status match w/ user conf && !PaylineNX
29
- if ($order->getStatus() == $fireCaptureOption && $paymentMethod != 'PaylineNX') {
30
- $invoice = $this->_getInvoiceFromOrder($order);
31
- if ($invoice) {
32
- $invoice->setState(Mage_Sales_Model_Order_Invoice::STATE_OPEN);
33
- }
34
- if ($invoice && $invoice->parentCanCapture()) { // invoice present && ok => capture
35
- Mage::register('payline_create_invoice', true);
36
- $invoice->capture();
37
- Mage::unregister('payline_create_invoice');
38
- }
39
- } // end if status matches
40
- } // end if( $paymentActionConf == 100 )
41
- }
42
- }
43
-
44
- // end createInvoiceWhenStatusChange()
45
-
46
- /**
47
- * Return the invoice's order data or false if not exist or NX payment
48
- */
49
- protected function _getInvoiceFromOrder($order)
50
- {
51
- $invoice = $order->getInvoiceCollection();
52
- $invoice = sizeof($invoice) == 1 ? $invoice->getFirstItem() : false;
53
- return $invoice;
54
- }
55
-
56
- protected function _getMode($order)
57
- {
58
- if ($this->_mode === null) {
59
- $paymentMethod = $order->getPayment()->getMethod();
60
- $mode = explode('Payline', $paymentMethod);
61
- if (isset($mode[1])) {
62
- $mode = $mode[1];
63
- $this->_mode = $mode;
64
- }
65
- }
66
- return $this->_mode;
67
- }
68
-
69
- protected function _canCreateInvoice($order)
70
- {
71
- $result = false;
72
- if ($order->canInvoice()) {
73
- $paymentMethod = $order->getPayment()->getMethod();
74
- if (strstr($paymentMethod, 'Payline') !== false) {
75
- $mode = $this->_getMode($order);
76
- if (!empty($mode)) {
77
- $statusToCreateInvoice = Mage::getStoreConfig('payment/' . $paymentMethod . '/automate_invoice_creation');
78
- if ($order->getStatus() == $statusToCreateInvoice && !empty($statusToCreateInvoice)) {
79
- if ($order->getData('status') !== $order->getOrigData('status')) {
80
- $result = true;
81
- }
82
- }
83
- }
84
- }
85
- }
86
- return $result;
87
- }
88
-
89
- protected function _createInvoice($order)
90
- {
91
- $transId = $order->getPayment()->getCcTransId();
92
- if (!empty($transId)) {
93
- $array = array(
94
- 'transactionId' => $transId,
95
- 'orderRef' => $order->getRealOrderId(),
96
- 'startDate' => '',
97
- 'endDate' => '',
98
- 'transactionHistory' => '',
99
- 'version' => Monext_Payline_Helper_Data::VERSION,
100
- 'archiveSearch' => ''
101
- );
102
- try {
103
- $mode = $this->_getMode($order);
104
- $res = Mage::helper('payline')->initPayline($mode)->getTransactionDetails($array);
105
- if (isset($res['payment']['action'])) {
106
- $order->setCreateInvoice(true);
107
- $action = $res['payment']['action'];
108
- if ($mode == 'NX') {
109
- $action = Monext_Payline_Model_Cpt::ACTION_AUTH_CAPTURE;
110
- }
111
- Mage::helper('payline')->createInvoice($action, $order);
112
- }
113
- } catch (Exception $e) {
114
- Mage::logException($e);
115
- Mage::helper('payline/logger')->log(
116
- '[createInvoiceWhenStatusChange] '
117
- . '[' . $order->getIncrementId() . '] '
118
- . '[' . $transId . '] '
119
- . $e->getMessage()
120
- );
121
- }
122
- }
123
- }
124
-
125
- public function saveQuoteNxFees(Varien_Event_Observer $observer)
126
- {
127
- // Only if the payment method is one of Payline
128
- $code = $observer->getQuote()->getPayment()->getMethod();
129
- if (!Mage::helper('payline')->isPayline($code)) {
130
- return;
131
- }
132
-
133
- $applyCosts = (int) Mage::getStoreConfig('payment/PaylineNX/cost_type');
134
- if (!$applyCosts) {
135
- return;
136
- }
137
-
138
- $quote = $observer->getEvent()->getQuote();
139
-
140
- if (!$quote->getPaylineFee()) {
141
- $payment = $quote->getPayment();
142
- if ($payment) {
143
- $paymentMethod = $payment->getMethod();
144
- $fee = Mage::getModel('payline/fees')->getCollection()
145
- ->addFieldtoFilter('quote_id', $quote->getId())->getFirstItem();
146
- $quote->setPaylineFee($fee);
147
- if ($paymentMethod == 'PaylineNX') {
148
- $amount = (float) Mage::getStoreConfig('payment/PaylineNX/cost_amount');
149
- $baseamount = (float) Mage::getStoreConfig('payment/PaylineNX/cost_amount');
150
-
151
- if ($applyCosts == Monext_Payline_Model_Datasource_Costs::COST_PERCENT) {
152
- $amount = round(($quote->getSubtotal() * $amount) / 100, 2);
153
- $baseamount = round(($quote->getBaseSubtotal() * $baseamount) / 100, 2);
154
- }
155
-
156
- //save fees
157
- if ($fee->getId()) {
158
- $fee->setAmount($amount)->setBaseAmount($baseamount)->save();
159
- } else {
160
- Mage::getModel('payline/fees')->setQuoteId($quote->getId())
161
- ->setAmount($amount)
162
- ->setBaseAmount($baseamount)
163
- ->save();
164
- }
165
- } elseif ($fee->getId()) {
166
- $fee->delete();
167
- }
168
- }
169
- }
170
- }
171
-
172
- public function saveOrderNxFees(Varien_Event_Observer $observer)
173
- {
174
- // Only if the payment method is one of Payline
175
- $code = $observer->getOrder()->getPayment()->getMethodInstance()->getCode();
176
- if (!Mage::helper('payline')->isPayline($code)) {
177
- return;
178
- }
179
-
180
- $applyCosts = (int) Mage::getStoreConfig('payment/PaylineNX/cost_type');
181
- if (!$applyCosts) {
182
- return;
183
- }
184
-
185
- $order = $observer->getEvent()->getOrder();
186
- if (!$order->getPaylineFee()) {
187
- $quoteId = $order->getQuoteId();
188
- $payment = $order->getPayment();
189
- if ($quoteId && $payment) {
190
- $paymentMethod = $payment->getMethod();
191
- $fee = Mage::getModel('payline/fees')->getCollection()
192
- ->addFieldtoFilter('quote_id', $quoteId)->getFirstItem();
193
- $order->setPaylineFee($fee);
194
- if ($paymentMethod == 'PaylineNX') {
195
- $amount = (float) Mage::getStoreConfig('payment/PaylineNX/cost_amount');
196
- $baseamount = (float) Mage::getStoreConfig('payment/PaylineNX/cost_amount');
197
-
198
- if ($applyCosts == Monext_Payline_Model_Datasource_Costs::COST_PERCENT) {
199
- $amount = round(($order->getSubtotal() * $amount) / 100, 2);
200
- $baseamount = round(($order->getBaseSubtotal() * $baseamount) / 100, 2);
201
- }
202
-
203
- //save fees
204
- if ($fee->getId()) {
205
- $fee->setOrderId($order->getId())->setAmount($amount)->setBaseAmount($baseamount)->save();
206
- }
207
- } elseif ($fee->getId()) {
208
- $fee->delete();
209
- }
210
- }
211
- }
212
- }
213
-
214
- public function saveInvoiceNxFees(Varien_Event_Observer $observer)
215
- {
216
- // Only if the payment method is one of Payline
217
- $code = $observer->getInvoice()->getOrder()->getPayment()->getMethodInstance()->getCode();
218
- if (!Mage::helper('payline')->isPayline($code)) {
219
- return;
220
- }
221
-
222
- $applyCosts = (int) Mage::getStoreConfig('payment/PaylineNX/cost_type');
223
- if (!$applyCosts) {
224
- return;
225
- }
226
-
227
- $invoice = $observer->getEvent()->getInvoice();
228
- $order = $invoice->getOrder();
229
- $payment = $order->getPayment();
230
- if ($payment) {
231
- $paymentMethod = $payment->getMethod();
232
- if ($paymentMethod == 'PaylineNX') {
233
- $fee = Mage::getModel('payline/fees')->getCollection()
234
- ->addFieldtoFilter('order_id', $order->getId())->getFirstItem();
235
-
236
- $amount = (float) Mage::getStoreConfig('payment/PaylineNX/cost_amount');
237
- $baseamount = (float) Mage::getStoreConfig('payment/PaylineNX/cost_amount');
238
-
239
- if ($applyCosts == Monext_Payline_Model_Datasource_Costs::COST_PERCENT) {
240
- $amount = round(($order->getSubtotal() * $amount) / 100, 2);
241
- $baseamount = round(($order->getBaseSubtotal() * $baseamount) / 100, 2);
242
- }
243
-
244
- //save fees
245
- if ($fee->getId() && !$fee->getInvoiceId()) {
246
- $fee->setInvoiceId($invoice->getId())->save();
247
- }
248
- }
249
- }
250
- }
251
-
252
- public function afterSaveShippingAction(Varien_Event_Observer $observer)
253
- {
254
- $controller = $observer->getControllerAction();
255
-
256
- $paymentMethodsBlock = $controller->getLayout()->createBlock('checkout/onepage_payment_methods');
257
- $methods = $paymentMethodsBlock->getMethods();
258
-
259
- // check if more than one methods available
260
- if (count($methods) != 1) {
261
- return;
262
- }
263
-
264
- $method = current($methods);
265
-
266
- // check if only payline methods (direct method should not be skipped)
267
- if (!in_array($method->getCode(), array('PaylineCPT', 'PaylineNX', 'PaylineWALLET'))) {
268
- return;
269
- }
270
-
271
- $data = array('method' => $method->getCode());
272
-
273
- if ($method->getCode() == 'PaylineCPT') {
274
- // retrive sub methods (card types)
275
- $cptBlock = $controller->getLayout()->createBlock('payline/cpt');
276
- $ccTypes = $cptBlock->getPaymentMethods();
277
- if (count($ccTypes) != 1) {
278
- return;
279
- }
280
- $ccType = current($ccTypes);
281
- $data['cc_type'] = $ccType['number'];
282
- }
283
-
284
- // seems that payment step can be skipped, so save the unique payment method now
285
- $result = Mage::getSingleton('checkout/type_onepage')->savePayment($data);
286
- if (!empty($result['error'])) {
287
- return;
288
- }
289
-
290
- $layout = Mage::getModel('core/layout');
291
- $layout->getUpdate()->load('checkout_onepage_review');
292
- $layout->generateXml()->generateBlocks();
293
- $layout->getBlock('root')->getChild('button')->setTemplate('checkout/onepage/review/button.phtml');
294
- $reviewHtml = $layout->getBlock('root')->toHtml();
295
-
296
- $result['goto_section'] = 'review';
297
- $result['update_section'] = array(
298
- 'name' => 'review',
299
- 'html' => $reviewHtml
300
- );
301
-
302
- $json = Mage::helper('core')->jsonEncode($result);
303
- $response = Mage::helper('core')->jsonDecode($controller->getResponse()->getBody());
304
-
305
- $response['update_section']['html'].= '<script type="text/javascript">
306
- //<![CDATA[
307
- paylinePaymentSavedTransport = ' . $json . ';
308
- paylineTrySkipPaymentMethod();
309
- //]]>
310
- </script>';
311
-
312
-
313
- $controller->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));
314
- }
315
-
316
- /**
317
- * Clean payline
318
- * @see customer_logout
319
- */
320
- public function cleanPayline(Varien_Event_Observer $observer)
321
- {
322
- // Clean the wallet
323
- Mage::getSingleton('payline/wallet')->clean();
324
- }
325
-
326
-
327
- /**
328
- *
329
- * @param Varien_Event_Observer $observer
330
- */
331
- public function checkForConfigChanged(Varien_Event_Observer $observer)
332
- {
333
- $disablePayments = Mage::registry('payline_config_disable_payments');
334
- if ($disablePayments) {
335
- $config=Mage::getModel('core/config');
336
- $store=null;
337
- $paymentConfig = Mage::getStoreConfig('payment', $store);
338
- foreach ($paymentConfig as $code => $methodConfig) {
339
- if (Mage::getStoreConfigFlag('payment/'.$code.'/active', $store) and stripos($code,'payline')!==false ) {
340
- $config->saveConfig('payment/'.$code.'/active', 0);
341
- }
342
- }
343
- }
344
-
345
-
346
- $change = Mage::registry('payline_config_change');
347
- if ($change) {
348
- $url = Mage::helper("adminhtml")->getUrl('adminhtml/payline_managecontracts/importFromConfig');
349
-
350
- Mage::app()->getFrontController()->getResponse()->setRedirect($url);
351
- Mage::app()->getResponse()->sendResponse();
352
- exit;
353
- }
354
- }
355
-
356
- /**
357
- *
358
- * @param Varien_Event_Observer $observer
359
- * @return void
360
- */
361
- public function configNestedPayment(Varien_Event_Observer $observer)
362
- {
363
- $paymentGroups = $observer->getEvent()->getConfig()->getNode('sections/payline/groups');
364
-
365
- $payments = $paymentGroups->xpath('payline_payments_availables/*');
366
- foreach ($payments as $payment) {
367
- if ((int)$payment->include) {
368
-
369
- $fields = $paymentGroups->xpath((string)$payment->group . '/fields');
370
- if (isset($fields[0])) {
371
- $fields[0]->appendChild($payment, true);
372
- }
373
- }
374
- }
375
- }
376
-
377
-
378
- /**
379
- *
380
- * @param Varien_Event_Observer $observer
381
- * @return Monext_Payline_Model_Observer
382
- */
383
- public function updateHandleToUnsetPaymentStep(Varien_Event_Observer $observer)
384
- {
385
- $action = $observer->getEvent()->getAction();
386
- if ($action->getFullActionName() == "checkout_onepage_index" && Mage::helper('payline')->disableOnepagePaymentStep()) {
387
- $update = $observer->getEvent()->getLayout()->getUpdate();
388
- $update->addHandle('payline_remove_onepage_payment_step_handler');
389
- }
390
- return $this;
391
- }
392
-
393
-
394
- /**
395
- *
396
- * @param Varien_Event_Observer $observer
397
- * @return Monext_Payline_Model_Observer
398
- */
399
- public function updateSectionTitle(Varien_Event_Observer $observer)
400
- {
401
- $action = $observer->getEvent()->getAction();
402
- if ($action->getFullActionName() == "checkout_onepage_index" && Mage::helper('payline')->disableOnepagePaymentStep()) {
403
- Mage::getSingleton('checkout/session')->setStepData('payment', array(
404
- 'label' => Mage::helper('checkout')->__('Payment Information'),
405
- 'is_show' => true
406
- ));
407
- Mage::getSingleton('checkout/session')->setStepData('review', array(
408
- 'label' => Mage::helper('checkout')->__('Payment Information'),
409
- 'is_show' => true
410
- ));;
411
- }
412
- return $this;
413
- }
414
-
415
-
416
- /**
417
- *
418
- * @param Varien_Event_Observer $observer
419
- * @return Monext_Payline_Model_Observer
420
- */
421
- public function postdispatchOnepageSaveShippingMethod(Varien_Event_Observer $observer)
422
- {
423
- if (!Mage::helper('payline')->disableOnepagePaymentStep()) {
424
- return $this;
425
- }
426
-
427
- /* @var $controller Mage_Checkout_OnepageController */
428
- $controller = $observer->getEvent()->getControllerAction();
429
- $response = Mage::app()->getFrontController()->getResponse()->getBody(true);
430
-
431
- if (!isset($response['default'])) {
432
- return;
433
- }
434
-
435
- $response = Mage::helper('core')->jsonDecode($response['default']);
436
-
437
- if ($response['goto_section'] == 'payment') {
438
-
439
- $contractNumber = Mage::helper('payline')->getDefaultContractNumberForWidget();
440
- if(empty($contractNumber)) {
441
- throw new Exception('Cannot find valid contract number');
442
- }
443
- $onePage = Mage::getSingleton('checkout/type_onepage');
444
- $onePage->getQuote()->getPayment()->importData(array('method'=>'PaylineCPT', 'cc_type'=>$contractNumber));
445
-
446
-
447
- $layout = $controller->getLayout();
448
- $update = $layout->getUpdate();
449
- // Needed with cache activated
450
- $update->setCacheId(uniqid("payline_onepage_review_payline"));
451
-
452
- $controller->loadLayout(array('checkout_onepage_review','payline_onepage_review_handler'), true, true);
453
- $response['goto_section'] = 'review';
454
- $response['update_section'] = array(
455
- 'name' => 'review',
456
- 'html' => $controller->getLayout()->getBlock('root')->toHtml()
457
- );
458
-
459
- $controller->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));
460
- }
461
-
462
- return $this;
463
- }
464
-
465
-
466
- /**
467
- *
468
- * @param Varien_Event_Observer $observer
469
- */
470
- public function alterBlockHtmlAfter(Varien_Event_Observer $observer)
471
- {
472
- if (!Mage::helper('payline')->disableOnepagePaymentStep()) {
473
- return $this;
474
- }
475
-
476
- $block = $observer->getEvent()->getBlock();
477
- $transport = $observer->getEvent()->getTransport();
478
-
479
- if($block instanceof Mage_Checkout_Block_Onepage_Shipping_Method) {
480
- $block->getLayout()
481
- ->createBlock('payline/checkout_widget_opcheckout', 'payline_checkout_widget_opcheckout_init')
482
- ->setTemplate('payline/checkout/onepage/widget-opcheckout-js-init.phtml')
483
- ->addHtmlAsChild($block, $transport);
484
- }
485
-
486
- }
487
-
488
-
489
- /**
490
- *
491
- * @param Varien_Event_Observer $observer
492
- */
493
- public function predispatchCheckoutOnepage(Varien_Event_Observer $observer)
494
- {
495
- if (!Mage::helper('payline')->disableOnepagePaymentStep()) {
496
- return $this;
497
- }
498
-
499
- $needRedirect = false;
500
-
501
- /* @var $controller Mage_Checkout_OnepageController */
502
- $controller = $observer->getEvent()->getControllerAction();
503
- $paylinetoken = $controller->getRequest()->getParam('paylinetoken');
504
-
505
- $referer = Mage::helper('core/http')->getHttpReferer();
506
- if ($paylinetoken) {
507
- $token = Mage::getModel('payline/token')->load($paylinetoken, 'token');
508
- if($token->getId()) {
509
- $needRedirect = true;
510
- }
511
- }
512
-
513
- if ($needRedirect) {
514
- $params = $controller->getRequest()->getParams();
515
- $params['_secure'] = true;
516
-
517
- $controller->getResponse()->setRedirect(
518
- Mage::getUrl('payline/index/cptReturnWidget', $params)
519
- );
520
- $controller->setFlag('', Mage_Core_Controller_Varien_Action::FLAG_NO_DISPATCH, true);
521
- }
522
- }
523
- }
1
+ <?php
2
+
3
+ class Monext_Payline_Model_Observer
4
+ {
5
+
6
+ protected $_mode;
7
+
8
+ public function createInvoiceWhenStatusChange(Varien_Event_Observer $observer)
9
+ {
10
+ // Only if the payment method is one of Payline
11
+ $code = $observer->getOrder()->getPayment()->getMethodInstance()->getCode();
12
+ if (!Mage::helper('payline')->isPayline($code)) {
13
+ return;
14
+ }
15
+
16
+ // infinite loop protection
17
+ if (is_null(Mage::registry('payline_create_invoice'))) {
18
+ $order = $observer->getEvent()->getOrder();
19
+ if ($this->_canCreateInvoice($order)) {
20
+ $this->_createInvoice($order);
21
+ }
22
+ // capture or not, that is the question
23
+ $paymentMethod = $order->getPayment()->getMethod();
24
+ $paymentActionConf = Mage::getStoreConfig('payment/' . $paymentMethod . '/payline_payment_action');
25
+ // if payment action user conf == authorization => need to capture
26
+ if ($paymentActionConf == "100") {
27
+ $fireCaptureOption = Mage::getStoreConfig('payment/' . $paymentMethod . '/capture_payment_when_i_said');
28
+ // if status match w/ user conf && !PaylineNX
29
+ if ($order->getStatus() == $fireCaptureOption && $paymentMethod != 'PaylineNX') {
30
+ $invoice = $this->_getInvoiceFromOrder($order);
31
+ if ($invoice) {
32
+ $invoice->setState(Mage_Sales_Model_Order_Invoice::STATE_OPEN);
33
+ }
34
+ if ($invoice && $invoice->parentCanCapture()) { // invoice present && ok => capture
35
+ Mage::register('payline_create_invoice', true);
36
+ $invoice->capture();
37
+ Mage::unregister('payline_create_invoice');
38
+ }
39
+ } // end if status matches
40
+ } // end if( $paymentActionConf == 100 )
41
+ }
42
+ }
43
+
44
+ // end createInvoiceWhenStatusChange()
45
+
46
+ /**
47
+ * Return the invoice's order data or false if not exist or NX payment
48
+ */
49
+ protected function _getInvoiceFromOrder($order)
50
+ {
51
+ $invoice = $order->getInvoiceCollection();
52
+ $invoice = sizeof($invoice) == 1 ? $invoice->getFirstItem() : false;
53
+ return $invoice;
54
+ }
55
+
56
+ protected function _getMode($order)
57
+ {
58
+ if ($this->_mode === null) {
59
+ $paymentMethod = $order->getPayment()->getMethod();
60
+ $mode = explode('Payline', $paymentMethod);
61
+ if (isset($mode[1])) {
62
+ $mode = $mode[1];
63
+ $this->_mode = $mode;
64
+ }
65
+ }
66
+ return $this->_mode;
67
+ }
68
+
69
+ protected function _canCreateInvoice($order)
70
+ {
71
+ $result = false;
72
+ if ($order->canInvoice()) {
73
+ $paymentMethod = $order->getPayment()->getMethod();
74
+ if (strstr($paymentMethod, 'Payline') !== false) {
75
+ $mode = $this->_getMode($order);
76
+ if (!empty($mode)) {
77
+ $statusToCreateInvoice = Mage::getStoreConfig('payment/' . $paymentMethod . '/automate_invoice_creation');
78
+ if ($order->getStatus() == $statusToCreateInvoice && !empty($statusToCreateInvoice)) {
79
+ if ($order->getData('status') !== $order->getOrigData('status')) {
80
+ $result = true;
81
+ }
82
+ }
83
+ }
84
+ }
85
+ }
86
+ return $result;
87
+ }
88
+
89
+ protected function _createInvoice($order)
90
+ {
91
+ $transId = $order->getPayment()->getCcTransId();
92
+ if (!empty($transId)) {
93
+ $array = array(
94
+ 'transactionId' => $transId,
95
+ 'orderRef' => $order->getRealOrderId(),
96
+ 'startDate' => '',
97
+ 'endDate' => '',
98
+ 'transactionHistory' => '',
99
+ 'version' => Monext_Payline_Helper_Data::VERSION,
100
+ 'archiveSearch' => ''
101
+ );
102
+ try {
103
+ $mode = $this->_getMode($order);
104
+ $res = Mage::helper('payline')->initPayline($mode)->getTransactionDetails($array);
105
+ if (isset($res['payment']['action'])) {
106
+ $order->setCreateInvoice(true);
107
+ $action = $res['payment']['action'];
108
+ if ($mode == 'NX') {
109
+ $action = Monext_Payline_Model_Cpt::ACTION_AUTH_CAPTURE;
110
+ }
111
+ Mage::helper('payline')->createInvoice($action, $order);
112
+ }
113
+ } catch (Exception $e) {
114
+ Mage::logException($e);
115
+ Mage::helper('payline/logger')->log(
116
+ '[createInvoiceWhenStatusChange] '
117
+ . '[' . $order->getIncrementId() . '] '
118
+ . '[' . $transId . '] '
119
+ . $e->getMessage()
120
+ );
121
+ }
122
+ }
123
+ }
124
+
125
+ public function saveQuoteNxFees(Varien_Event_Observer $observer)
126
+ {
127
+ // Only if the payment method is one of Payline
128
+ $code = $observer->getQuote()->getPayment()->getMethod();
129
+ if (!Mage::helper('payline')->isPayline($code)) {
130
+ return;
131
+ }
132
+
133
+ $applyCosts = (int) Mage::getStoreConfig('payment/PaylineNX/cost_type');
134
+ if (!$applyCosts) {
135
+ return;
136
+ }
137
+
138
+ $quote = $observer->getEvent()->getQuote();
139
+
140
+ if (!$quote->getPaylineFee()) {
141
+ $payment = $quote->getPayment();
142
+ if ($payment) {
143
+ $paymentMethod = $payment->getMethod();
144
+ $fee = Mage::getModel('payline/fees')->getCollection()
145
+ ->addFieldtoFilter('quote_id', $quote->getId())->getFirstItem();
146
+ $quote->setPaylineFee($fee);
147
+ if ($paymentMethod == 'PaylineNX') {
148
+ $amount = (float) Mage::getStoreConfig('payment/PaylineNX/cost_amount');
149
+ $baseamount = (float) Mage::getStoreConfig('payment/PaylineNX/cost_amount');
150
+
151
+ if ($applyCosts == Monext_Payline_Model_Datasource_Costs::COST_PERCENT) {
152
+ $amount = round(($quote->getSubtotal() * $amount) / 100, 2);
153
+ $baseamount = round(($quote->getBaseSubtotal() * $baseamount) / 100, 2);
154
+ }
155
+
156
+ //save fees
157
+ if ($fee->getId()) {
158
+ $fee->setAmount($amount)->setBaseAmount($baseamount)->save();
159
+ } else {
160
+ Mage::getModel('payline/fees')->setQuoteId($quote->getId())
161
+ ->setAmount($amount)
162
+ ->setBaseAmount($baseamount)
163
+ ->save();
164
+ }
165
+ } elseif ($fee->getId()) {
166
+ $fee->delete();
167
+ }
168
+ }
169
+ }
170
+ }
171
+
172
+ public function saveOrderNxFees(Varien_Event_Observer $observer)
173
+ {
174
+ // Only if the payment method is one of Payline
175
+ $code = $observer->getOrder()->getPayment()->getMethodInstance()->getCode();
176
+ if (!Mage::helper('payline')->isPayline($code)) {
177
+ return;
178
+ }
179
+
180
+ $applyCosts = (int) Mage::getStoreConfig('payment/PaylineNX/cost_type');
181
+ if (!$applyCosts) {
182
+ return;
183
+ }
184
+
185
+ $order = $observer->getEvent()->getOrder();
186
+ if (!$order->getPaylineFee()) {
187
+ $quoteId = $order->getQuoteId();
188
+ $payment = $order->getPayment();
189
+ if ($quoteId && $payment) {
190
+ $paymentMethod = $payment->getMethod();
191
+ $fee = Mage::getModel('payline/fees')->getCollection()
192
+ ->addFieldtoFilter('quote_id', $quoteId)->getFirstItem();
193
+ $order->setPaylineFee($fee);
194
+ if ($paymentMethod == 'PaylineNX') {
195
+ $amount = (float) Mage::getStoreConfig('payment/PaylineNX/cost_amount');
196
+ $baseamount = (float) Mage::getStoreConfig('payment/PaylineNX/cost_amount');
197
+
198
+ if ($applyCosts == Monext_Payline_Model_Datasource_Costs::COST_PERCENT) {
199
+ $amount = round(($order->getSubtotal() * $amount) / 100, 2);
200
+ $baseamount = round(($order->getBaseSubtotal() * $baseamount) / 100, 2);
201
+ }
202
+
203
+ //save fees
204
+ if ($fee->getId()) {
205
+ $fee->setOrderId($order->getId())->setAmount($amount)->setBaseAmount($baseamount)->save();
206
+ }
207
+ } elseif ($fee->getId()) {
208
+ $fee->delete();
209
+ }
210
+ }
211
+ }
212
+ }
213
+
214
+ public function saveInvoiceNxFees(Varien_Event_Observer $observer)
215
+ {
216
+ // Only if the payment method is one of Payline
217
+ $code = $observer->getInvoice()->getOrder()->getPayment()->getMethodInstance()->getCode();
218
+ if (!Mage::helper('payline')->isPayline($code)) {
219
+ return;
220
+ }
221
+
222
+ $applyCosts = (int) Mage::getStoreConfig('payment/PaylineNX/cost_type');
223
+ if (!$applyCosts) {
224
+ return;
225
+ }
226
+
227
+ $invoice = $observer->getEvent()->getInvoice();
228
+ $order = $invoice->getOrder();
229
+ $payment = $order->getPayment();
230
+ if ($payment) {
231
+ $paymentMethod = $payment->getMethod();
232
+ if ($paymentMethod == 'PaylineNX') {
233
+ $fee = Mage::getModel('payline/fees')->getCollection()
234
+ ->addFieldtoFilter('order_id', $order->getId())->getFirstItem();
235
+
236
+ $amount = (float) Mage::getStoreConfig('payment/PaylineNX/cost_amount');
237
+ $baseamount = (float) Mage::getStoreConfig('payment/PaylineNX/cost_amount');
238
+
239
+ if ($applyCosts == Monext_Payline_Model_Datasource_Costs::COST_PERCENT) {
240
+ $amount = round(($order->getSubtotal() * $amount) / 100, 2);
241
+ $baseamount = round(($order->getBaseSubtotal() * $baseamount) / 100, 2);
242
+ }
243
+
244
+ //save fees
245
+ if ($fee->getId() && !$fee->getInvoiceId()) {
246
+ $fee->setInvoiceId($invoice->getId())->save();
247
+ }
248
+ }
249
+ }
250
+ }
251
+
252
+ public function afterSaveShippingAction(Varien_Event_Observer $observer)
253
+ {
254
+ $controller = $observer->getControllerAction();
255
+
256
+ $paymentMethodsBlock = $controller->getLayout()->createBlock('checkout/onepage_payment_methods');
257
+ $methods = $paymentMethodsBlock->getMethods();
258
+
259
+ // check if more than one methods available
260
+ if (count($methods) != 1) {
261
+ return;
262
+ }
263
+
264
+ $method = current($methods);
265
+
266
+ // check if only payline methods (direct method should not be skipped)
267
+ if (!in_array($method->getCode(), array('PaylineCPT', 'PaylineNX', 'PaylineWALLET'))) {
268
+ return;
269
+ }
270
+
271
+ $data = array('method' => $method->getCode());
272
+
273
+ if ($method->getCode() == 'PaylineCPT') {
274
+ // retrive sub methods (card types)
275
+ $cptBlock = $controller->getLayout()->createBlock('payline/cpt');
276
+ $ccTypes = $cptBlock->getPaymentMethods();
277
+ if (count($ccTypes) != 1) {
278
+ return;
279
+ }
280
+ $ccType = current($ccTypes);
281
+ $data['cc_type'] = $ccType['number'];
282
+ }
283
+
284
+ // seems that payment step can be skipped, so save the unique payment method now
285
+ $result = Mage::getSingleton('checkout/type_onepage')->savePayment($data);
286
+ if (!empty($result['error'])) {
287
+ return;
288
+ }
289
+
290
+ $layout = Mage::getModel('core/layout');
291
+ $layout->getUpdate()->load('checkout_onepage_review');
292
+ $layout->generateXml()->generateBlocks();
293
+ $layout->getBlock('root')->getChild('button')->setTemplate('checkout/onepage/review/button.phtml');
294
+ $reviewHtml = $layout->getBlock('root')->toHtml();
295
+
296
+ $result['goto_section'] = 'review';
297
+ $result['update_section'] = array(
298
+ 'name' => 'review',
299
+ 'html' => $reviewHtml
300
+ );
301
+
302
+ $json = Mage::helper('core')->jsonEncode($result);
303
+ $response = Mage::helper('core')->jsonDecode($controller->getResponse()->getBody());
304
+
305
+ $response['update_section']['html'].= '<script type="text/javascript">
306
+ //<![CDATA[
307
+ paylinePaymentSavedTransport = ' . $json . ';
308
+ paylineTrySkipPaymentMethod();
309
+ //]]>
310
+ </script>';
311
+
312
+
313
+ $controller->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));
314
+ }
315
+
316
+ /**
317
+ * Clean payline
318
+ * @see customer_logout
319
+ */
320
+ public function cleanPayline(Varien_Event_Observer $observer)
321
+ {
322
+ // Clean the wallet
323
+ Mage::getSingleton('payline/wallet')->clean();
324
+ }
325
+
326
+
327
+ /**
328
+ *
329
+ * @param Varien_Event_Observer $observer
330
+ */
331
+ public function checkForConfigChanged(Varien_Event_Observer $observer)
332
+ {
333
+ $disablePayments = Mage::registry('payline_config_disable_payments');
334
+ if ($disablePayments) {
335
+ $config=Mage::getModel('core/config');
336
+ $store=null;
337
+ $paymentConfig = Mage::getStoreConfig('payment', $store);
338
+ foreach ($paymentConfig as $code => $methodConfig) {
339
+ if (Mage::getStoreConfigFlag('payment/'.$code.'/active', $store) and stripos($code,'payline')!==false ) {
340
+ $config->saveConfig('payment/'.$code.'/active', 0);
341
+ }
342
+ }
343
+ }
344
+
345
+
346
+ $change = Mage::registry('payline_config_change');
347
+ if ($change) {
348
+ $url = Mage::helper("adminhtml")->getUrl('adminhtml/payline_managecontracts/importFromConfig');
349
+
350
+ Mage::app()->getFrontController()->getResponse()->setRedirect($url);
351
+ Mage::app()->getResponse()->sendResponse();
352
+ exit;
353
+ }
354
+ }
355
+
356
+ /**
357
+ *
358
+ * @param Varien_Event_Observer $observer
359
+ * @return void
360
+ */
361
+ public function configNestedPayment(Varien_Event_Observer $observer)
362
+ {
363
+ $paymentGroups = $observer->getEvent()->getConfig()->getNode('sections/payline/groups');
364
+
365
+ $payments = $paymentGroups->xpath('payline_payments_availables/*');
366
+ foreach ($payments as $payment) {
367
+ if ((int)$payment->include) {
368
+
369
+ $fields = $paymentGroups->xpath((string)$payment->group . '/fields');
370
+ if (isset($fields[0])) {
371
+ $fields[0]->appendChild($payment, true);
372
+ }
373
+ }
374
+ }
375
+ }
376
+
377
+
378
+ /**
379
+ *
380
+ * @param Varien_Event_Observer $observer
381
+ * @return Monext_Payline_Model_Observer
382
+ */
383
+ public function updateHandleToUnsetPaymentStep(Varien_Event_Observer $observer)
384
+ {
385
+ $action = $observer->getEvent()->getAction();
386
+ if ($action->getFullActionName() == "checkout_onepage_index" && Mage::helper('payline')->disableOnepagePaymentStep()) {
387
+ $update = $observer->getEvent()->getLayout()->getUpdate();
388
+ $update->addHandle('payline_remove_onepage_payment_step_handler');
389
+ }
390
+ return $this;
391
+ }
392
+
393
+
394
+ /**
395
+ *
396
+ * @param Varien_Event_Observer $observer
397
+ * @return Monext_Payline_Model_Observer
398
+ */
399
+ public function updateSectionTitle(Varien_Event_Observer $observer)
400
+ {
401
+ $action = $observer->getEvent()->getAction();
402
+ if ($action->getFullActionName() == "checkout_onepage_index" && Mage::helper('payline')->disableOnepagePaymentStep()) {
403
+ Mage::getSingleton('checkout/session')->setStepData('payment', array(
404
+ 'label' => Mage::helper('checkout')->__('Payment Information'),
405
+ 'is_show' => true
406
+ ));
407
+ Mage::getSingleton('checkout/session')->setStepData('review', array(
408
+ 'label' => Mage::helper('checkout')->__('Payment Information'),
409
+ 'is_show' => true
410
+ ));;
411
+ }
412
+ return $this;
413
+ }
414
+
415
+
416
+ /**
417
+ *
418
+ * @param Varien_Event_Observer $observer
419
+ * @return Monext_Payline_Model_Observer
420
+ */
421
+ public function postdispatchOnepageSaveShippingMethod(Varien_Event_Observer $observer)
422
+ {
423
+ if (!Mage::helper('payline')->disableOnepagePaymentStep()) {
424
+ return $this;
425
+ }
426
+
427
+ /* @var $controller Mage_Checkout_OnepageController */
428
+ $controller = $observer->getEvent()->getControllerAction();
429
+ $response = Mage::app()->getFrontController()->getResponse()->getBody(true);
430
+
431
+ if (!isset($response['default'])) {
432
+ return;
433
+ }
434
+
435
+ $response = Mage::helper('core')->jsonDecode($response['default']);
436
+
437
+ if ($response['goto_section'] == 'payment') {
438
+
439
+ $contractNumber = Mage::helper('payline')->getDefaultContractNumberForWidget();
440
+ if(empty($contractNumber)) {
441
+ throw new Exception('Cannot find valid contract number');
442
+ }
443
+ $onePage = Mage::getSingleton('checkout/type_onepage');
444
+ $onePage->getQuote()->getPayment()->importData(array('method'=>'PaylineCPT', 'cc_type'=>$contractNumber));
445
+
446
+
447
+ $layout = $controller->getLayout();
448
+ $update = $layout->getUpdate();
449
+ // Needed with cache activated
450
+ $update->setCacheId(uniqid("payline_onepage_review_payline"));
451
+
452
+ $controller->loadLayout(array('checkout_onepage_review','payline_onepage_review_handler'), true, true);
453
+ $response['goto_section'] = 'review';
454
+ $response['update_section'] = array(
455
+ 'name' => 'review',
456
+ 'html' => $controller->getLayout()->getBlock('root')->toHtml()
457
+ );
458
+
459
+ $controller->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));
460
+ }
461
+
462
+ return $this;
463
+ }
464
+
465
+
466
+ /**
467
+ *
468
+ * @param Varien_Event_Observer $observer
469
+ */
470
+ public function alterBlockHtmlAfter(Varien_Event_Observer $observer)
471
+ {
472
+ if (!Mage::helper('payline')->disableOnepagePaymentStep()) {
473
+ return $this;
474
+ }
475
+
476
+ $block = $observer->getEvent()->getBlock();
477
+ $transport = $observer->getEvent()->getTransport();
478
+
479
+ if($block instanceof Mage_Checkout_Block_Onepage_Shipping_Method) {
480
+ $block->getLayout()
481
+ ->createBlock('payline/checkout_widget_opcheckout', 'payline_checkout_widget_opcheckout_init')
482
+ ->setTemplate('payline/checkout/onepage/widget-opcheckout-js-init.phtml')
483
+ ->addHtmlAsChild($block, $transport);
484
+ }
485
+
486
+ }
487
+
488
+
489
+ /**
490
+ *
491
+ * @param Varien_Event_Observer $observer
492
+ */
493
+ public function predispatchCheckoutOnepage(Varien_Event_Observer $observer)
494
+ {
495
+ if (!Mage::helper('payline')->disableOnepagePaymentStep()) {
496
+ return $this;
497
+ }
498
+
499
+ $needRedirect = false;
500
+
501
+ /* @var $controller Mage_Checkout_OnepageController */
502
+ $controller = $observer->getEvent()->getControllerAction();
503
+ $paylinetoken = $controller->getRequest()->getParam('paylinetoken');
504
+
505
+ $referer = Mage::helper('core/http')->getHttpReferer();
506
+ if ($paylinetoken) {
507
+ $token = Mage::getModel('payline/token')->load($paylinetoken, 'token');
508
+ if($token->getId()) {
509
+ $needRedirect = true;
510
+ }
511
+ }
512
+
513
+ if ($needRedirect) {
514
+ $params = $controller->getRequest()->getParams();
515
+ $params['_secure'] = true;
516
+
517
+ $controller->getResponse()->setRedirect(
518
+ Mage::getUrl('payline/index/cptReturnWidget', $params)
519
+ );
520
+ $controller->setFlag('', Mage_Core_Controller_Varien_Action::FLAG_NO_DISPATCH, true);
521
+ }
522
+ }
523
+ }
app/code/community/Monext/Payline/Model/Order/Invoice.php CHANGED
@@ -1,32 +1,32 @@
1
- <?php
2
- class Monext_Payline_Model_Order_Invoice extends Mage_Sales_Model_Order_Invoice
3
- {
4
- /**
5
- * Override parent to add the admin BO conf
6
- * @return bool true if can capture, otherwise false
7
- */
8
- public function canCapture()
9
- {
10
- // Only if the payment method is one of Payline
11
- $code = $this->getOrder()->getPayment()->getMethod();
12
- if (!Mage::helper('payline')->isPayline($code)) {
13
- return parent::canCapture();
14
- }
15
-
16
- $canCapture = parent::canCapture();
17
- $paymentMethod = $this->getOrder()->getPayment()->getMethod();
18
- $paymentActionConf = Mage::getStoreConfig('payment/'.$paymentMethod.'/payline_payment_action');
19
- $result = true;
20
- // if only auth (100), check if it's time to capture
21
- if( $paymentActionConf == "100" ) {
22
- $fireCaptureOption = Mage::getStoreConfig('payment/'.$paymentMethod.'/capture_payment_when_i_said');
23
- $result = ( strcasecmp('invoice', $fireCaptureOption) == 0 );
24
- }
25
- return $canCapture && $result ;
26
- }
27
-
28
- public function parentCanCapture()
29
- {
30
- return parent::canCapture();
31
- }
32
  }
1
+ <?php
2
+ class Monext_Payline_Model_Order_Invoice extends Mage_Sales_Model_Order_Invoice
3
+ {
4
+ /**
5
+ * Override parent to add the admin BO conf
6
+ * @return bool true if can capture, otherwise false
7
+ */
8
+ public function canCapture()
9
+ {
10
+ // Only if the payment method is one of Payline
11
+ $code = $this->getOrder()->getPayment()->getMethod();
12
+ if (!Mage::helper('payline')->isPayline($code)) {
13
+ return parent::canCapture();
14
+ }
15
+
16
+ $canCapture = parent::canCapture();
17
+ $paymentMethod = $this->getOrder()->getPayment()->getMethod();
18
+ $paymentActionConf = Mage::getStoreConfig('payment/'.$paymentMethod.'/payline_payment_action');
19
+ $result = true;
20
+ // if only auth (100), check if it's time to capture
21
+ if( $paymentActionConf == "100" ) {
22
+ $fireCaptureOption = Mage::getStoreConfig('payment/'.$paymentMethod.'/capture_payment_when_i_said');
23
+ $result = ( strcasecmp('invoice', $fireCaptureOption) == 0 );
24
+ }
25
+ return $canCapture && $result ;
26
+ }
27
+
28
+ public function parentCanCapture()
29
+ {
30
+ return parent::canCapture();
31
+ }
32
  }
app/code/community/Monext/Payline/Model/Order/Payment.php CHANGED
@@ -1,56 +1,56 @@
1
- <?php
2
- class Monext_Payline_Model_Order_Payment extends Mage_Sales_Model_Order_Payment
3
- {
4
- /* @Override
5
- * Exec parent, then set order status according to user conf
6
- */
7
- public function capture($invoice)
8
- {
9
- // Only if the payment method is one of Payline
10
- $code = $this->getOrder()->getPayment()->getMethod();
11
- if (!Mage::helper('payline')->isPayline($code)) {
12
- return parent::capture($invoice);
13
- }
14
-
15
- parent::capture( $invoice );
16
-
17
- $msgError = '[Monext_Payline_Model_Order_Payment#capture] ERROR Unable to set order status';
18
-
19
- if( $invoice->getTransactionId() ) {
20
- $order = $this->getOrder();
21
- $method = str_replace( 'Payline', '', $order->getPayment()->getMethod() );
22
- $paylineSDK = Mage::helper('payline')->initPayline( $method );
23
- // get the last transaction id in order to get the details from payline in order to get the action, then i die
24
- $transId = Mage::getModel('sales/order_payment_transaction')
25
- ->getCollection()
26
- ->addFieldToFilter('order_id', $order->getId() )
27
- ->setOrder('txn_id', 'DESC')
28
- ->getFirstItem()
29
- ->getTxnId();
30
-
31
- $array_details = array();
32
- $array_details['orderRef'] = $order->getRealOrderId();
33
- $array_details['transactionId'] = $transId;
34
- $array_details['startDate'] = '';
35
- $array_details['endDate'] = '';
36
- $array_details['transactionHistory']= '';
37
- $array_details['version'] = Monext_Payline_Helper_Data::VERSION;
38
- $array_details['archiveSearch'] = '';
39
- $transDetails = $paylineSDK->getTransactionDetails( $array_details );
40
-
41
- if( isset( $transDetails ) ) {
42
- $isReAuth = $transDetails['payment']['action'] == Monext_Payline_Model_Cpt::ACTION_RE_AUTH ? true:false;
43
- Mage::helper('payline')->setOrderStatusAccordingToPaymentMode(
44
- $order, $transDetails['payment']['action'], $isReAuth );
45
- $order->save();
46
-
47
- } else {
48
- Mage::log( $msgError );
49
- }
50
- } else {
51
- Mage::log( $msgError );
52
- }
53
-
54
- return $this;
55
- }
56
  }
1
+ <?php
2
+ class Monext_Payline_Model_Order_Payment extends Mage_Sales_Model_Order_Payment
3
+ {
4
+ /* @Override
5
+ * Exec parent, then set order status according to user conf
6
+ */
7
+ public function capture($invoice)
8
+ {
9
+ // Only if the payment method is one of Payline
10
+ $code = $this->getOrder()->getPayment()->getMethod();
11
+ if (!Mage::helper('payline')->isPayline($code)) {
12
+ return parent::capture($invoice);
13
+ }
14
+
15
+ parent::capture( $invoice );
16
+
17
+ $msgError = '[Monext_Payline_Model_Order_Payment#capture] ERROR Unable to set order status';
18
+
19
+ if( $invoice->getTransactionId() ) {
20
+ $order = $this->getOrder();
21
+ $method = str_replace( 'Payline', '', $order->getPayment()->getMethod() );
22
+ $paylineSDK = Mage::helper('payline')->initPayline( $method );
23
+ // get the last transaction id in order to get the details from payline in order to get the action, then i die
24
+ $transId = Mage::getModel('sales/order_payment_transaction')
25
+ ->getCollection()
26
+ ->addFieldToFilter('order_id', $order->getId() )
27
+ ->setOrder('txn_id', 'DESC')
28
+ ->getFirstItem()
29
+ ->getTxnId();
30
+
31
+ $array_details = array();
32
+ $array_details['orderRef'] = $order->getRealOrderId();
33
+ $array_details['transactionId'] = $transId;
34
+ $array_details['startDate'] = '';
35
+ $array_details['endDate'] = '';
36
+ $array_details['transactionHistory']= '';
37
+ $array_details['version'] = Monext_Payline_Helper_Data::VERSION;
38
+ $array_details['archiveSearch'] = '';
39
+ $transDetails = $paylineSDK->getTransactionDetails( $array_details );
40
+
41
+ if( isset( $transDetails ) ) {
42
+ $isReAuth = $transDetails['payment']['action'] == Monext_Payline_Model_Cpt::ACTION_RE_AUTH ? true:false;
43
+ Mage::helper('payline')->setOrderStatusAccordingToPaymentMode(
44
+ $order, $transDetails['payment']['action'], $isReAuth );
45
+ $order->save();
46
+
47
+ } else {
48
+ Mage::log( $msgError );
49
+ }
50
+ } else {
51
+ Mage::log( $msgError );
52
+ }
53
+
54
+ return $this;
55
+ }
56
  }
app/code/community/Monext/Payline/Model/Productcategories.php CHANGED
@@ -1,22 +1,22 @@
1
- <?php
2
-
3
- /**
4
- * Payline product categories model
5
- */
6
-
7
- class Monext_Payline_Model_Productcategories extends Mage_Core_Model_Abstract
8
- {
9
- public function _construct()
10
- {
11
- parent::_construct();
12
- $this->_init('payline/productcategories');
13
- }
14
-
15
- public function getStoreCategoryId(){
16
- return $this->_data['store_category_id'];
17
- }
18
-
19
- public function getPaylineCategoryId(){
20
- return $this->_data['payline_category_id'];
21
- }
22
- }
1
+ <?php
2
+
3
+ /**
4
+ * Payline product categories model
5
+ */
6
+
7
+ class Monext_Payline_Model_Productcategories extends Mage_Core_Model_Abstract
8
+ {
9
+ public function _construct()
10
+ {
11
+ parent::_construct();
12
+ $this->_init('payline/productcategories');
13
+ }
14
+
15
+ public function getStoreCategoryId(){
16
+ return $this->_data['store_category_id'];
17
+ }
18
+
19
+ public function getPaylineCategoryId(){
20
+ return $this->_data['payline_category_id'];
21
+ }
22
+ }
app/code/community/Monext/Payline/Model/Resource/Eav/Mysql4/Setup.php CHANGED
@@ -1,27 +1,27 @@
1
- <?php
2
- class Monext_Payline_Model_Resource_Eav_Mysql4_Setup extends Mage_Eav_Model_Entity_Setup
3
- {
4
- /**
5
- * @return array
6
- */
7
- public function getDefaultEntities(){
8
- return array(
9
- 'customer'=>array(
10
- 'entity_model' => 'customer/customer',
11
- 'table' => 'customer/entity',
12
- 'increment_model' => 'eav/entity_increment_numeric',
13
- 'increment_per_store' => false,
14
- 'additional_attribute_table' => 'customer/eav_attribute',
15
- 'entity_attribute_collection' => 'customer/eav_attribute',
16
- 'attributes' => array(
17
- 'wallet_id'=>array(
18
- 'label' => 'Wallet ID',
19
- 'type' => 'varchar',
20
- 'visible' => false,
21
- 'required' => false,
22
- )
23
- )
24
- )
25
- );
26
- }
27
  }
1
+ <?php
2
+ class Monext_Payline_Model_Resource_Eav_Mysql4_Setup extends Mage_Eav_Model_Entity_Setup
3
+ {
4
+ /**
5
+ * @return array
6
+ */
7
+ public function getDefaultEntities(){
8
+ return array(
9
+ 'customer'=>array(
10
+ 'entity_model' => 'customer/customer',
11
+ 'table' => 'customer/entity',
12
+ 'increment_model' => 'eav/entity_increment_numeric',
13
+ 'increment_per_store' => false,
14
+ 'additional_attribute_table' => 'customer/eav_attribute',
15
+ 'entity_attribute_collection' => 'customer/eav_attribute',
16
+ 'attributes' => array(
17
+ 'wallet_id'=>array(
18
+ 'label' => 'Wallet ID',
19
+ 'type' => 'varchar',
20
+ 'visible' => false,
21
+ 'required' => false,
22
+ )
23
+ )
24
+ )
25
+ );
26
+ }
27
  }
app/code/community/Monext/Payline/Model/Session.php CHANGED
@@ -1,34 +1,34 @@
1
- <?php
2
- class Monext_Payline_Model_Session extends Mage_Core_Model_Session_Abstract
3
- {
4
- /**
5
- * Class constructor. Initialize checkout session namespace
6
- */
7
- public function __construct()
8
- {
9
- $this->init('payline');
10
- }
11
-
12
- public function switchToSecureContract()
13
- {
14
- $currentCcType = $this->getCcType();
15
-
16
- $currentContractType = false;
17
- $allAvailableContracts = Mage::helper('payline')->getCcContracts();
18
- foreach ($allAvailableContracts as $contract) {
19
-
20
- if($contract->getId()==$currentCcType) {
21
- $currentContractType = $contract->getContractType();
22
- break;
23
- }
24
- }
25
-
26
- $contract = Mage::helper('payline')->getContractByType($currentContractType,true);
27
- if($contract) {
28
- $this->setCcType($contract->getId());
29
- return true;
30
- } else {
31
- return false;
32
  }
33
- }
34
- }
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Monext_Payline_Model_Session extends Mage_Core_Model_Session_Abstract
3
+ {
4
+ /**
5
+ * Class constructor. Initialize checkout session namespace
6
+ */
7
+ public function __construct()
8
+ {
9
+ $this->init('payline');
10
+ }
11
+
12
+ public function switchToSecureContract()
13
+ {
14
+ $currentCcType = $this->getCcType();
15
+
16
+ $currentContractType = false;
17
+ $allAvailableContracts = Mage::helper('payline')->getCcContracts();
18
+ foreach ($allAvailableContracts as $contract) {
19
+
20
+ if($contract->getId()==$currentCcType) {
21
+ $currentContractType = $contract->getContractType();
22
+ break;
23
+ }
 
 
 
 
 
 
 
 
24
  }
25
+
26
+ $contract = Mage::helper('payline')->getContractByType($currentContractType,true);
27
+ if($contract) {
28
+ $this->setCcType($contract->getId());
29
+ return true;
30
+ } else {
31
+ return false;
32
+ }
33
+ }
34
+ }
app/code/community/Monext/Payline/Model/Token.php CHANGED
@@ -1,14 +1,14 @@
1
- <?php
2
-
3
- /**
4
- * Payline token model
5
- */
6
-
7
- class Monext_Payline_Model_Token extends Mage_Core_Model_Abstract
8
- {
9
- public function _construct()
10
- {
11
- parent::_construct();
12
- $this->_init('payline/token');
13
- }
14
- }
1
+ <?php
2
+
3
+ /**
4
+ * Payline token model
5
+ */
6
+
7
+ class Monext_Payline_Model_Token extends Mage_Core_Model_Abstract
8
+ {
9
+ public function _construct()
10
+ {
11
+ parent::_construct();
12
+ $this->_init('payline/token');
13
+ }
14
+ }
app/code/community/Monext/Payline/Model/Total/Nx/Invoice.php CHANGED
@@ -1,23 +1,23 @@
1
- <?php
2
-
3
- class Monext_Payline_Model_Total_Nx_Invoice
4
- extends Mage_Sales_Model_Order_Invoice_Total_Abstract
5
- {
6
- // Collect the totals for the invoice
7
- public function collect(Mage_Sales_Model_Order_Invoice $invoice)
8
- {
9
- $order = $invoice->getOrder();
10
- $orderId = $order->getId();
11
- $fee = Mage::getModel('payline/fees')->getCollection()
12
- ->addFieldtoFilter('order_id',$orderId)->getFirstItem();
13
-
14
- if($fee->getId() && ($invoice->getId() == $fee->getInvoiceId())) {
15
- $myTotal = $fee->getAmount();
16
- $baseMyTotal = $fee->getBaseAmount();
17
-
18
- $invoice->setGrandTotal($invoice->getGrandTotal() + $myTotal);
19
- $invoice->setBaseGrandTotal($invoice->getBaseGrandTotal() + $baseMyTotal);
20
- }
21
- return $this;
22
- }
23
- }
1
+ <?php
2
+
3
+ class Monext_Payline_Model_Total_Nx_Invoice
4
+ extends Mage_Sales_Model_Order_Invoice_Total_Abstract
5
+ {
6
+ // Collect the totals for the invoice
7
+ public function collect(Mage_Sales_Model_Order_Invoice $invoice)
8
+ {
9
+ $order = $invoice->getOrder();
10
+ $orderId = $order->getId();
11
+ $fee = Mage::getModel('payline/fees')->getCollection()
12
+ ->addFieldtoFilter('order_id',$orderId)->getFirstItem();
13
+
14
+ if($fee->getId() && ($invoice->getId() == $fee->getInvoiceId())) {
15
+ $myTotal = $fee->getAmount();
16
+ $baseMyTotal = $fee->getBaseAmount();
17
+
18
+ $invoice->setGrandTotal($invoice->getGrandTotal() + $myTotal);
19
+ $invoice->setBaseGrandTotal($invoice->getBaseGrandTotal() + $baseMyTotal);
20
+ }
21
+ return $this;
22
+ }
23
+ }
app/code/community/Monext/Payline/Model/Total/Nx/Quote.php CHANGED
@@ -1,87 +1,87 @@
1
- <?php
2
-
3
- class Monext_Payline_Model_Total_Nx_Quote extends Mage_Sales_Model_Quote_Address_Total_Abstract
4
- {
5
- public function __construct()
6
- {
7
- $this->setCode('payline_nx');
8
- }
9
-
10
- /**
11
- * Get label
12
- *
13
- * @return string
14
- */
15
- public function getLabel()
16
- {
17
- return Mage::helper('payline')->__('Payline fees');
18
- }
19
-
20
- /**
21
- * Collect totals information
22
- *
23
- * @param Mage_Sales_Model_Quote_Address $address
24
- */
25
- public function collect(Mage_Sales_Model_Quote_Address $address)
26
- {
27
- parent::collect($address);
28
-
29
- $applyCosts = (int)Mage::getStoreConfig('payment/PaylineNX/cost_type');
30
- if(!$applyCosts) {
31
- return $this;
32
- }
33
-
34
- if (($address->getAddressType() == 'billing')) { // we collect fee for only one address
35
- return $this;
36
- }
37
-
38
- $quote = $address->getQuote();
39
- if($quote) {
40
- $payment = $quote->getPayment();
41
- if($payment && ($payment->getMethod() == 'PaylineNX')) {
42
- $fee = Mage::getModel('payline/fees')->getCollection()
43
- ->addFieldtoFilter('quote_id',$quote->getId())->getFirstItem();
44
- if($fee->getId()) {
45
- $this->_addAmount($fee->getAmount());
46
- $this->_addBaseAmount($fee->getBaseAmount());
47
- }
48
- }
49
- }
50
-
51
- return $this;
52
- }
53
-
54
- /**
55
- * Add fees to address object
56
- *
57
- * @param Mage_Sales_Model_Quote_Address $address
58
- */
59
- public function fetch(Mage_Sales_Model_Quote_Address $address)
60
- {
61
- $applyCosts = (int)Mage::getStoreConfig('payment/PaylineNX/cost_type');
62
- if(!$applyCosts) {
63
- return $this;
64
- }
65
-
66
- if (($address->getAddressType() == 'billing')) { // we collect fee for only one address
67
- $quote = $address->getQuote();
68
- if($quote) {
69
- $payment = $quote->getPayment();
70
- if($payment && ($payment->getMethod() == 'PaylineNX')) {
71
- $fee = Mage::getModel('payline/fees')->getCollection()
72
- ->addFieldtoFilter('quote_id',$quote->getId())->getFirstItem();
73
- if($fee->getId()) {
74
- $address->addTotal(array(
75
- 'code' => $this->getCode(),
76
- 'title' => $this->getLabel(),
77
- 'value' => $fee->getAmount()
78
- ));
79
- }
80
- }
81
- }
82
- }
83
-
84
- return $this;
85
- }
86
- }
87
-
1
+ <?php
2
+
3
+ class Monext_Payline_Model_Total_Nx_Quote extends Mage_Sales_Model_Quote_Address_Total_Abstract
4
+ {
5
+ public function __construct()
6
+ {
7
+ $this->setCode('payline_nx');
8
+ }
9
+
10
+ /**
11
+ * Get label
12
+ *
13
+ * @return string
14
+ */
15
+ public function getLabel()
16
+ {
17
+ return Mage::helper('payline')->__('Payline fees');
18
+ }
19
+
20
+ /**
21
+ * Collect totals information
22
+ *
23
+ * @param Mage_Sales_Model_Quote_Address $address
24
+ */
25
+ public function collect(Mage_Sales_Model_Quote_Address $address)
26
+ {
27
+ parent::collect($address);
28
+
29
+ $applyCosts = (int)Mage::getStoreConfig('payment/PaylineNX/cost_type');
30
+ if(!$applyCosts) {
31
+ return $this;
32
+ }
33
+
34
+ if (($address->getAddressType() == 'billing')) { // we collect fee for only one address
35
+ return $this;
36
+ }
37
+
38
+ $quote = $address->getQuote();
39
+ if($quote) {
40
+ $payment = $quote->getPayment();
41
+ if($payment && ($payment->getMethod() == 'PaylineNX')) {
42
+ $fee = Mage::getModel('payline/fees')->getCollection()
43
+ ->addFieldtoFilter('quote_id',$quote->getId())->getFirstItem();
44
+ if($fee->getId()) {
45
+ $this->_addAmount($fee->getAmount());
46
+ $this->_addBaseAmount($fee->getBaseAmount());
47
+ }
48
+ }
49
+ }
50
+
51
+ return $this;
52
+ }
53
+
54
+ /**
55
+ * Add fees to address object
56
+ *
57
+ * @param Mage_Sales_Model_Quote_Address $address
58
+ */
59
+ public function fetch(Mage_Sales_Model_Quote_Address $address)
60
+ {
61
+ $applyCosts = (int)Mage::getStoreConfig('payment/PaylineNX/cost_type');
62
+ if(!$applyCosts) {
63
+ return $this;
64
+ }
65
+
66
+ if (($address->getAddressType() == 'billing')) { // we collect fee for only one address
67
+ $quote = $address->getQuote();
68
+ if($quote) {
69
+ $payment = $quote->getPayment();
70
+ if($payment && ($payment->getMethod() == 'PaylineNX')) {
71
+ $fee = Mage::getModel('payline/fees')->getCollection()
72
+ ->addFieldtoFilter('quote_id',$quote->getId())->getFirstItem();
73
+ if($fee->getId()) {
74
+ $address->addTotal(array(
75
+ 'code' => $this->getCode(),
76
+ 'title' => $this->getLabel(),
77
+ 'value' => $fee->getAmount()
78
+ ));
79
+ }
80
+ }
81
+ }
82
+ }
83
+
84
+ return $this;
85
+ }
86
+ }
87
+
app/code/community/Monext/Payline/Model/Wallet.php CHANGED
@@ -1,243 +1,243 @@
1
- <?php
2
- /**
3
- * Payline Wallet payment method, or pay in 1 click
4
- */
5
- class Monext_Payline_Model_Wallet extends Mage_Payment_Model_Method_Abstract
6
- {
7
- protected $_code = 'PaylineWALLET';
8
- protected $_formBlockType = 'payline/wallet';
9
- protected $_infoBlockType = 'payline/wallet_infos';
10
- protected $_isInitializeNeeded = true;
11
- protected $_canUseInternal = false;
12
- protected $_canUseForMultishipping = false;
13
- protected $_canRefund = true;
14
- protected $_canRefundInvoicePartial = true;
15
- protected $_canCapture = true;
16
- protected $_canCapturePartial = true;
17
- protected $_canVoid = true;
18
-
19
- protected $_walletData;
20
-
21
- /**
22
- * Return Order place redirect url
23
- *
24
- * @return string
25
- */
26
- public function getOrderPlaceRedirectUrl()
27
- {
28
- return Mage::getUrl('payline/index/wallet');
29
- }
30
-
31
- /**
32
- * Retrieve the expiration date of the saved credit card
33
- * @return string
34
- */
35
- public function getExpirationDate(){
36
- $wallet=$this->getWalletData();
37
- if (isset($wallet['card']) && isset($wallet['card']['expirationDate'])){
38
- $exp=$wallet['card']['expirationDate'];
39
- return $exp;
40
- }else{
41
- Mage::helper('payline/logger')->log('[getExpirationDate] Error while retrieving wallet for expiration date');
42
- }
43
- }
44
-
45
- /**
46
- * Check if the saved credit card expiration date is OK
47
- * @return bool
48
- */
49
- public function checkExpirationDate()
50
- {
51
- if (Mage::getSingleton('customer/session')->getCustomer()->getWalletId()) {
52
- $exp = $this->getExpirationDate();
53
- $date_exp=substr($exp, 2).substr($exp,0,2);
54
- if (date('ym')<=$date_exp){
55
- return true;
56
- }else{
57
- return false;
58
- }
59
- } else {
60
- return false;
61
- }
62
- }
63
-
64
- /**
65
- * Check whether payment method can be used
66
- * Rewrited from Abstract class
67
- * TODO: payment method instance is not supposed to know about quote
68
- * @param Mage_Sales_Model_Quote
69
- * @return bool
70
- */
71
- public function isAvailable($quote = null){
72
- // if cart amount is null, this payment method is not shown on front
73
- if(!is_null($quote) && Mage::app()->getStore()->roundPrice($quote->getGrandTotal()) == 0){
74
- return false;
75
- }
76
- $checkResult = new StdClass;
77
- $checkResult->isAvailable=false;
78
- $customerSession = Mage::getSingleton('customer/session');
79
- if ($customerSession->isLoggedIn()) {
80
- if ($customerSession->getCustomer()->getWalletId()) {
81
- $checkResult->isAvailable=true;
82
- }
83
- }
84
- $checkResult->isAvailable=$this->checkExpirationDate();
85
- $checkResult->isAvailable = (
86
- $checkResult->isAvailable &&
87
- $this->getConfigData('active', ($quote ? $quote->getStoreId() : null))
88
- );
89
-
90
- // On Magento Pro 1.8, reward module is broken without quote. Let's provide it...
91
- if (!$quote)
92
- $quote=Mage::getSingleton('checkout/type_onepage')->getQuote();
93
- Mage::dispatchEvent('payment_method_is_active', array(
94
- 'result' => $checkResult,
95
- 'method_instance' => $this,
96
- 'quote' => $quote,
97
- ));
98
-
99
- // disable method if it cannot implement recurring profiles management and there are recurring items in quote
100
- if ($checkResult->isAvailable) {
101
- //This is not implemented on Magenot 1.3
102
- if (method_exists($this,'canManageRecurringProfiles')){
103
- $implementsRecurring = $this->canManageRecurringProfiles();
104
- // the $quote->hasRecurringItems() causes big performance impact, thus it has to be called last
105
- if ($quote && (!$implementsRecurring) && $quote->hasRecurringItems()) {
106
- $checkResult->isAvailable = false;
107
- }
108
- }
109
- }
110
- return $checkResult->isAvailable;
111
- }
112
-
113
- public function getWalletData(){
114
-
115
- $customerSession=Mage::getSingleton('customer/session');
116
- if ($customerSession->hasWalletData()) {
117
- $this->_walletData = $customerSession->getWalletData();
118
- }
119
-
120
- if ($customerSession->isLoggedIn()){
121
- $customer=$customerSession->getCustomer();
122
- $walletId=$customer->getWalletId();
123
- }
124
-
125
- if (!isset($walletId) || empty($walletId)){
126
- $this->_walletData = false;
127
- }
128
-
129
- if (is_null($this->_walletData)) {
130
- /* @var $paylineSDK PaylineSDK */
131
- $helperPayline = Mage::helper('payline');
132
- $paylineSDK = $helperPayline->initPayline('WALLET');
133
- $walletContractNumber = $customer->getWalletContractNumber();
134
- if (! $walletContractNumber) {
135
- $walletContractNumber = $helperPayline->contractNumber;
136
- }
137
- $array = array(
138
- 'walletId' => $walletId,
139
- 'cardInd' => '',
140
- 'contractNumber' => $walletContractNumber,
141
- 'version' => Monext_Payline_Helper_Data::VERSION);
142
-
143
- try {
144
- $res = $paylineSDK->getWallet($array);
145
- } catch (Exception $e) {
146
- $msgLog = 'Unknown PAYLINE ERROR on getWallet for wallet ' . $walletId . ' (Payline unreachable?)';
147
- $msg = Mage::helper('payline')->__('Error while retrieving wallet information');
148
- Mage::helper('payline/logger')->log('[getWalletData] ' . $msgLog);
149
- Mage::getSingleton('customer/session')->addError($msg);
150
- $this->_walletData = false;
151
- }
152
- if (is_string($res) or ! isset($res['result']) || $res['result']['code'] != '02500') {
153
- $this->_walletData = false;
154
- if (is_string($res)) {
155
- $msgLog = 'PAYLINE ERROR on getWallet: ' . $res;
156
- } elseif (isset($res['result'])) {
157
- $msgLog = 'PAYLINE ERROR on getWallet: ' . $res['result']['code'] . ' ' . $res['result']['longMessage'] . ' (wallet ' . $walletId . ')';
158
- } else {
159
- $msgLog = 'Unknown PAYLINE ERROR on getWallet for wallet ' . $walletId;
160
- }
161
- $msg = Mage::helper('payline')->__('Error while retrieving wallet information');
162
- Mage::helper('payline/logger')->log('[getWalletData] ' . $msgLog);
163
- Mage::getSingleton('customer/session')->addError($msg);
164
- } else {
165
- $this->_walletData = $res['wallet'];
166
- }
167
- }
168
- $customerSession->setWalletData($this->_walletData);
169
- return $this->_walletData;
170
- }
171
-
172
- /**
173
- * Clean the session and all necessary data
174
- * @return Monext_Payline_Model_Wallet
175
- */
176
- public function clean()
177
- {
178
- // Clean wallet in customer session
179
- Mage::getSingleton('customer/session')->unsWalletData();
180
- }
181
-
182
- /**
183
- * Generate a random wallet_id
184
- * @param int $length
185
- * @return string
186
- */
187
- public function generateWalletId($length=10){
188
- $customer = Mage::getSingleton('customer/session')->getCustomer();
189
- $prefix = $customer->getId() ? $customer->getId() : "XXX"; // prefix start with current customer ID if set, XXX otherwise
190
- $prefix .= '_'.date('Ymd',time()); // current date (format YYYYMMDD) is added to the prefix
191
- $characters = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWZ";
192
- $customerData = array('1','1'); // fake data in order to enter while loop
193
- $walletId = "";
194
-
195
- while(sizeof($customerData) != 0){ // this loop make sure that generated wallet ID is not already used
196
- $string = '_';
197
- for ($p = 0; $p < $length; $p++) {
198
- $string .= $characters[mt_rand(0, strlen($characters)-1)];
199
- }
200
- $walletId = $prefix.$string;
201
- $customerModel = Mage::getModel('customer/customer')->getCollection()->addFieldToFilter('wallet_id',$walletId); // search for a cistomer having this wallet ID
202
- $customerData = $customerModel->getFirstItem()->getData();
203
- }
204
-
205
- return $walletId;
206
- }
207
-
208
- /**
209
- * Capture payment
210
- *
211
- * @param Varien_Object $orderPayment
212
- * @return Monext_Payline_Model_Cpt
213
- */
214
- public function capture(Varien_Object $payment, $amount)
215
- {
216
- Mage::getModel('payline/cpt')->capture($payment,$amount, 'WALLET');
217
- return $this;
218
- }
219
-
220
- /**
221
- * Refund money
222
- *
223
- * @param Varien_Object $invoicePayment
224
- * @return Monext_Payline_Model_Cpt
225
- */
226
- public function refund(Varien_Object $payment, $amount)
227
- {
228
- Mage::getModel('payline/cpt')->refund($payment,$amount, 'WALLET');
229
- return $this;
230
- }
231
-
232
- /**
233
- * Cancel payment
234
- *
235
- * @param Varien_Object $payment
236
- * @return Monext_Payline_Model_Cpt
237
- */
238
- public function void(Varien_Object $payment)
239
- {
240
- Mage::getModel('payline/cpt')->void($payment, 'WALLET');
241
- return $this;
242
- }
243
  }
1
+ <?php
2
+ /**
3
+ * Payline Wallet payment method, or pay in 1 click
4
+ */
5
+ class Monext_Payline_Model_Wallet extends Mage_Payment_Model_Method_Abstract
6
+ {
7
+ protected $_code = 'PaylineWALLET';
8
+ protected $_formBlockType = 'payline/wallet';
9
+ protected $_infoBlockType = 'payline/wallet_infos';
10
+ protected $_isInitializeNeeded = true;
11
+ protected $_canUseInternal = false;
12
+ protected $_canUseForMultishipping = false;
13
+ protected $_canRefund = true;
14
+ protected $_canRefundInvoicePartial = true;
15
+ protected $_canCapture = true;
16
+ protected $_canCapturePartial = true;
17
+ protected $_canVoid = true;
18
+
19
+ protected $_walletData;
20
+
21
+ /**
22
+ * Return Order place redirect url
23
+ *
24
+ * @return string
25
+ */
26
+ public function getOrderPlaceRedirectUrl()
27
+ {
28
+ return Mage::getUrl('payline/index/wallet');
29
+ }
30
+
31
+ /**
32
+ * Retrieve the expiration date of the saved credit card
33
+ * @return string
34
+ */
35
+ public function getExpirationDate(){
36
+ $wallet=$this->getWalletData();
37
+ if (isset($wallet['card']) && isset($wallet['card']['expirationDate'])){
38
+ $exp=$wallet['card']['expirationDate'];
39
+ return $exp;
40
+ }else{
41
+ Mage::helper('payline/logger')->log('[getExpirationDate] Error while retrieving wallet for expiration date');
42
+ }
43
+ }
44
+
45
+ /**
46
+ * Check if the saved credit card expiration date is OK
47
+ * @return bool
48
+ */
49
+ public function checkExpirationDate()
50
+ {
51
+ if (Mage::getSingleton('customer/session')->getCustomer()->getWalletId()) {
52
+ $exp = $this->getExpirationDate();
53
+ $date_exp=substr($exp, 2).substr($exp,0,2);
54
+ if (date('ym')<=$date_exp){
55
+ return true;
56
+ }else{
57
+ return false;
58
+ }
59
+ } else {
60
+ return false;
61
+ }
62
+ }
63
+
64
+ /**
65
+ * Check whether payment method can be used
66
+ * Rewrited from Abstract class
67
+ * TODO: payment method instance is not supposed to know about quote
68
+ * @param Mage_Sales_Model_Quote
69
+ * @return bool
70
+ */
71
+ public function isAvailable($quote = null){
72
+ // if cart amount is null, this payment method is not shown on front
73
+ if(!is_null($quote) && Mage::app()->getStore()->roundPrice($quote->getGrandTotal()) == 0){
74
+ return false;
75
+ }
76
+ $checkResult = new StdClass;
77
+ $checkResult->isAvailable=false;
78
+ $customerSession = Mage::getSingleton('customer/session');
79
+ if ($customerSession->isLoggedIn()) {
80
+ if ($customerSession->getCustomer()->getWalletId()) {
81
+ $checkResult->isAvailable=true;
82
+ }
83
+ }
84
+ $checkResult->isAvailable=$this->checkExpirationDate();
85
+ $checkResult->isAvailable = (
86
+ $checkResult->isAvailable &&
87
+ $this->getConfigData('active', ($quote ? $quote->getStoreId() : null))
88
+ );
89
+
90
+ // On Magento Pro 1.8, reward module is broken without quote. Let's provide it...
91
+ if (!$quote)
92
+ $quote=Mage::getSingleton('checkout/type_onepage')->getQuote();
93
+ Mage::dispatchEvent('payment_method_is_active', array(
94
+ 'result' => $checkResult,
95
+ 'method_instance' => $this,
96
+ 'quote' => $quote,
97
+ ));
98
+
99
+ // disable method if it cannot implement recurring profiles management and there are recurring items in quote
100
+ if ($checkResult->isAvailable) {
101
+ //This is not implemented on Magenot 1.3
102
+ if (method_exists($this,'canManageRecurringProfiles')){
103
+ $implementsRecurring = $this->canManageRecurringProfiles();
104
+ // the $quote->hasRecurringItems() causes big performance impact, thus it has to be called last
105
+ if ($quote && (!$implementsRecurring) && $quote->hasRecurringItems()) {
106
+ $checkResult->isAvailable = false;
107
+ }
108
+ }
109
+ }
110
+ return $checkResult->isAvailable;
111
+ }
112
+
113
+ public function getWalletData(){
114
+
115
+ $customerSession=Mage::getSingleton('customer/session');
116
+ if ($customerSession->hasWalletData()) {
117
+ $this->_walletData = $customerSession->getWalletData();
118
+ }
119
+
120
+ if ($customerSession->isLoggedIn()){
121
+ $customer=$customerSession->getCustomer();
122
+ $walletId=$customer->getWalletId();
123
+ }
124
+
125
+ if (!isset($walletId) || empty($walletId)){
126
+ $this->_walletData = false;
127
+ }
128
+
129
+ if (is_null($this->_walletData)) {
130
+ /* @var $paylineSDK PaylineSDK */
131
+ $helperPayline = Mage::helper('payline');
132
+ $paylineSDK = $helperPayline->initPayline('WALLET');
133
+ $walletContractNumber = $customer->getWalletContractNumber();
134
+ if (! $walletContractNumber) {
135
+ $walletContractNumber = $helperPayline->contractNumber;
136
+ }
137
+ $array = array(
138
+ 'walletId' => $walletId,
139
+ 'cardInd' => '',
140
+ 'contractNumber' => $walletContractNumber,
141
+ 'version' => Monext_Payline_Helper_Data::VERSION);
142
+
143
+ try {
144
+ $res = $paylineSDK->getWallet($array);
145
+ } catch (Exception $e) {
146
+ $msgLog = 'Unknown PAYLINE ERROR on getWallet for wallet ' . $walletId . ' (Payline unreachable?)';
147
+ $msg = Mage::helper('payline')->__('Error while retrieving wallet information');
148
+ Mage::helper('payline/logger')->log('[getWalletData] ' . $msgLog);
149
+ Mage::getSingleton('customer/session')->addError($msg);
150
+ $this->_walletData = false;
151
+ }
152
+ if (is_string($res) or ! isset($res['result']) || $res['result']['code'] != '02500') {
153
+ $this->_walletData = false;
154
+ if (is_string($res)) {
155
+ $msgLog = 'PAYLINE ERROR on getWallet: ' . $res;
156
+ } elseif (isset($res['result'])) {
157
+ $msgLog = 'PAYLINE ERROR on getWallet: ' . $res['result']['code'] . ' ' . $res['result']['longMessage'] . ' (wallet ' . $walletId . ')';
158
+ } else {
159
+ $msgLog = 'Unknown PAYLINE ERROR on getWallet for wallet ' . $walletId;
160
+ }
161
+ $msg = Mage::helper('payline')->__('Error while retrieving wallet information');
162
+ Mage::helper('payline/logger')->log('[getWalletData] ' . $msgLog);
163
+ Mage::getSingleton('customer/session')->addError($msg);
164
+ } else {
165
+ $this->_walletData = $res['wallet'];
166
+ }
167
+ }
168
+ $customerSession->setWalletData($this->_walletData);
169
+ return $this->_walletData;
170
+ }
171
+
172
+ /**
173
+ * Clean the session and all necessary data
174
+ * @return Monext_Payline_Model_Wallet
175
+ */
176
+ public function clean()
177
+ {
178
+ // Clean wallet in customer session
179
+ Mage::getSingleton('customer/session')->unsWalletData();
180
+ }
181
+
182
+ /**
183
+ * Generate a random wallet_id
184
+ * @param int $length
185
+ * @return string
186
+ */
187
+ public function generateWalletId($length=10){
188
+ $customer = Mage::getSingleton('customer/session')->getCustomer();
189
+ $prefix = $customer->getId() ? $customer->getId() : "XXX"; // prefix start with current customer ID if set, XXX otherwise
190
+ $prefix .= '_'.date('Ymd',time()); // current date (format YYYYMMDD) is added to the prefix
191
+ $characters = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWZ";
192
+ $customerData = array('1','1'); // fake data in order to enter while loop
193
+ $walletId = "";
194
+
195
+ while(sizeof($customerData) != 0){ // this loop make sure that generated wallet ID is not already used
196
+ $string = '_';
197
+ for ($p = 0; $p < $length; $p++) {
198
+ $string .= $characters[mt_rand(0, strlen($characters)-1)];
199
+ }
200
+ $walletId = $prefix.$string;
201
+ $customerModel = Mage::getModel('customer/customer')->getCollection()->addFieldToFilter('wallet_id',$walletId); // search for a cistomer having this wallet ID
202
+ $customerData = $customerModel->getFirstItem()->getData();
203
+ }
204
+
205
+ return $walletId;
206
+ }
207
+
208
+ /**
209
+ * Capture payment
210
+ *
211
+ * @param Varien_Object $orderPayment
212
+ * @return Monext_Payline_Model_Cpt
213
+ */
214
+ public function capture(Varien_Object $payment, $amount)
215
+ {
216
+ Mage::getModel('payline/cpt')->capture($payment,$amount, 'WALLET');
217
+ return $this;
218
+ }
219
+
220
+ /**
221
+ * Refund money
222
+ *
223
+ * @param Varien_Object $invoicePayment
224
+ * @return Monext_Payline_Model_Cpt
225
+ */
226
+ public function refund(Varien_Object $payment, $amount)
227
+ {
228
+ Mage::getModel('payline/cpt')->refund($payment,$amount, 'WALLET');
229
+ return $this;
230
+ }
231
+
232
+ /**
233
+ * Cancel payment
234
+ *
235
+ * @param Varien_Object $payment
236
+ * @return Monext_Payline_Model_Cpt
237
+ */
238
+ public function void(Varien_Object $payment)
239
+ {
240
+ Mage::getModel('payline/cpt')->void($payment, 'WALLET');
241
+ return $this;
242
+ }
243
  }
app/code/community/Monext/Payline/controllers/Adminhtml/Payline/ManagecontractsController.php CHANGED
@@ -1,261 +1,261 @@
1
- <?php
2
-
3
- /**
4
- * This controller manage primary and secondary payline contracts in back office
5
- */
6
- class Monext_Payline_Adminhtml_Payline_ManagecontractsController extends Mage_Adminhtml_Controller_Action
7
- {
8
-
9
- public function indexAction()
10
- {
11
- $this->_title($this->__('Manage Payline Contracts'));
12
- $this->loadLayout();
13
- $this->_setActiveMenu('system');
14
- $this->renderLayout();
15
- }
16
-
17
- public function importFromConfigAction()
18
- {
19
- return $this->_importContract('adminhtml/system_config/edit/section/payline');
20
- }
21
-
22
  public function importAction()
23
- {
24
- return $this->_importContract('*/*');
25
- }
26
-
27
-
28
- protected function _importContract($utlPath='*/*')
29
- {
30
- $updatedAt = new Zend_Date();
31
- $updatedAt = $updatedAt->toString(Varien_Date::DATETIME_INTERNAL_FORMAT);
32
-
33
- $paylineSDK = Mage::helper('payline')->initPayline('CPT');
34
-
35
-
36
- try {
37
- $result = $paylineSDK->getMerchantSettings(array('version' => Monext_Payline_Helper_Data::VERSION));
38
- } catch (Exception $e) {
39
- Mage::logException($e);
40
- $msg = Mage::helper('payline')->__('Error during import');
41
- Mage::getSingleton('adminhtml/session')->addError($msg);
42
- $msgLog = 'Unknown PAYLINE ERROR (payline unreachable?)';
43
- Mage::helper('payline/logger')->log('[importAction] ' . $this->order->getIncrementId() . $msgLog);
44
- $this->_redirect($utlPath);
45
- return;
46
- }
47
-
48
- if (is_string($result)) { //error message from web service
49
- $msgError = $result;
50
  if (stristr('Authorization Required', $result)) {
51
  $msgError .= '. ' . Mage::helper('payline')->__('Please check your authentication params (merchant Id / access key / environment) in System > Configuration');
52
- } elseif (stristr('could not connect to host', $result)) {
53
- $msgError .= '. ' . Mage::helper('payline')->__('Please check your proxy params (Proxy host / port / login / password) in System > Configuration');
54
- }
55
-
56
- Mage::getSingleton('adminhtml/session')->addError($msgError);
57
- Mage::helper('payline/logger')->log('[importAction] ' . $result);
58
- } elseif (isset($result['listPointOfSell']['pointOfSell'])) {
59
- $nbContracts = Mage::getModel('payline/contract')->getCollection()->getSize();
60
- $first = true;
61
- $listPointOfSell = array();
62
- $listPointOfSell = $result['listPointOfSell']['pointOfSell'];
63
- foreach ($listPointOfSell as $key => $pointOfSell) {
64
- if (is_object($pointOfSell)) {
65
- $contracts = $pointOfSell->contracts->contract;
66
- $pointOfSellLabel = $pointOfSell->label;
67
- } else { //if only one point of sell, we parse an array
68
- if ($key == 'contracts') {
69
- $contracts = $pointOfSell['contract'];
70
- } elseif ($key == 'label') {
71
- $pointOfSellLabel = $pointOfSell;
72
- continue;
73
- } else {
74
- continue;
75
- }
76
- }
77
-
78
- if (!is_array($contracts)) {
79
- $contracts = array($contracts);
80
- }
81
-
82
- if (is_array($contracts) && isset($contracts['contractNumber'])) {
83
- $contracts = array((object) $contracts);
84
- }
85
-
86
- foreach ($contracts as $contract) {
87
- $myContract = Mage::getModel('payline/contract')
88
- ->getCollection()
89
- ->addFieldToFilter('number', $contract->contractNumber)
90
- ->getFirstItem();
91
-
92
- if ($myContract->getId()) { //contract exists, update
93
- $myContract->setName($contract->label)
94
- ->setPointOfSell($pointOfSellLabel)
95
- ->setContractDate($updatedAt)
96
- ->setContractType($contract->cardType)
97
- ->save();
98
- } else {
99
- $new_contract = Mage::getModel('payline/contract')
100
- ->setName($contract->label)
101
- ->setNumber($contract->contractNumber)
102
- ->setPointOfSell($pointOfSellLabel)
103
- ->setContractType($contract->cardType)
104
- ->setContractDate($updatedAt);
105
-
106
- if ($first && !$nbContracts) { //force to have a primary contract
107
- $new_contract->setIsPrimary(1);
108
- $first = false;
109
- }
110
-
111
- $new_contract->save();
112
- }
113
- }
114
- }
115
-
116
- //delete contracts not updated
117
- $toDelete = Mage::getModel('payline/contract')->getCollection()
118
- ->addFieldToFilter('contract_date', array('neq' => $updatedAt));
119
- foreach ($toDelete as $contract) {
120
- $contract->delete();
121
- }
122
-
123
- Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('payline')->__('Contracts imported successfully. Don\'t forget to define primary and secondary contracts!'));
124
- } else {
125
-
126
- $msgError = 'Unknown error occured while importing contract';
127
- if (!empty($result['result']['longMessage'])) {
128
- $msgError .= ' ('.$result['result']['longMessage'].')';
129
- } elseif (!empty($result['result']['code'])) {
130
- $msgError .= ' (code: '.$result['result']['code'].')';
131
- }
132
 
133
  Mage::getSingleton('adminhtml/session')->addError($msgError);
134
  Mage::helper('payline/logger')->log('[importAction] ' . $msgError);
135
-
136
- }
137
- $this->_redirect($utlPath);
138
- }
139
-
140
- /**
141
- * can't create new contract, forward to edit action
142
- */
143
- public function newAction()
144
- {
145
- $this->_forward('edit');
146
- }
147
-
148
- public function saveAction()
149
- {
150
- if ($this->getRequest()->getPost()) {
151
- try {
152
- $postData = $this->getRequest()->getPost();
153
-
154
- // Update existing contract
155
- if (array_key_exists('id', $postData)) {
156
- $contract = Mage::getModel('payline/contract')->load($postData['id']);
157
-
158
- $is_primary = (isset($postData['is_primary']) ? $postData['is_primary'] : 0);
159
- $is_secondary = (isset($postData['is_secondary']) ? $postData['is_secondary'] : 0);
160
- $is_secure = (isset($postData['is_secure']) ? $postData['is_secure'] : 0);
161
-
162
- $count = Mage::getModel('payline/contract')->getCollection()
163
- ->addFieldToFilter('is_primary', 1)
164
- ->addFieldToFilter('id', array('neq' => $contract->getId()))
165
- ->getSize();
166
- //at least one contract must be primary
167
- if (!$is_primary && !$count) {
168
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('payline')->__('At leat one contract must be primary'));
169
- $this->_redirect('*/*');
170
- return;
171
- }
172
-
173
- //primary and secondary contracts must ne defined in only one point of sell
174
- //because it's impossible to send to webservice contracts that are not in the same point of sell
175
- //Mage::getResourceModel('payline/contract')->removePrimaryAndSecondaryNotIn($contract->getPointOfSell());
176
-
177
- $contract->setIsPrimary($is_primary)
178
- ->setIsSecondary($is_secondary)
179
- ->setIsSecure($is_secure)
180
- ->save();
181
- Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('payline')->__('Contract saved successfully'));
182
- }
183
- } catch (Exception $e) {
184
- Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
185
- $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
186
- return;
187
- }
188
- }
189
-
190
- $this->_redirect('*/*/');
191
- }
192
-
193
- public function editAction()
194
- {
195
- $contract = Mage::getModel('payline/contract')->load($this->getRequest()->getParam('id', false));
196
-
197
- //checks if the item has been loaded correctly
198
- if (!$contract->getId()) {
199
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('payline')->__("Required contract does not exist"));
200
- $this->_redirect('*/*/index');
201
- return;
202
- }
203
-
204
- // Register model to use later in blocks
205
- Mage::register('current_contract', $contract);
206
-
207
- $this->loadLayout();
208
- $this->renderLayout();
209
- }
210
-
211
- public function massStatusAction()
212
- {
213
- $contractIds = (array) $this->getRequest()->getParam('contract');
214
- $status = (int) $this->getRequest()->getParam('status');
215
- $store = $this->getRequest()->getParam('store', 0);
216
- $website = $this->getRequest()->getParam('website', 0);
217
-
218
- Mage::getResourceModel('payline/contract_status')->updateContractStatus($contractIds, $status, $website, $store);
219
-
220
- $this->_redirect('*/*/', array('website' => $website, 'store' => $store));
221
- }
222
-
223
-
224
- public function massWalletAction()
225
- {
226
- $contractIds = (array) $this->getRequest()->getParam('contract');
227
- $subscribe = (int) $this->getRequest()->getParam('walletList');
228
- $store = $this->getRequest()->getParam('store', 0);
229
- $website = $this->getRequest()->getParam('website', 0);
230
-
231
- Mage::getResourceModel('payline/contract')->updateContractWalletList(
232
- $contractIds, $subscribe, $website, $store
233
- );
234
-
235
- $this->_redirect('*/*/', array('website' => $website, 'store' => $store));
236
- }
237
-
238
 
239
  public function massSecureAction()
240
  {
241
  $contractIds = (array) $this->getRequest()->getParam('contract');
242
  $secure = (int) $this->getRequest()->getParam('setSecure');
243
  $store = $this->getRequest()->getParam('store', 0);
244
- $website = $this->getRequest()->getParam('website', 0);
245
-
246
  Mage::getResourceModel('payline/contract')->updateContractSecureList(
247
  $contractIds, $secure, $website, $store
248
  );
249
 
250
  $this->_redirect('*/*/', array('website' => $website, 'store' => $store));
251
- }
252
- /**
253
- * contracts grid for AJAX request
254
- */
255
- public function gridAction()
256
- {
257
- $this->loadLayout();
258
- $this->renderLayout();
259
- }
260
-
261
- }
1
+ <?php
2
+
3
+ /**
4
+ * This controller manage primary and secondary payline contracts in back office
5
+ */
6
+ class Monext_Payline_Adminhtml_Payline_ManagecontractsController extends Mage_Adminhtml_Controller_Action
7
+ {
8
+
9
+ public function indexAction()
10
+ {
11
+ $this->_title($this->__('Manage Payline Contracts'));
12
+ $this->loadLayout();
13
+ $this->_setActiveMenu('system');
14
+ $this->renderLayout();
15
+ }
16
+
17
+ public function importFromConfigAction()
18
+ {
19
+ return $this->_importContract('adminhtml/system_config/edit/section/payline');
20
+ }
21
+
22
  public function importAction()
23
+ {
24
+ return $this->_importContract('*/*');
25
+ }
26
+
27
+
28
+ protected function _importContract($utlPath='*/*')
29
+ {
30
+ $updatedAt = new Zend_Date();
31
+ $updatedAt = $updatedAt->toString(Varien_Date::DATETIME_INTERNAL_FORMAT);
32
+
33
+ $paylineSDK = Mage::helper('payline')->initPayline('CPT');
34
+
35
+
36
+ try {
37
+ $result = $paylineSDK->getMerchantSettings(array('version' => Monext_Payline_Helper_Data::VERSION));
38
+ } catch (Exception $e) {
39
+ Mage::logException($e);
40
+ $msg = Mage::helper('payline')->__('Error during import');
41
+ Mage::getSingleton('adminhtml/session')->addError($msg);
42
+ $msgLog = 'Unknown PAYLINE ERROR (payline unreachable?)';
43
+ Mage::helper('payline/logger')->log('[importAction] ' . $this->order->getIncrementId() . $msgLog);
44
+ $this->_redirect($utlPath);
45
+ return;
46
+ }
47
+
48
+ if (is_string($result)) { //error message from web service
49
+ $msgError = $result;
50
  if (stristr('Authorization Required', $result)) {
51
  $msgError .= '. ' . Mage::helper('payline')->__('Please check your authentication params (merchant Id / access key / environment) in System > Configuration');
52
+ } elseif (stristr('could not connect to host', $result)) {
53
+ $msgError .= '. ' . Mage::helper('payline')->__('Please check your proxy params (Proxy host / port / login / password) in System > Configuration');
54
+ }
55
+
56
+ Mage::getSingleton('adminhtml/session')->addError($msgError);
57
+ Mage::helper('payline/logger')->log('[importAction] ' . $result);
58
+ } elseif (isset($result['listPointOfSell']['pointOfSell'])) {
59
+ $nbContracts = Mage::getModel('payline/contract')->getCollection()->getSize();
60
+ $first = true;
61
+ $listPointOfSell = array();
62
+ $listPointOfSell = $result['listPointOfSell']['pointOfSell'];
63
+ foreach ($listPointOfSell as $key => $pointOfSell) {
64
+ if (is_object($pointOfSell)) {
65
+ $contracts = $pointOfSell->contracts->contract;
66
+ $pointOfSellLabel = $pointOfSell->label;
67
+ } else { //if only one point of sell, we parse an array
68
+ if ($key == 'contracts') {
69
+ $contracts = $pointOfSell['contract'];
70
+ } elseif ($key == 'label') {
71
+ $pointOfSellLabel = $pointOfSell;
72
+ continue;
73
+ } else {
74
+ continue;
75
+ }
76
+ }
77
+
78
+ if (!is_array($contracts)) {
79
+ $contracts = array($contracts);
80
+ }
81
+
82
+ if (is_array($contracts) && isset($contracts['contractNumber'])) {
83
+ $contracts = array((object) $contracts);
84
+ }
85
+
86
+ foreach ($contracts as $contract) {
87
+ $myContract = Mage::getModel('payline/contract')
88
+ ->getCollection()
89
+ ->addFieldToFilter('number', $contract->contractNumber)
90
+ ->getFirstItem();
91
+
92
+ if ($myContract->getId()) { //contract exists, update
93
+ $myContract->setName($contract->label)
94
+ ->setPointOfSell($pointOfSellLabel)
95
+ ->setContractDate($updatedAt)
96
+ ->setContractType($contract->cardType)
97
+ ->save();
98
+ } else {
99
+ $new_contract = Mage::getModel('payline/contract')
100
+ ->setName($contract->label)
101
+ ->setNumber($contract->contractNumber)
102
+ ->setPointOfSell($pointOfSellLabel)
103
+ ->setContractType($contract->cardType)
104
+ ->setContractDate($updatedAt);
105
+
106
+ if ($first && !$nbContracts) { //force to have a primary contract
107
+ $new_contract->setIsPrimary(1);
108
+ $first = false;
109
+ }
110
+
111
+ $new_contract->save();
112
+ }
113
+ }
114
+ }
115
+
116
+ //delete contracts not updated
117
+ $toDelete = Mage::getModel('payline/contract')->getCollection()
118
+ ->addFieldToFilter('contract_date', array('neq' => $updatedAt));
119
+ foreach ($toDelete as $contract) {
120
+ $contract->delete();
121
+ }
122
+
123
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('payline')->__('Contracts imported successfully. Don\'t forget to define primary and secondary contracts!'));
124
+ } else {
125
+
126
+ $msgError = 'Unknown error occured while importing contract';
127
+ if (!empty($result['result']['longMessage'])) {
128
+ $msgError .= ' ('.$result['result']['longMessage'].')';
129
+ } elseif (!empty($result['result']['code'])) {
130
+ $msgError .= ' (code: '.$result['result']['code'].')';
131
+ }
132
 
133
  Mage::getSingleton('adminhtml/session')->addError($msgError);
134
  Mage::helper('payline/logger')->log('[importAction] ' . $msgError);
135
+
136
+ }
137
+ $this->_redirect($utlPath);
138
+ }
139
+
140
+ /**
141
+ * can't create new contract, forward to edit action
142
+ */
143
+ public function newAction()
144
+ {
145
+ $this->_forward('edit');
146
+ }
147
+
148
+ public function saveAction()
149
+ {
150
+ if ($this->getRequest()->getPost()) {
151
+ try {
152
+ $postData = $this->getRequest()->getPost();
153
+
154
+ // Update existing contract
155
+ if (array_key_exists('id', $postData)) {
156
+ $contract = Mage::getModel('payline/contract')->load($postData['id']);
157
+
158
+ $is_primary = (isset($postData['is_primary']) ? $postData['is_primary'] : 0);
159
+ $is_secondary = (isset($postData['is_secondary']) ? $postData['is_secondary'] : 0);
160
+ $is_secure = (isset($postData['is_secure']) ? $postData['is_secure'] : 0);
161
+
162
+ $count = Mage::getModel('payline/contract')->getCollection()
163
+ ->addFieldToFilter('is_primary', 1)
164
+ ->addFieldToFilter('id', array('neq' => $contract->getId()))
165
+ ->getSize();
166
+ //at least one contract must be primary
167
+ if (!$is_primary && !$count) {
168
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('payline')->__('At leat one contract must be primary'));
169
+ $this->_redirect('*/*');
170
+ return;
171
+ }
172
+
173
+ //primary and secondary contracts must ne defined in only one point of sell
174
+ //because it's impossible to send to webservice contracts that are not in the same point of sell
175
+ //Mage::getResourceModel('payline/contract')->removePrimaryAndSecondaryNotIn($contract->getPointOfSell());
176
+
177
+ $contract->setIsPrimary($is_primary)
178
+ ->setIsSecondary($is_secondary)
179
+ ->setIsSecure($is_secure)
180
+ ->save();
181
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('payline')->__('Contract saved successfully'));
182
+ }
183
+ } catch (Exception $e) {
184
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
185
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
186
+ return;
187
+ }
188
+ }
189
+
190
+ $this->_redirect('*/*/');
191
+ }
192
+
193
+ public function editAction()
194
+ {
195
+ $contract = Mage::getModel('payline/contract')->load($this->getRequest()->getParam('id', false));
196
+
197
+ //checks if the item has been loaded correctly
198
+ if (!$contract->getId()) {
199
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('payline')->__("Required contract does not exist"));
200
+ $this->_redirect('*/*/index');
201
+ return;
202
+ }
203
+
204
+ // Register model to use later in blocks
205
+ Mage::register('current_contract', $contract);
206
+
207
+ $this->loadLayout();
208
+ $this->renderLayout();
209
+ }
210
+
211
+ public function massStatusAction()
212
+ {
213
+ $contractIds = (array) $this->getRequest()->getParam('contract');
214
+ $status = (int) $this->getRequest()->getParam('status');
215
+ $store = $this->getRequest()->getParam('store', 0);
216
+ $website = $this->getRequest()->getParam('website', 0);
217
+
218
+ Mage::getResourceModel('payline/contract_status')->updateContractStatus($contractIds, $status, $website, $store);
219
+
220
+ $this->_redirect('*/*/', array('website' => $website, 'store' => $store));
221
+ }
222
+
223
+
224
+ public function massWalletAction()
225
+ {
226
+ $contractIds = (array) $this->getRequest()->getParam('contract');
227
+ $subscribe = (int) $this->getRequest()->getParam('walletList');
228
+ $store = $this->getRequest()->getParam('store', 0);
229
+ $website = $this->getRequest()->getParam('website', 0);
230
+
231
+ Mage::getResourceModel('payline/contract')->updateContractWalletList(
232
+ $contractIds, $subscribe, $website, $store
233
+ );
234
+
235
+ $this->_redirect('*/*/', array('website' => $website, 'store' => $store));
236
+ }
237
+
238
 
239
  public function massSecureAction()
240
  {
241
  $contractIds = (array) $this->getRequest()->getParam('contract');
242
  $secure = (int) $this->getRequest()->getParam('setSecure');
243
  $store = $this->getRequest()->getParam('store', 0);
244
+ $website = $this->getRequest()->getParam('website', 0);
245
+
246
  Mage::getResourceModel('payline/contract')->updateContractSecureList(
247
  $contractIds, $secure, $website, $store
248
  );
249
 
250
  $this->_redirect('*/*/', array('website' => $website, 'store' => $store));
251
+ }
252
+ /**
253
+ * contracts grid for AJAX request
254
+ */
255
+ public function gridAction()
256
+ {
257
+ $this->loadLayout();
258
+ $this->renderLayout();
259
+ }
260
+
261
+ }
app/code/community/Monext/Payline/controllers/Adminhtml/Payline/ManageproductcategoriesController.php CHANGED
@@ -1,114 +1,114 @@
1
- <?php
2
-
3
- /**
4
- * This controller manage mapping between Payline and store product categories
5
- */
6
- class Monext_Payline_Adminhtml_Payline_ManageproductcategoriesController extends Mage_Adminhtml_Controller_Action
7
- {
8
- public function indexAction()
9
- {
10
- $this->_title($this->__('Manage Payline Product Categories'));
11
- $this->loadLayout();
12
- $this->_setActiveMenu('system');
13
- $this->renderLayout();
14
- }
15
-
16
- public function assignAction()
17
- {
18
- Mage::getSingleton('core/session')->setData('rowCatToAssign',$this->getRequest()->getParam('id'));
19
- $this->loadLayout()
20
- ->renderLayout();
21
- }
22
-
23
- public function unassignAction()
24
- {
25
- $rowId = $this->getRequest()->getParam('id');
26
- $model = Mage::getModel('payline/productcategories')->load($rowId);
27
- $data = array('payline_category_id' => -1, 'payline_category_label' => '');
28
- $model->addData($data);
29
- try {
30
- $model->setId($rowId)->save();
31
- } catch (Exception $e){
32
- echo $e->getMessage();
33
- }
34
- $this->_redirect('*/*/');
35
- }
36
-
37
- public function updateAction()
38
- {
39
- $collection = Mage::getModel('catalog/category')->getCollection()
40
- ->addAttributeToSelect('name')
41
- ->addAttributeToSelect('is_active')
42
- ->addAttributeToFilter('level',array('gt'=>1));
43
-
44
- $collection->getSelect()
45
- ->joinLeft(array('plncat'=>$collection->getTable('payline_product_categories')), 'plncat.store_category_id=e.entity_id')
46
- ->where('plncat.store_category_id is null');
47
-
48
-
49
- foreach ($collection as $category) {
50
- $pc = Mage::getModel('payline/productcategories')
51
- ->setStoreCategoryId($category->getId())
52
- ->setStoreCategoryLabel(Mage::helper('payline/category')->getCategoryFullpathName($category->getId()))
53
- ->setPaylineCategoryId(-1)
54
- ->save();
55
- }
56
-
57
- $this->_redirect('*/*/');
58
- }
59
-
60
- /**
61
- * Save status assignment to state
62
- */
63
- public function assignPostAction()
64
- {
65
- $data = $this->getRequest()->getPost();
66
- if ($data) {
67
- $paylineCategoryId = $this->getRequest()->getParam('paylinecat');
68
- $rowId = Mage::getSingleton('core/session')->getData('rowCatToAssign');
69
-
70
- $data = array('payline_category_id' => $paylineCategoryId, 'payline_category_label' => Mage::getModel('payline/datasource_paylineproductcategories')->getLabelbyId($paylineCategoryId));
71
- $model = Mage::getModel('payline/productcategories')->load($rowId);
72
- $model->addData($data);
73
- try {
74
- $model->setId($rowId)->save();
75
- } catch (Exception $e){
76
- echo $e->getMessage();
77
- }
78
- $this->_redirect('*/*/index');
79
- return;
80
- }
81
- $this->_redirect('*/*/');
82
- }
83
-
84
- public function resetAction()
85
- {
86
- $pcCol = Mage::getModel('payline/productcategories')->getCollection();
87
-
88
- // delete current mapping between Payline and store categories
89
- foreach ($pcCol as $pcitem) {
90
- $pcitem->delete();
91
- }
92
-
93
- $categories = Mage::helper('payline/category')->getAllCategoriesWithFullpathName();
94
- foreach ($categories as $categoryId=>$categoryPath) {
95
- $pc = Mage::getModel('payline/productcategories')
96
- ->setStoreCategoryId($categoryId)
97
- ->setStoreCategoryLabel($categoryPath)
98
- ->setPaylineCategoryId(-1)
99
- ->save();
100
- }
101
- $this->_redirect('*/*');
102
- }
103
-
104
- /**
105
- * Order grid
106
- */
107
- public function gridAction()
108
- {
109
- $this->loadLayout();
110
- $this->getResponse()->setBody(
111
- $this->getLayout()->createBlock('payline/adminhtml_manageproductcategories_grid')->toHtml()
112
- );
113
- }
114
- }
1
+ <?php
2
+
3
+ /**
4
+ * This controller manage mapping between Payline and store product categories
5
+ */
6
+ class Monext_Payline_Adminhtml_Payline_ManageproductcategoriesController extends Mage_Adminhtml_Controller_Action
7
+ {
8
+ public function indexAction()
9
+ {
10
+ $this->_title($this->__('Manage Payline Product Categories'));
11
+ $this->loadLayout();
12
+ $this->_setActiveMenu('system');
13
+ $this->renderLayout();
14
+ }
15
+
16
+ public function assignAction()
17
+ {
18
+ Mage::getSingleton('core/session')->setData('rowCatToAssign',$this->getRequest()->getParam('id'));
19
+ $this->loadLayout()
20
+ ->renderLayout();
21
+ }
22
+
23
+ public function unassignAction()
24
+ {
25
+ $rowId = $this->getRequest()->getParam('id');
26
+ $model = Mage::getModel('payline/productcategories')->load($rowId);
27
+ $data = array('payline_category_id' => -1, 'payline_category_label' => '');
28
+ $model->addData($data);
29
+ try {
30
+ $model->setId($rowId)->save();
31
+ } catch (Exception $e){
32
+ echo $e->getMessage();
33
+ }
34
+ $this->_redirect('*/*/');
35
+ }
36
+
37
+ public function updateAction()
38
+ {
39
+ $collection = Mage::getModel('catalog/category')->getCollection()
40
+ ->addAttributeToSelect('name')
41
+ ->addAttributeToSelect('is_active')
42
+ ->addAttributeToFilter('level',array('gt'=>1));
43
+
44
+ $collection->getSelect()
45
+ ->joinLeft(array('plncat'=>$collection->getTable('payline_product_categories')), 'plncat.store_category_id=e.entity_id')
46
+ ->where('plncat.store_category_id is null');
47
+
48
+
49
+ foreach ($collection as $category) {
50
+ $pc = Mage::getModel('payline/productcategories')
51
+ ->setStoreCategoryId($category->getId())
52
+ ->setStoreCategoryLabel(Mage::helper('payline/category')->getCategoryFullpathName($category->getId()))
53
+ ->setPaylineCategoryId(-1)
54
+ ->save();
55
+ }
56
+
57
+ $this->_redirect('*/*/');
58
+ }
59
+
60
+ /**
61
+ * Save status assignment to state
62
+ */
63
+ public function assignPostAction()
64
+ {
65
+ $data = $this->getRequest()->getPost();
66
+ if ($data) {
67
+ $paylineCategoryId = $this->getRequest()->getParam('paylinecat');
68
+ $rowId = Mage::getSingleton('core/session')->getData('rowCatToAssign');
69
+
70
+ $data = array('payline_category_id' => $paylineCategoryId, 'payline_category_label' => Mage::getModel('payline/datasource_paylineproductcategories')->getLabelbyId($paylineCategoryId));
71
+ $model = Mage::getModel('payline/productcategories')->load($rowId);
72
+ $model->addData($data);
73
+ try {
74
+ $model->setId($rowId)->save();
75
+ } catch (Exception $e){
76
+ echo $e->getMessage();
77
+ }
78
+ $this->_redirect('*/*/index');
79
+ return;
80
+ }
81
+ $this->_redirect('*/*/');
82
+ }
83
+
84
+ public function resetAction()
85
+ {
86
+ $pcCol = Mage::getModel('payline/productcategories')->getCollection();
87
+
88
+ // delete current mapping between Payline and store categories
89
+ foreach ($pcCol as $pcitem) {
90
+ $pcitem->delete();
91
+ }
92
+
93
+ $categories = Mage::helper('payline/category')->getAllCategoriesWithFullpathName();
94
+ foreach ($categories as $categoryId=>$categoryPath) {
95
+ $pc = Mage::getModel('payline/productcategories')
96
+ ->setStoreCategoryId($categoryId)
97
+ ->setStoreCategoryLabel($categoryPath)
98
+ ->setPaylineCategoryId(-1)
99
+ ->save();
100
+ }
101
+ $this->_redirect('*/*');
102
+ }
103
+
104
+ /**
105
+ * Order grid
106
+ */
107
+ public function gridAction()
108
+ {
109
+ $this->loadLayout();
110
+ $this->getResponse()->setBody(
111
+ $this->getLayout()->createBlock('payline/adminhtml_manageproductcategories_grid')->toHtml()
112
+ );
113
+ }
114
+ }
app/code/community/Monext/Payline/controllers/CheckoutonepageController.php CHANGED
@@ -1,173 +1,173 @@
1
- <?php
2
- /**
3
- * This controller initialize the checkout for the oneclick payment
4
- */
5
- require_once 'Mage/Checkout/controllers/OnepageController.php';
6
- class Monext_Payline_CheckoutonepageController extends Mage_Checkout_OnepageController {
7
-
8
- /**
9
- * Initialize the onepage checkout by 1 click
10
- */
11
- public function indexAction(){
12
- if (!Mage::getStoreConfig('payment/PaylineWALLET/active')){
13
- $this->_redirect('checkout/onepage');
14
- return;
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');
33
- return;
34
- }
35
- /* @var $onepage Mage_Checkout_Model_Type_Onepage */
36
- $onepage = Mage::getSingleton('checkout/type_onepage');
37
- $quote=$onepage->getQuote();
38
- if (!$quote->hasItems() || $quote->getHasError()) {
39
- $this->_redirect('checkout/cart');
40
- return;
41
- }
42
- if (!$quote->validateMinimumAmount()) {
43
- $error = Mage::getStoreConfig('sales/minimum_order/error_message');
44
- Mage::getSingleton('checkout/session')->addError($error);
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');
52
- $error='';
53
- if(!$walletPaymentMethod->checkExpirationDate()){
54
- $error=$this->__('The credit card of your wallet has expired.');
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()){
62
- $error=$this->__('The wallet payment method is disabled. You can process your order below.');
63
- Mage::getSingleton('checkout/session')->addError($error);
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()) {
75
- Mage::getSingleton('checkout/session')->addError($this->__('The onepage checkout is disabled.'));
76
- $this->_redirect('checkout/cart');
77
- return;
78
- }
79
-
80
- if (version_compare(Mage::getVersion(), '1.4', 'ge')){
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();
93
- }else{
94
- Mage::getSingleton('checkout/session')->addError($this->__('You must add an address to your account to be able to checkout in one clic.'));
95
- $this->_redirect('checkout/cart');
96
- return;
97
- }
98
- }
99
- if (empty($billingAddressId)){
100
- if ($customer->getPrimaryBillingAddress()){
101
- $billingAddressId = $customer->getPrimaryBillingAddress()->getId();
102
- }else{
103
- Mage::getSingleton('checkout/session')->addError($this->__('You must add an address to your account to be able to checkout in one clic.'));
104
- $this->_redirect('checkout/cart');
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(
112
- 'address_id' => $billingAddress['entity_id'],
113
- );
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
123
- if ($methodCode=Mage::getStoreConfig('payment/PaylineWALLET/default_shipping_method')){
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();
155
- }
156
-
157
- public function reviewAction()
158
- {
159
- $this->loadLayout('checkout_onepage_review');
160
- $this->renderLayout();
161
- }
162
-
163
- protected function _getChargeProgress()
164
- {
165
- $steps = array('billing', 'shipping', 'shipping_method', 'payment');
166
- $checkout = Mage::getSingleton('checkout/session');
167
- foreach ($steps as $step) {
168
- $checkout->setStepData($step, 'complete', true);
169
- $checkout->setStepData($step, 'allow', true);
170
- }
171
- }
172
-
173
  }
1
+ <?php
2
+ /**
3
+ * This controller initialize the checkout for the oneclick payment
4
+ */
5
+ require_once 'Mage/Checkout/controllers/OnepageController.php';
6
+ class Monext_Payline_CheckoutonepageController extends Mage_Checkout_OnepageController {
7
+
8
+ /**
9
+ * Initialize the onepage checkout by 1 click
10
+ */
11
+ public function indexAction(){
12
+ if (!Mage::getStoreConfig('payment/PaylineWALLET/active')){
13
+ $this->_redirect('checkout/onepage');
14
+ return;
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');
33
+ return;
34
+ }
35
+ /* @var $onepage Mage_Checkout_Model_Type_Onepage */
36
+ $onepage = Mage::getSingleton('checkout/type_onepage');
37
+ $quote=$onepage->getQuote();
38
+ if (!$quote->hasItems() || $quote->getHasError()) {
39
+ $this->_redirect('checkout/cart');
40
+ return;
41
+ }
42
+ if (!$quote->validateMinimumAmount()) {
43
+ $error = Mage::getStoreConfig('sales/minimum_order/error_message');
44
+ Mage::getSingleton('checkout/session')->addError($error);
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');
52
+ $error='';
53
+ if(!$walletPaymentMethod->checkExpirationDate()){
54
+ $error=$this->__('The credit card of your wallet has expired.');
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()){
62
+ $error=$this->__('The wallet payment method is disabled. You can process your order below.');
63
+ Mage::getSingleton('checkout/session')->addError($error);
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()) {
75
+ Mage::getSingleton('checkout/session')->addError($this->__('The onepage checkout is disabled.'));
76
+ $this->_redirect('checkout/cart');
77
+ return;
78
+ }
79
+
80
+ if (version_compare(Mage::getVersion(), '1.4', 'ge')){
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();
93
+ }else{
94
+ Mage::getSingleton('checkout/session')->addError($this->__('You must add an address to your account to be able to checkout in one clic.'));
95
+ $this->_redirect('checkout/cart');
96
+ return;
97
+ }
98
+ }
99
+ if (empty($billingAddressId)){
100
+ if ($customer->getPrimaryBillingAddress()){
101
+ $billingAddressId = $customer->getPrimaryBillingAddress()->getId();
102
+ }else{
103
+ Mage::getSingleton('checkout/session')->addError($this->__('You must add an address to your account to be able to checkout in one clic.'));
104
+ $this->_redirect('checkout/cart');
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(
112
+ 'address_id' => $billingAddress['entity_id'],
113
+ );
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
123
+ if ($methodCode=Mage::getStoreConfig('payment/PaylineWALLET/default_shipping_method')){
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();
155
+ }
156
+
157
+ public function reviewAction()
158
+ {
159
+ $this->loadLayout('checkout_onepage_review');
160
+ $this->renderLayout();
161
+ }
162
+
163
+ protected function _getChargeProgress()
164
+ {
165
+ $steps = array('billing', 'shipping', 'shipping_method', 'payment');
166
+ $checkout = Mage::getSingleton('checkout/session');
167
+ foreach ($steps as $step) {
168
+ $checkout->setStepData($step, 'complete', true);
169
+ $checkout->setStepData($step, 'allow', true);
170
+ }
171
+ }
172
+
173
  }
app/code/community/Monext/Payline/controllers/IndexController.php CHANGED
@@ -774,7 +774,7 @@ class Monext_Payline_IndexController extends Mage_Core_Controller_Front_Action
774
  }
775
  $this->order = Mage::getModel('sales/order')->loadByIncrementId($tokenData['order_id']);
776
 
777
- if($tokenData['status'] != 0 && !isset($_GET['force_upd'])){ // order update is already done => exit this function
778
  if(isset($_GET['notificationType'])) return; // call from notify URL => no page to display
779
 
780
  $acceptedCodes = array(
@@ -840,7 +840,9 @@ class Monext_Payline_IndexController extends Mage_Core_Controller_Front_Action
840
  '02306', // Customer has to fill his payment data
841
  '02533', // Customer not redirected to payment page AND session is active
842
  '02000', // transaction in progress
843
- '02005' // transaction in progress
 
 
844
  );
845
 
846
  if(!in_array($webPaymentDetails['result']['code'], $pendingCodes)){
@@ -857,9 +859,15 @@ class Monext_Payline_IndexController extends Mage_Core_Controller_Front_Action
857
  $this->order->setState(Mage_Sales_Model_Order::STATE_CANCELED,$failedOrderStatus,$msgLog,false);
858
  }
859
  $tokenForUpdate->setStatus(2); // KO
 
 
 
 
 
 
 
860
  }
861
- Mage::helper('payline/logger')->log('[cptReturnAction] ' .$this->order->getIncrementId().$msgLog);
862
- $redirectUrl = $this->_getPaymentRefusedRedirectUrl();
863
  }
864
  $tokenForUpdate->setDateUpdate(date('Y-m-d G:i:s'));
865
  $tokenForUpdate->save();
@@ -1171,5 +1179,14 @@ class Monext_Payline_IndexController extends Mage_Core_Controller_Front_Action
1171
 
1172
  return;
1173
  }
 
 
 
 
 
 
 
 
 
1174
 
1175
  }
774
  }
775
  $this->order = Mage::getModel('sales/order')->loadByIncrementId($tokenData['order_id']);
776
 
777
+ if(!in_array($tokenData['status'],array(0,3)) && !isset($_GET['force_upd'])){ // order update is already done => exit this function
778
  if(isset($_GET['notificationType'])) return; // call from notify URL => no page to display
779
 
780
  $acceptedCodes = array(
840
  '02306', // Customer has to fill his payment data
841
  '02533', // Customer not redirected to payment page AND session is active
842
  '02000', // transaction in progress
843
+ '02005', // transaction in progress
844
+ '02015', // transaction delegated to partner
845
+ paylineSDK::ERR_CODE // communication issue between Payline and the store
846
  );
847
 
848
  if(!in_array($webPaymentDetails['result']['code'], $pendingCodes)){
859
  $this->order->setState(Mage_Sales_Model_Order::STATE_CANCELED,$failedOrderStatus,$msgLog,false);
860
  }
861
  $tokenForUpdate->setStatus(2); // KO
862
+ $redirectUrl = $this->_getPaymentRefusedRedirectUrl();
863
+ }else{
864
+ Mage::getSingleton('core/session')->addError(Mage::helper('payline')->__('Your payment is saved'));
865
+ $waitOrderStatus = Mage::getStoreConfig('payment/payline_common/wait_order_status');
866
+ $this->order->setState(Mage_Sales_Model_Order::STATE_PROCESSING,$waitOrderStatus,$msgLog,false);
867
+ $tokenForUpdate->setStatus(3); // to be determined
868
+ $redirectUrl = Mage::getBaseUrl()."checkout/onepage/success/";
869
  }
870
+ Mage::helper('payline/logger')->log('[cptReturnAction] ' .$this->order->getIncrementId().$msgLog);
 
871
  }
872
  $tokenForUpdate->setDateUpdate(date('Y-m-d G:i:s'));
873
  $tokenForUpdate->save();
1179
 
1180
  return;
1181
  }
1182
+
1183
+ public function waitingOrderUpdateAction(){
1184
+ $tokenCollection = Mage::getModel('payline/token')->getCollection()->addFieldToFilter('status',3); // 3 stands 'pending payment result' status
1185
+ foreach($tokenCollection as $token) {
1186
+ $this->getRequest()->setParam('token', $token->getToken());
1187
+ $_GET['notificationType'] = 'WAITUPD'; // force notificationType param to prevent cptReturnAction to display customer result page
1188
+ $this->cptReturnAction();
1189
+ }
1190
+ }
1191
 
1192
  }
app/code/community/Monext/Payline/controllers/UnloggedwalletController.php CHANGED
@@ -1,115 +1,115 @@
1
- <?php
2
- /**
3
- * On IE, seems like cookies are not sent when in an iframe
4
- * We don't have to be logged since the customer email is transmitted in the order - we can retrieve the customer object from it
5
- * @todo Only move the customer out of the iframe here, and do the getWallet in the WalletController
6
- *
7
- */
8
- class Monext_Payline_UnloggedwalletController extends Mage_Core_Controller_Front_Action
9
- {
10
- /**
11
- * New subscription notification
12
- */
13
- public function subscribeNotifyAction(){
14
- $res = Mage::helper('payline')->initPayline('WALLET')->getWebWallet(array('token' => $_GET['token'], 'version' => Monext_Payline_Helper_Data::VERSION));
15
- $redirectUrl="payline/wallet/manage";
16
- if (!isset($res['result']) || $res['result']['code']!='02500'){
17
- if(isset($res['result'])){
18
- $msgLog='PAYLINE ERROR on getWebWallet: '.$res['result']['code']. ' '.$res['result']['longMessage'];
19
- }else{
20
- $msgLog='Unknown PAYLINE ERROR on getWebWallet';
21
- }
22
- $msg=Mage::helper('payline')->__('Error during subscription');
23
- Mage::helper('payline/Logger')->log('[subscribeNotifyAction] ' .$msgLog);
24
- Mage::getSingleton('core/session')->addError($msg);
25
- $redirectUrl="payline/wallet/subscribe";
26
- return $redirectUrl;
27
- }
28
-
29
- $customer = Mage::getModel('customer/customer');
30
- $customer->setWebsiteId(Mage::app()->getWebsite()->getId());
31
- $customer->loadByEmail($res['wallet']['email']);
32
- $customer->setWalletId($res['wallet']['walletId']);
33
- $customer->setWalletContract(Mage::helper('payline')->contractNumber);
34
- $customer->save();
35
- $msg=Mage::helper('payline')->__('Wallet subscription succeed');
36
- Mage::getSingleton('core/session')->addSuccess($msg);
37
- return $redirectUrl;
38
- }
39
-
40
- /**
41
- * Return from the iframe
42
- * Show a page in the iframe which only redirect the user to the manage wallet page (or the subscription page if error)
43
- */
44
- public function subscribeReturnAction(){
45
- $this->loadLayout();
46
- $redirectUrl=$this->subscribeNotifyAction();
47
- $this->getLayout()->getBlock('payline-iframe-leaver')->setRedirectUrl($redirectUrl);
48
- $this->renderLayout();
49
- }
50
-
51
- /**
52
- * Return from the iframe
53
- * Show a page in the iframe which only redirect the user to the subscription page
54
- */
55
- public function subscribeCancelAction(){
56
- $msg=Mage::helper('payline')->__('Error during subscription');
57
- $msgLog=$msg." (cancelAction)";
58
- Mage::helper('payline/Logger')->log('[subscribeCancelAction] ' .$msgLog);
59
- Mage::getSingleton('core/session')->addError($msg);
60
-
61
- $this->loadLayout();
62
- $redirectUrl='payline/wallet/subscribe';
63
- $this->getLayout()->getBlock('payline-iframe-leaver')->setRedirectUrl($redirectUrl);
64
- $this->renderLayout();
65
- }
66
-
67
- /**
68
- * New subscription notification
69
- */
70
- public function updateNotifyAction(){
71
- $customerData = Mage::getSingleton('customer/session')->getCustomer()->getData();
72
- Mage::helper('payline')->initPayline('WALLET')->getWebWallet(array('token' => $_GET['token'], 'version' => Monext_Payline_Helper_Data::VERSION)); // appel sans traitement pour d�sactiver la notification
73
- $res = Mage::helper('payline')->initPayline('WALLET')->getCards(array('contractNumber' => $customerData['wallet_contract_number'], 'walletId' => $customerData['wallet_id']));
74
- $redirectUrl="payline/wallet/manage";
75
- if ($res['result']['code']!='02500'){
76
- $msgLog='PAYLINE ERROR on getWebWallet after update: '.$res['result']['code']. ' '.$res['result']['longMessage'];
77
- $msg=Mage::helper('payline')->__('Error during update');
78
- Mage::helper('payline/Logger')->log('[updateNotifyAction] ' .$msgLog);
79
- Mage::getSingleton('core/session')->addError($msg);
80
- $redirectUrl="payline/wallet/update";
81
- return $redirectUrl;
82
- }
83
- Mage::getSingleton('customer/session')->setWalletData(null);
84
- $msg=Mage::helper('payline')->__('Wallet update succeed');
85
- Mage::getSingleton('core/session')->addSuccess($msg);
86
- return $redirectUrl;
87
- }
88
-
89
- /**
90
- * Return from the iframe
91
- * Show a page in the iframe which only redirect the user to the manage wallet page
92
- */
93
- public function updateReturnAction(){
94
- $this->loadLayout();
95
- $redirectUrl=$this->updateNotifyAction();
96
- $this->getLayout()->getBlock('payline-iframe-leaver')->setRedirectUrl($redirectUrl);
97
- $this->renderLayout();
98
- }
99
-
100
- /**
101
- * Return from the iframe
102
- * Show a page in the iframe which only redirect the user to the manage page
103
- */
104
- public function updateCancelAction(){
105
- $msg=Mage::helper('payline')->__('Error during update');
106
- $msgLog=$msg." (cancelAction)";
107
- Mage::helper('payline/Logger')->log('[updateCancelAction] ' .$msgLog);
108
- Mage::getSingleton('core/session')->addError($msg);
109
-
110
- $this->loadLayout();
111
- $redirectUrl='payline/wallet/manage';
112
- $this->getLayout()->getBlock('payline-iframe-leaver')->setRedirectUrl($redirectUrl);
113
- $this->renderLayout();
114
- }
115
  }
1
+ <?php
2
+ /**
3
+ * On IE, seems like cookies are not sent when in an iframe
4
+ * We don't have to be logged since the customer email is transmitted in the order - we can retrieve the customer object from it
5
+ * @todo Only move the customer out of the iframe here, and do the getWallet in the WalletController
6
+ *
7
+ */
8
+ class Monext_Payline_UnloggedwalletController extends Mage_Core_Controller_Front_Action
9
+ {
10
+ /**
11
+ * New subscription notification
12
+ */
13
+ public function subscribeNotifyAction(){
14
+ $res = Mage::helper('payline')->initPayline('WALLET')->getWebWallet(array('token' => $_GET['token'], 'version' => Monext_Payline_Helper_Data::VERSION));
15
+ $redirectUrl="payline/wallet/manage";
16
+ if (!isset($res['result']) || $res['result']['code']!='02500'){
17
+ if(isset($res['result'])){
18
+ $msgLog='PAYLINE ERROR on getWebWallet: '.$res['result']['code']. ' '.$res['result']['longMessage'];
19
+ }else{
20
+ $msgLog='Unknown PAYLINE ERROR on getWebWallet';
21
+ }
22
+ $msg=Mage::helper('payline')->__('Error during subscription');
23
+ Mage::helper('payline/Logger')->log('[subscribeNotifyAction] ' .$msgLog);
24
+ Mage::getSingleton('core/session')->addError($msg);
25
+ $redirectUrl="payline/wallet/subscribe";
26
+ return $redirectUrl;
27
+ }
28
+
29
+ $customer = Mage::getModel('customer/customer');
30
+ $customer->setWebsiteId(Mage::app()->getWebsite()->getId());
31
+ $customer->loadByEmail($res['wallet']['email']);
32
+ $customer->setWalletId($res['wallet']['walletId']);
33
+ $customer->setWalletContract(Mage::helper('payline')->contractNumber);
34
+ $customer->save();
35
+ $msg=Mage::helper('payline')->__('Wallet subscription succeed');
36
+ Mage::getSingleton('core/session')->addSuccess($msg);
37
+ return $redirectUrl;
38
+ }
39
+
40
+ /**
41
+ * Return from the iframe
42
+ * Show a page in the iframe which only redirect the user to the manage wallet page (or the subscription page if error)
43
+ */
44
+ public function subscribeReturnAction(){
45
+ $this->loadLayout();
46
+ $redirectUrl=$this->subscribeNotifyAction();
47
+ $this->getLayout()->getBlock('payline-iframe-leaver')->setRedirectUrl($redirectUrl);
48
+ $this->renderLayout();
49
+ }
50
+
51
+ /**
52
+ * Return from the iframe
53
+ * Show a page in the iframe which only redirect the user to the subscription page
54
+ */
55
+ public function subscribeCancelAction(){
56
+ $msg=Mage::helper('payline')->__('Error during subscription');
57
+ $msgLog=$msg." (cancelAction)";
58
+ Mage::helper('payline/Logger')->log('[subscribeCancelAction] ' .$msgLog);
59
+ Mage::getSingleton('core/session')->addError($msg);
60
+
61
+ $this->loadLayout();
62
+ $redirectUrl='payline/wallet/subscribe';
63
+ $this->getLayout()->getBlock('payline-iframe-leaver')->setRedirectUrl($redirectUrl);
64
+ $this->renderLayout();
65
+ }
66
+
67
+ /**
68
+ * New subscription notification
69
+ */
70
+ public function updateNotifyAction(){
71
+ $customerData = Mage::getSingleton('customer/session')->getCustomer()->getData();
72
+ Mage::helper('payline')->initPayline('WALLET')->getWebWallet(array('token' => $_GET['token'], 'version' => Monext_Payline_Helper_Data::VERSION)); // appel sans traitement pour d�sactiver la notification
73
+ $res = Mage::helper('payline')->initPayline('WALLET')->getCards(array('contractNumber' => $customerData['wallet_contract_number'], 'walletId' => $customerData['wallet_id']));
74
+ $redirectUrl="payline/wallet/manage";
75
+ if ($res['result']['code']!='02500'){
76
+ $msgLog='PAYLINE ERROR on getWebWallet after update: '.$res['result']['code']. ' '.$res['result']['longMessage'];
77
+ $msg=Mage::helper('payline')->__('Error during update');
78
+ Mage::helper('payline/Logger')->log('[updateNotifyAction] ' .$msgLog);
79
+ Mage::getSingleton('core/session')->addError($msg);
80
+ $redirectUrl="payline/wallet/update";
81
+ return $redirectUrl;
82
+ }
83
+ Mage::getSingleton('customer/session')->setWalletData(null);
84
+ $msg=Mage::helper('payline')->__('Wallet update succeed');
85
+ Mage::getSingleton('core/session')->addSuccess($msg);
86
+ return $redirectUrl;
87
+ }
88
+
89
+ /**
90
+ * Return from the iframe
91
+ * Show a page in the iframe which only redirect the user to the manage wallet page
92
+ */
93
+ public function updateReturnAction(){
94
+ $this->loadLayout();
95
+ $redirectUrl=$this->updateNotifyAction();
96
+ $this->getLayout()->getBlock('payline-iframe-leaver')->setRedirectUrl($redirectUrl);
97
+ $this->renderLayout();
98
+ }
99
+
100
+ /**
101
+ * Return from the iframe
102
+ * Show a page in the iframe which only redirect the user to the manage page
103
+ */
104
+ public function updateCancelAction(){
105
+ $msg=Mage::helper('payline')->__('Error during update');
106
+ $msgLog=$msg." (cancelAction)";
107
+ Mage::helper('payline/Logger')->log('[updateCancelAction] ' .$msgLog);
108
+ Mage::getSingleton('core/session')->addError($msg);
109
+
110
+ $this->loadLayout();
111
+ $redirectUrl='payline/wallet/manage';
112
+ $this->getLayout()->getBlock('payline-iframe-leaver')->setRedirectUrl($redirectUrl);
113
+ $this->renderLayout();
114
+ }
115
  }
app/code/community/Monext/Payline/controllers/WalletController.php CHANGED
@@ -1,296 +1,296 @@
1
- <?php
2
-
3
- /**
4
- * This controller manage wallet in the customer account (subscribe, update, disable, ...)
5
- * @author fague
6
- *
7
- */
8
- class Monext_Payline_WalletController extends Mage_Core_Controller_Front_Action
9
- {
10
-
11
- /**
12
- * Action predispatch
13
- *
14
- * Check customer authentication
15
- */
16
- public function preDispatch()
17
- {
18
- parent::preDispatch();
19
- if (!Mage::getSingleton('customer/session')->authenticate($this)) {
20
- $this->setFlag('', 'no-dispatch', true);
21
- }
22
- if (!Mage::getStoreConfig('payment/PaylineWALLET/active')) {
23
- $this->setFlag('', 'no-dispatch', true);
24
- }
25
- }
26
-
27
- /**
28
- * Simply redirect to manageAction
29
- */
30
- public function indexAction()
31
- {
32
- $this->_redirect('*/*/manage');
33
- }
34
-
35
- /**
36
- * Display user's wallet informations
37
- */
38
- public function manageAction()
39
- {
40
- $customer = Mage::getSingleton('customer/session')->getCustomer();
41
- if (!($walletId = $customer->getWalletId())) {
42
- $this->_redirect('payline/wallet/subscribe');
43
- return;
44
- }
45
-
46
- $this->loadLayout();
47
-
48
- $this->getLayout()->getBlock('head')->setTitle($this->__('Wallet management'));
49
-
50
- $res = Mage::getModel('payline/wallet')->getWalletData();
51
- if ($res) {
52
- $this->getLayout()->getBlock('payline-wallet-details')->setWallet($res);
53
- }
54
-
55
- $this->_initLayoutMessages('customer/session');
56
- $this->_initLayoutMessages('core/session');
57
- $this->renderLayout();
58
- }
59
-
60
- /**
61
- * Display wallet subscription iframe
62
- */
63
- public function subscribeAction()
64
- {
65
- $customer = Mage::getSingleton('customer/session')->getCustomer();
66
- if ($customer->getWalletId()) {
67
- $this->_redirect('payline/wallet/manage');
68
- return;
69
- }
70
- $this->loadLayout();
71
-
72
- $this->getLayout()->getBlock('head')->setTitle($this->__('Subscribe to wallet'));
73
-
74
- /* @var $paylineHelper Monext_Payline_Helper_Data */
75
- $paylineHelper = Mage::helper('payline');
76
- $paylineHelper->notificationUrl = Mage::getUrl('payline/unloggedwallet/subscribeNotify');
77
- $paylineHelper->returnUrl = Mage::getUrl('payline/unloggedwallet/subscribeReturn');
78
- $paylineHelper->cancelUrl = Mage::getUrl('payline/unloggedwallet/subscribeCancel');
79
- /* @var $paylineSDK PaylineSDK */
80
- $paylineSDK = $paylineHelper->initPayline('WALLET');
81
- $array = array(
82
- 'buyer' => array(
83
- 'lastName' => Mage::helper('payline')->encodeString(substr($customer->getLastname(), 0, 100)),
84
- 'firstName' => Mage::helper('payline')->encodeString(substr($customer->getFirstname(), 0, 100)),
85
- 'walletId' => Mage::getModel('payline/wallet')->generateWalletId()
86
- ),
87
- 'billingAddress' => array(),
88
- 'shippingAddress' => array()
89
- );
90
-
91
- $email = $customer->getEmail();
92
- $pattern = '/\+/i';
93
- $charPlusExist = preg_match($pattern, $email);
94
- if (strlen($email) <= 50 && Zend_Validate::is($email, 'EmailAddress') && !$charPlusExist) {
95
- $array['buyer']['email'] = Mage::helper('payline')->encodeString($email);
96
- } else {
97
- $array['buyer']['email'] = '';
98
- }
99
- $array['buyer']['customerId'] = Mage::helper('payline')->encodeString($email);
100
- ;
101
-
102
- $array['contractNumber'] = $paylineHelper->contractNumber;
103
- $array['contracts'] = explode(';', $paylineHelper->contractNumberList);
104
-
105
- $array['updatePersonalDetails'] = (Mage::getStoreConfig('payment/PaylineWALLET/update_personal_details') ? 1 : 0);
106
- $array['version'] = Monext_Payline_Helper_Data::VERSION;
107
-
108
- // ADD CONTRACT WALLET ARRAY TO $array
109
- $array['walletContracts'] = Mage::helper('payline')->buildContractNumberWalletList();
110
-
111
- try {
112
- $resultCreateWebWallet = $paylineSDK->createWebWallet($array);
113
- } catch (Exception $e) {
114
- Mage::logException($e);
115
- $msgLog = 'Unknown PAYLINE ERROR on createWebWallet (Payline unreachable?)';
116
- $msg = Mage::helper('payline')->__('Error during subscription');
117
- Mage::helper('payline/logger')->log('[subscribeAction] ' . $msgLog);
118
- Mage::getSingleton('customer/session')->addError($msg);
119
- }
120
- if (is_string($resultCreateWebWallet)) {
121
- $msgLog = 'PAYLINE ERROR on createWebWallet: ' . $resultCreateWebWallet;
122
- $msg = Mage::helper('payline')->__('Error during subscription');
123
- Mage::helper('payline/logger')->log('[subscribeAction] ' . $msgLog);
124
- Mage::getSingleton('customer/session')->addError($msg);
125
- $this->_redirect('customer/account');
126
- return;
127
- } elseif (!isset($resultCreateWebWallet['result']) || $resultCreateWebWallet['result']['code'] != '00000') {
128
- if (isset($resultCreateWebWallet['result'])) {
129
- $msgLog = 'PAYLINE ERROR on createWebWallet: ' . $resultCreateWebWallet['result']['code'] . ' ' . $resultCreateWebWallet['result']['longMessage'];
130
- } else {
131
- $msgLog = 'Unknown PAYLINE ERROR on createWebWallet';
132
- }
133
- $msg = Mage::helper('payline')->__('Error during subscription');
134
- Mage::helper('payline/logger')->log('[subscribeAction] ' . $msgLog);
135
- Mage::getSingleton('customer/session')->addError($msg);
136
- $this->_redirect('customer/account');
137
- return;
138
- }
139
-
140
- //save contract number
141
- $customer->setWalletContractNumber($paylineHelper->contractNumber)->save();
142
-
143
- $this->getLayout()->getBlock('payline-wallet-subscribe-cmsblock')->setBlockId(Mage::getStoreConfig('payment/PaylineWALLET/payline_register-oneclick_customeraccount'));
144
- $urlPayline = $resultCreateWebWallet['redirectURL'];
145
-
146
- if (Mage::getStoreConfig('payment/PaylineWALLET/update_personal_details')) {
147
- $iframeClass = 'iframe-subscribe-wallet iframe-with-perso-data';
148
- } else {
149
- $iframeClass = 'iframe-subscribe-wallet';
150
- }
151
- $this->getLayout()->getBlock('payline-wallet-subscribe-iframe')->setIframeClassName($iframeClass);
152
- $this->getLayout()->getBlock('payline-wallet-subscribe-iframe')->setIframeSrc($urlPayline);
153
-
154
- $this->_initLayoutMessages('customer/session');
155
- $this->_initLayoutMessages('core/session');
156
- $this->renderLayout();
157
- }
158
-
159
- /**
160
- * Disable customer wallet, delete customer's walletId attribute value
161
- */
162
- public function disableAction()
163
- {
164
- $customer = Mage::getSingleton('customer/session')->getCustomer();
165
-
166
- if (!($walletId = $customer->getWalletId())) {
167
- $this->_redirect('payline/wallet/subscribe');
168
- return;
169
- }
170
-
171
- $paylineSDK = Mage::helper('payline')->initPayline('WALLET');
172
- $paylineSDK->setWalletIdList($walletId);
173
- $array = array('contractNumber' => $customer->getWalletContractNumber(), 'cardInd' => '');
174
- try {
175
- $res = $paylineSDK->disableWallet($array);
176
- Mage::getSingleton('customer/session')->setWalletData(null);
177
- } catch (Exception $e) {
178
- $msgLog = 'Unknown PAYLINE ERROR on disableWallet (Payline unreachable?)';
179
- $msg = Mage::helper('payline')->__('Error while disabling wallet');
180
- Mage::helper('payline/logger')->log('[disableAction] ' . $msgLog);
181
- Mage::getSingleton('customer/session')->addError($msg);
182
- }
183
-
184
- if (!isset($res['result']) || ($res['result']['code'] != '02500' && $res['result']['code'] != '02501' && $res['result']['code'] == '02505')) {
185
- if (isset($res['result'])) {
186
- $msgLog = 'PAYLINE ERROR on disableWallet: ' . $res['result']['code'] . ' ' . $res['result']['longMessage'];
187
- } else {
188
- $msgLog = 'Unknown PAYLINE ERROR on disableWallet';
189
- }
190
- $msg = Mage::helper('payline')->__('Error during disableWallet');
191
- Mage::helper('payline/logger')->log('[disableAction] ' . $msg);
192
- Mage::getSingleton('customer/session')->addError($msg);
193
- $this->_redirect('customer/account');
194
- return;
195
- }
196
-
197
- $customer->setWalletId();
198
- $customer->setWalletContractNumber();
199
- $customer->save();
200
- Mage::getSingleton('customer/session')->addSuccess($this->__('Your wallet has been disabled.'));
201
- $this->_redirect('customer/account');
202
- return;
203
- }
204
-
205
- /**
206
- *
207
- * Display wallet update iframe
208
- * Update payment card, not perso details
209
- */
210
- public function updateAction()
211
- {
212
- $customer = Mage::getSingleton('customer/session')->getCustomer();
213
- if (!($walletId = $customer->getWalletId())) {
214
- $this->_redirect('payline/wallet/subscribe');
215
- return;
216
- }
217
- $this->loadLayout();
218
-
219
- $this->getLayout()->getBlock('head')->setTitle($this->__('Update wallet'));
220
-
221
- /* @var $paylineHelper Monext_Payline_Helper_Data */
222
- $paylineHelper = Mage::helper('payline');
223
- $paylineHelper->notificationUrl = Mage::getUrl('payline/unloggedwallet/updateNotify');
224
- $paylineHelper->returnUrl = Mage::getUrl('payline/unloggedwallet/updateReturn');
225
- //$paylineHelper->cancelUrl = Mage::getUrl('payline/unloggedwallet/updateCancel');
226
- $paylineHelper->cancelUrl = Mage::getUrl('payline/unloggedwallet/updateReturn');
227
- /* @var $paylineSDK PaylineSDK */
228
- $paylineSDK = $paylineHelper->initPayline('WALLET');
229
- $array = array(
230
- 'walletId' => $walletId,
231
- 'contractNumber' => ($customer->getWalletContractNumber() ? $customer->getWalletContractNumber() : $paylineHelper->contractNumber),
232
- 'cardInd' => '',
233
- 'updatePersonalDetails' => (Mage::getStoreConfig('payment/PaylineWALLET/update_personal_details') ? 1 : 0),
234
- 'updatePaymentDetails' => (Mage::getStoreConfig('payment/PaylineWALLET/update_payment_details') ? 1 : 0),
235
- 'updateOwnerDetails' => 0,
236
- 'version' => Monext_Payline_Helper_Data::VERSION,
237
- 'billingAddress' => '',
238
- 'shippingAddress' => '',
239
- 'buyer' => array(
240
- 'lastName' => Mage::helper('payline')->encodeString(substr($customer->getLastname(), 0, 100)),
241
- 'firstName' => Mage::helper('payline')->encodeString(substr($customer->getFirstname(), 0, 100)),
242
- 'walletId' => $walletId
243
- )
244
- );
245
- $email = $customer->getEmail();
246
- $pattern = '/\+/i';
247
- $charPlusExist = preg_match($pattern, $email);
248
- if (strlen($email) <= 50 && Zend_Validate::is($email, 'EmailAddress') && !$charPlusExist) {
249
- $array['buyer']['email'] = Mage::helper('payline')->encodeString($email);
250
- } else {
251
- $array['buyer']['email'] = '';
252
- }
253
- $paylineSDK->setPrivate(array('customerId' => $customer->getId()));
254
- try {
255
- $res = $paylineSDK->updateWebWallet($array);
256
- } catch (Exception $e) {
257
- Mage::logException($e);
258
- $msgLog = 'Unknown PAYLINE ERROR on updateWebWallet (Payline unreachable?)';
259
- $msg = Mage::helper('payline')->__('Error during wallet update');
260
- Mage::helper('payline/logger')->log('[updateAction] ' . $msgLog);
261
- Mage::getSingleton('customer/session')->addError($msg);
262
- }
263
- if (is_string($res)) {
264
- Mage::helper('payline/logger')->log('[updateAction] ' . $res);
265
- Mage::getSingleton('customer/session')->addError($res);
266
- $this->_redirect('customer/account');
267
- return;
268
- } elseif (!isset($res['result']) || ($res['result']['code'] != '00000' && $res['result']['code'] != '02502')) {
269
- if (isset($res['result'])) {
270
- $msgLog = 'PAYLINE ERROR on updateWebWallet: ' . $res['result']['code'] . ' ' . $res['result']['longMessage'];
271
- } else {
272
- $msgLog = 'Unknown PAYLINE ERROR on updateWebWallet';
273
- }
274
- $msg = Mage::helper('payline')->__('Error while updating wallet');
275
- Mage::helper('payline/logger')->log('[updateAction] ' . $msgLog);
276
- Mage::getSingleton('customer/session')->addError($msg);
277
- $this->_redirect('customer/account');
278
- return;
279
- }
280
- $urlPayline = $res['redirectURL'];
281
-
282
- $this->_initLayoutMessages('customer/session');
283
- $this->_initLayoutMessages('core/session');
284
-
285
- if (Mage::getStoreConfig('payment/PaylineWALLET/update_personal_details')) {
286
- $iframeClass = 'iframe-update-wallet iframe-with-perso-data';
287
- } else {
288
- $iframeClass = 'iframe-update-wallet';
289
- }
290
- $this->getLayout()->getBlock('payline-wallet-update-iframe')->setIframeClassName($iframeClass);
291
- $this->getLayout()->getBlock('payline-wallet-update-iframe')->setIframeSrc($urlPayline);
292
-
293
- $this->renderLayout();
294
- }
295
-
296
- }
1
+ <?php
2
+
3
+ /**
4
+ * This controller manage wallet in the customer account (subscribe, update, disable, ...)
5
+ * @author fague
6
+ *
7
+ */
8
+ class Monext_Payline_WalletController extends Mage_Core_Controller_Front_Action
9
+ {
10
+
11
+ /**
12
+ * Action predispatch
13
+ *
14
+ * Check customer authentication
15
+ */
16
+ public function preDispatch()
17
+ {
18
+ parent::preDispatch();
19
+ if (!Mage::getSingleton('customer/session')->authenticate($this)) {
20
+ $this->setFlag('', 'no-dispatch', true);
21
+ }
22
+ if (!Mage::getStoreConfig('payment/PaylineWALLET/active')) {
23
+ $this->setFlag('', 'no-dispatch', true);
24
+ }
25
+ }
26
+
27
+ /**
28
+ * Simply redirect to manageAction
29
+ */
30
+ public function indexAction()
31
+ {
32
+ $this->_redirect('*/*/manage');
33
+ }
34
+
35
+ /**
36
+ * Display user's wallet informations
37
+ */
38
+ public function manageAction()
39
+ {
40
+ $customer = Mage::getSingleton('customer/session')->getCustomer();
41
+ if (!($walletId = $customer->getWalletId())) {
42
+ $this->_redirect('payline/wallet/subscribe');
43
+ return;
44
+ }
45
+
46
+ $this->loadLayout();
47
+
48
+ $this->getLayout()->getBlock('head')->setTitle($this->__('Wallet management'));
49
+
50
+ $res = Mage::getModel('payline/wallet')->getWalletData();
51
+ if ($res) {
52
+ $this->getLayout()->getBlock('payline-wallet-details')->setWallet($res);
53
+ }
54
+
55
+ $this->_initLayoutMessages('customer/session');
56
+ $this->_initLayoutMessages('core/session');
57
+ $this->renderLayout();
58
+ }
59
+
60
+ /**
61
+ * Display wallet subscription iframe
62
+ */
63
+ public function subscribeAction()
64
+ {
65
+ $customer = Mage::getSingleton('customer/session')->getCustomer();
66
+ if ($customer->getWalletId()) {
67
+ $this->_redirect('payline/wallet/manage');
68
+ return;
69
+ }
70
+ $this->loadLayout();
71
+
72
+ $this->getLayout()->getBlock('head')->setTitle($this->__('Subscribe to wallet'));
73
+
74
+ /* @var $paylineHelper Monext_Payline_Helper_Data */
75
+ $paylineHelper = Mage::helper('payline');
76
+ $paylineHelper->notificationUrl = Mage::getUrl('payline/unloggedwallet/subscribeNotify');
77
+ $paylineHelper->returnUrl = Mage::getUrl('payline/unloggedwallet/subscribeReturn');
78
+ $paylineHelper->cancelUrl = Mage::getUrl('payline/unloggedwallet/subscribeCancel');
79
+ /* @var $paylineSDK PaylineSDK */
80
+ $paylineSDK = $paylineHelper->initPayline('WALLET');
81
+ $array = array(
82
+ 'buyer' => array(
83
+ 'lastName' => Mage::helper('payline')->encodeString(substr($customer->getLastname(), 0, 100)),
84
+ 'firstName' => Mage::helper('payline')->encodeString(substr($customer->getFirstname(), 0, 100)),
85
+ 'walletId' => Mage::getModel('payline/wallet')->generateWalletId()
86
+ ),
87
+ 'billingAddress' => array(),
88
+ 'shippingAddress' => array()
89
+ );
90
+
91
+ $email = $customer->getEmail();
92
+ $pattern = '/\+/i';
93
+ $charPlusExist = preg_match($pattern, $email);
94
+ if (strlen($email) <= 50 && Zend_Validate::is($email, 'EmailAddress') && !$charPlusExist) {
95
+ $array['buyer']['email'] = Mage::helper('payline')->encodeString($email);
96
+ } else {
97
+ $array['buyer']['email'] = '';
98
+ }
99
+ $array['buyer']['customerId'] = Mage::helper('payline')->encodeString($email);
100
+ ;
101
+
102
+ $array['contractNumber'] = $paylineHelper->contractNumber;
103
+ $array['contracts'] = explode(';', $paylineHelper->contractNumberList);
104
+
105
+ $array['updatePersonalDetails'] = (Mage::getStoreConfig('payment/PaylineWALLET/update_personal_details') ? 1 : 0);
106
+ $array['version'] = Monext_Payline_Helper_Data::VERSION;
107
+
108
+ // ADD CONTRACT WALLET ARRAY TO $array
109
+ $array['walletContracts'] = Mage::helper('payline')->buildContractNumberWalletList();
110
+
111
+ try {
112
+ $resultCreateWebWallet = $paylineSDK->createWebWallet($array);
113
+ } catch (Exception $e) {
114
+ Mage::logException($e);
115
+ $msgLog = 'Unknown PAYLINE ERROR on createWebWallet (Payline unreachable?)';
116
+ $msg = Mage::helper('payline')->__('Error during subscription');
117
+ Mage::helper('payline/logger')->log('[subscribeAction] ' . $msgLog);
118
+ Mage::getSingleton('customer/session')->addError($msg);
119
+ }
120
+ if (is_string($resultCreateWebWallet)) {
121
+ $msgLog = 'PAYLINE ERROR on createWebWallet: ' . $resultCreateWebWallet;
122
+ $msg = Mage::helper('payline')->__('Error during subscription');
123
+ Mage::helper('payline/logger')->log('[subscribeAction] ' . $msgLog);
124
+ Mage::getSingleton('customer/session')->addError($msg);
125
+ $this->_redirect('customer/account');
126
+ return;
127
+ } elseif (!isset($resultCreateWebWallet['result']) || $resultCreateWebWallet['result']['code'] != '00000') {
128
+ if (isset($resultCreateWebWallet['result'])) {
129
+ $msgLog = 'PAYLINE ERROR on createWebWallet: ' . $resultCreateWebWallet['result']['code'] . ' ' . $resultCreateWebWallet['result']['longMessage'];
130
+ } else {
131
+ $msgLog = 'Unknown PAYLINE ERROR on createWebWallet';
132
+ }
133
+ $msg = Mage::helper('payline')->__('Error during subscription');
134
+ Mage::helper('payline/logger')->log('[subscribeAction] ' . $msgLog);
135
+ Mage::getSingleton('customer/session')->addError($msg);
136
+ $this->_redirect('customer/account');
137
+ return;
138
+ }
139
+
140
+ //save contract number
141
+ $customer->setWalletContractNumber($paylineHelper->contractNumber)->save();
142
+
143
+ $this->getLayout()->getBlock('payline-wallet-subscribe-cmsblock')->setBlockId(Mage::getStoreConfig('payment/PaylineWALLET/payline_register-oneclick_customeraccount'));
144
+ $urlPayline = $resultCreateWebWallet['redirectURL'];
145
+
146
+ if (Mage::getStoreConfig('payment/PaylineWALLET/update_personal_details')) {
147
+ $iframeClass = 'iframe-subscribe-wallet iframe-with-perso-data';
148
+ } else {
149
+ $iframeClass = 'iframe-subscribe-wallet';
150
+ }
151
+ $this->getLayout()->getBlock('payline-wallet-subscribe-iframe')->setIframeClassName($iframeClass);
152
+ $this->getLayout()->getBlock('payline-wallet-subscribe-iframe')->setIframeSrc($urlPayline);
153
+
154
+ $this->_initLayoutMessages('customer/session');
155
+ $this->_initLayoutMessages('core/session');
156
+ $this->renderLayout();
157
+ }
158
+
159
+ /**
160
+ * Disable customer wallet, delete customer's walletId attribute value
161
+ */
162
+ public function disableAction()
163
+ {
164
+ $customer = Mage::getSingleton('customer/session')->getCustomer();
165
+
166
+ if (!($walletId = $customer->getWalletId())) {
167
+ $this->_redirect('payline/wallet/subscribe');
168
+ return;
169
+ }
170
+
171
+ $paylineSDK = Mage::helper('payline')->initPayline('WALLET');
172
+ $paylineSDK->setWalletIdList($walletId);
173
+ $array = array('contractNumber' => $customer->getWalletContractNumber(), 'cardInd' => '');
174
+ try {
175
+ $res = $paylineSDK->disableWallet($array);
176
+ Mage::getSingleton('customer/session')->setWalletData(null);
177
+ } catch (Exception $e) {
178
+ $msgLog = 'Unknown PAYLINE ERROR on disableWallet (Payline unreachable?)';
179
+ $msg = Mage::helper('payline')->__('Error while disabling wallet');
180
+ Mage::helper('payline/logger')->log('[disableAction] ' . $msgLog);
181
+ Mage::getSingleton('customer/session')->addError($msg);
182
+ }
183
+
184
+ if (!isset($res['result']) || ($res['result']['code'] != '02500' && $res['result']['code'] != '02501' && $res['result']['code'] == '02505')) {
185
+ if (isset($res['result'])) {
186
+ $msgLog = 'PAYLINE ERROR on disableWallet: ' . $res['result']['code'] . ' ' . $res['result']['longMessage'];
187
+ } else {
188
+ $msgLog = 'Unknown PAYLINE ERROR on disableWallet';
189
+ }
190
+ $msg = Mage::helper('payline')->__('Error during disableWallet');
191
+ Mage::helper('payline/logger')->log('[disableAction] ' . $msg);
192
+ Mage::getSingleton('customer/session')->addError($msg);
193
+ $this->_redirect('customer/account');
194
+ return;
195
+ }
196
+
197
+ $customer->setWalletId();
198
+ $customer->setWalletContractNumber();
199
+ $customer->save();
200
+ Mage::getSingleton('customer/session')->addSuccess($this->__('Your wallet has been disabled.'));
201
+ $this->_redirect('customer/account');
202
+ return;
203
+ }
204
+
205
+ /**
206
+ *
207
+ * Display wallet update iframe
208
+ * Update payment card, not perso details
209
+ */
210
+ public function updateAction()
211
+ {
212
+ $customer = Mage::getSingleton('customer/session')->getCustomer();
213
+ if (!($walletId = $customer->getWalletId())) {
214
+ $this->_redirect('payline/wallet/subscribe');
215
+ return;
216
+ }
217
+ $this->loadLayout();
218
+
219
+ $this->getLayout()->getBlock('head')->setTitle($this->__('Update wallet'));
220
+
221
+ /* @var $paylineHelper Monext_Payline_Helper_Data */
222
+ $paylineHelper = Mage::helper('payline');
223
+ $paylineHelper->notificationUrl = Mage::getUrl('payline/unloggedwallet/updateNotify');
224
+ $paylineHelper->returnUrl = Mage::getUrl('payline/unloggedwallet/updateReturn');
225
+ //$paylineHelper->cancelUrl = Mage::getUrl('payline/unloggedwallet/updateCancel');
226
+ $paylineHelper->cancelUrl = Mage::getUrl('payline/unloggedwallet/updateReturn');
227
+ /* @var $paylineSDK PaylineSDK */
228
+ $paylineSDK = $paylineHelper->initPayline('WALLET');
229
+ $array = array(
230
+ 'walletId' => $walletId,
231
+ 'contractNumber' => ($customer->getWalletContractNumber() ? $customer->getWalletContractNumber() : $paylineHelper->contractNumber),
232
+ 'cardInd' => '',
233
+ 'updatePersonalDetails' => (Mage::getStoreConfig('payment/PaylineWALLET/update_personal_details') ? 1 : 0),
234
+ 'updatePaymentDetails' => (Mage::getStoreConfig('payment/PaylineWALLET/update_payment_details') ? 1 : 0),
235
+ 'updateOwnerDetails' => 0,
236
+ 'version' => Monext_Payline_Helper_Data::VERSION,
237
+ 'billingAddress' => '',
238
+ 'shippingAddress' => '',
239
+ 'buyer' => array(
240
+ 'lastName' => Mage::helper('payline')->encodeString(substr($customer->getLastname(), 0, 100)),
241
+ 'firstName' => Mage::helper('payline')->encodeString(substr($customer->getFirstname(), 0, 100)),
242
+ 'walletId' => $walletId
243
+ )
244
+ );
245
+ $email = $customer->getEmail();
246
+ $pattern = '/\+/i';
247
+ $charPlusExist = preg_match($pattern, $email);
248
+ if (strlen($email) <= 50 && Zend_Validate::is($email, 'EmailAddress') && !$charPlusExist) {
249
+ $array['buyer']['email'] = Mage::helper('payline')->encodeString($email);
250
+ } else {
251
+ $array['buyer']['email'] = '';
252
+ }
253
+ $paylineSDK->setPrivate(array('customerId' => $customer->getId()));
254
+ try {
255
+ $res = $paylineSDK->updateWebWallet($array);
256
+ } catch (Exception $e) {
257
+ Mage::logException($e);
258
+ $msgLog = 'Unknown PAYLINE ERROR on updateWebWallet (Payline unreachable?)';
259
+ $msg = Mage::helper('payline')->__('Error during wallet update');
260
+ Mage::helper('payline/logger')->log('[updateAction] ' . $msgLog);
261
+ Mage::getSingleton('customer/session')->addError($msg);
262
+ }
263
+ if (is_string($res)) {
264
+ Mage::helper('payline/logger')->log('[updateAction] ' . $res);
265
+ Mage::getSingleton('customer/session')->addError($res);
266
+ $this->_redirect('customer/account');
267
+ return;
268
+ } elseif (!isset($res['result']) || ($res['result']['code'] != '00000' && $res['result']['code'] != '02502')) {
269
+ if (isset($res['result'])) {
270
+ $msgLog = 'PAYLINE ERROR on updateWebWallet: ' . $res['result']['code'] . ' ' . $res['result']['longMessage'];
271
+ } else {
272
+ $msgLog = 'Unknown PAYLINE ERROR on updateWebWallet';
273
+ }
274
+ $msg = Mage::helper('payline')->__('Error while updating wallet');
275
+ Mage::helper('payline/logger')->log('[updateAction] ' . $msgLog);
276
+ Mage::getSingleton('customer/session')->addError($msg);
277
+ $this->_redirect('customer/account');
278
+ return;
279
+ }
280
+ $urlPayline = $res['redirectURL'];
281
+
282
+ $this->_initLayoutMessages('customer/session');
283
+ $this->_initLayoutMessages('core/session');
284
+
285
+ if (Mage::getStoreConfig('payment/PaylineWALLET/update_personal_details')) {
286
+ $iframeClass = 'iframe-update-wallet iframe-with-perso-data';
287
+ } else {
288
+ $iframeClass = 'iframe-update-wallet';
289
+ }
290
+ $this->getLayout()->getBlock('payline-wallet-update-iframe')->setIframeClassName($iframeClass);
291
+ $this->getLayout()->getBlock('payline-wallet-update-iframe')->setIframeSrc($urlPayline);
292
+
293
+ $this->renderLayout();
294
+ }
295
+
296
+ }
app/code/community/Monext/Payline/etc/adminhtml.xml CHANGED
File without changes
app/code/community/Monext/Payline/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Monext_Payline>
5
- <version>1.8.5</version>
6
  </Monext_Payline>
7
  </modules>
8
  <global>
2
  <config>
3
  <modules>
4
  <Monext_Payline>
5
+ <version>1.8.5.1</version>
6
  </Monext_Payline>
7
  </modules>
8
  <global>
app/code/community/Monext/Payline/etc/system.xml CHANGED
@@ -187,7 +187,18 @@
187
  <show_in_default>1</show_in_default>
188
  <show_in_website>1</show_in_website>
189
  <show_in_store>1</show_in_store>
190
- </init_order_status>
 
 
 
 
 
 
 
 
 
 
 
191
  <heading_payment_author translate="label">
192
  <label>Status for an authorized payment</label>
193
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
@@ -920,7 +931,7 @@
920
  <show_in_default>1</show_in_default>
921
  <show_in_website>1</show_in_website>
922
  <show_in_store>1</show_in_store>
923
- </wallet_payment_security>
924
  <default_shipping_method translate="label comment">
925
  <config_path>payment/PaylineWALLET/default_shipping_method</config_path>
926
  <label>Default shipping method</label>
187
  <show_in_default>1</show_in_default>
188
  <show_in_website>1</show_in_website>
189
  <show_in_store>1</show_in_store>
190
+ </init_order_status>
191
+ <wait_order_status translate="label">
192
+ <config_path>payment/payline_common/wait_order_status</config_path>
193
+ <label>Wait order status</label>
194
+ <comment>Payline waits payment status from a partner</comment>
195
+ <frontend_type>select</frontend_type>
196
+ <source_model>payline/datasource_status</source_model>
197
+ <sort_order>121</sort_order>
198
+ <show_in_default>1</show_in_default>
199
+ <show_in_website>1</show_in_website>
200
+ <show_in_store>1</show_in_store>
201
+ </wait_order_status>
202
  <heading_payment_author translate="label">
203
  <label>Status for an authorized payment</label>
204
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
931
  <show_in_default>1</show_in_default>
932
  <show_in_website>1</show_in_website>
933
  <show_in_store>1</show_in_store>
934
+ </wallet_payment_security>
935
  <default_shipping_method translate="label comment">
936
  <config_path>payment/PaylineWALLET/default_shipping_method</config_path>
937
  <label>Default shipping method</label>
app/code/community/Monext/Payline/lib/PaylineByMonext.wsdl CHANGED
@@ -1,169 +1,169 @@
1
- <?xml version="1.0"?>
2
- <definitions name="PaylinebyMonext" targetNamespace="urn:PaylinebyMonext"
3
- xmlns:typens="urn:PaylinebyMonext" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
4
- xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
5
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/">
6
- <types>
7
- <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:PaylinebyMonext">
8
- <complexType name="paymentMean">
9
- <annotation>
10
- <documentation>This element contains infos aboout a payment mean</documentation>
11
- </annotation>
12
- <sequence>
13
- <element name="code" type="xsd:string"/>
14
- <element name="logoUrl" type="xsd:string"/>
15
- </sequence>
16
- </complexType>
17
- <complexType name="getPaymentMeansResponse">
18
- <annotation>
19
- <documentation>This element is the response from getPaymentMeans service</documentation>
20
- </annotation>
21
- <sequence>
22
- <element name="result" nillable="false" type="xsd:string"/>
23
- <element name="listPaymentMean" nillable="false">
24
- <complexType>
25
- <sequence>
26
- <element maxOccurs="unbounded" minOccurs="0" name="paymentMean" type="typens:paymentMean"/>
27
- </sequence>
28
- </complexType>
29
- </element>
30
- </sequence>
31
- </complexType>
32
- <complexType name="pointOfSale">
33
- <annotation>
34
- <documentation>
35
- This element contains all information about point of sale
36
- </documentation>
37
- </annotation>
38
- <sequence>
39
- <element name="label" nillable="true" type="xsd:string"/>
40
- <element name="webmasterEmail" nillable="true" type="xsd:string"/>
41
- <element name="webstoreURL" nillable="true" type="xsd:string"/>
42
- <element name="contracts">
43
- <annotation>
44
- <documentation>list of contract</documentation>
45
- </annotation>
46
- <complexType>
47
- <sequence>
48
- <element maxOccurs="unbounded" minOccurs="0" name="contract" type="typens:contract"/>
49
- </sequence>
50
- </complexType>
51
- </element>
52
- <element name="customPaymentPageCodeList">
53
- <annotation>
54
- <documentation>list of custom payment page code</documentation>
55
- </annotation>
56
- <complexType>
57
- <sequence>
58
- <element maxOccurs="unbounded" minOccurs="0" name="customPaymentPageCode" type="typens:customPaymentPageCode"/>
59
- </sequence>
60
- </complexType>
61
- </element>
62
- </sequence>
63
- </complexType>
64
- <complexType name="customPaymentPageCode">
65
- <annotation>
66
- <documentation>
67
- This element contains all information about customPaymentPageCode
68
- </documentation>
69
- </annotation>
70
- <sequence>
71
- <element name="code" nillable="true" type="xsd:string"/>
72
- <element name="label" nillable="true" type="xsd:string"/>
73
- <element name="type" nillable="true" type="xsd:string"/>
74
- </sequence>
75
- </complexType>
76
- <complexType name="contract">
77
- <annotation>
78
- <documentation>
79
- This element contains all information about contract
80
- </documentation>
81
- </annotation>
82
- <sequence>
83
- <element name="cardType" nillable="true" type="xsd:string"/>
84
- <element minOccurs="0" name="label" nillable="true" type="xsd:string"/>
85
- <element name="contractNumber" nillable="true" type="xsd:string"/>
86
- <element maxOccurs="1" minOccurs="0" name="enrolment3DS" type="xsd:string"/>
87
- </sequence>
88
- </complexType>
89
- <complexType name="insertMerchantSettingsRequest">
90
- <annotation>
91
- <documentation>
92
- This element contains request parameters for service insertMerchantSettings
93
- </documentation>
94
- </annotation>
95
- <sequence>
96
- <element name="cryptedMerchantID" nillable="true" type="xsd:string"/>
97
- <element name="environment" nillable="true" type="xsd:string"/>
98
- <element name="listPointOfSale" nillable="false">
99
- <complexType>
100
- <sequence>
101
- <element maxOccurs="unbounded" minOccurs="0" name="pointOfSale" type="typens:pointOfSale"/>
102
- </sequence>
103
- </complexType>
104
- </element>
105
- </sequence>
106
- </complexType>
107
- <complexType name="insertMerchantSettingsResponse">
108
- <annotation>
109
- <documentation>
110
- This element contains response from service insertMerchantSettings
111
- </documentation>
112
- </annotation>
113
- <sequence>
114
- <element name="code" nillable="true" type="xsd:string"/>
115
- <element name="message" nillable="true" type="xsd:string"/>
116
- <element name="returnUrl" nillable="true" type="xsd:string"/>
117
- </sequence>
118
- </complexType>
119
- </xsd:schema>
120
- </types>
121
- <message name="getPaymentMeansRequest">
122
- </message>
123
- <message name="getPaymentMeansResponse">
124
- <part name="return" type="typens:getPaymentMeansResponse" />
125
- </message>
126
- <message name="insertMerchantSettingsRequest">
127
- <part name="request" type="typens:insertMerchantSettingsRequest" />
128
- </message>
129
- <message name="insertMerchantSettingsResponse">
130
- <part name="return" type="typens:insertMerchantSettingsResponse" />
131
- </message>
132
- <portType name="PaylinebyMonextPort">
133
- <operation name="getPaymentMeans">
134
- <input message="typens:getPaymentMeansRequest" />
135
- <output message="typens:getPaymentMeansResponse" />
136
- </operation>
137
- <operation name="insertMerchantSettings">
138
- <input message="typens:insertMerchantSettingsRequest" />
139
- <output message="typens:insertMerchantSettingsResponse" />
140
- </operation>
141
- </portType>
142
- <binding name="PaylinebyMonextBinding" type="typens:PaylinebyMonextPort">
143
- <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
144
- <operation name="getPaymentMeans">
145
- <soap:operation soapAction="PaylinebyMonextAction" />
146
- <input name="getPaymentMeansRequest">
147
- <soap:body use="encoded" namespace="urn:PaylinebyMonext" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
148
- </input>
149
- <output name="getPaymentMeansResponse">
150
- <soap:body use="encoded" namespace="urn:PaylinebyMonext" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
151
- </output>
152
- </operation>
153
- <operation name="insertMerchantSettings">
154
- <soap:operation soapAction="PaylinebyMonextAction" />
155
- <input name="insertMerchantSettingsRequest">
156
- <soap:body use="encoded" namespace="urn:PaylinebyMonext" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
157
- </input>
158
- <output name="insertMerchantSettingsResponse">
159
- <soap:body use="encoded" namespace="urn:PaylinebyMonext" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
160
- </output>
161
- </operation>
162
- </binding>
163
- <service name="PaylinebyMonextService">
164
- <documentation>general information about Payline by Monext</documentation>
165
- <port name="PaylinebyMonextPort" binding="typens:PaylinebyMonextBinding">
166
- <soap:address location="http://demo.payline.com/~product/PaylinebyMonextEndpoint.php" />
167
- </port>
168
- </service>
169
  </definitions>
1
+ <?xml version="1.0"?>
2
+ <definitions name="PaylinebyMonext" targetNamespace="urn:PaylinebyMonext"
3
+ xmlns:typens="urn:PaylinebyMonext" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
4
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
5
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/">
6
+ <types>
7
+ <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:PaylinebyMonext">
8
+ <complexType name="paymentMean">
9
+ <annotation>
10
+ <documentation>This element contains infos aboout a payment mean</documentation>
11
+ </annotation>
12
+ <sequence>
13
+ <element name="code" type="xsd:string"/>
14
+ <element name="logoUrl" type="xsd:string"/>
15
+ </sequence>
16
+ </complexType>
17
+ <complexType name="getPaymentMeansResponse">
18
+ <annotation>
19
+ <documentation>This element is the response from getPaymentMeans service</documentation>
20
+ </annotation>
21
+ <sequence>
22
+ <element name="result" nillable="false" type="xsd:string"/>
23
+ <element name="listPaymentMean" nillable="false">
24
+ <complexType>
25
+ <sequence>
26
+ <element maxOccurs="unbounded" minOccurs="0" name="paymentMean" type="typens:paymentMean"/>
27
+ </sequence>
28
+ </complexType>
29
+ </element>
30
+ </sequence>
31
+ </complexType>
32
+ <complexType name="pointOfSale">
33
+ <annotation>
34
+ <documentation>
35
+ This element contains all information about point of sale
36
+ </documentation>
37
+ </annotation>
38
+ <sequence>
39
+ <element name="label" nillable="true" type="xsd:string"/>
40
+ <element name="webmasterEmail" nillable="true" type="xsd:string"/>
41
+ <element name="webstoreURL" nillable="true" type="xsd:string"/>
42
+ <element name="contracts">
43
+ <annotation>
44
+ <documentation>list of contract</documentation>
45
+ </annotation>
46
+ <complexType>
47
+ <sequence>
48
+ <element maxOccurs="unbounded" minOccurs="0" name="contract" type="typens:contract"/>
49
+ </sequence>
50
+ </complexType>
51
+ </element>
52
+ <element name="customPaymentPageCodeList">
53
+ <annotation>
54
+ <documentation>list of custom payment page code</documentation>
55
+ </annotation>
56
+ <complexType>
57
+ <sequence>
58
+ <element maxOccurs="unbounded" minOccurs="0" name="customPaymentPageCode" type="typens:customPaymentPageCode"/>
59
+ </sequence>
60
+ </complexType>
61
+ </element>
62
+ </sequence>
63
+ </complexType>
64
+ <complexType name="customPaymentPageCode">
65
+ <annotation>
66
+ <documentation>
67
+ This element contains all information about customPaymentPageCode
68
+ </documentation>
69
+ </annotation>
70
+ <sequence>
71
+ <element name="code" nillable="true" type="xsd:string"/>
72
+ <element name="label" nillable="true" type="xsd:string"/>
73
+ <element name="type" nillable="true" type="xsd:string"/>
74
+ </sequence>
75
+ </complexType>
76
+ <complexType name="contract">
77
+ <annotation>
78
+ <documentation>
79
+ This element contains all information about contract
80
+ </documentation>
81
+ </annotation>
82
+ <sequence>
83
+ <element name="cardType" nillable="true" type="xsd:string"/>
84
+ <element minOccurs="0" name="label" nillable="true" type="xsd:string"/>
85
+ <element name="contractNumber" nillable="true" type="xsd:string"/>
86
+ <element maxOccurs="1" minOccurs="0" name="enrolment3DS" type="xsd:string"/>
87
+ </sequence>
88
+ </complexType>
89
+ <complexType name="insertMerchantSettingsRequest">
90
+ <annotation>
91
+ <documentation>
92
+ This element contains request parameters for service insertMerchantSettings
93
+ </documentation>
94
+ </annotation>
95
+ <sequence>
96
+ <element name="cryptedMerchantID" nillable="true" type="xsd:string"/>
97
+ <element name="environment" nillable="true" type="xsd:string"/>
98
+ <element name="listPointOfSale" nillable="false">
99
+ <complexType>
100
+ <sequence>
101
+ <element maxOccurs="unbounded" minOccurs="0" name="pointOfSale" type="typens:pointOfSale"/>
102
+ </sequence>
103
+ </complexType>
104
+ </element>
105
+ </sequence>
106
+ </complexType>
107
+ <complexType name="insertMerchantSettingsResponse">
108
+ <annotation>
109
+ <documentation>
110
+ This element contains response from service insertMerchantSettings
111
+ </documentation>
112
+ </annotation>
113
+ <sequence>
114
+ <element name="code" nillable="true" type="xsd:string"/>
115
+ <element name="message" nillable="true" type="xsd:string"/>
116
+ <element name="returnUrl" nillable="true" type="xsd:string"/>
117
+ </sequence>
118
+ </complexType>
119
+ </xsd:schema>
120
+ </types>
121
+ <message name="getPaymentMeansRequest">
122
+ </message>
123
+ <message name="getPaymentMeansResponse">
124
+ <part name="return" type="typens:getPaymentMeansResponse" />
125
+ </message>
126
+ <message name="insertMerchantSettingsRequest">
127
+ <part name="request" type="typens:insertMerchantSettingsRequest" />
128
+ </message>
129
+ <message name="insertMerchantSettingsResponse">
130
+ <part name="return" type="typens:insertMerchantSettingsResponse" />
131
+ </message>
132
+ <portType name="PaylinebyMonextPort">
133
+ <operation name="getPaymentMeans">
134
+ <input message="typens:getPaymentMeansRequest" />
135
+ <output message="typens:getPaymentMeansResponse" />
136
+ </operation>
137
+ <operation name="insertMerchantSettings">
138
+ <input message="typens:insertMerchantSettingsRequest" />
139
+ <output message="typens:insertMerchantSettingsResponse" />
140
+ </operation>
141
+ </portType>
142
+ <binding name="PaylinebyMonextBinding" type="typens:PaylinebyMonextPort">
143
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
144
+ <operation name="getPaymentMeans">
145
+ <soap:operation soapAction="PaylinebyMonextAction" />
146
+ <input name="getPaymentMeansRequest">
147
+ <soap:body use="encoded" namespace="urn:PaylinebyMonext" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
148
+ </input>
149
+ <output name="getPaymentMeansResponse">
150
+ <soap:body use="encoded" namespace="urn:PaylinebyMonext" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
151
+ </output>
152
+ </operation>
153
+ <operation name="insertMerchantSettings">
154
+ <soap:operation soapAction="PaylinebyMonextAction" />
155
+ <input name="insertMerchantSettingsRequest">
156
+ <soap:body use="encoded" namespace="urn:PaylinebyMonext" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
157
+ </input>
158
+ <output name="insertMerchantSettingsResponse">
159
+ <soap:body use="encoded" namespace="urn:PaylinebyMonext" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
160
+ </output>
161
+ </operation>
162
+ </binding>
163
+ <service name="PaylinebyMonextService">
164
+ <documentation>general information about Payline by Monext</documentation>
165
+ <port name="PaylinebyMonextPort" binding="typens:PaylinebyMonextBinding">
166
+ <soap:address location="http://demo.payline.com/~product/PaylinebyMonextEndpoint.php" />
167
+ </port>
168
+ </service>
169
  </definitions>
app/code/community/Monext/Payline/lib/paylineSDK.php CHANGED
@@ -1,2053 +1,2053 @@
1
- <?php
2
- //
3
- // OBJECTS DEFINITIONS
4
- //
5
-
6
- class paylineUtil{
7
-
8
- /**
9
- * make an array from a payline server response object.
10
- * @params : $response : Objet response from payline
11
- * @return : Object convert in an array
12
- **/
13
- static function responseToArray($response){
14
-
15
- $array = array();
16
- foreach($response as $k=>$v){
17
- if (is_object($v)) {
18
- $array[$k] = paylineUtil::responseToArray($v);
19
- }
20
- else { $array[$k] = $v;
21
- }
22
- }
23
- return $array;
24
-
25
- return $response;
26
- }
27
-
28
- static function responseToArrayForGetCards($response){
29
-
30
- $array = array();
31
- foreach($response as $k=>$v){
32
-
33
- if (is_object($v) && ($k != 'cards' ) ) {
34
- $array[$k] = paylineUtil::responseToArrayForGetCards($v);
35
- }
36
- else {
37
- if($k == 'cards' && count($v) == 1 ){
38
- $array[$k][0] = $v;
39
- }else{
40
- $array[$k] = $v;
41
- }
42
- }
43
- }
44
- return $array;
45
-
46
- return $response;
47
- }
48
- }
49
-
50
- //
51
- // PL_PAYMENT OBJECT DEFINITION
52
- //
53
- class pl_payment{
54
-
55
- // ATTRIBUTES LISTING
56
- public $amount;
57
- public $currency;
58
- public $action;
59
- public $mode;
60
- public $method;
61
- public $contractNumber;
62
- public $differedActionDate;
63
- }
64
-
65
- //
66
- // PL_ORDER OBJECT DEFINITION
67
- //
68
- class pl_order{
69
-
70
- // ATTRIBUTES LISTING
71
- public $ref;
72
- public $origin;
73
- public $country;
74
- public $taxes;
75
- public $amount;
76
- public $currency;
77
- public $date;
78
- public $quantity;
79
- public $comment;
80
- public $details;
81
- public $deliveryTime;
82
- public $deliveryMode;
83
- public $deliveryExpectedDate;
84
- public $deliveryExpectedDelay;
85
-
86
- function __construct() {
87
- $this->date = date('d/m/Y H:i', time());
88
- $this->details = array();
89
- }
90
- }
91
-
92
- //
93
- // PL_PRIVATEDATA OBJECT DEFINITION
94
- //
95
- class pl_privateData{
96
-
97
- // ATTRIBUTES LISTING
98
- public $key ;
99
- public $value;
100
- }
101
-
102
- //
103
- // PL_AUTHORIZATION OBJECT DEFINITION
104
- //
105
- class pl_authorization{
106
-
107
- // ATTRIBUTES LISTING
108
- public $number;
109
- public $date;
110
- }
111
-
112
- //
113
- // PL_ADDRESS OBJECT DEFINITION
114
- //
115
- class pl_address{
116
-
117
- // ATTRIBUTES LISTING
118
- public $title;
119
- public $firstName;
120
- public $lastName;
121
- public $name;
122
- public $street1;
123
- public $street2;
124
- public $cityName;
125
- public $zipCode;
126
- public $country;
127
- public $county;
128
- public $state;
129
- public $phoneType;
130
- public $phone;
131
- }
132
-
133
- //
134
- // PL_OWNERADDRESS OBJECT DEFINITION
135
- //
136
- class pl_ownerAddress{
137
-
138
- // ATTRIBUTES LISTING
139
- public $street;
140
- public $cityName;
141
- public $zipCode;
142
- public $country;
143
- public $phone;
144
- }
145
-
146
- //
147
- // PL_BUYER OBJECT DEFINITION
148
- //
149
- class pl_buyer{
150
-
151
- // ATTRIBUTES LISTING
152
- public $title;
153
- public $lastName;
154
- public $firstName;
155
- public $email;
156
- public $customerId;
157
- public $walletId;
158
- public $walletDisplayed;
159
- public $walletSecured;
160
- public $walletCardInd;
161
- public $shippingAdress;
162
- public $billingAddress;
163
- public $accountCreateDate;
164
- public $accountAverageAmount;
165
- public $accountOrderCount;
166
- public $ip;
167
- public $mobilePhone;
168
- public $legalStatus;
169
- public $legalDocument;
170
- public $birthDate;
171
- public $fingerprintID;
172
-
173
- function __construct() {
174
- $this->accountCreateDate = date('d/m/y', time());
175
- }
176
- }
177
-
178
- //
179
- // PL_OWNER OBJECT DEFINITION
180
- //
181
- class pl_owner{
182
-
183
- // ATTRIBUTES LISTING
184
- public $lastName;
185
- public $firstName;
186
- public $billingAddress;
187
- public $issueCardDate;
188
- }
189
-
190
- //
191
- // PL_ORDERDETAIL OBJECT DEFINITION
192
- //
193
- class pl_orderDetail{
194
-
195
- // ATTRIBUTES LISTING
196
- public $ref;
197
- public $price;
198
- public $quantity;
199
- public $comment;
200
- public $category;
201
- public $subcategory1;
202
- public $subcategory2;
203
- public $brand;
204
- public $additionalData;
205
- public $taxRate;
206
- }
207
-
208
- //
209
- // PL_CARD OBJECT DEFINITION
210
- //
211
- class pl_card{
212
-
213
- // ATTRIBUTES LISTING
214
- public $number;
215
- public $type;
216
- public $expirationDate;
217
- public $cvx;
218
- public $ownerBirthdayDate;
219
- public $password;
220
- public $cardPresent;
221
- public $cardholder;
222
- public $token;
223
-
224
- function __construct($type) {
225
- $this->accountCreateDate = date('d/m/y', time());
226
- }
227
- }
228
-
229
-
230
- //
231
- // PL_TRANSACTION OBJECT DEFINITION
232
- //
233
- class pl_transaction{
234
-
235
- // ATTRIBUTES LISTING
236
- public $id;
237
- public $isPossibleFraud;
238
- public $isDuplicated;
239
- public $date;
240
- }
241
-
242
-
243
- //
244
- // PL_RESULT OBJECT DEFINITION
245
- //
246
- class pl_result{
247
-
248
- // ATTRIBUTES LISTING
249
- public $code;
250
- public $shortMessage;
251
- public $longMessage;
252
- }
253
-
254
- //
255
- // PL_CAPTURE OBJECT DEFINITION
256
- //
257
- class pl_capture{
258
-
259
- // ATTRIBUTES LISTING
260
- public $transactionID;
261
- public $payment;
262
- public $sequenceNumber;
263
-
264
- function __construct() {
265
- $this->payment = new pl_payment();
266
- }
267
- }
268
-
269
- //
270
- // PL_REFUND OBJECT DEFINITION
271
- //
272
- class pl_refund extends pl_capture {
273
- function __construct() {
274
- parent::__construct();
275
- }
276
- }
277
-
278
- //
279
- // PL_WALLET OBJECT DEFINITION
280
- //
281
- class pl_wallet{
282
-
283
- // ATTRIBUTES LISTING
284
- public $walletId;
285
- public $lastName;
286
- public $firstName;
287
- public $email;
288
- public $shippingAddress;
289
- public $card;
290
- public $comment;
291
- public $default;
292
- public $cardStatus;
293
-
294
- function __construct() {
295
- }
296
- }
297
-
298
- //
299
- // PL_RECURRING OBJECT DEFINITION
300
- //
301
- class pl_recurring{
302
-
303
- // ATTRIBUTES LISTING
304
- public $firstAmount;
305
- public $amount;
306
- public $billingCycle;
307
- public $billingLeft;
308
- public $billingDay;
309
- public $startDate;
310
- public $endDate;
311
- public $newAmount;
312
- public $amountModificationDate;
313
-
314
- function __construct() {
315
- }
316
- }
317
-
318
- //
319
- // PL_BILLINGRECORD OBJECT DEFINITION
320
- //
321
- class pl_billingRecord{
322
-
323
- // ATTRIBUTES LISTING
324
- public $date;
325
- public $amount;
326
- public $status;
327
- public $executionDate;
328
-
329
- function __construct() {
330
- }
331
- }
332
-
333
- //
334
- // PL_AUTHENTIFICATION 3D SECURE
335
- //
336
- class pl_authentication3DSecure{
337
-
338
- // ATTRIBUTES LISTING
339
- public $md ;
340
- public $pares ;
341
- public $xid ;
342
- public $eci ;
343
- public $cavv ;
344
- public $cavvAlgorithm ;
345
- public $vadsResult ;
346
- public $typeSecurisation;
347
-
348
- function __construct() {
349
- }
350
- }
351
-
352
- //
353
- // PL_BANKACCOUNTDATA
354
- //
355
- class pl_bankAccountData{
356
-
357
-
358
- // ATTRIBUTES LISTING
359
- public $countryCode ;
360
- public $bankCode ;
361
- public $accountNumber ;
362
- public $key ;
363
-
364
-
365
- function __construct() {
366
- }
367
- }
368
-
369
- //
370
- // PL_CHEQUE
371
- //
372
- class pl_cheque{
373
-
374
- // ATTRIBUTES LISTING
375
- public $number ;
376
-
377
- function __construct() {
378
- }
379
- }
380
-
381
- final class paylineLog {
382
- private $filename;
383
- private $path;
384
-
385
- public function __construct($filename, $path=null) {
386
- $this->filename = $filename;
387
- if($path == null){
388
- $tmp = explode(DIRECTORY_SEPARATOR ,dirname(__FILE__));
389
-
390
- // up one level from the current directory
391
- for($i=0,$s = sizeof($tmp)-1; $i<$s; $i++){
392
- $this->path .= $tmp[$i].DIRECTORY_SEPARATOR;
393
- }
394
- $this->path .= 'logs'.DIRECTORY_SEPARATOR;
395
- }else{
396
- $this->path = $path;
397
- }
398
- }
399
-
400
- public function write($message) {
401
- $file = $this->path.$this->filename;
402
- $handle = fopen($file, 'a+');
403
- fwrite($handle, date('Y-m-d G:i:s') . ' - ' . $message . "\n");
404
- fclose($handle);
405
- }
406
- }
407
-
408
- //
409
- // PAYLINESDK CLASS
410
- //
411
- class paylineSDK{
412
-
413
- // kit version
414
- const KIT_VERSION = 'module Magento 1.8.4';
415
-
416
- // trace log
417
- var $logger;
418
- var $flagLog; // 0 : pas de log / 1 : log par défaut / 2 : chemin personnalisé (pathLog)
419
- var $pathLog;
420
-
421
- // environement flags
422
- const ENV_DEV = "DEV";
423
- const ENV_HOMO = "HOMO";
424
- const ENV_PROD = "PROD";
425
-
426
- // SOAP URL's
427
- const PAYLINE_NAMESPACE = 'http://obj.ws.payline.experian.com';
428
- const WSDL = 'v4.44.wsdl';
429
- const DEV_ENDPOINT = 'https://ws.dev.payline.com/V4/services/';
430
- const HOMO_ENDPOINT = 'https://homologation.payline.com/V4/services/';
431
- const PROD_ENDPOINT = 'https://services.payline.com/V4/services/';
432
-
433
- // getToken servlet URL
434
- const DEV_GET_TOKEN_SERVLET = "https://webpayment.dev.payline.com/webpayment/getToken";
435
- const HOMO_GET_TOKEN_SERVLET = "https://homologation-webpayment.payline.com/webpayment/getToken";
436
- const PROD_GET_TOKEN_SERVLET = "https://webpayment.payline.com/webpayment/getToken";
437
-
438
- // Widget JavaScript
439
- const HOMO_WDGT_JS = "https://homologation-payment.payline.com/scripts/widget-min.js";
440
- const PROD_WDGT_JS = "https://payment.payline.com/scripts/widget-min.js";
441
- const DEV_WDGT_JS = "https://webpayment.dev.payline.com/payline-widget/scripts/widget-min.js";
442
-
443
- // Widget css
444
- const DEV_WDGT_CSS = "https://webpayment.dev.payline.com/payline-widget/styles/widget-min.css";
445
- const HOMO_WDGT_CSS = "https://homologation-payment.payline.com/styles/widget-min.css";
446
- const PROD_WDGT_CSS = "https://payment.payline.com/styles/widget-min.css";
447
-
448
-
449
- // Administration center
450
- const DEV_CA = 'https://admin.dev.payline.aixlan.local:9363';
451
- const HOMO_CA = 'https://homologation-admin.payline.com';
452
- const PROD_CA = 'https://admin.payline.com';
453
-
454
- // APIs
455
- const DIRECT_API = 'DirectPaymentAPI';
456
- const EXTENDED_API = 'ExtendedAPI';
457
- const WEB_API = 'WebPaymentAPI';
458
-
459
- // current endpoint
460
- private $webServicesEndpoint;
461
-
462
- // current url to get token
463
- private $servletTokenUrl;
464
-
465
- private $widgetJavascriptUrl;
466
- private $widgetCssUrl;
467
-
468
- // SOAP ACTIONS CONSTANTS
469
- const soap_result = 'result';
470
- const soap_authorization = 'authorization';
471
- const soap_card = 'card';
472
- const soap_order = 'order';
473
- const soap_orderDetail = 'orderDetail';
474
- const soap_payment = 'payment';
475
- const soap_transaction = 'transaction';
476
- const soap_privateData = 'privateData';
477
- const soap_buyer = 'buyer';
478
- const soap_owner = 'owner';
479
- const soap_address = 'address';
480
- const soap_ownerAddress = 'addressOwner';
481
- const soap_capture = 'capture';
482
- const soap_refund = 'refund';
483
- const soap_refund_auth = 'refundAuthorization';
484
- const soap_authentication3DSecure = 'authentication3DSecure';
485
- const soap_bankAccountData = 'bankAccountData';
486
- const soap_cheque = 'cheque';
487
-
488
- const ERR_CODE = 'XXXXX';
489
-
490
- // ARRAY
491
- public $header_soap;
492
- public $items;
493
- public $privates;
494
-
495
- // OPTIONS
496
- public $cancelURL;
497
- public $securityMode;
498
- public $notificationURL;
499
- public $returnURL;
500
- public $customPaymentTemplateURL;
501
- public $customPaymentPageCode;
502
- public $languageCode;
503
-
504
- // WALLET
505
- public $walletIdList;
506
-
507
- // custom logo path
508
- const DEFAULT_LOGO_DIR = 'customLogos';
509
- var $customLogoPath = '';
510
-
511
- // getMerchantSettings Array
512
- private $posData;
513
- private $paymentMeansLogos;
514
-
515
- /**
516
- * contructor of PAYLINESDK CLASS
517
- **/
518
- function __construct($merchant_id, $access_key, $proxy_host, $proxy_port, $proxy_login, $proxy_password, $environment, $pathLog = null) {
519
- if(is_null($pathLog)){
520
- $this->flagLog = 1;
521
- }elseif (strlen($pathLog) == 0){
522
- $this->flagLog = 0;
523
- }else{
524
- $this->flagLog = 2;
525
- $this->pathLog = $pathLog;
526
- }
527
-
528
- $this->writeTrace('----------------------------------------------------------');
529
- $this->writeTrace('paylineSDK::__construct('.$this->hideChars($merchant_id,6,1).', '.$this->hideChars($access_key,1,3).", $proxy_host, $proxy_port, $proxy_login, ".$this->hideChars($proxy_password,1,1).", $environment)");
530
- $this->header_soap = array();
531
- $this->header_soap['login'] = $merchant_id;
532
- $this->header_soap['password'] = $access_key;
533
- if($proxy_host != ''){
534
- $this->header_soap['proxy_host'] = $proxy_host;
535
- $this->header_soap['proxy_port'] = $proxy_port;
536
- $this->header_soap['proxy_login'] = $proxy_login;
537
- $this->header_soap['proxy_password'] = $proxy_password;
538
- }
539
-
540
- if(strcmp($environment,paylineSDK::ENV_DEV)==0){
541
- $this->webServicesEndpoint = paylineSDK::DEV_ENDPOINT;
542
- $this->widgetJavascriptUrl = paylineSDK::DEV_WDGT_JS;
543
- $this->widgetCssUrl = paylineSDK::DEV_WDGT_CSS;
544
- }elseif(strcmp($environment,paylineSDK::ENV_PROD)==0){
545
- $this->webServicesEndpoint = paylineSDK::PROD_ENDPOINT;
546
- $this->servletTokenUrl = paylineSDK::PROD_GET_TOKEN_SERVLET;
547
- $this->widgetJavascriptUrl = paylineSDK::PROD_WDGT_JS;
548
- $this->widgetCssUrl = paylineSDK::PROD_WDGT_CSS;
549
- }elseif(strcmp($environment,paylineSDK::ENV_HOMO)==0){
550
- $this->webServicesEndpoint = paylineSDK::HOMO_ENDPOINT;
551
- $this->servletTokenUrl = paylineSDK::HOMO_GET_TOKEN_SERVLET;
552
- $this->widgetJavascriptUrl = paylineSDK::HOMO_WDGT_JS;
553
- $this->widgetCssUrl = paylineSDK::HOMO_WDGT_CSS;
554
- }
555
-
556
- $this->header_soap['style'] = SOAP_DOCUMENT;
557
- $this->header_soap['use'] = SOAP_LITERAL;
558
- $this->items = array();
559
- $this->privates = array();
560
- $this->walletIdList = array();
561
-
562
- ini_set('user_agent', "PHP\r\nversion: ".paylineSDK::KIT_VERSION);
563
- }
564
-
565
- /**
566
- * function payment
567
- * @params : $array : array. the array keys are listed in pl_payment CLASS.
568
- * @return : SoapVar : object
569
- * @description : build pl_payment instance from $array and make SoapVar object for payment.
570
- **/
571
- protected function payment($array) {
572
- $payment = new pl_payment();
573
- if($array && is_array($array)){
574
- foreach($array as $k=>$v){
575
- if(array_key_exists($k, $payment)&&(strlen($v))){
576
- $payment->$k = $v;
577
- }
578
- }
579
- }
580
- return new SoapVar($payment, SOAP_ENC_OBJECT, paylineSDK::soap_payment, paylineSDK::PAYLINE_NAMESPACE);
581
- }
582
-
583
- /**
584
- * function order
585
- * @params : $array : array. the array keys are listed in pl_order CLASS.
586
- * @return : SoapVar : object
587
- * @description : build pl_order instance from $array and make SoapVar object for order.
588
- **/
589
- protected function order($array) {
590
- $order = new pl_order();
591
- if($array && is_array($array)){
592
- foreach($array as $k=>$v){
593
- if(array_key_exists($k, $order)&&(strlen($v))){
594
- $order->$k = $v;
595
- }
596
- }
597
- }
598
- $allDetails = array();
599
- // insert orderDetails
600
- $order->details = $this->items;
601
- return new SoapVar($order, SOAP_ENC_OBJECT, paylineSDK::soap_order, paylineSDK::PAYLINE_NAMESPACE);
602
- }
603
-
604
- /**
605
- * function address
606
- * @params : $address : array. the array keys are listed in pl_address CLASS.
607
- * @return : SoapVar : object
608
- * @description : build pl_address instance from $array and make SoapVar object for address.
609
- **/
610
- protected function address($array) {
611
- $address = new pl_address();
612
- if($array && is_array($array)){
613
- foreach($array as $k=>$v){
614
- if(array_key_exists($k, $address)&&(strlen($v)))$address->$k = $v;
615
- }
616
- }
617
- return new SoapVar($address, SOAP_ENC_OBJECT, paylineSDK::soap_address, paylineSDK::PAYLINE_NAMESPACE);
618
- }
619
-
620
- /**
621
- * function ownerAddress
622
- * @params : $address : array. the array keys are listed in pl_address CLASS.
623
- * @return : SoapVar : object
624
- * @description : build pl_ownerAddress instance from $array and make SoapVar object for address.
625
- **/
626
- protected function ownerAddress($array) {
627
- $address = new pl_ownerAddress();
628
- if($array && is_array($array)){
629
- foreach($array as $k=>$v){
630
- if(array_key_exists($k, $address)&&(strlen($v)))$address->$k = $v;
631
- }
632
- }
633
- return new SoapVar($address, SOAP_ENC_OBJECT, paylineSDK::soap_ownerAddress, paylineSDK::PAYLINE_NAMESPACE);
634
- }
635
-
636
- /**
637
- * function buyer
638
- * @params : $array : array. the array keys are listed in pl_buyer CLASS.
639
- * @params : $shippingAdress : array. the array keys are listed in pl_address CLASS.
640
- * @params : $billingAddress : array. the array keys are listed in pl_address CLASS.
641
- * @return : SoapVar : object
642
- * @description : build pl_buyer instance from $array and $address and make SoapVar object for buyer.
643
- **/
644
- protected function buyer($array,$shippingAdress,$billingAddress) {
645
- $buyer = new pl_buyer();
646
- if($array && is_array($array)){
647
- foreach($array as $k=>$v){
648
- if(array_key_exists($k, $buyer)&&(strlen($v)))$buyer->$k = $v;
649
- }
650
- }
651
- $buyer->shippingAdress = $this->address($shippingAdress);
652
- $buyer->billingAddress = $this->address($billingAddress);
653
- return new SoapVar($buyer, SOAP_ENC_OBJECT, paylineSDK::soap_buyer, paylineSDK::PAYLINE_NAMESPACE);
654
- }
655
-
656
- /**
657
- * function owner
658
- * @params : $array : array. the array keys are listed in pl_buyer CLASS.
659
- * @params : $shippingAdress : array. the array keys are listed in pl_address CLASS.
660
- * @params : $billingAddress : array. the array keys are listed in pl_address CLASS.
661
- * @return : SoapVar : object
662
- * @description : build pl_buyer instance from $array and $address and make SoapVar object for buyer.
663
- **/
664
- protected function owner($array,$Address) {
665
- if($array != null){
666
- $owner = new pl_owner();
667
- if($array && is_array($array)){
668
- foreach($array as $k=>$v){
669
- if(array_key_exists($k, $owner)&&(strlen($v)))$owner->$k = $v;
670
- }
671
- }
672
- $owner->billingAddress = $this->ownerAddress($Address);
673
- return new SoapVar($owner, SOAP_ENC_OBJECT, paylineSDK::soap_owner, paylineSDK::PAYLINE_NAMESPACE);
674
- }else{
675
- return null;
676
- }
677
- }
678
-
679
- /**
680
- * function contracts
681
- * @params : $contracts : array. array of contracts
682
- * @return : $contracts : array. the same as params if exist, or an array with default contract defined in
683
- * configuration
684
- * @description : Add datas to contract array
685
- **/
686
- protected function contracts($contracts) {
687
- if($contracts && is_array($contracts)){
688
- return $contracts;
689
- }
690
- return null;
691
- }
692
-
693
- /**
694
- * function secondContracts
695
- * @params : $secondContracts : array. array of contracts
696
- * @return : $secondContracts : array. the same as params if exist, null otherwise
697
- * @description : Add datas to contract array
698
- **/
699
- protected function secondContracts($secondContracts) {
700
- if($secondContracts && is_array($secondContracts)){
701
- return $secondContracts;
702
- }
703
- return null;
704
- }
705
-
706
- /**
707
- * function authentification 3Dsecure
708
- * @params : $array : array. the array keys are listed in pl_card CLASS.
709
- * @return : SoapVar : object
710
- * @description : build pl_authentication3DSecure instance from $array and make SoapVar object for authentication3DSecure.
711
- **/
712
- protected function authentication3DSecure($array) {
713
- $authentication3DSecure = new pl_authentication3DSecure($array);
714
- if($array && is_array($array)){
715
- foreach($array as $k=>$v){
716
- if(array_key_exists($k, $authentication3DSecure)&&(strlen($v))){
717
- $authentication3DSecure->$k = $v;
718
- }
719
- }
720
- }
721
- return new SoapVar($authentication3DSecure, SOAP_ENC_OBJECT, paylineSDK::soap_authentication3DSecure, paylineSDK::PAYLINE_NAMESPACE);
722
- }
723
-
724
- /**
725
- * function authorization
726
- * @params : $array : array. the array keys are listed in pl_card CLASS.
727
- * @return : SoapVar : object
728
- * @description : build pl_authentication3DSecure instance from $array and make SoapVar object for authentication3DSecure.
729
- **/
730
- protected function authorization($array) {
731
- $authorization = new pl_authorization($array);
732
- if($array && is_array($array)){
733
- foreach($array as $k=>$v){
734
- if(array_key_exists($k, $authorization)&&(strlen($v))){
735
- $authorization->$k = $v;
736
- }
737
- }
738
- }
739
- return new SoapVar($authorization, SOAP_ENC_OBJECT, paylineSDK::soap_authorization, paylineSDK::PAYLINE_NAMESPACE);
740
- }
741
-
742
- /**
743
- * function card
744
- * @params : $array : array. the array keys are listed in pl_card CLASS.
745
- * @return : SoapVar : object
746
- * @description : build pl_card instance from $array and make SoapVar object for card.
747
- **/
748
- protected function card($array) {
749
- $card = new pl_card($array['type']);
750
- if($array && is_array($array)){
751
- foreach($array as $k=>$v){
752
- if(array_key_exists($k, $card)&&(strlen($v))){
753
- $card->$k = $v;
754
- }
755
- }
756
- }
757
- return new SoapVar($card, SOAP_ENC_OBJECT, paylineSDK::soap_card, paylineSDK::PAYLINE_NAMESPACE);
758
- }
759
-
760
-
761
-
762
- /**
763
- * function bankAccountData
764
- * @params : $array : array. the array keys are listed in pl_bankAccountData CLASS.
765
- * @return : SoapVar : object
766
- * @description : build pl_bankAccountData instance from $array and make SoapVar object for bankAccountData.
767
- **/
768
- protected function bankAccountData($array) {
769
- $bankAccountData = new pl_bankAccountData($array);
770
- if($array && is_array($array)){
771
- foreach($array as $k=>$v){
772
- if(array_key_exists($k, $bankAccountData)&&(strlen($v))){
773
- $bankAccountData->$k = $v;
774
- }
775
- }
776
- }
777
- return new SoapVar($bankAccountData, SOAP_ENC_OBJECT, paylineSDK::soap_bankAccountData, paylineSDK::PAYLINE_NAMESPACE);
778
- }
779
-
780
- /**
781
- * function cheque
782
- * @params : $array : array. the array keys are listed in pl_cheque CLASS.
783
- * @return : SoapVar : object
784
- * @description : build pl_authentication3DSecure instance from $array and make SoapVar object for cheque.
785
- **/
786
- protected function cheque($array) {
787
- $cheque = new pl_cheque($array);
788
- if($array && is_array($array)){
789
- foreach($array as $k=>$v){
790
- if(array_key_exists($k, $cheque)&&(strlen($v))){
791
- $cheque->$k = $v;
792
- }
793
- }
794
- }
795
- return new SoapVar($cheque, SOAP_ENC_OBJECT, paylineSDK::soap_cheque, paylineSDK::PAYLINE_NAMESPACE);
796
- }
797
-
798
- /****************************************************/
799
- // WALLET //
800
- /****************************************************/
801
-
802
- /**
803
- * function wallet
804
- * @params : array : array. the array keys are listed in pl_wallet CLASS.
805
- * @params : address : array. the array keys are listed in pl_address CLASS.
806
- * @params : card : array. the array keys are listed in pl_card CLASS.
807
- * @return : wallet: pl_wallet Object.
808
- * @description : build a wallet object.
809
- **/
810
- protected function wallet($array,$address,$card) {
811
- $wallet = new pl_wallet();
812
- if($array && is_array($array)){
813
- foreach($array as $k=>$v){
814
- if(array_key_exists($k, $wallet)&&(strlen($v)))$wallet->$k = $v;
815
- }
816
- }
817
-
818
- $wallet->shippingAddress = $this->address($address);
819
- $wallet->card = $this->card($card);
820
-
821
- return $wallet;
822
- }
823
-
824
- /**
825
- * function recurring
826
- * @params : array : array. the array keys are listed in pl_recurring CLASS.
827
- * @return : recurring object.
828
- * @description : build a recurring object.
829
- **/
830
- protected function recurring($array) {
831
- if($array){
832
- $recurring = new pl_recurring();
833
- if($array && is_array($array)){
834
- foreach($array as $k=>$v){
835
- if(array_key_exists($k, $recurring)&&(strlen($v)))$recurring->$k = $v;
836
- }
837
- }
838
- return $recurring;
839
- }
840
- else return null;
841
- }
842
-
843
- /**
844
- * function billingRecord
845
- * @params : array : array. the array keys are listed in pl_billingRecord CLASS.
846
- * @return : billingRecord object.
847
- * @description : build a billingRecord object.
848
- **/
849
- protected function billingRecord($array) {
850
- if($array){
851
- $billingRecord = new pl_billingRecord();
852
- if($array && is_array($array)){
853
- foreach($array as $k=>$v){
854
- if(array_key_exists($k, $billingRecord)&&(strlen($v)))$billingRecord->$k = $v;
855
- }
856
- }
857
- return $billingRecord;
858
- }
859
- else return null;
860
- }
861
-
862
- /**
863
- * function setItem
864
- * @params : $item : array. the array keys are listed in PL_ORDERDETAIL CLASS.
865
- * @description : Make $item SoapVar object and insert in items array
866
- **/
867
- public function setItem($item) {
868
- $orderDetail = new pl_orderDetail();
869
- if($item && is_array($item)){
870
- foreach($item as $k=>$v){
871
- if(array_key_exists($k, $orderDetail)&&(strlen($v)))$orderDetail->$k = $v;
872
- }
873
- }
874
- $this->items[] = new SoapVar($orderDetail, SOAP_ENC_OBJECT, paylineSDK::soap_orderDetail, paylineSDK::PAYLINE_NAMESPACE);
875
- }
876
-
877
- /**
878
- * function setPrivate
879
- * @params : $private : array. the array keys are listed in PRIVATE CLASS.
880
- * @description : Make $setPrivate SoapVar object and insert in privates array
881
- **/
882
- public function setPrivate($array) {
883
- $private = new pl_privateData();
884
- if($array && is_array($array)){
885
- foreach($array as $k=>$v){
886
- if(array_key_exists($k, $private)&&(strlen($v)))$private->$k = $v;
887
- }
888
- }
889
- $this->privates[] = new SoapVar($private, SOAP_ENC_OBJECT, paylineSDK::soap_privateData, paylineSDK::PAYLINE_NAMESPACE);
890
- }
891
-
892
- /**
893
- * function setWalletIdList
894
- * @params : sting : string if wallet id separated by ';'.
895
- * @return :
896
- * @description : make an array of wallet id .
897
- **/
898
- public function setWalletIdList($walletIdList) {
899
- if ($walletIdList) $this->walletIdList = explode(";", $walletIdList);
900
- if(empty($walletIdList))$this->walletIdList = array(0) ;
901
- }
902
-
903
- /**
904
- * Hide characters in a string
905
- * @param String $inString : the string to hide
906
- * @param int $n1 : number of characters shown at the begining of the string
907
- * @param int $n2 : number of characters shown at end begining of the string
908
- */
909
- private function hideChars($inString, $n1, $n2){
910
- $inStringLength = strlen($inString);
911
- if($inStringLength < ($n1+$n2)){
912
- return $inString;
913
- }
914
- $outString = substr($inString,0,$n1);
915
- $outString .= substr("********************",0,$inStringLength-($n1+$n2));
916
- $outString .= substr($inString,-($n2));
917
- return $outString;
918
- }
919
-
920
- /**
921
- * @method writeTrace
922
- * @desc write a trace in Payline log file
923
- * @param $trace : the string to add in the log file
924
- */
925
- public function writeTrace($trace){
926
- if($this->flagLog == 0){
927
- return;
928
- }else{
929
- if(!isset($this->logger)){
930
- if($this->flagLog == 1){ // log dans le répertoire par défaut
931
- $this->logger = new paylineLog(date('Y-m-d',time()).'.log');
932
- }
933
- if($this->flagLog == 2){ // log dans un répertoire spécifié
934
- $this->logger = new paylineLog(date('Y-m-d',time()).'.log',$this->pathLog);
935
- }
936
- }
937
- $this->logger->write($trace);
938
- }
939
- }
940
-
941
- /**
942
- * Custom base64 url encoding. Replace unsafe url chars
943
- *
944
- * @param string $input
945
- * @return string
946
- */
947
- public function base64_url_encode($input)
948
- {
949
- return strtr(base64_encode($input), '+/=', '-_,');
950
- }
951
-
952
- /**
953
- * Custom base64 url decode. Replace custom url safe values with normal
954
- * base64 characters before decoding.
955
- *
956
- * @param string $input
957
- * @return string
958
- */
959
- public function base64_url_decode($input)
960
- {
961
- return base64_decode(strtr($input, '-_,', '+/='));
962
- }
963
-
964
- // MCRYPT_RIJNDAEL_128 : AES compliant
965
- public function getEncrypt($message, $accessKey){
966
- $block = mcrypt_get_block_size('rijndael_128', 'ecb');
967
- $pad = $block - (strlen($message) % $block);
968
- $message .= str_repeat(chr($pad), $pad);
969
- return $this->base64_url_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $accessKey, $message, MCRYPT_MODE_ECB));
970
- }
971
-
972
- public function getDecrypt($message, $accessKey){
973
- $message = $this->base64_url_decode($message);
974
- $message = mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $accessKey, $message, MCRYPT_MODE_ECB);
975
- $block = mcrypt_get_block_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_ECB);
976
- $pad = ord($message[($len = strlen($message)) - 1]);
977
- $len = strlen($message);
978
- $pad = ord($message[$len-1]);
979
- $return = substr($message, 0, strlen($message) - $pad);
980
- $this->writeTrace("getDecrypt($message, $accessKey) = $return");
981
- return $return;
982
- }
983
-
984
- public function gzdecode($data,&$filename='',&$error='',$maxlength=null)
985
- {
986
- $this->writeTrace("gzdecode($data,$filename,$error,$maxlength)");
987
- $len = strlen($data);
988
- if ($len < 18 || strcmp(substr($data,0,2),"\x1f\x8b")) {
989
- $error = "Not in GZIP format.";
990
- return null; // Not GZIP format (See RFC 1952)
991
- }
992
- $method = ord(substr($data,2,1)); // Compression method
993
- $flags = ord(substr($data,3,1)); // Flags
994
- if ($flags & 31 != $flags) {
995
- $error = "Reserved bits not allowed.";
996
- return null;
997
- }
998
- // NOTE: $mtime may be negative (PHP integer limitations)
999
- $mtime = unpack("V", substr($data,4,4));
1000
- $mtime = $mtime[1];
1001
- $xfl = substr($data,8,1);
1002
- $os = substr($data,8,1);
1003
- $headerlen = 10;
1004
- $extralen = 0;
1005
- $extra = "";
1006
- if ($flags & 4) {
1007
- // 2-byte length prefixed EXTRA data in header
1008
- if ($len - $headerlen - 2 < 8) {
1009
- return false; // invalid
1010
- }
1011
- $extralen = unpack("v",substr($data,8,2));
1012
- $extralen = $extralen[1];
1013
- if ($len - $headerlen - 2 - $extralen < 8) {
1014
- return false; // invalid
1015
- }
1016
- $extra = substr($data,10,$extralen);
1017
- $headerlen += 2 + $extralen;
1018
- }
1019
- $filenamelen = 0;
1020
- $filename = "";
1021
- if ($flags & 8) {
1022
- // C-style string
1023
- if ($len - $headerlen - 1 < 8) {
1024
- return false; // invalid
1025
- }
1026
- $filenamelen = strpos(substr($data,$headerlen),chr(0));
1027
- if ($filenamelen === false || $len - $headerlen - $filenamelen - 1 < 8) {
1028
- return false; // invalid
1029
- }
1030
- $filename = substr($data,$headerlen,$filenamelen);
1031
- $headerlen += $filenamelen + 1;
1032
- }
1033
- $commentlen = 0;
1034
- $comment = "";
1035
- if ($flags & 16) {
1036
- // C-style string COMMENT data in header
1037
- if ($len - $headerlen - 1 < 8) {
1038
- return false; // invalid
1039
- }
1040
- $commentlen = strpos(substr($data,$headerlen),chr(0));
1041
- if ($commentlen === false || $len - $headerlen - $commentlen - 1 < 8) {
1042
- return false; // Invalid header format
1043
- }
1044
- $comment = substr($data,$headerlen,$commentlen);
1045
- $headerlen += $commentlen + 1;
1046
- }
1047
- $headercrc = "";
1048
- if ($flags & 2) {
1049
- // 2-bytes (lowest order) of CRC32 on header present
1050
- if ($len - $headerlen - 2 < 8) {
1051
- return false; // invalid
1052
- }
1053
- $calccrc = crc32(substr($data,0,$headerlen)) & 0xffff;
1054
- $headercrc = unpack("v", substr($data,$headerlen,2));
1055
- $headercrc = $headercrc[1];
1056
- if ($headercrc != $calccrc) {
1057
- $error = "Header checksum failed.";
1058
- return false; // Bad header CRC
1059
- }
1060
- $headerlen += 2;
1061
- }
1062
- // GZIP FOOTER
1063
- $datacrc = unpack("V",substr($data,-8,4));
1064
- $datacrc = sprintf('%u',$datacrc[1] & 0xFFFFFFFF);
1065
- $isize = unpack("V",substr($data,-4));
1066
- $isize = $isize[1];
1067
- // decompression:
1068
- $bodylen = $len-$headerlen-8;
1069
- if ($bodylen < 1) {
1070
- // IMPLEMENTATION BUG!
1071
- return null;
1072
- }
1073
- $body = substr($data,$headerlen,$bodylen);
1074
- $data = "";
1075
- if ($bodylen > 0) {
1076
- switch ($method) {
1077
- case 8:
1078
- // Currently the only supported compression method:
1079
- $data = gzinflate($body,$maxlength);
1080
- break;
1081
- default:
1082
- $error = "Unknown compression method.";
1083
- return false;
1084
- }
1085
- } // zero-byte body content is allowed
1086
- // Verifiy CRC32
1087
- $crc = sprintf("%u",crc32($data));
1088
- $crcOK = $crc == $datacrc;
1089
- $lenOK = $isize == strlen($data);
1090
- if (!$lenOK || !$crcOK) {
1091
- $error = ( $lenOK ? '' : 'Length check FAILED. ') . ( $crcOK ? '' : 'Checksum FAILED.');
1092
- return false;
1093
- }
1094
- return $data;
1095
- }
1096
-
1097
- private function webServiceRequest($array,$WSRequest,$PaylineAPI,$Method){
1098
- $reqTrace = "Request : $PaylineAPI.$Method";
1099
- $resTrace = '';
1100
- try{
1101
- $client = new SoapClient(dirname(__FILE__).'/'.paylineSDK::WSDL, $this->header_soap);
1102
- $client->__setLocation ($this->webServicesEndpoint.$PaylineAPI);
1103
-
1104
- if(isset($array['version'])&& strlen($array['version']))
1105
- $WSRequest['version'] = $array['version'];
1106
- else
1107
- $WSRequest['version'] = '';
1108
- if(isset($array['media'])&& strlen($array['media']))
1109
- $WSRequest['media'] = $array['media'];
1110
- else
1111
- $WSRequest['media'] = '';
1112
-
1113
- switch($Method){
1114
- case 'createMerchant':
1115
- $WSresponse = $client->createMerchant($WSRequest);
1116
- $response = paylineUtil::responseToArray($WSresponse);
1117
- break;
1118
- case 'createWallet':
1119
- $reqTrace .= '(contract = '.$array['contractNumber'].' - walletId = '.$array['wallet']['walletId'].' - card = '.$this->hideChars($array['card']['number'],4,4).')';
1120
- $WSresponse = $client->createWallet($WSRequest);
1121
- $response = paylineUtil::responseToArray($WSresponse);
1122
- break;
1123
- case 'createWebWallet':
1124
- $reqTrace .= '(contract = '.$array['contractNumber'].' - walletId = '.$array['buyer']['walletId'].')';
1125
- $WSresponse = $client->createWebWallet($WSRequest);
1126
- $response = paylineUtil::responseToArray($WSresponse);
1127
- if($response['result']['code'] == '00000'){
1128
- $resTrace = ' - token = '.$response['token'];
1129
- }
1130
- break;
1131
- case 'updatePaymentRecord':
1132
- $reqTrace .= '(contract = '.$array['contractNumber'].' - paymentRecordId = '.$array['paymentRecordId'].')';
1133
- $WSresponse = $client->updatePaymentRecord($WSRequest);
1134
- $response = paylineUtil::responseToArray($WSresponse);
1135
- break;
1136
- case 'getBillingRecord':
1137
- $reqTrace .= '(contract = '.$array['contractNumber'].' - paymentRecordId = '.$array['paymentRecordId'].' - billingRecordId = '.$array['billingRecordId'].')';
1138
- $WSresponse = $client->getBillingRecord($WSRequest);
1139
- $response = paylineUtil::responseToArray($WSresponse);
1140
- break;
1141
- case 'updateBillingRecord':
1142
- $reqTrace .= '(contract = '.$array['contractNumber'].' - paymentRecordId = '.$array['paymentRecordId'].' - billingRecordId = '.$array['billingRecordId'].')';
1143
- $WSresponse = $client->updateBillingRecord($WSRequest);
1144
- $response = paylineUtil::responseToArray($WSresponse);
1145
- break;
1146
- case 'disablePaymentRecord':
1147
- $reqTrace .= '(contract = '.$array['contractNumber'].' - paymentRecordId = '.$array['paymentRecordId'].')';
1148
- $WSresponse = $client->disablePaymentRecord($WSRequest);
1149
- $response = paylineUtil::responseToArray($WSresponse);
1150
- break;
1151
- case 'disableWallet':
1152
- $reqTrace .= '(contract = '.$array['contractNumber'].' - walletIdList = '.implode(';', $this->walletIdList).')';
1153
- $WSresponse = $client->disableWallet($WSRequest);
1154
- $response = paylineUtil::responseToArray($WSresponse);
1155
- break;
1156
- case 'doAuthorization':
1157
- $reqTrace .= '(contract = '.$array['payment']['contractNumber'].' - amount = '.$array['payment']['amount'].')';
1158
- $WSresponse = $client->doAuthorization($WSRequest);
1159
- $response = paylineUtil::responseToArray($WSresponse);
1160
- $resTrace = ' - transactionID = '.$response['transaction']['id'];
1161
- break;
1162
- case 'doCapture':
1163
- $reqTrace .= '(transactionID = '.$array['transactionID'].' - amount = '.$array['payment']['amount'].')';
1164
- $WSresponse = $client->doCapture($WSRequest);
1165
- $response = paylineUtil::responseToArray($WSresponse);
1166
- $resTrace = ' - transactionID = '.$response['transaction']['id'];
1167
- break;
1168
- case 'doCredit':
1169
- $reqTrace .= '(contract = '.$array['payment']['contractNumber'].' - order.ref = '.$array['order']['ref'].' - card = '.$this->hideChars($array['card']['number'],4,4).')';
1170
- $WSresponse = $client->doCredit($WSRequest);
1171
- $response = paylineUtil::responseToArray($WSresponse);
1172
- $resTrace = ' - transactionID = '.$response['transaction']['id'];
1173
- break;
1174
- case 'doDebit':
1175
- $reqTrace .= '(contract = '.$array['payment']['contractNumber'].' - order.ref = '.$array['order']['ref'].' - card = '.$this->hideChars($array['card']['number'],4,4).')';
1176
- $WSresponse = $client->doDebit($WSRequest);
1177
- $response = paylineUtil::responseToArray($WSresponse);
1178
- $resTrace = ' - transactionID = '.$response['transaction']['id'];
1179
- break;
1180
- case 'doImmediateWalletPayment':
1181
- $reqTrace .= '(contract = '.$array['payment']['contractNumber'].' - walletId = '.$array['walletId'].' - order.ref = '.$array['order']['ref'].')';
1182
- $WSresponse = $client->doImmediateWalletPayment($WSRequest);
1183
- $response = paylineUtil::responseToArray($WSresponse);
1184
- $resTrace = ' - transactionID = '.$response['transaction']['id'];
1185
- break;
1186
- case 'doReAuthorization':
1187
- $reqTrace .= '(transactionID = '.$array['transactionID'].' - amount = '.$array['payment']['amount'].')';
1188
- $WSresponse = $client->doReAuthorization($WSRequest);
1189
- $response = paylineUtil::responseToArray($WSresponse);
1190
- $resTrace = ' - transactionID = '.$response['transaction']['id'];
1191
- break;
1192
- case 'doRecurrentWalletPayment':
1193
- $reqTrace .= '(contract = '.$array['payment']['contractNumber'].' - walletId = '.$array['walletId'].' - order.ref = '.$array['order']['ref'].')';
1194
- $WSresponse = $client->doRecurrentWalletPayment($WSRequest);
1195
- $response = paylineUtil::responseToArray($WSresponse);
1196
- if($response['result']['code'] == '02500'){
1197
- $resTrace = ' - paymentRecordId = '.$response['paymentRecordId'];
1198
- }
1199
- break;
1200
- case 'doRefund':
1201
- $reqTrace .= '(transactionID = '.$array['transactionID'].' - amount = '.$array['payment']['amount'].')';
1202
- $WSresponse = $client->doRefund($WSRequest);
1203
- $response = paylineUtil::responseToArray($WSresponse);
1204
- $resTrace = ' - transactionID = '.$response['transaction']['id'];
1205
- break;
1206
- case 'doReset':
1207
- $reqTrace .= '(transactionID = '.$array['transactionID'].')';
1208
- $WSresponse = $client->doReset($WSRequest);
1209
- $response = paylineUtil::responseToArray($WSresponse);
1210
- $resTrace = ' - transactionID = '.$response['transaction']['id'];
1211
- break;
1212
- case 'doScheduledWalletPayment':
1213
- $reqTrace .= '(contract = '.$array['payment']['contractNumber'].' - walletId = '.$array['walletId'].' - order.ref = '.$array['order']['ref'].')';
1214
- $WSresponse = $client->doScheduledWalletPayment($WSRequest);
1215
- $response = paylineUtil::responseToArray($WSresponse);
1216
- if($response['result']['code'] == '02500'){
1217
- $resTrace = ' - paymentRecordId = '.$response['paymentRecordId'];
1218
- }
1219
- break;
1220
- case 'doScoringCheque':
1221
- $WSresponse = $client->doScoringCheque($WSRequest);
1222
- $response = paylineUtil::responseToArray($WSresponse);
1223
- break;
1224
- case 'doWebPayment':
1225
- $reqTrace .= '(order.ref = '.$array['order']['ref'].')';
1226
- $WSresponse = $client->doWebPayment($WSRequest);
1227
- $response = paylineUtil::responseToArray($WSresponse);
1228
- if($response['result']['code'] == '00000'){
1229
- $resTrace = ' - token = '.$response['token'];
1230
- }
1231
- break;
1232
- case 'enableWallet':
1233
- $reqTrace .= '(walletId = '.$array['walletId'].')';
1234
- $WSresponse = $client->enableWallet($WSRequest);
1235
- $response = paylineUtil::responseToArray($WSresponse);
1236
- break;
1237
- case 'getAlertDetails':
1238
- $reqTrace .= '(alertId = '.$array['AlertId'].' - transactionId = '.$array['TransactionId'].')';
1239
- $WSresponse = $client->getAlertDetails($WSRequest);
1240
- $response = paylineUtil::responseToArray($WSresponse);
1241
- break;
1242
- case 'getBalance':
1243
- $reqTrace .= '(contract = '.$array['contractNumber'].' - cardID = '.$this->hideChars($array['cardID'],4,4).')';
1244
- $WSresponse = $client->getBalance($WSRequest);
1245
- $response = paylineUtil::responseToArray($WSresponse);
1246
- break;
1247
- case 'getCards':
1248
- $reqTrace .= '(contract - '.$array['contractNumber'].' - walletId = '.$array['walletId'].' - cardInd = '.$array['cardInd'].')';
1249
- $WSresponse = $client->getCards($WSRequest);
1250
- $response = paylineUtil::responseToArrayForGetCards($WSresponse);
1251
- break;
1252
- case 'getEncryptionKey':
1253
- $WSresponse = $client->getEncryptionKey($WSRequest);
1254
- $response = paylineUtil::responseToArray($WSresponse);
1255
- break;
1256
- case 'getMerchantSettings':
1257
- $WSresponse = $client->getMerchantSettings($WSRequest);
1258
- $response = paylineUtil::responseToArray($WSresponse);
1259
- break;
1260
- case 'getPaymentRecord':
1261
- $reqTrace .= '(contract = '.$array['contractNumber'].' - paymentRecordId = '.$array['paymentRecordId'].')';
1262
- $WSresponse = $client->getPaymentRecord($WSRequest);
1263
- $response = paylineUtil::responseToArray($WSresponse);
1264
- break;
1265
- case 'getToken':
1266
- $reqTrace .= '(contract = '.$array['contractNumber'].' - cardNumber = '.$this->hideChars($array['cardNumber'],4,4).')';
1267
- $WSresponse = $client->getToken($WSRequest);
1268
- $response = paylineUtil::responseToArray($WSresponse);
1269
- if($response['result']['code'] == '02500'){
1270
- $resTrace = ' - token = '.$response['token'];
1271
- }
1272
- break;
1273
- case 'getTransactionDetails':
1274
- $reqTrace = '(transactionId = '.$array['transactionId'].')';
1275
- $WSresponse = $client->getTransactionDetails($WSRequest);
1276
- $response = paylineUtil::responseToArray($WSresponse);
1277
- break;
1278
- case 'getWallet':
1279
- $reqTrace .= '(contract = '.$array['contractNumber'].' - walletId = '.$array['walletId'].' - cardInd = '.$array['cardInd'].')';
1280
- $WSresponse = $client->getWallet($WSRequest);
1281
- $response = paylineUtil::responseToArray($WSresponse);
1282
- break;
1283
- case 'getWebPaymentDetails':
1284
- $reqTrace .= '(token = '.$array['token'].')';
1285
- $WSresponse = $client->getWebPaymentDetails($WSRequest);
1286
- $response = paylineUtil::responseToArray($WSresponse);
1287
- if(isset($response['transaction']['id'])){
1288
- $resTrace = ' - transactionId = '.$response['transaction']['id'];
1289
- }
1290
- break;
1291
- case 'getWebWallet':
1292
- $reqTrace .= '(token = '.$array['token'].')';
1293
- $WSresponse = $client->getWebWallet($WSRequest);
1294
- $response = paylineUtil::responseToArray($WSresponse);
1295
- if(isset($response['wallet']['card'])){
1296
- $resTrace = ' - card = '.$this->hideChars($response['wallet']['card']['number'],4,4);
1297
- }
1298
- break;
1299
- case 'manageWebWallet' :
1300
- $reqTrace .= '(contract = '.$array['contractNumber'].' - walletId = '.$array['buyer']['walletId'].')';
1301
- $WSresponse = $client->manageWebWallet($WSRequest);
1302
- $response = paylineUtil::responseToArray($WSresponse);
1303
- if($response['result']['code'] == '00000'){
1304
- $resTrace = ' - token = '.$response['token'];
1305
- }
1306
- break;
1307
- case 'transactionsSearch':
1308
- $reqTrace .= '(';
1309
- foreach ($array as $key => $value) {
1310
- $reqTrace .= $value != '' ? "$key = $value - " : '';
1311
- }
1312
- $reqTrace .= ')';
1313
- $WSresponse = $client->transactionsSearch($WSRequest);
1314
- $response = paylineUtil::responseToArray($WSresponse);
1315
- break;
1316
- case 'unBlock':
1317
- $reqTrace .= '(transactionID = '.$array['transactionID'].')';
1318
- $WSresponse = $client->unBlock($WSRequest);
1319
- $response = paylineUtil::responseToArray($WSresponse);
1320
- break;
1321
- case 'updateWallet':
1322
- $reqTrace .= '(walletId = '.$array['wallet']['walletId'].')';
1323
- $WSresponse = $client->updateWallet($WSRequest);
1324
- $response = paylineUtil::responseToArray($WSresponse);
1325
- break;
1326
- case 'updateWebWallet':
1327
- $reqTrace .= '(walletId = '.$array['walletId'].')';
1328
- $WSresponse = $client->updateWebWallet($WSRequest);
1329
- $response = paylineUtil::responseToArray($WSresponse);
1330
- if($response['result']['code'] == '00000'){
1331
- $resTrace = ' - token = '.$response['token'];
1332
- }
1333
- break;
1334
- case 'verifyAuthentication':
1335
- $reqTrace .= '(contract = '.$array['contractNumber'].' - card = '.$this->hideChars($array['card']['number'],4,4).')';
1336
- $WSresponse = $client->verifyAuthentication($WSRequest);
1337
- $response = paylineUtil::responseToArray($WSresponse);
1338
- break;
1339
- case 'verifyEnrollment':
1340
- if(!empty($array['card']['number']) and !empty($array['payment']['contractNumber'])) {
1341
- $reqTrace .= '(contract = '.$array['payment']['contractNumber'].' - card = '.$this->hideChars($array['card']['number'],4,4).')';
1342
- }
1343
- $WSresponse = $client->verifyEnrollment($WSRequest);
1344
- $response = paylineUtil::responseToArray($WSresponse);
1345
- break;
1346
-
1347
- }
1348
- $this->writeTrace($reqTrace);
1349
- $this->writeTrace('Response : code = '.$response['result']['code'].$resTrace);
1350
- return $response;
1351
- }catch ( Exception $e ) {
1352
- $this->writeTrace($reqTrace);
1353
- $this->writeTrace("Exception : ".$e->getMessage());
1354
- $ERROR = array();
1355
- $ERROR['result']['code'] = paylineSDK::ERR_CODE;
1356
- $ERROR['result']['longMessage'] = $e->getMessage();
1357
- $ERROR['result']['shortMessage'] = $e->getMessage();
1358
- return $ERROR;
1359
- }
1360
- }
1361
-
1362
- public function createWallet($array){
1363
- if(!isset($array['walletContracts'])||!strlen($array['walletContracts'][0]))$array['walletContracts'] = '';
1364
- if(!isset($array['buyer']))$array['buyer'] = null;
1365
- if(!isset($array['billingAddress']))$array['billingAddress'] = null;
1366
- if(!isset($array['shippingAddress']))$array['shippingAddress'] = null;
1367
- if(!isset($array['owner']))$array['owner'] = null;
1368
- if(!isset($array['ownerAddress']))$array['ownerAddress'] = null;
1369
- $WSRequest = array (
1370
- 'contractNumber' => $array['contractNumber'],
1371
- 'wallet' => $this->wallet($array['wallet'],$array['address'],$array['card']),
1372
- 'buyer' => $this->buyer($array['buyer'],$array['shippingAddress'],$array['billingAddress']),
1373
- 'owner' => $this->owner($array['owner'],$array['ownerAddress']),
1374
- 'privateDataList' => $this->privates,
1375
- 'authentication3DSecure' =>$this->authentication3DSecure($array['3DSecure']),
1376
- 'contractNumberWalletList' => $this->secondContracts($array['walletContracts'])
1377
- );
1378
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'createWallet');
1379
- }
1380
-
1381
- public function createWebWallet($array){
1382
- if(isset($array['customPaymentPageCode'])&& strlen($array['customPaymentPageCode'])) $this->customPaymentPageCode = $array['customPaymentPageCode'];
1383
- if(isset($array['cancelURL'])&& strlen($array['cancelURL'])) $this->cancelURL = $array['cancelURL'];
1384
- if(isset($array['notificationURL']) && strlen($array['notificationURL'])) $this->notificationURL = $array['notificationURL'];
1385
- if(isset($array['returnURL'])&& strlen($array['returnURL'])) $this->returnURL = $array['returnURL'];
1386
- if(isset($array['customPaymentTemplateURL'])&& strlen($array['customPaymentTemplateURL'])) $this->customPaymentTemplateURL = $array['customPaymentTemplateURL'];
1387
- if(isset($array['customPaymentPageCode'])&& strlen($array['customPaymentPageCode'])) $this->customPaymentPageCode = $array['customPaymentPageCode'];
1388
- if(isset($array['languageCode'])&& strlen($array['languageCode'])) $this->languageCode = $array['languageCode'];
1389
- if(isset($array['securityMode'])&& strlen($array['securityMode'])) $this->securityMode = $array['securityMode'];
1390
- if(!isset($array['contracts'])||!strlen($array['contracts'][0]))$array['contracts'] = '';
1391
- if(!isset($array['walletContracts'])||!strlen($array['walletContracts'][0]))$array['walletContracts'] = '';
1392
- $WSRequest = array (
1393
- 'contractNumber' => $array['contractNumber'],
1394
- 'selectedContractList' => $this->contracts($array['contracts']),
1395
- 'updatePersonalDetails' => $array['updatePersonalDetails'],
1396
- 'buyer' => $this->buyer($array['buyer'],$array['shippingAddress'],$array['billingAddress']),
1397
- 'languageCode' => $this->languageCode,
1398
- 'customPaymentPageCode' => $this->customPaymentPageCode,
1399
- 'securityMode' => $this->securityMode,
1400
- 'returnURL' => $this->returnURL,
1401
- 'cancelURL' => $this->cancelURL,
1402
- 'notificationURL' => $this->notificationURL,
1403
- 'privateDataList' => $this->privates,
1404
- 'customPaymentTemplateURL' => $this->customPaymentTemplateURL,
1405
- 'contractNumberWalletList' => $this->secondContracts($array['walletContracts'])
1406
- );
1407
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::WEB_API,'createWebWallet');
1408
- }
1409
-
1410
- public function disablePaymentRecord($array){
1411
- $WSRequest = array (
1412
- 'contractNumber' => $array['contractNumber'],
1413
- 'paymentRecordId' => $array['paymentRecordId']
1414
- );
1415
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'disablePaymentRecord');
1416
- }
1417
-
1418
- public function disableWallet($array){
1419
- $WSRequest = array (
1420
- 'contractNumber' => $array['contractNumber'],
1421
- 'walletIdList' => $this->walletIdList,
1422
- 'cardInd' => $array['cardInd']
1423
- );
1424
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'disableWallet');
1425
- }
1426
-
1427
- public function doAuthorization($array){
1428
- if(!isset($array['buyer']))$array['buyer'] = null;
1429
- if(!isset($array['owner']))$array['owner'] = null;
1430
- if(!isset($array['billingAddress']))$array['billingAddress'] = null;
1431
- if(!isset($array['shippingAddress']))$array['shippingAddress'] = null;
1432
- if(!isset($array['ownerAddress']))$array['ownerAddress'] = null;
1433
- if(!isset($array['3DSecure']))$array['3DSecure'] = null;
1434
- if(!isset($array['bankAccountData']))$array['bankAccountData'] = null;
1435
- $WSRequest = array (
1436
- 'payment' => $this->payment($array['payment']),
1437
- 'card' => $this->card($array['card']),
1438
- 'order' => $this->order($array['order']),
1439
- 'buyer' => $this->buyer($array['buyer'],$array['shippingAddress'],$array['billingAddress']),
1440
- 'owner' => $this->owner($array['owner'],$array['ownerAddress']),
1441
- 'privateDataList' => $this->privates,
1442
- 'authentication3DSecure' =>$this->authentication3DSecure($array['3DSecure']),
1443
- 'bankAccountData' => $this->bankAccountData($array['bankAccountData'])
1444
- );
1445
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'doAuthorization');
1446
- }
1447
-
1448
- public function doCapture($array){
1449
- $WSRequest = array (
1450
- 'transactionID' =>$array['transactionID'],
1451
- 'payment' => $this->payment($array['payment']),
1452
- 'privateDataList' => $this->privates,
1453
- 'sequenceNumber'=>$array['sequenceNumber']
1454
- );
1455
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'doCapture');
1456
- }
1457
-
1458
- public function doCredit($array){
1459
- if(!isset($array['buyer']))$array['buyer'] = null;
1460
- if(!isset($array['billingAddress']))$array['billingAddress'] = null;
1461
- if(!isset($array['shippingAddress']))$array['shippingAddress'] = null;
1462
- $WSRequest = array (
1463
- 'payment' => $this->payment($array['payment']),
1464
- 'card' => $this->card($array['card']),
1465
- 'buyer' => $this->buyer($array['buyer'],$array['shippingAddress'],$array['billingAddress']),
1466
- 'privateDataList' => $this->privates,
1467
- 'order' => $this->order($array['order']),
1468
- 'comment' =>$array['comment']
1469
- );
1470
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'doCredit');
1471
- }
1472
-
1473
- public function doDebit($array){
1474
- if(!isset($array['buyer']))$array['buyer'] = null;
1475
- if(!isset($array['billingAddress']))$array['billingAddress'] = null;
1476
- if(!isset($array['shippingAddress']))$array['shippingAddress'] = null;
1477
- $WSRequest = array (
1478
- 'payment' => $this->payment($array['payment']),
1479
- 'card' => $this->card($array['card']),
1480
- 'order' => $this->order($array['order']),
1481
- 'privateDataList' => $this->privates,
1482
- 'buyer' => $this->buyer($array['buyer'],$array['shippingAddress'],$array['billingAddress']),
1483
- 'authentication3DSecure' =>$this->authentication3DSecure($array['3DSecure']),
1484
- 'authorization' =>$this->authorization($array['authorization'])
1485
- );
1486
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'doDebit');
1487
- }
1488
-
1489
- public function doImmediateWalletPayment($array){
1490
- if(!isset($array['buyer']))$array['buyer'] = null;
1491
- if(!isset($array['billingAddress']))$array['billingAddress'] = null;
1492
- if(!isset($array['shippingAddress']))$array['shippingAddress'] = null;
1493
- if(!isset($array['3DSecure']))$array['3DSecure'] = null;
1494
- $WSRequest = array (
1495
- 'payment' => $this->payment($array['payment']),
1496
- 'order' => $this->order($array['order']),
1497
- 'buyer' => $this->buyer($array['buyer'],$array['shippingAddress'],$array['billingAddress']),
1498
- 'walletId' => $array['walletId'],
1499
- 'cardInd' => $array['cardInd'],
1500
- 'cvx' => $array['walletCvx'],
1501
- 'privateDataList' => $this->privates,
1502
- 'authentication3DSecure' =>$this->authentication3DSecure($array['3DSecure'])
1503
- );
1504
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'doImmediateWalletPayment');
1505
- }
1506
-
1507
- public function doReAuthorization($array){
1508
- $WSRequest = array (
1509
- 'transactionID' => $array['transactionID'],
1510
- 'payment' => $this->payment($array['payment']),
1511
- 'order' => $this->order($array['order']),
1512
- 'privateDataList' => $this->privates
1513
- );
1514
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'doReAuthorization');
1515
- }
1516
-
1517
- public function doRecurrentWalletPayment($array){
1518
- if(!isset($array['orderRef']))$array['orderRef'] = null;
1519
- if(!isset($array['orderDate']))$array['orderDate'] = null;
1520
- if(!isset($array['scheduledDate']))$array['scheduledDate'] = null;
1521
- $WSRequest = array (
1522
- 'payment' => $this->payment($array['payment']),
1523
- 'orderRef' => $array['orderRef'],
1524
- 'orderDate' => $array['orderDate'],
1525
- 'scheduledDate' => $array['scheduledDate'],
1526
- 'walletId' => $array['walletId'],
1527
- 'cardInd' => $array['cardInd'],
1528
- 'recurring' => $this->recurring($array['recurring']),
1529
- 'privateDataList' => $this->privates,
1530
- 'order' => $this->order($array['order'])
1531
- );
1532
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'doRecurrentWalletPayment');
1533
- }
1534
-
1535
- public function doRefund($array){
1536
- $WSRequest = array (
1537
- 'transactionID' =>$array['transactionID'],
1538
- 'payment' =>$this->payment($array['payment']),
1539
- 'comment' =>$array['comment'],
1540
- 'privateDataList' => $this->privates,
1541
- 'sequenceNumber'=>$array['sequenceNumber']
1542
- );
1543
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'doRefund');
1544
- }
1545
-
1546
- public function doReset($array){
1547
- $WSRequest = array (
1548
- 'transactionID' => $array['transactionID'],
1549
- 'comment' => $array['comment']
1550
- );
1551
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'doReset');
1552
- }
1553
-
1554
- public function doScheduledWalletPayment($array){
1555
- if(!isset($array['orderRef']))$array['orderRef'] = null;
1556
- if(!isset($array['orderDate']))$array['orderDate'] = null;
1557
- $WSRequest = array (
1558
- 'payment' => $this->payment($array['payment']),
1559
- 'orderRef' => $array['orderRef'],
1560
- 'orderDate' => $array['orderDate'],
1561
- 'scheduledDate' => $array['scheduledDate'],
1562
- 'walletId' => $array['walletId'],
1563
- 'cardInd' => $array['cardInd'],
1564
- 'order' => $this->order($array['order']),
1565
- 'privateDataList' => $this->privates
1566
- );
1567
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'doScheduledWalletPayment');
1568
- }
1569
-
1570
- public function doScoringCheque($array){
1571
- $WSRequest = array (
1572
- 'payment' => $this->payment($array['payment']),
1573
- 'cheque' => $this->cheque($array['cheque']),
1574
- 'order' => $this->order($array['order']),
1575
- 'privateDataList' => $this->privates
1576
- );
1577
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'doScoringCheque');
1578
- }
1579
-
1580
- public function doWebPayment($array){
1581
- if(isset($array['cancelURL'])&& strlen($array['cancelURL'])) $this->cancelURL = $array['cancelURL'];
1582
- if(isset($array['notificationURL']) && strlen($array['notificationURL'])) $this->notificationURL = $array['notificationURL'];
1583
- if(isset($array['returnURL'])&& strlen($array['returnURL'])) $this->returnURL = $array['returnURL'];
1584
- if(isset($array['customPaymentTemplateURL'])&& strlen($array['customPaymentTemplateURL'])) $this->customPaymentTemplateURL = $array['customPaymentTemplateURL'];
1585
- if(isset($array['customPaymentPageCode'])&& strlen($array['customPaymentPageCode'])) $this->customPaymentPageCode = $array['customPaymentPageCode'];
1586
- if(isset($array['languageCode'])&& strlen($array['languageCode'])) $this->languageCode = $array['languageCode'];
1587
- if(isset($array['securityMode'])&& strlen($array['securityMode'])) $this->securityMode = $array['securityMode'];
1588
- if(!isset($array['payment']))$array['payment'] = null;
1589
- if(!isset($array['contracts'])||!strlen($array['contracts'][0]))$array['contracts'] = '';
1590
- if(!isset($array['secondContracts'])||!strlen($array['secondContracts'][0]))$array['secondContracts'] = '';
1591
- if(!isset($array['walletContracts'])||!strlen($array['walletContracts'][0]))$array['walletContracts'] = '';
1592
- if(!isset($array['buyer']))$array['buyer'] = null;
1593
- if(!isset($array['billingAddress']))$array['billingAddress'] = null;
1594
- if(!isset($array['shippingAddress']))$array['shippingAddress'] = null;
1595
- if(!isset($array['recurring']))$array['recurring'] = null;
1596
-
1597
- $WSRequest = array (
1598
- 'payment' => $this->payment($array['payment']),
1599
- 'returnURL' => $this->returnURL,
1600
- 'cancelURL' => $this->cancelURL,
1601
- 'order' => $this->order($array['order']),
1602
- 'notificationURL' => $this->notificationURL,
1603
- 'customPaymentTemplateURL' => $this->customPaymentTemplateURL,
1604
- 'selectedContractList' => $this->contracts($array['contracts']),
1605
- 'secondSelectedContractList' => $this->secondContracts($array['secondContracts']),
1606
- 'privateDataList' => $this->privates,
1607
- 'languageCode' => $this->languageCode,
1608
- 'customPaymentPageCode' => $this->customPaymentPageCode,
1609
- 'buyer' => $this->buyer($array['buyer'],$array['shippingAddress'],$array['billingAddress']),
1610
- 'securityMode' => $this->securityMode,
1611
- 'contractNumberWalletList' => $this->secondContracts($array['walletContracts'])
1612
- );
1613
-
1614
-
1615
- if(isset($array['payment']['mode'])){
1616
- if(($array['payment']['mode'] == "REC") || ($array['payment']['mode'] == "NX")) {
1617
- $WSRequest['recurring'] = $this->recurring($array['recurring']);
1618
- }
1619
- }
1620
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::WEB_API,'doWebPayment');
1621
- }
1622
-
1623
- public function enableWallet($array){
1624
- $WSRequest = array (
1625
- 'contractNumber' => $array['contractNumber'],
1626
- 'walletId' => $array['walletId'],
1627
- 'cardInd' => $array['cardInd']
1628
- );
1629
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'enableWallet');
1630
- }
1631
-
1632
- public function getServletTokenUrl(){
1633
- return $this->servletTokenUrl;
1634
- }
1635
-
1636
- public function getWidgetJavascriptUrl(){
1637
- return $this->widgetJavascriptUrl;
1638
- }
1639
-
1640
- public function getWidgetCssUrl(){
1641
- return $this->widgetCssUrl;
1642
- }
1643
-
1644
- public function getAlertDetails($array){
1645
- $WSRequest = array(
1646
- 'AlertId' => $array['AlertId'],
1647
- 'TransactionId' => $array['TransactionId']
1648
- );
1649
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::EXTENDED_API,'getAlertDetails');
1650
- }
1651
-
1652
- public function getBalance($array){
1653
- $WSRequest = array(
1654
- 'contractNumber' => $array['contractNumber'],
1655
- 'cardID' => $array['cardID']
1656
- );
1657
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'getBalance');
1658
- }
1659
-
1660
- public function getCards($array){
1661
- $WSRequest = array (
1662
- 'contractNumber' => $array['contractNumber'],
1663
- 'walletId' => $array['walletId'],
1664
- 'cardInd' => $array['cardInd']
1665
- );
1666
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'getCards');
1667
- }
1668
-
1669
- public function getEncryptionKey($array){
1670
- $WSRequest = array();
1671
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'getEncryptionKey');
1672
- }
1673
-
1674
- public function getMerchantSettings($array){
1675
- $WSRequest = array();
1676
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'getMerchantSettings');
1677
- }
1678
-
1679
- private function getPaymentMeans(){
1680
- $this->writeTrace('getPaymentMeans');
1681
- try{
1682
- $client = new SoapClient(dirname(__FILE__).'/PaylineByMonext.wsdl', $this->header_soap);
1683
- $WSresponse = $client->getPaymentMeans();
1684
- $response = paylineUtil::responseToArray($WSresponse);
1685
- $this->writeTrace($response['result']);
1686
- return $response;
1687
- }catch ( Exception $e ) {
1688
- $this->writeTrace("Exception : ".$e->getMessage());
1689
- $ERROR = array();
1690
- $ERROR['result']['code'] = paylineSDK::ERR_CODE;
1691
- $ERROR['result']['longMessage'] = $e->getMessage();
1692
- $ERROR['result']['shortMessage'] = $e->getMessage();
1693
- return $ERROR;
1694
- }
1695
- }
1696
-
1697
- private function addPOSFromObject($oPointOfSell,$pos){
1698
- if(isset($oPointOfSell->contracts->contract)){
1699
- $this->posData[$pos] = array();
1700
- $this->posData[$pos]['label'] = $oPointOfSell->label;
1701
- $this->posData[$pos]['contracts'] = array();
1702
- if(sizeof($oPointOfSell->contracts->contract) > 1){
1703
- // more than 1 active contract in this point of sell
1704
- $ctr = 0;
1705
- foreach ($oPointOfSell->contracts->contract as $contract){
1706
- $this->posData[$pos]['contracts'][$ctr] = array();
1707
- $this->posData[$pos]['contracts'][$ctr]['cardType'] = $contract->cardType;
1708
- $this->posData[$pos]['contracts'][$ctr]['label'] = $contract->label;
1709
- $this->posData[$pos]['contracts'][$ctr]['contractNumber'] = $contract->contractNumber;
1710
- $this->posData[$pos]['contracts'][$ctr]['logo'] = $this->paymentMeansLogos[$this->posData[$pos]['contracts'][$ctr]['cardType']]; // default logo
1711
- if($contract->logoEnable){
1712
- $this->posData[$pos]['contracts'][$ctr]['logo'] = $this->downloadCustomLogo($contract->normalLogo, $contract->normalLogoMime, $contract->contractNumber, $oPointOfSell->label);
1713
- }
1714
- $ctr++;
1715
- }
1716
- }else{ // only 1 active contract in this point of sell
1717
- $this->posData[$pos]['contracts'][0] = array();
1718
- $this->posData[$pos]['contracts'][0]['cardType'] = $oPointOfSell->contracts->contract->cardType;
1719
- $this->posData[$pos]['contracts'][0]['label'] = $oPointOfSell->contracts->contract->label;
1720
- $this->posData[$pos]['contracts'][0]['contractNumber'] = $oPointOfSell->contracts->contract->contractNumber;
1721
- $this->posData[$pos]['contracts'][0]['logo'] = $this->paymentMeansLogos[$this->posData[$pos]['contracts'][0]['cardType']]; // default logo
1722
- if($oPointOfSell->contracts->contract->logoEnable){
1723
- $this->posData[$pos]['contracts'][0]['logo'] = $this->downloadCustomLogo($oPointOfSell->contracts->contract->normalLogo, $oPointOfSell->contracts->contract->normalLogoMime, $oPointOfSell->contracts->contract->contractNumber, $oPointOfSell->label);
1724
- }
1725
- }
1726
- }else{ // no contract in this point of sell
1727
- return false;
1728
- }
1729
-
1730
- return true;
1731
- }
1732
-
1733
- private function addPOSFromArray($aPointOfSell,$pos){
1734
- if(isset($aPointOfSell['contracts']['contract'])){
1735
- $this->posData[$pos] = array();
1736
- $this->posData[$pos]['label'] = $aPointOfSell['label'];
1737
- $this->posData[$pos]['contracts'] = array();
1738
- if(isset($aPointOfSell['contracts']['contract']['label'])){
1739
- // only 1 active contract in this point of sell
1740
- $this->posData[$pos]['contracts'][0] = array();
1741
- $this->posData[$pos]['contracts'][0]['cardType'] = $aPointOfSell['contracts']['contract']['cardType'];
1742
- $this->posData[$pos]['contracts'][0]['label'] = $aPointOfSell['contracts']['contract']['label'];
1743
- $this->posData[$pos]['contracts'][0]['contractNumber'] = $aPointOfSell['contracts']['contract']['contractNumber'];
1744
- $this->posData[$pos]['contracts'][0]['logo'] = $this->paymentMeansLogos[$this->posData[$pos]['contracts'][0]['cardType']]; // default logo
1745
- if($aPointOfSell['contracts']['contract']['logoEnable']){
1746
- $this->posData[$pos]['contracts'][0]['logo'] = $this->downloadCustomLogo($aPointOfSell['contracts']['contract']['normalLogo'], $aPointOfSell['contracts']['contract']['normalLogoMime'], $aPointOfSell['contracts']['contract']['contractNumber'], $aPointOfSell['label']);
1747
- }
1748
- }else{ // more than 1 active contract in this point of sell
1749
- $ctr = 0;
1750
- foreach ($aPointOfSell['contracts']['contract'] as $contract){
1751
- $this->posData[$pos]['contracts'][$ctr] = array();
1752
- $this->posData[$pos]['contracts'][$ctr]['cardType'] = $contract->cardType;
1753
- $this->posData[$pos]['contracts'][$ctr]['label'] = $contract->label;
1754
- $this->posData[$pos]['contracts'][$ctr]['contractNumber'] = $contract->contractNumber;
1755
- $this->posData[$pos]['contracts'][$ctr]['logo'] = $this->paymentMeansLogos[$this->posData[$pos]['contracts'][$ctr]['cardType']]; // default logo
1756
- if($contract->logoEnable){
1757
- $this->posData[$pos]['contracts'][$ctr]['logo'] = $this->downloadCustomLogo($contract->normalLogo, $contract->normalLogoMime, $contract->contractNumber, $aPointOfSell['label']);
1758
- }
1759
- $ctr++;
1760
- }
1761
- }
1762
- }else{ // no contract in this point of sell
1763
- return false;
1764
- }
1765
- return true;
1766
- }
1767
-
1768
- private function absoluteURL($path) {
1769
- $dir = str_replace('\\', '/', dirname($path));
1770
- return $_SERVER['HTTP_ORIGIN'].'/'.substr($dir, strlen($_SERVER['DOCUMENT_ROOT'])).'/';
1771
- }
1772
-
1773
- private function downloadCustomLogo($base64String,$mimeType,$contractNumber,$posLabel){
1774
- $mime = explode('/', $mimeType);
1775
- if($this->customLogoPath != null){
1776
- if(!file_exists($this->customLogoPath)){
1777
- mkdir($this->customLogoPath);
1778
- }
1779
- $posDir = $this->customLogoPath.$posLabel.DIRECTORY_SEPARATOR;
1780
- }else{
1781
- $merchantDir = dirname(__DIR__).DIRECTORY_SEPARATOR.paylineSDK::DEFAULT_LOGO_DIR.DIRECTORY_SEPARATOR.$this->header_soap['login'].DIRECTORY_SEPARATOR;
1782
- if(!file_exists($merchantDir)){
1783
- mkdir($merchantDir);
1784
- }
1785
- $posDir = $merchantDir.$posLabel.DIRECTORY_SEPARATOR;
1786
- }
1787
- if(!file_exists($posDir)){
1788
- mkdir($posDir);
1789
- }
1790
- $output_file = $posDir.$contractNumber.'.'.$mime[1];
1791
-
1792
- try{
1793
- if(file_put_contents($output_file,$base64String)){
1794
- return $this->absoluteURL($output_file).$contractNumber.'.'.$mime[1];
1795
- }else{
1796
- $this->writeTrace("Error : downloadCustomLogo for contract $contractNumber under $posDir failed");
1797
- return paylineSDK::ERR_CODE;
1798
- }
1799
- }catch (Exception $e){
1800
- $this->writeTrace("Exception : downloadCustomLogo for contract $contractNumber of pos $posLabel - ".$e->getMessage());
1801
- return paylineSDK::ERR_CODE;
1802
- }
1803
- }
1804
-
1805
- public function getMerchantSettingsToArray($array){
1806
- /*
1807
- * Association between Payment mean types and logos URL
1808
- */
1809
- $getPaymentMeansResponse = $this->getPaymentMeans();
1810
- if($getPaymentMeansResponse['result']['code'] != paylineSDK::ERR_CODE){
1811
- $this->paymentMeansLogos = array();
1812
- for($i=0 ; $i<sizeof($getPaymentMeansResponse['listPaymentMean']['paymentMean']) ; $i++){
1813
- $this->paymentMeansLogos[$getPaymentMeansResponse['listPaymentMean']['paymentMean'][$i]->code] = $getPaymentMeansResponse['listPaymentMean']['paymentMean'][$i]->logoUrl;
1814
- }
1815
- }
1816
-
1817
- if(isset($array['logoPath'])){
1818
- $this->customLogoPath = $array['logoPath'];
1819
- }
1820
- $getMerchantSettingsRes = $this->getMerchantSettings($array);
1821
- if(isset($getMerchantSettingsRes['listPointOfSell']['pointOfSell']['label'])){
1822
- // only 1 active point of sell
1823
- $aPointOfSell = $getMerchantSettingsRes['listPointOfSell']['pointOfSell'];
1824
- $this->addPOSFromArray($aPointOfSell, 0);
1825
- }else{ // more than 1 active point of sell
1826
- $index = 0;
1827
- foreach ($getMerchantSettingsRes['listPointOfSell']['pointOfSell'] as $oPointOfSell){
1828
- if($this->addPOSFromObject($oPointOfSell, $index)){
1829
- $index++; // no incrementation if pos was not added
1830
- }
1831
- }
1832
- }
1833
- $res = array('result' => $getMerchantSettingsRes['result'],'POS' => $this->posData);
1834
- return $res;
1835
- }
1836
-
1837
- public function getPaymentRecord($array){
1838
- $WSRequest = array (
1839
- 'contractNumber' => $array['contractNumber'],
1840
- 'paymentRecordId' => $array['paymentRecordId']
1841
- );
1842
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'getPaymentRecord');
1843
- }
1844
-
1845
- public function updatePaymentRecord($array){
1846
- $WSRequest = array (
1847
- 'contractNumber' => $array['contractNumber'],
1848
- 'paymentRecordId' => $array['paymentRecordId'],
1849
- 'recurring' => $this->recurring($array['recurring']),
1850
- );
1851
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'updatePaymentRecord');
1852
- }
1853
-
1854
- public function getBillingRecord($array){
1855
- $WSRequest = array (
1856
- 'contractNumber' => $array['contractNumber'],
1857
- 'paymentRecordId' => $array['paymentRecordId'],
1858
- 'billingRecordId' => $array['billingRecordId']
1859
- );
1860
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'getBillingRecord');
1861
- }
1862
-
1863
- public function updateBillingRecord($array){
1864
- $WSRequest = array (
1865
- 'contractNumber' => $array['contractNumber'],
1866
- 'paymentRecordId' => $array['paymentRecordId'],
1867
- 'billingRecordId' => $array['billingRecordId'],
1868
- 'billingRecordForUpdate' => $this->billingRecord($array['billingRecordForUpdate'])
1869
- );
1870
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'updateBillingRecord');
1871
- }
1872
-
1873
- public function getToken($array){
1874
- $WSRequest = array (
1875
- 'cardNumber' => $array['cardNumber'],
1876
- 'expirationDate' => $array['expirationDate'],
1877
- 'contractNumber' => $array['contractNumber']
1878
- );
1879
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'getToken');
1880
- }
1881
-
1882
- public function getTransactionDetails($array){
1883
- if(!isset($array['transactionId']))$array['transactionId'] = null;
1884
- if(!isset($array['orderRef']))$array['orderRef'] = null;
1885
- if(!isset($array['startDate']))$array['startDate'] = null;
1886
- if(!isset($array['endDate']))$array['endDate'] = null;
1887
- if(!isset($array['transactionHistory']))$array['transactionHistory'] = null;
1888
- if(!isset($array['archiveSearch']))$array['archiveSearch'] = null;
1889
- $WSRequest = array (
1890
- 'transactionId' => $array['transactionId'],
1891
- 'orderRef' => $array['orderRef'],
1892
- 'startDate' => $array['startDate'],
1893
- 'endDate' => $array['endDate'],
1894
- 'transactionHistory' => $array['transactionHistory'],
1895
- 'archiveSearch' => $array['archiveSearch']
1896
- );
1897
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::EXTENDED_API,'getTransactionDetails');
1898
- }
1899
- public function getWallet($array){
1900
- $WSRequest = array (
1901
- 'contractNumber' => $array['contractNumber'],
1902
- 'walletId' => $array['walletId'],
1903
- 'cardInd' => $array['cardInd']
1904
- );
1905
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'getWallet');
1906
- }
1907
-
1908
- public function getWebPaymentDetails($array){
1909
- return $this->webServiceRequest($array,$array,paylineSDK::WEB_API,'getWebPaymentDetails');
1910
- }
1911
-
1912
- public function getWebWallet($array){
1913
- return $this->webServiceRequest($array,$array,paylineSDK::WEB_API,'getWebWallet');
1914
- }
1915
-
1916
- public function manageWebWallet($array){
1917
- if(isset($array['cancelURL'])&& strlen($array['cancelURL'])) $this->cancelURL = $array['cancelURL'];
1918
- if(isset($array['notificationURL']) && strlen($array['notificationURL'])) $this->notificationURL = $array['notificationURL'];
1919
- if(isset($array['returnURL'])&& strlen($array['returnURL'])) $this->returnURL = $array['returnURL'];
1920
- if(!isset($array['buyer']))$array['buyer'] = null;
1921
- if(!isset($array['billingAddress']))$array['billingAddress'] = null;
1922
- if(!isset($array['shippingAddress']))$array['shippingAddress'] = null;
1923
- if(!isset($array['owner']))$array['owner'] = null;
1924
- if(!isset($array['ownerAddress']))$array['ownerAddress'] = null;
1925
- if(!isset($array['contracts'])||!strlen($array['contracts'][0]))$array['contracts'] = '';
1926
- if(!isset($array['walletContracts'])||!strlen($array['walletContracts'][0]))$array['walletContracts'] = '';
1927
- if(isset($array['customPaymentPageCode'])&& strlen($array['customPaymentPageCode'])) $this->customPaymentPageCode = $array['customPaymentPageCode'];
1928
- if(isset($array['customPaymentTemplateURL'])&& strlen($array['customPaymentTemplateURL'])) $this->customPaymentTemplateURL = $array['customPaymentTemplateURL'];
1929
- $WSRequest = array (
1930
- 'contractNumber' => $array['contractNumber'],
1931
- 'selectedContractList' => $this->contracts($array['contracts']),
1932
- 'updatePersonalDetails' => $array['updatePersonalDetails'],
1933
- 'buyer' => $this->buyer($array['buyer'],$array['shippingAddress'],$array['billingAddress']),
1934
- 'owner' => $this->owner($array['owner'],$array['ownerAddress']),
1935
- 'languageCode' => $array['languageCode'],
1936
- 'customPaymentPageCode' => $array['customPaymentPageCode'],
1937
- 'securityMode' => $array['securityMode'],
1938
- 'returnURL' => $this->returnURL,
1939
- 'cancelURL' => $this->cancelURL,
1940
- 'notificationURL' => $this->notificationURL,
1941
- 'privateDataList' => $this->privates,
1942
- 'customPaymentTemplateURL' => $array['customPaymentTemplateURL'],
1943
- 'contractNumberWalletList' => $this->secondContracts($array['walletContracts'])
1944
- );
1945
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::WEB_API,'manageWebWallet');
1946
- }
1947
-
1948
- public function transactionsSearch($array){
1949
- $WSRequest = array (
1950
- 'transactionId' => $array['transactionId'],
1951
- 'orderRef' => $array['orderRef'],
1952
- 'startDate' => $array['startDate'],
1953
- 'endDate' => $array['endDate'],
1954
- 'contractNumber' => $array['contractNumber'],
1955
- 'authorizationNumber' => $array['authorizationNumber'],
1956
- 'returnCode' => $array['returnCode'],
1957
- 'paymentMean' => $array['paymentMean'],
1958
- 'transactionType' => $array['transactionType'],
1959
- 'name' => $array['name'],
1960
- 'firstName' => $array['firstName'],
1961
- 'email' => $array['email'],
1962
- 'cardNumber' => $array['cardNumber'],
1963
- 'currency' => $array['currency'],
1964
- 'minAmount' => $array['minAmount'],
1965
- 'maxAmount' => $array['maxAmount'],
1966
- 'walletId' => $array['walletId'],
1967
- 'sequenceNumber' => $array['sequenceNumber'],
1968
- 'token' => $array['token']
1969
- );
1970
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::EXTENDED_API,'transactionsSearch');
1971
- }
1972
-
1973
- public function unBlock($array){
1974
- $WSRequest = array (
1975
- 'transactionID' => $array['transactionID'],
1976
- 'transactionDate' => $array['transactionDate']
1977
- );
1978
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'unBlock');
1979
- }
1980
-
1981
- public function updateWallet($array){
1982
- $WSRequest = array (
1983
- 'contractNumber' => $array['contractNumber'],
1984
- 'cardInd' => $array['cardInd'],
1985
- 'wallet' => $this->wallet($array['wallet'],$array['address'],$array['card']),
1986
- 'buyer' => $this->buyer($array['buyer'], $array['shippingAddress'],$array['billingAddress']),
1987
- 'owner' => $this->owner($array['owner'],$array['ownerAddress']),
1988
- 'privateDataList' => $this->privates,
1989
- 'authentication3DSecure' =>$this->authentication3DSecure($array['3DSecure']),
1990
- 'contractNumberWalletList' => $this->secondContracts($array['walletContracts'])
1991
- );
1992
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'updateWallet');
1993
- }
1994
-
1995
- public function updateWebWallet($array){
1996
- if(isset($array['cancelURL'])&& strlen($array['cancelURL'])) $this->cancelURL = $array['cancelURL'];
1997
- if(isset($array['notificationURL']) && strlen($array['notificationURL'])) $this->notificationURL = $array['notificationURL'];
1998
- if(isset($array['returnURL'])&& strlen($array['returnURL'])) $this->returnURL = $array['returnURL'];
1999
- if(isset($array['customPaymentTemplateURL'])&& strlen($array['customPaymentTemplateURL'])) $this->customPaymentTemplateURL = $array['customPaymentTemplateURL'];
2000
- if(isset($array['customPaymentPageCode'])&& strlen($array['customPaymentPageCode'])) $this->customPaymentPageCode = $array['customPaymentPageCode'];
2001
- if(isset($array['languageCode'])&& strlen($array['languageCode'])) $this->languageCode = $array['languageCode'];
2002
- if(isset($array['securityMode'])&& strlen($array['securityMode'])) $this->securityMode = $array['securityMode'];
2003
- if(!isset($array['walletContracts'])||!strlen($array['walletContracts'][0]))$array['walletContracts'] = '';
2004
- $WSRequest = array (
2005
- 'contractNumber' => $array['contractNumber'],
2006
- 'cardInd' => $array['cardInd'],
2007
- 'walletId' => $array['walletId'],
2008
- 'updatePersonalDetails' => $array['updatePersonalDetails'],
2009
- 'updateOwnerDetails' => $array['updateOwnerDetails'],
2010
- 'updatePaymentDetails' => $array['updatePaymentDetails'],
2011
- 'buyer' => $this->buyer($array['buyer'],$array['shippingAddress'],$array['billingAddress']),
2012
- 'languageCode' => $this->languageCode,
2013
- 'customPaymentPageCode' => $this->customPaymentPageCode,
2014
- 'securityMode' => $this->securityMode,
2015
- 'returnURL' => $this->returnURL,
2016
- 'cancelURL' => $this->cancelURL,
2017
- 'notificationURL' => $this->notificationURL,
2018
- 'privateDataList' => $this->privates,
2019
- 'customPaymentTemplateURL' => $this->customPaymentTemplateURL,
2020
- 'contractNumberWalletList' => $this->secondContracts($array['walletContracts'])
2021
- );
2022
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::WEB_API,'updateWebWallet');
2023
- }
2024
-
2025
- public function verifyAuthentication($array){
2026
- $WSRequest = array (
2027
- 'contractNumber' => $array['contractNumber'],
2028
- 'pares' => $array['pares'],
2029
- 'md' => $array['md'],
2030
- 'card' => $this->card($array['card'])
2031
- );
2032
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'verifyAuthentication');
2033
- }
2034
-
2035
- public function verifyEnrollment($array){
2036
- if(!isset($array['orderRef']))$array['orderRef'] = null;
2037
- if(!isset($array['userAgent']))$array['userAgent'] = null;
2038
- if(!isset($array['mdFieldValue']))$array['mdFieldValue'] = null;
2039
- if(!isset($array['walletId']))$array['walletId'] = null;
2040
- if(!isset($array['walletCardInd']))$array['walletCardInd'] = null;
2041
- if(!isset($array['card']))$array['card'] = null;
2042
- $WSRequest = array (
2043
- 'payment' => $this->payment($array['payment']),
2044
- 'card' => $this->card($array['card']),
2045
- 'orderRef' => $array['orderRef'],
2046
- 'userAgent' => $array['userAgent'],
2047
- 'mdFieldValue' => $array['mdFieldValue'],
2048
- 'walletId' => $array['walletId'],
2049
- 'walletCardInd' => $array['walletCardInd']
2050
- );
2051
- return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'verifyEnrollment');
2052
- }
2053
- }
1
+ <?php
2
+ //
3
+ // OBJECTS DEFINITIONS
4
+ //
5
+
6
+ class paylineUtil{
7
+
8
+ /**
9
+ * make an array from a payline server response object.
10
+ * @params : $response : Objet response from payline
11
+ * @return : Object convert in an array
12
+ **/
13
+ static function responseToArray($response){
14
+
15
+ $array = array();
16
+ foreach($response as $k=>$v){
17
+ if (is_object($v)) {
18
+ $array[$k] = paylineUtil::responseToArray($v);
19
+ }
20
+ else { $array[$k] = $v;
21
+ }
22
+ }
23
+ return $array;
24
+
25
+ return $response;
26
+ }
27
+
28
+ static function responseToArrayForGetCards($response){
29
+
30
+ $array = array();
31
+ foreach($response as $k=>$v){
32
+
33
+ if (is_object($v) && ($k != 'cards' ) ) {
34
+ $array[$k] = paylineUtil::responseToArrayForGetCards($v);
35
+ }
36
+ else {
37
+ if($k == 'cards' && count($v) == 1 ){
38
+ $array[$k][0] = $v;
39
+ }else{
40
+ $array[$k] = $v;
41
+ }
42
+ }
43
+ }
44
+ return $array;
45
+
46
+ return $response;
47
+ }
48
+ }
49
+
50
+ //
51
+ // PL_PAYMENT OBJECT DEFINITION
52
+ //
53
+ class pl_payment{
54
+
55
+ // ATTRIBUTES LISTING
56
+ public $amount;
57
+ public $currency;
58
+ public $action;
59
+ public $mode;
60
+ public $method;
61
+ public $contractNumber;
62
+ public $differedActionDate;
63
+ }
64
+
65
+ //
66
+ // PL_ORDER OBJECT DEFINITION
67
+ //
68
+ class pl_order{
69
+
70
+ // ATTRIBUTES LISTING
71
+ public $ref;
72
+ public $origin;
73
+ public $country;
74
+ public $taxes;
75
+ public $amount;
76
+ public $currency;
77
+ public $date;
78
+ public $quantity;
79
+ public $comment;
80
+ public $details;
81
+ public $deliveryTime;
82
+ public $deliveryMode;
83
+ public $deliveryExpectedDate;
84
+ public $deliveryExpectedDelay;
85
+
86
+ function __construct() {
87
+ $this->date = date('d/m/Y H:i', time());
88
+ $this->details = array();
89
+ }
90
+ }
91
+
92
+ //
93
+ // PL_PRIVATEDATA OBJECT DEFINITION
94
+ //
95
+ class pl_privateData{
96
+
97
+ // ATTRIBUTES LISTING
98
+ public $key ;
99
+ public $value;
100
+ }
101
+
102
+ //
103
+ // PL_AUTHORIZATION OBJECT DEFINITION
104
+ //
105
+ class pl_authorization{
106
+
107
+ // ATTRIBUTES LISTING
108
+ public $number;
109
+ public $date;
110
+ }
111
+
112
+ //
113
+ // PL_ADDRESS OBJECT DEFINITION
114
+ //
115
+ class pl_address{
116
+
117
+ // ATTRIBUTES LISTING
118
+ public $title;
119
+ public $firstName;
120
+ public $lastName;
121
+ public $name;
122
+ public $street1;
123
+ public $street2;
124
+ public $cityName;
125
+ public $zipCode;
126
+ public $country;
127
+ public $county;
128
+ public $state;
129
+ public $phoneType;
130
+ public $phone;
131
+ }
132
+
133
+ //
134
+ // PL_OWNERADDRESS OBJECT DEFINITION
135
+ //
136
+ class pl_ownerAddress{
137
+
138
+ // ATTRIBUTES LISTING
139
+ public $street;
140
+ public $cityName;
141
+ public $zipCode;
142
+ public $country;
143
+ public $phone;
144
+ }
145
+
146
+ //
147
+ // PL_BUYER OBJECT DEFINITION
148
+ //
149
+ class pl_buyer{
150
+
151
+ // ATTRIBUTES LISTING
152
+ public $title;
153
+ public $lastName;
154
+ public $firstName;
155
+ public $email;
156
+ public $customerId;
157
+ public $walletId;
158
+ public $walletDisplayed;
159
+ public $walletSecured;
160
+ public $walletCardInd;
161
+ public $shippingAdress;
162
+ public $billingAddress;
163
+ public $accountCreateDate;
164
+ public $accountAverageAmount;
165
+ public $accountOrderCount;
166
+ public $ip;
167
+ public $mobilePhone;
168
+ public $legalStatus;
169
+ public $legalDocument;
170
+ public $birthDate;
171
+ public $fingerprintID;
172
+
173
+ function __construct() {
174
+ $this->accountCreateDate = date('d/m/y', time());
175
+ }
176
+ }
177
+
178
+ //
179
+ // PL_OWNER OBJECT DEFINITION
180
+ //
181
+ class pl_owner{
182
+
183
+ // ATTRIBUTES LISTING
184
+ public $lastName;
185
+ public $firstName;
186
+ public $billingAddress;
187
+ public $issueCardDate;
188
+ }
189
+
190
+ //
191
+ // PL_ORDERDETAIL OBJECT DEFINITION
192
+ //
193
+ class pl_orderDetail{
194
+
195
+ // ATTRIBUTES LISTING
196
+ public $ref;
197
+ public $price;
198
+ public $quantity;
199
+ public $comment;
200
+ public $category;
201
+ public $subcategory1;
202
+ public $subcategory2;
203
+ public $brand;
204
+ public $additionalData;
205
+ public $taxRate;
206
+ }
207
+
208
+ //
209
+ // PL_CARD OBJECT DEFINITION
210
+ //
211
+ class pl_card{
212
+
213
+ // ATTRIBUTES LISTING
214
+ public $number;
215
+ public $type;
216
+ public $expirationDate;
217
+ public $cvx;
218
+ public $ownerBirthdayDate;
219
+ public $password;
220
+ public $cardPresent;
221
+ public $cardholder;
222
+ public $token;
223
+
224
+ function __construct($type) {
225
+ $this->accountCreateDate = date('d/m/y', time());
226
+ }
227
+ }
228
+
229
+
230
+ //
231
+ // PL_TRANSACTION OBJECT DEFINITION
232
+ //
233
+ class pl_transaction{
234
+
235
+ // ATTRIBUTES LISTING
236
+ public $id;
237
+ public $isPossibleFraud;
238
+ public $isDuplicated;
239
+ public $date;
240
+ }
241
+
242
+
243
+ //
244
+ // PL_RESULT OBJECT DEFINITION
245
+ //
246
+ class pl_result{
247
+
248
+ // ATTRIBUTES LISTING
249
+ public $code;
250
+ public $shortMessage;
251
+ public $longMessage;
252
+ }
253
+
254
+ //
255
+ // PL_CAPTURE OBJECT DEFINITION
256
+ //
257
+ class pl_capture{
258
+
259
+ // ATTRIBUTES LISTING
260
+ public $transactionID;
261
+ public $payment;
262
+ public $sequenceNumber;
263
+
264
+ function __construct() {
265
+ $this->payment = new pl_payment();
266
+ }
267
+ }
268
+
269
+ //
270
+ // PL_REFUND OBJECT DEFINITION
271
+ //
272
+ class pl_refund extends pl_capture {
273
+ function __construct() {
274
+ parent::__construct();
275
+ }
276
+ }
277
+
278
+ //
279
+ // PL_WALLET OBJECT DEFINITION
280
+ //
281
+ class pl_wallet{
282
+
283
+ // ATTRIBUTES LISTING
284
+ public $walletId;
285
+ public $lastName;
286
+ public $firstName;
287
+ public $email;
288
+ public $shippingAddress;
289
+ public $card;
290
+ public $comment;
291
+ public $default;
292
+ public $cardStatus;
293
+
294
+ function __construct() {
295
+ }
296
+ }
297
+
298
+ //
299
+ // PL_RECURRING OBJECT DEFINITION
300
+ //
301
+ class pl_recurring{
302
+
303
+ // ATTRIBUTES LISTING
304
+ public $firstAmount;
305
+ public $amount;
306
+ public $billingCycle;
307
+ public $billingLeft;
308
+ public $billingDay;
309
+ public $startDate;
310
+ public $endDate;
311
+ public $newAmount;
312
+ public $amountModificationDate;
313
+
314
+ function __construct() {
315
+ }
316
+ }
317
+
318
+ //
319
+ // PL_BILLINGRECORD OBJECT DEFINITION
320
+ //
321
+ class pl_billingRecord{
322
+
323
+ // ATTRIBUTES LISTING
324
+ public $date;
325
+ public $amount;
326
+ public $status;
327
+ public $executionDate;
328
+
329
+ function __construct() {
330
+ }
331
+ }
332
+
333
+ //
334
+ // PL_AUTHENTIFICATION 3D SECURE
335
+ //
336
+ class pl_authentication3DSecure{
337
+
338
+ // ATTRIBUTES LISTING
339
+ public $md ;
340
+ public $pares ;
341
+ public $xid ;
342
+ public $eci ;
343
+ public $cavv ;
344
+ public $cavvAlgorithm ;
345
+ public $vadsResult ;
346
+ public $typeSecurisation;
347
+
348
+ function __construct() {
349
+ }
350
+ }
351
+
352
+ //
353
+ // PL_BANKACCOUNTDATA
354
+ //
355
+ class pl_bankAccountData{
356
+
357
+
358
+ // ATTRIBUTES LISTING
359
+ public $countryCode ;
360
+ public $bankCode ;
361
+ public $accountNumber ;
362
+ public $key ;
363
+
364
+
365
+ function __construct() {
366
+ }
367
+ }
368
+
369
+ //
370
+ // PL_CHEQUE
371
+ //
372
+ class pl_cheque{
373
+
374
+ // ATTRIBUTES LISTING
375
+ public $number ;
376
+
377
+ function __construct() {
378
+ }
379
+ }
380
+
381
+ final class paylineLog {
382
+ private $filename;
383
+ private $path;
384
+
385
+ public function __construct($filename, $path=null) {
386
+ $this->filename = $filename;
387
+ if($path == null){
388
+ $tmp = explode(DIRECTORY_SEPARATOR ,dirname(__FILE__));
389
+
390
+ // up one level from the current directory
391
+ for($i=0,$s = sizeof($tmp)-1; $i<$s; $i++){
392
+ $this->path .= $tmp[$i].DIRECTORY_SEPARATOR;
393
+ }
394
+ $this->path .= 'logs'.DIRECTORY_SEPARATOR;
395
+ }else{
396
+ $this->path = $path;
397
+ }
398
+ }
399
+
400
+ public function write($message) {
401
+ $file = $this->path.$this->filename;
402
+ $handle = fopen($file, 'a+');
403
+ fwrite($handle, date('Y-m-d G:i:s') . ' - ' . $message . "\n");
404
+ fclose($handle);
405
+ }
406
+ }
407
+
408
+ //
409
+ // PAYLINESDK CLASS
410
+ //
411
+ class paylineSDK{
412
+
413
+ // kit version
414
+ const KIT_VERSION = 'module Magento 1.8.5.1';
415
+
416
+ // trace log
417
+ var $logger;
418
+ var $flagLog; // 0 : pas de log / 1 : log par défaut / 2 : chemin personnalisé (pathLog)
419
+ var $pathLog;
420
+
421
+ // environement flags
422
+ const ENV_DEV = "DEV";
423
+ const ENV_HOMO = "HOMO";
424
+ const ENV_PROD = "PROD";
425
+
426
+ // SOAP URL's
427
+ const PAYLINE_NAMESPACE = 'http://obj.ws.payline.experian.com';
428
+ const WSDL = 'v4.44.wsdl';
429
+ const DEV_ENDPOINT = 'https://ws.dev.payline.com/V4/services/';
430
+ const HOMO_ENDPOINT = 'https://homologation.payline.com/V4/services/';
431
+ const PROD_ENDPOINT = 'https://services.payline.com/V4/services/';
432
+
433
+ // getToken servlet URL
434
+ const DEV_GET_TOKEN_SERVLET = "https://webpayment.dev.payline.com/webpayment/getToken";
435
+ const HOMO_GET_TOKEN_SERVLET = "https://homologation-webpayment.payline.com/webpayment/getToken";
436
+ const PROD_GET_TOKEN_SERVLET = "https://webpayment.payline.com/webpayment/getToken";
437
+
438
+ // Widget JavaScript
439
+ const HOMO_WDGT_JS = "https://homologation-payment.payline.com/scripts/widget-min.js";
440
+ const PROD_WDGT_JS = "https://payment.payline.com/scripts/widget-min.js";
441
+ const DEV_WDGT_JS = "https://webpayment.dev.payline.com/payline-widget/scripts/widget-min.js";
442
+
443
+ // Widget css
444
+ const DEV_WDGT_CSS = "https://webpayment.dev.payline.com/payline-widget/styles/widget-min.css";
445
+ const HOMO_WDGT_CSS = "https://homologation-payment.payline.com/styles/widget-min.css";
446
+ const PROD_WDGT_CSS = "https://payment.payline.com/styles/widget-min.css";
447
+
448
+
449
+ // Administration center
450
+ const DEV_CA = 'https://admin.dev.payline.aixlan.local:9363';
451
+ const HOMO_CA = 'https://homologation-admin.payline.com';
452
+ const PROD_CA = 'https://admin.payline.com';
453
+
454
+ // APIs
455
+ const DIRECT_API = 'DirectPaymentAPI';
456
+ const EXTENDED_API = 'ExtendedAPI';
457
+ const WEB_API = 'WebPaymentAPI';
458
+
459
+ // current endpoint
460
+ private $webServicesEndpoint;
461
+
462
+ // current url to get token
463
+ private $servletTokenUrl;
464
+
465
+ private $widgetJavascriptUrl;
466
+ private $widgetCssUrl;
467
+
468
+ // SOAP ACTIONS CONSTANTS
469
+ const soap_result = 'result';
470
+ const soap_authorization = 'authorization';
471
+ const soap_card = 'card';
472
+ const soap_order = 'order';
473
+ const soap_orderDetail = 'orderDetail';
474
+ const soap_payment = 'payment';
475
+ const soap_transaction = 'transaction';
476
+ const soap_privateData = 'privateData';
477
+ const soap_buyer = 'buyer';
478
+ const soap_owner = 'owner';
479
+ const soap_address = 'address';
480
+ const soap_ownerAddress = 'addressOwner';
481
+ const soap_capture = 'capture';
482
+ const soap_refund = 'refund';
483
+ const soap_refund_auth = 'refundAuthorization';
484
+ const soap_authentication3DSecure = 'authentication3DSecure';
485
+ const soap_bankAccountData = 'bankAccountData';
486
+ const soap_cheque = 'cheque';
487
+
488
+ const ERR_CODE = 'XXXXX';
489
+
490
+ // ARRAY
491
+ public $header_soap;
492
+ public $items;
493
+ public $privates;
494
+
495
+ // OPTIONS
496
+ public $cancelURL;
497
+ public $securityMode;
498
+ public $notificationURL;
499
+ public $returnURL;
500
+ public $customPaymentTemplateURL;
501
+ public $customPaymentPageCode;
502
+ public $languageCode;
503
+
504
+ // WALLET
505
+ public $walletIdList;
506
+
507
+ // custom logo path
508
+ const DEFAULT_LOGO_DIR = 'customLogos';
509
+ var $customLogoPath = '';
510
+
511
+ // getMerchantSettings Array
512
+ private $posData;
513
+ private $paymentMeansLogos;
514
+
515
+ /**
516
+ * contructor of PAYLINESDK CLASS
517
+ **/
518
+ function __construct($merchant_id, $access_key, $proxy_host, $proxy_port, $proxy_login, $proxy_password, $environment, $pathLog = null) {
519
+ if(is_null($pathLog)){
520
+ $this->flagLog = 1;
521
+ }elseif (strlen($pathLog) == 0){
522
+ $this->flagLog = 0;
523
+ }else{
524
+ $this->flagLog = 2;
525
+ $this->pathLog = $pathLog;
526
+ }
527
+
528
+ $this->writeTrace('----------------------------------------------------------');
529
+ $this->writeTrace('paylineSDK::__construct('.$this->hideChars($merchant_id,6,1).', '.$this->hideChars($access_key,1,3).", $proxy_host, $proxy_port, $proxy_login, ".$this->hideChars($proxy_password,1,1).", $environment)");
530
+ $this->header_soap = array();
531
+ $this->header_soap['login'] = $merchant_id;
532
+ $this->header_soap['password'] = $access_key;
533
+ if($proxy_host != ''){
534
+ $this->header_soap['proxy_host'] = $proxy_host;
535
+ $this->header_soap['proxy_port'] = $proxy_port;
536
+ $this->header_soap['proxy_login'] = $proxy_login;
537
+ $this->header_soap['proxy_password'] = $proxy_password;
538
+ }
539
+
540
+ if(strcmp($environment,paylineSDK::ENV_DEV)==0){
541
+ $this->webServicesEndpoint = paylineSDK::DEV_ENDPOINT;
542
+ $this->widgetJavascriptUrl = paylineSDK::DEV_WDGT_JS;
543
+ $this->widgetCssUrl = paylineSDK::DEV_WDGT_CSS;
544
+ }elseif(strcmp($environment,paylineSDK::ENV_PROD)==0){
545
+ $this->webServicesEndpoint = paylineSDK::PROD_ENDPOINT;
546
+ $this->servletTokenUrl = paylineSDK::PROD_GET_TOKEN_SERVLET;
547
+ $this->widgetJavascriptUrl = paylineSDK::PROD_WDGT_JS;
548
+ $this->widgetCssUrl = paylineSDK::PROD_WDGT_CSS;
549
+ }elseif(strcmp($environment,paylineSDK::ENV_HOMO)==0){
550
+ $this->webServicesEndpoint = paylineSDK::HOMO_ENDPOINT;
551
+ $this->servletTokenUrl = paylineSDK::HOMO_GET_TOKEN_SERVLET;
552
+ $this->widgetJavascriptUrl = paylineSDK::HOMO_WDGT_JS;
553
+ $this->widgetCssUrl = paylineSDK::HOMO_WDGT_CSS;
554
+ }
555
+
556
+ $this->header_soap['style'] = SOAP_DOCUMENT;
557
+ $this->header_soap['use'] = SOAP_LITERAL;
558
+ $this->items = array();
559
+ $this->privates = array();
560
+ $this->walletIdList = array();
561
+
562
+ ini_set('user_agent', "PHP\r\nversion: ".paylineSDK::KIT_VERSION);
563
+ }
564
+
565
+ /**
566
+ * function payment
567
+ * @params : $array : array. the array keys are listed in pl_payment CLASS.
568
+ * @return : SoapVar : object
569
+ * @description : build pl_payment instance from $array and make SoapVar object for payment.
570
+ **/
571
+ protected function payment($array) {
572
+ $payment = new pl_payment();
573
+ if($array && is_array($array)){
574
+ foreach($array as $k=>$v){
575
+ if(array_key_exists($k, $payment)&&(strlen($v))){
576
+ $payment->$k = $v;
577
+ }
578
+ }
579
+ }
580
+ return new SoapVar($payment, SOAP_ENC_OBJECT, paylineSDK::soap_payment, paylineSDK::PAYLINE_NAMESPACE);
581
+ }
582
+
583
+ /**
584
+ * function order
585
+ * @params : $array : array. the array keys are listed in pl_order CLASS.
586
+ * @return : SoapVar : object
587
+ * @description : build pl_order instance from $array and make SoapVar object for order.
588
+ **/
589
+ protected function order($array) {
590
+ $order = new pl_order();
591
+ if($array && is_array($array)){
592
+ foreach($array as $k=>$v){
593
+ if(array_key_exists($k, $order)&&(strlen($v))){
594
+ $order->$k = $v;
595
+ }
596
+ }
597
+ }
598
+ $allDetails = array();
599
+ // insert orderDetails
600
+ $order->details = $this->items;
601
+ return new SoapVar($order, SOAP_ENC_OBJECT, paylineSDK::soap_order, paylineSDK::PAYLINE_NAMESPACE);
602
+ }
603
+
604
+ /**
605
+ * function address
606
+ * @params : $address : array. the array keys are listed in pl_address CLASS.
607
+ * @return : SoapVar : object
608
+ * @description : build pl_address instance from $array and make SoapVar object for address.
609
+ **/
610
+ protected function address($array) {
611
+ $address = new pl_address();
612
+ if($array && is_array($array)){
613
+ foreach($array as $k=>$v){
614
+ if(array_key_exists($k, $address)&&(strlen($v)))$address->$k = $v;
615
+ }
616
+ }
617
+ return new SoapVar($address, SOAP_ENC_OBJECT, paylineSDK::soap_address, paylineSDK::PAYLINE_NAMESPACE);
618
+ }
619
+
620
+ /**
621
+ * function ownerAddress
622
+ * @params : $address : array. the array keys are listed in pl_address CLASS.
623
+ * @return : SoapVar : object
624
+ * @description : build pl_ownerAddress instance from $array and make SoapVar object for address.
625
+ **/
626
+ protected function ownerAddress($array) {
627
+ $address = new pl_ownerAddress();
628
+ if($array && is_array($array)){
629
+ foreach($array as $k=>$v){
630
+ if(array_key_exists($k, $address)&&(strlen($v)))$address->$k = $v;
631
+ }
632
+ }
633
+ return new SoapVar($address, SOAP_ENC_OBJECT, paylineSDK::soap_ownerAddress, paylineSDK::PAYLINE_NAMESPACE);
634
+ }
635
+
636
+ /**
637
+ * function buyer
638
+ * @params : $array : array. the array keys are listed in pl_buyer CLASS.
639
+ * @params : $shippingAdress : array. the array keys are listed in pl_address CLASS.
640
+ * @params : $billingAddress : array. the array keys are listed in pl_address CLASS.
641
+ * @return : SoapVar : object
642
+ * @description : build pl_buyer instance from $array and $address and make SoapVar object for buyer.
643
+ **/
644
+ protected function buyer($array,$shippingAdress,$billingAddress) {
645
+ $buyer = new pl_buyer();
646
+ if($array && is_array($array)){
647
+ foreach($array as $k=>$v){
648
+ if(array_key_exists($k, $buyer)&&(strlen($v)))$buyer->$k = $v;
649
+ }
650
+ }
651
+ $buyer->shippingAdress = $this->address($shippingAdress);
652
+ $buyer->billingAddress = $this->address($billingAddress);
653
+ return new SoapVar($buyer, SOAP_ENC_OBJECT, paylineSDK::soap_buyer, paylineSDK::PAYLINE_NAMESPACE);
654
+ }
655
+
656
+ /**
657
+ * function owner
658
+ * @params : $array : array. the array keys are listed in pl_buyer CLASS.
659
+ * @params : $shippingAdress : array. the array keys are listed in pl_address CLASS.
660
+ * @params : $billingAddress : array. the array keys are listed in pl_address CLASS.
661
+ * @return : SoapVar : object
662
+ * @description : build pl_buyer instance from $array and $address and make SoapVar object for buyer.
663
+ **/
664
+ protected function owner($array,$Address) {
665
+ if($array != null){
666
+ $owner = new pl_owner();
667
+ if($array && is_array($array)){
668
+ foreach($array as $k=>$v){
669
+ if(array_key_exists($k, $owner)&&(strlen($v)))$owner->$k = $v;
670
+ }
671
+ }
672
+ $owner->billingAddress = $this->ownerAddress($Address);
673
+ return new SoapVar($owner, SOAP_ENC_OBJECT, paylineSDK::soap_owner, paylineSDK::PAYLINE_NAMESPACE);
674
+ }else{
675
+ return null;
676
+ }
677
+ }
678
+
679
+ /**
680
+ * function contracts
681
+ * @params : $contracts : array. array of contracts
682
+ * @return : $contracts : array. the same as params if exist, or an array with default contract defined in
683
+ * configuration
684
+ * @description : Add datas to contract array
685
+ **/
686
+ protected function contracts($contracts) {
687
+ if($contracts && is_array($contracts)){
688
+ return $contracts;
689
+ }
690
+ return null;
691
+ }
692
+
693
+ /**
694
+ * function secondContracts
695
+ * @params : $secondContracts : array. array of contracts
696
+ * @return : $secondContracts : array. the same as params if exist, null otherwise
697
+ * @description : Add datas to contract array
698
+ **/
699
+ protected function secondContracts($secondContracts) {
700
+ if($secondContracts && is_array($secondContracts)){
701
+ return $secondContracts;
702
+ }
703
+ return null;
704
+ }
705
+
706
+ /**
707
+ * function authentification 3Dsecure
708
+ * @params : $array : array. the array keys are listed in pl_card CLASS.
709
+ * @return : SoapVar : object
710
+ * @description : build pl_authentication3DSecure instance from $array and make SoapVar object for authentication3DSecure.
711
+ **/
712
+ protected function authentication3DSecure($array) {
713
+ $authentication3DSecure = new pl_authentication3DSecure($array);
714
+ if($array && is_array($array)){
715
+ foreach($array as $k=>$v){
716
+ if(array_key_exists($k, $authentication3DSecure)&&(strlen($v))){
717
+ $authentication3DSecure->$k = $v;
718
+ }
719
+ }
720
+ }
721
+ return new SoapVar($authentication3DSecure, SOAP_ENC_OBJECT, paylineSDK::soap_authentication3DSecure, paylineSDK::PAYLINE_NAMESPACE);
722
+ }
723
+
724
+ /**
725
+ * function authorization
726
+ * @params : $array : array. the array keys are listed in pl_card CLASS.
727
+ * @return : SoapVar : object
728
+ * @description : build pl_authentication3DSecure instance from $array and make SoapVar object for authentication3DSecure.
729
+ **/
730
+ protected function authorization($array) {
731
+ $authorization = new pl_authorization($array);
732
+ if($array && is_array($array)){
733
+ foreach($array as $k=>$v){
734
+ if(array_key_exists($k, $authorization)&&(strlen($v))){
735
+ $authorization->$k = $v;
736
+ }
737
+ }
738
+ }
739
+ return new SoapVar($authorization, SOAP_ENC_OBJECT, paylineSDK::soap_authorization, paylineSDK::PAYLINE_NAMESPACE);
740
+ }
741
+
742
+ /**
743
+ * function card
744
+ * @params : $array : array. the array keys are listed in pl_card CLASS.
745
+ * @return : SoapVar : object
746
+ * @description : build pl_card instance from $array and make SoapVar object for card.
747
+ **/
748
+ protected function card($array) {
749
+ $card = new pl_card($array['type']);
750
+ if($array && is_array($array)){
751
+ foreach($array as $k=>$v){
752
+ if(array_key_exists($k, $card)&&(strlen($v))){
753
+ $card->$k = $v;
754
+ }
755
+ }
756
+ }
757
+ return new SoapVar($card, SOAP_ENC_OBJECT, paylineSDK::soap_card, paylineSDK::PAYLINE_NAMESPACE);
758
+ }
759
+
760
+
761
+
762
+ /**
763
+ * function bankAccountData
764
+ * @params : $array : array. the array keys are listed in pl_bankAccountData CLASS.
765
+ * @return : SoapVar : object
766
+ * @description : build pl_bankAccountData instance from $array and make SoapVar object for bankAccountData.
767
+ **/
768
+ protected function bankAccountData($array) {
769
+ $bankAccountData = new pl_bankAccountData($array);
770
+ if($array && is_array($array)){
771
+ foreach($array as $k=>$v){
772
+ if(array_key_exists($k, $bankAccountData)&&(strlen($v))){
773
+ $bankAccountData->$k = $v;
774
+ }
775
+ }
776
+ }
777
+ return new SoapVar($bankAccountData, SOAP_ENC_OBJECT, paylineSDK::soap_bankAccountData, paylineSDK::PAYLINE_NAMESPACE);
778
+ }
779
+
780
+ /**
781
+ * function cheque
782
+ * @params : $array : array. the array keys are listed in pl_cheque CLASS.
783
+ * @return : SoapVar : object
784
+ * @description : build pl_authentication3DSecure instance from $array and make SoapVar object for cheque.
785
+ **/
786
+ protected function cheque($array) {
787
+ $cheque = new pl_cheque($array);
788
+ if($array && is_array($array)){
789
+ foreach($array as $k=>$v){
790
+ if(array_key_exists($k, $cheque)&&(strlen($v))){
791
+ $cheque->$k = $v;
792
+ }
793
+ }
794
+ }
795
+ return new SoapVar($cheque, SOAP_ENC_OBJECT, paylineSDK::soap_cheque, paylineSDK::PAYLINE_NAMESPACE);
796
+ }
797
+
798
+ /****************************************************/
799
+ // WALLET //
800
+ /****************************************************/
801
+
802
+ /**
803
+ * function wallet
804
+ * @params : array : array. the array keys are listed in pl_wallet CLASS.
805
+ * @params : address : array. the array keys are listed in pl_address CLASS.
806
+ * @params : card : array. the array keys are listed in pl_card CLASS.
807
+ * @return : wallet: pl_wallet Object.
808
+ * @description : build a wallet object.
809
+ **/
810
+ protected function wallet($array,$address,$card) {
811
+ $wallet = new pl_wallet();
812
+ if($array && is_array($array)){
813
+ foreach($array as $k=>$v){
814
+ if(array_key_exists($k, $wallet)&&(strlen($v)))$wallet->$k = $v;
815
+ }
816
+ }
817
+
818
+ $wallet->shippingAddress = $this->address($address);
819
+ $wallet->card = $this->card($card);
820
+
821
+ return $wallet;
822
+ }
823
+
824
+ /**
825
+ * function recurring
826
+ * @params : array : array. the array keys are listed in pl_recurring CLASS.
827
+ * @return : recurring object.
828
+ * @description : build a recurring object.
829
+ **/
830
+ protected function recurring($array) {
831
+ if($array){
832
+ $recurring = new pl_recurring();
833
+ if($array && is_array($array)){
834
+ foreach($array as $k=>$v){
835
+ if(array_key_exists($k, $recurring)&&(strlen($v)))$recurring->$k = $v;
836
+ }
837
+ }
838
+ return $recurring;
839
+ }
840
+ else return null;
841
+ }
842
+
843
+ /**
844
+ * function billingRecord
845
+ * @params : array : array. the array keys are listed in pl_billingRecord CLASS.
846
+ * @return : billingRecord object.
847
+ * @description : build a billingRecord object.
848
+ **/
849
+ protected function billingRecord($array) {
850
+ if($array){
851
+ $billingRecord = new pl_billingRecord();
852
+ if($array && is_array($array)){
853
+ foreach($array as $k=>$v){
854
+ if(array_key_exists($k, $billingRecord)&&(strlen($v)))$billingRecord->$k = $v;
855
+ }
856
+ }
857
+ return $billingRecord;
858
+ }
859
+ else return null;
860
+ }
861
+
862
+ /**
863
+ * function setItem
864
+ * @params : $item : array. the array keys are listed in PL_ORDERDETAIL CLASS.
865
+ * @description : Make $item SoapVar object and insert in items array
866
+ **/
867
+ public function setItem($item) {
868
+ $orderDetail = new pl_orderDetail();
869
+ if($item && is_array($item)){
870
+ foreach($item as $k=>$v){
871
+ if(array_key_exists($k, $orderDetail)&&(strlen($v)))$orderDetail->$k = $v;
872
+ }
873
+ }
874
+ $this->items[] = new SoapVar($orderDetail, SOAP_ENC_OBJECT, paylineSDK::soap_orderDetail, paylineSDK::PAYLINE_NAMESPACE);
875
+ }
876
+
877
+ /**
878
+ * function setPrivate
879
+ * @params : $private : array. the array keys are listed in PRIVATE CLASS.
880
+ * @description : Make $setPrivate SoapVar object and insert in privates array
881
+ **/
882
+ public function setPrivate($array) {
883
+ $private = new pl_privateData();
884
+ if($array && is_array($array)){
885
+ foreach($array as $k=>$v){
886
+ if(array_key_exists($k, $private)&&(strlen($v)))$private->$k = $v;
887
+ }
888
+ }
889
+ $this->privates[] = new SoapVar($private, SOAP_ENC_OBJECT, paylineSDK::soap_privateData, paylineSDK::PAYLINE_NAMESPACE);
890
+ }
891
+
892
+ /**
893
+ * function setWalletIdList
894
+ * @params : sting : string if wallet id separated by ';'.
895
+ * @return :
896
+ * @description : make an array of wallet id .
897
+ **/
898
+ public function setWalletIdList($walletIdList) {
899
+ if ($walletIdList) $this->walletIdList = explode(";", $walletIdList);
900
+ if(empty($walletIdList))$this->walletIdList = array(0) ;
901
+ }
902
+
903
+ /**
904
+ * Hide characters in a string
905
+ * @param String $inString : the string to hide
906
+ * @param int $n1 : number of characters shown at the begining of the string
907
+ * @param int $n2 : number of characters shown at end begining of the string
908
+ */
909
+ private function hideChars($inString, $n1, $n2){
910
+ $inStringLength = strlen($inString);
911
+ if($inStringLength < ($n1+$n2)){
912
+ return $inString;
913
+ }
914
+ $outString = substr($inString,0,$n1);
915
+ $outString .= substr("********************",0,$inStringLength-($n1+$n2));
916
+ $outString .= substr($inString,-($n2));
917
+ return $outString;
918
+ }
919
+
920
+ /**
921
+ * @method writeTrace
922
+ * @desc write a trace in Payline log file
923
+ * @param $trace : the string to add in the log file
924
+ */
925
+ public function writeTrace($trace){
926
+ if($this->flagLog == 0){
927
+ return;
928
+ }else{
929
+ if(!isset($this->logger)){
930
+ if($this->flagLog == 1){ // log dans le répertoire par défaut
931
+ $this->logger = new paylineLog(date('Y-m-d',time()).'.log');
932
+ }
933
+ if($this->flagLog == 2){ // log dans un répertoire spécifié
934
+ $this->logger = new paylineLog(date('Y-m-d',time()).'.log',$this->pathLog);
935
+ }
936
+ }
937
+ $this->logger->write($trace);
938
+ }
939
+ }
940
+
941
+ /**
942
+ * Custom base64 url encoding. Replace unsafe url chars
943
+ *
944
+ * @param string $input
945
+ * @return string
946
+ */
947
+ public function base64_url_encode($input)
948
+ {
949
+ return strtr(base64_encode($input), '+/=', '-_,');
950
+ }
951
+
952
+ /**
953
+ * Custom base64 url decode. Replace custom url safe values with normal
954
+ * base64 characters before decoding.
955
+ *
956
+ * @param string $input
957
+ * @return string
958
+ */
959
+ public function base64_url_decode($input)
960
+ {
961
+ return base64_decode(strtr($input, '-_,', '+/='));
962
+ }
963
+
964
+ // MCRYPT_RIJNDAEL_128 : AES compliant
965
+ public function getEncrypt($message, $accessKey){
966
+ $block = mcrypt_get_block_size('rijndael_128', 'ecb');
967
+ $pad = $block - (strlen($message) % $block);
968
+ $message .= str_repeat(chr($pad), $pad);
969
+ return $this->base64_url_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $accessKey, $message, MCRYPT_MODE_ECB));
970
+ }
971
+
972
+ public function getDecrypt($message, $accessKey){
973
+ $message = $this->base64_url_decode($message);
974
+ $message = mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $accessKey, $message, MCRYPT_MODE_ECB);
975
+ $block = mcrypt_get_block_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_ECB);
976
+ $pad = ord($message[($len = strlen($message)) - 1]);
977
+ $len = strlen($message);
978
+ $pad = ord($message[$len-1]);
979
+ $return = substr($message, 0, strlen($message) - $pad);
980
+ $this->writeTrace("getDecrypt($message, $accessKey) = $return");
981
+ return $return;
982
+ }
983
+
984
+ public function gzdecode($data,&$filename='',&$error='',$maxlength=null)
985
+ {
986
+ $this->writeTrace("gzdecode($data,$filename,$error,$maxlength)");
987
+ $len = strlen($data);
988
+ if ($len < 18 || strcmp(substr($data,0,2),"\x1f\x8b")) {
989
+ $error = "Not in GZIP format.";
990
+ return null; // Not GZIP format (See RFC 1952)
991
+ }
992
+ $method = ord(substr($data,2,1)); // Compression method
993
+ $flags = ord(substr($data,3,1)); // Flags
994
+ if ($flags & 31 != $flags) {
995
+ $error = "Reserved bits not allowed.";
996
+ return null;
997
+ }
998
+ // NOTE: $mtime may be negative (PHP integer limitations)
999
+ $mtime = unpack("V", substr($data,4,4));
1000
+ $mtime = $mtime[1];
1001
+ $xfl = substr($data,8,1);
1002
+ $os = substr($data,8,1);
1003
+ $headerlen = 10;
1004
+ $extralen = 0;
1005
+ $extra = "";
1006
+ if ($flags & 4) {
1007
+ // 2-byte length prefixed EXTRA data in header
1008
+ if ($len - $headerlen - 2 < 8) {
1009
+ return false; // invalid
1010
+ }
1011
+ $extralen = unpack("v",substr($data,8,2));
1012
+ $extralen = $extralen[1];
1013
+ if ($len - $headerlen - 2 - $extralen < 8) {
1014
+ return false; // invalid
1015
+ }
1016
+ $extra = substr($data,10,$extralen);
1017
+ $headerlen += 2 + $extralen;
1018
+ }
1019
+ $filenamelen = 0;
1020
+ $filename = "";
1021
+ if ($flags & 8) {
1022
+ // C-style string
1023
+ if ($len - $headerlen - 1 < 8) {
1024
+ return false; // invalid
1025
+ }
1026
+ $filenamelen = strpos(substr($data,$headerlen),chr(0));
1027
+ if ($filenamelen === false || $len - $headerlen - $filenamelen - 1 < 8) {
1028
+ return false; // invalid
1029
+ }
1030
+ $filename = substr($data,$headerlen,$filenamelen);
1031
+ $headerlen += $filenamelen + 1;
1032
+ }
1033
+ $commentlen = 0;
1034
+ $comment = "";
1035
+ if ($flags & 16) {
1036
+ // C-style string COMMENT data in header
1037
+ if ($len - $headerlen - 1 < 8) {
1038
+ return false; // invalid
1039
+ }
1040
+ $commentlen = strpos(substr($data,$headerlen),chr(0));
1041
+ if ($commentlen === false || $len - $headerlen - $commentlen - 1 < 8) {
1042
+ return false; // Invalid header format
1043
+ }
1044
+ $comment = substr($data,$headerlen,$commentlen);
1045
+ $headerlen += $commentlen + 1;
1046
+ }
1047
+ $headercrc = "";
1048
+ if ($flags & 2) {
1049
+ // 2-bytes (lowest order) of CRC32 on header present
1050
+ if ($len - $headerlen - 2 < 8) {
1051
+ return false; // invalid
1052
+ }
1053
+ $calccrc = crc32(substr($data,0,$headerlen)) & 0xffff;
1054
+ $headercrc = unpack("v", substr($data,$headerlen,2));
1055
+ $headercrc = $headercrc[1];
1056
+ if ($headercrc != $calccrc) {
1057
+ $error = "Header checksum failed.";
1058
+ return false; // Bad header CRC
1059
+ }
1060
+ $headerlen += 2;
1061
+ }
1062
+ // GZIP FOOTER
1063
+ $datacrc = unpack("V",substr($data,-8,4));
1064
+ $datacrc = sprintf('%u',$datacrc[1] & 0xFFFFFFFF);
1065
+ $isize = unpack("V",substr($data,-4));
1066
+ $isize = $isize[1];
1067
+ // decompression:
1068
+ $bodylen = $len-$headerlen-8;
1069
+ if ($bodylen < 1) {
1070
+ // IMPLEMENTATION BUG!
1071
+ return null;
1072
+ }
1073
+ $body = substr($data,$headerlen,$bodylen);
1074
+ $data = "";
1075
+ if ($bodylen > 0) {
1076
+ switch ($method) {
1077
+ case 8:
1078
+ // Currently the only supported compression method:
1079
+ $data = gzinflate($body,$maxlength);
1080
+ break;
1081
+ default:
1082
+ $error = "Unknown compression method.";
1083
+ return false;
1084
+ }
1085
+ } // zero-byte body content is allowed
1086
+ // Verifiy CRC32
1087
+ $crc = sprintf("%u",crc32($data));
1088
+ $crcOK = $crc == $datacrc;
1089
+ $lenOK = $isize == strlen($data);
1090
+ if (!$lenOK || !$crcOK) {
1091
+ $error = ( $lenOK ? '' : 'Length check FAILED. ') . ( $crcOK ? '' : 'Checksum FAILED.');
1092
+ return false;
1093
+ }
1094
+ return $data;
1095
+ }
1096
+
1097
+ private function webServiceRequest($array,$WSRequest,$PaylineAPI,$Method){
1098
+ $reqTrace = "Request : $PaylineAPI.$Method";
1099
+ $resTrace = '';
1100
+ try{
1101
+ $client = new SoapClient(dirname(__FILE__).'/'.paylineSDK::WSDL, $this->header_soap);
1102
+ $client->__setLocation ($this->webServicesEndpoint.$PaylineAPI);
1103
+
1104
+ if(isset($array['version'])&& strlen($array['version']))
1105
+ $WSRequest['version'] = $array['version'];
1106
+ else
1107
+ $WSRequest['version'] = '';
1108
+ if(isset($array['media'])&& strlen($array['media']))
1109
+ $WSRequest['media'] = $array['media'];
1110
+ else
1111
+ $WSRequest['media'] = '';
1112
+
1113
+ switch($Method){
1114
+ case 'createMerchant':
1115
+ $WSresponse = $client->createMerchant($WSRequest);
1116
+ $response = paylineUtil::responseToArray($WSresponse);
1117
+ break;
1118
+ case 'createWallet':
1119
+ $reqTrace .= '(contract = '.$array['contractNumber'].' - walletId = '.$array['wallet']['walletId'].' - card = '.$this->hideChars($array['card']['number'],4,4).')';
1120
+ $WSresponse = $client->createWallet($WSRequest);
1121
+ $response = paylineUtil::responseToArray($WSresponse);
1122
+ break;
1123
+ case 'createWebWallet':
1124
+ $reqTrace .= '(contract = '.$array['contractNumber'].' - walletId = '.$array['buyer']['walletId'].')';
1125
+ $WSresponse = $client->createWebWallet($WSRequest);
1126
+ $response = paylineUtil::responseToArray($WSresponse);
1127
+ if($response['result']['code'] == '00000'){
1128
+ $resTrace = ' - token = '.$response['token'];
1129
+ }
1130
+ break;
1131
+ case 'updatePaymentRecord':
1132
+ $reqTrace .= '(contract = '.$array['contractNumber'].' - paymentRecordId = '.$array['paymentRecordId'].')';
1133
+ $WSresponse = $client->updatePaymentRecord($WSRequest);
1134
+ $response = paylineUtil::responseToArray($WSresponse);
1135
+ break;
1136
+ case 'getBillingRecord':
1137
+ $reqTrace .= '(contract = '.$array['contractNumber'].' - paymentRecordId = '.$array['paymentRecordId'].' - billingRecordId = '.$array['billingRecordId'].')';
1138
+ $WSresponse = $client->getBillingRecord($WSRequest);
1139
+ $response = paylineUtil::responseToArray($WSresponse);
1140
+ break;
1141
+ case 'updateBillingRecord':
1142
+ $reqTrace .= '(contract = '.$array['contractNumber'].' - paymentRecordId = '.$array['paymentRecordId'].' - billingRecordId = '.$array['billingRecordId'].')';
1143
+ $WSresponse = $client->updateBillingRecord($WSRequest);
1144
+ $response = paylineUtil::responseToArray($WSresponse);
1145
+ break;
1146
+ case 'disablePaymentRecord':
1147
+ $reqTrace .= '(contract = '.$array['contractNumber'].' - paymentRecordId = '.$array['paymentRecordId'].')';
1148
+ $WSresponse = $client->disablePaymentRecord($WSRequest);
1149
+ $response = paylineUtil::responseToArray($WSresponse);
1150
+ break;
1151
+ case 'disableWallet':
1152
+ $reqTrace .= '(contract = '.$array['contractNumber'].' - walletIdList = '.implode(';', $this->walletIdList).')';
1153
+ $WSresponse = $client->disableWallet($WSRequest);
1154
+ $response = paylineUtil::responseToArray($WSresponse);
1155
+ break;
1156
+ case 'doAuthorization':
1157
+ $reqTrace .= '(contract = '.$array['payment']['contractNumber'].' - amount = '.$array['payment']['amount'].')';
1158
+ $WSresponse = $client->doAuthorization($WSRequest);
1159
+ $response = paylineUtil::responseToArray($WSresponse);
1160
+ $resTrace = ' - transactionID = '.$response['transaction']['id'];
1161
+ break;
1162
+ case 'doCapture':
1163
+ $reqTrace .= '(transactionID = '.$array['transactionID'].' - amount = '.$array['payment']['amount'].')';
1164
+ $WSresponse = $client->doCapture($WSRequest);
1165
+ $response = paylineUtil::responseToArray($WSresponse);
1166
+ $resTrace = ' - transactionID = '.$response['transaction']['id'];
1167
+ break;
1168
+ case 'doCredit':
1169
+ $reqTrace .= '(contract = '.$array['payment']['contractNumber'].' - order.ref = '.$array['order']['ref'].' - card = '.$this->hideChars($array['card']['number'],4,4).')';
1170
+ $WSresponse = $client->doCredit($WSRequest);
1171
+ $response = paylineUtil::responseToArray($WSresponse);
1172
+ $resTrace = ' - transactionID = '.$response['transaction']['id'];
1173
+ break;
1174
+ case 'doDebit':
1175
+ $reqTrace .= '(contract = '.$array['payment']['contractNumber'].' - order.ref = '.$array['order']['ref'].' - card = '.$this->hideChars($array['card']['number'],4,4).')';
1176
+ $WSresponse = $client->doDebit($WSRequest);
1177
+ $response = paylineUtil::responseToArray($WSresponse);
1178
+ $resTrace = ' - transactionID = '.$response['transaction']['id'];
1179
+ break;
1180
+ case 'doImmediateWalletPayment':
1181
+ $reqTrace .= '(contract = '.$array['payment']['contractNumber'].' - walletId = '.$array['walletId'].' - order.ref = '.$array['order']['ref'].')';
1182
+ $WSresponse = $client->doImmediateWalletPayment($WSRequest);
1183
+ $response = paylineUtil::responseToArray($WSresponse);
1184
+ $resTrace = ' - transactionID = '.$response['transaction']['id'];
1185
+ break;
1186
+ case 'doReAuthorization':
1187
+ $reqTrace .= '(transactionID = '.$array['transactionID'].' - amount = '.$array['payment']['amount'].')';
1188
+ $WSresponse = $client->doReAuthorization($WSRequest);
1189
+ $response = paylineUtil::responseToArray($WSresponse);
1190
+ $resTrace = ' - transactionID = '.$response['transaction']['id'];
1191
+ break;
1192
+ case 'doRecurrentWalletPayment':
1193
+ $reqTrace .= '(contract = '.$array['payment']['contractNumber'].' - walletId = '.$array['walletId'].' - order.ref = '.$array['order']['ref'].')';
1194
+ $WSresponse = $client->doRecurrentWalletPayment($WSRequest);
1195
+ $response = paylineUtil::responseToArray($WSresponse);
1196
+ if($response['result']['code'] == '02500'){
1197
+ $resTrace = ' - paymentRecordId = '.$response['paymentRecordId'];
1198
+ }
1199
+ break;
1200
+ case 'doRefund':
1201
+ $reqTrace .= '(transactionID = '.$array['transactionID'].' - amount = '.$array['payment']['amount'].')';
1202
+ $WSresponse = $client->doRefund($WSRequest);
1203
+ $response = paylineUtil::responseToArray($WSresponse);
1204
+ $resTrace = ' - transactionID = '.$response['transaction']['id'];
1205
+ break;
1206
+ case 'doReset':
1207
+ $reqTrace .= '(transactionID = '.$array['transactionID'].')';
1208
+ $WSresponse = $client->doReset($WSRequest);
1209
+ $response = paylineUtil::responseToArray($WSresponse);
1210
+ $resTrace = ' - transactionID = '.$response['transaction']['id'];
1211
+ break;
1212
+ case 'doScheduledWalletPayment':
1213
+ $reqTrace .= '(contract = '.$array['payment']['contractNumber'].' - walletId = '.$array['walletId'].' - order.ref = '.$array['order']['ref'].')';
1214
+ $WSresponse = $client->doScheduledWalletPayment($WSRequest);
1215
+ $response = paylineUtil::responseToArray($WSresponse);
1216
+ if($response['result']['code'] == '02500'){
1217
+ $resTrace = ' - paymentRecordId = '.$response['paymentRecordId'];
1218
+ }
1219
+ break;
1220
+ case 'doScoringCheque':
1221
+ $WSresponse = $client->doScoringCheque($WSRequest);
1222
+ $response = paylineUtil::responseToArray($WSresponse);
1223
+ break;
1224
+ case 'doWebPayment':
1225
+ $reqTrace .= '(order.ref = '.$array['order']['ref'].')';
1226
+ $WSresponse = $client->doWebPayment($WSRequest);
1227
+ $response = paylineUtil::responseToArray($WSresponse);
1228
+ if($response['result']['code'] == '00000'){
1229
+ $resTrace = ' - token = '.$response['token'];
1230
+ }
1231
+ break;
1232
+ case 'enableWallet':
1233
+ $reqTrace .= '(walletId = '.$array['walletId'].')';
1234
+ $WSresponse = $client->enableWallet($WSRequest);
1235
+ $response = paylineUtil::responseToArray($WSresponse);
1236
+ break;
1237
+ case 'getAlertDetails':
1238
+ $reqTrace .= '(alertId = '.$array['AlertId'].' - transactionId = '.$array['TransactionId'].')';
1239
+ $WSresponse = $client->getAlertDetails($WSRequest);
1240
+ $response = paylineUtil::responseToArray($WSresponse);
1241
+ break;
1242
+ case 'getBalance':
1243
+ $reqTrace .= '(contract = '.$array['contractNumber'].' - cardID = '.$this->hideChars($array['cardID'],4,4).')';
1244
+ $WSresponse = $client->getBalance($WSRequest);
1245
+ $response = paylineUtil::responseToArray($WSresponse);
1246
+ break;
1247
+ case 'getCards':
1248
+ $reqTrace .= '(contract - '.$array['contractNumber'].' - walletId = '.$array['walletId'].' - cardInd = '.$array['cardInd'].')';
1249
+ $WSresponse = $client->getCards($WSRequest);
1250
+ $response = paylineUtil::responseToArrayForGetCards($WSresponse);
1251
+ break;
1252
+ case 'getEncryptionKey':
1253
+ $WSresponse = $client->getEncryptionKey($WSRequest);
1254
+ $response = paylineUtil::responseToArray($WSresponse);
1255
+ break;
1256
+ case 'getMerchantSettings':
1257
+ $WSresponse = $client->getMerchantSettings($WSRequest);
1258
+ $response = paylineUtil::responseToArray($WSresponse);
1259
+ break;
1260
+ case 'getPaymentRecord':
1261
+ $reqTrace .= '(contract = '.$array['contractNumber'].' - paymentRecordId = '.$array['paymentRecordId'].')';
1262
+ $WSresponse = $client->getPaymentRecord($WSRequest);
1263
+ $response = paylineUtil::responseToArray($WSresponse);
1264
+ break;
1265
+ case 'getToken':
1266
+ $reqTrace .= '(contract = '.$array['contractNumber'].' - cardNumber = '.$this->hideChars($array['cardNumber'],4,4).')';
1267
+ $WSresponse = $client->getToken($WSRequest);
1268
+ $response = paylineUtil::responseToArray($WSresponse);
1269
+ if($response['result']['code'] == '02500'){
1270
+ $resTrace = ' - token = '.$response['token'];
1271
+ }
1272
+ break;
1273
+ case 'getTransactionDetails':
1274
+ $reqTrace = '(transactionId = '.$array['transactionId'].')';
1275
+ $WSresponse = $client->getTransactionDetails($WSRequest);
1276
+ $response = paylineUtil::responseToArray($WSresponse);
1277
+ break;
1278
+ case 'getWallet':
1279
+ $reqTrace .= '(contract = '.$array['contractNumber'].' - walletId = '.$array['walletId'].' - cardInd = '.$array['cardInd'].')';
1280
+ $WSresponse = $client->getWallet($WSRequest);
1281
+ $response = paylineUtil::responseToArray($WSresponse);
1282
+ break;
1283
+ case 'getWebPaymentDetails':
1284
+ $reqTrace .= '(token = '.$array['token'].')';
1285
+ $WSresponse = $client->getWebPaymentDetails($WSRequest);
1286
+ $response = paylineUtil::responseToArray($WSresponse);
1287
+ if(isset($response['transaction']['id'])){
1288
+ $resTrace = ' - transactionId = '.$response['transaction']['id'];
1289
+ }
1290
+ break;
1291
+ case 'getWebWallet':
1292
+ $reqTrace .= '(token = '.$array['token'].')';
1293
+ $WSresponse = $client->getWebWallet($WSRequest);
1294
+ $response = paylineUtil::responseToArray($WSresponse);
1295
+ if(isset($response['wallet']['card'])){
1296
+ $resTrace = ' - card = '.$this->hideChars($response['wallet']['card']['number'],4,4);
1297
+ }
1298
+ break;
1299
+ case 'manageWebWallet' :
1300
+ $reqTrace .= '(contract = '.$array['contractNumber'].' - walletId = '.$array['buyer']['walletId'].')';
1301
+ $WSresponse = $client->manageWebWallet($WSRequest);
1302
+ $response = paylineUtil::responseToArray($WSresponse);
1303
+ if($response['result']['code'] == '00000'){
1304
+ $resTrace = ' - token = '.$response['token'];
1305
+ }
1306
+ break;
1307
+ case 'transactionsSearch':
1308
+ $reqTrace .= '(';
1309
+ foreach ($array as $key => $value) {
1310
+ $reqTrace .= $value != '' ? "$key = $value - " : '';
1311
+ }
1312
+ $reqTrace .= ')';
1313
+ $WSresponse = $client->transactionsSearch($WSRequest);
1314
+ $response = paylineUtil::responseToArray($WSresponse);
1315
+ break;
1316
+ case 'unBlock':
1317
+ $reqTrace .= '(transactionID = '.$array['transactionID'].')';
1318
+ $WSresponse = $client->unBlock($WSRequest);
1319
+ $response = paylineUtil::responseToArray($WSresponse);
1320
+ break;
1321
+ case 'updateWallet':
1322
+ $reqTrace .= '(walletId = '.$array['wallet']['walletId'].')';
1323
+ $WSresponse = $client->updateWallet($WSRequest);
1324
+ $response = paylineUtil::responseToArray($WSresponse);
1325
+ break;
1326
+ case 'updateWebWallet':
1327
+ $reqTrace .= '(walletId = '.$array['walletId'].')';
1328
+ $WSresponse = $client->updateWebWallet($WSRequest);
1329
+ $response = paylineUtil::responseToArray($WSresponse);
1330
+ if($response['result']['code'] == '00000'){
1331
+ $resTrace = ' - token = '.$response['token'];
1332
+ }
1333
+ break;
1334
+ case 'verifyAuthentication':
1335
+ $reqTrace .= '(contract = '.$array['contractNumber'].' - card = '.$this->hideChars($array['card']['number'],4,4).')';
1336
+ $WSresponse = $client->verifyAuthentication($WSRequest);
1337
+ $response = paylineUtil::responseToArray($WSresponse);
1338
+ break;
1339
+ case 'verifyEnrollment':
1340
+ if(!empty($array['card']['number']) and !empty($array['payment']['contractNumber'])) {
1341
+ $reqTrace .= '(contract = '.$array['payment']['contractNumber'].' - card = '.$this->hideChars($array['card']['number'],4,4).')';
1342
+ }
1343
+ $WSresponse = $client->verifyEnrollment($WSRequest);
1344
+ $response = paylineUtil::responseToArray($WSresponse);
1345
+ break;
1346
+
1347
+ }
1348
+ $this->writeTrace($reqTrace);
1349
+ $this->writeTrace('Response : code = '.$response['result']['code'].$resTrace);
1350
+ return $response;
1351
+ }catch ( Exception $e ) {
1352
+ $this->writeTrace($reqTrace);
1353
+ $this->writeTrace("Exception : ".$e->getMessage());
1354
+ $ERROR = array();
1355
+ $ERROR['result']['code'] = paylineSDK::ERR_CODE;
1356
+ $ERROR['result']['longMessage'] = $e->getMessage();
1357
+ $ERROR['result']['shortMessage'] = $e->getMessage();
1358
+ return $ERROR;
1359
+ }
1360
+ }
1361
+
1362
+ public function createWallet($array){
1363
+ if(!isset($array['walletContracts'])||!strlen($array['walletContracts'][0]))$array['walletContracts'] = '';
1364
+ if(!isset($array['buyer']))$array['buyer'] = null;
1365
+ if(!isset($array['billingAddress']))$array['billingAddress'] = null;
1366
+ if(!isset($array['shippingAddress']))$array['shippingAddress'] = null;
1367
+ if(!isset($array['owner']))$array['owner'] = null;
1368
+ if(!isset($array['ownerAddress']))$array['ownerAddress'] = null;
1369
+ $WSRequest = array (
1370
+ 'contractNumber' => $array['contractNumber'],
1371
+ 'wallet' => $this->wallet($array['wallet'],$array['address'],$array['card']),
1372
+ 'buyer' => $this->buyer($array['buyer'],$array['shippingAddress'],$array['billingAddress']),
1373
+ 'owner' => $this->owner($array['owner'],$array['ownerAddress']),
1374
+ 'privateDataList' => $this->privates,
1375
+ 'authentication3DSecure' =>$this->authentication3DSecure($array['3DSecure']),
1376
+ 'contractNumberWalletList' => $this->secondContracts($array['walletContracts'])
1377
+ );
1378
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'createWallet');
1379
+ }
1380
+
1381
+ public function createWebWallet($array){
1382
+ if(isset($array['customPaymentPageCode'])&& strlen($array['customPaymentPageCode'])) $this->customPaymentPageCode = $array['customPaymentPageCode'];
1383
+ if(isset($array['cancelURL'])&& strlen($array['cancelURL'])) $this->cancelURL = $array['cancelURL'];
1384
+ if(isset($array['notificationURL']) && strlen($array['notificationURL'])) $this->notificationURL = $array['notificationURL'];
1385
+ if(isset($array['returnURL'])&& strlen($array['returnURL'])) $this->returnURL = $array['returnURL'];
1386
+ if(isset($array['customPaymentTemplateURL'])&& strlen($array['customPaymentTemplateURL'])) $this->customPaymentTemplateURL = $array['customPaymentTemplateURL'];
1387
+ if(isset($array['customPaymentPageCode'])&& strlen($array['customPaymentPageCode'])) $this->customPaymentPageCode = $array['customPaymentPageCode'];
1388
+ if(isset($array['languageCode'])&& strlen($array['languageCode'])) $this->languageCode = $array['languageCode'];
1389
+ if(isset($array['securityMode'])&& strlen($array['securityMode'])) $this->securityMode = $array['securityMode'];
1390
+ if(!isset($array['contracts'])||!strlen($array['contracts'][0]))$array['contracts'] = '';
1391
+ if(!isset($array['walletContracts'])||!strlen($array['walletContracts'][0]))$array['walletContracts'] = '';
1392
+ $WSRequest = array (
1393
+ 'contractNumber' => $array['contractNumber'],
1394
+ 'selectedContractList' => $this->contracts($array['contracts']),
1395
+ 'updatePersonalDetails' => $array['updatePersonalDetails'],
1396
+ 'buyer' => $this->buyer($array['buyer'],$array['shippingAddress'],$array['billingAddress']),
1397
+ 'languageCode' => $this->languageCode,
1398
+ 'customPaymentPageCode' => $this->customPaymentPageCode,
1399
+ 'securityMode' => $this->securityMode,
1400
+ 'returnURL' => $this->returnURL,
1401
+ 'cancelURL' => $this->cancelURL,
1402
+ 'notificationURL' => $this->notificationURL,
1403
+ 'privateDataList' => $this->privates,
1404
+ 'customPaymentTemplateURL' => $this->customPaymentTemplateURL,
1405
+ 'contractNumberWalletList' => $this->secondContracts($array['walletContracts'])
1406
+ );
1407
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::WEB_API,'createWebWallet');
1408
+ }
1409
+
1410
+ public function disablePaymentRecord($array){
1411
+ $WSRequest = array (
1412
+ 'contractNumber' => $array['contractNumber'],
1413
+ 'paymentRecordId' => $array['paymentRecordId']
1414
+ );
1415
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'disablePaymentRecord');
1416
+ }
1417
+
1418
+ public function disableWallet($array){
1419
+ $WSRequest = array (
1420
+ 'contractNumber' => $array['contractNumber'],
1421
+ 'walletIdList' => $this->walletIdList,
1422
+ 'cardInd' => $array['cardInd']
1423
+ );
1424
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'disableWallet');
1425
+ }
1426
+
1427
+ public function doAuthorization($array){
1428
+ if(!isset($array['buyer']))$array['buyer'] = null;
1429
+ if(!isset($array['owner']))$array['owner'] = null;
1430
+ if(!isset($array['billingAddress']))$array['billingAddress'] = null;
1431
+ if(!isset($array['shippingAddress']))$array['shippingAddress'] = null;
1432
+ if(!isset($array['ownerAddress']))$array['ownerAddress'] = null;
1433
+ if(!isset($array['3DSecure']))$array['3DSecure'] = null;
1434
+ if(!isset($array['bankAccountData']))$array['bankAccountData'] = null;
1435
+ $WSRequest = array (
1436
+ 'payment' => $this->payment($array['payment']),
1437
+ 'card' => $this->card($array['card']),
1438
+ 'order' => $this->order($array['order']),
1439
+ 'buyer' => $this->buyer($array['buyer'],$array['shippingAddress'],$array['billingAddress']),
1440
+ 'owner' => $this->owner($array['owner'],$array['ownerAddress']),
1441
+ 'privateDataList' => $this->privates,
1442
+ 'authentication3DSecure' =>$this->authentication3DSecure($array['3DSecure']),
1443
+ 'bankAccountData' => $this->bankAccountData($array['bankAccountData'])
1444
+ );
1445
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'doAuthorization');
1446
+ }
1447
+
1448
+ public function doCapture($array){
1449
+ $WSRequest = array (
1450
+ 'transactionID' =>$array['transactionID'],
1451
+ 'payment' => $this->payment($array['payment']),
1452
+ 'privateDataList' => $this->privates,
1453
+ 'sequenceNumber'=>$array['sequenceNumber']
1454
+ );
1455
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'doCapture');
1456
+ }
1457
+
1458
+ public function doCredit($array){
1459
+ if(!isset($array['buyer']))$array['buyer'] = null;
1460
+ if(!isset($array['billingAddress']))$array['billingAddress'] = null;
1461
+ if(!isset($array['shippingAddress']))$array['shippingAddress'] = null;
1462
+ $WSRequest = array (
1463
+ 'payment' => $this->payment($array['payment']),
1464
+ 'card' => $this->card($array['card']),
1465
+ 'buyer' => $this->buyer($array['buyer'],$array['shippingAddress'],$array['billingAddress']),
1466
+ 'privateDataList' => $this->privates,
1467
+ 'order' => $this->order($array['order']),
1468
+ 'comment' =>$array['comment']
1469
+ );
1470
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'doCredit');
1471
+ }
1472
+
1473
+ public function doDebit($array){
1474
+ if(!isset($array['buyer']))$array['buyer'] = null;
1475
+ if(!isset($array['billingAddress']))$array['billingAddress'] = null;
1476
+ if(!isset($array['shippingAddress']))$array['shippingAddress'] = null;
1477
+ $WSRequest = array (
1478
+ 'payment' => $this->payment($array['payment']),
1479
+ 'card' => $this->card($array['card']),
1480
+ 'order' => $this->order($array['order']),
1481
+ 'privateDataList' => $this->privates,
1482
+ 'buyer' => $this->buyer($array['buyer'],$array['shippingAddress'],$array['billingAddress']),
1483
+ 'authentication3DSecure' =>$this->authentication3DSecure($array['3DSecure']),
1484
+ 'authorization' =>$this->authorization($array['authorization'])
1485
+ );
1486
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'doDebit');
1487
+ }
1488
+
1489
+ public function doImmediateWalletPayment($array){
1490
+ if(!isset($array['buyer']))$array['buyer'] = null;
1491
+ if(!isset($array['billingAddress']))$array['billingAddress'] = null;
1492
+ if(!isset($array['shippingAddress']))$array['shippingAddress'] = null;
1493
+ if(!isset($array['3DSecure']))$array['3DSecure'] = null;
1494
+ $WSRequest = array (
1495
+ 'payment' => $this->payment($array['payment']),
1496
+ 'order' => $this->order($array['order']),
1497
+ 'buyer' => $this->buyer($array['buyer'],$array['shippingAddress'],$array['billingAddress']),
1498
+ 'walletId' => $array['walletId'],
1499
+ 'cardInd' => $array['cardInd'],
1500
+ 'cvx' => $array['walletCvx'],
1501
+ 'privateDataList' => $this->privates,
1502
+ 'authentication3DSecure' =>$this->authentication3DSecure($array['3DSecure'])
1503
+ );
1504
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'doImmediateWalletPayment');
1505
+ }
1506
+
1507
+ public function doReAuthorization($array){
1508
+ $WSRequest = array (
1509
+ 'transactionID' => $array['transactionID'],
1510
+ 'payment' => $this->payment($array['payment']),
1511
+ 'order' => $this->order($array['order']),
1512
+ 'privateDataList' => $this->privates
1513
+ );
1514
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'doReAuthorization');
1515
+ }
1516
+
1517
+ public function doRecurrentWalletPayment($array){
1518
+ if(!isset($array['orderRef']))$array['orderRef'] = null;
1519
+ if(!isset($array['orderDate']))$array['orderDate'] = null;
1520
+ if(!isset($array['scheduledDate']))$array['scheduledDate'] = null;
1521
+ $WSRequest = array (
1522
+ 'payment' => $this->payment($array['payment']),
1523
+ 'orderRef' => $array['orderRef'],
1524
+ 'orderDate' => $array['orderDate'],
1525
+ 'scheduledDate' => $array['scheduledDate'],
1526
+ 'walletId' => $array['walletId'],
1527
+ 'cardInd' => $array['cardInd'],
1528
+ 'recurring' => $this->recurring($array['recurring']),
1529
+ 'privateDataList' => $this->privates,
1530
+ 'order' => $this->order($array['order'])
1531
+ );
1532
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'doRecurrentWalletPayment');
1533
+ }
1534
+
1535
+ public function doRefund($array){
1536
+ $WSRequest = array (
1537
+ 'transactionID' =>$array['transactionID'],
1538
+ 'payment' =>$this->payment($array['payment']),
1539
+ 'comment' =>$array['comment'],
1540
+ 'privateDataList' => $this->privates,
1541
+ 'sequenceNumber'=>$array['sequenceNumber']
1542
+ );
1543
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'doRefund');
1544
+ }
1545
+
1546
+ public function doReset($array){
1547
+ $WSRequest = array (
1548
+ 'transactionID' => $array['transactionID'],
1549
+ 'comment' => $array['comment']
1550
+ );
1551
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'doReset');
1552
+ }
1553
+
1554
+ public function doScheduledWalletPayment($array){
1555
+ if(!isset($array['orderRef']))$array['orderRef'] = null;
1556
+ if(!isset($array['orderDate']))$array['orderDate'] = null;
1557
+ $WSRequest = array (
1558
+ 'payment' => $this->payment($array['payment']),
1559
+ 'orderRef' => $array['orderRef'],
1560
+ 'orderDate' => $array['orderDate'],
1561
+ 'scheduledDate' => $array['scheduledDate'],
1562
+ 'walletId' => $array['walletId'],
1563
+ 'cardInd' => $array['cardInd'],
1564
+ 'order' => $this->order($array['order']),
1565
+ 'privateDataList' => $this->privates
1566
+ );
1567
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'doScheduledWalletPayment');
1568
+ }
1569
+
1570
+ public function doScoringCheque($array){
1571
+ $WSRequest = array (
1572
+ 'payment' => $this->payment($array['payment']),
1573
+ 'cheque' => $this->cheque($array['cheque']),
1574
+ 'order' => $this->order($array['order']),
1575
+ 'privateDataList' => $this->privates
1576
+ );
1577
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'doScoringCheque');
1578
+ }
1579
+
1580
+ public function doWebPayment($array){
1581
+ if(isset($array['cancelURL'])&& strlen($array['cancelURL'])) $this->cancelURL = $array['cancelURL'];
1582
+ if(isset($array['notificationURL']) && strlen($array['notificationURL'])) $this->notificationURL = $array['notificationURL'];
1583
+ if(isset($array['returnURL'])&& strlen($array['returnURL'])) $this->returnURL = $array['returnURL'];
1584
+ if(isset($array['customPaymentTemplateURL'])&& strlen($array['customPaymentTemplateURL'])) $this->customPaymentTemplateURL = $array['customPaymentTemplateURL'];
1585
+ if(isset($array['customPaymentPageCode'])&& strlen($array['customPaymentPageCode'])) $this->customPaymentPageCode = $array['customPaymentPageCode'];
1586
+ if(isset($array['languageCode'])&& strlen($array['languageCode'])) $this->languageCode = $array['languageCode'];
1587
+ if(isset($array['securityMode'])&& strlen($array['securityMode'])) $this->securityMode = $array['securityMode'];
1588
+ if(!isset($array['payment']))$array['payment'] = null;
1589
+ if(!isset($array['contracts'])||!strlen($array['contracts'][0]))$array['contracts'] = '';
1590
+ if(!isset($array['secondContracts'])||!strlen($array['secondContracts'][0]))$array['secondContracts'] = '';
1591
+ if(!isset($array['walletContracts'])||!strlen($array['walletContracts'][0]))$array['walletContracts'] = '';
1592
+ if(!isset($array['buyer']))$array['buyer'] = null;
1593
+ if(!isset($array['billingAddress']))$array['billingAddress'] = null;
1594
+ if(!isset($array['shippingAddress']))$array['shippingAddress'] = null;
1595
+ if(!isset($array['recurring']))$array['recurring'] = null;
1596
+
1597
+ $WSRequest = array (
1598
+ 'payment' => $this->payment($array['payment']),
1599
+ 'returnURL' => $this->returnURL,
1600
+ 'cancelURL' => $this->cancelURL,
1601
+ 'order' => $this->order($array['order']),
1602
+ 'notificationURL' => $this->notificationURL,
1603
+ 'customPaymentTemplateURL' => $this->customPaymentTemplateURL,
1604
+ 'selectedContractList' => $this->contracts($array['contracts']),
1605
+ 'secondSelectedContractList' => $this->secondContracts($array['secondContracts']),
1606
+ 'privateDataList' => $this->privates,
1607
+ 'languageCode' => $this->languageCode,
1608
+ 'customPaymentPageCode' => $this->customPaymentPageCode,
1609
+ 'buyer' => $this->buyer($array['buyer'],$array['shippingAddress'],$array['billingAddress']),
1610
+ 'securityMode' => $this->securityMode,
1611
+ 'contractNumberWalletList' => $this->secondContracts($array['walletContracts'])
1612
+ );
1613
+
1614
+
1615
+ if(isset($array['payment']['mode'])){
1616
+ if(($array['payment']['mode'] == "REC") || ($array['payment']['mode'] == "NX")) {
1617
+ $WSRequest['recurring'] = $this->recurring($array['recurring']);
1618
+ }
1619
+ }
1620
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::WEB_API,'doWebPayment');
1621
+ }
1622
+
1623
+ public function enableWallet($array){
1624
+ $WSRequest = array (
1625
+ 'contractNumber' => $array['contractNumber'],
1626
+ 'walletId' => $array['walletId'],
1627
+ 'cardInd' => $array['cardInd']
1628
+ );
1629
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'enableWallet');
1630
+ }
1631
+
1632
+ public function getServletTokenUrl(){
1633
+ return $this->servletTokenUrl;
1634
+ }
1635
+
1636
+ public function getWidgetJavascriptUrl(){
1637
+ return $this->widgetJavascriptUrl;
1638
+ }
1639
+
1640
+ public function getWidgetCssUrl(){
1641
+ return $this->widgetCssUrl;
1642
+ }
1643
+
1644
+ public function getAlertDetails($array){
1645
+ $WSRequest = array(
1646
+ 'AlertId' => $array['AlertId'],
1647
+ 'TransactionId' => $array['TransactionId']
1648
+ );
1649
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::EXTENDED_API,'getAlertDetails');
1650
+ }
1651
+
1652
+ public function getBalance($array){
1653
+ $WSRequest = array(
1654
+ 'contractNumber' => $array['contractNumber'],
1655
+ 'cardID' => $array['cardID']
1656
+ );
1657
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'getBalance');
1658
+ }
1659
+
1660
+ public function getCards($array){
1661
+ $WSRequest = array (
1662
+ 'contractNumber' => $array['contractNumber'],
1663
+ 'walletId' => $array['walletId'],
1664
+ 'cardInd' => $array['cardInd']
1665
+ );
1666
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'getCards');
1667
+ }
1668
+
1669
+ public function getEncryptionKey($array){
1670
+ $WSRequest = array();
1671
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'getEncryptionKey');
1672
+ }
1673
+
1674
+ public function getMerchantSettings($array){
1675
+ $WSRequest = array();
1676
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'getMerchantSettings');
1677
+ }
1678
+
1679
+ private function getPaymentMeans(){
1680
+ $this->writeTrace('getPaymentMeans');
1681
+ try{
1682
+ $client = new SoapClient(dirname(__FILE__).'/PaylineByMonext.wsdl', $this->header_soap);
1683
+ $WSresponse = $client->getPaymentMeans();
1684
+ $response = paylineUtil::responseToArray($WSresponse);
1685
+ $this->writeTrace($response['result']);
1686
+ return $response;
1687
+ }catch ( Exception $e ) {
1688
+ $this->writeTrace("Exception : ".$e->getMessage());
1689
+ $ERROR = array();
1690
+ $ERROR['result']['code'] = paylineSDK::ERR_CODE;
1691
+ $ERROR['result']['longMessage'] = $e->getMessage();
1692
+ $ERROR['result']['shortMessage'] = $e->getMessage();
1693
+ return $ERROR;
1694
+ }
1695
+ }
1696
+
1697
+ private function addPOSFromObject($oPointOfSell,$pos){
1698
+ if(isset($oPointOfSell->contracts->contract)){
1699
+ $this->posData[$pos] = array();
1700
+ $this->posData[$pos]['label'] = $oPointOfSell->label;
1701
+ $this->posData[$pos]['contracts'] = array();
1702
+ if(sizeof($oPointOfSell->contracts->contract) > 1){
1703
+ // more than 1 active contract in this point of sell
1704
+ $ctr = 0;
1705
+ foreach ($oPointOfSell->contracts->contract as $contract){
1706
+ $this->posData[$pos]['contracts'][$ctr] = array();
1707
+ $this->posData[$pos]['contracts'][$ctr]['cardType'] = $contract->cardType;
1708
+ $this->posData[$pos]['contracts'][$ctr]['label'] = $contract->label;
1709
+ $this->posData[$pos]['contracts'][$ctr]['contractNumber'] = $contract->contractNumber;
1710
+ $this->posData[$pos]['contracts'][$ctr]['logo'] = $this->paymentMeansLogos[$this->posData[$pos]['contracts'][$ctr]['cardType']]; // default logo
1711
+ if($contract->logoEnable){
1712
+ $this->posData[$pos]['contracts'][$ctr]['logo'] = $this->downloadCustomLogo($contract->normalLogo, $contract->normalLogoMime, $contract->contractNumber, $oPointOfSell->label);
1713
+ }
1714
+ $ctr++;
1715
+ }
1716
+ }else{ // only 1 active contract in this point of sell
1717
+ $this->posData[$pos]['contracts'][0] = array();
1718
+ $this->posData[$pos]['contracts'][0]['cardType'] = $oPointOfSell->contracts->contract->cardType;
1719
+ $this->posData[$pos]['contracts'][0]['label'] = $oPointOfSell->contracts->contract->label;
1720
+ $this->posData[$pos]['contracts'][0]['contractNumber'] = $oPointOfSell->contracts->contract->contractNumber;
1721
+ $this->posData[$pos]['contracts'][0]['logo'] = $this->paymentMeansLogos[$this->posData[$pos]['contracts'][0]['cardType']]; // default logo
1722
+ if($oPointOfSell->contracts->contract->logoEnable){
1723
+ $this->posData[$pos]['contracts'][0]['logo'] = $this->downloadCustomLogo($oPointOfSell->contracts->contract->normalLogo, $oPointOfSell->contracts->contract->normalLogoMime, $oPointOfSell->contracts->contract->contractNumber, $oPointOfSell->label);
1724
+ }
1725
+ }
1726
+ }else{ // no contract in this point of sell
1727
+ return false;
1728
+ }
1729
+
1730
+ return true;
1731
+ }
1732
+
1733
+ private function addPOSFromArray($aPointOfSell,$pos){
1734
+ if(isset($aPointOfSell['contracts']['contract'])){
1735
+ $this->posData[$pos] = array();
1736
+ $this->posData[$pos]['label'] = $aPointOfSell['label'];
1737
+ $this->posData[$pos]['contracts'] = array();
1738
+ if(isset($aPointOfSell['contracts']['contract']['label'])){
1739
+ // only 1 active contract in this point of sell
1740
+ $this->posData[$pos]['contracts'][0] = array();
1741
+ $this->posData[$pos]['contracts'][0]['cardType'] = $aPointOfSell['contracts']['contract']['cardType'];
1742
+ $this->posData[$pos]['contracts'][0]['label'] = $aPointOfSell['contracts']['contract']['label'];
1743
+ $this->posData[$pos]['contracts'][0]['contractNumber'] = $aPointOfSell['contracts']['contract']['contractNumber'];
1744
+ $this->posData[$pos]['contracts'][0]['logo'] = $this->paymentMeansLogos[$this->posData[$pos]['contracts'][0]['cardType']]; // default logo
1745
+ if($aPointOfSell['contracts']['contract']['logoEnable']){
1746
+ $this->posData[$pos]['contracts'][0]['logo'] = $this->downloadCustomLogo($aPointOfSell['contracts']['contract']['normalLogo'], $aPointOfSell['contracts']['contract']['normalLogoMime'], $aPointOfSell['contracts']['contract']['contractNumber'], $aPointOfSell['label']);
1747
+ }
1748
+ }else{ // more than 1 active contract in this point of sell
1749
+ $ctr = 0;
1750
+ foreach ($aPointOfSell['contracts']['contract'] as $contract){
1751
+ $this->posData[$pos]['contracts'][$ctr] = array();
1752
+ $this->posData[$pos]['contracts'][$ctr]['cardType'] = $contract->cardType;
1753
+ $this->posData[$pos]['contracts'][$ctr]['label'] = $contract->label;
1754
+ $this->posData[$pos]['contracts'][$ctr]['contractNumber'] = $contract->contractNumber;
1755
+ $this->posData[$pos]['contracts'][$ctr]['logo'] = $this->paymentMeansLogos[$this->posData[$pos]['contracts'][$ctr]['cardType']]; // default logo
1756
+ if($contract->logoEnable){
1757
+ $this->posData[$pos]['contracts'][$ctr]['logo'] = $this->downloadCustomLogo($contract->normalLogo, $contract->normalLogoMime, $contract->contractNumber, $aPointOfSell['label']);
1758
+ }
1759
+ $ctr++;
1760
+ }
1761
+ }
1762
+ }else{ // no contract in this point of sell
1763
+ return false;
1764
+ }
1765
+ return true;
1766
+ }
1767
+
1768
+ private function absoluteURL($path) {
1769
+ $dir = str_replace('\\', '/', dirname($path));
1770
+ return $_SERVER['HTTP_ORIGIN'].'/'.substr($dir, strlen($_SERVER['DOCUMENT_ROOT'])).'/';
1771
+ }
1772
+
1773
+ private function downloadCustomLogo($base64String,$mimeType,$contractNumber,$posLabel){
1774
+ $mime = explode('/', $mimeType);
1775
+ if($this->customLogoPath != null){
1776
+ if(!file_exists($this->customLogoPath)){
1777
+ mkdir($this->customLogoPath);
1778
+ }
1779
+ $posDir = $this->customLogoPath.$posLabel.DIRECTORY_SEPARATOR;
1780
+ }else{
1781
+ $merchantDir = dirname(__DIR__).DIRECTORY_SEPARATOR.paylineSDK::DEFAULT_LOGO_DIR.DIRECTORY_SEPARATOR.$this->header_soap['login'].DIRECTORY_SEPARATOR;
1782
+ if(!file_exists($merchantDir)){
1783
+ mkdir($merchantDir);
1784
+ }
1785
+ $posDir = $merchantDir.$posLabel.DIRECTORY_SEPARATOR;
1786
+ }
1787
+ if(!file_exists($posDir)){
1788
+ mkdir($posDir);
1789
+ }
1790
+ $output_file = $posDir.$contractNumber.'.'.$mime[1];
1791
+
1792
+ try{
1793
+ if(file_put_contents($output_file,$base64String)){
1794
+ return $this->absoluteURL($output_file).$contractNumber.'.'.$mime[1];
1795
+ }else{
1796
+ $this->writeTrace("Error : downloadCustomLogo for contract $contractNumber under $posDir failed");
1797
+ return paylineSDK::ERR_CODE;
1798
+ }
1799
+ }catch (Exception $e){
1800
+ $this->writeTrace("Exception : downloadCustomLogo for contract $contractNumber of pos $posLabel - ".$e->getMessage());
1801
+ return paylineSDK::ERR_CODE;
1802
+ }
1803
+ }
1804
+
1805
+ public function getMerchantSettingsToArray($array){
1806
+ /*
1807
+ * Association between Payment mean types and logos URL
1808
+ */
1809
+ $getPaymentMeansResponse = $this->getPaymentMeans();
1810
+ if($getPaymentMeansResponse['result']['code'] != paylineSDK::ERR_CODE){
1811
+ $this->paymentMeansLogos = array();
1812
+ for($i=0 ; $i<sizeof($getPaymentMeansResponse['listPaymentMean']['paymentMean']) ; $i++){
1813
+ $this->paymentMeansLogos[$getPaymentMeansResponse['listPaymentMean']['paymentMean'][$i]->code] = $getPaymentMeansResponse['listPaymentMean']['paymentMean'][$i]->logoUrl;
1814
+ }
1815
+ }
1816
+
1817
+ if(isset($array['logoPath'])){
1818
+ $this->customLogoPath = $array['logoPath'];
1819
+ }
1820
+ $getMerchantSettingsRes = $this->getMerchantSettings($array);
1821
+ if(isset($getMerchantSettingsRes['listPointOfSell']['pointOfSell']['label'])){
1822
+ // only 1 active point of sell
1823
+ $aPointOfSell = $getMerchantSettingsRes['listPointOfSell']['pointOfSell'];
1824
+ $this->addPOSFromArray($aPointOfSell, 0);
1825
+ }else{ // more than 1 active point of sell
1826
+ $index = 0;
1827
+ foreach ($getMerchantSettingsRes['listPointOfSell']['pointOfSell'] as $oPointOfSell){
1828
+ if($this->addPOSFromObject($oPointOfSell, $index)){
1829
+ $index++; // no incrementation if pos was not added
1830
+ }
1831
+ }
1832
+ }
1833
+ $res = array('result' => $getMerchantSettingsRes['result'],'POS' => $this->posData);
1834
+ return $res;
1835
+ }
1836
+
1837
+ public function getPaymentRecord($array){
1838
+ $WSRequest = array (
1839
+ 'contractNumber' => $array['contractNumber'],
1840
+ 'paymentRecordId' => $array['paymentRecordId']
1841
+ );
1842
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'getPaymentRecord');
1843
+ }
1844
+
1845
+ public function updatePaymentRecord($array){
1846
+ $WSRequest = array (
1847
+ 'contractNumber' => $array['contractNumber'],
1848
+ 'paymentRecordId' => $array['paymentRecordId'],
1849
+ 'recurring' => $this->recurring($array['recurring']),
1850
+ );
1851
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'updatePaymentRecord');
1852
+ }
1853
+
1854
+ public function getBillingRecord($array){
1855
+ $WSRequest = array (
1856
+ 'contractNumber' => $array['contractNumber'],
1857
+ 'paymentRecordId' => $array['paymentRecordId'],
1858
+ 'billingRecordId' => $array['billingRecordId']
1859
+ );
1860
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'getBillingRecord');
1861
+ }
1862
+
1863
+ public function updateBillingRecord($array){
1864
+ $WSRequest = array (
1865
+ 'contractNumber' => $array['contractNumber'],
1866
+ 'paymentRecordId' => $array['paymentRecordId'],
1867
+ 'billingRecordId' => $array['billingRecordId'],
1868
+ 'billingRecordForUpdate' => $this->billingRecord($array['billingRecordForUpdate'])
1869
+ );
1870
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'updateBillingRecord');
1871
+ }
1872
+
1873
+ public function getToken($array){
1874
+ $WSRequest = array (
1875
+ 'cardNumber' => $array['cardNumber'],
1876
+ 'expirationDate' => $array['expirationDate'],
1877
+ 'contractNumber' => $array['contractNumber']
1878
+ );
1879
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'getToken');
1880
+ }
1881
+
1882
+ public function getTransactionDetails($array){
1883
+ if(!isset($array['transactionId']))$array['transactionId'] = null;
1884
+ if(!isset($array['orderRef']))$array['orderRef'] = null;
1885
+ if(!isset($array['startDate']))$array['startDate'] = null;
1886
+ if(!isset($array['endDate']))$array['endDate'] = null;
1887
+ if(!isset($array['transactionHistory']))$array['transactionHistory'] = null;
1888
+ if(!isset($array['archiveSearch']))$array['archiveSearch'] = null;
1889
+ $WSRequest = array (
1890
+ 'transactionId' => $array['transactionId'],
1891
+ 'orderRef' => $array['orderRef'],
1892
+ 'startDate' => $array['startDate'],
1893
+ 'endDate' => $array['endDate'],
1894
+ 'transactionHistory' => $array['transactionHistory'],
1895
+ 'archiveSearch' => $array['archiveSearch']
1896
+ );
1897
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::EXTENDED_API,'getTransactionDetails');
1898
+ }
1899
+ public function getWallet($array){
1900
+ $WSRequest = array (
1901
+ 'contractNumber' => $array['contractNumber'],
1902
+ 'walletId' => $array['walletId'],
1903
+ 'cardInd' => $array['cardInd']
1904
+ );
1905
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'getWallet');
1906
+ }
1907
+
1908
+ public function getWebPaymentDetails($array){
1909
+ return $this->webServiceRequest($array,$array,paylineSDK::WEB_API,'getWebPaymentDetails');
1910
+ }
1911
+
1912
+ public function getWebWallet($array){
1913
+ return $this->webServiceRequest($array,$array,paylineSDK::WEB_API,'getWebWallet');
1914
+ }
1915
+
1916
+ public function manageWebWallet($array){
1917
+ if(isset($array['cancelURL'])&& strlen($array['cancelURL'])) $this->cancelURL = $array['cancelURL'];
1918
+ if(isset($array['notificationURL']) && strlen($array['notificationURL'])) $this->notificationURL = $array['notificationURL'];
1919
+ if(isset($array['returnURL'])&& strlen($array['returnURL'])) $this->returnURL = $array['returnURL'];
1920
+ if(!isset($array['buyer']))$array['buyer'] = null;
1921
+ if(!isset($array['billingAddress']))$array['billingAddress'] = null;
1922
+ if(!isset($array['shippingAddress']))$array['shippingAddress'] = null;
1923
+ if(!isset($array['owner']))$array['owner'] = null;
1924
+ if(!isset($array['ownerAddress']))$array['ownerAddress'] = null;
1925
+ if(!isset($array['contracts'])||!strlen($array['contracts'][0]))$array['contracts'] = '';
1926
+ if(!isset($array['walletContracts'])||!strlen($array['walletContracts'][0]))$array['walletContracts'] = '';
1927
+ if(isset($array['customPaymentPageCode'])&& strlen($array['customPaymentPageCode'])) $this->customPaymentPageCode = $array['customPaymentPageCode'];
1928
+ if(isset($array['customPaymentTemplateURL'])&& strlen($array['customPaymentTemplateURL'])) $this->customPaymentTemplateURL = $array['customPaymentTemplateURL'];
1929
+ $WSRequest = array (
1930
+ 'contractNumber' => $array['contractNumber'],
1931
+ 'selectedContractList' => $this->contracts($array['contracts']),
1932
+ 'updatePersonalDetails' => $array['updatePersonalDetails'],
1933
+ 'buyer' => $this->buyer($array['buyer'],$array['shippingAddress'],$array['billingAddress']),
1934
+ 'owner' => $this->owner($array['owner'],$array['ownerAddress']),
1935
+ 'languageCode' => $array['languageCode'],
1936
+ 'customPaymentPageCode' => $array['customPaymentPageCode'],
1937
+ 'securityMode' => $array['securityMode'],
1938
+ 'returnURL' => $this->returnURL,
1939
+ 'cancelURL' => $this->cancelURL,
1940
+ 'notificationURL' => $this->notificationURL,
1941
+ 'privateDataList' => $this->privates,
1942
+ 'customPaymentTemplateURL' => $array['customPaymentTemplateURL'],
1943
+ 'contractNumberWalletList' => $this->secondContracts($array['walletContracts'])
1944
+ );
1945
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::WEB_API,'manageWebWallet');
1946
+ }
1947
+
1948
+ public function transactionsSearch($array){
1949
+ $WSRequest = array (
1950
+ 'transactionId' => $array['transactionId'],
1951
+ 'orderRef' => $array['orderRef'],
1952
+ 'startDate' => $array['startDate'],
1953
+ 'endDate' => $array['endDate'],
1954
+ 'contractNumber' => $array['contractNumber'],
1955
+ 'authorizationNumber' => $array['authorizationNumber'],
1956
+ 'returnCode' => $array['returnCode'],
1957
+ 'paymentMean' => $array['paymentMean'],
1958
+ 'transactionType' => $array['transactionType'],
1959
+ 'name' => $array['name'],
1960
+ 'firstName' => $array['firstName'],
1961
+ 'email' => $array['email'],
1962
+ 'cardNumber' => $array['cardNumber'],
1963
+ 'currency' => $array['currency'],
1964
+ 'minAmount' => $array['minAmount'],
1965
+ 'maxAmount' => $array['maxAmount'],
1966
+ 'walletId' => $array['walletId'],
1967
+ 'sequenceNumber' => $array['sequenceNumber'],
1968
+ 'token' => $array['token']
1969
+ );
1970
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::EXTENDED_API,'transactionsSearch');
1971
+ }
1972
+
1973
+ public function unBlock($array){
1974
+ $WSRequest = array (
1975
+ 'transactionID' => $array['transactionID'],
1976
+ 'transactionDate' => $array['transactionDate']
1977
+ );
1978
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'unBlock');
1979
+ }
1980
+
1981
+ public function updateWallet($array){
1982
+ $WSRequest = array (
1983
+ 'contractNumber' => $array['contractNumber'],
1984
+ 'cardInd' => $array['cardInd'],
1985
+ 'wallet' => $this->wallet($array['wallet'],$array['address'],$array['card']),
1986
+ 'buyer' => $this->buyer($array['buyer'], $array['shippingAddress'],$array['billingAddress']),
1987
+ 'owner' => $this->owner($array['owner'],$array['ownerAddress']),
1988
+ 'privateDataList' => $this->privates,
1989
+ 'authentication3DSecure' =>$this->authentication3DSecure($array['3DSecure']),
1990
+ 'contractNumberWalletList' => $this->secondContracts($array['walletContracts'])
1991
+ );
1992
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'updateWallet');
1993
+ }
1994
+
1995
+ public function updateWebWallet($array){
1996
+ if(isset($array['cancelURL'])&& strlen($array['cancelURL'])) $this->cancelURL = $array['cancelURL'];
1997
+ if(isset($array['notificationURL']) && strlen($array['notificationURL'])) $this->notificationURL = $array['notificationURL'];
1998
+ if(isset($array['returnURL'])&& strlen($array['returnURL'])) $this->returnURL = $array['returnURL'];
1999
+ if(isset($array['customPaymentTemplateURL'])&& strlen($array['customPaymentTemplateURL'])) $this->customPaymentTemplateURL = $array['customPaymentTemplateURL'];
2000
+ if(isset($array['customPaymentPageCode'])&& strlen($array['customPaymentPageCode'])) $this->customPaymentPageCode = $array['customPaymentPageCode'];
2001
+ if(isset($array['languageCode'])&& strlen($array['languageCode'])) $this->languageCode = $array['languageCode'];
2002
+ if(isset($array['securityMode'])&& strlen($array['securityMode'])) $this->securityMode = $array['securityMode'];
2003
+ if(!isset($array['walletContracts'])||!strlen($array['walletContracts'][0]))$array['walletContracts'] = '';
2004
+ $WSRequest = array (
2005
+ 'contractNumber' => $array['contractNumber'],
2006
+ 'cardInd' => $array['cardInd'],
2007
+ 'walletId' => $array['walletId'],
2008
+ 'updatePersonalDetails' => $array['updatePersonalDetails'],
2009
+ 'updateOwnerDetails' => $array['updateOwnerDetails'],
2010
+ 'updatePaymentDetails' => $array['updatePaymentDetails'],
2011
+ 'buyer' => $this->buyer($array['buyer'],$array['shippingAddress'],$array['billingAddress']),
2012
+ 'languageCode' => $this->languageCode,
2013
+ 'customPaymentPageCode' => $this->customPaymentPageCode,
2014
+ 'securityMode' => $this->securityMode,
2015
+ 'returnURL' => $this->returnURL,
2016
+ 'cancelURL' => $this->cancelURL,
2017
+ 'notificationURL' => $this->notificationURL,
2018
+ 'privateDataList' => $this->privates,
2019
+ 'customPaymentTemplateURL' => $this->customPaymentTemplateURL,
2020
+ 'contractNumberWalletList' => $this->secondContracts($array['walletContracts'])
2021
+ );
2022
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::WEB_API,'updateWebWallet');
2023
+ }
2024
+
2025
+ public function verifyAuthentication($array){
2026
+ $WSRequest = array (
2027
+ 'contractNumber' => $array['contractNumber'],
2028
+ 'pares' => $array['pares'],
2029
+ 'md' => $array['md'],
2030
+ 'card' => $this->card($array['card'])
2031
+ );
2032
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'verifyAuthentication');
2033
+ }
2034
+
2035
+ public function verifyEnrollment($array){
2036
+ if(!isset($array['orderRef']))$array['orderRef'] = null;
2037
+ if(!isset($array['userAgent']))$array['userAgent'] = null;
2038
+ if(!isset($array['mdFieldValue']))$array['mdFieldValue'] = null;
2039
+ if(!isset($array['walletId']))$array['walletId'] = null;
2040
+ if(!isset($array['walletCardInd']))$array['walletCardInd'] = null;
2041
+ if(!isset($array['card']))$array['card'] = null;
2042
+ $WSRequest = array (
2043
+ 'payment' => $this->payment($array['payment']),
2044
+ 'card' => $this->card($array['card']),
2045
+ 'orderRef' => $array['orderRef'],
2046
+ 'userAgent' => $array['userAgent'],
2047
+ 'mdFieldValue' => $array['mdFieldValue'],
2048
+ 'walletId' => $array['walletId'],
2049
+ 'walletCardInd' => $array['walletCardInd']
2050
+ );
2051
+ return $this->webServiceRequest($array,$WSRequest,paylineSDK::DIRECT_API,'verifyEnrollment');
2052
+ }
2053
+ }
app/code/community/Monext/Payline/lib/v4.44.wsdl CHANGED
@@ -1,3453 +1,3453 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <wsdl:definitions targetNamespace="http://impl.ws.payline.experian.com" xmlns:impl="http://impl.ws.payline.experian.com" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:intf="http://impl.ws.payline.experian.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns1="http://obj.ws.payline.experian.com">
3
- <wsdl:types>
4
- <schema elementFormDefault="qualified" targetNamespace="http://impl.ws.payline.experian.com" xmlns="http://www.w3.org/2001/XMLSchema">
5
- <import namespace="http://obj.ws.payline.experian.com"/>
6
- <element name="doWebPaymentRequest">
7
- <complexType>
8
- <annotation>
9
- <documentation>
10
- This element is the request for the
11
- doWebPayment
12
- method
13
- </documentation>
14
- </annotation>
15
- <sequence>
16
- <element name="version" nillable="false" type="xsd:string"/>
17
- <element name="payment" nillable="false" type="tns1:payment"/>
18
- <element name="returnURL" nillable="false" type="xsd:string"/>
19
- <element name="cancelURL" nillable="false" type="xsd:string"/>
20
- <element name="order" nillable="false" type="tns1:order"/>
21
- <element name="notificationURL" nillable="true" type="xsd:string"/>
22
- <element name="selectedContractList" nillable="true" type="tns1:selectedContractList"/>
23
- <element name="secondSelectedContractList" nillable="true" type="tns1:selectedContractList"/>
24
- <element name="privateDataList" nillable="true" type="tns1:privateDataList"/>
25
- <element name="languageCode" nillable="true" type="xsd:string"/>
26
- <element name="customPaymentPageCode" nillable="true" type="xsd:string"/>
27
- <element name="buyer" nillable="true" type="tns1:buyer"/>
28
- <element name="owner" nillable="true" type="tns1:owner"/>
29
- <element name="securityMode" nillable="true" type="xsd:string"/>
30
- <element name="recurring" nillable="true" type="tns1:recurring"/>
31
- <element name="customPaymentTemplateURL" nillable="true" type="xsd:string"/>
32
- <element name="contractNumberWalletList" nillable="true" type="tns1:contractNumberWalletList"/>
33
- </sequence>
34
- </complexType>
35
- </element>
36
- <element name="doWebPaymentResponse">
37
- <complexType>
38
- <annotation>
39
- <documentation>
40
- This element is the reponse from the
41
- doWebPayment
42
- method
43
- </documentation>
44
- </annotation>
45
- <sequence>
46
- <element name="result" nillable="false" type="tns1:result"/>
47
- <element name="token" nillable="false" type="xsd:string"/>
48
- <element name="redirectURL" nillable="false" type="xsd:string"/>
49
- <element minOccurs="0" name="stepCode" nillable="true" type="xsd:string"/>
50
- <element minOccurs="0" name="reqCode" nillable="true" type="xsd:string"/>
51
- <element minOccurs="0" name="method" nillable="true" type="xsd:string"/>
52
- </sequence>
53
- </complexType>
54
- </element>
55
- <element name="getWebPaymentDetailsRequest">
56
- <complexType>
57
- <annotation>
58
- <documentation>
59
- This element is the reponse from the
60
- getWebPayment
61
- method
62
- </documentation>
63
- </annotation>
64
- <sequence>
65
- <element name="version" nillable="false" type="xsd:string"/>
66
- <element name="token" nillable="false" type="xsd:string"/>
67
- </sequence>
68
- </complexType>
69
- </element>
70
- <element name="getWebPaymentDetailsResponse">
71
- <complexType>
72
- <annotation>
73
- <documentation>
74
- This element is the reponse from the
75
- doWebPayment
76
- method
77
- </documentation>
78
- </annotation>
79
- <sequence>
80
- <element name="result" nillable="false" type="tns1:result"/>
81
- <element name="transaction" nillable="false" type="tns1:transaction"/>
82
- <element name="payment" nillable="false" type="tns1:payment"/>
83
- <element name="authorization" nillable="false" type="tns1:authorization"/>
84
- <element minOccurs="0" name="privateDataList" nillable="true" type="tns1:privateDataList"/>
85
- <element minOccurs="0" name="paymentRecordId" nillable="true" type="xsd:string"/>
86
- <element minOccurs="0" name="billingRecordList" nillable="true" type="tns1:billingRecordList"/>
87
- <element minOccurs="0" name="authentication3DSecure" nillable="true" type="tns1:authentication3DSecure"/>
88
- <element name="card" type="tns1:cardOut"/>
89
- <element minOccurs="0" name="extendedCard" type="tns1:extendedCardType"/>
90
- <element name="order" type="tns1:order"/>
91
- <element minOccurs="0" name="paymentAdditionalList" nillable="true" type="tns1:paymentAdditionalList"/>
92
- <element minOccurs="0" name="media" nillable="true" type="xsd:string"/>
93
- <element minOccurs="0" name="numberOfAttempt" nillable="true" type="xsd:string"/>
94
- <element minOccurs="0" name="wallet" nillable="true" type="tns1:wallet"/>
95
- <element minOccurs="0" name="contractNumberWalletList" nillable="true" type="tns1:contractNumberWalletList"/>
96
- <element minOccurs="0" name="contractNumber" nillable="false" type="xsd:string"/>
97
- <element name="bankAccountData" nillable="true" type="tns1:bankAccountData"/>
98
- </sequence>
99
- </complexType>
100
- </element>
101
- <element name="doAuthorizationRequest">
102
- <complexType>
103
- <annotation>
104
- <documentation>
105
- This element is the request for the
106
- doAuthorization
107
- method
108
- </documentation>
109
- </annotation>
110
- <sequence>
111
- <element name="version" nillable="false" type="xsd:string"/>
112
- <element name="payment" nillable="false" type="tns1:payment"/>
113
- <element name="bankAccountData" nillable="false" type="tns1:bankAccountData"/>
114
- <element name="card" nillable="false" type="tns1:card"/>
115
- <element name="order" nillable="false" type="tns1:order"/>
116
- <element name="buyer" nillable="true" type="tns1:buyer"/>
117
- <element name="owner" nillable="true" type="tns1:owner"/>
118
- <element name="privateDataList" nillable="true" type="tns1:privateDataList"/>
119
- <element name="authentication3DSecure" nillable="true" type="tns1:authentication3DSecure"/>
120
- <element name="media" nillable="true" type="xsd:string"/>
121
- </sequence>
122
- </complexType>
123
- </element>
124
- <element name="doAuthorizationResponse">
125
- <complexType>
126
- <annotation>
127
- <documentation>
128
- This element is the reponse from the
129
- doAuthorization method
130
- </documentation>
131
- </annotation>
132
- <sequence>
133
- <element name="result" nillable="false" type="tns1:result"/>
134
- <element name="transaction" nillable="false" type="tns1:transaction"/>
135
- <element name="authorization" nillable="false" type="tns1:authorization"/>
136
- <element name="card" type="tns1:cardOut"/>
137
- <element name="extendedCard" type="tns1:extendedCardType"/>
138
- <element name="privateDataList" nillable="true" type="tns1:privateDataList"/>
139
- <element name="contractNumber" nillable="false" type="xsd:string"/>
140
- </sequence>
141
- </complexType>
142
- </element>
143
- <element name="doCaptureRequest">
144
- <complexType>
145
- <annotation>
146
- <documentation>
147
- This element is the request for the
148
- doCapture method
149
- </documentation>
150
- </annotation>
151
- <sequence>
152
- <element name="version" nillable="false" type="xsd:string"/>
153
- <element name="transactionID" nillable="false" type="xsd:string"/>
154
- <element name="payment" nillable="false" type="tns1:payment"/>
155
- <element name="privateDataList" nillable="true" type="tns1:privateDataList"/>
156
- <element name="sequenceNumber" nillable="true" type="xsd:string"/>
157
- <element name="media" nillable="true" type="xsd:string"/>
158
- </sequence>
159
- </complexType>
160
- </element>
161
- <element name="doCaptureResponse">
162
- <complexType>
163
- <annotation>
164
- <documentation>
165
- This element is the reponse from the
166
- doCapture
167
- method
168
- </documentation>
169
- </annotation>
170
- <sequence>
171
- <element name="result" nillable="false" type="tns1:result"/>
172
- <element name="transaction" nillable="false" type="tns1:transaction"/>
173
- <element name="reAuthorization" nillable="true" type="xsd:string"/>
174
- </sequence>
175
- </complexType>
176
- </element>
177
- <element name="doDebitRequest">
178
- <complexType>
179
- <sequence>
180
- <element name="version" nillable="false" type="xsd:string"/>
181
- <element name="payment" nillable="false" type="tns1:payment"/>
182
- <element name="card" nillable="false" type="tns1:card"/>
183
- <element name="order" nillable="false" type="tns1:order"/>
184
- <element name="buyer" nillable="true" type="tns1:buyer"/>
185
- <element name="owner" nillable="true" type="tns1:owner"/>
186
- <element name="privateDataList" nillable="true" type="tns1:privateDataList"/>
187
- <element name="authentication3DSecure" nillable="true" type="tns1:authentication3DSecure"/>
188
- <element name="authorization" nillable="false" type="tns1:authorization"/>
189
- <element name="media" nillable="true" type="xsd:string"/>
190
- </sequence>
191
- </complexType>
192
- </element>
193
- <element name="doDebitResponse">
194
- <complexType>
195
- <sequence>
196
- <element name="result" nillable="false" type="tns1:result"/>
197
- <element name="transaction" nillable="false" type="tns1:transaction"/>
198
- <element name="card" type="tns1:cardOut"/>
199
- <element name="extendedCard" type="tns1:extendedCardType"/>
200
- </sequence>
201
- </complexType>
202
- </element>
203
- <element name="doRefundRequest">
204
- <complexType>
205
- <annotation>
206
- <documentation>
207
- This element is the request for the doRefund
208
- method
209
- </documentation>
210
- </annotation>
211
- <sequence>
212
- <element name="version" nillable="false" type="xsd:string"/>
213
- <element name="transactionID" nillable="false" type="xsd:string"/>
214
- <element name="payment" nillable="false" type="tns1:payment"/>
215
- <element name="comment" nillable="true" type="xsd:string"/>
216
- <element name="privateDataList" nillable="true" type="tns1:privateDataList"/>
217
- <element name="sequenceNumber" nillable="true" type="xsd:string"/>
218
- <element name="media" nillable="true" type="xsd:string"/>
219
- </sequence>
220
- </complexType>
221
- </element>
222
- <element name="doRefundResponse">
223
- <complexType>
224
- <annotation>
225
- <documentation>
226
- This element is the reponse from the
227
- doRefund method
228
- </documentation>
229
- </annotation>
230
- <sequence>
231
- <element name="result" nillable="false" type="tns1:result"/>
232
- <element name="transaction" nillable="false" type="tns1:transaction"/>
233
- </sequence>
234
- </complexType>
235
- </element>
236
- <element name="doResetRequest">
237
- <complexType>
238
- <annotation>
239
- <documentation>
240
- This element is the request for the doReset
241
- method
242
- </documentation>
243
- </annotation>
244
- <sequence>
245
- <element name="version" nillable="false" type="xsd:string"/>
246
- <element name="transactionID" nillable="false" type="xsd:string"/>
247
- <element name="comment" nillable="true" type="xsd:string"/>
248
- <element name="media" nillable="true" type="xsd:string"/>
249
- </sequence>
250
- </complexType>
251
- </element>
252
- <element name="doResetResponse">
253
- <complexType>
254
- <annotation>
255
- <documentation>
256
- This element is the reponse from the doReset
257
- method
258
- </documentation>
259
- </annotation>
260
- <sequence>
261
- <element name="result" nillable="false" type="tns1:result"/>
262
- <element name="transaction" nillable="false" type="tns1:transaction"/>
263
- </sequence>
264
- </complexType>
265
- </element>
266
- <element name="doCreditRequest">
267
- <complexType>
268
- <annotation>
269
- <documentation>
270
- This element is the request for the doCredit
271
- method
272
- </documentation>
273
- </annotation>
274
- <sequence>
275
- <element name="version" nillable="false" type="xsd:string"/>
276
- <element name="payment" nillable="false" type="tns1:payment"/>
277
- <element name="card" nillable="false" type="tns1:card"/>
278
- <element name="comment" nillable="true" type="xsd:string"/>
279
- <element name="order" nillable="true" type="tns1:order"/>
280
- <element name="buyer" nillable="true" type="tns1:buyer"/>
281
- <element name="owner" nillable="true" type="tns1:owner"/>
282
- <element name="privateDataList" nillable="true" type="tns1:privateDataList"/>
283
- <element name="media" nillable="true" type="xsd:string"/>
284
- </sequence>
285
- </complexType>
286
- </element>
287
- <element name="doCreditResponse">
288
- <complexType>
289
- <annotation>
290
- <documentation>
291
- This element is the reponse from the
292
- doCredit method
293
- </documentation>
294
- </annotation>
295
- <sequence>
296
- <element name="result" nillable="false" type="tns1:result"/>
297
- <element name="transaction" nillable="false" type="tns1:transaction"/>
298
- <element name="card" type="tns1:cardOut"/>
299
- <element name="extendedCard" type="tns1:extendedCardType"/>
300
- </sequence>
301
- </complexType>
302
- </element>
303
- <element name="createWalletRequest">
304
- <complexType>
305
- <annotation>
306
- <documentation>
307
- This element is the request for the
308
- createWallet
309
- method
310
- </documentation>
311
- </annotation>
312
- <sequence>
313
- <element name="version" nillable="false" type="xsd:string"/>
314
- <element name="contractNumber" nillable="false" type="xsd:string"/>
315
- <element name="wallet" nillable="false" type="tns1:wallet"/>
316
- <element name="buyer" nillable="true" type="tns1:buyer"/>
317
- <element name="owner" nillable="true" type="tns1:owner"/>
318
- <element name="privateDataList" nillable="true" type="tns1:privateDataList"/>
319
- <element name="authentication3DSecure" nillable="true" type="tns1:authentication3DSecure"/>
320
- <element name="media" nillable="true" type="xsd:string"/>
321
- <element name="contractNumberWalletList" nillable="true" type="tns1:contractNumberWalletList"/>
322
- </sequence>
323
- </complexType>
324
- </element>
325
- <element name="createWalletResponse">
326
- <complexType>
327
- <annotation>
328
- <documentation>
329
- This element is the reponse from the
330
- createWallet
331
- method
332
- </documentation>
333
- </annotation>
334
- <sequence>
335
- <element name="result" nillable="false" type="tns1:result"/>
336
- <element name="card" type="tns1:cardOut"/>
337
- <element name="extendedCard" type="tns1:extendedCardType"/>
338
- <element name="contractNumberWalletList" nillable="true" type="tns1:contractNumberWalletList"/>
339
- <element name="fraudResultDetails" nillable="true" type="tns1:fraudResultDetails"/>
340
- </sequence>
341
- </complexType>
342
- </element>
343
- <element name="updateWalletRequest">
344
- <complexType>
345
- <annotation>
346
- <documentation>
347
- This element is the request for the
348
- updateWallet
349
- method
350
- </documentation>
351
- </annotation>
352
- <sequence>
353
- <element name="version" nillable="false" type="xsd:string"/>
354
- <element name="contractNumber" nillable="false" type="xsd:string"/>
355
- <element name="cardInd" nillable="true" type="xsd:string"/>
356
- <element name="wallet" nillable="false" type="tns1:wallet"/>
357
- <element name="buyer" nillable="true" type="tns1:buyer"/>
358
- <element name="owner" nillable="true" type="tns1:owner"/>
359
- <element name="privateDataList" nillable="true" type="tns1:privateDataList"/>
360
- <element name="authentication3DSecure" nillable="true" type="tns1:authentication3DSecure"/>
361
- <element name="media" nillable="true" type="xsd:string"/>
362
- <element name="contractNumberWalletList" nillable="true" type="tns1:contractNumberWalletList"/>
363
- </sequence>
364
- </complexType>
365
- </element>
366
- <element name="updateWalletResponse">
367
- <complexType>
368
- <annotation>
369
- <documentation>
370
- This element is the reponse from the
371
- updateWallet
372
- method
373
- </documentation>
374
- </annotation>
375
- <sequence>
376
- <element name="result" nillable="false" type="tns1:result"/>
377
- <element name="card" type="tns1:cardOut"/>
378
- <element name="extendedCard" type="tns1:extendedCardType"/>
379
- <element name="contractNumberWalletList" nillable="true" type="tns1:contractNumberWalletList"/>
380
- </sequence>
381
- </complexType>
382
- </element>
383
- <element name="getWalletRequest">
384
- <complexType>
385
- <annotation>
386
- <documentation>
387
- This element is the request for the
388
- getWallet method
389
- </documentation>
390
- </annotation>
391
- <sequence>
392
- <element name="version" nillable="false" type="xsd:string"/>
393
- <element name="contractNumber" nillable="false" type="xsd:string"/>
394
- <element name="walletId" nillable="false" type="xsd:string"/>
395
- <element name="cardInd" nillable="true" type="xsd:string"/>
396
- <element name="media" nillable="true" type="xsd:string"/>
397
- </sequence>
398
- </complexType>
399
- </element>
400
- <element name="getWalletResponse">
401
- <complexType>
402
- <annotation>
403
- <documentation>
404
- This element is the reponse from the
405
- getWallet
406
- method
407
- </documentation>
408
- </annotation>
409
- <sequence>
410
- <element name="result" nillable="false" type="tns1:result"/>
411
- <element name="wallet" nillable="true" type="tns1:wallet"/>
412
- <element name="owner" nillable="true" type="tns1:owner"/>
413
- <element name="isDisabled" nillable="true" type="xsd:string"/>
414
- <element name="disableDate" nillable="true" type="xsd:string"/>
415
- <element name="privateDataList" nillable="true" type="tns1:privateDataList"/>
416
- <element name="extendedCard" nillable="true" type="tns1:extendedCardType"/>
417
- <element name="contractNumberWalletList" nillable="true" type="tns1:contractNumberWalletList"/>
418
- <element name="media" nillable="true" type="xsd:string"/>
419
- </sequence>
420
- </complexType>
421
- </element>
422
- <element name="getCardsRequest">
423
- <complexType>
424
- <annotation>
425
- <documentation>
426
- This element is the request for the
427
- getCards method
428
- </documentation>
429
- </annotation>
430
- <sequence>
431
- <element name="contractNumber" nillable="false" type="xsd:string"/>
432
- <element name="walletId" nillable="false" type="xsd:string"/>
433
- <element name="cardInd" nillable="true" type="xsd:string"/>
434
- </sequence>
435
- </complexType>
436
- </element>
437
- <element name="getCardsResponse">
438
- <complexType>
439
- <annotation>
440
- <documentation>
441
- This element is the reponse from the
442
- getCards method
443
- </documentation>
444
- </annotation>
445
- <sequence>
446
- <element name="result" nillable="false" type="tns1:result"/>
447
- <element name="cardsList" nillable="true" type="tns1:cardsList"/>
448
- <element name="owner" nillable="true" type="tns1:owner"/>
449
- <element name="privateDataList" nillable="true" type="tns1:privateDataList"/>
450
- </sequence>
451
- </complexType>
452
- </element>
453
- <element name="disableWalletRequest">
454
- <complexType>
455
- <annotation>
456
- <documentation>
457
- This element is the request for the
458
- disableWallet
459
- method
460
- </documentation>
461
- </annotation>
462
- <sequence>
463
- <element name="contractNumber" nillable="false" type="xsd:string"/>
464
- <element name="cardInd" nillable="true" type="xsd:string"/>
465
- <element name="walletIdList" nillable="false" type="tns1:walletIdList"/>
466
- </sequence>
467
- </complexType>
468
- </element>
469
- <element name="disableWalletResponse">
470
- <complexType>
471
- <annotation>
472
- <documentation>
473
- This element is the reponse from the
474
- disableWallet
475
- method
476
- </documentation>
477
- </annotation>
478
- <sequence>
479
- <element name="result" nillable="false" type="tns1:result"/>
480
- <element name="walletIdList" nillable="false" type="tns1:walletIdList"/>
481
- </sequence>
482
- </complexType>
483
- </element>
484
- <element name="enableWalletRequest">
485
- <complexType>
486
- <annotation>
487
- <documentation>
488
- This element is the request for the
489
- enableWallet
490
- method
491
- </documentation>
492
- </annotation>
493
- <sequence>
494
- <element name="contractNumber" nillable="false" type="xsd:string"/>
495
- <element name="cardInd" nillable="true" type="xsd:string"/>
496
- <element name="walletId" nillable="false" type="xsd:string"/>
497
- </sequence>
498
- </complexType>
499
- </element>
500
- <element name="enableWalletResponse">
501
- <complexType>
502
- <annotation>
503
- <documentation>
504
- This element is the reponse from the
505
- enableWallet
506
- method
507
- </documentation>
508
- </annotation>
509
- <sequence>
510
- <element name="result" nillable="false" type="tns1:result"/>
511
- </sequence>
512
- </complexType>
513
- </element>
514
- <element name="doImmediateWalletPaymentRequest">
515
- <complexType>
516
- <annotation>
517
- <documentation>
518
- This element is the request for the
519
- doImmediateWalletPayment method
520
- </documentation>
521
- </annotation>
522
- <sequence>
523
- <element name="version" nillable="false" type="xsd:string"/>
524
- <element name="payment" nillable="false" type="tns1:payment"/>
525
- <element name="order" nillable="false" type="tns1:order"/>
526
- <element name="buyer" nillable="true" type="tns1:buyer"/>
527
- <element name="walletId" nillable="false" type="xsd:string"/>
528
- <element name="cardInd" nillable="true" type="xsd:string"/>
529
- <element name="cvx" nillable="true" type="xsd:string"/>
530
- <element name="privateDataList" nillable="true" type="tns1:privateDataList"/>
531
- <element name="media" nillable="true" type="xsd:string"/>
532
- <element name="authentication3DSecure" nillable="true" type="tns1:authentication3DSecure"/>
533
- </sequence>
534
- </complexType>
535
- </element>
536
- <element name="doImmediateWalletPaymentResponse">
537
- <complexType>
538
- <annotation>
539
- <documentation>
540
- This element is the reponse from the
541
- doImmediateWalletPayment method
542
- </documentation>
543
- </annotation>
544
- <sequence>
545
- <element name="result" nillable="false" type="tns1:result"/>
546
- <element name="transaction" nillable="true" type="tns1:transaction"/>
547
- <element name="authorization" nillable="true" type="tns1:authorization"/>
548
- </sequence>
549
- </complexType>
550
- </element>
551
- <element name="doScheduledWalletPaymentRequest">
552
- <complexType>
553
- <annotation>
554
- <documentation>
555
- This element is the request for the
556
- doScheduledWalletPayment method
557
- </documentation>
558
- </annotation>
559
- <sequence>
560
- <element name="version" nillable="false" type="xsd:string"/>
561
- <element name="payment" nillable="false" type="tns1:payment"/>
562
- <element name="orderRef" nillable="true" type="xsd:string"/>
563
- <element name="orderDate" nillable="true" type="xsd:string"/>
564
- <element name="scheduledDate" nillable="false" type="xsd:string"/>
565
- <element name="walletId" nillable="false" type="xsd:string"/>
566
- <element name="cardInd" nillable="true" type="xsd:string"/>
567
- <element name="order" nillable="true" type="tns1:order"/>
568
- <element name="privateDataList" nillable="true" type="tns1:privateDataList"/>
569
- <element name="media" nillable="true" type="xsd:string"/>
570
- </sequence>
571
- </complexType>
572
- </element>
573
- <element name="doScheduledWalletPaymentResponse">
574
- <complexType>
575
- <annotation>
576
- <documentation>
577
- This element is the reponse from the
578
- doScheduledWalletPayment method
579
- </documentation>
580
- </annotation>
581
- <sequence>
582
- <element name="result" nillable="false" type="tns1:result"/>
583
- <element name="paymentRecordId" nillable="false" type="xsd:string"/>
584
- </sequence>
585
- </complexType>
586
- </element>
587
- <element name="doRecurrentWalletPaymentRequest">
588
- <complexType>
589
- <annotation>
590
- <documentation>
591
- This element is the request for the
592
- doRecurrentWalletPayment method
593
- </documentation>
594
- </annotation>
595
- <sequence>
596
- <element name="version" nillable="false" type="xsd:string"/>
597
- <element name="payment" nillable="false" type="tns1:payment"/>
598
- <element name="orderRef" nillable="false" type="xsd:string"/>
599
- <element name="orderDate" nillable="false" type="xsd:string"/>
600
- <element name="scheduledDate" nillable="false" type="xsd:string"/>
601
- <element name="walletId" nillable="false" type="xsd:string"/>
602
- <element name="cardInd" nillable="true" type="xsd:string"/>
603
- <element name="recurring" nillable="false" type="tns1:recurring"/>
604
- <element name="privateDataList" nillable="true" type="tns1:privateDataList"/>
605
- <element name="order" nillable="true" type="tns1:order"/>
606
- <element name="media" nillable="true" type="xsd:string"/>
607
- </sequence>
608
- </complexType>
609
- </element>
610
- <element name="doRecurrentWalletPaymentResponse">
611
- <complexType>
612
- <annotation>
613
- <documentation>
614
- This element is the reponse from the
615
- doRecurrentWalletPayment method
616
- </documentation>
617
- </annotation>
618
- <sequence>
619
- <element name="result" nillable="false" type="tns1:result"/>
620
- <element name="paymentRecordId" nillable="false" type="xsd:string"/>
621
- <element name="billingRecordList" nillable="false" type="tns1:billingRecordList"/>
622
- </sequence>
623
- </complexType>
624
- </element>
625
- <element name="getPaymentRecordRequest">
626
- <complexType>
627
- <annotation>
628
- <documentation>
629
- This element is the request for the
630
- getPaymentRecord method
631
- </documentation>
632
- </annotation>
633
- <sequence>
634
- <element name="version" nillable="false" type="xsd:string"/>
635
- <element name="contractNumber" nillable="false" type="xsd:string"/>
636
- <element name="paymentRecordId" nillable="false" type="xsd:string"/>
637
- </sequence>
638
- </complexType>
639
- </element>
640
- <element name="getPaymentRecordResponse">
641
- <complexType>
642
- <annotation>
643
- <documentation>
644
- This element is the reponse from the
645
- getPaymentRecord method
646
- </documentation>
647
- </annotation>
648
- <sequence>
649
- <element name="result" nillable="false" type="tns1:result"/>
650
- <element name="recurring" nillable="false" type="tns1:recurring"/>
651
- <element name="isDisabled" nillable="true" type="xsd:string"/>
652
- <element name="disableDate" nillable="true" type="xsd:string"/>
653
- <element name="billingRecordList" nillable="false" type="tns1:billingRecordList"/>
654
- <element name="privateDataList" nillable="true" type="tns1:privateDataList"/>
655
- <element name="order" nillable="true" type="tns1:order"/>
656
- <element name="walletId" nillable="false" type="xsd:string"/>
657
- </sequence>
658
- </complexType>
659
- </element>
660
- <element name="disablePaymentRecordRequest">
661
- <complexType>
662
- <annotation>
663
- <documentation>
664
- This element is the request for the
665
- disablePaymentRecord method
666
- </documentation>
667
- </annotation>
668
- <sequence>
669
- <element name="contractNumber" nillable="false" type="xsd:string"/>
670
- <element name="paymentRecordId" nillable="false" type="xsd:string"/>
671
- </sequence>
672
- </complexType>
673
- </element>
674
- <element name="disablePaymentRecordResponse">
675
- <complexType>
676
- <annotation>
677
- <documentation>
678
- This element is the reponse from the
679
- disablePaymentRecord method
680
- </documentation>
681
- </annotation>
682
- <sequence>
683
- <element name="result" nillable="false" type="tns1:result"/>
684
- </sequence>
685
- </complexType>
686
- </element>
687
- <element name="manageWebWalletRequest">
688
- <complexType>
689
- <annotation>
690
- <documentation>
691
- This element is the request for the
692
- manageWebWallet
693
- method
694
- </documentation>
695
- </annotation>
696
- <sequence>
697
- <element name="version" nillable="false" type="xsd:string"/>
698
- <element name="contractNumber" nillable="false" type="xsd:string"/>
699
- <element name="selectedContractList" nillable="true" type="tns1:selectedContractList"/>
700
- <element name="updatePersonalDetails" nillable="true" type="xsd:string"/>
701
- <element name="buyer" nillable="false" type="tns1:buyer"/>
702
- <element name="owner" nillable="true" type="tns1:owner"/>
703
- <element name="languageCode" nillable="true" type="xsd:string"/>
704
- <element name="customPaymentPageCode" nillable="true" type="xsd:string"/>
705
- <element name="securityMode" nillable="true" type="xsd:string"/>
706
- <element name="returnURL" nillable="false" type="xsd:string"/>
707
- <element name="cancelURL" nillable="false" type="xsd:string"/>
708
- <element name="notificationURL" nillable="true" type="xsd:string"/>
709
- <element name="privateDataList" nillable="true" type="tns1:privateDataList"/>
710
- <element name="customPaymentTemplateURL" nillable="true" type="xsd:string"/>
711
- <element name="contractNumberWalletList" nillable="true" type="tns1:contractNumberWalletList"/>
712
- </sequence>
713
- </complexType>
714
- </element>
715
- <element name="manageWebWalletResponse">
716
- <complexType>
717
- <annotation>
718
- <documentation>
719
- This element is the reponse from the
720
- manageWebWallet method
721
- </documentation>
722
- </annotation>
723
- <sequence>
724
- <element name="result" nillable="false" type="tns1:result"/>
725
- <element name="token" nillable="false" type="xsd:string"/>
726
- <element name="redirectURL" nillable="false" type="xsd:string"/>
727
- </sequence>
728
- </complexType>
729
- </element>
730
- <element name="createWebWalletRequest">
731
- <complexType>
732
- <annotation>
733
- <documentation>
734
- This element is the request for the
735
- createWebWallet
736
- method
737
- </documentation>
738
- </annotation>
739
- <sequence>
740
- <element name="version" nillable="false" type="xsd:string"/>
741
- <element name="contractNumber" nillable="false" type="xsd:string"/>
742
- <element name="selectedContractList" nillable="true" type="tns1:selectedContractList"/>
743
- <element name="updatePersonalDetails" nillable="true" type="xsd:string"/>
744
- <element name="buyer" nillable="false" type="tns1:buyer"/>
745
- <element name="owner" nillable="true" type="tns1:owner"/>
746
- <element name="languageCode" nillable="true" type="xsd:string"/>
747
- <element name="customPaymentPageCode" nillable="true" type="xsd:string"/>
748
- <element name="securityMode" nillable="true" type="xsd:string"/>
749
- <element name="returnURL" nillable="false" type="xsd:string"/>
750
- <element name="cancelURL" nillable="false" type="xsd:string"/>
751
- <element name="notificationURL" nillable="true" type="xsd:string"/>
752
- <element name="privateDataList" nillable="true" type="tns1:privateDataList"/>
753
- <element name="customPaymentTemplateURL" nillable="true" type="xsd:string"/>
754
- <element name="contractNumberWalletList" nillable="true" type="tns1:contractNumberWalletList"/>
755
- </sequence>
756
- </complexType>
757
- </element>
758
- <element name="createWebWalletResponse">
759
- <complexType>
760
- <annotation>
761
- <documentation>
762
- This element is the reponse from the
763
- createWebWallet method
764
- </documentation>
765
- </annotation>
766
- <sequence>
767
- <element name="result" nillable="false" type="tns1:result"/>
768
- <element name="token" nillable="false" type="xsd:string"/>
769
- <element name="redirectURL" nillable="false" type="xsd:string"/>
770
- </sequence>
771
- </complexType>
772
- </element>
773
- <element name="updateWebWalletRequest">
774
- <complexType>
775
- <annotation>
776
- <documentation>
777
- This element is the request for the
778
- updateWebWallet
779
- method
780
- </documentation>
781
- </annotation>
782
- <sequence>
783
- <element name="version" nillable="false" type="xsd:string"/>
784
- <element name="contractNumber" nillable="false" type="xsd:string"/>
785
- <element name="cardInd" nillable="true" type="xsd:string"/>
786
- <element name="walletId" nillable="false" type="xsd:string"/>
787
- <element name="updatePersonalDetails" nillable="true" type="xsd:string"/>
788
- <element name="updateOwnerDetails" nillable="true" type="xsd:string"/>
789
- <element name="updatePaymentDetails" nillable="true" type="xsd:string"/>
790
- <element name="buyer" nillable="true" type="tns1:buyer"/>
791
- <element name="languageCode" nillable="true" type="xsd:string"/>
792
- <element name="customPaymentPageCode" nillable="true" type="xsd:string"/>
793
- <element name="securityMode" nillable="true" type="xsd:string"/>
794
- <element name="returnURL" nillable="false" type="xsd:string"/>
795
- <element name="cancelURL" nillable="false" type="xsd:string"/>
796
- <element name="notificationURL" nillable="true" type="xsd:string"/>
797
- <element name="privateDataList" nillable="true" type="tns1:privateDataList"/>
798
- <element name="customPaymentTemplateURL" nillable="true" type="xsd:string"/>
799
- <element name="contractNumberWalletList" nillable="true" type="tns1:contractNumberWalletList"/>
800
- </sequence>
801
- </complexType>
802
- </element>
803
- <element name="updateWebWalletResponse">
804
- <complexType>
805
- <annotation>
806
- <documentation>
807
- This element is the reponse from the
808
- updateWebWallet method
809
- </documentation>
810
- </annotation>
811
- <sequence>
812
- <element name="result" nillable="false" type="tns1:result"/>
813
- <element name="token" nillable="false" type="xsd:string"/>
814
- <element name="redirectURL" nillable="false" type="xsd:string"/>
815
- </sequence>
816
- </complexType>
817
- </element>
818
- <element name="getWebWalletRequest">
819
- <complexType>
820
- <annotation>
821
- <documentation>
822
- This element is the request for the
823
- getWebWallet
824
- method
825
- </documentation>
826
- </annotation>
827
- <sequence>
828
- <element name="version" nillable="false" type="xsd:string"/>
829
- <element name="token" nillable="false" type="xsd:string"/>
830
- </sequence>
831
- </complexType>
832
- </element>
833
- <element name="getWebWalletResponse">
834
- <complexType>
835
- <annotation>
836
- <documentation>
837
- This element is the reponse from the
838
- getWebWallet
839
- method
840
- </documentation>
841
- </annotation>
842
- <sequence>
843
- <element name="result" nillable="false" type="tns1:result"/>
844
- <element name="wallet" nillable="true" type="tns1:wallet"/>
845
- <element name="owner" nillable="true" type="tns1:owner"/>
846
- <element name="privateDataList" nillable="true" type="tns1:privateDataList"/>
847
- <element name="extendedCard" type="tns1:extendedCardType"/>
848
- <element name="media" nillable="true" type="xsd:string"/>
849
- <element name="numberOfAttempt" nillable="true" type="xsd:string"/>
850
- <element name="contractNumberWalletList" nillable="true" type="tns1:contractNumberWalletList"/>
851
- </sequence>
852
- </complexType>
853
- </element>
854
- <element name="getTransactionDetailsRequest">
855
- <complexType>
856
- <annotation>
857
- <documentation>
858
- This element is the request for the
859
- getTransactionDetails method
860
- </documentation>
861
- </annotation>
862
- <sequence>
863
- <element name="version" nillable="false" type="xsd:string"/>
864
- <element name="transactionId" nillable="true" type="xsd:string"/>
865
- <element name="orderRef" nillable="true" type="xsd:string"/>
866
- <element name="startDate" nillable="true" type="xsd:string"/>
867
- <element name="endDate" nillable="true" type="xsd:string"/>
868
- <element name="transactionHistory" nillable="true" type="xsd:string"/>
869
- <element name="archiveSearch" nillable="true" type="xsd:string"/>
870
- </sequence>
871
- </complexType>
872
- </element>
873
- <element name="getTransactionDetailsResponse">
874
- <complexType>
875
- <annotation>
876
- <documentation>
877
- This element is the response for the
878
- getTransactionDetails method
879
- </documentation>
880
- </annotation>
881
- <sequence>
882
- <element name="result" nillable="false" type="tns1:result"/>
883
- <element name="transaction" nillable="true" type="tns1:transaction"/>
884
- <element name="payment" nillable="true" type="tns1:payment"/>
885
- <element name="authorization" nillable="true" type="tns1:authorization"/>
886
- <element name="order" nillable="true" type="tns1:order"/>
887
- <element name="buyer" nillable="true" type="tns1:buyer"/>
888
- <element name="privateDataList" nillable="true" type="tns1:privateDataList"/>
889
- <element name="card" type="tns1:cardOut"/>
890
- <element name="extendedCard" type="tns1:extendedCardType"/>
891
- <element name="associatedTransactionsList" nillable="true" type="tns1:associatedTransactionsList"/>
892
- <element name="statusHistoryList" nillable="true" type="tns1:statusHistoryList"/>
893
- <element name="media" nillable="true" type="xsd:string"/>
894
- <element name="contractNumber" nillable="false" type="xsd:string"/>
895
- <element minOccurs="0" name="paymentAdditionalList" nillable="true" type="tns1:paymentAdditionalList"/>
896
- <element name="bankAccountData" nillable="true" type="tns1:bankAccountData"/>
897
- </sequence>
898
- </complexType>
899
- </element>
900
- <element name="transactionsSearchRequest">
901
- <complexType>
902
- <annotation>
903
- <documentation>
904
- This element is the request for the
905
- transactionsSearch method
906
- </documentation>
907
- </annotation>
908
- <sequence>
909
- <element name="version" nillable="false" type="xsd:string"/>
910
- <element name="transactionId" nillable="true" type="xsd:string"/>
911
- <element name="orderRef" nillable="true" type="xsd:string"/>
912
- <element name="startDate" nillable="true" type="xsd:string"/>
913
- <element name="endDate" nillable="true" type="xsd:string"/>
914
- <element name="contractNumber" nillable="true" type="xsd:string"/>
915
- <element name="authorizationNumber" nillable="true" type="xsd:string"/>
916
- <element name="returnCode" nillable="true" type="xsd:string"/>
917
- <element name="paymentMean" nillable="true" type="xsd:string"/>
918
- <element name="transactionType" nillable="true" type="xsd:string"/>
919
- <element name="name" nillable="true" type="xsd:string"/>
920
- <element name="firstName" nillable="true" type="xsd:string"/>
921
- <element name="email" nillable="true" type="xsd:string"/>
922
- <element name="cardNumber" nillable="true" type="xsd:string"/>
923
- <element name="currency" nillable="true" type="xsd:string"/>
924
- <element name="minAmount" nillable="true" type="xsd:string"/>
925
- <element name="maxAmount" nillable="true" type="xsd:string"/>
926
- <element name="walletId" nillable="true" type="xsd:string"/>
927
- <element name="sequenceNumber" nillable="true" type="xsd:string"/>
928
- <element name="token" nillable="true" type="xsd:string"/>
929
- </sequence>
930
- </complexType>
931
- </element>
932
- <element name="transactionsSearchResponse">
933
- <complexType>
934
- <annotation>
935
- <documentation>
936
- This element is the response for the
937
- transactionsSearch method
938
- </documentation>
939
- </annotation>
940
- <sequence>
941
- <element name="result" nillable="false" type="tns1:result"/>
942
- <element name="transactionList" nillable="true" type="tns1:transactionList"/>
943
- </sequence>
944
- </complexType>
945
- </element>
946
- <element name="verifyEnrollmentRequest">
947
- <complexType>
948
- <annotation>
949
- <documentation>
950
- This element is the request for the
951
- verifyEnrollment method
952
- </documentation>
953
- </annotation>
954
- <sequence>
955
- <element name="version" nillable="false" type="xsd:string"/>
956
- <element name="card" nillable="false" type="tns1:card"/>
957
- <element name="payment" nillable="false" type="tns1:payment"/>
958
- <element name="orderRef" nillable="false" type="xsd:string"/>
959
- <element name="mdFieldValue" nillable="true" type="xsd:string"/>
960
- <element name="userAgent" nillable="true" type="xsd:string"/>
961
- <element name="walletId" nillable="true" type="xsd:string"/>
962
- <element name="walletCardInd" nillable="true" type="xsd:string"/>
963
- </sequence>
964
- </complexType>
965
- </element>
966
- <element name="verifyEnrollmentResponse">
967
- <complexType>
968
- <annotation>
969
- <documentation>
970
- This element is the reponse from the
971
- verifyEnrollment method
972
- </documentation>
973
- </annotation>
974
- <sequence>
975
- <element name="result" nillable="false" type="tns1:result"/>
976
- <element name="actionUrl" nillable="true" type="xsd:string"/>
977
- <element name="actionMethod" nillable="true" type="xsd:string"/>
978
- <element name="pareqFieldName" nillable="true" type="xsd:string"/>
979
- <element name="pareqFieldValue" nillable="true" type="xsd:string"/>
980
- <element name="termUrlName" nillable="true" type="xsd:string"/>
981
- <element name="termUrlValue" nillable="true" type="xsd:string"/>
982
- <element name="mdFieldName" nillable="true" type="xsd:string"/>
983
- <element name="mdFieldValue" nillable="true" type="xsd:string"/>
984
- <element name="mpiResult" nillable="true" type="xsd:string"/>
985
- <element name="authentication3DSecure" nillable="true" type="tns1:authentication3DSecure"/>
986
- </sequence>
987
- </complexType>
988
- </element>
989
- <element name="verifyAuthenticationRequest">
990
- <complexType>
991
- <annotation>
992
- <documentation>
993
- This element is the request for the
994
- doAuthentication method
995
- </documentation>
996
- </annotation>
997
- <sequence>
998
- <element name="version" nillable="false" type="xsd:string"/>
999
- <element name="contractNumber" nillable="false" type="xsd:string"/>
1000
- <element name="pares" nillable="false" type="xsd:string"/>
1001
- <element name="md" nillable="true" type="xsd:string"/>
1002
- <element name="card" nillable="false" type="tns1:card"/>
1003
- </sequence>
1004
- </complexType>
1005
- </element>
1006
- <element name="verifyAuthenticationResponse">
1007
- <complexType>
1008
- <annotation>
1009
- <documentation>
1010
- This element is the reponse from the
1011
- doAuthentication method
1012
- </documentation>
1013
- </annotation>
1014
- <sequence>
1015
- <element name="result" nillable="false" type="tns1:result"/>
1016
- <element name="authentication3DSecure" nillable="true" type="tns1:authentication3DSecure"/>
1017
- <element name="mpiResult" nillable="true" type="xsd:string"/>
1018
- </sequence>
1019
- </complexType>
1020
- </element>
1021
- <element name="createMerchantRequest">
1022
- <complexType>
1023
- <annotation>
1024
- <documentation>
1025
- This element is the request for the
1026
- createMerchant
1027
- method
1028
- </documentation>
1029
- </annotation>
1030
- <sequence>
1031
- <element name="corporateName" nillable="true" type="xsd:string"/>
1032
- <element name="publicName" nillable="true" type="xsd:string"/>
1033
- <element name="currency">
1034
- <annotation>
1035
- <documentation>currency in ISO 4217 numeric format
1036
- </documentation>
1037
- </annotation>
1038
- <simpleType>
1039
- <restriction base="xsd:string">
1040
- <length value="3"/>
1041
- </restriction>
1042
- </simpleType>
1043
- </element>
1044
- <element name="nationalID" nillable="true">
1045
- <annotation>
1046
- <documentation>unique national merchant ID</documentation>
1047
- </annotation>
1048
- <complexType>
1049
- <choice>
1050
- <element name="SIRET">
1051
- <annotation>
1052
- <documentation>Systeme d identification du Repertoire des
1053
- ENtreprises
1054
- </documentation>
1055
- </annotation>
1056
- <simpleType>
1057
- <restriction base="xsd:string">
1058
- <length value="14"/>
1059
- </restriction>
1060
- </simpleType>
1061
- </element>
1062
- <element name="other" type="xsd:string">
1063
- <annotation>
1064
- <documentation>to use if country is not France
1065
- </documentation>
1066
- </annotation>
1067
- </element>
1068
- </choice>
1069
- </complexType>
1070
- </element>
1071
- <element name="distributor" nillable="true" type="xsd:string">
1072
- <annotation>
1073
- <documentation>Payline Distributor ID</documentation>
1074
- </annotation>
1075
- </element>
1076
- <element name="merchantAddress" nillable="true" type="tns1:addressInterlocutor"/>
1077
- <element name="businessInterlocutor" nillable="true" type="tns1:interlocutor"/>
1078
- <element name="technicalInterlocutor" nillable="true" type="tns1:interlocutor"/>
1079
- <element name="subscription" nillable="true" type="tns1:subscription"/>
1080
- <element name="poss" nillable="true">
1081
- <annotation>
1082
- <documentation>list of point of sell</documentation>
1083
- </annotation>
1084
- <complexType>
1085
- <sequence>
1086
- <element maxOccurs="unbounded" minOccurs="0" name="pos" nillable="true" type="tns1:pointOfSell"/>
1087
- </sequence>
1088
- </complexType>
1089
- </element>
1090
- <element name="partner" nillable="true" type="xsd:string">
1091
- <annotation>
1092
- <documentation>Billing partner. 1:monext, 2:cetib, 3:payline.com
1093
- </documentation>
1094
- </annotation>
1095
- </element>
1096
- </sequence>
1097
- </complexType>
1098
- </element>
1099
- <element name="createMerchantResponse">
1100
- <complexType>
1101
- <annotation>
1102
- <documentation>
1103
- This element is the reponse from the
1104
- createMerchant
1105
- method
1106
- </documentation>
1107
- </annotation>
1108
- <sequence>
1109
- <element name="result" nillable="false" type="tns1:result"/>
1110
- <element name="connectionData" nillable="false" type="tns1:connectionData"/>
1111
- </sequence>
1112
- </complexType>
1113
- </element>
1114
- <element name="doScoringChequeRequest">
1115
- <complexType>
1116
- <annotation>
1117
- <documentation>
1118
- This element is the request for the
1119
- doScoringCheque
1120
- method
1121
- </documentation>
1122
- </annotation>
1123
- <sequence>
1124
- <element name="version" nillable="false" type="xsd:string"/>
1125
- <element name="payment" nillable="false" type="tns1:payment"/>
1126
- <element name="cheque" nillable="false" type="tns1:cheque"/>
1127
- <element name="order" nillable="false" type="tns1:order"/>
1128
- <element name="privateDataList" nillable="true" type="tns1:privateDataList"/>
1129
- <element name="media" nillable="true" type="xsd:string"/>
1130
- </sequence>
1131
- </complexType>
1132
- </element>
1133
- <element name="doScoringChequeResponse">
1134
- <complexType>
1135
- <annotation>
1136
- <documentation>
1137
- This element is the reponse from the
1138
- doScoringCheque method
1139
- </documentation>
1140
- </annotation>
1141
- <sequence>
1142
- <element name="result" nillable="false" type="tns1:result"/>
1143
- <element name="transaction" nillable="false" type="tns1:transaction"/>
1144
- <element name="scoringCheque" nillable="false" type="tns1:scoringCheque"/>
1145
- </sequence>
1146
- </complexType>
1147
- </element>
1148
- <element name="getEncryptionKeyRequest">
1149
- <complexType>
1150
- <annotation>
1151
- <documentation>
1152
- This element is the request for the
1153
- getEncryptionKeyRequest method
1154
- </documentation>
1155
- </annotation>
1156
- </complexType>
1157
- </element>
1158
- <element name="getEncryptionKeyResponse">
1159
- <complexType>
1160
- <annotation>
1161
- <documentation>
1162
- This element is the reponse from the
1163
- getEncryptionKeyResponse method
1164
- </documentation>
1165
- </annotation>
1166
- <sequence>
1167
- <element name="result" nillable="false" type="tns1:result"/>
1168
- <element name="key" nillable="false" type="tns1:key"/>
1169
- </sequence>
1170
- </complexType>
1171
- </element>
1172
- <element name="doReAuthorizationRequest">
1173
- <complexType>
1174
- <annotation>
1175
- <documentation>
1176
- This element is the request for the
1177
- doReAuthorization method
1178
- </documentation>
1179
- </annotation>
1180
- <sequence>
1181
- <element name="version" nillable="false" type="xsd:string"/>
1182
- <element name="transactionID" nillable="false" type="xsd:string"/>
1183
- <element name="payment" nillable="false" type="tns1:payment"/>
1184
- <element name="order" nillable="true" type="tns1:order"/>
1185
- <element name="privateDataList" nillable="true" type="tns1:privateDataList"/>
1186
- <element name="media" nillable="true" type="xsd:string"/>
1187
- </sequence>
1188
- </complexType>
1189
- </element>
1190
- <element name="doReAuthorizationResponse">
1191
- <complexType>
1192
- <annotation>
1193
- <documentation>
1194
- This element is the reponse from the
1195
- doReAuthorization method
1196
- </documentation>
1197
- </annotation>
1198
- <sequence>
1199
- <element name="result" nillable="false" type="tns1:result"/>
1200
- <element name="transaction" nillable="false" type="tns1:transaction"/>
1201
- <element name="card" type="tns1:cardOut"/>
1202
- <element name="extendedCard" type="tns1:extendedCardType"/>
1203
- </sequence>
1204
- </complexType>
1205
- </element>
1206
- <element name="getMerchantSettingsRequest">
1207
- <complexType>
1208
- <annotation>
1209
- <documentation>
1210
- This element is the request for the
1211
- getMerchantSettings method
1212
- </documentation>
1213
- </annotation>
1214
- <sequence>
1215
- <element name="version" nillable="true" type="xsd:string"/>
1216
- </sequence>
1217
- </complexType>
1218
- </element>
1219
- <element name="getMerchantSettingsResponse">
1220
- <complexType>
1221
- <annotation>
1222
- <documentation>
1223
- This element is the response from the
1224
- getMerchantSettings method
1225
- </documentation>
1226
- </annotation>
1227
- <sequence>
1228
- <element name="result" nillable="false" type="tns1:result"/>
1229
- <element name="listPointOfSell" nillable="false">
1230
- <complexType>
1231
- <sequence>
1232
- <element maxOccurs="unbounded" minOccurs="0" name="pointOfSell" type="tns1:pointOfSell"/>
1233
- </sequence>
1234
- </complexType>
1235
- </element>
1236
- </sequence>
1237
- </complexType>
1238
- </element>
1239
- <element name="getBalanceRequest">
1240
- <complexType>
1241
- <annotation>
1242
- <documentation>
1243
- This element is the request for the
1244
- getBalance
1245
- method
1246
- </documentation>
1247
- </annotation>
1248
- <sequence>
1249
- <element name="version" nillable="false" type="xsd:string"/>
1250
- <element name="cardID" nillable="false" type="xsd:string"/>
1251
- <element name="contractNumber" nillable="false" type="xsd:string"/>
1252
- </sequence>
1253
- </complexType>
1254
- </element>
1255
- <element name="getBalanceResponse">
1256
- <complexType>
1257
- <annotation>
1258
- <documentation>
1259
- This element is the reponse from the
1260
- getBalance
1261
- method
1262
- </documentation>
1263
- </annotation>
1264
- <sequence>
1265
- <element name="result" nillable="false" type="tns1:result"/>
1266
- <element name="balance" nillable="false">
1267
- <complexType>
1268
- <sequence>
1269
- <element maxOccurs="1" minOccurs="0" name="amount" type="xsd:string"/>
1270
- <element maxOccurs="1" minOccurs="0" name="currency" type="xsd:string"/>
1271
- </sequence>
1272
- </complexType>
1273
- </element>
1274
- <element name="crdproduct" nillable="false" type="xsd:string"/>
1275
- <element name="crdprogram" nillable="false" type="xsd:string"/>
1276
- <element name="crddesign" nillable="false" type="xsd:string"/>
1277
- </sequence>
1278
- </complexType>
1279
- </element>
1280
- <element name="getAlertDetailsRequest">
1281
- <complexType>
1282
- <sequence>
1283
- <element maxOccurs="1" minOccurs="1" name="AlertId" nillable="false" type="xsd:string">
1284
- </element>
1285
- <element maxOccurs="1" minOccurs="1" name="TransactionId" nillable="false" type="xsd:string">
1286
- </element>
1287
- </sequence>
1288
- </complexType>
1289
- </element>
1290
- <element name="getAlertDetailsResponse">
1291
- <complexType>
1292
- <sequence>
1293
- <element name="result" nillable="false" type="tns1:result"/>
1294
- <element maxOccurs="1" minOccurs="1" name="AlertId" nillable="false" type="xsd:string">
1295
- </element>
1296
- <element maxOccurs="1" minOccurs="0" name="ExplanationCode" nillable="true" type="xsd:string">
1297
- </element>
1298
- <element maxOccurs="1" minOccurs="0" name="ExplanationLabel" nillable="true" type="xsd:string">
1299
- </element>
1300
- <element maxOccurs="1" minOccurs="1" name="TransactionStatus" nillable="false" type="xsd:string">
1301
- </element>
1302
- <element maxOccurs="1" minOccurs="1" name="MerchantLabel" nillable="false" type="xsd:string">
1303
- </element>
1304
- <element maxOccurs="1" minOccurs="1" name="PosLabel" nillable="false" type="xsd:string">
1305
- </element>
1306
- <element maxOccurs="1" minOccurs="1" name="TransactionId" nillable="false" type="xsd:string">
1307
- </element>
1308
- <element maxOccurs="1" minOccurs="1" name="SecurityLevel" nillable="false" type="xsd:string">
1309
- </element>
1310
- <element maxOccurs="1" minOccurs="1" name="TransactionDate" nillable="false" type="xsd:string">
1311
- </element>
1312
- <element maxOccurs="1" minOccurs="1" name="TransactionAmount" nillable="false" type="xsd:string">
1313
- </element>
1314
- <element maxOccurs="1" minOccurs="1" name="TransactionCurrency" nillable="false" type="xsd:string">
1315
- </element>
1316
- <element maxOccurs="1" minOccurs="1" name="PaymentType" nillable="false" type="xsd:string">
1317
- </element>
1318
- <element maxOccurs="1" minOccurs="1" name="PaymentData" nillable="false" type="xsd:string">
1319
- </element>
1320
- <element maxOccurs="1" minOccurs="0" name="HolderName" nillable="true" type="xsd:string">
1321
- </element>
1322
- <element maxOccurs="1" minOccurs="1" name="ReferenceData" nillable="false" type="xsd:string">
1323
- </element>
1324
- <element maxOccurs="1" minOccurs="0" name="CustomerId" nillable="true" type="xsd:string">
1325
- </element>
1326
- <element maxOccurs="1" minOccurs="0" name="BuyerFirstName" nillable="true" type="xsd:string">
1327
- </element>
1328
- <element maxOccurs="1" minOccurs="0" name="BuyerLastName" nillable="true" type="xsd:string">
1329
- </element>
1330
- <element maxOccurs="1" minOccurs="1" name="CustomerTransHist" nillable="false" type="tns1:CustomerTransHist">
1331
- </element>
1332
- <element maxOccurs="1" minOccurs="1" name="PaymentMeansTransHist" nillable="false" type="tns1:PaymentMeansTransHist">
1333
- </element>
1334
- <element maxOccurs="1" minOccurs="1" name="AlertsTransHist" nillable="false" type="tns1:AlertsTransHist">
1335
- </element>
1336
- </sequence>
1337
- </complexType>
1338
- </element>
1339
- <element name="getTokenRequest">
1340
- <complexType>
1341
- <sequence>
1342
- <element name="cardNumber" nillable="false" type="xsd:string"/>
1343
- <element name="expirationDate" nillable="true" type="xsd:string"/>
1344
- <element name="contractNumber" nillable="false" type="xsd:string"/>
1345
- </sequence>
1346
- </complexType>
1347
- </element>
1348
- <element name="getTokenResponse">
1349
- <complexType>
1350
- <sequence>
1351
- <element name="result" nillable="false" type="tns1:result"/>
1352
- <element maxOccurs="1" minOccurs="1" name="token" nillable="false" type="xsd:string"/>
1353
- <element maxOccurs="1" minOccurs="1" name="maskedCardNumber" nillable="false" type="xsd:string"/>
1354
- <element maxOccurs="1" minOccurs="1" name="expirationDate" nillable="false" type="xsd:string"/>
1355
- <element maxOccurs="1" minOccurs="1" name="virtualCard" nillable="false" type="xsd:string"/>
1356
- <element maxOccurs="1" minOccurs="1" name="cardType" nillable="false" type="xsd:string"/>
1357
- <element maxOccurs="1" minOccurs="1" name="cardProduct" nillable="false" type="xsd:string"/>
1358
- <element maxOccurs="1" minOccurs="1" name="acceptanceNetwork" nillable="false" type="xsd:string"/>
1359
- <element maxOccurs="1" minOccurs="1" name="bank" nillable="false" type="xsd:string"/>
1360
- </sequence>
1361
- </complexType>
1362
- </element>
1363
- <element name="unBlockRequest">
1364
- <complexType>
1365
- <sequence>
1366
- <element name="transactionID" nillable="false" type="xsd:string"/>
1367
- <element name="transactionDate" nillable="true" type="xsd:string"/>
1368
- <element name="version" nillable="true" type="xsd:string"/>
1369
- </sequence>
1370
- </complexType>
1371
- </element>
1372
- <element name="unBlockResponse">
1373
- <complexType>
1374
- <sequence>
1375
- <element name="result" nillable="false" type="tns1:result"/>
1376
- </sequence>
1377
- </complexType>
1378
- </element>
1379
-
1380
- <element name="updatePaymentRecordRequest">
1381
- <complexType>
1382
- <sequence>
1383
- <element name="version" nillable="true" type="xsd:string"/>
1384
- <element name="contractNumber" nillable="false" type="xsd:string"/>
1385
- <element name="paymentRecordId" nillable="false" type="xsd:string"/>
1386
- <element name="recurring" nillable="false" type="tns1:recurringForUpdate"/>
1387
- </sequence>
1388
- </complexType>
1389
- </element>
1390
- <element name="updatePaymentRecordResponse">
1391
- <complexType>
1392
- <sequence>
1393
- <element name="result" nillable="false" type="tns1:result"/>
1394
- <element name="recurring" nillable="false" type="tns1:recurring"/>
1395
- <element name="isDisabled" nillable="false" type="xsd:string"/>
1396
- <element name="disableDate" nillable="false" type="xsd:string"/>
1397
- <element name="privateDataList" nillable="false" type="tns1:privateDataList"/>
1398
- <element name="order" nillable="false" type="tns1:order"/>
1399
- <element name="walletId" nillable="false" type="xsd:string"/>
1400
- </sequence>
1401
- </complexType>
1402
- </element>
1403
-
1404
- <element name="getBillingRecordRequest">
1405
- <complexType>
1406
- <sequence>
1407
- <element name="contractNumber" nillable="false" type="xsd:string"/>
1408
- <element name="paymentRecordId" nillable="false" type="xsd:string"/>
1409
- <element name="billingRecordId" nillable="false" type="xsd:string"/>
1410
- </sequence>
1411
- </complexType>
1412
- </element>
1413
- <element name="getBillingRecordResponse">
1414
- <complexType>
1415
- <sequence>
1416
- <element name="result" nillable="false" type="tns1:result"/>
1417
- <element name="recurring" nillable="false" type="tns1:recurring"/>
1418
- <element name="isDisabled" nillable="true" type="xsd:string"/>
1419
- <element name="disableDate" nillable="true" type="xsd:string"/>
1420
- <element name="billingRecord" nillable="false" type="tns1:billingRecord"/>
1421
- <element name="order" nillable="true" type="tns1:order"/>
1422
- <element name="privateDataList" nillable="true" type="tns1:privateDataList"/>
1423
- <element name="walletId" nillable="false" type="xsd:string"/>
1424
- </sequence>
1425
- </complexType>
1426
- </element>
1427
-
1428
- <element name="updateBillingRecordRequest">
1429
- <complexType>
1430
- <sequence>
1431
- <element name="contractNumber" nillable="false" type="xsd:string"/>
1432
- <element name="paymentRecordId" nillable="false" type="xsd:string"/>
1433
- <element name="billingRecordId" nillable="false" type="xsd:string"/>
1434
- <element name="billingRecordForUpdate" nillable="false" type="tns1:billingRecordForUpdate"/>
1435
- </sequence>
1436
- </complexType>
1437
- </element>
1438
-
1439
- <element name="updateBillingRecordResponse">
1440
- <complexType>
1441
- <sequence>
1442
- <element name="result" nillable="false" type="tns1:result"/>
1443
- <element name="recurring" nillable="false" type="tns1:recurring"/>
1444
- <element name="isDisabled" nillable="true" type="xsd:string"/>
1445
- <element name="disableDate" nillable="true" type="xsd:string"/>
1446
- <element name="billingRecord" nillable="false" type="tns1:billingRecord"/>
1447
- <element name="order" nillable="true" type="tns1:order"/>
1448
- <element name="privateDataList" nillable="true" type="tns1:privateDataList"/>
1449
- <element name="walletId" nillable="false" type="xsd:string"/>
1450
- </sequence>
1451
- </complexType>
1452
- </element>
1453
-
1454
- </schema>
1455
- <schema elementFormDefault="qualified" targetNamespace="http://obj.ws.payline.experian.com" xmlns="http://www.w3.org/2001/XMLSchema">
1456
- <complexType name="result">
1457
- <annotation>
1458
- <documentation>
1459
- This element contains information about the
1460
- process
1461
- </documentation>
1462
- </annotation>
1463
- <sequence>
1464
- <element name="code" nillable="false" type="xsd:string"/>
1465
- <element minOccurs="0" name="shortMessage" nillable="true" type="xsd:string"/>
1466
- <element minOccurs="0" name="longMessage" nillable="true" type="xsd:string"/>
1467
- </sequence>
1468
- </complexType>
1469
- <complexType name="cardOut">
1470
- <sequence>
1471
- <element minOccurs="0" name="number" nillable="true" type="xsd:string"/>
1472
- <element minOccurs="0" name="type" nillable="true" type="xsd:string"/>
1473
- <element minOccurs="0" name="expirationDate" nillable="true" type="xsd:string"/>
1474
- <element minOccurs="0" name="cardholder" nillable="true" type="xsd:string"/>
1475
- <element minOccurs="0" name="token" nillable="true" type="xsd:string"/>
1476
- </sequence>
1477
- </complexType>
1478
-
1479
- <complexType name="extendedCardType">
1480
- <sequence>
1481
- <element minOccurs="0" name="country" nillable="true" type="xsd:string"/>
1482
- <element minOccurs="0" name="isCvd" nillable="true" type="xsd:string"/>
1483
- <element minOccurs="0" name="bank" nillable="true" type="xsd:string"/>
1484
- <element minOccurs="0" name="type" nillable="true" type="xsd:string"/>
1485
- <element minOccurs="0" name="network" nillable="true" type="xsd:string"/>
1486
- <element minOccurs="0" name="product" nillable="true" type="xsd:string"/>
1487
- </sequence>
1488
- </complexType>
1489
- <complexType name="order">
1490
- <annotation>
1491
- <documentation>
1492
- This element contains information about the
1493
- order
1494
- </documentation>
1495
- </annotation>
1496
- <sequence>
1497
- <element name="ref" nillable="false" type="xsd:string"/>
1498
- <element minOccurs="0" name="origin" nillable="true" type="xsd:string"/>
1499
- <element minOccurs="0" name="country" nillable="true" type="xsd:string"/>
1500
- <element minOccurs="0" name="taxes" nillable="true" type="xsd:string"/>
1501
- <element name="amount" nillable="false" type="xsd:string"/>
1502
- <element name="currency" nillable="false" type="xsd:string"/>
1503
- <element name="date" nillable="false" type="xsd:string"/>
1504
- <element minOccurs="0" name="details" nillable="true" type="tns1:details"/>
1505
- <element minOccurs="0" name="deliveryTime" nillable="true" type="xsd:string"/>
1506
- <element minOccurs="0" name="deliveryMode" nillable="true" type="xsd:string"/>
1507
- <element minOccurs="0" name="deliveryExpectedDate" nillable="true" type="xsd:string"/>
1508
- <element minOccurs="0" name="deliveryExpectedDelay" nillable="true" type="xsd:string"/>
1509
- </sequence>
1510
- </complexType>
1511
- <complexType name="key">
1512
- <annotation>
1513
- <documentation>
1514
- This element contains information about the
1515
- encryptionKey
1516
- </documentation>
1517
- </annotation>
1518
- <sequence>
1519
- <element name="keyId" nillable="false" type="xsd:integer"/>
1520
- <element name="modulus" nillable="false" type="xsd:string"/>
1521
- <element name="publicExponent" nillable="false" type="xsd:string"/>
1522
- <element name="expirationDate" nillable="false" type="xsd:string"/>
1523
- </sequence>
1524
- </complexType>
1525
- <complexType name="details">
1526
- <annotation>
1527
- <documentation>
1528
- This element contains an array of orderDetail
1529
- </documentation>
1530
- </annotation>
1531
- <sequence>
1532
- <element maxOccurs="100" minOccurs="0" name="details" type="tns1:orderDetail"/>
1533
- </sequence>
1534
- </complexType>
1535
-
1536
- <complexType name="orderDetail">
1537
- <annotation>
1538
- <documentation>
1539
- This element contains information about the
1540
- order
1541
- product
1542
- </documentation>
1543
- </annotation>
1544
- <sequence>
1545
- <element minOccurs="0" name="ref" nillable="true" type="xsd:string"/>
1546
- <element minOccurs="0" name="price" nillable="true" type="xsd:string"/>
1547
- <element minOccurs="0" name="quantity" nillable="true" type="xsd:string"/>
1548
- <element minOccurs="0" name="comment" nillable="true" type="xsd:string"/>
1549
- <element minOccurs="0" name="category" nillable="true" type="xsd:string"/>
1550
- <element minOccurs="0" name="brand" nillable="true" type="xsd:string"/>
1551
- <element minOccurs="0" name="subcategory1" nillable="true" type="xsd:string"/>
1552
- <element minOccurs="0" name="subcategory2" nillable="true" type="xsd:string"/>
1553
- <element minOccurs="0" name="additionalData" nillable="true" type="xsd:string"/>
1554
- <element minOccurs="0" name="taxRate" nillable="true" type="xsd:string"/>
1555
- </sequence>
1556
- </complexType>
1557
- <complexType name="privateData">
1558
- <annotation>
1559
- <documentation>
1560
- This element contains information about the
1561
- merchant
1562
- private data
1563
- </documentation>
1564
- </annotation>
1565
- <sequence>
1566
- <element name="key" nillable="false" type="xsd:string"/>
1567
- <element name="value" nillable="false" type="xsd:string"/>
1568
- </sequence>
1569
- </complexType>
1570
- <complexType name="transaction">
1571
- <annotation>
1572
- <documentation>
1573
- This element contains information about the
1574
- transaction
1575
- </documentation>
1576
- </annotation>
1577
- <sequence>
1578
- <element name="id" nillable="false" type="xsd:string"/>
1579
- <element name="date" nillable="false" type="xsd:string"/>
1580
- <element minOccurs="0" name="isDuplicated" nillable="true" type="xsd:string"/>
1581
- <element name="isPossibleFraud" nillable="true" type="xsd:string"/>
1582
- <element minOccurs="0" name="fraudResult" nillable="true" type="xsd:string"/>
1583
- <element minOccurs="0" name="fraudResultDetails" nillable="true" type="tns1:fraudResultDetails"/>
1584
- <element minOccurs="0" name="explanation" nillable="true" type="xsd:string"/>
1585
- <element minOccurs="0" name="threeDSecure" nillable="true" type="xsd:string"/>
1586
- <element minOccurs="0" name="score" nillable="true" type="xsd:string"/>
1587
- <element minOccurs="0" name="externalWalletType" nillable="true" type="xsd:string"/>
1588
- <element minOccurs="0" name="externalWalletContractNumber" nillable="true" type="xsd:string"/>
1589
-
1590
- </sequence>
1591
- </complexType>
1592
- <complexType name="fraudResultDetails">
1593
- <annotation>
1594
- <documentation>
1595
- This element contains information about the
1596
- fraud
1597
- result details
1598
- </documentation>
1599
- </annotation>
1600
- <sequence>
1601
- <element name="code" nillable="false" type="xsd:string"/>
1602
- <element name="shortMessage" nillable="false" type="xsd:string"/>
1603
- <element name="longMessage" nillable="false" type="xsd:string"/>
1604
- </sequence>
1605
- </complexType>
1606
- <complexType name="payment">
1607
- <annotation>
1608
- <documentation>
1609
- This element contains information about the
1610
- payment
1611
- </documentation>
1612
- </annotation>
1613
- <sequence>
1614
- <element name="amount" nillable="true" type="xsd:string"/>
1615
- <element name="currency" nillable="false" type="xsd:string"/>
1616
- <element name="action" nillable="false" type="xsd:string"/>
1617
- <element name="mode" nillable="false" type="xsd:string"/>
1618
- <element name="contractNumber" nillable="false" type="xsd:string"/>
1619
- <element minOccurs="0" name="differedActionDate" nillable="true" type="xsd:string"/>
1620
- <element minOccurs="0" name="method" nillable="true" type="xsd:string"/>
1621
- </sequence>
1622
- </complexType>
1623
- <complexType name="authorization">
1624
- <annotation>
1625
- <documentation>
1626
- This element contains information about the
1627
- authorization
1628
- </documentation>
1629
- </annotation>
1630
- <sequence>
1631
- <element name="number" nillable="false" type="xsd:string"/>
1632
- <element name="date" nillable="false" type="xsd:string"/>
1633
- </sequence>
1634
- </complexType>
1635
- <complexType name="card">
1636
- <annotation>
1637
- <documentation>
1638
- This element contains information about the card
1639
- </documentation>
1640
- </annotation>
1641
- <sequence>
1642
- <element minOccurs="0" name="encryptionKeyId" nillable="true" type="xsd:string"/>
1643
- <element minOccurs="0" name="encryptedData" nillable="true" type="xsd:string"/>
1644
- <element minOccurs="0" name="number" nillable="true" type="xsd:string"/>
1645
- <element name="type" nillable="false" type="xsd:string"/>
1646
- <element minOccurs="0" name="expirationDate" nillable="true" type="xsd:string"/>
1647
- <element minOccurs="0" name="cvx" nillable="true" type="xsd:string"/>
1648
- <element minOccurs="0" name="ownerBirthdayDate" nillable="true" type="xsd:string"/>
1649
- <element minOccurs="0" name="password" nillable="true" type="xsd:string"/>
1650
- <element minOccurs="0" name="cardPresent" nillable="true" type="xsd:string"/>
1651
- <element minOccurs="0" name="cardholder" nillable="true" type="xsd:string"/>
1652
- <element minOccurs="0" name="token" nillable="true" type="xsd:string"/>
1653
- </sequence>
1654
- </complexType>
1655
- <complexType name="buyer">
1656
- <annotation>
1657
- <documentation>
1658
- This element contains information about the
1659
- buyer
1660
- </documentation>
1661
- </annotation>
1662
- <sequence>
1663
- <element name="title" nillable="true" type="xsd:string"/>
1664
- <element name="lastName" nillable="true" type="xsd:string"/>
1665
- <element name="firstName" nillable="true" type="xsd:string"/>
1666
- <element name="email" nillable="true" type="xsd:string"/>
1667
- <element name="shippingAdress" nillable="true" type="tns1:address"/>
1668
- <element name="billingAddress" nillable="true" type="tns1:address"/>
1669
- <element name="accountCreateDate" nillable="true" type="xsd:string"/>
1670
- <element name="accountAverageAmount" nillable="true" type="xsd:string"/>
1671
- <element name="accountOrderCount" nillable="true" type="xsd:string"/>
1672
- <element name="walletId" nillable="true" type="xsd:string"/>
1673
- <element name="walletDisplayed" nillable="true" type="xsd:string"/>
1674
- <element name="walletSecured" nillable="true" type="xsd:string"/>
1675
- <element name="walletCardInd" nillable="true" type="xsd:string"/>
1676
- <element name="ip" nillable="true" type="xsd:string"/>
1677
- <element name="mobilePhone" nillable="true" type="xsd:string"/>
1678
- <element name="customerId" nillable="true" type="xsd:string"/>
1679
- <element name="legalStatus" nillable="true" type="xsd:string"/>
1680
- <element name="legalDocument" nillable="true" type="xsd:string"/>
1681
- <element name="birthDate" nillable="true" type="xsd:string"/>
1682
- <element name="fingerprintID" nillable="true" type="xsd:string"/>
1683
- </sequence>
1684
- </complexType>
1685
- <complexType name="owner">
1686
- <annotation>
1687
- <documentation>
1688
- This element contains information about the
1689
- owner
1690
- </documentation>
1691
- </annotation>
1692
- <sequence>
1693
- <element name="lastName" nillable="true" type="xsd:string"/>
1694
- <element name="firstName" nillable="true" type="xsd:string"/>
1695
- <element name="billingAddress" nillable="true" type="tns1:addressOwner"/>
1696
- <element name="issueCardDate" nillable="true" type="xsd:string"/>
1697
- </sequence>
1698
- </complexType>
1699
- <complexType name="address">
1700
- <annotation>
1701
- <documentation>
1702
- This element contains information about the
1703
- address
1704
- </documentation>
1705
- </annotation>
1706
- <sequence>
1707
- <element minOccurs="0" name="title" nillable="true" type="xsd:string"/>
1708
- <element minOccurs="0" name="name" nillable="true" type="xsd:string"/>
1709
- <element minOccurs="0" name="firstName" nillable="true" type="xsd:string"/>
1710
- <element minOccurs="0" name="lastName" nillable="true" type="xsd:string"/>
1711
- <element minOccurs="0" name="street1" nillable="true" type="xsd:string"/>
1712
- <element minOccurs="0" name="street2" nillable="true" type="xsd:string"/>
1713
- <element minOccurs="0" name="cityName" nillable="true" type="xsd:string"/>
1714
- <element minOccurs="0" name="zipCode" nillable="true" type="xsd:string"/>
1715
- <element minOccurs="0" name="country" nillable="true" type="xsd:string"/>
1716
- <element minOccurs="0" name="phone" nillable="true" type="xsd:string"/>
1717
- <element minOccurs="0" name="state" nillable="true" type="xsd:string"/>
1718
- <element minOccurs="0" name="county" nillable="true" type="xsd:string"/>
1719
- <element minOccurs="0" name="phoneType" nillable="true" type="xsd:string"/>
1720
- </sequence>
1721
- </complexType>
1722
- <complexType name="addressOwner">
1723
- <annotation>
1724
- <documentation>
1725
- This element contains information about the
1726
- address
1727
- </documentation>
1728
- </annotation>
1729
- <sequence>
1730
- <element name="street" nillable="true" type="xsd:string"/>
1731
- <element name="cityName" nillable="true" type="xsd:string"/>
1732
- <element name="zipCode" nillable="true" type="xsd:string"/>
1733
- <element name="country" nillable="true" type="xsd:string"/>
1734
- <element name="phone" nillable="true" type="xsd:string"/>
1735
- </sequence>
1736
- </complexType>
1737
- <complexType name="capture">
1738
- <annotation>
1739
- <documentation>
1740
- This element contains information about the
1741
- capture
1742
- </documentation>
1743
- </annotation>
1744
- <sequence>
1745
- <element name="transactionID" nillable="false" type="xsd:string"/>
1746
- <element name="payment" nillable="false" type="tns1:payment"/>
1747
- </sequence>
1748
- </complexType>
1749
- <complexType name="refund">
1750
- <annotation>
1751
- <documentation>
1752
- This element contains information about the
1753
- refund
1754
- </documentation>
1755
- </annotation>
1756
- <sequence>
1757
- <element name="transactionID" nillable="false" type="xsd:string"/>
1758
- <element name="payment" nillable="false" type="tns1:payment"/>
1759
- </sequence>
1760
- </complexType>
1761
- <complexType name="selectedContractList">
1762
- <annotation>
1763
- <documentation>
1764
- This element contains the list of selected card
1765
- </documentation>
1766
- </annotation>
1767
- <sequence>
1768
- <element maxOccurs="25" minOccurs="1" name="selectedContract" type="xsd:string"/>
1769
- </sequence>
1770
- </complexType>
1771
- <complexType name="privateDataList">
1772
- <annotation>
1773
- <documentation>
1774
- An array of private data
1775
- </documentation>
1776
- </annotation>
1777
- <sequence>
1778
- <element maxOccurs="100" minOccurs="0" name="privateData" type="tns1:privateData"/>
1779
- </sequence>
1780
- </complexType>
1781
- <complexType name="contractNumberWalletList">
1782
- <annotation>
1783
- <documentation>
1784
- An array of contract number of a wallet
1785
- </documentation>
1786
- </annotation>
1787
- <sequence>
1788
- <element maxOccurs="10" minOccurs="0" name="contractNumberWallet" type="xsd:string"/>
1789
- </sequence>
1790
- </complexType>
1791
- <complexType name="cardsList">
1792
- <annotation>
1793
- <documentation>
1794
- An array of cards
1795
- </documentation>
1796
- </annotation>
1797
- <sequence>
1798
- <element maxOccurs="99" minOccurs="0" name="cards" type="tns1:cards"/>
1799
- </sequence>
1800
- </complexType>
1801
- <complexType name="captureAuthorizationList">
1802
- <annotation>
1803
- <documentation>
1804
- An array of authorization to capture
1805
- </documentation>
1806
- </annotation>
1807
- <sequence>
1808
- <element maxOccurs="5000" minOccurs="1" name="capture" type="tns1:capture"/>
1809
- </sequence>
1810
- </complexType>
1811
- <complexType name="refundAuthorizationList">
1812
- <annotation>
1813
- <documentation>
1814
- An array of authorization to refund
1815
- </documentation>
1816
- </annotation>
1817
- <sequence>
1818
- <element maxOccurs="5000" minOccurs="1" name="refund" type="tns1:refund"/>
1819
- </sequence>
1820
- </complexType>
1821
- <complexType name="resetAuthorizationList">
1822
- <annotation>
1823
- <documentation>
1824
- An array of authorization to reset
1825
- </documentation>
1826
- </annotation>
1827
- <sequence>
1828
- <element maxOccurs="5000" minOccurs="1" name="transactionID" type="xsd:string"/>
1829
- </sequence>
1830
- </complexType>
1831
- <complexType name="recurring">
1832
- <annotation>
1833
- <documentation>
1834
- This element contains element for recurring
1835
- operation
1836
- </documentation>
1837
- </annotation>
1838
- <sequence>
1839
- <element name="firstAmount" nillable="true" type="xsd:string"/>
1840
- <element name="amount" nillable="false" type="xsd:string"/>
1841
- <element name="billingCycle" nillable="false" type="xsd:string"/>
1842
- <element name="billingLeft" nillable="false" type="xsd:string"/>
1843
- <element name="billingDay" nillable="true" type="xsd:string"/>
1844
- <element name="startDate" nillable="true" type="xsd:string"/>
1845
- <element name="endDate" nillable="true" type="xsd:string"/>
1846
- <element name="newAmount" nillable="true" type="xsd:string"/>
1847
- <element name="amountModificationDate" nillable="true" type="xsd:string"/>
1848
- </sequence>
1849
- </complexType>
1850
- <complexType name="recurringForUpdate">
1851
- <annotation>
1852
- <documentation>
1853
- This element contains element for update a recurring
1854
- operation
1855
- </documentation>
1856
- </annotation>
1857
- <sequence>
1858
- <element name="billingLeft" nillable="true" type="xsd:string"/>
1859
- <element name="billingDay" nillable="true" type="xsd:string"/>
1860
- <element name="endDate" nillable="true" type="xsd:string"/>
1861
- <element name="newAmount" nillable="true" type="xsd:string"/>
1862
- <element name="amountModificationDate" nillable="true" type="xsd:string"/>
1863
- </sequence>
1864
- </complexType>
1865
- <complexType name="billingRecord">
1866
- <annotation>
1867
- <documentation>
1868
- This element contains element for a billing
1869
- record
1870
- </documentation>
1871
- </annotation>
1872
- <sequence>
1873
- <element name="date" nillable="false" type="xsd:string"/>
1874
- <element name="amount" nillable="false" type="xsd:string"/>
1875
- <element name="status" nillable="false" type="xsd:string"/>
1876
- <element minOccurs="0" name="result" nillable="true" type="tns1:result"/>
1877
- <element minOccurs="0" name="transaction" nillable="true" type="tns1:transaction"/>
1878
- <element minOccurs="0" name="authorization" nillable="true" type="tns1:authorization"/>
1879
- <element minOccurs="0" name="nbTry" nillable="true" type="xsd:string"/>
1880
- <element minOccurs="0" name="rank" nillable="true" type="xsd:string"/>
1881
- </sequence>
1882
- </complexType>
1883
- <complexType name="billingRecordList">
1884
- <annotation>
1885
- <documentation>
1886
- An array of billing record
1887
- </documentation>
1888
- </annotation>
1889
- <sequence>
1890
- <element maxOccurs="100" minOccurs="0" name="billingRecord" type="tns1:billingRecord"/>
1891
- </sequence>
1892
- </complexType>
1893
-
1894
- <complexType name="billingRecordForUpdate">
1895
- <annotation>
1896
- <documentation>
1897
- This element contains element for update a recurring
1898
- operation
1899
- </documentation>
1900
- </annotation>
1901
- <sequence>
1902
- <element name="date" nillable="true" type="xsd:string"/>
1903
- <element name="amount" nillable="true" type="xsd:string"/>
1904
- <element name="status" nillable="true" type="xsd:string"/>
1905
- <element name="executionDate" nillable="true" type="xsd:string"/>
1906
- </sequence>
1907
- </complexType>
1908
-
1909
- <complexType name="wallet">
1910
- <annotation>
1911
- <documentation>
1912
- This element contains element for a wallet
1913
- </documentation>
1914
- </annotation>
1915
- <sequence>
1916
- <element name="walletId" nillable="false" type="xsd:string"/>
1917
- <element minOccurs="0" name="lastName" nillable="true" type="xsd:string"/>
1918
- <element minOccurs="0" name="firstName" nillable="true" type="xsd:string"/>
1919
- <element minOccurs="0" name="email" nillable="true" type="xsd:string"/>
1920
- <element minOccurs="0" name="shippingAddress" nillable="true" type="tns1:address"/>
1921
- <element name="card" nillable="false" type="tns1:card"/>
1922
- <element minOccurs="0" name="comment" nillable="true" type="xsd:string"/>
1923
- <element minOccurs="0" name="default" nillable="true" type="xsd:string"/>
1924
- <element minOccurs="0" name="cardStatus" nillable="true" type="xsd:string"/>
1925
- </sequence>
1926
- </complexType>
1927
- <complexType name="cards">
1928
- <annotation>
1929
- <documentation>
1930
- This element contains element for a wallet
1931
- </documentation>
1932
- </annotation>
1933
- <sequence>
1934
- <element name="walletId" nillable="false" type="xsd:string"/>
1935
- <element name="lastName" nillable="true" type="xsd:string"/>
1936
- <element name="firstName" nillable="true" type="xsd:string"/>
1937
- <element name="email" nillable="true" type="xsd:string"/>
1938
- <element name="shippingAddress" nillable="true" type="tns1:address"/>
1939
- <element name="card" nillable="false" type="tns1:card"/>
1940
- <element name="cardInd" nillable="true" type="xsd:string"/>
1941
- <element name="comment" nillable="true" type="xsd:string"/>
1942
- <element name="isDisabled" nillable="true" type="xsd:string"/>
1943
- <element name="disableDate" nillable="true" type="xsd:string"/>
1944
- <element name="extendedCard" nillable="true" type="tns1:extendedCardType"/>
1945
- <element name="default" nillable="true" type="xsd:string"/>
1946
- </sequence>
1947
- </complexType>
1948
- <complexType name="walletIdList">
1949
- <annotation>
1950
- <documentation>
1951
- This element contains the list of selected card
1952
- </documentation>
1953
- </annotation>
1954
- <sequence>
1955
- <element maxOccurs="500" minOccurs="1" name="walletId" type="xsd:string"/>
1956
- </sequence>
1957
- </complexType>
1958
- <complexType name="transactionList">
1959
- <annotation>
1960
- <documentation>
1961
- This element contains the list of selected card
1962
- </documentation>
1963
- </annotation>
1964
- <sequence>
1965
- <element maxOccurs="5000" minOccurs="0" name="transaction" type="tns1:transaction"/>
1966
- </sequence>
1967
- </complexType>
1968
- <complexType name="authentication3DSecure">
1969
- <annotation>
1970
- <documentation>
1971
- This element contains element for a 3DSecure
1972
- transaction
1973
- </documentation>
1974
- </annotation>
1975
- <sequence>
1976
- <element minOccurs="0" name="md" nillable="true" type="xsd:string"/>
1977
- <element minOccurs="0" name="pares" nillable="true" type="xsd:string"/>
1978
- <element minOccurs="0" name="xid" nillable="true" type="xsd:string"/>
1979
- <element minOccurs="0" name="eci" nillable="true" type="xsd:string"/>
1980
- <element minOccurs="0" name="cavv" nillable="true" type="xsd:string"/>
1981
- <element minOccurs="0" name="cavvAlgorithm" nillable="true" type="xsd:string"/>
1982
- <element minOccurs="0" name="vadsResult" nillable="true" type="xsd:string"/>
1983
- <element minOccurs="0" name="typeSecurisation" nillable="true" type="xsd:string"/>
1984
- </sequence>
1985
- </complexType>
1986
- <complexType name="connectionData">
1987
- <annotation>
1988
- <documentation>
1989
- This element contains the merchant connection
1990
- parameters
1991
- </documentation>
1992
- </annotation>
1993
- <sequence>
1994
- <element name="merchantId" nillable="false" type="xsd:string"/>
1995
- <element name="userId" nillable="false" type="xsd:string"/>
1996
- <element name="password" nillable="false" type="xsd:string"/>
1997
- <element name="secretQuestion" nillable="false" type="xsd:string"/>
1998
- <element name="secretAnswer" nillable="false" type="xsd:string"/>
1999
- </sequence>
2000
- </complexType>
2001
- <complexType name="scoringCheque">
2002
- <annotation>
2003
- <documentation>
2004
- This element contains the scoring cheque parameters
2005
- </documentation>
2006
- </annotation>
2007
- <sequence>
2008
- <element name="chequeNumber" nillable="false" type="xsd:string"/>
2009
- <element name="additionalDataResponse" nillable="false" type="xsd:string"/>
2010
- <element name="terminalId" nillable="false" type="xsd:string"/>
2011
- <element name="additionalPrivateData" nillable="false" type="xsd:string"/>
2012
- </sequence>
2013
- </complexType>
2014
- <complexType name="addressInterlocutor">
2015
- <annotation>
2016
- <documentation>
2017
- This element contains information about Interlocutor
2018
- address
2019
- </documentation>
2020
- </annotation>
2021
- <sequence>
2022
- <element name="street1" nillable="true" type="xsd:string"/>
2023
- <element name="street2" nillable="true" type="xsd:string"/>
2024
- <element name="city" nillable="true" type="xsd:string"/>
2025
- <element name="zipCode" nillable="true" type="xsd:string"/>
2026
- <element name="state" nillable="true" type="xsd:string"/>
2027
- <element name="country" nillable="true" type="xsd:string"/>
2028
- </sequence>
2029
- </complexType>
2030
- <complexType name="interlocutor">
2031
- <annotation>
2032
- <documentation>
2033
- This element contains information about Interlocutor
2034
- </documentation>
2035
- </annotation>
2036
- <sequence>
2037
- <element name="firstName" nillable="true" type="xsd:string"/>
2038
- <element name="lastName" nillable="true" type="xsd:string"/>
2039
- <element name="email" nillable="true" type="xsd:string"/>
2040
- <element name="phone" nillable="true" type="xsd:string"/>
2041
- <element name="mobile" nillable="true" type="xsd:string"/>
2042
- <element name="fax" nillable="true" type="xsd:string"/>
2043
- <element name="addressInterlocutor" nillable="true" type="tns1:addressInterlocutor"/>
2044
- </sequence>
2045
- </complexType>
2046
- <complexType name="option">
2047
- <annotation>
2048
- <documentation>
2049
- An array of subscribed options
2050
- </documentation>
2051
- </annotation>
2052
- <sequence>
2053
- <element name="id" type="xsd:string"/>
2054
- <element name="subscribed" nillable="true" type="xsd:boolean"/>
2055
- <element name="endDate" nillable="true" type="xsd:dateTime"/>
2056
- </sequence>
2057
- </complexType>
2058
- <complexType name="subscription">
2059
- <annotation>
2060
- <documentation>
2061
- This element contains information about the payline
2062
- package subscribed by the merchant
2063
- </documentation>
2064
- </annotation>
2065
- <sequence>
2066
- <element name="id" type="xsd:string"/>
2067
- <element maxOccurs="unbounded" minOccurs="0" name="option" type="tns1:option"/>
2068
- </sequence>
2069
- </complexType>
2070
- <complexType name="iban">
2071
- <annotation>
2072
- <documentation>
2073
- This element contains IBAN information
2074
- </documentation>
2075
- </annotation>
2076
- <sequence>
2077
- <element name="CountryCode" nillable="true" type="xsd:string"/>
2078
- <element name="checkKey" nillable="true" type="xsd:string"/>
2079
- <element name="BBAN" nillable="true" type="xsd:string"/>
2080
- <element name="BIC" nillable="true" type="xsd:string"/>
2081
- </sequence>
2082
- </complexType>
2083
- <complexType name="rib">
2084
- <annotation>
2085
- <documentation>
2086
- This element contains RIB information
2087
- </documentation>
2088
- </annotation>
2089
- <sequence>
2090
- <element name="tellerCode" nillable="true" type="xsd:string"/>
2091
- <element name="accountNumber" nillable="true" type="xsd:string"/>
2092
- <element name="key" nillable="true" type="xsd:string"/>
2093
- </sequence>
2094
- </complexType>
2095
- <complexType name="bankAccount">
2096
- <annotation>
2097
- <documentation>
2098
- This element contains bankAccount information
2099
- </documentation>
2100
- </annotation>
2101
- <sequence>
2102
- <element name="bankCode" nillable="true" type="xsd:string"/>
2103
- <element name="bankNumber" nillable="true" type="xsd:string"/>
2104
- <element name="iban" nillable="true" type="tns1:iban"/>
2105
- <element name="rib" nillable="true" type="tns1:rib"/>
2106
- </sequence>
2107
- </complexType>
2108
- <complexType name="bankAccountData">
2109
- <annotation>
2110
- <documentation>
2111
- This element contains bank Account information
2112
- </documentation>
2113
- </annotation>
2114
- <sequence>
2115
- <element name="countryCode" nillable="true" type="xsd:string"/>
2116
- <element name="bankCode" nillable="true" type="xsd:string"/>
2117
- <element name="accountNumber" nillable="true" type="xsd:string"/>
2118
- <element name="key" nillable="true" type="xsd:string"/>
2119
- </sequence>
2120
- </complexType>
2121
- <complexType name="technicalData">
2122
- <annotation>
2123
- <documentation>
2124
- This element contains technical data used to define
2125
- acquirer service
2126
- </documentation>
2127
- </annotation>
2128
- <sequence>
2129
- <element name="terminalNumber" nillable="true" type="xsd:string"/>
2130
- <element name="GTInstance" nillable="true" type="xsd:string"/>
2131
- <element name="paymentProfil" nillable="true" type="xsd:string"/>
2132
- </sequence>
2133
- </complexType>
2134
- <complexType name="contract">
2135
- <annotation>
2136
- <documentation>
2137
- This element contains all information about contract
2138
- </documentation>
2139
- </annotation>
2140
- <sequence>
2141
- <element name="cardType" nillable="true" type="xsd:string"/>
2142
- <element minOccurs="0" name="label" nillable="true" type="xsd:string"/>
2143
- <element name="contractNumber" nillable="true" type="xsd:string"/>
2144
- <element name="currency" nillable="true" type="xsd:string"/>
2145
- <element default="Manual" name="settlementType">
2146
- <simpleType>
2147
- <restriction base="xsd:string">
2148
- <enumeration value="Manual"/>
2149
- <enumeration value="Now"/>
2150
- <enumeration value="1Day"/>
2151
- <enumeration value="2Day"/>
2152
- <enumeration value="3Day"/>
2153
- <enumeration value="4Day"/>
2154
- <enumeration value="5Day"/>
2155
- <enumeration value="6Day"/>
2156
- <enumeration value="7Day"/>
2157
- </restriction>
2158
- </simpleType>
2159
- </element>
2160
- <element name="maxAmountPerTransaction" nillable="true" type="xsd:int"/>
2161
- <element name="technicalData" nillable="true" type="tns1:technicalData"/>
2162
- <element name="bankAccount" nillable="true" type="tns1:bankAccount"/>
2163
- <element name="acquirerInterlocutor" nillable="true" type="tns1:interlocutor"/>
2164
- <element name="description" nillable="true" type="xsd:string"/>
2165
- <element name="logoEnable" nillable="false" type="xsd:boolean"/>
2166
- <element maxOccurs="1" minOccurs="0" name="smallLogoMime" type="xsd:string">
2167
- </element>
2168
- <element maxOccurs="1" minOccurs="0" name="smallLogo" type="xsd:base64Binary">
2169
- </element>
2170
- <element maxOccurs="1" minOccurs="0" name="normalLogoMime" type="xsd:string">
2171
- </element>
2172
- <element maxOccurs="1" minOccurs="0" name="normalLogo" type="xsd:base64Binary">
2173
- </element>
2174
- <element maxOccurs="1" minOccurs="0" name="contribution" type="tns1:contribution">
2175
- </element>
2176
- <element maxOccurs="1" minOccurs="0" name="enrolment3DS" type="xsd:string">
2177
- </element>
2178
- </sequence>
2179
- </complexType>
2180
- <complexType name="customPaymentPageCode">
2181
- <annotation>
2182
- <documentation>
2183
- This element contains all information about
2184
- customPaymentPageCode
2185
- </documentation>
2186
- </annotation>
2187
- <sequence>
2188
- <element name="code" nillable="true" type="xsd:string"/>
2189
- <element name="label" nillable="true" type="xsd:string"/>
2190
- <element name="type" nillable="true" type="xsd:string"/>
2191
- </sequence>
2192
- </complexType>
2193
- <complexType name="ticketSend">
2194
- <annotation>
2195
- <documentation>
2196
- This element contains information e-ticket
2197
- </documentation>
2198
- </annotation>
2199
- <sequence>
2200
- <element name="toBuyer" nillable="true" type="xsd:boolean"/>
2201
- <element name="toMerchant" nillable="true" type="xsd:boolean"/>
2202
- </sequence>
2203
- </complexType>
2204
- <complexType name="pointOfSell">
2205
- <annotation>
2206
- <documentation>
2207
- This element contains all information about point of
2208
- sell
2209
- </documentation>
2210
- </annotation>
2211
- <sequence>
2212
- <element name="siret" nillable="true" type="xsd:string"/>
2213
- <element name="codeMcc" nillable="true">
2214
- <annotation>
2215
- <documentation>Merchant Category Code</documentation>
2216
- </annotation>
2217
- <simpleType>
2218
- <restriction base="xsd:string">
2219
- <xsd:length value="4"/>
2220
- </restriction>
2221
- </simpleType>
2222
- </element>
2223
- <element name="label" nillable="true" type="xsd:string"/>
2224
- <element name="webmasterEmail" nillable="true" type="xsd:string"/>
2225
- <element minOccurs="0" name="comments" nillable="true" type="xsd:string"/>
2226
- <element name="webstoreURL" nillable="true" type="xsd:string"/>
2227
- <element name="notificationURL" nillable="true" type="xsd:string"/>
2228
- <element minOccurs="0" name="privateLifeURL" nillable="true" type="xsd:string"/>
2229
- <element minOccurs="0" name="saleCondURL" nillable="true" type="xsd:string"/>
2230
- <element minOccurs="0" name="buyerMustAcceptSaleCond" nillable="true" type="xsd:boolean"/>
2231
- <element minOccurs="0" name="endOfPaymentRedirection" nillable="true" type="xsd:boolean"/>
2232
- <element name="ticketSend" nillable="true" type="tns1:ticketSend"/>
2233
- <element name="contracts">
2234
- <annotation>
2235
- <documentation>list of contract</documentation>
2236
- </annotation>
2237
- <complexType>
2238
- <sequence>
2239
- <element maxOccurs="unbounded" minOccurs="0" name="contract" type="tns1:contract"/>
2240
- </sequence>
2241
- </complexType>
2242
- </element>
2243
- <element name="virtualTerminal" nillable="true" type="tns1:virtualTerminal"/>
2244
- <element name="customPaymentPageCodeList">
2245
- <annotation>
2246
- <documentation>list of custom payment page code</documentation>
2247
- </annotation>
2248
- <complexType>
2249
- <sequence>
2250
- <element maxOccurs="unbounded" minOccurs="0" name="customPaymentPageCode" type="tns1:customPaymentPageCode"/>
2251
- </sequence>
2252
- </complexType>
2253
- </element>
2254
- </sequence>
2255
- </complexType>
2256
- <complexType name="virtualTerminal">
2257
- <annotation>
2258
- <documentation>virtualTerminal</documentation>
2259
- </annotation>
2260
- <sequence>
2261
- <element name="label" type="xsd:string"/>
2262
- <element default="10" name="inactivityDelay" type="xsd:int">
2263
- <annotation>
2264
- <documentation>http session timeout delay</documentation>
2265
- </annotation>
2266
- </element>
2267
- <element minOccurs="0" name="logo" type="xsd:string">
2268
- <annotation>
2269
- <documentation>path to logo</documentation>
2270
- </annotation>
2271
- </element>
2272
- <element name="functions">
2273
- <annotation>
2274
- <documentation>list of functions</documentation>
2275
- </annotation>
2276
- <complexType>
2277
- <sequence>
2278
- <element maxOccurs="unbounded" name="function" type="tns1:virtualTerminalFunction"/>
2279
- </sequence>
2280
- </complexType>
2281
- </element>
2282
- </sequence>
2283
- </complexType>
2284
- <complexType name="virtualTerminalFunction">
2285
- <annotation>
2286
- <documentation>functions availbe in virtual terminal
2287
- </documentation>
2288
- </annotation>
2289
- <sequence>
2290
- <element name="function">
2291
- <annotation>
2292
- <documentation>Please refer to Payline documentation
2293
- </documentation>
2294
- </annotation>
2295
- <simpleType>
2296
- <restriction base="xsd:string">
2297
- <enumeration value="simplePayment"/>
2298
- <enumeration value="walletCreation"/>
2299
- <enumeration value="nXPayment"/>
2300
- </restriction>
2301
- </simpleType>
2302
- </element>
2303
- <element name="label" type="xsd:string"/>
2304
- <sequence minOccurs="0">
2305
- <element maxOccurs="unbounded" name="functionParameter">
2306
- <annotation>
2307
- <documentation>Value of parameter</documentation>
2308
- </annotation>
2309
- <complexType>
2310
- <attribute name="id">
2311
- <annotation>
2312
- <documentation>Parameter ID. Refer to payline documentation
2313
- </documentation>
2314
- </annotation>
2315
- </attribute>
2316
- </complexType>
2317
- </element>
2318
- </sequence>
2319
- </sequence>
2320
- </complexType>
2321
- <complexType name="cheque">
2322
- <annotation>
2323
- <documentation>
2324
- This element contains information about the
2325
- cheque
2326
- </documentation>
2327
- </annotation>
2328
- <sequence>
2329
- <element name="number" nillable="false" type="xsd:string"/>
2330
- </sequence>
2331
- </complexType>
2332
- <complexType name="contribution">
2333
- <annotation>
2334
- <documentation>
2335
- This element contains all information about
2336
- contrinution
2337
- </documentation>
2338
- </annotation>
2339
- <sequence>
2340
- <element name="enable" type="xsd:boolean"/>
2341
- <element name="type" nillable="true" type="xsd:string"/>
2342
- <element name="value" nillable="true" type="xsd:string"/>
2343
- <element name="nbFreeTransaction" nillable="true" type="xsd:string"/>
2344
- <element name="minAmountTransaction" nillable="true" type="xsd:string"/>
2345
- <element name="maxAmountTransaction" nillable="true" type="xsd:string"/>
2346
- </sequence>
2347
- </complexType>
2348
- <complexType name="associatedTransactions">
2349
- <annotation>
2350
- <documentation>
2351
- This element contains information about the
2352
- associated transactions
2353
- </documentation>
2354
- </annotation>
2355
- <sequence>
2356
- <element name="transactionId" nillable="false" type="xsd:string"/>
2357
- <element name="type" nillable="false" type="xsd:string"/>
2358
- <element name="date" nillable="false" type="string"/>
2359
- <element name="amount" nillable="false" type="xsd:string"/>
2360
- <element name="status" nillable="false" type="xsd:string"/>
2361
- <element name="originTransactionId" nillable="false" type="xsd:string"/>
2362
- </sequence>
2363
- </complexType>
2364
-
2365
- <complexType name="associatedTransactionsList">
2366
- <annotation>
2367
- <documentation>
2368
- An array of associatedTransactions
2369
- </documentation>
2370
- </annotation>
2371
- <sequence>
2372
- <element maxOccurs="100" minOccurs="0" name="associatedTransactions" type="tns1:associatedTransactions"/>
2373
- </sequence>
2374
- </complexType>
2375
-
2376
- <complexType name="statusHistory">
2377
- <annotation>
2378
- <documentation>
2379
- This element contains information about the
2380
- status
2381
- History
2382
- </documentation>
2383
- </annotation>
2384
- <sequence>
2385
- <element name="transactionId" nillable="false" type="xsd:string"/>
2386
- <element name="date" nillable="false" type="string"/>
2387
- <element name="amount" nillable="false" type="xsd:string"/>
2388
- <element name="fees" nillable="false" type="xsd:string"/>
2389
- <element name="status" nillable="false" type="xsd:string"/>
2390
- <element name="originTransactionId" nillable="false" type="xsd:string"/>
2391
- </sequence>
2392
- </complexType>
2393
-
2394
- <complexType name="statusHistoryList">
2395
- <annotation>
2396
- <documentation>
2397
- An array of statusHistory
2398
- </documentation>
2399
- </annotation>
2400
- <sequence>
2401
- <element maxOccurs="100" minOccurs="0" name="statusHistory" type="tns1:statusHistory"/>
2402
- </sequence>
2403
- </complexType>
2404
- <complexType name="paymentAdditional">
2405
- <annotation>
2406
- <documentation>
2407
- This element contains information about the
2408
- paymentAdditional
2409
- </documentation>
2410
- </annotation>
2411
- <sequence>
2412
- <element name="transaction" nillable="false" type="tns1:transaction"/>
2413
- <element name="payment" nillable="false" type="tns1:payment"/>
2414
- <element name="authorization" nillable="false" type="tns1:authorization"/>
2415
- <element minOccurs="0" name="authentication3DSecure" nillable="true" type="tns1:authentication3DSecure"/>
2416
- <element minOccurs="0" name="card" nillable="true" type="tns1:cardOut"/>
2417
- <element minOccurs="0" name="extendedCard" nillable="true" type="tns1:extendedCardType"/>
2418
- </sequence>
2419
- </complexType>
2420
-
2421
- <complexType name="paymentAdditionalList">
2422
- <annotation>
2423
- <documentation>
2424
- An array of paymentAdditionalList
2425
- </documentation>
2426
- </annotation>
2427
- <sequence>
2428
- <element maxOccurs="100" minOccurs="0" name="paymentAdditional" type="tns1:paymentAdditional"/>
2429
- </sequence>
2430
- </complexType>
2431
-
2432
- <complexType name="CustomerTransHist">
2433
- <annotation>
2434
- <documentation>
2435
- An array of CustomerTrans
2436
- </documentation>
2437
- </annotation>
2438
- <sequence>
2439
- <element maxOccurs="unbounded" minOccurs="0" name="CustomerTrans" type="tns1:CustomerTrans">
2440
- </element>
2441
- </sequence>
2442
- </complexType>
2443
- <complexType name="CustomerTrans">
2444
- <sequence>
2445
- <element maxOccurs="1" minOccurs="1" name="IsLCLFAlerted" nillable="false" type="xsd:string">
2446
- </element>
2447
- <element maxOccurs="1" minOccurs="1" name="ExternalTransactionId" nillable="false" type="xsd:string">
2448
- </element>
2449
- <element maxOccurs="1" minOccurs="1" name="ReferenceOrder" nillable="false" type="xsd:string">
2450
- </element>
2451
- <element maxOccurs="1" minOccurs="1" name="CardCode" nillable="false" type="xsd:string">
2452
- </element>
2453
- <element maxOccurs="1" minOccurs="1" name="TransactionDate" nillable="false" type="xsd:string">
2454
- </element>
2455
- <element maxOccurs="1" minOccurs="1" name="Amount" nillable="false" type="xsd:string">
2456
- </element>
2457
- <element maxOccurs="1" minOccurs="1" name="Status" nillable="false" type="xsd:string">
2458
- </element>
2459
- <element maxOccurs="1" minOccurs="1" name="PosLabel" nillable="false" type="xsd:string">
2460
- </element>
2461
- </sequence>
2462
- </complexType>
2463
-
2464
- <complexType name="PaymentMeansTransHist">
2465
- <annotation>
2466
- <documentation>
2467
- An array of PaymentMeansTrans
2468
- </documentation>
2469
- </annotation>
2470
- <sequence>
2471
- <element maxOccurs="unbounded" minOccurs="0" name="PaymentMeansTrans" type="tns1:PaymentMeansTrans">
2472
- </element>
2473
- </sequence>
2474
- </complexType>
2475
- <complexType name="PaymentMeansTrans">
2476
- <sequence>
2477
- <element maxOccurs="1" minOccurs="1" name="IsLCLFAlerted" nillable="false" type="xsd:string">
2478
- </element>
2479
- <element maxOccurs="1" minOccurs="1" name="ExternalTransactionId" nillable="false" type="xsd:string">
2480
- </element>
2481
- <element maxOccurs="1" minOccurs="1" name="ReferenceOrder" nillable="false" type="xsd:string">
2482
- </element>
2483
- <element maxOccurs="1" minOccurs="0" name="CustomerData" nillable="true" type="xsd:string">
2484
- </element>
2485
- <element maxOccurs="1" minOccurs="1" name="TransactionDate" nillable="false" type="xsd:string">
2486
- </element>
2487
- <element maxOccurs="1" minOccurs="1" name="Amount" nillable="false" type="xsd:string">
2488
- </element>
2489
- <element maxOccurs="1" minOccurs="1" name="Status" nillable="false" type="xsd:string">
2490
- </element>
2491
- <element maxOccurs="1" minOccurs="1" name="PosLabel" nillable="false" type="xsd:string">
2492
- </element>
2493
- </sequence>
2494
- </complexType>
2495
-
2496
- <complexType name="AlertsTransHist">
2497
- <annotation>
2498
- <documentation>
2499
- An array of AlertsTrans
2500
- </documentation>
2501
- </annotation>
2502
- <sequence>
2503
- <element maxOccurs="unbounded" minOccurs="0" name="AlertsTrans" type="tns1:AlertsTrans">
2504
- </element>
2505
- </sequence>
2506
- </complexType>
2507
- <complexType name="AlertsTrans">
2508
- <sequence>
2509
- <element maxOccurs="1" minOccurs="1" name="AlertId" nillable="false" type="xsd:string">
2510
- </element>
2511
- <element maxOccurs="1" minOccurs="1" name="ExplanationLabel" nillable="false" type="xsd:string">
2512
- </element>
2513
- <element maxOccurs="1" minOccurs="1" name="ExplanationCode" nillable="false" type="xsd:string">
2514
- </element>
2515
- <element maxOccurs="1" minOccurs="1" name="RuleName" nillable="false" type="xsd:string">
2516
- </element>
2517
- <element maxOccurs="1" minOccurs="0" name="RuleAction" nillable="true" type="xsd:string">
2518
- </element>
2519
- <element maxOccurs="1" minOccurs="0" name="RuleCriteria" nillable="true" type="xsd:string">
2520
- </element>
2521
- </sequence>
2522
- </complexType>
2523
-
2524
- </schema>
2525
- </wsdl:types>
2526
- <wsdl:message name="getTransactionDetailsRequest">
2527
- <wsdl:part name="parameters" element="impl:getTransactionDetailsRequest">
2528
- </wsdl:part>
2529
- </wsdl:message>
2530
- <wsdl:message name="doScheduledWalletPaymentRequest">
2531
- <wsdl:part name="parameters" element="impl:doScheduledWalletPaymentRequest">
2532
- </wsdl:part>
2533
- </wsdl:message>
2534
- <wsdl:message name="doDebitRequest">
2535
- <wsdl:part name="parameters" element="impl:doDebitRequest">
2536
- </wsdl:part>
2537
- </wsdl:message>
2538
- <wsdl:message name="doScheduledWalletPaymentResponse">
2539
- <wsdl:part name="parameters" element="impl:doScheduledWalletPaymentResponse">
2540
- </wsdl:part>
2541
- </wsdl:message>
2542
- <wsdl:message name="doCaptureResponse">
2543
- <wsdl:part name="parameters" element="impl:doCaptureResponse">
2544
- </wsdl:part>
2545
- </wsdl:message>
2546
- <wsdl:message name="doRecurrentWalletPaymentRequest">
2547
- <wsdl:part name="parameters" element="impl:doRecurrentWalletPaymentRequest">
2548
- </wsdl:part>
2549
- </wsdl:message>
2550
- <wsdl:message name="getWalletRequest">
2551
- <wsdl:part name="parameters" element="impl:getWalletRequest">
2552
- </wsdl:part>
2553
- </wsdl:message>
2554
- <wsdl:message name="doAuthorizationResponse">
2555
- <wsdl:part name="parameters" element="impl:doAuthorizationResponse">
2556
- </wsdl:part>
2557
- </wsdl:message>
2558
- <wsdl:message name="getCardsResponse">
2559
- <wsdl:part name="parameters" element="impl:getCardsResponse">
2560
- </wsdl:part>
2561
- </wsdl:message>
2562
- <wsdl:message name="createWebWalletRequest">
2563
- <wsdl:part name="parameters" element="impl:createWebWalletRequest">
2564
- </wsdl:part>
2565
- </wsdl:message>
2566
- <wsdl:message name="getBalanceResponse">
2567
- <wsdl:part name="parameters" element="impl:getBalanceResponse">
2568
- </wsdl:part>
2569
- </wsdl:message>
2570
- <wsdl:message name="verifyAuthenticationRequest">
2571
- <wsdl:part name="parameters" element="impl:verifyAuthenticationRequest">
2572
- </wsdl:part>
2573
- </wsdl:message>
2574
- <wsdl:message name="verifyEnrollmentRequest">
2575
- <wsdl:part name="parameters" element="impl:verifyEnrollmentRequest">
2576
- </wsdl:part>
2577
- </wsdl:message>
2578
- <wsdl:message name="getWebWalletRequest">
2579
- <wsdl:part name="parameters" element="impl:getWebWalletRequest">
2580
- </wsdl:part>
2581
- </wsdl:message>
2582
- <wsdl:message name="verifyAuthenticationResponse">
2583
- <wsdl:part name="parameters" element="impl:verifyAuthenticationResponse">
2584
- </wsdl:part>
2585
- </wsdl:message>
2586
- <wsdl:message name="doScoringChequeRequest">
2587
- <wsdl:part name="parameters" element="impl:doScoringChequeRequest">
2588
- </wsdl:part>
2589
- </wsdl:message>
2590
- <wsdl:message name="doRefundRequest">
2591
- <wsdl:part name="parameters" element="impl:doRefundRequest">
2592
- </wsdl:part>
2593
- </wsdl:message>
2594
- <wsdl:message name="getWebWalletResponse">
2595
- <wsdl:part name="parameters" element="impl:getWebWalletResponse">
2596
- </wsdl:part>
2597
- </wsdl:message>
2598
- <wsdl:message name="getAlertDetailsRequest">
2599
- <wsdl:part name="parameters" element="impl:getAlertDetailsRequest">
2600
- </wsdl:part>
2601
- </wsdl:message>
2602
- <wsdl:message name="getBalanceRequest">
2603
- <wsdl:part name="parameters" element="impl:getBalanceRequest">
2604
- </wsdl:part>
2605
- </wsdl:message>
2606
- <wsdl:message name="updateWalletRequest">
2607
- <wsdl:part name="parameters" element="impl:updateWalletRequest">
2608
- </wsdl:part>
2609
- </wsdl:message>
2610
- <wsdl:message name="doScoringChequeResponse">
2611
- <wsdl:part name="parameters" element="impl:doScoringChequeResponse">
2612
- </wsdl:part>
2613
- </wsdl:message>
2614
- <wsdl:message name="getBillingRecordResponse">
2615
- <wsdl:part name="parameters" element="impl:getBillingRecordResponse">
2616
- </wsdl:part>
2617
- </wsdl:message>
2618
- <wsdl:message name="getPaymentRecordRequest">
2619
- <wsdl:part name="parameters" element="impl:getPaymentRecordRequest">
2620
- </wsdl:part>
2621
- </wsdl:message>
2622
- <wsdl:message name="updateWebWalletRequest">
2623
- <wsdl:part name="parameters" element="impl:updateWebWalletRequest">
2624
- </wsdl:part>
2625
- </wsdl:message>
2626
- <wsdl:message name="unBlockRequest">
2627
- <wsdl:part name="parameters" element="impl:unBlockRequest">
2628
- </wsdl:part>
2629
- </wsdl:message>
2630
- <wsdl:message name="enableWalletRequest">
2631
- <wsdl:part name="parameters" element="impl:enableWalletRequest">
2632
- </wsdl:part>
2633
- </wsdl:message>
2634
- <wsdl:message name="doImmediateWalletPaymentRequest">
2635
- <wsdl:part name="parameters" element="impl:doImmediateWalletPaymentRequest">
2636
- </wsdl:part>
2637
- </wsdl:message>
2638
- <wsdl:message name="updateWalletResponse">
2639
- <wsdl:part name="parameters" element="impl:updateWalletResponse">
2640
- </wsdl:part>
2641
- </wsdl:message>
2642
- <wsdl:message name="doImmediateWalletPaymentResponse">
2643
- <wsdl:part name="parameters" element="impl:doImmediateWalletPaymentResponse">
2644
- </wsdl:part>
2645
- </wsdl:message>
2646
- <wsdl:message name="doAuthorizationRequest">
2647
- <wsdl:part name="parameters" element="impl:doAuthorizationRequest">
2648
- </wsdl:part>
2649
- </wsdl:message>
2650
- <wsdl:message name="doWebPaymentRequest">
2651
- <wsdl:part name="parameters" element="impl:doWebPaymentRequest">
2652
- </wsdl:part>
2653
- </wsdl:message>
2654
- <wsdl:message name="getWalletResponse">
2655
- <wsdl:part name="parameters" element="impl:getWalletResponse">
2656
- </wsdl:part>
2657
- </wsdl:message>
2658
- <wsdl:message name="doDebitResponse">
2659
- <wsdl:part name="parameters" element="impl:doDebitResponse">
2660
- </wsdl:part>
2661
- </wsdl:message>
2662
- <wsdl:message name="updateBillingRecordResponse">
2663
- <wsdl:part name="parameters" element="impl:updateBillingRecordResponse">
2664
- </wsdl:part>
2665
- </wsdl:message>
2666
- <wsdl:message name="disableWalletRequest">
2667
- <wsdl:part name="parameters" element="impl:disableWalletRequest">
2668
- </wsdl:part>
2669
- </wsdl:message>
2670
- <wsdl:message name="createMerchantRequest">
2671
- <wsdl:part name="parameters" element="impl:createMerchantRequest">
2672
- </wsdl:part>
2673
- </wsdl:message>
2674
- <wsdl:message name="getEncryptionKeyResponse">
2675
- <wsdl:part name="parameters" element="impl:getEncryptionKeyResponse">
2676
- </wsdl:part>
2677
- </wsdl:message>
2678
- <wsdl:message name="createMerchantResponse">
2679
- <wsdl:part name="parameters" element="impl:createMerchantResponse">
2680
- </wsdl:part>
2681
- </wsdl:message>
2682
- <wsdl:message name="getMerchantSettingsRequest">
2683
- <wsdl:part name="parameters" element="impl:getMerchantSettingsRequest">
2684
- </wsdl:part>
2685
- </wsdl:message>
2686
- <wsdl:message name="disableWalletResponse">
2687
- <wsdl:part name="parameters" element="impl:disableWalletResponse">
2688
- </wsdl:part>
2689
- </wsdl:message>
2690
- <wsdl:message name="doRecurrentWalletPaymentResponse">
2691
- <wsdl:part name="parameters" element="impl:doRecurrentWalletPaymentResponse">
2692
- </wsdl:part>
2693
- </wsdl:message>
2694
- <wsdl:message name="createWalletResponse">
2695
- <wsdl:part name="parameters" element="impl:createWalletResponse">
2696
- </wsdl:part>
2697
- </wsdl:message>
2698
- <wsdl:message name="manageWebWalletRequest">
2699
- <wsdl:part name="parameters" element="impl:manageWebWalletRequest">
2700
- </wsdl:part>
2701
- </wsdl:message>
2702
- <wsdl:message name="doCreditResponse">
2703
- <wsdl:part name="parameters" element="impl:doCreditResponse">
2704
- </wsdl:part>
2705
- </wsdl:message>
2706
- <wsdl:message name="getPaymentRecordResponse">
2707
- <wsdl:part name="parameters" element="impl:getPaymentRecordResponse">
2708
- </wsdl:part>
2709
- </wsdl:message>
2710
- <wsdl:message name="transactionsSearchRequest">
2711
- <wsdl:part name="parameters" element="impl:transactionsSearchRequest">
2712
- </wsdl:part>
2713
- </wsdl:message>
2714
- <wsdl:message name="updateBillingRecordRequest">
2715
- <wsdl:part name="parameters" element="impl:updateBillingRecordRequest">
2716
- </wsdl:part>
2717
- </wsdl:message>
2718
- <wsdl:message name="getTokenResponse">
2719
- <wsdl:part name="parameters" element="impl:getTokenResponse">
2720
- </wsdl:part>
2721
- </wsdl:message>
2722
- <wsdl:message name="getWebPaymentDetailsResponse">
2723
- <wsdl:part name="parameters" element="impl:getWebPaymentDetailsResponse">
2724
- </wsdl:part>
2725
- </wsdl:message>
2726
- <wsdl:message name="verifyEnrollmentResponse">
2727
- <wsdl:part name="parameters" element="impl:verifyEnrollmentResponse">
2728
- </wsdl:part>
2729
- </wsdl:message>
2730
- <wsdl:message name="updatePaymentRecordRequest">
2731
- <wsdl:part name="parameters" element="impl:updatePaymentRecordRequest">
2732
- </wsdl:part>
2733
- </wsdl:message>
2734
- <wsdl:message name="doReAuthorizationRequest">
2735
- <wsdl:part name="parameters" element="impl:doReAuthorizationRequest">
2736
- </wsdl:part>
2737
- </wsdl:message>
2738
- <wsdl:message name="createWalletRequest">
2739
- <wsdl:part name="parameters" element="impl:createWalletRequest">
2740
- </wsdl:part>
2741
- </wsdl:message>
2742
- <wsdl:message name="getEncryptionKeyRequest">
2743
- <wsdl:part name="parameters" element="impl:getEncryptionKeyRequest">
2744
- </wsdl:part>
2745
- </wsdl:message>
2746
- <wsdl:message name="doResetResponse">
2747
- <wsdl:part name="parameters" element="impl:doResetResponse">
2748
- </wsdl:part>
2749
- </wsdl:message>
2750
- <wsdl:message name="manageWebWalletResponse">
2751
- <wsdl:part name="parameters" element="impl:manageWebWalletResponse">
2752
- </wsdl:part>
2753
- </wsdl:message>
2754
- <wsdl:message name="createWebWalletResponse">
2755
- <wsdl:part name="parameters" element="impl:createWebWalletResponse">
2756
- </wsdl:part>
2757
- </wsdl:message>
2758
- <wsdl:message name="unBlockResponse">
2759
- <wsdl:part name="parameters" element="impl:unBlockResponse">
2760
- </wsdl:part>
2761
- </wsdl:message>
2762
- <wsdl:message name="doReAuthorizationResponse">
2763
- <wsdl:part name="parameters" element="impl:doReAuthorizationResponse">
2764
- </wsdl:part>
2765
- </wsdl:message>
2766
- <wsdl:message name="doCreditRequest">
2767
- <wsdl:part name="parameters" element="impl:doCreditRequest">
2768
- </wsdl:part>
2769
- </wsdl:message>
2770
- <wsdl:message name="getTokenRequest">
2771
- <wsdl:part name="parameters" element="impl:getTokenRequest">
2772
- </wsdl:part>
2773
- </wsdl:message>
2774
- <wsdl:message name="doRefundResponse">
2775
- <wsdl:part name="parameters" element="impl:doRefundResponse">
2776
- </wsdl:part>
2777
- </wsdl:message>
2778
- <wsdl:message name="getTransactionDetailsResponse">
2779
- <wsdl:part name="parameters" element="impl:getTransactionDetailsResponse">
2780
- </wsdl:part>
2781
- </wsdl:message>
2782
- <wsdl:message name="getAlertDetailsResponse">
2783
- <wsdl:part name="parameters" element="impl:getAlertDetailsResponse">
2784
- </wsdl:part>
2785
- </wsdl:message>
2786
- <wsdl:message name="doCaptureRequest">
2787
- <wsdl:part name="parameters" element="impl:doCaptureRequest">
2788
- </wsdl:part>
2789
- </wsdl:message>
2790
- <wsdl:message name="getBillingRecordRequest">
2791
- <wsdl:part name="parameters" element="impl:getBillingRecordRequest">
2792
- </wsdl:part>
2793
- </wsdl:message>
2794
- <wsdl:message name="disablePaymentRecordRequest">
2795
- <wsdl:part name="parameters" element="impl:disablePaymentRecordRequest">
2796
- </wsdl:part>
2797
- </wsdl:message>
2798
- <wsdl:message name="updateWebWalletResponse">
2799
- <wsdl:part name="parameters" element="impl:updateWebWalletResponse">
2800
- </wsdl:part>
2801
- </wsdl:message>
2802
- <wsdl:message name="updatePaymentRecordResponse">
2803
- <wsdl:part name="parameters" element="impl:updatePaymentRecordResponse">
2804
- </wsdl:part>
2805
- </wsdl:message>
2806
- <wsdl:message name="doWebPaymentResponse">
2807
- <wsdl:part name="parameters" element="impl:doWebPaymentResponse">
2808
- </wsdl:part>
2809
- </wsdl:message>
2810
- <wsdl:message name="getWebPaymentDetailsRequest">
2811
- <wsdl:part name="parameters" element="impl:getWebPaymentDetailsRequest">
2812
- </wsdl:part>
2813
- </wsdl:message>
2814
- <wsdl:message name="doResetRequest">
2815
- <wsdl:part name="parameters" element="impl:doResetRequest">
2816
- </wsdl:part>
2817
- </wsdl:message>
2818
- <wsdl:message name="enableWalletResponse">
2819
- <wsdl:part name="parameters" element="impl:enableWalletResponse">
2820
- </wsdl:part>
2821
- </wsdl:message>
2822
- <wsdl:message name="getMerchantSettingsResponse">
2823
- <wsdl:part name="parameters" element="impl:getMerchantSettingsResponse">
2824
- </wsdl:part>
2825
- </wsdl:message>
2826
- <wsdl:message name="disablePaymentRecordResponse">
2827
- <wsdl:part name="parameters" element="impl:disablePaymentRecordResponse">
2828
- </wsdl:part>
2829
- </wsdl:message>
2830
- <wsdl:message name="transactionsSearchResponse">
2831
- <wsdl:part name="parameters" element="impl:transactionsSearchResponse">
2832
- </wsdl:part>
2833
- </wsdl:message>
2834
- <wsdl:message name="getCardsRequest">
2835
- <wsdl:part name="parameters" element="impl:getCardsRequest">
2836
- </wsdl:part>
2837
- </wsdl:message>
2838
- <wsdl:portType name="WebPaymentAPI">
2839
- <wsdl:operation name="doWebPayment">
2840
- <wsdl:input name="doWebPaymentRequest" message="impl:doWebPaymentRequest">
2841
- </wsdl:input>
2842
- <wsdl:output name="doWebPaymentResponse" message="impl:doWebPaymentResponse">
2843
- </wsdl:output>
2844
- </wsdl:operation>
2845
- <wsdl:operation name="getWebPaymentDetails">
2846
- <wsdl:input name="getWebPaymentDetailsRequest" message="impl:getWebPaymentDetailsRequest">
2847
- </wsdl:input>
2848
- <wsdl:output name="getWebPaymentDetailsResponse" message="impl:getWebPaymentDetailsResponse">
2849
- </wsdl:output>
2850
- </wsdl:operation>
2851
- <wsdl:operation name="manageWebWallet">
2852
- <wsdl:input name="manageWebWalletRequest" message="impl:manageWebWalletRequest">
2853
- </wsdl:input>
2854
- <wsdl:output name="manageWebWalletResponse" message="impl:manageWebWalletResponse">
2855
- </wsdl:output>
2856
- </wsdl:operation>
2857
- <wsdl:operation name="createWebWallet">
2858
- <wsdl:input name="createWebWalletRequest" message="impl:createWebWalletRequest">
2859
- </wsdl:input>
2860
- <wsdl:output name="createWebWalletResponse" message="impl:createWebWalletResponse">
2861
- </wsdl:output>
2862
- </wsdl:operation>
2863
- <wsdl:operation name="updateWebWallet">
2864
- <wsdl:input name="updateWebWalletRequest" message="impl:updateWebWalletRequest">
2865
- </wsdl:input>
2866
- <wsdl:output name="updateWebWalletResponse" message="impl:updateWebWalletResponse">
2867
- </wsdl:output>
2868
- </wsdl:operation>
2869
- <wsdl:operation name="getWebWallet">
2870
- <wsdl:input name="getWebWalletRequest" message="impl:getWebWalletRequest">
2871
- </wsdl:input>
2872
- <wsdl:output name="getWebWalletResponse" message="impl:getWebWalletResponse">
2873
- </wsdl:output>
2874
- </wsdl:operation>
2875
- </wsdl:portType>
2876
- <wsdl:portType name="DirectPaymentAPI">
2877
- <wsdl:operation name="doAuthorization">
2878
- <wsdl:input name="doAuthorizationRequest" message="impl:doAuthorizationRequest">
2879
- </wsdl:input>
2880
- <wsdl:output name="doAuthorizationResponse" message="impl:doAuthorizationResponse">
2881
- </wsdl:output>
2882
- </wsdl:operation>
2883
- <wsdl:operation name="doCapture">
2884
- <wsdl:input name="doCaptureRequest" message="impl:doCaptureRequest">
2885
- </wsdl:input>
2886
- <wsdl:output name="doCaptureResponse" message="impl:doCaptureResponse">
2887
- </wsdl:output>
2888
- </wsdl:operation>
2889
- <wsdl:operation name="doReAuthorization">
2890
- <wsdl:input name="doReAuthorizationRequest" message="impl:doReAuthorizationRequest">
2891
- </wsdl:input>
2892
- <wsdl:output name="doReAuthorizationResponse" message="impl:doReAuthorizationResponse">
2893
- </wsdl:output>
2894
- </wsdl:operation>
2895
- <wsdl:operation name="doDebit">
2896
- <wsdl:input name="doDebitRequest" message="impl:doDebitRequest">
2897
- </wsdl:input>
2898
- <wsdl:output name="doDebitResponse" message="impl:doDebitResponse">
2899
- </wsdl:output>
2900
- </wsdl:operation>
2901
- <wsdl:operation name="doRefund">
2902
- <wsdl:input name="doRefundRequest" message="impl:doRefundRequest">
2903
- </wsdl:input>
2904
- <wsdl:output name="doRefundResponse" message="impl:doRefundResponse">
2905
- </wsdl:output>
2906
- </wsdl:operation>
2907
- <wsdl:operation name="doReset">
2908
- <wsdl:input name="doResetRequest" message="impl:doResetRequest">
2909
- </wsdl:input>
2910
- <wsdl:output name="doResetResponse" message="impl:doResetResponse">
2911
- </wsdl:output>
2912
- </wsdl:operation>
2913
- <wsdl:operation name="doCredit">
2914
- <wsdl:input name="doCreditRequest" message="impl:doCreditRequest">
2915
- </wsdl:input>
2916
- <wsdl:output name="doCreditResponse" message="impl:doCreditResponse">
2917
- </wsdl:output>
2918
- </wsdl:operation>
2919
- <wsdl:operation name="createWallet">
2920
- <wsdl:input name="createWalletRequest" message="impl:createWalletRequest">
2921
- </wsdl:input>
2922
- <wsdl:output name="createWalletResponse" message="impl:createWalletResponse">
2923
- </wsdl:output>
2924
- </wsdl:operation>
2925
- <wsdl:operation name="updateWallet">
2926
- <wsdl:input name="updateWalletRequest" message="impl:updateWalletRequest">
2927
- </wsdl:input>
2928
- <wsdl:output name="updateWalletResponse" message="impl:updateWalletResponse">
2929
- </wsdl:output>
2930
- </wsdl:operation>
2931
- <wsdl:operation name="getWallet">
2932
- <wsdl:input name="getWalletRequest" message="impl:getWalletRequest">
2933
- </wsdl:input>
2934
- <wsdl:output name="getWalletResponse" message="impl:getWalletResponse">
2935
- </wsdl:output>
2936
- </wsdl:operation>
2937
- <wsdl:operation name="getCards">
2938
- <wsdl:input name="getCardsRequest" message="impl:getCardsRequest">
2939
- </wsdl:input>
2940
- <wsdl:output name="getCardsResponse" message="impl:getCardsResponse">
2941
- </wsdl:output>
2942
- </wsdl:operation>
2943
- <wsdl:operation name="disableWallet">
2944
- <wsdl:input name="disableWalletRequest" message="impl:disableWalletRequest">
2945
- </wsdl:input>
2946
- <wsdl:output name="disableWalletResponse" message="impl:disableWalletResponse">
2947
- </wsdl:output>
2948
- </wsdl:operation>
2949
- <wsdl:operation name="enableWallet">
2950
- <wsdl:input name="enableWalletRequest" message="impl:enableWalletRequest">
2951
- </wsdl:input>
2952
- <wsdl:output name="enableWalletResponse" message="impl:enableWalletResponse">
2953
- </wsdl:output>
2954
- </wsdl:operation>
2955
- <wsdl:operation name="doImmediateWalletPayment">
2956
- <wsdl:input name="doImmediateWalletPaymentRequest" message="impl:doImmediateWalletPaymentRequest">
2957
- </wsdl:input>
2958
- <wsdl:output name="doImmediateWalletPaymentResponse" message="impl:doImmediateWalletPaymentResponse">
2959
- </wsdl:output>
2960
- </wsdl:operation>
2961
- <wsdl:operation name="doScheduledWalletPayment">
2962
- <wsdl:input name="doScheduledWalletPaymentRequest" message="impl:doScheduledWalletPaymentRequest">
2963
- </wsdl:input>
2964
- <wsdl:output name="doScheduledWalletPaymentResponse" message="impl:doScheduledWalletPaymentResponse">
2965
- </wsdl:output>
2966
- </wsdl:operation>
2967
- <wsdl:operation name="doRecurrentWalletPayment">
2968
- <wsdl:input name="doRecurrentWalletPaymentRequest" message="impl:doRecurrentWalletPaymentRequest">
2969
- </wsdl:input>
2970
- <wsdl:output name="doRecurrentWalletPaymentResponse" message="impl:doRecurrentWalletPaymentResponse">
2971
- </wsdl:output>
2972
- </wsdl:operation>
2973
- <wsdl:operation name="getPaymentRecord">
2974
- <wsdl:input name="getPaymentRecordRequest" message="impl:getPaymentRecordRequest">
2975
- </wsdl:input>
2976
- <wsdl:output name="getPaymentRecordResponse" message="impl:getPaymentRecordResponse">
2977
- </wsdl:output>
2978
- </wsdl:operation>
2979
- <wsdl:operation name="disablePaymentRecord">
2980
- <wsdl:input name="disablePaymentRecordRequest" message="impl:disablePaymentRecordRequest">
2981
- </wsdl:input>
2982
- <wsdl:output name="disablePaymentRecordResponse" message="impl:disablePaymentRecordResponse">
2983
- </wsdl:output>
2984
- </wsdl:operation>
2985
- <wsdl:operation name="verifyEnrollment">
2986
- <wsdl:input name="verifyEnrollmentRequest" message="impl:verifyEnrollmentRequest">
2987
- </wsdl:input>
2988
- <wsdl:output name="verifyEnrollmentResponse" message="impl:verifyEnrollmentResponse">
2989
- </wsdl:output>
2990
- </wsdl:operation>
2991
- <wsdl:operation name="verifyAuthentication">
2992
- <wsdl:input name="verifyAuthenticationRequest" message="impl:verifyAuthenticationRequest">
2993
- </wsdl:input>
2994
- <wsdl:output name="verifyAuthenticationResponse" message="impl:verifyAuthenticationResponse">
2995
- </wsdl:output>
2996
- </wsdl:operation>
2997
- <wsdl:operation name="createMerchant">
2998
- <wsdl:input name="createMerchantRequest" message="impl:createMerchantRequest">
2999
- </wsdl:input>
3000
- <wsdl:output name="createMerchantResponse" message="impl:createMerchantResponse">
3001
- </wsdl:output>
3002
- </wsdl:operation>
3003
- <wsdl:operation name="doScoringCheque">
3004
- <wsdl:input name="doScoringChequeRequest" message="impl:doScoringChequeRequest">
3005
- </wsdl:input>
3006
- <wsdl:output name="doScoringChequeResponse" message="impl:doScoringChequeResponse">
3007
- </wsdl:output>
3008
- </wsdl:operation>
3009
- <wsdl:operation name="getEncryptionKey">
3010
- <wsdl:input name="getEncryptionKeyRequest" message="impl:getEncryptionKeyRequest">
3011
- </wsdl:input>
3012
- <wsdl:output name="getEncryptionKeyResponse" message="impl:getEncryptionKeyResponse">
3013
- </wsdl:output>
3014
- </wsdl:operation>
3015
- <wsdl:operation name="getMerchantSettings">
3016
- <wsdl:input name="getMerchantSettingsRequest" message="impl:getMerchantSettingsRequest">
3017
- </wsdl:input>
3018
- <wsdl:output name="getMerchantSettingsResponse" message="impl:getMerchantSettingsResponse">
3019
- </wsdl:output>
3020
- </wsdl:operation>
3021
- <wsdl:operation name="getBalance">
3022
- <wsdl:input name="getBalanceRequest" message="impl:getBalanceRequest">
3023
- </wsdl:input>
3024
- <wsdl:output name="getBalanceResponse" message="impl:getBalanceResponse">
3025
- </wsdl:output>
3026
- </wsdl:operation>
3027
- <wsdl:operation name="getToken">
3028
- <wsdl:input message="impl:getTokenRequest">
3029
- </wsdl:input>
3030
- <wsdl:output message="impl:getTokenResponse">
3031
- </wsdl:output>
3032
- </wsdl:operation>
3033
- <wsdl:operation name="unBlock">
3034
- <wsdl:input name="unBlockRequest" message="impl:unBlockRequest">
3035
- </wsdl:input>
3036
- <wsdl:output name="unBlockResponse" message="impl:unBlockResponse">
3037
- </wsdl:output>
3038
- </wsdl:operation>
3039
- <wsdl:operation name="updatePaymentRecord">
3040
- <wsdl:input name="updatePaymentRecordRequest" message="impl:updatePaymentRecordRequest">
3041
- </wsdl:input>
3042
- <wsdl:output name="updatePaymentRecordResponse" message="impl:updatePaymentRecordResponse">
3043
- </wsdl:output>
3044
- </wsdl:operation>
3045
- <wsdl:operation name="getBillingRecord">
3046
- <wsdl:input name="getBillingRecordRequest" message="impl:getBillingRecordRequest">
3047
- </wsdl:input>
3048
- <wsdl:output name="getBillingRecordResponse" message="impl:getBillingRecordResponse">
3049
- </wsdl:output>
3050
- </wsdl:operation>
3051
- <wsdl:operation name="updateBillingRecord">
3052
- <wsdl:input name="updateBillingRecordRequest" message="impl:updateBillingRecordRequest">
3053
- </wsdl:input>
3054
- <wsdl:output name="updateBillingRecordResponse" message="impl:updateBillingRecordResponse">
3055
- </wsdl:output>
3056
- </wsdl:operation>
3057
- </wsdl:portType>
3058
- <wsdl:portType name="ExtendedAPI">
3059
- <wsdl:operation name="getTransactionDetails">
3060
- <wsdl:input name="getTransactionDetailsRequest" message="impl:getTransactionDetailsRequest">
3061
- </wsdl:input>
3062
- <wsdl:output name="getTransactionDetailsResponse" message="impl:getTransactionDetailsResponse">
3063
- </wsdl:output>
3064
- </wsdl:operation>
3065
- <wsdl:operation name="transactionsSearch">
3066
- <wsdl:input name="transactionsSearchRequest" message="impl:transactionsSearchRequest">
3067
- </wsdl:input>
3068
- <wsdl:output name="transactionsSearchResponse" message="impl:transactionsSearchResponse">
3069
- </wsdl:output>
3070
- </wsdl:operation>
3071
- <wsdl:operation name="getAlertDetails">
3072
- <wsdl:input message="impl:getAlertDetailsRequest">
3073
- </wsdl:input>
3074
- <wsdl:output message="impl:getAlertDetailsResponse">
3075
- </wsdl:output>
3076
- </wsdl:operation>
3077
- </wsdl:portType>
3078
- <wsdl:binding name="DirectPaymentAPISoapBinding" type="impl:DirectPaymentAPI">
3079
- <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
3080
- <wsdl:operation name="doAuthorization">
3081
- <wsdlsoap:operation soapAction="doAuthorization"/>
3082
- <wsdl:input>
3083
- <wsdlsoap:body use="literal"/>
3084
- </wsdl:input>
3085
- <wsdl:output>
3086
- <wsdlsoap:body use="literal"/>
3087
- </wsdl:output>
3088
- </wsdl:operation>
3089
- <wsdl:operation name="doCapture">
3090
- <wsdlsoap:operation soapAction="doCapture"/>
3091
- <wsdl:input>
3092
- <wsdlsoap:body use="literal"/>
3093
- </wsdl:input>
3094
- <wsdl:output>
3095
- <wsdlsoap:body use="literal"/>
3096
- </wsdl:output>
3097
- </wsdl:operation>
3098
- <wsdl:operation name="doReAuthorization">
3099
- <wsdlsoap:operation soapAction="doReAuthorization"/>
3100
- <wsdl:input>
3101
- <wsdlsoap:body use="literal"/>
3102
- </wsdl:input>
3103
- <wsdl:output>
3104
- <wsdlsoap:body use="literal"/>
3105
- </wsdl:output>
3106
- </wsdl:operation>
3107
- <wsdl:operation name="doDebit">
3108
- <wsdlsoap:operation soapAction="doDebit"/>
3109
- <wsdl:input>
3110
- <wsdlsoap:body use="literal"/>
3111
- </wsdl:input>
3112
- <wsdl:output>
3113
- <wsdlsoap:body use="literal"/>
3114
- </wsdl:output>
3115
- </wsdl:operation>
3116
- <wsdl:operation name="doRefund">
3117
- <wsdlsoap:operation soapAction="doRefund"/>
3118
- <wsdl:input>
3119
- <wsdlsoap:body use="literal"/>
3120
- </wsdl:input>
3121
- <wsdl:output>
3122
- <wsdlsoap:body use="literal"/>
3123
- </wsdl:output>
3124
- </wsdl:operation>
3125
- <wsdl:operation name="doReset">
3126
- <wsdlsoap:operation soapAction="doReset"/>
3127
- <wsdl:input>
3128
- <wsdlsoap:body use="literal"/>
3129
- </wsdl:input>
3130
- <wsdl:output>
3131
- <wsdlsoap:body use="literal"/>
3132
- </wsdl:output>
3133
- </wsdl:operation>
3134
- <wsdl:operation name="doCredit">
3135
- <wsdlsoap:operation soapAction="doCredit"/>
3136
- <wsdl:input>
3137
- <wsdlsoap:body use="literal"/>
3138
- </wsdl:input>
3139
- <wsdl:output>
3140
- <wsdlsoap:body use="literal"/>
3141
- </wsdl:output>
3142
- </wsdl:operation>
3143
- <wsdl:operation name="createWallet">
3144
- <wsdlsoap:operation soapAction="createWallet"/>
3145
- <wsdl:input>
3146
- <wsdlsoap:body use="literal"/>
3147
- </wsdl:input>
3148
- <wsdl:output>
3149
- <wsdlsoap:body use="literal"/>
3150
- </wsdl:output>
3151
- </wsdl:operation>
3152
- <wsdl:operation name="updateWallet">
3153
- <wsdlsoap:operation soapAction="updateWallet"/>
3154
- <wsdl:input>
3155
- <wsdlsoap:body use="literal"/>
3156
- </wsdl:input>
3157
- <wsdl:output>
3158
- <wsdlsoap:body use="literal"/>
3159
- </wsdl:output>
3160
- </wsdl:operation>
3161
- <wsdl:operation name="getWallet">
3162
- <wsdlsoap:operation soapAction="getWallet"/>
3163
- <wsdl:input>
3164
- <wsdlsoap:body use="literal"/>
3165
- </wsdl:input>
3166
- <wsdl:output>
3167
- <wsdlsoap:body use="literal"/>
3168
- </wsdl:output>
3169
- </wsdl:operation>
3170
- <wsdl:operation name="getCards">
3171
- <wsdlsoap:operation soapAction="getCards"/>
3172
- <wsdl:input>
3173
- <wsdlsoap:body use="literal"/>
3174
- </wsdl:input>
3175
- <wsdl:output>
3176
- <wsdlsoap:body use="literal"/>
3177
- </wsdl:output>
3178
- </wsdl:operation>
3179
- <wsdl:operation name="disableWallet">
3180
- <wsdlsoap:operation soapAction="disableWallet"/>
3181
- <wsdl:input>
3182
- <wsdlsoap:body use="literal"/>
3183
- </wsdl:input>
3184
- <wsdl:output>
3185
- <wsdlsoap:body use="literal"/>
3186
- </wsdl:output>
3187
- </wsdl:operation>
3188
- <wsdl:operation name="enableWallet">
3189
- <wsdlsoap:operation soapAction="enableWallet"/>
3190
- <wsdl:input>
3191
- <wsdlsoap:body use="literal"/>
3192
- </wsdl:input>
3193
- <wsdl:output>
3194
- <wsdlsoap:body use="literal"/>
3195
- </wsdl:output>
3196
- </wsdl:operation>
3197
- <wsdl:operation name="doImmediateWalletPayment">
3198
- <wsdlsoap:operation soapAction="doImmediateWalletPayment"/>
3199
- <wsdl:input>
3200
- <wsdlsoap:body use="literal"/>
3201
- </wsdl:input>
3202
- <wsdl:output>
3203
- <wsdlsoap:body use="literal"/>
3204
- </wsdl:output>
3205
- </wsdl:operation>
3206
- <wsdl:operation name="doScheduledWalletPayment">
3207
- <wsdlsoap:operation soapAction="doScheduledWalletPayment"/>
3208
- <wsdl:input>
3209
- <wsdlsoap:body use="literal"/>
3210
- </wsdl:input>
3211
- <wsdl:output>
3212
- <wsdlsoap:body use="literal"/>
3213
- </wsdl:output>
3214
- </wsdl:operation>
3215
- <wsdl:operation name="doRecurrentWalletPayment">
3216
- <wsdlsoap:operation soapAction="doRecurrentWalletPayment"/>
3217
- <wsdl:input>
3218
- <wsdlsoap:body use="literal"/>
3219
- </wsdl:input>
3220
- <wsdl:output>
3221
- <wsdlsoap:body use="literal"/>
3222
- </wsdl:output>
3223
- </wsdl:operation>
3224
- <wsdl:operation name="getPaymentRecord">
3225
- <wsdlsoap:operation soapAction="getPaymentRecord"/>
3226
- <wsdl:input>
3227
- <wsdlsoap:body use="literal"/>
3228
- </wsdl:input>
3229
- <wsdl:output>
3230
- <wsdlsoap:body use="literal"/>
3231
- </wsdl:output>
3232
- </wsdl:operation>
3233
- <wsdl:operation name="disablePaymentRecord">
3234
- <wsdlsoap:operation soapAction="disablePaymentRecord"/>
3235
- <wsdl:input>
3236
- <wsdlsoap:body use="literal"/>
3237
- </wsdl:input>
3238
- <wsdl:output>
3239
- <wsdlsoap:body use="literal"/>
3240
- </wsdl:output>
3241
- </wsdl:operation>
3242
- <wsdl:operation name="verifyEnrollment">
3243
- <wsdlsoap:operation soapAction="verifyEnrollment"/>
3244
- <wsdl:input>
3245
- <wsdlsoap:body use="literal"/>
3246
- </wsdl:input>
3247
- <wsdl:output>
3248
- <wsdlsoap:body use="literal"/>
3249
- </wsdl:output>
3250
- </wsdl:operation>
3251
- <wsdl:operation name="verifyAuthentication">
3252
- <wsdlsoap:operation soapAction="verifyAuthentication"/>
3253
- <wsdl:input>
3254
- <wsdlsoap:body use="literal"/>
3255
- </wsdl:input>
3256
- <wsdl:output>
3257
- <wsdlsoap:body use="literal"/>
3258
- </wsdl:output>
3259
- </wsdl:operation>
3260
- <wsdl:operation name="createMerchant">
3261
- <wsdlsoap:operation soapAction="createMerchant"/>
3262
- <wsdl:input>
3263
- <wsdlsoap:body use="literal"/>
3264
- </wsdl:input>
3265
- <wsdl:output>
3266
- <wsdlsoap:body use="literal"/>
3267
- </wsdl:output>
3268
- </wsdl:operation>
3269
- <wsdl:operation name="doScoringCheque">
3270
- <wsdlsoap:operation soapAction="doScoringCheque"/>
3271
- <wsdl:input>
3272
- <wsdlsoap:body use="literal"/>
3273
- </wsdl:input>
3274
- <wsdl:output>
3275
- <wsdlsoap:body use="literal"/>
3276
- </wsdl:output>
3277
- </wsdl:operation>
3278
- <wsdl:operation name="getEncryptionKey">
3279
- <wsdlsoap:operation soapAction="getEncryptionKey"/>
3280
- <wsdl:input>
3281
- <wsdlsoap:body use="literal"/>
3282
- </wsdl:input>
3283
- <wsdl:output>
3284
- <wsdlsoap:body use="literal"/>
3285
- </wsdl:output>
3286
- </wsdl:operation>
3287
- <wsdl:operation name="getMerchantSettings">
3288
- <wsdlsoap:operation soapAction="getMerchantSettings"/>
3289
- <wsdl:input name="getMerchantSettingsRequest">
3290
- <wsdlsoap:body use="literal"/>
3291
- </wsdl:input>
3292
- <wsdl:output name="getMerchantSettingsResponse">
3293
- <wsdlsoap:body use="literal"/>
3294
- </wsdl:output>
3295
- </wsdl:operation>
3296
- <wsdl:operation name="getBalance">
3297
- <wsdlsoap:operation soapAction="getBalance"/>
3298
- <wsdl:input>
3299
- <wsdlsoap:body use="literal"/>
3300
- </wsdl:input>
3301
- <wsdl:output>
3302
- <wsdlsoap:body use="literal"/>
3303
- </wsdl:output>
3304
- </wsdl:operation>
3305
- <wsdl:operation name="getToken">
3306
- <wsdlsoap:operation soapAction="getToken"/>
3307
- <wsdl:input>
3308
- <wsdlsoap:body use="literal"/>
3309
- </wsdl:input>
3310
- <wsdl:output>
3311
- <wsdlsoap:body use="literal"/>
3312
- </wsdl:output>
3313
- </wsdl:operation>
3314
- <wsdl:operation name="unBlock">
3315
- <wsdlsoap:operation soapAction="unBlock"/>
3316
- <wsdl:input>
3317
- <wsdlsoap:body use="literal"/>
3318
- </wsdl:input>
3319
- <wsdl:output>
3320
- <wsdlsoap:body use="literal"/>
3321
- </wsdl:output>
3322
- </wsdl:operation>
3323
- <wsdl:operation name="updatePaymentRecord">
3324
- <wsdlsoap:operation soapAction="updatePaymentRecord"/>
3325
- <wsdl:input>
3326
- <wsdlsoap:body use="literal"/>
3327
- </wsdl:input>
3328
- <wsdl:output>
3329
- <wsdlsoap:body use="literal"/>
3330
- </wsdl:output>
3331
- </wsdl:operation>
3332
- <wsdl:operation name="getBillingRecord">
3333
- <wsdlsoap:operation soapAction="getBillingRecord"/>
3334
- <wsdl:input>
3335
- <wsdlsoap:body use="literal"/>
3336
- </wsdl:input>
3337
- <wsdl:output>
3338
- <wsdlsoap:body use="literal"/>
3339
- </wsdl:output>
3340
- </wsdl:operation>
3341
- <wsdl:operation name="updateBillingRecord">
3342
- <wsdlsoap:operation soapAction="updateBillingRecord"/>
3343
- <wsdl:input>
3344
- <wsdlsoap:body use="literal"/>
3345
- </wsdl:input>
3346
- <wsdl:output>
3347
- <wsdlsoap:body use="literal"/>
3348
- </wsdl:output>
3349
- </wsdl:operation>
3350
- </wsdl:binding>
3351
- <wsdl:binding name="WebPaymentAPISoapBinding" type="impl:WebPaymentAPI">
3352
- <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
3353
- <wsdl:operation name="getWebPaymentDetails">
3354
- <wsdlsoap:operation soapAction="getWebPaymentDetails"/>
3355
- <wsdl:input>
3356
- <wsdlsoap:body use="literal"/>
3357
- </wsdl:input>
3358
- <wsdl:output>
3359
- <wsdlsoap:body use="literal"/>
3360
- </wsdl:output>
3361
- </wsdl:operation>
3362
- <wsdl:operation name="doWebPayment">
3363
- <wsdlsoap:operation soapAction="doWebPayment"/>
3364
- <wsdl:input>
3365
- <wsdlsoap:body use="literal"/>
3366
- </wsdl:input>
3367
- <wsdl:output>
3368
- <wsdlsoap:body use="literal"/>
3369
- </wsdl:output>
3370
- </wsdl:operation>
3371
- <wsdl:operation name="manageWebWallet">
3372
- <wsdlsoap:operation soapAction="manageWebWallet"/>
3373
- <wsdl:input>
3374
- <wsdlsoap:body use="literal"/>
3375
- </wsdl:input>
3376
- <wsdl:output>
3377
- <wsdlsoap:body use="literal"/>
3378
- </wsdl:output>
3379
- </wsdl:operation>
3380
- <wsdl:operation name="createWebWallet">
3381
- <wsdlsoap:operation soapAction="createWebWallet"/>
3382
- <wsdl:input>
3383
- <wsdlsoap:body use="literal"/>
3384
- </wsdl:input>
3385
- <wsdl:output>
3386
- <wsdlsoap:body use="literal"/>
3387
- </wsdl:output>
3388
- </wsdl:operation>
3389
- <wsdl:operation name="updateWebWallet">
3390
- <wsdlsoap:operation soapAction="updateWebWallet"/>
3391
- <wsdl:input>
3392
- <wsdlsoap:body use="literal"/>
3393
- </wsdl:input>
3394
- <wsdl:output>
3395
- <wsdlsoap:body use="literal"/>
3396
- </wsdl:output>
3397
- </wsdl:operation>
3398
- <wsdl:operation name="getWebWallet">
3399
- <wsdlsoap:operation soapAction="getWebWallet"/>
3400
- <wsdl:input>
3401
- <wsdlsoap:body use="literal"/>
3402
- </wsdl:input>
3403
- <wsdl:output>
3404
- <wsdlsoap:body use="literal"/>
3405
- </wsdl:output>
3406
- </wsdl:operation>
3407
- </wsdl:binding>
3408
- <wsdl:binding name="ExtendedAPISoapBinding" type="impl:ExtendedAPI">
3409
- <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
3410
- <wsdl:operation name="getTransactionDetails">
3411
- <wsdlsoap:operation soapAction="getTransactionDetails"/>
3412
- <wsdl:input>
3413
- <wsdlsoap:body use="literal"/>
3414
- </wsdl:input>
3415
- <wsdl:output>
3416
- <wsdlsoap:body use="literal"/>
3417
- </wsdl:output>
3418
- </wsdl:operation>
3419
- <wsdl:operation name="transactionsSearch">
3420
- <wsdlsoap:operation soapAction="transactionsSearch"/>
3421
- <wsdl:input>
3422
- <wsdlsoap:body use="literal"/>
3423
- </wsdl:input>
3424
- <wsdl:output>
3425
- <wsdlsoap:body use="literal"/>
3426
- </wsdl:output>
3427
- </wsdl:operation>
3428
- <wsdl:operation name="getAlertDetails">
3429
- <wsdlsoap:operation soapAction="getAlertDetails"/>
3430
- <wsdl:input>
3431
- <wsdlsoap:body use="literal"/>
3432
- </wsdl:input>
3433
- <wsdl:output>
3434
- <wsdlsoap:body use="literal"/>
3435
- </wsdl:output>
3436
- </wsdl:operation>
3437
- </wsdl:binding>
3438
- <wsdl:service name="WebPaymentAPI">
3439
- <wsdl:port name="WebPaymentAPI" binding="impl:WebPaymentAPISoapBinding">
3440
- <wsdlsoap:address location="https://homologation.payline.com/V4/services/WebPaymentAPI"/>
3441
- </wsdl:port>
3442
- </wsdl:service>
3443
- <wsdl:service name="ExtendedAPI">
3444
- <wsdl:port name="ExtendedAPI" binding="impl:ExtendedAPISoapBinding">
3445
- <wsdlsoap:address location="https://homologation.payline.com/V4/services/ExtendedAPI"/>
3446
- </wsdl:port>
3447
- </wsdl:service>
3448
- <wsdl:service name="DirectPaymentAPI">
3449
- <wsdl:port name="DirectPaymentAPI" binding="impl:DirectPaymentAPISoapBinding">
3450
- <wsdlsoap:address location="https://homologation.payline.com/V4/services/DirectPaymentAPI"/>
3451
- </wsdl:port>
3452
- </wsdl:service>
3453
  </wsdl:definitions>
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <wsdl:definitions targetNamespace="http://impl.ws.payline.experian.com" xmlns:impl="http://impl.ws.payline.experian.com" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:intf="http://impl.ws.payline.experian.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns1="http://obj.ws.payline.experian.com">
3
+ <wsdl:types>
4
+ <schema elementFormDefault="qualified" targetNamespace="http://impl.ws.payline.experian.com" xmlns="http://www.w3.org/2001/XMLSchema">
5
+ <import namespace="http://obj.ws.payline.experian.com"/>
6
+ <element name="doWebPaymentRequest">
7
+ <complexType>
8
+ <annotation>
9
+ <documentation>
10
+ This element is the request for the
11
+ doWebPayment
12
+ method
13
+ </documentation>
14
+ </annotation>
15
+ <sequence>
16
+ <element name="version" nillable="false" type="xsd:string"/>
17
+ <element name="payment" nillable="false" type="tns1:payment"/>
18
+ <element name="returnURL" nillable="false" type="xsd:string"/>
19
+ <element name="cancelURL" nillable="false" type="xsd:string"/>
20
+ <element name="order" nillable="false" type="tns1:order"/>
21
+ <element name="notificationURL" nillable="true" type="xsd:string"/>
22
+ <element name="selectedContractList" nillable="true" type="tns1:selectedContractList"/>
23
+ <element name="secondSelectedContractList" nillable="true" type="tns1:selectedContractList"/>
24
+ <element name="privateDataList" nillable="true" type="tns1:privateDataList"/>
25
+ <element name="languageCode" nillable="true" type="xsd:string"/>
26
+ <element name="customPaymentPageCode" nillable="true" type="xsd:string"/>
27
+ <element name="buyer" nillable="true" type="tns1:buyer"/>
28
+ <element name="owner" nillable="true" type="tns1:owner"/>
29
+ <element name="securityMode" nillable="true" type="xsd:string"/>
30
+ <element name="recurring" nillable="true" type="tns1:recurring"/>
31
+ <element name="customPaymentTemplateURL" nillable="true" type="xsd:string"/>
32
+ <element name="contractNumberWalletList" nillable="true" type="tns1:contractNumberWalletList"/>
33
+ </sequence>
34
+ </complexType>
35
+ </element>
36
+ <element name="doWebPaymentResponse">
37
+ <complexType>
38
+ <annotation>
39
+ <documentation>
40
+ This element is the reponse from the
41
+ doWebPayment
42
+ method
43
+ </documentation>
44
+ </annotation>
45
+ <sequence>
46
+ <element name="result" nillable="false" type="tns1:result"/>
47
+ <element name="token" nillable="false" type="xsd:string"/>
48
+ <element name="redirectURL" nillable="false" type="xsd:string"/>
49
+ <element minOccurs="0" name="stepCode" nillable="true" type="xsd:string"/>
50
+ <element minOccurs="0" name="reqCode" nillable="true" type="xsd:string"/>
51
+ <element minOccurs="0" name="method" nillable="true" type="xsd:string"/>
52
+ </sequence>
53
+ </complexType>
54
+ </element>
55
+ <element name="getWebPaymentDetailsRequest">
56
+ <complexType>
57
+ <annotation>
58
+ <documentation>
59
+ This element is the reponse from the
60
+ getWebPayment
61
+ method
62
+ </documentation>
63
+ </annotation>
64
+ <sequence>
65
+ <element name="version" nillable="false" type="xsd:string"/>
66
+ <element name="token" nillable="false" type="xsd:string"/>
67
+ </sequence>
68
+ </complexType>
69
+ </element>
70
+ <element name="getWebPaymentDetailsResponse">
71
+ <complexType>
72
+ <annotation>
73
+ <documentation>
74
+ This element is the reponse from the
75
+ doWebPayment
76
+ method
77
+ </documentation>
78
+ </annotation>
79
+ <sequence>
80
+ <element name="result" nillable="false" type="tns1:result"/>
81
+ <element name="transaction" nillable="false" type="tns1:transaction"/>
82
+ <element name="payment" nillable="false" type="tns1:payment"/>
83
+ <element name="authorization" nillable="false" type="tns1:authorization"/>
84
+ <element minOccurs="0" name="privateDataList" nillable="true" type="tns1:privateDataList"/>
85
+ <element minOccurs="0" name="paymentRecordId" nillable="true" type="xsd:string"/>
86
+ <element minOccurs="0" name="billingRecordList" nillable="true" type="tns1:billingRecordList"/>
87
+ <element minOccurs="0" name="authentication3DSecure" nillable="true" type="tns1:authentication3DSecure"/>
88
+ <element name="card" type="tns1:cardOut"/>
89
+ <element minOccurs="0" name="extendedCard" type="tns1:extendedCardType"/>
90
+ <element name="order" type="tns1:order"/>
91
+ <element minOccurs="0" name="paymentAdditionalList" nillable="true" type="tns1:paymentAdditionalList"/>
92
+ <element minOccurs="0" name="media" nillable="true" type="xsd:string"/>
93
+ <element minOccurs="0" name="numberOfAttempt" nillable="true" type="xsd:string"/>
94
+ <element minOccurs="0" name="wallet" nillable="true" type="tns1:wallet"/>
95
+ <element minOccurs="0" name="contractNumberWalletList" nillable="true" type="tns1:contractNumberWalletList"/>
96
+ <element minOccurs="0" name="contractNumber" nillable="false" type="xsd:string"/>
97
+ <element name="bankAccountData" nillable="true" type="tns1:bankAccountData"/>
98
+ </sequence>
99
+ </complexType>
100
+ </element>
101
+ <element name="doAuthorizationRequest">
102
+ <complexType>
103
+ <annotation>
104
+ <documentation>
105
+ This element is the request for the
106
+ doAuthorization
107
+ method
108
+ </documentation>
109
+ </annotation>
110
+ <sequence>
111
+ <element name="version" nillable="false" type="xsd:string"/>
112
+ <element name="payment" nillable="false" type="tns1:payment"/>
113
+ <element name="bankAccountData" nillable="false" type="tns1:bankAccountData"/>
114
+ <element name="card" nillable="false" type="tns1:card"/>
115
+ <element name="order" nillable="false" type="tns1:order"/>
116
+ <element name="buyer" nillable="true" type="tns1:buyer"/>
117
+ <element name="owner" nillable="true" type="tns1:owner"/>
118
+ <element name="privateDataList" nillable="true" type="tns1:privateDataList"/>
119
+ <element name="authentication3DSecure" nillable="true" type="tns1:authentication3DSecure"/>
120
+ <element name="media" nillable="true" type="xsd:string"/>
121
+ </sequence>
122
+ </complexType>
123
+ </element>
124
+ <element name="doAuthorizationResponse">
125
+ <complexType>
126
+ <annotation>
127
+ <documentation>
128
+ This element is the reponse from the
129
+ doAuthorization method
130
+ </documentation>
131
+ </annotation>
132
+ <sequence>
133
+ <element name="result" nillable="false" type="tns1:result"/>
134
+ <element name="transaction" nillable="false" type="tns1:transaction"/>
135
+ <element name="authorization" nillable="false" type="tns1:authorization"/>
136
+ <element name="card" type="tns1:cardOut"/>
137
+ <element name="extendedCard" type="tns1:extendedCardType"/>
138
+ <element name="privateDataList" nillable="true" type="tns1:privateDataList"/>
139
+ <element name="contractNumber" nillable="false" type="xsd:string"/>
140
+ </sequence>
141
+ </complexType>
142
+ </element>
143
+ <element name="doCaptureRequest">
144
+ <complexType>
145
+ <annotation>
146
+ <documentation>
147
+ This element is the request for the
148
+ doCapture method
149
+ </documentation>
150
+ </annotation>
151
+ <sequence>
152
+ <element name="version" nillable="false" type="xsd:string"/>
153
+ <element name="transactionID" nillable="false" type="xsd:string"/>
154
+ <element name="payment" nillable="false" type="tns1:payment"/>
155
+ <element name="privateDataList" nillable="true" type="tns1:privateDataList"/>
156
+ <element name="sequenceNumber" nillable="true" type="xsd:string"/>
157
+ <element name="media" nillable="true" type="xsd:string"/>
158
+ </sequence>
159
+ </complexType>
160
+ </element>
161
+ <element name="doCaptureResponse">
162
+ <complexType>
163
+ <annotation>
164
+ <documentation>
165
+ This element is the reponse from the
166
+ doCapture
167
+ method
168
+ </documentation>
169
+ </annotation>
170
+ <sequence>
171
+ <element name="result" nillable="false" type="tns1:result"/>
172
+ <element name="transaction" nillable="false" type="tns1:transaction"/>
173
+ <element name="reAuthorization" nillable="true" type="xsd:string"/>
174
+ </sequence>
175
+ </complexType>
176
+ </element>
177
+ <element name="doDebitRequest">
178
+ <complexType>
179
+ <sequence>
180
+ <element name="version" nillable="false" type="xsd:string"/>
181
+ <element name="payment" nillable="false" type="tns1:payment"/>
182
+ <element name="card" nillable="false" type="tns1:card"/>
183
+ <element name="order" nillable="false" type="tns1:order"/>
184
+ <element name="buyer" nillable="true" type="tns1:buyer"/>
185
+ <element name="owner" nillable="true" type="tns1:owner"/>
186
+ <element name="privateDataList" nillable="true" type="tns1:privateDataList"/>
187
+ <element name="authentication3DSecure" nillable="true" type="tns1:authentication3DSecure"/>
188
+ <element name="authorization" nillable="false" type="tns1:authorization"/>
189
+ <element name="media" nillable="true" type="xsd:string"/>
190
+ </sequence>
191
+ </complexType>
192
+ </element>
193
+ <element name="doDebitResponse">
194
+ <complexType>
195
+ <sequence>
196
+ <element name="result" nillable="false" type="tns1:result"/>
197
+ <element name="transaction" nillable="false" type="tns1:transaction"/>
198
+ <element name="card" type="tns1:cardOut"/>
199
+ <element name="extendedCard" type="tns1:extendedCardType"/>
200
+ </sequence>
201
+ </complexType>
202
+ </element>
203
+ <element name="doRefundRequest">
204
+ <complexType>
205
+ <annotation>
206
+ <documentation>
207
+ This element is the request for the doRefund
208
+ method
209
+ </documentation>
210
+ </annotation>
211
+ <sequence>
212
+ <element name="version" nillable="false" type="xsd:string"/>
213
+ <element name="transactionID" nillable="false" type="xsd:string"/>
214
+ <element name="payment" nillable="false" type="tns1:payment"/>
215
+ <element name="comment" nillable="true" type="xsd:string"/>
216
+ <element name="privateDataList" nillable="true" type="tns1:privateDataList"/>
217
+ <element name="sequenceNumber" nillable="true" type="xsd:string"/>
218
+ <element name="media" nillable="true" type="xsd:string"/>
219
+ </sequence>
220
+ </complexType>
221
+ </element>
222
+ <element name="doRefundResponse">
223
+ <complexType>
224
+ <annotation>
225
+ <documentation>
226
+ This element is the reponse from the
227
+ doRefund method
228
+ </documentation>
229
+ </annotation>
230
+ <sequence>
231
+ <element name="result" nillable="false" type="tns1:result"/>
232
+ <element name="transaction" nillable="false" type="tns1:transaction"/>
233
+ </sequence>
234
+ </complexType>
235
+ </element>
236
+ <element name="doResetRequest">
237
+ <complexType>
238
+ <annotation>
239
+ <documentation>
240
+ This element is the request for the doReset
241
+ method
242
+ </documentation>
243
+ </annotation>
244
+ <sequence>
245
+ <element name="version" nillable="false" type="xsd:string"/>
246
+ <element name="transactionID" nillable="false" type="xsd:string"/>
247
+ <element name="comment" nillable="true" type="xsd:string"/>
248
+ <element name="media" nillable="true" type="xsd:string"/>
249
+ </sequence>
250
+ </complexType>
251
+ </element>
252
+ <element name="doResetResponse">
253
+ <complexType>
254
+ <annotation>
255
+ <documentation>
256
+ This element is the reponse from the doReset
257
+ method
258
+ </documentation>
259
+ </annotation>
260
+ <sequence>
261
+ <element name="result" nillable="false" type="tns1:result"/>
262
+ <element name="transaction" nillable="false" type="tns1:transaction"/>
263
+ </sequence>
264
+ </complexType>
265
+ </element>
266
+ <element name="doCreditRequest">
267
+ <complexType>
268
+ <annotation>
269
+ <documentation>
270
+ This element is the request for the doCredit
271
+ method
272
+ </documentation>
273
+ </annotation>
274
+ <sequence>
275
+ <element name="version" nillable="false" type="xsd:string"/>
276
+ <element name="payment" nillable="false" type="tns1:payment"/>
277
+ <element name="card" nillable="false" type="tns1:card"/>
278
+ <element name="comment" nillable="true" type="xsd:string"/>
279
+ <element name="order" nillable="true" type="tns1:order"/>
280
+ <element name="buyer" nillable="true" type="tns1:buyer"/>
281
+ <element name="owner" nillable="true" type="tns1:owner"/>
282
+ <element name="privateDataList" nillable="true" type="tns1:privateDataList"/>
283
+ <element name="media" nillable="true" type="xsd:string"/>
284
+ </sequence>
285
+ </complexType>
286
+ </element>
287
+ <element name="doCreditResponse">
288
+ <complexType>
289
+ <annotation>
290
+ <documentation>
291
+ This element is the reponse from the
292
+ doCredit method
293
+ </documentation>
294
+ </annotation>
295
+ <sequence>
296
+ <element name="result" nillable="false" type="tns1:result"/>
297
+ <element name="transaction" nillable="false" type="tns1:transaction"/>
298
+ <element name="card" type="tns1:cardOut"/>
299
+ <element name="extendedCard" type="tns1:extendedCardType"/>
300
+ </sequence>
301
+ </complexType>
302
+ </element>
303
+ <element name="createWalletRequest">
304
+ <complexType>
305
+ <annotation>
306
+ <documentation>
307
+ This element is the request for the
308
+ createWallet
309
+ method
310
+ </documentation>
311
+ </annotation>
312
+ <sequence>
313
+ <element name="version" nillable="false" type="xsd:string"/>
314
+ <element name="contractNumber" nillable="false" type="xsd:string"/>
315
+ <element name="wallet" nillable="false" type="tns1:wallet"/>
316
+ <element name="buyer" nillable="true" type="tns1:buyer"/>
317
+ <element name="owner" nillable="true" type="tns1:owner"/>
318
+ <element name="privateDataList" nillable="true" type="tns1:privateDataList"/>
319
+ <element name="authentication3DSecure" nillable="true" type="tns1:authentication3DSecure"/>
320
+ <element name="media" nillable="true" type="xsd:string"/>
321
+ <element name="contractNumberWalletList" nillable="true" type="tns1:contractNumberWalletList"/>
322
+ </sequence>
323
+ </complexType>
324
+ </element>
325
+ <element name="createWalletResponse">
326
+ <complexType>
327
+ <annotation>
328
+ <documentation>
329
+ This element is the reponse from the
330
+ createWallet
331
+ method
332
+ </documentation>
333
+ </annotation>
334
+ <sequence>
335
+ <element name="result" nillable="false" type="tns1:result"/>
336
+ <element name="card" type="tns1:cardOut"/>
337
+ <element name="extendedCard" type="tns1:extendedCardType"/>
338
+ <element name="contractNumberWalletList" nillable="true" type="tns1:contractNumberWalletList"/>
339
+ <element name="fraudResultDetails" nillable="true" type="tns1:fraudResultDetails"/>
340
+ </sequence>
341
+ </complexType>
342
+ </element>
343
+ <element name="updateWalletRequest">
344
+ <complexType>
345
+ <annotation>
346
+ <documentation>
347
+ This element is the request for the
348
+ updateWallet
349
+ method
350
+ </documentation>
351
+ </annotation>
352
+ <sequence>
353
+ <element name="version" nillable="false" type="xsd:string"/>
354
+ <element name="contractNumber" nillable="false" type="xsd:string"/>
355
+ <element name="cardInd" nillable="true" type="xsd:string"/>
356
+ <element name="wallet" nillable="false" type="tns1:wallet"/>
357
+ <element name="buyer" nillable="true" type="tns1:buyer"/>
358
+ <element name="owner" nillable="true" type="tns1:owner"/>
359
+ <element name="privateDataList" nillable="true" type="tns1:privateDataList"/>
360
+ <element name="authentication3DSecure" nillable="true" type="tns1:authentication3DSecure"/>
361
+ <element name="media" nillable="true" type="xsd:string"/>
362
+ <element name="contractNumberWalletList" nillable="true" type="tns1:contractNumberWalletList"/>
363
+ </sequence>
364
+ </complexType>
365
+ </element>
366
+ <element name="updateWalletResponse">
367
+ <complexType>
368
+ <annotation>
369
+ <documentation>
370
+ This element is the reponse from the
371
+ updateWallet
372
+ method
373
+ </documentation>
374
+ </annotation>
375
+ <sequence>
376
+ <element name="result" nillable="false" type="tns1:result"/>
377
+ <element name="card" type="tns1:cardOut"/>
378
+ <element name="extendedCard" type="tns1:extendedCardType"/>
379
+ <element name="contractNumberWalletList" nillable="true" type="tns1:contractNumberWalletList"/>
380
+ </sequence>
381
+ </complexType>
382
+ </element>
383
+ <element name="getWalletRequest">
384
+ <complexType>
385
+ <annotation>
386
+ <documentation>
387
+ This element is the request for the
388
+ getWallet method
389
+ </documentation>
390
+ </annotation>
391
+ <sequence>
392
+ <element name="version" nillable="false" type="xsd:string"/>
393
+ <element name="contractNumber" nillable="false" type="xsd:string"/>
394
+ <element name="walletId" nillable="false" type="xsd:string"/>
395
+ <element name="cardInd" nillable="true" type="xsd:string"/>
396
+ <element name="media" nillable="true" type="xsd:string"/>
397
+ </sequence>
398
+ </complexType>
399
+ </element>
400
+ <element name="getWalletResponse">
401
+ <complexType>
402
+ <annotation>
403
+ <documentation>
404
+ This element is the reponse from the
405
+ getWallet
406
+ method
407
+ </documentation>
408
+ </annotation>
409
+ <sequence>
410
+ <element name="result" nillable="false" type="tns1:result"/>
411
+ <element name="wallet" nillable="true" type="tns1:wallet"/>
412
+ <element name="owner" nillable="true" type="tns1:owner"/>
413
+ <element name="isDisabled" nillable="true" type="xsd:string"/>
414
+ <element name="disableDate" nillable="true" type="xsd:string"/>
415
+ <element name="privateDataList" nillable="true" type="tns1:privateDataList"/>
416
+ <element name="extendedCard" nillable="true" type="tns1:extendedCardType"/>
417
+ <element name="contractNumberWalletList" nillable="true" type="tns1:contractNumberWalletList"/>
418
+ <element name="media" nillable="true" type="xsd:string"/>
419
+ </sequence>
420
+ </complexType>
421
+ </element>
422
+ <element name="getCardsRequest">
423
+ <complexType>
424
+ <annotation>
425
+ <documentation>
426
+ This element is the request for the
427
+ getCards method
428
+ </documentation>
429
+ </annotation>
430
+ <sequence>
431
+ <element name="contractNumber" nillable="false" type="xsd:string"/>
432
+ <element name="walletId" nillable="false" type="xsd:string"/>
433
+ <element name="cardInd" nillable="true" type="xsd:string"/>
434
+ </sequence>
435
+ </complexType>
436
+ </element>
437
+ <element name="getCardsResponse">
438
+ <complexType>
439
+ <annotation>
440
+ <documentation>
441
+ This element is the reponse from the
442
+ getCards method
443
+ </documentation>
444
+ </annotation>
445
+ <sequence>
446
+ <element name="result" nillable="false" type="tns1:result"/>
447
+ <element name="cardsList" nillable="true" type="tns1:cardsList"/>
448
+ <element name="owner" nillable="true" type="tns1:owner"/>
449
+ <element name="privateDataList" nillable="true" type="tns1:privateDataList"/>
450
+ </sequence>
451
+ </complexType>
452
+ </element>
453
+ <element name="disableWalletRequest">
454
+ <complexType>
455
+ <annotation>
456
+ <documentation>
457
+ This element is the request for the
458
+ disableWallet
459
+ method
460
+ </documentation>
461
+ </annotation>
462
+ <sequence>
463
+ <element name="contractNumber" nillable="false" type="xsd:string"/>
464
+ <element name="cardInd" nillable="true" type="xsd:string"/>
465
+ <element name="walletIdList" nillable="false" type="tns1:walletIdList"/>
466
+ </sequence>
467
+ </complexType>
468
+ </element>
469
+ <element name="disableWalletResponse">
470
+ <complexType>
471
+ <annotation>
472
+ <documentation>
473
+ This element is the reponse from the
474
+ disableWallet
475
+ method
476
+ </documentation>
477
+ </annotation>
478
+ <sequence>
479
+ <element name="result" nillable="false" type="tns1:result"/>
480
+ <element name="walletIdList" nillable="false" type="tns1:walletIdList"/>
481
+ </sequence>
482
+ </complexType>
483
+ </element>
484
+ <element name="enableWalletRequest">
485
+ <complexType>
486
+ <annotation>
487
+ <documentation>
488
+ This element is the request for the
489
+ enableWallet
490
+ method
491
+ </documentation>
492
+ </annotation>
493
+ <sequence>
494
+ <element name="contractNumber" nillable="false" type="xsd:string"/>
495
+ <element name="cardInd" nillable="true" type="xsd:string"/>
496
+ <element name="walletId" nillable="false" type="xsd:string"/>
497
+ </sequence>
498
+ </complexType>
499
+ </element>
500
+ <element name="enableWalletResponse">
501
+ <complexType>
502
+ <annotation>
503
+ <documentation>
504
+ This element is the reponse from the
505
+ enableWallet
506
+ method
507
+ </documentation>
508
+ </annotation>
509
+ <sequence>
510
+ <element name="result" nillable="false" type="tns1:result"/>
511
+ </sequence>
512
+ </complexType>
513
+ </element>
514
+ <element name="doImmediateWalletPaymentRequest">
515
+ <complexType>
516
+ <annotation>
517
+ <documentation>
518
+ This element is the request for the
519
+ doImmediateWalletPayment method
520
+ </documentation>
521
+ </annotation>
522
+ <sequence>
523
+ <element name="version" nillable="false" type="xsd:string"/>
524
+ <element name="payment" nillable="false" type="tns1:payment"/>
525
+ <element name="order" nillable="false" type="tns1:order"/>
526
+ <element name="buyer" nillable="true" type="tns1:buyer"/>
527
+ <element name="walletId" nillable="false" type="xsd:string"/>
528
+ <element name="cardInd" nillable="true" type="xsd:string"/>
529
+ <element name="cvx" nillable="true" type="xsd:string"/>
530
+ <element name="privateDataList" nillable="true" type="tns1:privateDataList"/>
531
+ <element name="media" nillable="true" type="xsd:string"/>
532
+ <element name="authentication3DSecure" nillable="true" type="tns1:authentication3DSecure"/>
533
+ </sequence>
534
+ </complexType>
535
+ </element>
536
+ <element name="doImmediateWalletPaymentResponse">
537
+ <complexType>
538
+ <annotation>
539
+ <documentation>
540
+ This element is the reponse from the
541
+ doImmediateWalletPayment method
542
+ </documentation>
543
+ </annotation>
544
+ <sequence>
545
+ <element name="result" nillable="false" type="tns1:result"/>
546
+ <element name="transaction" nillable="true" type="tns1:transaction"/>
547
+ <element name="authorization" nillable="true" type="tns1:authorization"/>
548
+ </sequence>
549
+ </complexType>
550
+ </element>
551
+ <element name="doScheduledWalletPaymentRequest">
552
+ <complexType>
553
+ <annotation>
554
+ <documentation>
555
+ This element is the request for the
556
+ doScheduledWalletPayment method
557
+ </documentation>
558
+ </annotation>
559
+ <sequence>
560
+ <element name="version" nillable="false" type="xsd:string"/>
561
+ <element name="payment" nillable="false" type="tns1:payment"/>
562
+ <element name="orderRef" nillable="true" type="xsd:string"/>
563
+ <element name="orderDate" nillable="true" type="xsd:string"/>
564
+ <element name="scheduledDate" nillable="false" type="xsd:string"/>
565
+ <element name="walletId" nillable="false" type="xsd:string"/>
566
+ <element name="cardInd" nillable="true" type="xsd:string"/>
567
+ <element name="order" nillable="true" type="tns1:order"/>
568
+ <element name="privateDataList" nillable="true" type="tns1:privateDataList"/>
569
+ <element name="media" nillable="true" type="xsd:string"/>
570
+ </sequence>
571
+ </complexType>
572
+ </element>
573
+ <element name="doScheduledWalletPaymentResponse">
574
+ <complexType>
575
+ <annotation>
576
+ <documentation>
577
+ This element is the reponse from the
578
+ doScheduledWalletPayment method
579
+ </documentation>
580
+ </annotation>
581
+ <sequence>
582
+ <element name="result" nillable="false" type="tns1:result"/>
583
+ <element name="paymentRecordId" nillable="false" type="xsd:string"/>
584
+ </sequence>
585
+ </complexType>
586
+ </element>
587
+ <element name="doRecurrentWalletPaymentRequest">
588
+ <complexType>
589
+ <annotation>
590
+ <documentation>
591
+ This element is the request for the
592
+ doRecurrentWalletPayment method
593
+ </documentation>
594
+ </annotation>
595
+ <sequence>
596
+ <element name="version" nillable="false" type="xsd:string"/>
597
+ <element name="payment" nillable="false" type="tns1:payment"/>
598
+ <element name="orderRef" nillable="false" type="xsd:string"/>
599
+ <element name="orderDate" nillable="false" type="xsd:string"/>
600
+ <element name="scheduledDate" nillable="false" type="xsd:string"/>
601
+ <element name="walletId" nillable="false" type="xsd:string"/>
602
+ <element name="cardInd" nillable="true" type="xsd:string"/>
603
+ <element name="recurring" nillable="false" type="tns1:recurring"/>
604
+ <element name="privateDataList" nillable="true" type="tns1:privateDataList"/>
605
+ <element name="order" nillable="true" type="tns1:order"/>
606
+ <element name="media" nillable="true" type="xsd:string"/>
607
+ </sequence>
608
+ </complexType>
609
+ </element>
610
+ <element name="doRecurrentWalletPaymentResponse">
611
+ <complexType>
612
+ <annotation>
613
+ <documentation>
614
+ This element is the reponse from the
615
+ doRecurrentWalletPayment method
616
+ </documentation>
617
+ </annotation>
618
+ <sequence>
619
+ <element name="result" nillable="false" type="tns1:result"/>
620
+ <element name="paymentRecordId" nillable="false" type="xsd:string"/>
621
+ <element name="billingRecordList" nillable="false" type="tns1:billingRecordList"/>
622
+ </sequence>
623
+ </complexType>
624
+ </element>
625
+ <element name="getPaymentRecordRequest">
626
+ <complexType>
627
+ <annotation>
628
+ <documentation>
629
+ This element is the request for the
630
+ getPaymentRecord method
631
+ </documentation>
632
+ </annotation>
633
+ <sequence>
634
+ <element name="version" nillable="false" type="xsd:string"/>
635
+ <element name="contractNumber" nillable="false" type="xsd:string"/>
636
+ <element name="paymentRecordId" nillable="false" type="xsd:string"/>
637
+ </sequence>
638
+ </complexType>
639
+ </element>
640
+ <element name="getPaymentRecordResponse">
641
+ <complexType>
642
+ <annotation>
643
+ <documentation>
644
+ This element is the reponse from the
645
+ getPaymentRecord method
646
+ </documentation>
647
+ </annotation>
648
+ <sequence>
649
+ <element name="result" nillable="false" type="tns1:result"/>
650
+ <element name="recurring" nillable="false" type="tns1:recurring"/>
651
+ <element name="isDisabled" nillable="true" type="xsd:string"/>
652
+ <element name="disableDate" nillable="true" type="xsd:string"/>
653
+ <element name="billingRecordList" nillable="false" type="tns1:billingRecordList"/>
654
+ <element name="privateDataList" nillable="true" type="tns1:privateDataList"/>
655
+ <element name="order" nillable="true" type="tns1:order"/>
656
+ <element name="walletId" nillable="false" type="xsd:string"/>
657
+ </sequence>
658
+ </complexType>
659
+ </element>
660
+ <element name="disablePaymentRecordRequest">
661
+ <complexType>
662
+ <annotation>
663
+ <documentation>
664
+ This element is the request for the
665
+ disablePaymentRecord method
666
+ </documentation>
667
+ </annotation>
668
+ <sequence>
669
+ <element name="contractNumber" nillable="false" type="xsd:string"/>
670
+ <element name="paymentRecordId" nillable="false" type="xsd:string"/>
671
+ </sequence>
672
+ </complexType>
673
+ </element>
674
+ <element name="disablePaymentRecordResponse">
675
+ <complexType>
676
+ <annotation>
677
+ <documentation>
678
+ This element is the reponse from the
679
+ disablePaymentRecord method
680
+ </documentation>
681
+ </annotation>
682
+ <sequence>
683
+ <element name="result" nillable="false" type="tns1:result"/>
684
+ </sequence>
685
+ </complexType>
686
+ </element>
687
+ <element name="manageWebWalletRequest">
688
+ <complexType>
689
+ <annotation>
690
+ <documentation>
691
+ This element is the request for the
692
+ manageWebWallet
693
+ method
694
+ </documentation>
695
+ </annotation>
696
+ <sequence>
697
+ <element name="version" nillable="false" type="xsd:string"/>
698
+ <element name="contractNumber" nillable="false" type="xsd:string"/>
699
+ <element name="selectedContractList" nillable="true" type="tns1:selectedContractList"/>
700
+ <element name="updatePersonalDetails" nillable="true" type="xsd:string"/>
701
+ <element name="buyer" nillable="false" type="tns1:buyer"/>
702
+ <element name="owner" nillable="true" type="tns1:owner"/>
703
+ <element name="languageCode" nillable="true" type="xsd:string"/>
704
+ <element name="customPaymentPageCode" nillable="true" type="xsd:string"/>
705
+ <element name="securityMode" nillable="true" type="xsd:string"/>
706
+ <element name="returnURL" nillable="false" type="xsd:string"/>
707
+ <element name="cancelURL" nillable="false" type="xsd:string"/>
708
+ <element name="notificationURL" nillable="true" type="xsd:string"/>
709
+ <element name="privateDataList" nillable="true" type="tns1:privateDataList"/>
710
+ <element name="customPaymentTemplateURL" nillable="true" type="xsd:string"/>
711
+ <element name="contractNumberWalletList" nillable="true" type="tns1:contractNumberWalletList"/>
712
+ </sequence>
713
+ </complexType>
714
+ </element>
715
+ <element name="manageWebWalletResponse">
716
+ <complexType>
717
+ <annotation>
718
+ <documentation>
719
+ This element is the reponse from the
720
+ manageWebWallet method
721
+ </documentation>
722
+ </annotation>
723
+ <sequence>
724
+ <element name="result" nillable="false" type="tns1:result"/>
725
+ <element name="token" nillable="false" type="xsd:string"/>
726
+ <element name="redirectURL" nillable="false" type="xsd:string"/>
727
+ </sequence>
728
+ </complexType>
729
+ </element>
730
+ <element name="createWebWalletRequest">
731
+ <complexType>
732
+ <annotation>
733
+ <documentation>
734
+ This element is the request for the
735
+ createWebWallet
736
+ method
737
+ </documentation>
738
+ </annotation>
739
+ <sequence>
740
+ <element name="version" nillable="false" type="xsd:string"/>
741
+ <element name="contractNumber" nillable="false" type="xsd:string"/>
742
+ <element name="selectedContractList" nillable="true" type="tns1:selectedContractList"/>
743
+ <element name="updatePersonalDetails" nillable="true" type="xsd:string"/>
744
+ <element name="buyer" nillable="false" type="tns1:buyer"/>
745
+ <element name="owner" nillable="true" type="tns1:owner"/>
746
+ <element name="languageCode" nillable="true" type="xsd:string"/>
747
+ <element name="customPaymentPageCode" nillable="true" type="xsd:string"/>
748
+ <element name="securityMode" nillable="true" type="xsd:string"/>
749
+ <element name="returnURL" nillable="false" type="xsd:string"/>
750
+ <element name="cancelURL" nillable="false" type="xsd:string"/>
751
+ <element name="notificationURL" nillable="true" type="xsd:string"/>
752
+ <element name="privateDataList" nillable="true" type="tns1:privateDataList"/>
753
+ <element name="customPaymentTemplateURL" nillable="true" type="xsd:string"/>
754
+ <element name="contractNumberWalletList" nillable="true" type="tns1:contractNumberWalletList"/>
755
+ </sequence>
756
+ </complexType>
757
+ </element>
758
+ <element name="createWebWalletResponse">
759
+ <complexType>
760
+ <annotation>
761
+ <documentation>
762
+ This element is the reponse from the
763
+ createWebWallet method
764
+ </documentation>
765
+ </annotation>
766
+ <sequence>
767
+ <element name="result" nillable="false" type="tns1:result"/>
768
+ <element name="token" nillable="false" type="xsd:string"/>
769
+ <element name="redirectURL" nillable="false" type="xsd:string"/>
770
+ </sequence>
771
+ </complexType>
772
+ </element>
773
+ <element name="updateWebWalletRequest">
774
+ <complexType>
775
+ <annotation>
776
+ <documentation>
777
+ This element is the request for the
778
+ updateWebWallet
779
+ method
780
+ </documentation>
781
+ </annotation>
782
+ <sequence>
783
+ <element name="version" nillable="false" type="xsd:string"/>
784
+ <element name="contractNumber" nillable="false" type="xsd:string"/>
785
+ <element name="cardInd" nillable="true" type="xsd:string"/>
786
+ <element name="walletId" nillable="false" type="xsd:string"/>
787
+ <element name="updatePersonalDetails" nillable="true" type="xsd:string"/>
788
+ <element name="updateOwnerDetails" nillable="true" type="xsd:string"/>
789
+ <element name="updatePaymentDetails" nillable="true" type="xsd:string"/>
790
+ <element name="buyer" nillable="true" type="tns1:buyer"/>
791
+ <element name="languageCode" nillable="true" type="xsd:string"/>
792
+ <element name="customPaymentPageCode" nillable="true" type="xsd:string"/>
793
+ <element name="securityMode" nillable="true" type="xsd:string"/>
794
+ <element name="returnURL" nillable="false" type="xsd:string"/>
795
+ <element name="cancelURL" nillable="false" type="xsd:string"/>
796
+ <element name="notificationURL" nillable="true" type="xsd:string"/>
797
+ <element name="privateDataList" nillable="true" type="tns1:privateDataList"/>
798
+ <element name="customPaymentTemplateURL" nillable="true" type="xsd:string"/>
799
+ <element name="contractNumberWalletList" nillable="true" type="tns1:contractNumberWalletList"/>
800
+ </sequence>
801
+ </complexType>
802
+ </element>
803
+ <element name="updateWebWalletResponse">
804
+ <complexType>
805
+ <annotation>
806
+ <documentation>
807
+ This element is the reponse from the
808
+ updateWebWallet method
809
+ </documentation>
810
+ </annotation>
811
+ <sequence>
812
+ <element name="result" nillable="false" type="tns1:result"/>
813
+ <element name="token" nillable="false" type="xsd:string"/>
814
+ <element name="redirectURL" nillable="false" type="xsd:string"/>
815
+ </sequence>
816
+ </complexType>
817
+ </element>
818
+ <element name="getWebWalletRequest">
819
+ <complexType>
820
+ <annotation>
821
+ <documentation>
822
+ This element is the request for the
823
+ getWebWallet
824
+ method
825
+ </documentation>
826
+ </annotation>
827
+ <sequence>
828
+ <element name="version" nillable="false" type="xsd:string"/>
829
+ <element name="token" nillable="false" type="xsd:string"/>
830
+ </sequence>
831
+ </complexType>
832
+ </element>
833
+ <element name="getWebWalletResponse">
834
+ <complexType>
835
+ <annotation>
836
+ <documentation>
837
+ This element is the reponse from the
838
+ getWebWallet
839
+ method
840
+ </documentation>
841
+ </annotation>
842
+ <sequence>
843
+ <element name="result" nillable="false" type="tns1:result"/>
844
+ <element name="wallet" nillable="true" type="tns1:wallet"/>
845
+ <element name="owner" nillable="true" type="tns1:owner"/>
846
+ <element name="privateDataList" nillable="true" type="tns1:privateDataList"/>
847
+ <element name="extendedCard" type="tns1:extendedCardType"/>
848
+ <element name="media" nillable="true" type="xsd:string"/>
849
+ <element name="numberOfAttempt" nillable="true" type="xsd:string"/>
850
+ <element name="contractNumberWalletList" nillable="true" type="tns1:contractNumberWalletList"/>
851
+ </sequence>
852
+ </complexType>
853
+ </element>
854
+ <element name="getTransactionDetailsRequest">
855
+ <complexType>
856
+ <annotation>
857
+ <documentation>
858
+ This element is the request for the
859
+ getTransactionDetails method
860
+ </documentation>
861
+ </annotation>
862
+ <sequence>
863
+ <element name="version" nillable="false" type="xsd:string"/>
864
+ <element name="transactionId" nillable="true" type="xsd:string"/>
865
+ <element name="orderRef" nillable="true" type="xsd:string"/>
866
+ <element name="startDate" nillable="true" type="xsd:string"/>
867
+ <element name="endDate" nillable="true" type="xsd:string"/>
868
+ <element name="transactionHistory" nillable="true" type="xsd:string"/>
869
+ <element name="archiveSearch" nillable="true" type="xsd:string"/>
870
+ </sequence>
871
+ </complexType>
872
+ </element>
873
+ <element name="getTransactionDetailsResponse">
874
+ <complexType>
875
+ <annotation>
876
+ <documentation>
877
+ This element is the response for the
878
+ getTransactionDetails method
879
+ </documentation>
880
+ </annotation>
881
+ <sequence>
882
+ <element name="result" nillable="false" type="tns1:result"/>
883
+ <element name="transaction" nillable="true" type="tns1:transaction"/>
884
+ <element name="payment" nillable="true" type="tns1:payment"/>
885
+ <element name="authorization" nillable="true" type="tns1:authorization"/>
886
+ <element name="order" nillable="true" type="tns1:order"/>
887
+ <element name="buyer" nillable="true" type="tns1:buyer"/>
888
+ <element name="privateDataList" nillable="true" type="tns1:privateDataList"/>
889
+ <element name="card" type="tns1:cardOut"/>
890
+ <element name="extendedCard" type="tns1:extendedCardType"/>
891
+ <element name="associatedTransactionsList" nillable="true" type="tns1:associatedTransactionsList"/>
892
+ <element name="statusHistoryList" nillable="true" type="tns1:statusHistoryList"/>
893
+ <element name="media" nillable="true" type="xsd:string"/>
894
+ <element name="contractNumber" nillable="false" type="xsd:string"/>
895
+ <element minOccurs="0" name="paymentAdditionalList" nillable="true" type="tns1:paymentAdditionalList"/>
896
+ <element name="bankAccountData" nillable="true" type="tns1:bankAccountData"/>
897
+ </sequence>
898
+ </complexType>
899
+ </element>
900
+ <element name="transactionsSearchRequest">
901
+ <complexType>
902
+ <annotation>
903
+ <documentation>
904
+ This element is the request for the
905
+ transactionsSearch method
906
+ </documentation>
907
+ </annotation>
908
+ <sequence>
909
+ <element name="version" nillable="false" type="xsd:string"/>
910
+ <element name="transactionId" nillable="true" type="xsd:string"/>
911
+ <element name="orderRef" nillable="true" type="xsd:string"/>
912
+ <element name="startDate" nillable="true" type="xsd:string"/>
913
+ <element name="endDate" nillable="true" type="xsd:string"/>
914
+ <element name="contractNumber" nillable="true" type="xsd:string"/>
915
+ <element name="authorizationNumber" nillable="true" type="xsd:string"/>
916
+ <element name="returnCode" nillable="true" type="xsd:string"/>
917
+ <element name="paymentMean" nillable="true" type="xsd:string"/>
918
+ <element name="transactionType" nillable="true" type="xsd:string"/>
919
+ <element name="name" nillable="true" type="xsd:string"/>
920
+ <element name="firstName" nillable="true" type="xsd:string"/>
921
+ <element name="email" nillable="true" type="xsd:string"/>
922
+ <element name="cardNumber" nillable="true" type="xsd:string"/>
923
+ <element name="currency" nillable="true" type="xsd:string"/>
924
+ <element name="minAmount" nillable="true" type="xsd:string"/>
925
+ <element name="maxAmount" nillable="true" type="xsd:string"/>
926
+ <element name="walletId" nillable="true" type="xsd:string"/>
927
+ <element name="sequenceNumber" nillable="true" type="xsd:string"/>
928
+ <element name="token" nillable="true" type="xsd:string"/>
929
+ </sequence>
930
+ </complexType>
931
+ </element>
932
+ <element name="transactionsSearchResponse">
933
+ <complexType>
934
+ <annotation>
935
+ <documentation>
936
+ This element is the response for the
937
+ transactionsSearch method
938
+ </documentation>
939
+ </annotation>
940
+ <sequence>
941
+ <element name="result" nillable="false" type="tns1:result"/>
942
+ <element name="transactionList" nillable="true" type="tns1:transactionList"/>
943
+ </sequence>
944
+ </complexType>
945
+ </element>
946
+ <element name="verifyEnrollmentRequest">
947
+ <complexType>
948
+ <annotation>
949
+ <documentation>
950
+ This element is the request for the
951
+ verifyEnrollment method
952
+ </documentation>
953
+ </annotation>
954
+ <sequence>
955
+ <element name="version" nillable="false" type="xsd:string"/>
956
+ <element name="card" nillable="false" type="tns1:card"/>
957
+ <element name="payment" nillable="false" type="tns1:payment"/>
958
+ <element name="orderRef" nillable="false" type="xsd:string"/>
959
+ <element name="mdFieldValue" nillable="true" type="xsd:string"/>
960
+ <element name="userAgent" nillable="true" type="xsd:string"/>
961
+ <element name="walletId" nillable="true" type="xsd:string"/>
962
+ <element name="walletCardInd" nillable="true" type="xsd:string"/>
963
+ </sequence>
964
+ </complexType>
965
+ </element>
966
+ <element name="verifyEnrollmentResponse">
967
+ <complexType>
968
+ <annotation>
969
+ <documentation>
970
+ This element is the reponse from the
971
+ verifyEnrollment method
972
+ </documentation>
973
+ </annotation>
974
+ <sequence>
975
+ <element name="result" nillable="false" type="tns1:result"/>
976
+ <element name="actionUrl" nillable="true" type="xsd:string"/>
977
+ <element name="actionMethod" nillable="true" type="xsd:string"/>
978
+ <element name="pareqFieldName" nillable="true" type="xsd:string"/>
979
+ <element name="pareqFieldValue" nillable="true" type="xsd:string"/>
980
+ <element name="termUrlName" nillable="true" type="xsd:string"/>
981
+ <element name="termUrlValue" nillable="true" type="xsd:string"/>
982
+ <element name="mdFieldName" nillable="true" type="xsd:string"/>
983
+ <element name="mdFieldValue" nillable="true" type="xsd:string"/>
984
+ <element name="mpiResult" nillable="true" type="xsd:string"/>
985
+ <element name="authentication3DSecure" nillable="true" type="tns1:authentication3DSecure"/>
986
+ </sequence>
987
+ </complexType>
988
+ </element>
989
+ <element name="verifyAuthenticationRequest">
990
+ <complexType>
991
+ <annotation>
992
+ <documentation>
993
+ This element is the request for the
994
+ doAuthentication method
995
+ </documentation>
996
+ </annotation>
997
+ <sequence>
998
+ <element name="version" nillable="false" type="xsd:string"/>
999
+ <element name="contractNumber" nillable="false" type="xsd:string"/>
1000
+ <element name="pares" nillable="false" type="xsd:string"/>
1001
+ <element name="md" nillable="true" type="xsd:string"/>
1002
+ <element name="card" nillable="false" type="tns1:card"/>
1003
+ </sequence>
1004
+ </complexType>
1005
+ </element>
1006
+ <element name="verifyAuthenticationResponse">
1007
+ <complexType>
1008
+ <annotation>
1009
+ <documentation>
1010
+ This element is the reponse from the
1011
+ doAuthentication method
1012
+ </documentation>
1013
+ </annotation>
1014
+ <sequence>
1015
+ <element name="result" nillable="false" type="tns1:result"/>
1016
+ <element name="authentication3DSecure" nillable="true" type="tns1:authentication3DSecure"/>
1017
+ <element name="mpiResult" nillable="true" type="xsd:string"/>
1018
+ </sequence>
1019
+ </complexType>
1020
+ </element>
1021
+ <element name="createMerchantRequest">
1022
+ <complexType>
1023
+ <annotation>
1024
+ <documentation>
1025
+ This element is the request for the
1026
+ createMerchant
1027
+ method
1028
+ </documentation>
1029
+ </annotation>
1030
+ <sequence>
1031
+ <element name="corporateName" nillable="true" type="xsd:string"/>
1032
+ <element name="publicName" nillable="true" type="xsd:string"/>
1033
+ <element name="currency">
1034
+ <annotation>
1035
+ <documentation>currency in ISO 4217 numeric format
1036
+ </documentation>
1037
+ </annotation>
1038
+ <simpleType>
1039
+ <restriction base="xsd:string">
1040
+ <length value="3"/>
1041
+ </restriction>
1042
+ </simpleType>
1043
+ </element>
1044
+ <element name="nationalID" nillable="true">
1045
+ <annotation>
1046
+ <documentation>unique national merchant ID</documentation>
1047
+ </annotation>
1048
+ <complexType>
1049
+ <choice>
1050
+ <element name="SIRET">
1051
+ <annotation>
1052
+ <documentation>Systeme d identification du Repertoire des
1053
+ ENtreprises
1054
+ </documentation>
1055
+ </annotation>
1056
+ <simpleType>
1057
+ <restriction base="xsd:string">
1058
+ <length value="14"/>
1059
+ </restriction>
1060
+ </simpleType>
1061
+ </element>
1062
+ <element name="other" type="xsd:string">
1063
+ <annotation>
1064
+ <documentation>to use if country is not France
1065
+ </documentation>
1066
+ </annotation>
1067
+ </element>
1068
+ </choice>
1069
+ </complexType>
1070
+ </element>
1071
+ <element name="distributor" nillable="true" type="xsd:string">
1072
+ <annotation>
1073
+ <documentation>Payline Distributor ID</documentation>
1074
+ </annotation>
1075
+ </element>
1076
+ <element name="merchantAddress" nillable="true" type="tns1:addressInterlocutor"/>
1077
+ <element name="businessInterlocutor" nillable="true" type="tns1:interlocutor"/>
1078
+ <element name="technicalInterlocutor" nillable="true" type="tns1:interlocutor"/>
1079
+ <element name="subscription" nillable="true" type="tns1:subscription"/>
1080
+ <element name="poss" nillable="true">
1081
+ <annotation>
1082
+ <documentation>list of point of sell</documentation>
1083
+ </annotation>
1084
+ <complexType>
1085
+ <sequence>
1086
+ <element maxOccurs="unbounded" minOccurs="0" name="pos" nillable="true" type="tns1:pointOfSell"/>
1087
+ </sequence>
1088
+ </complexType>
1089
+ </element>
1090
+ <element name="partner" nillable="true" type="xsd:string">
1091
+ <annotation>
1092
+ <documentation>Billing partner. 1:monext, 2:cetib, 3:payline.com
1093
+ </documentation>
1094
+ </annotation>
1095
+ </element>
1096
+ </sequence>
1097
+ </complexType>
1098
+ </element>
1099
+ <element name="createMerchantResponse">
1100
+ <complexType>
1101
+ <annotation>
1102
+ <documentation>
1103
+ This element is the reponse from the
1104
+ createMerchant
1105
+ method
1106
+ </documentation>
1107
+ </annotation>
1108
+ <sequence>
1109
+ <element name="result" nillable="false" type="tns1:result"/>
1110
+ <element name="connectionData" nillable="false" type="tns1:connectionData"/>
1111
+ </sequence>
1112
+ </complexType>
1113
+ </element>
1114
+ <element name="doScoringChequeRequest">
1115
+ <complexType>
1116
+ <annotation>
1117
+ <documentation>
1118
+ This element is the request for the
1119
+ doScoringCheque
1120
+ method
1121
+ </documentation>
1122
+ </annotation>
1123
+ <sequence>
1124
+ <element name="version" nillable="false" type="xsd:string"/>
1125
+ <element name="payment" nillable="false" type="tns1:payment"/>
1126
+ <element name="cheque" nillable="false" type="tns1:cheque"/>
1127
+ <element name="order" nillable="false" type="tns1:order"/>
1128
+ <element name="privateDataList" nillable="true" type="tns1:privateDataList"/>
1129
+ <element name="media" nillable="true" type="xsd:string"/>
1130
+ </sequence>
1131
+ </complexType>
1132
+ </element>
1133
+ <element name="doScoringChequeResponse">
1134
+ <complexType>
1135
+ <annotation>
1136
+ <documentation>
1137
+ This element is the reponse from the
1138
+ doScoringCheque method
1139
+ </documentation>
1140
+ </annotation>
1141
+ <sequence>
1142
+ <element name="result" nillable="false" type="tns1:result"/>
1143
+ <element name="transaction" nillable="false" type="tns1:transaction"/>
1144
+ <element name="scoringCheque" nillable="false" type="tns1:scoringCheque"/>
1145
+ </sequence>
1146
+ </complexType>
1147
+ </element>
1148
+ <element name="getEncryptionKeyRequest">
1149
+ <complexType>
1150
+ <annotation>
1151
+ <documentation>
1152
+ This element is the request for the
1153
+ getEncryptionKeyRequest method
1154
+ </documentation>
1155
+ </annotation>
1156
+ </complexType>
1157
+ </element>
1158
+ <element name="getEncryptionKeyResponse">
1159
+ <complexType>
1160
+ <annotation>
1161
+ <documentation>
1162
+ This element is the reponse from the
1163
+ getEncryptionKeyResponse method
1164
+ </documentation>
1165
+ </annotation>
1166
+ <sequence>
1167
+ <element name="result" nillable="false" type="tns1:result"/>
1168
+ <element name="key" nillable="false" type="tns1:key"/>
1169
+ </sequence>
1170
+ </complexType>
1171
+ </element>
1172
+ <element name="doReAuthorizationRequest">
1173
+ <complexType>
1174
+ <annotation>
1175
+ <documentation>
1176
+ This element is the request for the
1177
+ doReAuthorization method
1178
+ </documentation>
1179
+ </annotation>
1180
+ <sequence>
1181
+ <element name="version" nillable="false" type="xsd:string"/>
1182
+ <element name="transactionID" nillable="false" type="xsd:string"/>
1183
+ <element name="payment" nillable="false" type="tns1:payment"/>
1184
+ <element name="order" nillable="true" type="tns1:order"/>
1185
+ <element name="privateDataList" nillable="true" type="tns1:privateDataList"/>
1186
+ <element name="media" nillable="true" type="xsd:string"/>
1187
+ </sequence>
1188
+ </complexType>
1189
+ </element>
1190
+ <element name="doReAuthorizationResponse">
1191
+ <complexType>
1192
+ <annotation>
1193
+ <documentation>
1194
+ This element is the reponse from the
1195
+ doReAuthorization method
1196
+ </documentation>
1197
+ </annotation>
1198
+ <sequence>
1199
+ <element name="result" nillable="false" type="tns1:result"/>
1200
+ <element name="transaction" nillable="false" type="tns1:transaction"/>
1201
+ <element name="card" type="tns1:cardOut"/>
1202
+ <element name="extendedCard" type="tns1:extendedCardType"/>
1203
+ </sequence>
1204
+ </complexType>
1205
+ </element>
1206
+ <element name="getMerchantSettingsRequest">
1207
+ <complexType>
1208
+ <annotation>
1209
+ <documentation>
1210
+ This element is the request for the
1211
+ getMerchantSettings method
1212
+ </documentation>
1213
+ </annotation>
1214
+ <sequence>
1215
+ <element name="version" nillable="true" type="xsd:string"/>
1216
+ </sequence>
1217
+ </complexType>
1218
+ </element>
1219
+ <element name="getMerchantSettingsResponse">
1220
+ <complexType>
1221
+ <annotation>
1222
+ <documentation>
1223
+ This element is the response from the
1224
+ getMerchantSettings method
1225
+ </documentation>
1226
+ </annotation>
1227
+ <sequence>
1228
+ <element name="result" nillable="false" type="tns1:result"/>
1229
+ <element name="listPointOfSell" nillable="false">
1230
+ <complexType>
1231
+ <sequence>
1232
+ <element maxOccurs="unbounded" minOccurs="0" name="pointOfSell" type="tns1:pointOfSell"/>
1233
+ </sequence>
1234
+ </complexType>
1235
+ </element>
1236
+ </sequence>
1237
+ </complexType>
1238
+ </element>
1239
+ <element name="getBalanceRequest">
1240
+ <complexType>
1241
+ <annotation>
1242
+ <documentation>
1243
+ This element is the request for the
1244
+ getBalance
1245
+ method
1246
+ </documentation>
1247
+ </annotation>
1248
+ <sequence>
1249
+ <element name="version" nillable="false" type="xsd:string"/>
1250
+ <element name="cardID" nillable="false" type="xsd:string"/>
1251
+ <element name="contractNumber" nillable="false" type="xsd:string"/>
1252
+ </sequence>
1253
+ </complexType>
1254
+ </element>
1255
+ <element name="getBalanceResponse">
1256
+ <complexType>
1257
+ <annotation>
1258
+ <documentation>
1259
+ This element is the reponse from the
1260
+ getBalance
1261
+ method
1262
+ </documentation>
1263
+ </annotation>
1264
+ <sequence>
1265
+ <element name="result" nillable="false" type="tns1:result"/>
1266
+ <element name="balance" nillable="false">
1267
+ <complexType>
1268
+ <sequence>
1269
+ <element maxOccurs="1" minOccurs="0" name="amount" type="xsd:string"/>
1270
+ <element maxOccurs="1" minOccurs="0" name="currency" type="xsd:string"/>
1271
+ </sequence>
1272
+ </complexType>
1273
+ </element>
1274
+ <element name="crdproduct" nillable="false" type="xsd:string"/>
1275
+ <element name="crdprogram" nillable="false" type="xsd:string"/>
1276
+ <element name="crddesign" nillable="false" type="xsd:string"/>
1277
+ </sequence>
1278
+ </complexType>
1279
+ </element>
1280
+ <element name="getAlertDetailsRequest">
1281
+ <complexType>
1282
+ <sequence>
1283
+ <element maxOccurs="1" minOccurs="1" name="AlertId" nillable="false" type="xsd:string">
1284
+ </element>
1285
+ <element maxOccurs="1" minOccurs="1" name="TransactionId" nillable="false" type="xsd:string">
1286
+ </element>
1287
+ </sequence>
1288
+ </complexType>
1289
+ </element>
1290
+ <element name="getAlertDetailsResponse">
1291
+ <complexType>
1292
+ <sequence>
1293
+ <element name="result" nillable="false" type="tns1:result"/>
1294
+ <element maxOccurs="1" minOccurs="1" name="AlertId" nillable="false" type="xsd:string">
1295
+ </element>
1296
+ <element maxOccurs="1" minOccurs="0" name="ExplanationCode" nillable="true" type="xsd:string">
1297
+ </element>
1298
+ <element maxOccurs="1" minOccurs="0" name="ExplanationLabel" nillable="true" type="xsd:string">
1299
+ </element>
1300
+ <element maxOccurs="1" minOccurs="1" name="TransactionStatus" nillable="false" type="xsd:string">
1301
+ </element>
1302
+ <element maxOccurs="1" minOccurs="1" name="MerchantLabel" nillable="false" type="xsd:string">
1303
+ </element>
1304
+ <element maxOccurs="1" minOccurs="1" name="PosLabel" nillable="false" type="xsd:string">
1305
+ </element>
1306
+ <element maxOccurs="1" minOccurs="1" name="TransactionId" nillable="false" type="xsd:string">
1307
+ </element>
1308
+ <element maxOccurs="1" minOccurs="1" name="SecurityLevel" nillable="false" type="xsd:string">
1309
+ </element>
1310
+ <element maxOccurs="1" minOccurs="1" name="TransactionDate" nillable="false" type="xsd:string">
1311
+ </element>
1312
+ <element maxOccurs="1" minOccurs="1" name="TransactionAmount" nillable="false" type="xsd:string">
1313
+ </element>
1314
+ <element maxOccurs="1" minOccurs="1" name="TransactionCurrency" nillable="false" type="xsd:string">
1315
+ </element>
1316
+ <element maxOccurs="1" minOccurs="1" name="PaymentType" nillable="false" type="xsd:string">
1317
+ </element>
1318
+ <element maxOccurs="1" minOccurs="1" name="PaymentData" nillable="false" type="xsd:string">
1319
+ </element>
1320
+ <element maxOccurs="1" minOccurs="0" name="HolderName" nillable="true" type="xsd:string">
1321
+ </element>
1322
+ <element maxOccurs="1" minOccurs="1" name="ReferenceData" nillable="false" type="xsd:string">
1323
+ </element>
1324
+ <element maxOccurs="1" minOccurs="0" name="CustomerId" nillable="true" type="xsd:string">
1325
+ </element>
1326
+ <element maxOccurs="1" minOccurs="0" name="BuyerFirstName" nillable="true" type="xsd:string">
1327
+ </element>
1328
+ <element maxOccurs="1" minOccurs="0" name="BuyerLastName" nillable="true" type="xsd:string">
1329
+ </element>
1330
+ <element maxOccurs="1" minOccurs="1" name="CustomerTransHist" nillable="false" type="tns1:CustomerTransHist">
1331
+ </element>
1332
+ <element maxOccurs="1" minOccurs="1" name="PaymentMeansTransHist" nillable="false" type="tns1:PaymentMeansTransHist">
1333
+ </element>
1334
+ <element maxOccurs="1" minOccurs="1" name="AlertsTransHist" nillable="false" type="tns1:AlertsTransHist">
1335
+ </element>
1336
+ </sequence>
1337
+ </complexType>
1338
+ </element>
1339
+ <element name="getTokenRequest">
1340
+ <complexType>
1341
+ <sequence>
1342
+ <element name="cardNumber" nillable="false" type="xsd:string"/>
1343
+ <element name="expirationDate" nillable="true" type="xsd:string"/>
1344
+ <element name="contractNumber" nillable="false" type="xsd:string"/>
1345
+ </sequence>
1346
+ </complexType>
1347
+ </element>
1348
+ <element name="getTokenResponse">
1349
+ <complexType>
1350
+ <sequence>
1351
+ <element name="result" nillable="false" type="tns1:result"/>
1352
+ <element maxOccurs="1" minOccurs="1" name="token" nillable="false" type="xsd:string"/>
1353
+ <element maxOccurs="1" minOccurs="1" name="maskedCardNumber" nillable="false" type="xsd:string"/>
1354
+ <element maxOccurs="1" minOccurs="1" name="expirationDate" nillable="false" type="xsd:string"/>
1355
+ <element maxOccurs="1" minOccurs="1" name="virtualCard" nillable="false" type="xsd:string"/>
1356
+ <element maxOccurs="1" minOccurs="1" name="cardType" nillable="false" type="xsd:string"/>
1357
+ <element maxOccurs="1" minOccurs="1" name="cardProduct" nillable="false" type="xsd:string"/>
1358
+ <element maxOccurs="1" minOccurs="1" name="acceptanceNetwork" nillable="false" type="xsd:string"/>
1359
+ <element maxOccurs="1" minOccurs="1" name="bank" nillable="false" type="xsd:string"/>
1360
+ </sequence>
1361
+ </complexType>
1362
+ </element>
1363
+ <element name="unBlockRequest">
1364
+ <complexType>
1365
+ <sequence>
1366
+ <element name="transactionID" nillable="false" type="xsd:string"/>
1367
+ <element name="transactionDate" nillable="true" type="xsd:string"/>
1368
+ <element name="version" nillable="true" type="xsd:string"/>
1369
+ </sequence>
1370
+ </complexType>
1371
+ </element>
1372
+ <element name="unBlockResponse">
1373
+ <complexType>
1374
+ <sequence>
1375
+ <element name="result" nillable="false" type="tns1:result"/>
1376
+ </sequence>
1377
+ </complexType>
1378
+ </element>
1379
+
1380
+ <element name="updatePaymentRecordRequest">
1381
+ <complexType>
1382
+ <sequence>
1383
+ <element name="version" nillable="true" type="xsd:string"/>
1384
+ <element name="contractNumber" nillable="false" type="xsd:string"/>
1385
+ <element name="paymentRecordId" nillable="false" type="xsd:string"/>
1386
+ <element name="recurring" nillable="false" type="tns1:recurringForUpdate"/>
1387
+ </sequence>
1388
+ </complexType>
1389
+ </element>
1390
+ <element name="updatePaymentRecordResponse">
1391
+ <complexType>
1392
+ <sequence>
1393
+ <element name="result" nillable="false" type="tns1:result"/>
1394
+ <element name="recurring" nillable="false" type="tns1:recurring"/>
1395
+ <element name="isDisabled" nillable="false" type="xsd:string"/>
1396
+ <element name="disableDate" nillable="false" type="xsd:string"/>
1397
+ <element name="privateDataList" nillable="false" type="tns1:privateDataList"/>
1398
+ <element name="order" nillable="false" type="tns1:order"/>
1399
+ <element name="walletId" nillable="false" type="xsd:string"/>
1400
+ </sequence>
1401
+ </complexType>
1402
+ </element>
1403
+
1404
+ <element name="getBillingRecordRequest">
1405
+ <complexType>
1406
+ <sequence>
1407
+ <element name="contractNumber" nillable="false" type="xsd:string"/>
1408
+ <element name="paymentRecordId" nillable="false" type="xsd:string"/>
1409
+ <element name="billingRecordId" nillable="false" type="xsd:string"/>
1410
+ </sequence>
1411
+ </complexType>
1412
+ </element>
1413
+ <element name="getBillingRecordResponse">
1414
+ <complexType>
1415
+ <sequence>
1416
+ <element name="result" nillable="false" type="tns1:result"/>
1417
+ <element name="recurring" nillable="false" type="tns1:recurring"/>
1418
+ <element name="isDisabled" nillable="true" type="xsd:string"/>
1419
+ <element name="disableDate" nillable="true" type="xsd:string"/>
1420
+ <element name="billingRecord" nillable="false" type="tns1:billingRecord"/>
1421
+ <element name="order" nillable="true" type="tns1:order"/>
1422
+ <element name="privateDataList" nillable="true" type="tns1:privateDataList"/>
1423
+ <element name="walletId" nillable="false" type="xsd:string"/>
1424
+ </sequence>
1425
+ </complexType>
1426
+ </element>
1427
+
1428
+ <element name="updateBillingRecordRequest">
1429
+ <complexType>
1430
+ <sequence>
1431
+ <element name="contractNumber" nillable="false" type="xsd:string"/>
1432
+ <element name="paymentRecordId" nillable="false" type="xsd:string"/>
1433
+ <element name="billingRecordId" nillable="false" type="xsd:string"/>
1434
+ <element name="billingRecordForUpdate" nillable="false" type="tns1:billingRecordForUpdate"/>
1435
+ </sequence>
1436
+ </complexType>
1437
+ </element>
1438
+
1439
+ <element name="updateBillingRecordResponse">
1440
+ <complexType>
1441
+ <sequence>
1442
+ <element name="result" nillable="false" type="tns1:result"/>
1443
+ <element name="recurring" nillable="false" type="tns1:recurring"/>
1444
+ <element name="isDisabled" nillable="true" type="xsd:string"/>
1445
+ <element name="disableDate" nillable="true" type="xsd:string"/>
1446
+ <element name="billingRecord" nillable="false" type="tns1:billingRecord"/>
1447
+ <element name="order" nillable="true" type="tns1:order"/>
1448
+ <element name="privateDataList" nillable="true" type="tns1:privateDataList"/>
1449
+ <element name="walletId" nillable="false" type="xsd:string"/>
1450
+ </sequence>
1451
+ </complexType>
1452
+ </element>
1453
+
1454
+ </schema>
1455
+ <schema elementFormDefault="qualified" targetNamespace="http://obj.ws.payline.experian.com" xmlns="http://www.w3.org/2001/XMLSchema">
1456
+ <complexType name="result">
1457
+ <annotation>
1458
+ <documentation>
1459
+ This element contains information about the
1460
+ process
1461
+ </documentation>
1462
+ </annotation>
1463
+ <sequence>
1464
+ <element name="code" nillable="false" type="xsd:string"/>
1465
+ <element minOccurs="0" name="shortMessage" nillable="true" type="xsd:string"/>
1466
+ <element minOccurs="0" name="longMessage" nillable="true" type="xsd:string"/>
1467
+ </sequence>
1468
+ </complexType>
1469
+ <complexType name="cardOut">
1470
+ <sequence>
1471
+ <element minOccurs="0" name="number" nillable="true" type="xsd:string"/>
1472
+ <element minOccurs="0" name="type" nillable="true" type="xsd:string"/>
1473
+ <element minOccurs="0" name="expirationDate" nillable="true" type="xsd:string"/>
1474
+ <element minOccurs="0" name="cardholder" nillable="true" type="xsd:string"/>
1475
+ <element minOccurs="0" name="token" nillable="true" type="xsd:string"/>
1476
+ </sequence>
1477
+ </complexType>
1478
+
1479
+ <complexType name="extendedCardType">
1480
+ <sequence>
1481
+ <element minOccurs="0" name="country" nillable="true" type="xsd:string"/>
1482
+ <element minOccurs="0" name="isCvd" nillable="true" type="xsd:string"/>
1483
+ <element minOccurs="0" name="bank" nillable="true" type="xsd:string"/>
1484
+ <element minOccurs="0" name="type" nillable="true" type="xsd:string"/>
1485
+ <element minOccurs="0" name="network" nillable="true" type="xsd:string"/>
1486
+ <element minOccurs="0" name="product" nillable="true" type="xsd:string"/>
1487
+ </sequence>
1488
+ </complexType>
1489
+ <complexType name="order">
1490
+ <annotation>
1491
+ <documentation>
1492
+ This element contains information about the
1493
+ order
1494
+ </documentation>
1495
+ </annotation>
1496
+ <sequence>
1497
+ <element name="ref" nillable="false" type="xsd:string"/>
1498
+ <element minOccurs="0" name="origin" nillable="true" type="xsd:string"/>
1499
+ <element minOccurs="0" name="country" nillable="true" type="xsd:string"/>
1500
+ <element minOccurs="0" name="taxes" nillable="true" type="xsd:string"/>
1501
+ <element name="amount" nillable="false" type="xsd:string"/>
1502
+ <element name="currency" nillable="false" type="xsd:string"/>
1503
+ <element name="date" nillable="false" type="xsd:string"/>
1504
+ <element minOccurs="0" name="details" nillable="true" type="tns1:details"/>
1505
+ <element minOccurs="0" name="deliveryTime" nillable="true" type="xsd:string"/>
1506
+ <element minOccurs="0" name="deliveryMode" nillable="true" type="xsd:string"/>
1507
+ <element minOccurs="0" name="deliveryExpectedDate" nillable="true" type="xsd:string"/>
1508
+ <element minOccurs="0" name="deliveryExpectedDelay" nillable="true" type="xsd:string"/>
1509
+ </sequence>
1510
+ </complexType>
1511
+ <complexType name="key">
1512
+ <annotation>
1513
+ <documentation>
1514
+ This element contains information about the
1515
+ encryptionKey
1516
+ </documentation>
1517
+ </annotation>
1518
+ <sequence>
1519
+ <element name="keyId" nillable="false" type="xsd:integer"/>
1520
+ <element name="modulus" nillable="false" type="xsd:string"/>
1521
+ <element name="publicExponent" nillable="false" type="xsd:string"/>
1522
+ <element name="expirationDate" nillable="false" type="xsd:string"/>
1523
+ </sequence>
1524
+ </complexType>
1525
+ <complexType name="details">
1526
+ <annotation>
1527
+ <documentation>
1528
+ This element contains an array of orderDetail
1529
+ </documentation>
1530
+ </annotation>
1531
+ <sequence>
1532
+ <element maxOccurs="100" minOccurs="0" name="details" type="tns1:orderDetail"/>
1533
+ </sequence>
1534
+ </complexType>
1535
+
1536
+ <complexType name="orderDetail">
1537
+ <annotation>
1538
+ <documentation>
1539
+ This element contains information about the
1540
+ order
1541
+ product
1542
+ </documentation>
1543
+ </annotation>
1544
+ <sequence>
1545
+ <element minOccurs="0" name="ref" nillable="true" type="xsd:string"/>
1546
+ <element minOccurs="0" name="price" nillable="true" type="xsd:string"/>
1547
+ <element minOccurs="0" name="quantity" nillable="true" type="xsd:string"/>
1548
+ <element minOccurs="0" name="comment" nillable="true" type="xsd:string"/>
1549
+ <element minOccurs="0" name="category" nillable="true" type="xsd:string"/>
1550
+ <element minOccurs="0" name="brand" nillable="true" type="xsd:string"/>
1551
+ <element minOccurs="0" name="subcategory1" nillable="true" type="xsd:string"/>
1552
+ <element minOccurs="0" name="subcategory2" nillable="true" type="xsd:string"/>
1553
+ <element minOccurs="0" name="additionalData" nillable="true" type="xsd:string"/>
1554
+ <element minOccurs="0" name="taxRate" nillable="true" type="xsd:string"/>
1555
+ </sequence>
1556
+ </complexType>
1557
+ <complexType name="privateData">
1558
+ <annotation>
1559
+ <documentation>
1560
+ This element contains information about the
1561
+ merchant
1562
+ private data
1563
+ </documentation>
1564
+ </annotation>
1565
+ <sequence>
1566
+ <element name="key" nillable="false" type="xsd:string"/>
1567
+ <element name="value" nillable="false" type="xsd:string"/>
1568
+ </sequence>
1569
+ </complexType>
1570
+ <complexType name="transaction">
1571
+ <annotation>
1572
+ <documentation>
1573
+ This element contains information about the
1574
+ transaction
1575
+ </documentation>
1576
+ </annotation>
1577
+ <sequence>
1578
+ <element name="id" nillable="false" type="xsd:string"/>
1579
+ <element name="date" nillable="false" type="xsd:string"/>
1580
+ <element minOccurs="0" name="isDuplicated" nillable="true" type="xsd:string"/>
1581
+ <element name="isPossibleFraud" nillable="true" type="xsd:string"/>
1582
+ <element minOccurs="0" name="fraudResult" nillable="true" type="xsd:string"/>
1583
+ <element minOccurs="0" name="fraudResultDetails" nillable="true" type="tns1:fraudResultDetails"/>
1584
+ <element minOccurs="0" name="explanation" nillable="true" type="xsd:string"/>
1585
+ <element minOccurs="0" name="threeDSecure" nillable="true" type="xsd:string"/>
1586
+ <element minOccurs="0" name="score" nillable="true" type="xsd:string"/>
1587
+ <element minOccurs="0" name="externalWalletType" nillable="true" type="xsd:string"/>
1588
+ <element minOccurs="0" name="externalWalletContractNumber" nillable="true" type="xsd:string"/>
1589
+
1590
+ </sequence>
1591
+ </complexType>
1592
+ <complexType name="fraudResultDetails">
1593
+ <annotation>
1594
+ <documentation>
1595
+ This element contains information about the
1596
+ fraud
1597
+ result details
1598
+ </documentation>
1599
+ </annotation>
1600
+ <sequence>
1601
+ <element name="code" nillable="false" type="xsd:string"/>
1602
+ <element name="shortMessage" nillable="false" type="xsd:string"/>
1603
+ <element name="longMessage" nillable="false" type="xsd:string"/>
1604
+ </sequence>
1605
+ </complexType>
1606
+ <complexType name="payment">
1607
+ <annotation>
1608
+ <documentation>
1609
+ This element contains information about the
1610
+ payment
1611
+ </documentation>
1612
+ </annotation>
1613
+ <sequence>
1614
+ <element name="amount" nillable="true" type="xsd:string"/>
1615
+ <element name="currency" nillable="false" type="xsd:string"/>
1616
+ <element name="action" nillable="false" type="xsd:string"/>
1617
+ <element name="mode" nillable="false" type="xsd:string"/>
1618
+ <element name="contractNumber" nillable="false" type="xsd:string"/>
1619
+ <element minOccurs="0" name="differedActionDate" nillable="true" type="xsd:string"/>
1620
+ <element minOccurs="0" name="method" nillable="true" type="xsd:string"/>
1621
+ </sequence>
1622
+ </complexType>
1623
+ <complexType name="authorization">
1624
+ <annotation>
1625
+ <documentation>
1626
+ This element contains information about the
1627
+ authorization
1628
+ </documentation>
1629
+ </annotation>
1630
+ <sequence>
1631
+ <element name="number" nillable="false" type="xsd:string"/>
1632
+ <element name="date" nillable="false" type="xsd:string"/>
1633
+ </sequence>
1634
+ </complexType>
1635
+ <complexType name="card">
1636
+ <annotation>
1637
+ <documentation>
1638
+ This element contains information about the card
1639
+ </documentation>
1640
+ </annotation>
1641
+ <sequence>
1642
+ <element minOccurs="0" name="encryptionKeyId" nillable="true" type="xsd:string"/>
1643
+ <element minOccurs="0" name="encryptedData" nillable="true" type="xsd:string"/>
1644
+ <element minOccurs="0" name="number" nillable="true" type="xsd:string"/>
1645
+ <element name="type" nillable="false" type="xsd:string"/>
1646
+ <element minOccurs="0" name="expirationDate" nillable="true" type="xsd:string"/>
1647
+ <element minOccurs="0" name="cvx" nillable="true" type="xsd:string"/>
1648
+ <element minOccurs="0" name="ownerBirthdayDate" nillable="true" type="xsd:string"/>
1649
+ <element minOccurs="0" name="password" nillable="true" type="xsd:string"/>
1650
+ <element minOccurs="0" name="cardPresent" nillable="true" type="xsd:string"/>
1651
+ <element minOccurs="0" name="cardholder" nillable="true" type="xsd:string"/>
1652
+ <element minOccurs="0" name="token" nillable="true" type="xsd:string"/>
1653
+ </sequence>
1654
+ </complexType>
1655
+ <complexType name="buyer">
1656
+ <annotation>
1657
+ <documentation>
1658
+ This element contains information about the
1659
+ buyer
1660
+ </documentation>
1661
+ </annotation>
1662
+ <sequence>
1663
+ <element name="title" nillable="true" type="xsd:string"/>
1664
+ <element name="lastName" nillable="true" type="xsd:string"/>
1665
+ <element name="firstName" nillable="true" type="xsd:string"/>
1666
+ <element name="email" nillable="true" type="xsd:string"/>
1667
+ <element name="shippingAdress" nillable="true" type="tns1:address"/>
1668
+ <element name="billingAddress" nillable="true" type="tns1:address"/>
1669
+ <element name="accountCreateDate" nillable="true" type="xsd:string"/>
1670
+ <element name="accountAverageAmount" nillable="true" type="xsd:string"/>
1671
+ <element name="accountOrderCount" nillable="true" type="xsd:string"/>
1672
+ <element name="walletId" nillable="true" type="xsd:string"/>
1673
+ <element name="walletDisplayed" nillable="true" type="xsd:string"/>
1674
+ <element name="walletSecured" nillable="true" type="xsd:string"/>
1675
+ <element name="walletCardInd" nillable="true" type="xsd:string"/>
1676
+ <element name="ip" nillable="true" type="xsd:string"/>
1677
+ <element name="mobilePhone" nillable="true" type="xsd:string"/>
1678
+ <element name="customerId" nillable="true" type="xsd:string"/>
1679
+ <element name="legalStatus" nillable="true" type="xsd:string"/>
1680
+ <element name="legalDocument" nillable="true" type="xsd:string"/>
1681
+ <element name="birthDate" nillable="true" type="xsd:string"/>
1682
+ <element name="fingerprintID" nillable="true" type="xsd:string"/>
1683
+ </sequence>
1684
+ </complexType>
1685
+ <complexType name="owner">
1686
+ <annotation>
1687
+ <documentation>
1688
+ This element contains information about the
1689
+ owner
1690
+ </documentation>
1691
+ </annotation>
1692
+ <sequence>
1693
+ <element name="lastName" nillable="true" type="xsd:string"/>
1694
+ <element name="firstName" nillable="true" type="xsd:string"/>
1695
+ <element name="billingAddress" nillable="true" type="tns1:addressOwner"/>
1696
+ <element name="issueCardDate" nillable="true" type="xsd:string"/>
1697
+ </sequence>
1698
+ </complexType>
1699
+ <complexType name="address">
1700
+ <annotation>
1701
+ <documentation>
1702
+ This element contains information about the
1703
+ address
1704
+ </documentation>
1705
+ </annotation>
1706
+ <sequence>
1707
+ <element minOccurs="0" name="title" nillable="true" type="xsd:string"/>
1708
+ <element minOccurs="0" name="name" nillable="true" type="xsd:string"/>
1709
+ <element minOccurs="0" name="firstName" nillable="true" type="xsd:string"/>
1710
+ <element minOccurs="0" name="lastName" nillable="true" type="xsd:string"/>
1711
+ <element minOccurs="0" name="street1" nillable="true" type="xsd:string"/>
1712
+ <element minOccurs="0" name="street2" nillable="true" type="xsd:string"/>
1713
+ <element minOccurs="0" name="cityName" nillable="true" type="xsd:string"/>
1714
+ <element minOccurs="0" name="zipCode" nillable="true" type="xsd:string"/>
1715
+ <element minOccurs="0" name="country" nillable="true" type="xsd:string"/>
1716
+ <element minOccurs="0" name="phone" nillable="true" type="xsd:string"/>
1717
+ <element minOccurs="0" name="state" nillable="true" type="xsd:string"/>
1718
+ <element minOccurs="0" name="county" nillable="true" type="xsd:string"/>
1719
+ <element minOccurs="0" name="phoneType" nillable="true" type="xsd:string"/>
1720
+ </sequence>
1721
+ </complexType>
1722
+ <complexType name="addressOwner">
1723
+ <annotation>
1724
+ <documentation>
1725
+ This element contains information about the
1726
+ address
1727
+ </documentation>
1728
+ </annotation>
1729
+ <sequence>
1730
+ <element name="street" nillable="true" type="xsd:string"/>
1731
+ <element name="cityName" nillable="true" type="xsd:string"/>
1732
+ <element name="zipCode" nillable="true" type="xsd:string"/>
1733
+ <element name="country" nillable="true" type="xsd:string"/>
1734
+ <element name="phone" nillable="true" type="xsd:string"/>
1735
+ </sequence>
1736
+ </complexType>
1737
+ <complexType name="capture">
1738
+ <annotation>
1739
+ <documentation>
1740
+ This element contains information about the
1741
+ capture
1742
+ </documentation>
1743
+ </annotation>
1744
+ <sequence>
1745
+ <element name="transactionID" nillable="false" type="xsd:string"/>
1746
+ <element name="payment" nillable="false" type="tns1:payment"/>
1747
+ </sequence>
1748
+ </complexType>
1749
+ <complexType name="refund">
1750
+ <annotation>
1751
+ <documentation>
1752
+ This element contains information about the
1753
+ refund
1754
+ </documentation>
1755
+ </annotation>
1756
+ <sequence>
1757
+ <element name="transactionID" nillable="false" type="xsd:string"/>
1758
+ <element name="payment" nillable="false" type="tns1:payment"/>
1759
+ </sequence>
1760
+ </complexType>
1761
+ <complexType name="selectedContractList">
1762
+ <annotation>
1763
+ <documentation>
1764
+ This element contains the list of selected card
1765
+ </documentation>
1766
+ </annotation>
1767
+ <sequence>
1768
+ <element maxOccurs="25" minOccurs="1" name="selectedContract" type="xsd:string"/>
1769
+ </sequence>
1770
+ </complexType>
1771
+ <complexType name="privateDataList">
1772
+ <annotation>
1773
+ <documentation>
1774
+ An array of private data
1775
+ </documentation>
1776
+ </annotation>
1777
+ <sequence>
1778
+ <element maxOccurs="100" minOccurs="0" name="privateData" type="tns1:privateData"/>
1779
+ </sequence>
1780
+ </complexType>
1781
+ <complexType name="contractNumberWalletList">
1782
+ <annotation>
1783
+ <documentation>
1784
+ An array of contract number of a wallet
1785
+ </documentation>
1786
+ </annotation>
1787
+ <sequence>
1788
+ <element maxOccurs="10" minOccurs="0" name="contractNumberWallet" type="xsd:string"/>
1789
+ </sequence>
1790
+ </complexType>
1791
+ <complexType name="cardsList">
1792
+ <annotation>
1793
+ <documentation>
1794
+ An array of cards
1795
+ </documentation>
1796
+ </annotation>
1797
+ <sequence>
1798
+ <element maxOccurs="99" minOccurs="0" name="cards" type="tns1:cards"/>
1799
+ </sequence>
1800
+ </complexType>
1801
+ <complexType name="captureAuthorizationList">
1802
+ <annotation>
1803
+ <documentation>
1804
+ An array of authorization to capture
1805
+ </documentation>
1806
+ </annotation>
1807
+ <sequence>
1808
+ <element maxOccurs="5000" minOccurs="1" name="capture" type="tns1:capture"/>
1809
+ </sequence>
1810
+ </complexType>
1811
+ <complexType name="refundAuthorizationList">
1812
+ <annotation>
1813
+ <documentation>
1814
+ An array of authorization to refund
1815
+ </documentation>
1816
+ </annotation>
1817
+ <sequence>
1818
+ <element maxOccurs="5000" minOccurs="1" name="refund" type="tns1:refund"/>
1819
+ </sequence>
1820
+ </complexType>
1821
+ <complexType name="resetAuthorizationList">
1822
+ <annotation>
1823
+ <documentation>
1824
+ An array of authorization to reset
1825
+ </documentation>
1826
+ </annotation>
1827
+ <sequence>
1828
+ <element maxOccurs="5000" minOccurs="1" name="transactionID" type="xsd:string"/>
1829
+ </sequence>
1830
+ </complexType>
1831
+ <complexType name="recurring">
1832
+ <annotation>
1833
+ <documentation>
1834
+ This element contains element for recurring
1835
+ operation
1836
+ </documentation>
1837
+ </annotation>
1838
+ <sequence>
1839
+ <element name="firstAmount" nillable="true" type="xsd:string"/>
1840
+ <element name="amount" nillable="false" type="xsd:string"/>
1841
+ <element name="billingCycle" nillable="false" type="xsd:string"/>
1842
+ <element name="billingLeft" nillable="false" type="xsd:string"/>
1843
+ <element name="billingDay" nillable="true" type="xsd:string"/>
1844
+ <element name="startDate" nillable="true" type="xsd:string"/>
1845
+ <element name="endDate" nillable="true" type="xsd:string"/>
1846
+ <element name="newAmount" nillable="true" type="xsd:string"/>
1847
+ <element name="amountModificationDate" nillable="true" type="xsd:string"/>
1848
+ </sequence>
1849
+ </complexType>
1850
+ <complexType name="recurringForUpdate">
1851
+ <annotation>
1852
+ <documentation>
1853
+ This element contains element for update a recurring
1854
+ operation
1855
+ </documentation>
1856
+ </annotation>
1857
+ <sequence>
1858
+ <element name="billingLeft" nillable="true" type="xsd:string"/>
1859
+ <element name="billingDay" nillable="true" type="xsd:string"/>
1860
+ <element name="endDate" nillable="true" type="xsd:string"/>
1861
+ <element name="newAmount" nillable="true" type="xsd:string"/>
1862
+ <element name="amountModificationDate" nillable="true" type="xsd:string"/>
1863
+ </sequence>
1864
+ </complexType>
1865
+ <complexType name="billingRecord">
1866
+ <annotation>
1867
+ <documentation>
1868
+ This element contains element for a billing
1869
+ record
1870
+ </documentation>
1871
+ </annotation>
1872
+ <sequence>
1873
+ <element name="date" nillable="false" type="xsd:string"/>
1874
+ <element name="amount" nillable="false" type="xsd:string"/>
1875
+ <element name="status" nillable="false" type="xsd:string"/>
1876
+ <element minOccurs="0" name="result" nillable="true" type="tns1:result"/>
1877
+ <element minOccurs="0" name="transaction" nillable="true" type="tns1:transaction"/>
1878
+ <element minOccurs="0" name="authorization" nillable="true" type="tns1:authorization"/>
1879
+ <element minOccurs="0" name="nbTry" nillable="true" type="xsd:string"/>
1880
+ <element minOccurs="0" name="rank" nillable="true" type="xsd:string"/>
1881
+ </sequence>
1882
+ </complexType>
1883
+ <complexType name="billingRecordList">
1884
+ <annotation>
1885
+ <documentation>
1886
+ An array of billing record
1887
+ </documentation>
1888
+ </annotation>
1889
+ <sequence>
1890
+ <element maxOccurs="100" minOccurs="0" name="billingRecord" type="tns1:billingRecord"/>
1891
+ </sequence>
1892
+ </complexType>
1893
+
1894
+ <complexType name="billingRecordForUpdate">
1895
+ <annotation>
1896
+ <documentation>
1897
+ This element contains element for update a recurring
1898
+ operation
1899
+ </documentation>
1900
+ </annotation>
1901
+ <sequence>
1902
+ <element name="date" nillable="true" type="xsd:string"/>
1903
+ <element name="amount" nillable="true" type="xsd:string"/>
1904
+ <element name="status" nillable="true" type="xsd:string"/>
1905
+ <element name="executionDate" nillable="true" type="xsd:string"/>
1906
+ </sequence>
1907
+ </complexType>
1908
+
1909
+ <complexType name="wallet">
1910
+ <annotation>
1911
+ <documentation>
1912
+ This element contains element for a wallet
1913
+ </documentation>
1914
+ </annotation>
1915
+ <sequence>
1916
+ <element name="walletId" nillable="false" type="xsd:string"/>
1917
+ <element minOccurs="0" name="lastName" nillable="true" type="xsd:string"/>
1918
+ <element minOccurs="0" name="firstName" nillable="true" type="xsd:string"/>
1919
+ <element minOccurs="0" name="email" nillable="true" type="xsd:string"/>
1920
+ <element minOccurs="0" name="shippingAddress" nillable="true" type="tns1:address"/>
1921
+ <element name="card" nillable="false" type="tns1:card"/>
1922
+ <element minOccurs="0" name="comment" nillable="true" type="xsd:string"/>
1923
+ <element minOccurs="0" name="default" nillable="true" type="xsd:string"/>
1924
+ <element minOccurs="0" name="cardStatus" nillable="true" type="xsd:string"/>
1925
+ </sequence>
1926
+ </complexType>
1927
+ <complexType name="cards">
1928
+ <annotation>
1929
+ <documentation>
1930
+ This element contains element for a wallet
1931
+ </documentation>
1932
+ </annotation>
1933
+ <sequence>
1934
+ <element name="walletId" nillable="false" type="xsd:string"/>
1935
+ <element name="lastName" nillable="true" type="xsd:string"/>
1936
+ <element name="firstName" nillable="true" type="xsd:string"/>
1937
+ <element name="email" nillable="true" type="xsd:string"/>
1938
+ <element name="shippingAddress" nillable="true" type="tns1:address"/>
1939
+ <element name="card" nillable="false" type="tns1:card"/>
1940
+ <element name="cardInd" nillable="true" type="xsd:string"/>
1941
+ <element name="comment" nillable="true" type="xsd:string"/>
1942
+ <element name="isDisabled" nillable="true" type="xsd:string"/>
1943
+ <element name="disableDate" nillable="true" type="xsd:string"/>
1944
+ <element name="extendedCard" nillable="true" type="tns1:extendedCardType"/>
1945
+ <element name="default" nillable="true" type="xsd:string"/>
1946
+ </sequence>
1947
+ </complexType>
1948
+ <complexType name="walletIdList">
1949
+ <annotation>
1950
+ <documentation>
1951
+ This element contains the list of selected card
1952
+ </documentation>
1953
+ </annotation>
1954
+ <sequence>
1955
+ <element maxOccurs="500" minOccurs="1" name="walletId" type="xsd:string"/>
1956
+ </sequence>
1957
+ </complexType>
1958
+ <complexType name="transactionList">
1959
+ <annotation>
1960
+ <documentation>
1961
+ This element contains the list of selected card
1962
+ </documentation>
1963
+ </annotation>
1964
+ <sequence>
1965
+ <element maxOccurs="5000" minOccurs="0" name="transaction" type="tns1:transaction"/>
1966
+ </sequence>
1967
+ </complexType>
1968
+ <complexType name="authentication3DSecure">
1969
+ <annotation>
1970
+ <documentation>
1971
+ This element contains element for a 3DSecure
1972
+ transaction
1973
+ </documentation>
1974
+ </annotation>
1975
+ <sequence>
1976
+ <element minOccurs="0" name="md" nillable="true" type="xsd:string"/>
1977
+ <element minOccurs="0" name="pares" nillable="true" type="xsd:string"/>
1978
+ <element minOccurs="0" name="xid" nillable="true" type="xsd:string"/>
1979
+ <element minOccurs="0" name="eci" nillable="true" type="xsd:string"/>
1980
+ <element minOccurs="0" name="cavv" nillable="true" type="xsd:string"/>
1981
+ <element minOccurs="0" name="cavvAlgorithm" nillable="true" type="xsd:string"/>
1982
+ <element minOccurs="0" name="vadsResult" nillable="true" type="xsd:string"/>
1983
+ <element minOccurs="0" name="typeSecurisation" nillable="true" type="xsd:string"/>
1984
+ </sequence>
1985
+ </complexType>
1986
+ <complexType name="connectionData">
1987
+ <annotation>
1988
+ <documentation>
1989
+ This element contains the merchant connection
1990
+ parameters
1991
+ </documentation>
1992
+ </annotation>
1993
+ <sequence>
1994
+ <element name="merchantId" nillable="false" type="xsd:string"/>
1995
+ <element name="userId" nillable="false" type="xsd:string"/>
1996
+ <element name="password" nillable="false" type="xsd:string"/>
1997
+ <element name="secretQuestion" nillable="false" type="xsd:string"/>
1998
+ <element name="secretAnswer" nillable="false" type="xsd:string"/>
1999
+ </sequence>
2000
+ </complexType>
2001
+ <complexType name="scoringCheque">
2002
+ <annotation>
2003
+ <documentation>
2004
+ This element contains the scoring cheque parameters
2005
+ </documentation>
2006
+ </annotation>
2007
+ <sequence>
2008
+ <element name="chequeNumber" nillable="false" type="xsd:string"/>
2009
+ <element name="additionalDataResponse" nillable="false" type="xsd:string"/>
2010
+ <element name="terminalId" nillable="false" type="xsd:string"/>
2011
+ <element name="additionalPrivateData" nillable="false" type="xsd:string"/>
2012
+ </sequence>
2013
+ </complexType>
2014
+ <complexType name="addressInterlocutor">
2015
+ <annotation>
2016
+ <documentation>
2017
+ This element contains information about Interlocutor
2018
+ address
2019
+ </documentation>
2020
+ </annotation>
2021
+ <sequence>
2022
+ <element name="street1" nillable="true" type="xsd:string"/>
2023
+ <element name="street2" nillable="true" type="xsd:string"/>
2024
+ <element name="city" nillable="true" type="xsd:string"/>
2025
+ <element name="zipCode" nillable="true" type="xsd:string"/>
2026
+ <element name="state" nillable="true" type="xsd:string"/>
2027
+ <element name="country" nillable="true" type="xsd:string"/>
2028
+ </sequence>
2029
+ </complexType>
2030
+ <complexType name="interlocutor">
2031
+ <annotation>
2032
+ <documentation>
2033
+ This element contains information about Interlocutor
2034
+ </documentation>
2035
+ </annotation>
2036
+ <sequence>
2037
+ <element name="firstName" nillable="true" type="xsd:string"/>
2038
+ <element name="lastName" nillable="true" type="xsd:string"/>
2039
+ <element name="email" nillable="true" type="xsd:string"/>
2040
+ <element name="phone" nillable="true" type="xsd:string"/>
2041
+ <element name="mobile" nillable="true" type="xsd:string"/>
2042
+ <element name="fax" nillable="true" type="xsd:string"/>
2043
+ <element name="addressInterlocutor" nillable="true" type="tns1:addressInterlocutor"/>
2044
+ </sequence>
2045
+ </complexType>
2046
+ <complexType name="option">
2047
+ <annotation>
2048
+ <documentation>
2049
+ An array of subscribed options
2050
+ </documentation>
2051
+ </annotation>
2052
+ <sequence>
2053
+ <element name="id" type="xsd:string"/>
2054
+ <element name="subscribed" nillable="true" type="xsd:boolean"/>
2055
+ <element name="endDate" nillable="true" type="xsd:dateTime"/>
2056
+ </sequence>
2057
+ </complexType>
2058
+ <complexType name="subscription">
2059
+ <annotation>
2060
+ <documentation>
2061
+ This element contains information about the payline
2062
+ package subscribed by the merchant
2063
+ </documentation>
2064
+ </annotation>
2065
+ <sequence>
2066
+ <element name="id" type="xsd:string"/>
2067
+ <element maxOccurs="unbounded" minOccurs="0" name="option" type="tns1:option"/>
2068
+ </sequence>
2069
+ </complexType>
2070
+ <complexType name="iban">
2071
+ <annotation>
2072
+ <documentation>
2073
+ This element contains IBAN information
2074
+ </documentation>
2075
+ </annotation>
2076
+ <sequence>
2077
+ <element name="CountryCode" nillable="true" type="xsd:string"/>
2078
+ <element name="checkKey" nillable="true" type="xsd:string"/>
2079
+ <element name="BBAN" nillable="true" type="xsd:string"/>
2080
+ <element name="BIC" nillable="true" type="xsd:string"/>
2081
+ </sequence>
2082
+ </complexType>
2083
+ <complexType name="rib">
2084
+ <annotation>
2085
+ <documentation>
2086
+ This element contains RIB information
2087
+ </documentation>
2088
+ </annotation>
2089
+ <sequence>
2090
+ <element name="tellerCode" nillable="true" type="xsd:string"/>
2091
+ <element name="accountNumber" nillable="true" type="xsd:string"/>
2092
+ <element name="key" nillable="true" type="xsd:string"/>
2093
+ </sequence>
2094
+ </complexType>
2095
+ <complexType name="bankAccount">
2096
+ <annotation>
2097
+ <documentation>
2098
+ This element contains bankAccount information
2099
+ </documentation>
2100
+ </annotation>
2101
+ <sequence>
2102
+ <element name="bankCode" nillable="true" type="xsd:string"/>
2103
+ <element name="bankNumber" nillable="true" type="xsd:string"/>
2104
+ <element name="iban" nillable="true" type="tns1:iban"/>
2105
+ <element name="rib" nillable="true" type="tns1:rib"/>
2106
+ </sequence>
2107
+ </complexType>
2108
+ <complexType name="bankAccountData">
2109
+ <annotation>
2110
+ <documentation>
2111
+ This element contains bank Account information
2112
+ </documentation>
2113
+ </annotation>
2114
+ <sequence>
2115
+ <element name="countryCode" nillable="true" type="xsd:string"/>
2116
+ <element name="bankCode" nillable="true" type="xsd:string"/>
2117
+ <element name="accountNumber" nillable="true" type="xsd:string"/>
2118
+ <element name="key" nillable="true" type="xsd:string"/>
2119
+ </sequence>
2120
+ </complexType>
2121
+ <complexType name="technicalData">
2122
+ <annotation>
2123
+ <documentation>
2124
+ This element contains technical data used to define
2125
+ acquirer service
2126
+ </documentation>
2127
+ </annotation>
2128
+ <sequence>
2129
+ <element name="terminalNumber" nillable="true" type="xsd:string"/>
2130
+ <element name="GTInstance" nillable="true" type="xsd:string"/>
2131
+ <element name="paymentProfil" nillable="true" type="xsd:string"/>
2132
+ </sequence>
2133
+ </complexType>
2134
+ <complexType name="contract">
2135
+ <annotation>
2136
+ <documentation>
2137
+ This element contains all information about contract
2138
+ </documentation>
2139
+ </annotation>
2140
+ <sequence>
2141
+ <element name="cardType" nillable="true" type="xsd:string"/>
2142
+ <element minOccurs="0" name="label" nillable="true" type="xsd:string"/>
2143
+ <element name="contractNumber" nillable="true" type="xsd:string"/>
2144
+ <element name="currency" nillable="true" type="xsd:string"/>
2145
+ <element default="Manual" name="settlementType">
2146
+ <simpleType>
2147
+ <restriction base="xsd:string">
2148
+ <enumeration value="Manual"/>
2149
+ <enumeration value="Now"/>
2150
+ <enumeration value="1Day"/>
2151
+ <enumeration value="2Day"/>
2152
+ <enumeration value="3Day"/>
2153
+ <enumeration value="4Day"/>
2154
+ <enumeration value="5Day"/>
2155
+ <enumeration value="6Day"/>
2156
+ <enumeration value="7Day"/>
2157
+ </restriction>
2158
+ </simpleType>
2159
+ </element>
2160
+ <element name="maxAmountPerTransaction" nillable="true" type="xsd:int"/>
2161
+ <element name="technicalData" nillable="true" type="tns1:technicalData"/>
2162
+ <element name="bankAccount" nillable="true" type="tns1:bankAccount"/>
2163
+ <element name="acquirerInterlocutor" nillable="true" type="tns1:interlocutor"/>
2164
+ <element name="description" nillable="true" type="xsd:string"/>
2165
+ <element name="logoEnable" nillable="false" type="xsd:boolean"/>
2166
+ <element maxOccurs="1" minOccurs="0" name="smallLogoMime" type="xsd:string">
2167
+ </element>
2168
+ <element maxOccurs="1" minOccurs="0" name="smallLogo" type="xsd:base64Binary">
2169
+ </element>
2170
+ <element maxOccurs="1" minOccurs="0" name="normalLogoMime" type="xsd:string">
2171
+ </element>
2172
+ <element maxOccurs="1" minOccurs="0" name="normalLogo" type="xsd:base64Binary">
2173
+ </element>
2174
+ <element maxOccurs="1" minOccurs="0" name="contribution" type="tns1:contribution">
2175
+ </element>
2176
+ <element maxOccurs="1" minOccurs="0" name="enrolment3DS" type="xsd:string">
2177
+ </element>
2178
+ </sequence>
2179
+ </complexType>
2180
+ <complexType name="customPaymentPageCode">
2181
+ <annotation>
2182
+ <documentation>
2183
+ This element contains all information about
2184
+ customPaymentPageCode
2185
+ </documentation>
2186
+ </annotation>
2187
+ <sequence>
2188
+ <element name="code" nillable="true" type="xsd:string"/>
2189
+ <element name="label" nillable="true" type="xsd:string"/>
2190
+ <element name="type" nillable="true" type="xsd:string"/>
2191
+ </sequence>
2192
+ </complexType>
2193
+ <complexType name="ticketSend">
2194
+ <annotation>
2195
+ <documentation>
2196
+ This element contains information e-ticket
2197
+ </documentation>
2198
+ </annotation>
2199
+ <sequence>
2200
+ <element name="toBuyer" nillable="true" type="xsd:boolean"/>
2201
+ <element name="toMerchant" nillable="true" type="xsd:boolean"/>
2202
+ </sequence>
2203
+ </complexType>
2204
+ <complexType name="pointOfSell">
2205
+ <annotation>
2206
+ <documentation>
2207
+ This element contains all information about point of
2208
+ sell
2209
+ </documentation>
2210
+ </annotation>
2211
+ <sequence>
2212
+ <element name="siret" nillable="true" type="xsd:string"/>
2213
+ <element name="codeMcc" nillable="true">
2214
+ <annotation>
2215
+ <documentation>Merchant Category Code</documentation>
2216
+ </annotation>
2217
+ <simpleType>
2218
+ <restriction base="xsd:string">
2219
+ <xsd:length value="4"/>
2220
+ </restriction>
2221
+ </simpleType>
2222
+ </element>
2223
+ <element name="label" nillable="true" type="xsd:string"/>
2224
+ <element name="webmasterEmail" nillable="true" type="xsd:string"/>
2225
+ <element minOccurs="0" name="comments" nillable="true" type="xsd:string"/>
2226
+ <element name="webstoreURL" nillable="true" type="xsd:string"/>
2227
+ <element name="notificationURL" nillable="true" type="xsd:string"/>
2228
+ <element minOccurs="0" name="privateLifeURL" nillable="true" type="xsd:string"/>
2229
+ <element minOccurs="0" name="saleCondURL" nillable="true" type="xsd:string"/>
2230
+ <element minOccurs="0" name="buyerMustAcceptSaleCond" nillable="true" type="xsd:boolean"/>
2231
+ <element minOccurs="0" name="endOfPaymentRedirection" nillable="true" type="xsd:boolean"/>
2232
+ <element name="ticketSend" nillable="true" type="tns1:ticketSend"/>
2233
+ <element name="contracts">
2234
+ <annotation>
2235
+ <documentation>list of contract</documentation>
2236
+ </annotation>
2237
+ <complexType>
2238
+ <sequence>
2239
+ <element maxOccurs="unbounded" minOccurs="0" name="contract" type="tns1:contract"/>
2240
+ </sequence>
2241
+ </complexType>
2242
+ </element>
2243
+ <element name="virtualTerminal" nillable="true" type="tns1:virtualTerminal"/>
2244
+ <element name="customPaymentPageCodeList">
2245
+ <annotation>
2246
+ <documentation>list of custom payment page code</documentation>
2247
+ </annotation>
2248
+ <complexType>
2249
+ <sequence>
2250
+ <element maxOccurs="unbounded" minOccurs="0" name="customPaymentPageCode" type="tns1:customPaymentPageCode"/>
2251
+ </sequence>
2252
+ </complexType>
2253
+ </element>
2254
+ </sequence>
2255
+ </complexType>
2256
+ <complexType name="virtualTerminal">
2257
+ <annotation>
2258
+ <documentation>virtualTerminal</documentation>
2259
+ </annotation>
2260
+ <sequence>
2261
+ <element name="label" type="xsd:string"/>
2262
+ <element default="10" name="inactivityDelay" type="xsd:int">
2263
+ <annotation>
2264
+ <documentation>http session timeout delay</documentation>
2265
+ </annotation>
2266
+ </element>
2267
+ <element minOccurs="0" name="logo" type="xsd:string">
2268
+ <annotation>
2269
+ <documentation>path to logo</documentation>
2270
+ </annotation>
2271
+ </element>
2272
+ <element name="functions">
2273
+ <annotation>
2274
+ <documentation>list of functions</documentation>
2275
+ </annotation>
2276
+ <complexType>
2277
+ <sequence>
2278
+ <element maxOccurs="unbounded" name="function" type="tns1:virtualTerminalFunction"/>
2279
+ </sequence>
2280
+ </complexType>
2281
+ </element>
2282
+ </sequence>
2283
+ </complexType>
2284
+ <complexType name="virtualTerminalFunction">
2285
+ <annotation>
2286
+ <documentation>functions availbe in virtual terminal
2287
+ </documentation>
2288
+ </annotation>
2289
+ <sequence>
2290
+ <element name="function">
2291
+ <annotation>
2292
+ <documentation>Please refer to Payline documentation
2293
+ </documentation>
2294
+ </annotation>
2295
+ <simpleType>
2296
+ <restriction base="xsd:string">
2297
+ <enumeration value="simplePayment"/>
2298
+ <enumeration value="walletCreation"/>
2299
+ <enumeration value="nXPayment"/>
2300
+ </restriction>
2301
+ </simpleType>
2302
+ </element>
2303
+ <element name="label" type="xsd:string"/>
2304
+ <sequence minOccurs="0">
2305
+ <element maxOccurs="unbounded" name="functionParameter">
2306
+ <annotation>
2307
+ <documentation>Value of parameter</documentation>
2308
+ </annotation>
2309
+ <complexType>
2310
+ <attribute name="id">
2311
+ <annotation>
2312
+ <documentation>Parameter ID. Refer to payline documentation
2313
+ </documentation>
2314
+ </annotation>
2315
+ </attribute>
2316
+ </complexType>
2317
+ </element>
2318
+ </sequence>
2319
+ </sequence>
2320
+ </complexType>
2321
+ <complexType name="cheque">
2322
+ <annotation>
2323
+ <documentation>
2324
+ This element contains information about the
2325
+ cheque
2326
+ </documentation>
2327
+ </annotation>
2328
+ <sequence>
2329
+ <element name="number" nillable="false" type="xsd:string"/>
2330
+ </sequence>
2331
+ </complexType>
2332
+ <complexType name="contribution">
2333
+ <annotation>
2334
+ <documentation>
2335
+ This element contains all information about
2336
+ contrinution
2337
+ </documentation>
2338
+ </annotation>
2339
+ <sequence>
2340
+ <element name="enable" type="xsd:boolean"/>
2341
+ <element name="type" nillable="true" type="xsd:string"/>
2342
+ <element name="value" nillable="true" type="xsd:string"/>
2343
+ <element name="nbFreeTransaction" nillable="true" type="xsd:string"/>
2344
+ <element name="minAmountTransaction" nillable="true" type="xsd:string"/>
2345
+ <element name="maxAmountTransaction" nillable="true" type="xsd:string"/>
2346
+ </sequence>
2347
+ </complexType>
2348
+ <complexType name="associatedTransactions">
2349
+ <annotation>
2350
+ <documentation>
2351
+ This element contains information about the
2352
+ associated transactions
2353
+ </documentation>
2354
+ </annotation>
2355
+ <sequence>
2356
+ <element name="transactionId" nillable="false" type="xsd:string"/>
2357
+ <element name="type" nillable="false" type="xsd:string"/>
2358
+ <element name="date" nillable="false" type="string"/>
2359
+ <element name="amount" nillable="false" type="xsd:string"/>
2360
+ <element name="status" nillable="false" type="xsd:string"/>
2361
+ <element name="originTransactionId" nillable="false" type="xsd:string"/>
2362
+ </sequence>
2363
+ </complexType>
2364
+
2365
+ <complexType name="associatedTransactionsList">
2366
+ <annotation>
2367
+ <documentation>
2368
+ An array of associatedTransactions
2369
+ </documentation>
2370
+ </annotation>
2371
+ <sequence>
2372
+ <element maxOccurs="100" minOccurs="0" name="associatedTransactions" type="tns1:associatedTransactions"/>
2373
+ </sequence>
2374
+ </complexType>
2375
+
2376
+ <complexType name="statusHistory">
2377
+ <annotation>
2378
+ <documentation>
2379
+ This element contains information about the
2380
+ status
2381
+ History
2382
+ </documentation>
2383
+ </annotation>
2384
+ <sequence>
2385
+ <element name="transactionId" nillable="false" type="xsd:string"/>
2386
+ <element name="date" nillable="false" type="string"/>
2387
+ <element name="amount" nillable="false" type="xsd:string"/>
2388
+ <element name="fees" nillable="false" type="xsd:string"/>
2389
+ <element name="status" nillable="false" type="xsd:string"/>
2390
+ <element name="originTransactionId" nillable="false" type="xsd:string"/>
2391
+ </sequence>
2392
+ </complexType>
2393
+
2394
+ <complexType name="statusHistoryList">
2395
+ <annotation>
2396
+ <documentation>
2397
+ An array of statusHistory
2398
+ </documentation>
2399
+ </annotation>
2400
+ <sequence>
2401
+ <element maxOccurs="100" minOccurs="0" name="statusHistory" type="tns1:statusHistory"/>
2402
+ </sequence>
2403
+ </complexType>
2404
+ <complexType name="paymentAdditional">
2405
+ <annotation>
2406
+ <documentation>
2407
+ This element contains information about the
2408
+ paymentAdditional
2409
+ </documentation>
2410
+ </annotation>
2411
+ <sequence>
2412
+ <element name="transaction" nillable="false" type="tns1:transaction"/>
2413
+ <element name="payment" nillable="false" type="tns1:payment"/>
2414
+ <element name="authorization" nillable="false" type="tns1:authorization"/>
2415
+ <element minOccurs="0" name="authentication3DSecure" nillable="true" type="tns1:authentication3DSecure"/>
2416
+ <element minOccurs="0" name="card" nillable="true" type="tns1:cardOut"/>
2417
+ <element minOccurs="0" name="extendedCard" nillable="true" type="tns1:extendedCardType"/>
2418
+ </sequence>
2419
+ </complexType>
2420
+
2421
+ <complexType name="paymentAdditionalList">
2422
+ <annotation>
2423
+ <documentation>
2424
+ An array of paymentAdditionalList
2425
+ </documentation>
2426
+ </annotation>
2427
+ <sequence>
2428
+ <element maxOccurs="100" minOccurs="0" name="paymentAdditional" type="tns1:paymentAdditional"/>
2429
+ </sequence>
2430
+ </complexType>
2431
+
2432
+ <complexType name="CustomerTransHist">
2433
+ <annotation>
2434
+ <documentation>
2435
+ An array of CustomerTrans
2436
+ </documentation>
2437
+ </annotation>
2438
+ <sequence>
2439
+ <element maxOccurs="unbounded" minOccurs="0" name="CustomerTrans" type="tns1:CustomerTrans">
2440
+ </element>
2441
+ </sequence>
2442
+ </complexType>
2443
+ <complexType name="CustomerTrans">
2444
+ <sequence>
2445
+ <element maxOccurs="1" minOccurs="1" name="IsLCLFAlerted" nillable="false" type="xsd:string">
2446
+ </element>
2447
+ <element maxOccurs="1" minOccurs="1" name="ExternalTransactionId" nillable="false" type="xsd:string">
2448
+ </element>
2449
+ <element maxOccurs="1" minOccurs="1" name="ReferenceOrder" nillable="false" type="xsd:string">
2450
+ </element>
2451
+ <element maxOccurs="1" minOccurs="1" name="CardCode" nillable="false" type="xsd:string">
2452
+ </element>
2453
+ <element maxOccurs="1" minOccurs="1" name="TransactionDate" nillable="false" type="xsd:string">
2454
+ </element>
2455
+ <element maxOccurs="1" minOccurs="1" name="Amount" nillable="false" type="xsd:string">
2456
+ </element>
2457
+ <element maxOccurs="1" minOccurs="1" name="Status" nillable="false" type="xsd:string">
2458
+ </element>
2459
+ <element maxOccurs="1" minOccurs="1" name="PosLabel" nillable="false" type="xsd:string">
2460
+ </element>
2461
+ </sequence>
2462
+ </complexType>
2463
+
2464
+ <complexType name="PaymentMeansTransHist">
2465
+ <annotation>
2466
+ <documentation>
2467
+ An array of PaymentMeansTrans
2468
+ </documentation>
2469
+ </annotation>
2470
+ <sequence>
2471
+ <element maxOccurs="unbounded" minOccurs="0" name="PaymentMeansTrans" type="tns1:PaymentMeansTrans">
2472
+ </element>
2473
+ </sequence>
2474
+ </complexType>
2475
+ <complexType name="PaymentMeansTrans">
2476
+ <sequence>
2477
+ <element maxOccurs="1" minOccurs="1" name="IsLCLFAlerted" nillable="false" type="xsd:string">
2478
+ </element>
2479
+ <element maxOccurs="1" minOccurs="1" name="ExternalTransactionId" nillable="false" type="xsd:string">
2480
+ </element>
2481
+ <element maxOccurs="1" minOccurs="1" name="ReferenceOrder" nillable="false" type="xsd:string">
2482
+ </element>
2483
+ <element maxOccurs="1" minOccurs="0" name="CustomerData" nillable="true" type="xsd:string">
2484
+ </element>
2485
+ <element maxOccurs="1" minOccurs="1" name="TransactionDate" nillable="false" type="xsd:string">
2486
+ </element>
2487
+ <element maxOccurs="1" minOccurs="1" name="Amount" nillable="false" type="xsd:string">
2488
+ </element>
2489
+ <element maxOccurs="1" minOccurs="1" name="Status" nillable="false" type="xsd:string">
2490
+ </element>
2491
+ <element maxOccurs="1" minOccurs="1" name="PosLabel" nillable="false" type="xsd:string">
2492
+ </element>
2493
+ </sequence>
2494
+ </complexType>
2495
+
2496
+ <complexType name="AlertsTransHist">
2497
+ <annotation>
2498
+ <documentation>
2499
+ An array of AlertsTrans
2500
+ </documentation>
2501
+ </annotation>
2502
+ <sequence>
2503
+ <element maxOccurs="unbounded" minOccurs="0" name="AlertsTrans" type="tns1:AlertsTrans">
2504
+ </element>
2505
+ </sequence>
2506
+ </complexType>
2507
+ <complexType name="AlertsTrans">
2508
+ <sequence>
2509
+ <element maxOccurs="1" minOccurs="1" name="AlertId" nillable="false" type="xsd:string">
2510
+ </element>
2511
+ <element maxOccurs="1" minOccurs="1" name="ExplanationLabel" nillable="false" type="xsd:string">
2512
+ </element>
2513
+ <element maxOccurs="1" minOccurs="1" name="ExplanationCode" nillable="false" type="xsd:string">
2514
+ </element>
2515
+ <element maxOccurs="1" minOccurs="1" name="RuleName" nillable="false" type="xsd:string">
2516
+ </element>
2517
+ <element maxOccurs="1" minOccurs="0" name="RuleAction" nillable="true" type="xsd:string">
2518
+ </element>
2519
+ <element maxOccurs="1" minOccurs="0" name="RuleCriteria" nillable="true" type="xsd:string">
2520
+ </element>
2521
+ </sequence>
2522
+ </complexType>
2523
+
2524
+ </schema>
2525
+ </wsdl:types>
2526
+ <wsdl:message name="getTransactionDetailsRequest">
2527
+ <wsdl:part name="parameters" element="impl:getTransactionDetailsRequest">
2528
+ </wsdl:part>
2529
+ </wsdl:message>
2530
+ <wsdl:message name="doScheduledWalletPaymentRequest">
2531
+ <wsdl:part name="parameters" element="impl:doScheduledWalletPaymentRequest">
2532
+ </wsdl:part>
2533
+ </wsdl:message>
2534
+ <wsdl:message name="doDebitRequest">
2535
+ <wsdl:part name="parameters" element="impl:doDebitRequest">
2536
+ </wsdl:part>
2537
+ </wsdl:message>
2538
+ <wsdl:message name="doScheduledWalletPaymentResponse">
2539
+ <wsdl:part name="parameters" element="impl:doScheduledWalletPaymentResponse">
2540
+ </wsdl:part>
2541
+ </wsdl:message>
2542
+ <wsdl:message name="doCaptureResponse">
2543
+ <wsdl:part name="parameters" element="impl:doCaptureResponse">
2544
+ </wsdl:part>
2545
+ </wsdl:message>
2546
+ <wsdl:message name="doRecurrentWalletPaymentRequest">
2547
+ <wsdl:part name="parameters" element="impl:doRecurrentWalletPaymentRequest">
2548
+ </wsdl:part>
2549
+ </wsdl:message>
2550
+ <wsdl:message name="getWalletRequest">
2551
+ <wsdl:part name="parameters" element="impl:getWalletRequest">
2552
+ </wsdl:part>
2553
+ </wsdl:message>
2554
+ <wsdl:message name="doAuthorizationResponse">
2555
+ <wsdl:part name="parameters" element="impl:doAuthorizationResponse">
2556
+ </wsdl:part>
2557
+ </wsdl:message>
2558
+ <wsdl:message name="getCardsResponse">
2559
+ <wsdl:part name="parameters" element="impl:getCardsResponse">
2560
+ </wsdl:part>
2561
+ </wsdl:message>
2562
+ <wsdl:message name="createWebWalletRequest">
2563
+ <wsdl:part name="parameters" element="impl:createWebWalletRequest">
2564
+ </wsdl:part>
2565
+ </wsdl:message>
2566
+ <wsdl:message name="getBalanceResponse">
2567
+ <wsdl:part name="parameters" element="impl:getBalanceResponse">
2568
+ </wsdl:part>
2569
+ </wsdl:message>
2570
+ <wsdl:message name="verifyAuthenticationRequest">
2571
+ <wsdl:part name="parameters" element="impl:verifyAuthenticationRequest">
2572
+ </wsdl:part>
2573
+ </wsdl:message>
2574
+ <wsdl:message name="verifyEnrollmentRequest">
2575
+ <wsdl:part name="parameters" element="impl:verifyEnrollmentRequest">
2576
+ </wsdl:part>
2577
+ </wsdl:message>
2578
+ <wsdl:message name="getWebWalletRequest">
2579
+ <wsdl:part name="parameters" element="impl:getWebWalletRequest">
2580
+ </wsdl:part>
2581
+ </wsdl:message>
2582
+ <wsdl:message name="verifyAuthenticationResponse">
2583
+ <wsdl:part name="parameters" element="impl:verifyAuthenticationResponse">
2584
+ </wsdl:part>
2585
+ </wsdl:message>
2586
+ <wsdl:message name="doScoringChequeRequest">
2587
+ <wsdl:part name="parameters" element="impl:doScoringChequeRequest">
2588
+ </wsdl:part>
2589
+ </wsdl:message>
2590
+ <wsdl:message name="doRefundRequest">
2591
+ <wsdl:part name="parameters" element="impl:doRefundRequest">
2592
+ </wsdl:part>
2593
+ </wsdl:message>
2594
+ <wsdl:message name="getWebWalletResponse">
2595
+ <wsdl:part name="parameters" element="impl:getWebWalletResponse">
2596
+ </wsdl:part>
2597
+ </wsdl:message>
2598
+ <wsdl:message name="getAlertDetailsRequest">
2599
+ <wsdl:part name="parameters" element="impl:getAlertDetailsRequest">
2600
+ </wsdl:part>
2601
+ </wsdl:message>
2602
+ <wsdl:message name="getBalanceRequest">
2603
+ <wsdl:part name="parameters" element="impl:getBalanceRequest">
2604
+ </wsdl:part>
2605
+ </wsdl:message>
2606
+ <wsdl:message name="updateWalletRequest">
2607
+ <wsdl:part name="parameters" element="impl:updateWalletRequest">
2608
+ </wsdl:part>
2609
+ </wsdl:message>
2610
+ <wsdl:message name="doScoringChequeResponse">
2611
+ <wsdl:part name="parameters" element="impl:doScoringChequeResponse">
2612
+ </wsdl:part>
2613
+ </wsdl:message>
2614
+ <wsdl:message name="getBillingRecordResponse">
2615
+ <wsdl:part name="parameters" element="impl:getBillingRecordResponse">
2616
+ </wsdl:part>
2617
+ </wsdl:message>
2618
+ <wsdl:message name="getPaymentRecordRequest">
2619
+ <wsdl:part name="parameters" element="impl:getPaymentRecordRequest">
2620
+ </wsdl:part>
2621
+ </wsdl:message>
2622
+ <wsdl:message name="updateWebWalletRequest">
2623
+ <wsdl:part name="parameters" element="impl:updateWebWalletRequest">
2624
+ </wsdl:part>
2625
+ </wsdl:message>
2626
+ <wsdl:message name="unBlockRequest">
2627
+ <wsdl:part name="parameters" element="impl:unBlockRequest">
2628
+ </wsdl:part>
2629
+ </wsdl:message>
2630
+ <wsdl:message name="enableWalletRequest">
2631
+ <wsdl:part name="parameters" element="impl:enableWalletRequest">
2632
+ </wsdl:part>
2633
+ </wsdl:message>
2634
+ <wsdl:message name="doImmediateWalletPaymentRequest">
2635
+ <wsdl:part name="parameters" element="impl:doImmediateWalletPaymentRequest">
2636
+ </wsdl:part>
2637
+ </wsdl:message>
2638
+ <wsdl:message name="updateWalletResponse">
2639
+ <wsdl:part name="parameters" element="impl:updateWalletResponse">
2640
+ </wsdl:part>
2641
+ </wsdl:message>
2642
+ <wsdl:message name="doImmediateWalletPaymentResponse">
2643
+ <wsdl:part name="parameters" element="impl:doImmediateWalletPaymentResponse">
2644
+ </wsdl:part>
2645
+ </wsdl:message>
2646
+ <wsdl:message name="doAuthorizationRequest">
2647
+ <wsdl:part name="parameters" element="impl:doAuthorizationRequest">
2648
+ </wsdl:part>
2649
+ </wsdl:message>
2650
+ <wsdl:message name="doWebPaymentRequest">
2651
+ <wsdl:part name="parameters" element="impl:doWebPaymentRequest">
2652
+ </wsdl:part>
2653
+ </wsdl:message>
2654
+ <wsdl:message name="getWalletResponse">
2655
+ <wsdl:part name="parameters" element="impl:getWalletResponse">
2656
+ </wsdl:part>
2657
+ </wsdl:message>
2658
+ <wsdl:message name="doDebitResponse">
2659
+ <wsdl:part name="parameters" element="impl:doDebitResponse">
2660
+ </wsdl:part>
2661
+ </wsdl:message>
2662
+ <wsdl:message name="updateBillingRecordResponse">
2663
+ <wsdl:part name="parameters" element="impl:updateBillingRecordResponse">
2664
+ </wsdl:part>
2665
+ </wsdl:message>
2666
+ <wsdl:message name="disableWalletRequest">
2667
+ <wsdl:part name="parameters" element="impl:disableWalletRequest">
2668
+ </wsdl:part>
2669
+ </wsdl:message>
2670
+ <wsdl:message name="createMerchantRequest">
2671
+ <wsdl:part name="parameters" element="impl:createMerchantRequest">
2672
+ </wsdl:part>
2673
+ </wsdl:message>
2674
+ <wsdl:message name="getEncryptionKeyResponse">
2675
+ <wsdl:part name="parameters" element="impl:getEncryptionKeyResponse">
2676
+ </wsdl:part>
2677
+ </wsdl:message>
2678
+ <wsdl:message name="createMerchantResponse">
2679
+ <wsdl:part name="parameters" element="impl:createMerchantResponse">
2680
+ </wsdl:part>
2681
+ </wsdl:message>
2682
+ <wsdl:message name="getMerchantSettingsRequest">
2683
+ <wsdl:part name="parameters" element="impl:getMerchantSettingsRequest">
2684
+ </wsdl:part>
2685
+ </wsdl:message>
2686
+ <wsdl:message name="disableWalletResponse">
2687
+ <wsdl:part name="parameters" element="impl:disableWalletResponse">
2688
+ </wsdl:part>
2689
+ </wsdl:message>
2690
+ <wsdl:message name="doRecurrentWalletPaymentResponse">
2691
+ <wsdl:part name="parameters" element="impl:doRecurrentWalletPaymentResponse">
2692
+ </wsdl:part>
2693
+ </wsdl:message>
2694
+ <wsdl:message name="createWalletResponse">
2695
+ <wsdl:part name="parameters" element="impl:createWalletResponse">
2696
+ </wsdl:part>
2697
+ </wsdl:message>
2698
+ <wsdl:message name="manageWebWalletRequest">
2699
+ <wsdl:part name="parameters" element="impl:manageWebWalletRequest">
2700
+ </wsdl:part>
2701
+ </wsdl:message>
2702
+ <wsdl:message name="doCreditResponse">
2703
+ <wsdl:part name="parameters" element="impl:doCreditResponse">
2704
+ </wsdl:part>
2705
+ </wsdl:message>
2706
+ <wsdl:message name="getPaymentRecordResponse">
2707
+ <wsdl:part name="parameters" element="impl:getPaymentRecordResponse">
2708
+ </wsdl:part>
2709
+ </wsdl:message>
2710
+ <wsdl:message name="transactionsSearchRequest">
2711
+ <wsdl:part name="parameters" element="impl:transactionsSearchRequest">
2712
+ </wsdl:part>
2713
+ </wsdl:message>
2714
+ <wsdl:message name="updateBillingRecordRequest">
2715
+ <wsdl:part name="parameters" element="impl:updateBillingRecordRequest">
2716
+ </wsdl:part>
2717
+ </wsdl:message>
2718
+ <wsdl:message name="getTokenResponse">
2719
+ <wsdl:part name="parameters" element="impl:getTokenResponse">
2720
+ </wsdl:part>
2721
+ </wsdl:message>
2722
+ <wsdl:message name="getWebPaymentDetailsResponse">
2723
+ <wsdl:part name="parameters" element="impl:getWebPaymentDetailsResponse">
2724
+ </wsdl:part>
2725
+ </wsdl:message>
2726
+ <wsdl:message name="verifyEnrollmentResponse">
2727
+ <wsdl:part name="parameters" element="impl:verifyEnrollmentResponse">
2728
+ </wsdl:part>
2729
+ </wsdl:message>
2730
+ <wsdl:message name="updatePaymentRecordRequest">
2731
+ <wsdl:part name="parameters" element="impl:updatePaymentRecordRequest">
2732
+ </wsdl:part>
2733
+ </wsdl:message>
2734
+ <wsdl:message name="doReAuthorizationRequest">
2735
+ <wsdl:part name="parameters" element="impl:doReAuthorizationRequest">
2736
+ </wsdl:part>
2737
+ </wsdl:message>
2738
+ <wsdl:message name="createWalletRequest">
2739
+ <wsdl:part name="parameters" element="impl:createWalletRequest">
2740
+ </wsdl:part>
2741
+ </wsdl:message>
2742
+ <wsdl:message name="getEncryptionKeyRequest">
2743
+ <wsdl:part name="parameters" element="impl:getEncryptionKeyRequest">
2744
+ </wsdl:part>
2745
+ </wsdl:message>
2746
+ <wsdl:message name="doResetResponse">
2747
+ <wsdl:part name="parameters" element="impl:doResetResponse">
2748
+ </wsdl:part>
2749
+ </wsdl:message>
2750
+ <wsdl:message name="manageWebWalletResponse">
2751
+ <wsdl:part name="parameters" element="impl:manageWebWalletResponse">
2752
+ </wsdl:part>
2753
+ </wsdl:message>
2754
+ <wsdl:message name="createWebWalletResponse">
2755
+ <wsdl:part name="parameters" element="impl:createWebWalletResponse">
2756
+ </wsdl:part>
2757
+ </wsdl:message>
2758
+ <wsdl:message name="unBlockResponse">
2759
+ <wsdl:part name="parameters" element="impl:unBlockResponse">
2760
+ </wsdl:part>
2761
+ </wsdl:message>
2762
+ <wsdl:message name="doReAuthorizationResponse">
2763
+ <wsdl:part name="parameters" element="impl:doReAuthorizationResponse">
2764
+ </wsdl:part>
2765
+ </wsdl:message>
2766
+ <wsdl:message name="doCreditRequest">
2767
+ <wsdl:part name="parameters" element="impl:doCreditRequest">
2768
+ </wsdl:part>
2769
+ </wsdl:message>
2770
+ <wsdl:message name="getTokenRequest">
2771
+ <wsdl:part name="parameters" element="impl:getTokenRequest">
2772
+ </wsdl:part>
2773
+ </wsdl:message>
2774
+ <wsdl:message name="doRefundResponse">
2775
+ <wsdl:part name="parameters" element="impl:doRefundResponse">
2776
+ </wsdl:part>
2777
+ </wsdl:message>
2778
+ <wsdl:message name="getTransactionDetailsResponse">
2779
+ <wsdl:part name="parameters" element="impl:getTransactionDetailsResponse">
2780
+ </wsdl:part>
2781
+ </wsdl:message>
2782
+ <wsdl:message name="getAlertDetailsResponse">
2783
+ <wsdl:part name="parameters" element="impl:getAlertDetailsResponse">
2784
+ </wsdl:part>
2785
+ </wsdl:message>
2786
+ <wsdl:message name="doCaptureRequest">
2787
+ <wsdl:part name="parameters" element="impl:doCaptureRequest">
2788
+ </wsdl:part>
2789
+ </wsdl:message>
2790
+ <wsdl:message name="getBillingRecordRequest">
2791
+ <wsdl:part name="parameters" element="impl:getBillingRecordRequest">
2792
+ </wsdl:part>
2793
+ </wsdl:message>
2794
+ <wsdl:message name="disablePaymentRecordRequest">
2795
+ <wsdl:part name="parameters" element="impl:disablePaymentRecordRequest">
2796
+ </wsdl:part>
2797
+ </wsdl:message>
2798
+ <wsdl:message name="updateWebWalletResponse">
2799
+ <wsdl:part name="parameters" element="impl:updateWebWalletResponse">
2800
+ </wsdl:part>
2801
+ </wsdl:message>
2802
+ <wsdl:message name="updatePaymentRecordResponse">
2803
+ <wsdl:part name="parameters" element="impl:updatePaymentRecordResponse">
2804
+ </wsdl:part>
2805
+ </wsdl:message>
2806
+ <wsdl:message name="doWebPaymentResponse">
2807
+ <wsdl:part name="parameters" element="impl:doWebPaymentResponse">
2808
+ </wsdl:part>
2809
+ </wsdl:message>
2810
+ <wsdl:message name="getWebPaymentDetailsRequest">
2811
+ <wsdl:part name="parameters" element="impl:getWebPaymentDetailsRequest">
2812
+ </wsdl:part>
2813
+ </wsdl:message>
2814
+ <wsdl:message name="doResetRequest">
2815
+ <wsdl:part name="parameters" element="impl:doResetRequest">
2816
+ </wsdl:part>
2817
+ </wsdl:message>
2818
+ <wsdl:message name="enableWalletResponse">
2819
+ <wsdl:part name="parameters" element="impl:enableWalletResponse">
2820
+ </wsdl:part>
2821
+ </wsdl:message>
2822
+ <wsdl:message name="getMerchantSettingsResponse">
2823
+ <wsdl:part name="parameters" element="impl:getMerchantSettingsResponse">
2824
+ </wsdl:part>
2825
+ </wsdl:message>
2826
+ <wsdl:message name="disablePaymentRecordResponse">
2827
+ <wsdl:part name="parameters" element="impl:disablePaymentRecordResponse">
2828
+ </wsdl:part>
2829
+ </wsdl:message>
2830
+ <wsdl:message name="transactionsSearchResponse">
2831
+ <wsdl:part name="parameters" element="impl:transactionsSearchResponse">
2832
+ </wsdl:part>
2833
+ </wsdl:message>
2834
+ <wsdl:message name="getCardsRequest">
2835
+ <wsdl:part name="parameters" element="impl:getCardsRequest">
2836
+ </wsdl:part>
2837
+ </wsdl:message>
2838
+ <wsdl:portType name="WebPaymentAPI">
2839
+ <wsdl:operation name="doWebPayment">
2840
+ <wsdl:input name="doWebPaymentRequest" message="impl:doWebPaymentRequest">
2841
+ </wsdl:input>
2842
+ <wsdl:output name="doWebPaymentResponse" message="impl:doWebPaymentResponse">
2843
+ </wsdl:output>
2844
+ </wsdl:operation>
2845
+ <wsdl:operation name="getWebPaymentDetails">
2846
+ <wsdl:input name="getWebPaymentDetailsRequest" message="impl:getWebPaymentDetailsRequest">
2847
+ </wsdl:input>
2848
+ <wsdl:output name="getWebPaymentDetailsResponse" message="impl:getWebPaymentDetailsResponse">
2849
+ </wsdl:output>
2850
+ </wsdl:operation>
2851
+ <wsdl:operation name="manageWebWallet">
2852
+ <wsdl:input name="manageWebWalletRequest" message="impl:manageWebWalletRequest">
2853
+ </wsdl:input>
2854
+ <wsdl:output name="manageWebWalletResponse" message="impl:manageWebWalletResponse">
2855
+ </wsdl:output>
2856
+ </wsdl:operation>
2857
+ <wsdl:operation name="createWebWallet">
2858
+ <wsdl:input name="createWebWalletRequest" message="impl:createWebWalletRequest">
2859
+ </wsdl:input>
2860
+ <wsdl:output name="createWebWalletResponse" message="impl:createWebWalletResponse">
2861
+ </wsdl:output>
2862
+ </wsdl:operation>
2863
+ <wsdl:operation name="updateWebWallet">
2864
+ <wsdl:input name="updateWebWalletRequest" message="impl:updateWebWalletRequest">
2865
+ </wsdl:input>
2866
+ <wsdl:output name="updateWebWalletResponse" message="impl:updateWebWalletResponse">
2867
+ </wsdl:output>
2868
+ </wsdl:operation>
2869
+ <wsdl:operation name="getWebWallet">
2870
+ <wsdl:input name="getWebWalletRequest" message="impl:getWebWalletRequest">
2871
+ </wsdl:input>
2872
+ <wsdl:output name="getWebWalletResponse" message="impl:getWebWalletResponse">
2873
+ </wsdl:output>
2874
+ </wsdl:operation>
2875
+ </wsdl:portType>
2876
+ <wsdl:portType name="DirectPaymentAPI">
2877
+ <wsdl:operation name="doAuthorization">
2878
+ <wsdl:input name="doAuthorizationRequest" message="impl:doAuthorizationRequest">
2879
+ </wsdl:input>
2880
+ <wsdl:output name="doAuthorizationResponse" message="impl:doAuthorizationResponse">
2881
+ </wsdl:output>
2882
+ </wsdl:operation>
2883
+ <wsdl:operation name="doCapture">
2884
+ <wsdl:input name="doCaptureRequest" message="impl:doCaptureRequest">
2885
+ </wsdl:input>
2886
+ <wsdl:output name="doCaptureResponse" message="impl:doCaptureResponse">
2887
+ </wsdl:output>
2888
+ </wsdl:operation>
2889
+ <wsdl:operation name="doReAuthorization">
2890
+ <wsdl:input name="doReAuthorizationRequest" message="impl:doReAuthorizationRequest">
2891
+ </wsdl:input>
2892
+ <wsdl:output name="doReAuthorizationResponse" message="impl:doReAuthorizationResponse">
2893
+ </wsdl:output>
2894
+ </wsdl:operation>
2895
+ <wsdl:operation name="doDebit">
2896
+ <wsdl:input name="doDebitRequest" message="impl:doDebitRequest">
2897
+ </wsdl:input>
2898
+ <wsdl:output name="doDebitResponse" message="impl:doDebitResponse">
2899
+ </wsdl:output>
2900
+ </wsdl:operation>
2901
+ <wsdl:operation name="doRefund">
2902
+ <wsdl:input name="doRefundRequest" message="impl:doRefundRequest">
2903
+ </wsdl:input>
2904
+ <wsdl:output name="doRefundResponse" message="impl:doRefundResponse">
2905
+ </wsdl:output>
2906
+ </wsdl:operation>
2907
+ <wsdl:operation name="doReset">
2908
+ <wsdl:input name="doResetRequest" message="impl:doResetRequest">
2909
+ </wsdl:input>
2910
+ <wsdl:output name="doResetResponse" message="impl:doResetResponse">
2911
+ </wsdl:output>
2912
+ </wsdl:operation>
2913
+ <wsdl:operation name="doCredit">
2914
+ <wsdl:input name="doCreditRequest" message="impl:doCreditRequest">
2915
+ </wsdl:input>
2916
+ <wsdl:output name="doCreditResponse" message="impl:doCreditResponse">
2917
+ </wsdl:output>
2918
+ </wsdl:operation>
2919
+ <wsdl:operation name="createWallet">
2920
+ <wsdl:input name="createWalletRequest" message="impl:createWalletRequest">
2921
+ </wsdl:input>
2922
+ <wsdl:output name="createWalletResponse" message="impl:createWalletResponse">
2923
+ </wsdl:output>
2924
+ </wsdl:operation>
2925
+ <wsdl:operation name="updateWallet">
2926
+ <wsdl:input name="updateWalletRequest" message="impl:updateWalletRequest">
2927
+ </wsdl:input>
2928
+ <wsdl:output name="updateWalletResponse" message="impl:updateWalletResponse">
2929
+ </wsdl:output>
2930
+ </wsdl:operation>
2931
+ <wsdl:operation name="getWallet">
2932
+ <wsdl:input name="getWalletRequest" message="impl:getWalletRequest">
2933
+ </wsdl:input>
2934
+ <wsdl:output name="getWalletResponse" message="impl:getWalletResponse">
2935
+ </wsdl:output>
2936
+ </wsdl:operation>
2937
+ <wsdl:operation name="getCards">
2938
+ <wsdl:input name="getCardsRequest" message="impl:getCardsRequest">
2939
+ </wsdl:input>
2940
+ <wsdl:output name="getCardsResponse" message="impl:getCardsResponse">
2941
+ </wsdl:output>
2942
+ </wsdl:operation>
2943
+ <wsdl:operation name="disableWallet">
2944
+ <wsdl:input name="disableWalletRequest" message="impl:disableWalletRequest">
2945
+ </wsdl:input>
2946
+ <wsdl:output name="disableWalletResponse" message="impl:disableWalletResponse">
2947
+ </wsdl:output>
2948
+ </wsdl:operation>
2949
+ <wsdl:operation name="enableWallet">
2950
+ <wsdl:input name="enableWalletRequest" message="impl:enableWalletRequest">
2951
+ </wsdl:input>
2952
+ <wsdl:output name="enableWalletResponse" message="impl:enableWalletResponse">
2953
+ </wsdl:output>
2954
+ </wsdl:operation>
2955
+ <wsdl:operation name="doImmediateWalletPayment">
2956
+ <wsdl:input name="doImmediateWalletPaymentRequest" message="impl:doImmediateWalletPaymentRequest">
2957
+ </wsdl:input>
2958
+ <wsdl:output name="doImmediateWalletPaymentResponse" message="impl:doImmediateWalletPaymentResponse">
2959
+ </wsdl:output>
2960
+ </wsdl:operation>
2961
+ <wsdl:operation name="doScheduledWalletPayment">
2962
+ <wsdl:input name="doScheduledWalletPaymentRequest" message="impl:doScheduledWalletPaymentRequest">
2963
+ </wsdl:input>
2964
+ <wsdl:output name="doScheduledWalletPaymentResponse" message="impl:doScheduledWalletPaymentResponse">
2965
+ </wsdl:output>
2966
+ </wsdl:operation>
2967
+ <wsdl:operation name="doRecurrentWalletPayment">
2968
+ <wsdl:input name="doRecurrentWalletPaymentRequest" message="impl:doRecurrentWalletPaymentRequest">
2969
+ </wsdl:input>
2970
+ <wsdl:output name="doRecurrentWalletPaymentResponse" message="impl:doRecurrentWalletPaymentResponse">
2971
+ </wsdl:output>
2972
+ </wsdl:operation>
2973
+ <wsdl:operation name="getPaymentRecord">
2974
+ <wsdl:input name="getPaymentRecordRequest" message="impl:getPaymentRecordRequest">
2975
+ </wsdl:input>
2976
+ <wsdl:output name="getPaymentRecordResponse" message="impl:getPaymentRecordResponse">
2977
+ </wsdl:output>
2978
+ </wsdl:operation>
2979
+ <wsdl:operation name="disablePaymentRecord">
2980
+ <wsdl:input name="disablePaymentRecordRequest" message="impl:disablePaymentRecordRequest">
2981
+ </wsdl:input>
2982
+ <wsdl:output name="disablePaymentRecordResponse" message="impl:disablePaymentRecordResponse">
2983
+ </wsdl:output>
2984
+ </wsdl:operation>
2985
+ <wsdl:operation name="verifyEnrollment">
2986
+ <wsdl:input name="verifyEnrollmentRequest" message="impl:verifyEnrollmentRequest">
2987
+ </wsdl:input>
2988
+ <wsdl:output name="verifyEnrollmentResponse" message="impl:verifyEnrollmentResponse">
2989
+ </wsdl:output>
2990
+ </wsdl:operation>
2991
+ <wsdl:operation name="verifyAuthentication">
2992
+ <wsdl:input name="verifyAuthenticationRequest" message="impl:verifyAuthenticationRequest">
2993
+ </wsdl:input>
2994
+ <wsdl:output name="verifyAuthenticationResponse" message="impl:verifyAuthenticationResponse">
2995
+ </wsdl:output>
2996
+ </wsdl:operation>
2997
+ <wsdl:operation name="createMerchant">
2998
+ <wsdl:input name="createMerchantRequest" message="impl:createMerchantRequest">
2999
+ </wsdl:input>
3000
+ <wsdl:output name="createMerchantResponse" message="impl:createMerchantResponse">
3001
+ </wsdl:output>
3002
+ </wsdl:operation>
3003
+ <wsdl:operation name="doScoringCheque">
3004
+ <wsdl:input name="doScoringChequeRequest" message="impl:doScoringChequeRequest">
3005
+ </wsdl:input>
3006
+ <wsdl:output name="doScoringChequeResponse" message="impl:doScoringChequeResponse">
3007
+ </wsdl:output>
3008
+ </wsdl:operation>
3009
+ <wsdl:operation name="getEncryptionKey">
3010
+ <wsdl:input name="getEncryptionKeyRequest" message="impl:getEncryptionKeyRequest">
3011
+ </wsdl:input>
3012
+ <wsdl:output name="getEncryptionKeyResponse" message="impl:getEncryptionKeyResponse">
3013
+ </wsdl:output>
3014
+ </wsdl:operation>
3015
+ <wsdl:operation name="getMerchantSettings">
3016
+ <wsdl:input name="getMerchantSettingsRequest" message="impl:getMerchantSettingsRequest">
3017
+ </wsdl:input>
3018
+ <wsdl:output name="getMerchantSettingsResponse" message="impl:getMerchantSettingsResponse">
3019
+ </wsdl:output>
3020
+ </wsdl:operation>
3021
+ <wsdl:operation name="getBalance">
3022
+ <wsdl:input name="getBalanceRequest" message="impl:getBalanceRequest">
3023
+ </wsdl:input>
3024
+ <wsdl:output name="getBalanceResponse" message="impl:getBalanceResponse">
3025
+ </wsdl:output>
3026
+ </wsdl:operation>
3027
+ <wsdl:operation name="getToken">
3028
+ <wsdl:input message="impl:getTokenRequest">
3029
+ </wsdl:input>
3030
+ <wsdl:output message="impl:getTokenResponse">
3031
+ </wsdl:output>
3032
+ </wsdl:operation>
3033
+ <wsdl:operation name="unBlock">
3034
+ <wsdl:input name="unBlockRequest" message="impl:unBlockRequest">
3035
+ </wsdl:input>
3036
+ <wsdl:output name="unBlockResponse" message="impl:unBlockResponse">
3037
+ </wsdl:output>
3038
+ </wsdl:operation>
3039
+ <wsdl:operation name="updatePaymentRecord">
3040
+ <wsdl:input name="updatePaymentRecordRequest" message="impl:updatePaymentRecordRequest">
3041
+ </wsdl:input>
3042
+ <wsdl:output name="updatePaymentRecordResponse" message="impl:updatePaymentRecordResponse">
3043
+ </wsdl:output>
3044
+ </wsdl:operation>
3045
+ <wsdl:operation name="getBillingRecord">
3046
+ <wsdl:input name="getBillingRecordRequest" message="impl:getBillingRecordRequest">
3047
+ </wsdl:input>
3048
+ <wsdl:output name="getBillingRecordResponse" message="impl:getBillingRecordResponse">
3049
+ </wsdl:output>
3050
+ </wsdl:operation>
3051
+ <wsdl:operation name="updateBillingRecord">
3052
+ <wsdl:input name="updateBillingRecordRequest" message="impl:updateBillingRecordRequest">
3053
+ </wsdl:input>
3054
+ <wsdl:output name="updateBillingRecordResponse" message="impl:updateBillingRecordResponse">
3055
+ </wsdl:output>
3056
+ </wsdl:operation>
3057
+ </wsdl:portType>
3058
+ <wsdl:portType name="ExtendedAPI">
3059
+ <wsdl:operation name="getTransactionDetails">
3060
+ <wsdl:input name="getTransactionDetailsRequest" message="impl:getTransactionDetailsRequest">
3061
+ </wsdl:input>
3062
+ <wsdl:output name="getTransactionDetailsResponse" message="impl:getTransactionDetailsResponse">
3063
+ </wsdl:output>
3064
+ </wsdl:operation>
3065
+ <wsdl:operation name="transactionsSearch">
3066
+ <wsdl:input name="transactionsSearchRequest" message="impl:transactionsSearchRequest">
3067
+ </wsdl:input>
3068
+ <wsdl:output name="transactionsSearchResponse" message="impl:transactionsSearchResponse">
3069
+ </wsdl:output>
3070
+ </wsdl:operation>
3071
+ <wsdl:operation name="getAlertDetails">
3072
+ <wsdl:input message="impl:getAlertDetailsRequest">
3073
+ </wsdl:input>
3074
+ <wsdl:output message="impl:getAlertDetailsResponse">
3075
+ </wsdl:output>
3076
+ </wsdl:operation>
3077
+ </wsdl:portType>
3078
+ <wsdl:binding name="DirectPaymentAPISoapBinding" type="impl:DirectPaymentAPI">
3079
+ <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
3080
+ <wsdl:operation name="doAuthorization">
3081
+ <wsdlsoap:operation soapAction="doAuthorization"/>
3082
+ <wsdl:input>
3083
+ <wsdlsoap:body use="literal"/>
3084
+ </wsdl:input>
3085
+ <wsdl:output>
3086
+ <wsdlsoap:body use="literal"/>
3087
+ </wsdl:output>
3088
+ </wsdl:operation>
3089
+ <wsdl:operation name="doCapture">
3090
+ <wsdlsoap:operation soapAction="doCapture"/>
3091
+ <wsdl:input>
3092
+ <wsdlsoap:body use="literal"/>
3093
+ </wsdl:input>
3094
+ <wsdl:output>
3095
+ <wsdlsoap:body use="literal"/>
3096
+ </wsdl:output>
3097
+ </wsdl:operation>
3098
+ <wsdl:operation name="doReAuthorization">
3099
+ <wsdlsoap:operation soapAction="doReAuthorization"/>
3100
+ <wsdl:input>
3101
+ <wsdlsoap:body use="literal"/>
3102
+ </wsdl:input>
3103
+ <wsdl:output>
3104
+ <wsdlsoap:body use="literal"/>
3105
+ </wsdl:output>
3106
+ </wsdl:operation>
3107
+ <wsdl:operation name="doDebit">
3108
+ <wsdlsoap:operation soapAction="doDebit"/>
3109
+ <wsdl:input>
3110
+ <wsdlsoap:body use="literal"/>
3111
+ </wsdl:input>
3112
+ <wsdl:output>
3113
+ <wsdlsoap:body use="literal"/>
3114
+ </wsdl:output>
3115
+ </wsdl:operation>
3116
+ <wsdl:operation name="doRefund">
3117
+ <wsdlsoap:operation soapAction="doRefund"/>
3118
+ <wsdl:input>
3119
+ <wsdlsoap:body use="literal"/>
3120
+ </wsdl:input>
3121
+ <wsdl:output>
3122
+ <wsdlsoap:body use="literal"/>
3123
+ </wsdl:output>
3124
+ </wsdl:operation>
3125
+ <wsdl:operation name="doReset">
3126
+ <wsdlsoap:operation soapAction="doReset"/>
3127
+ <wsdl:input>
3128
+ <wsdlsoap:body use="literal"/>
3129
+ </wsdl:input>
3130
+ <wsdl:output>
3131
+ <wsdlsoap:body use="literal"/>
3132
+ </wsdl:output>
3133
+ </wsdl:operation>
3134
+ <wsdl:operation name="doCredit">
3135
+ <wsdlsoap:operation soapAction="doCredit"/>
3136
+ <wsdl:input>
3137
+ <wsdlsoap:body use="literal"/>
3138
+ </wsdl:input>
3139
+ <wsdl:output>
3140
+ <wsdlsoap:body use="literal"/>
3141
+ </wsdl:output>
3142
+ </wsdl:operation>
3143
+ <wsdl:operation name="createWallet">
3144
+ <wsdlsoap:operation soapAction="createWallet"/>
3145
+ <wsdl:input>
3146
+ <wsdlsoap:body use="literal"/>
3147
+ </wsdl:input>
3148
+ <wsdl:output>
3149
+ <wsdlsoap:body use="literal"/>
3150
+ </wsdl:output>
3151
+ </wsdl:operation>
3152
+ <wsdl:operation name="updateWallet">
3153
+ <wsdlsoap:operation soapAction="updateWallet"/>
3154
+ <wsdl:input>
3155
+ <wsdlsoap:body use="literal"/>
3156
+ </wsdl:input>
3157
+ <wsdl:output>
3158
+ <wsdlsoap:body use="literal"/>
3159
+ </wsdl:output>
3160
+ </wsdl:operation>
3161
+ <wsdl:operation name="getWallet">
3162
+ <wsdlsoap:operation soapAction="getWallet"/>
3163
+ <wsdl:input>
3164
+ <wsdlsoap:body use="literal"/>
3165
+ </wsdl:input>
3166
+ <wsdl:output>
3167
+ <wsdlsoap:body use="literal"/>
3168
+ </wsdl:output>
3169
+ </wsdl:operation>
3170
+ <wsdl:operation name="getCards">
3171
+ <wsdlsoap:operation soapAction="getCards"/>
3172
+ <wsdl:input>
3173
+ <wsdlsoap:body use="literal"/>
3174
+ </wsdl:input>
3175
+ <wsdl:output>
3176
+ <wsdlsoap:body use="literal"/>
3177
+ </wsdl:output>
3178
+ </wsdl:operation>
3179
+ <wsdl:operation name="disableWallet">
3180
+ <wsdlsoap:operation soapAction="disableWallet"/>
3181
+ <wsdl:input>
3182
+ <wsdlsoap:body use="literal"/>
3183
+ </wsdl:input>
3184
+ <wsdl:output>
3185
+ <wsdlsoap:body use="literal"/>
3186
+ </wsdl:output>
3187
+ </wsdl:operation>
3188
+ <wsdl:operation name="enableWallet">
3189
+ <wsdlsoap:operation soapAction="enableWallet"/>
3190
+ <wsdl:input>
3191
+ <wsdlsoap:body use="literal"/>
3192
+ </wsdl:input>
3193
+ <wsdl:output>
3194
+ <wsdlsoap:body use="literal"/>
3195
+ </wsdl:output>
3196
+ </wsdl:operation>
3197
+ <wsdl:operation name="doImmediateWalletPayment">
3198
+ <wsdlsoap:operation soapAction="doImmediateWalletPayment"/>
3199
+ <wsdl:input>
3200
+ <wsdlsoap:body use="literal"/>
3201
+ </wsdl:input>
3202
+ <wsdl:output>
3203
+ <wsdlsoap:body use="literal"/>
3204
+ </wsdl:output>
3205
+ </wsdl:operation>
3206
+ <wsdl:operation name="doScheduledWalletPayment">
3207
+ <wsdlsoap:operation soapAction="doScheduledWalletPayment"/>
3208
+ <wsdl:input>
3209
+ <wsdlsoap:body use="literal"/>
3210
+ </wsdl:input>
3211
+ <wsdl:output>
3212
+ <wsdlsoap:body use="literal"/>
3213
+ </wsdl:output>
3214
+ </wsdl:operation>
3215
+ <wsdl:operation name="doRecurrentWalletPayment">
3216
+ <wsdlsoap:operation soapAction="doRecurrentWalletPayment"/>
3217
+ <wsdl:input>
3218
+ <wsdlsoap:body use="literal"/>
3219
+ </wsdl:input>
3220
+ <wsdl:output>
3221
+ <wsdlsoap:body use="literal"/>
3222
+ </wsdl:output>
3223
+ </wsdl:operation>
3224
+ <wsdl:operation name="getPaymentRecord">
3225
+ <wsdlsoap:operation soapAction="getPaymentRecord"/>
3226
+ <wsdl:input>
3227
+ <wsdlsoap:body use="literal"/>
3228
+ </wsdl:input>
3229
+ <wsdl:output>
3230
+ <wsdlsoap:body use="literal"/>
3231
+ </wsdl:output>
3232
+ </wsdl:operation>
3233
+ <wsdl:operation name="disablePaymentRecord">
3234
+ <wsdlsoap:operation soapAction="disablePaymentRecord"/>
3235
+ <wsdl:input>
3236
+ <wsdlsoap:body use="literal"/>
3237
+ </wsdl:input>
3238
+ <wsdl:output>
3239
+ <wsdlsoap:body use="literal"/>
3240
+ </wsdl:output>
3241
+ </wsdl:operation>
3242
+ <wsdl:operation name="verifyEnrollment">
3243
+ <wsdlsoap:operation soapAction="verifyEnrollment"/>
3244
+ <wsdl:input>
3245
+ <wsdlsoap:body use="literal"/>
3246
+ </wsdl:input>
3247
+ <wsdl:output>
3248
+ <wsdlsoap:body use="literal"/>
3249
+ </wsdl:output>
3250
+ </wsdl:operation>
3251
+ <wsdl:operation name="verifyAuthentication">
3252
+ <wsdlsoap:operation soapAction="verifyAuthentication"/>
3253
+ <wsdl:input>
3254
+ <wsdlsoap:body use="literal"/>
3255
+ </wsdl:input>
3256
+ <wsdl:output>
3257
+ <wsdlsoap:body use="literal"/>
3258
+ </wsdl:output>
3259
+ </wsdl:operation>
3260
+ <wsdl:operation name="createMerchant">
3261
+ <wsdlsoap:operation soapAction="createMerchant"/>
3262
+ <wsdl:input>
3263
+ <wsdlsoap:body use="literal"/>
3264
+ </wsdl:input>
3265
+ <wsdl:output>
3266
+ <wsdlsoap:body use="literal"/>
3267
+ </wsdl:output>
3268
+ </wsdl:operation>
3269
+ <wsdl:operation name="doScoringCheque">
3270
+ <wsdlsoap:operation soapAction="doScoringCheque"/>
3271
+ <wsdl:input>
3272
+ <wsdlsoap:body use="literal"/>
3273
+ </wsdl:input>
3274
+ <wsdl:output>
3275
+ <wsdlsoap:body use="literal"/>
3276
+ </wsdl:output>
3277
+ </wsdl:operation>
3278
+ <wsdl:operation name="getEncryptionKey">
3279
+ <wsdlsoap:operation soapAction="getEncryptionKey"/>
3280
+ <wsdl:input>
3281
+ <wsdlsoap:body use="literal"/>
3282
+ </wsdl:input>
3283
+ <wsdl:output>
3284
+ <wsdlsoap:body use="literal"/>
3285
+ </wsdl:output>
3286
+ </wsdl:operation>
3287
+ <wsdl:operation name="getMerchantSettings">
3288
+ <wsdlsoap:operation soapAction="getMerchantSettings"/>
3289
+ <wsdl:input name="getMerchantSettingsRequest">
3290
+ <wsdlsoap:body use="literal"/>
3291
+ </wsdl:input>
3292
+ <wsdl:output name="getMerchantSettingsResponse">
3293
+ <wsdlsoap:body use="literal"/>
3294
+ </wsdl:output>
3295
+ </wsdl:operation>
3296
+ <wsdl:operation name="getBalance">
3297
+ <wsdlsoap:operation soapAction="getBalance"/>
3298
+ <wsdl:input>
3299
+ <wsdlsoap:body use="literal"/>
3300
+ </wsdl:input>
3301
+ <wsdl:output>
3302
+ <wsdlsoap:body use="literal"/>
3303
+ </wsdl:output>
3304
+ </wsdl:operation>
3305
+ <wsdl:operation name="getToken">
3306
+ <wsdlsoap:operation soapAction="getToken"/>
3307
+ <wsdl:input>
3308
+ <wsdlsoap:body use="literal"/>
3309
+ </wsdl:input>
3310
+ <wsdl:output>
3311
+ <wsdlsoap:body use="literal"/>
3312
+ </wsdl:output>
3313
+ </wsdl:operation>
3314
+ <wsdl:operation name="unBlock">
3315
+ <wsdlsoap:operation soapAction="unBlock"/>
3316
+ <wsdl:input>
3317
+ <wsdlsoap:body use="literal"/>
3318
+ </wsdl:input>
3319
+ <wsdl:output>
3320
+ <wsdlsoap:body use="literal"/>
3321
+ </wsdl:output>
3322
+ </wsdl:operation>
3323
+ <wsdl:operation name="updatePaymentRecord">
3324
+ <wsdlsoap:operation soapAction="updatePaymentRecord"/>
3325
+ <wsdl:input>
3326
+ <wsdlsoap:body use="literal"/>
3327
+ </wsdl:input>
3328
+ <wsdl:output>
3329
+ <wsdlsoap:body use="literal"/>
3330
+ </wsdl:output>
3331
+ </wsdl:operation>
3332
+ <wsdl:operation name="getBillingRecord">
3333
+ <wsdlsoap:operation soapAction="getBillingRecord"/>
3334
+ <wsdl:input>
3335
+ <wsdlsoap:body use="literal"/>
3336
+ </wsdl:input>
3337
+ <wsdl:output>
3338
+ <wsdlsoap:body use="literal"/>
3339
+ </wsdl:output>
3340
+ </wsdl:operation>
3341
+ <wsdl:operation name="updateBillingRecord">
3342
+ <wsdlsoap:operation soapAction="updateBillingRecord"/>
3343
+ <wsdl:input>
3344
+ <wsdlsoap:body use="literal"/>
3345
+ </wsdl:input>
3346
+ <wsdl:output>
3347
+ <wsdlsoap:body use="literal"/>
3348
+ </wsdl:output>
3349
+ </wsdl:operation>
3350
+ </wsdl:binding>
3351
+ <wsdl:binding name="WebPaymentAPISoapBinding" type="impl:WebPaymentAPI">
3352
+ <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
3353
+ <wsdl:operation name="getWebPaymentDetails">
3354
+ <wsdlsoap:operation soapAction="getWebPaymentDetails"/>
3355
+ <wsdl:input>
3356
+ <wsdlsoap:body use="literal"/>
3357
+ </wsdl:input>
3358
+ <wsdl:output>
3359
+ <wsdlsoap:body use="literal"/>
3360
+ </wsdl:output>
3361
+ </wsdl:operation>
3362
+ <wsdl:operation name="doWebPayment">
3363
+ <wsdlsoap:operation soapAction="doWebPayment"/>
3364
+ <wsdl:input>
3365
+ <wsdlsoap:body use="literal"/>
3366
+ </wsdl:input>
3367
+ <wsdl:output>
3368
+ <wsdlsoap:body use="literal"/>
3369
+ </wsdl:output>
3370
+ </wsdl:operation>
3371
+ <wsdl:operation name="manageWebWallet">
3372
+ <wsdlsoap:operation soapAction="manageWebWallet"/>
3373
+ <wsdl:input>
3374
+ <wsdlsoap:body use="literal"/>
3375
+ </wsdl:input>
3376
+ <wsdl:output>
3377
+ <wsdlsoap:body use="literal"/>
3378
+ </wsdl:output>
3379
+ </wsdl:operation>
3380
+ <wsdl:operation name="createWebWallet">
3381
+ <wsdlsoap:operation soapAction="createWebWallet"/>
3382
+ <wsdl:input>
3383
+ <wsdlsoap:body use="literal"/>
3384
+ </wsdl:input>
3385
+ <wsdl:output>
3386
+ <wsdlsoap:body use="literal"/>
3387
+ </wsdl:output>
3388
+ </wsdl:operation>
3389
+ <wsdl:operation name="updateWebWallet">
3390
+ <wsdlsoap:operation soapAction="updateWebWallet"/>
3391
+ <wsdl:input>
3392
+ <wsdlsoap:body use="literal"/>
3393
+ </wsdl:input>
3394
+ <wsdl:output>
3395
+ <wsdlsoap:body use="literal"/>
3396
+ </wsdl:output>
3397
+ </wsdl:operation>
3398
+ <wsdl:operation name="getWebWallet">
3399
+ <wsdlsoap:operation soapAction="getWebWallet"/>
3400
+ <wsdl:input>
3401
+ <wsdlsoap:body use="literal"/>
3402
+ </wsdl:input>
3403
+ <wsdl:output>
3404
+ <wsdlsoap:body use="literal"/>
3405
+ </wsdl:output>
3406
+ </wsdl:operation>
3407
+ </wsdl:binding>
3408
+ <wsdl:binding name="ExtendedAPISoapBinding" type="impl:ExtendedAPI">
3409
+ <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
3410
+ <wsdl:operation name="getTransactionDetails">
3411
+ <wsdlsoap:operation soapAction="getTransactionDetails"/>
3412
+ <wsdl:input>
3413
+ <wsdlsoap:body use="literal"/>
3414
+ </wsdl:input>
3415
+ <wsdl:output>
3416
+ <wsdlsoap:body use="literal"/>
3417
+ </wsdl:output>
3418
+ </wsdl:operation>
3419
+ <wsdl:operation name="transactionsSearch">
3420
+ <wsdlsoap:operation soapAction="transactionsSearch"/>
3421
+ <wsdl:input>
3422
+ <wsdlsoap:body use="literal"/>
3423
+ </wsdl:input>
3424
+ <wsdl:output>
3425
+ <wsdlsoap:body use="literal"/>
3426
+ </wsdl:output>
3427
+ </wsdl:operation>
3428
+ <wsdl:operation name="getAlertDetails">
3429
+ <wsdlsoap:operation soapAction="getAlertDetails"/>
3430
+ <wsdl:input>
3431
+ <wsdlsoap:body use="literal"/>
3432
+ </wsdl:input>
3433
+ <wsdl:output>
3434
+ <wsdlsoap:body use="literal"/>
3435
+ </wsdl:output>
3436
+ </wsdl:operation>
3437
+ </wsdl:binding>
3438
+ <wsdl:service name="WebPaymentAPI">
3439
+ <wsdl:port name="WebPaymentAPI" binding="impl:WebPaymentAPISoapBinding">
3440
+ <wsdlsoap:address location="https://homologation.payline.com/V4/services/WebPaymentAPI"/>
3441
+ </wsdl:port>
3442
+ </wsdl:service>
3443
+ <wsdl:service name="ExtendedAPI">
3444
+ <wsdl:port name="ExtendedAPI" binding="impl:ExtendedAPISoapBinding">
3445
+ <wsdlsoap:address location="https://homologation.payline.com/V4/services/ExtendedAPI"/>
3446
+ </wsdl:port>
3447
+ </wsdl:service>
3448
+ <wsdl:service name="DirectPaymentAPI">
3449
+ <wsdl:port name="DirectPaymentAPI" binding="impl:DirectPaymentAPISoapBinding">
3450
+ <wsdlsoap:address location="https://homologation.payline.com/V4/services/DirectPaymentAPI"/>
3451
+ </wsdl:port>
3452
+ </wsdl:service>
3453
  </wsdl:definitions>
app/code/community/Monext/Payline/sql/payline_setup/mysql4-install-1.6.0.php CHANGED
@@ -1,66 +1,66 @@
1
- <?php
2
- /* @var $this Monext_Payline_Model_Resource_Eav_Mysql4_Setup */
3
- $installer=$this;
4
- $installer->startSetup();
5
- //Create the wallet id if doesn't exists
6
- $attribute = $installer->getAttribute('customer', 'wallet_id');
7
- if (empty($attribute['attribute_id'])) {
8
-
9
- $installer->addAttribute('customer', 'wallet_id',
10
- array(
11
- 'type' => 'varchar',
12
- 'backend' => '',
13
- 'frontend' => '',
14
- 'label' => 'Payline User ID',
15
- 'input' => 'text',
16
- 'class' => '',
17
- 'source' => '',
18
- 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
19
- 'visible' => false,
20
- 'required' => false,
21
- 'user_defined' => false,
22
- 'default' => '',
23
- 'searchable' => false,
24
- 'filterable' => false,
25
- 'comparable' => false,
26
- 'visible_on_front' => false,
27
- 'visible_in_advanced_search' => false,
28
- 'unique' => true,
29
- 'position' => 1
30
- )
31
- );
32
- }
33
-
34
- //Create default static CMS blocks for registration to one click payment
35
- $connection=$installer->getConnection();
36
- if (!$connection->fetchOne("SELECT block_id FROM ".$installer->getTable('cms_block')." WHERE `identifier`='payline_register-oneclick_catalog'")) {
37
- $connection->insert($installer->getTable('cms/block'), array(
38
- 'title' => 'Register to one click checkout',
39
- 'identifier' => 'payline_register-oneclick_catalog',
40
- 'content' => "<p>Save time by registering now to our one click checkout service</p>",
41
- 'creation_time' => now(),
42
- 'update_time' => now(),
43
- 'is_active' => 1,
44
- ));
45
-
46
- $connection->insert($installer->getTable('cms/block_store'), array(
47
- 'block_id' => $connection->lastInsertId(),
48
- 'store_id' => 0
49
- ));
50
- }
51
- if (!$connection->fetchOne("SELECT block_id FROM ".$installer->getTable('cms_block')." WHERE `identifier`='payline_register-oneclick_customeraccount'")) {
52
- $connection->insert($installer->getTable('cms/block'), array(
53
- 'title' => 'Register to one click checkout',
54
- 'identifier' => 'payline_register-oneclick_customeraccount',
55
- 'content' => "<p>Save time by registering now to our one click checkout service</p>",
56
- 'creation_time' => now(),
57
- 'update_time' => now(),
58
- 'is_active' => 1,
59
- ));
60
-
61
- $connection->insert($installer->getTable('cms/block_store'), array(
62
- 'block_id' => $connection->lastInsertId(),
63
- 'store_id' => 0
64
- ));
65
- }
66
  $installer->endSetup();
1
+ <?php
2
+ /* @var $this Monext_Payline_Model_Resource_Eav_Mysql4_Setup */
3
+ $installer=$this;
4
+ $installer->startSetup();
5
+ //Create the wallet id if doesn't exists
6
+ $attribute = $installer->getAttribute('customer', 'wallet_id');
7
+ if (empty($attribute['attribute_id'])) {
8
+
9
+ $installer->addAttribute('customer', 'wallet_id',
10
+ array(
11
+ 'type' => 'varchar',
12
+ 'backend' => '',
13
+ 'frontend' => '',
14
+ 'label' => 'Payline User ID',
15
+ 'input' => 'text',
16
+ 'class' => '',
17
+ 'source' => '',
18
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
19
+ 'visible' => false,
20
+ 'required' => false,
21
+ 'user_defined' => false,
22
+ 'default' => '',
23
+ 'searchable' => false,
24
+ 'filterable' => false,
25
+ 'comparable' => false,
26
+ 'visible_on_front' => false,
27
+ 'visible_in_advanced_search' => false,
28
+ 'unique' => true,
29
+ 'position' => 1
30
+ )
31
+ );
32
+ }
33
+
34
+ //Create default static CMS blocks for registration to one click payment
35
+ $connection=$installer->getConnection();
36
+ if (!$connection->fetchOne("SELECT block_id FROM ".$installer->getTable('cms_block')." WHERE `identifier`='payline_register-oneclick_catalog'")) {
37
+ $connection->insert($installer->getTable('cms/block'), array(
38
+ 'title' => 'Register to one click checkout',
39
+ 'identifier' => 'payline_register-oneclick_catalog',
40
+ 'content' => "<p>Save time by registering now to our one click checkout service</p>",
41
+ 'creation_time' => now(),
42
+ 'update_time' => now(),
43
+ 'is_active' => 1,
44
+ ));
45
+
46
+ $connection->insert($installer->getTable('cms/block_store'), array(
47
+ 'block_id' => $connection->lastInsertId(),
48
+ 'store_id' => 0
49
+ ));
50
+ }
51
+ if (!$connection->fetchOne("SELECT block_id FROM ".$installer->getTable('cms_block')." WHERE `identifier`='payline_register-oneclick_customeraccount'")) {
52
+ $connection->insert($installer->getTable('cms/block'), array(
53
+ 'title' => 'Register to one click checkout',
54
+ 'identifier' => 'payline_register-oneclick_customeraccount',
55
+ 'content' => "<p>Save time by registering now to our one click checkout service</p>",
56
+ 'creation_time' => now(),
57
+ 'update_time' => now(),
58
+ 'is_active' => 1,
59
+ ));
60
+
61
+ $connection->insert($installer->getTable('cms/block_store'), array(
62
+ 'block_id' => $connection->lastInsertId(),
63
+ 'store_id' => 0
64
+ ));
65
+ }
66
  $installer->endSetup();
app/code/community/Monext/Payline/sql/payline_setup/mysql4-upgrade-1.7.2-1.7.3.php CHANGED
@@ -1,88 +1,88 @@
1
- <?php
2
- /* @var $this Monext_Payline_Model_Resource_Eav_Mysql4_Setup */
3
- $installer=$this;
4
- $installer->startSetup();
5
- //Create the wallet contract number if doesn't exists
6
- $attribute = $installer->getAttribute('customer', 'wallet_contract_number');
7
- if (empty($attribute['attribute_id'])) {
8
-
9
- $installer->addAttribute('customer', 'wallet_contract_number',
10
- array(
11
- 'type' => 'varchar',
12
- 'backend' => '',
13
- 'frontend' => '',
14
- 'label' => 'Contract number used to create wallet',
15
- 'input' => 'text',
16
- 'class' => '',
17
- 'source' => '',
18
- 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
19
- 'visible' => false,
20
- 'required' => false,
21
- 'user_defined' => false,
22
- 'default' => '',
23
- 'searchable' => false,
24
- 'filterable' => false,
25
- 'comparable' => false,
26
- 'visible_on_front' => false,
27
- 'visible_in_advanced_search' => false,
28
- 'unique' => false,
29
- 'position' => 1
30
- )
31
- );
32
- }
33
-
34
- //Create payline contracts table
35
-
36
- $installer->run("
37
- DROP TABLE IF EXISTS {$this->getTable('payline_contract')};
38
- CREATE TABLE {$this->getTable('payline_contract')} (
39
- `id` int(10) unsigned NOT NULL auto_increment,
40
- `name` varchar(255) NOT NULL default '',
41
- `number` varchar(255) NOT NULL default '',
42
- `point_of_sell` varchar(255) NOT NULL default '',
43
- `contract_type` varchar(100) NOT NULL default '',
44
- `is_primary` tinyint(1) NOT NULL default 0,
45
- `is_secondary` tinyint(1) NOT NULL default 0,
46
- `contract_date` datetime NOT NULL default '0000-00-00 00:00:00',
47
- PRIMARY KEY (`id`)
48
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='payline contracts';
49
-
50
- ");
51
-
52
- // create payline contracts status by store
53
-
54
- $installer->run("
55
- DROP TABLE IF EXISTS {$this->getTable('payline_contract_status')};
56
- create table {$this->getTable('payline_contract_status')} (
57
- `id` int(10) unsigned NOT NULL auto_increment,
58
- `contract_id` int(10) unsigned not null,
59
- `store_id` smallint(5) unsigned,
60
- `website_id` smallint(5) unsigned,
61
- `is_primary` tinyint(1) NOT NULL default 0,
62
- `is_secondary` tinyint(1) NOT NULL default 0,
63
- primary key (`id`),
64
- foreign key (`contract_id`) references {$this->getTable('payline_contract')}(id) on delete cascade,
65
- foreign key (`store_id`) references {$this->getTable('core_store')}(store_id),
66
- foreign key (`website_id`) references {$this->getTable('core_website')}(website_id)
67
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='payline contract status by store';
68
- ");
69
-
70
- //create table to store payline nx fees
71
- $installer->run("
72
- DROP TABLE IF EXISTS {$this->getTable('payline_nx_fees')};
73
- create table {$this->getTable('payline_nx_fees')} (
74
- `id` int(10) unsigned NOT NULL auto_increment,
75
- `quote_id` int(10) unsigned,
76
- `order_id` int(10) unsigned,
77
- `invoice_id` int(10) unsigned,
78
- `amount` decimal(12,4),
79
- `base_amount` decimal(12,4),
80
- primary key (`id`),
81
- foreign key (`order_id`) references {$this->getTable('sales_flat_order')}(entity_id),
82
- foreign key (`quote_id`) references {$this->getTable('sales_flat_quote')}(entity_id),
83
- foreign key (`invoice_id`) references {$this->getTable('sales_flat_invoice')}(entity_id)
84
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='payline nx fees';
85
- ");
86
-
87
-
88
  $installer->endSetup();
1
+ <?php
2
+ /* @var $this Monext_Payline_Model_Resource_Eav_Mysql4_Setup */
3
+ $installer=$this;
4
+ $installer->startSetup();
5
+ //Create the wallet contract number if doesn't exists
6
+ $attribute = $installer->getAttribute('customer', 'wallet_contract_number');
7
+ if (empty($attribute['attribute_id'])) {
8
+
9
+ $installer->addAttribute('customer', 'wallet_contract_number',
10
+ array(
11
+ 'type' => 'varchar',
12
+ 'backend' => '',
13
+ 'frontend' => '',
14
+ 'label' => 'Contract number used to create wallet',
15
+ 'input' => 'text',
16
+ 'class' => '',
17
+ 'source' => '',
18
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
19
+ 'visible' => false,
20
+ 'required' => false,
21
+ 'user_defined' => false,
22
+ 'default' => '',
23
+ 'searchable' => false,
24
+ 'filterable' => false,
25
+ 'comparable' => false,
26
+ 'visible_on_front' => false,
27
+ 'visible_in_advanced_search' => false,
28
+ 'unique' => false,
29
+ 'position' => 1
30
+ )
31
+ );
32
+ }
33
+
34
+ //Create payline contracts table
35
+
36
+ $installer->run("
37
+ DROP TABLE IF EXISTS {$this->getTable('payline_contract')};
38
+ CREATE TABLE {$this->getTable('payline_contract')} (
39
+ `id` int(10) unsigned NOT NULL auto_increment,
40
+ `name` varchar(255) NOT NULL default '',
41
+ `number` varchar(255) NOT NULL default '',
42
+ `point_of_sell` varchar(255) NOT NULL default '',
43
+ `contract_type` varchar(100) NOT NULL default '',
44
+ `is_primary` tinyint(1) NOT NULL default 0,
45
+ `is_secondary` tinyint(1) NOT NULL default 0,
46
+ `contract_date` datetime NOT NULL default '0000-00-00 00:00:00',
47
+ PRIMARY KEY (`id`)
48
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='payline contracts';
49
+
50
+ ");
51
+
52
+ // create payline contracts status by store
53
+
54
+ $installer->run("
55
+ DROP TABLE IF EXISTS {$this->getTable('payline_contract_status')};
56
+ create table {$this->getTable('payline_contract_status')} (
57
+ `id` int(10) unsigned NOT NULL auto_increment,
58
+ `contract_id` int(10) unsigned not null,
59
+ `store_id` smallint(5) unsigned,
60
+ `website_id` smallint(5) unsigned,
61
+ `is_primary` tinyint(1) NOT NULL default 0,
62
+ `is_secondary` tinyint(1) NOT NULL default 0,
63
+ primary key (`id`),
64
+ foreign key (`contract_id`) references {$this->getTable('payline_contract')}(id) on delete cascade,
65
+ foreign key (`store_id`) references {$this->getTable('core_store')}(store_id),
66
+ foreign key (`website_id`) references {$this->getTable('core_website')}(website_id)
67
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='payline contract status by store';
68
+ ");
69
+
70
+ //create table to store payline nx fees
71
+ $installer->run("
72
+ DROP TABLE IF EXISTS {$this->getTable('payline_nx_fees')};
73
+ create table {$this->getTable('payline_nx_fees')} (
74
+ `id` int(10) unsigned NOT NULL auto_increment,
75
+ `quote_id` int(10) unsigned,
76
+ `order_id` int(10) unsigned,
77
+ `invoice_id` int(10) unsigned,
78
+ `amount` decimal(12,4),
79
+ `base_amount` decimal(12,4),
80
+ primary key (`id`),
81
+ foreign key (`order_id`) references {$this->getTable('sales_flat_order')}(entity_id),
82
+ foreign key (`quote_id`) references {$this->getTable('sales_flat_quote')}(entity_id),
83
+ foreign key (`invoice_id`) references {$this->getTable('sales_flat_invoice')}(entity_id)
84
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='payline nx fees';
85
+ ");
86
+
87
+
88
  $installer->endSetup();
app/code/community/Monext/Payline/sql/payline_setup/mysql4-upgrade-1.7.5-1.7.6.php CHANGED
@@ -1,17 +1,17 @@
1
- <?php
2
- /** Add is_included_wallet_list column to payline_contract & payline_contract_status tables.
3
- *
4
- * Used to know if the contract can be included in contractNumberWalletList params when $paylineSDK->doWebPayment() and
5
- * $paylineSDK->createWebWallet() are called. */
6
-
7
- $installer = $this;
8
- $installer->startSetup();
9
-
10
- $connection = $installer->getConnection();
11
-
12
- $connection->addColumn( $this->getTable('payline/contract'), "is_included_wallet_list",
13
- 'tinyint(1) NOT NULL default 0' );
14
- $connection->addColumn( $this->getTable('payline/contract_status'), "is_included_wallet_list",
15
- 'tinyint(1) NOT NULL default 0' );
16
-
17
  $installer->endSetup();
1
+ <?php
2
+ /** Add is_included_wallet_list column to payline_contract & payline_contract_status tables.
3
+ *
4
+ * Used to know if the contract can be included in contractNumberWalletList params when $paylineSDK->doWebPayment() and
5
+ * $paylineSDK->createWebWallet() are called. */
6
+
7
+ $installer = $this;
8
+ $installer->startSetup();
9
+
10
+ $connection = $installer->getConnection();
11
+
12
+ $connection->addColumn( $this->getTable('payline/contract'), "is_included_wallet_list",
13
+ 'tinyint(1) NOT NULL default 0' );
14
+ $connection->addColumn( $this->getTable('payline/contract_status'), "is_included_wallet_list",
15
+ 'tinyint(1) NOT NULL default 0' );
16
+
17
  $installer->endSetup();
app/code/community/Monext/Payline/sql/payline_setup/mysql4-upgrade-1.7.7-1.8.1.php CHANGED
File without changes
app/code/community/Monext/Payline/sql/payline_setup/mysql4-upgrade-1.8.1-1.8.3.php CHANGED
@@ -1,19 +1,19 @@
1
- <?php
2
- $installer=$this;
3
- $installer->startSetup();
4
-
5
- // create table to storeweb payment token
6
- $installer->run("
7
- DROP TABLE IF EXISTS {$this->getTable('payline_product_categories')};
8
- CREATE TABLE {$this->getTable('payline_product_categories')} (
9
- `id` int(10) unsigned NOT NULL auto_increment,
10
- `store_category_id` int(10) NOT NULL,
11
- `store_category_label` varchar(255),
12
- `payline_category_id` int(10),
13
- `payline_category_label` varchar(255),
14
- PRIMARY KEY (`id`)
15
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='mapping between store and Payline product categories';
16
-
17
- ");
18
-
19
  $installer->endSetup();
1
+ <?php
2
+ $installer=$this;
3
+ $installer->startSetup();
4
+
5
+ // create table to storeweb payment token
6
+ $installer->run("
7
+ DROP TABLE IF EXISTS {$this->getTable('payline_product_categories')};
8
+ CREATE TABLE {$this->getTable('payline_product_categories')} (
9
+ `id` int(10) unsigned NOT NULL auto_increment,
10
+ `store_category_id` int(10) NOT NULL,
11
+ `store_category_label` varchar(255),
12
+ `payline_category_id` int(10),
13
+ `payline_category_label` varchar(255),
14
+ PRIMARY KEY (`id`)
15
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='mapping between store and Payline product categories';
16
+
17
+ ");
18
+
19
  $installer->endSetup();
app/code/community/Monext/Payline/sql/payline_setup/mysql4-upgrade-1.8.3.1-1.8.4.php CHANGED
@@ -1,24 +1,24 @@
1
- <?php
2
- /** Add is_included_wallet_list column to payline_contract & payline_contract_status tables.
3
- *
4
- * Used to know if the contract is a secure one and should be used in 3DS cinematic. */
5
-
6
- $installer = $this;
7
- $installer->startSetup();
8
-
9
- $connection = $installer->getConnection();
10
-
11
- $connection->addColumn( $this->getTable('payline/contract'), "is_secure",
12
- 'tinyint(1) NOT NULL default 0' );
13
-
14
- $connection->addColumn( $this->getTable('payline/contract_status'), "is_secure",
15
- 'tinyint(1) NOT NULL default 0' );
16
-
17
- $connection->addColumn( $this->getTable('sales/quote_payment'), "card_token_pan",
18
- 'varchar(255)' );
19
-
20
- $connection->addColumn( $this->getTable('sales/order_payment'), "card_token_pan",
21
- 'varchar(255)' );
22
-
23
-
24
  $installer->endSetup();
1
+ <?php
2
+ /** Add is_included_wallet_list column to payline_contract & payline_contract_status tables.
3
+ *
4
+ * Used to know if the contract is a secure one and should be used in 3DS cinematic. */
5
+
6
+ $installer = $this;
7
+ $installer->startSetup();
8
+
9
+ $connection = $installer->getConnection();
10
+
11
+ $connection->addColumn( $this->getTable('payline/contract'), "is_secure",
12
+ 'tinyint(1) NOT NULL default 0' );
13
+
14
+ $connection->addColumn( $this->getTable('payline/contract_status'), "is_secure",
15
+ 'tinyint(1) NOT NULL default 0' );
16
+
17
+ $connection->addColumn( $this->getTable('sales/quote_payment'), "card_token_pan",
18
+ 'varchar(255)' );
19
+
20
+ $connection->addColumn( $this->getTable('sales/order_payment'), "card_token_pan",
21
+ 'varchar(255)' );
22
+
23
+
24
  $installer->endSetup();
app/design/adminhtml/base/default/layout/payline.xml CHANGED
@@ -1,76 +1,76 @@
1
- <?xml version="1.0"?>
2
- <layout>
3
- <adminhtml_customer_edit>
4
- <reference name="customer_edit_tab_view">
5
- <action method="setTemplate">
6
- <template>payline/customer/tab/view.phtml</template>
7
- </action>
8
- </reference>
9
- </adminhtml_customer_edit>
10
-
11
- <adminhtml_payline_managecontracts_index>
12
- <reference name="content">
13
- <block type="payline/adminhtml_managecontracts" name="contracts_container">
14
- <block type="adminhtml/system_config_switcher" name="store_switcher" as="store_switcher" template="payline/switcher.phtml"></block>
15
- </block>
16
- </reference>
17
- </adminhtml_payline_managecontracts_index>
18
-
19
- <adminhtml_payline_managecontracts_edit>
20
- <reference name="content">
21
- <block type="payline/adminhtml_managecontracts_edit" name="contract_edit" />
22
- </reference>
23
- </adminhtml_payline_managecontracts_edit>
24
-
25
- <adminhtml_payline_managecontracts_grid>
26
- <block type="core/text_list" name="root" output="toHtml">
27
- <block type="payline/adminhtml_managecontracts_grid" name="admin.contracts.grid"/>
28
- </block>
29
- </adminhtml_payline_managecontracts_grid>
30
-
31
- <adminhtml_payline_manageproductcategories_index>
32
- <reference name="content">
33
- <block type="payline/adminhtml_manageproductcategories" name="productcategories_container">
34
- <block type="adminhtml/system_config_switcher" name="store_switcher" as="store_switcher" template="payline/switcher.phtml"></block>
35
- </block>
36
- </reference>
37
- </adminhtml_payline_manageproductcategories_index>
38
-
39
- <adminhtml_payline_manageproductcategories_assign>
40
- <reference name="content">
41
- <block type="payline/adminhtml_manageproductcategories_assign_form" name="manageproductcategories_assign" template="payline/assignProductCategories.phtml">
42
- </block>
43
- </reference>
44
- </adminhtml_payline_manageproductcategories_assign>
45
-
46
- <adminhtml_sales_order_view>
47
- <reference name="order_totals">
48
- <block type="payline/adminhtml_sales_order_total_nxfees" name="nxfees_total" as="nxfees_total"/>
49
- </reference>
50
- </adminhtml_sales_order_view>
51
-
52
- <adminhtml_sales_order_invoice_new>
53
- <reference name="invoice_totals">
54
- <block type="payline/adminhtml_sales_order_total_nxfees" name="nxfees_total" as="nxfees_total"/>
55
- </reference>
56
- </adminhtml_sales_order_invoice_new>
57
-
58
- <adminhtml_sales_order_invoice_updateqty>
59
- <reference name="invoice_totals">
60
- <block type="payline/adminhtml_sales_order_total_nxfees" name="nxfees_total" as="nxfees_total"/>
61
- </reference>
62
- </adminhtml_sales_order_invoice_updateqty>
63
-
64
- <adminhtml_sales_order_invoice_view>
65
- <reference name="invoice_totals">
66
- <block type="payline/adminhtml_sales_order_total_nxfees" name="nxfees_total" as="nxfees_total"/>
67
- </reference>
68
- </adminhtml_sales_order_invoice_view>
69
-
70
- <adminhtml_system_config_edit>
71
- <reference name="head">
72
- <action method="addItem"><type>skin_css</type><name>payline.css</name><params/></action>
73
- </reference>
74
- </adminhtml_system_config_edit>
75
-
76
  </layout>
1
+ <?xml version="1.0"?>
2
+ <layout>
3
+ <adminhtml_customer_edit>
4
+ <reference name="customer_edit_tab_view">
5
+ <action method="setTemplate">
6
+ <template>payline/customer/tab/view.phtml</template>
7
+ </action>
8
+ </reference>
9
+ </adminhtml_customer_edit>
10
+
11
+ <adminhtml_payline_managecontracts_index>
12
+ <reference name="content">
13
+ <block type="payline/adminhtml_managecontracts" name="contracts_container">
14
+ <block type="adminhtml/system_config_switcher" name="store_switcher" as="store_switcher" template="payline/switcher.phtml"></block>
15
+ </block>
16
+ </reference>
17
+ </adminhtml_payline_managecontracts_index>
18
+
19
+ <adminhtml_payline_managecontracts_edit>
20
+ <reference name="content">
21
+ <block type="payline/adminhtml_managecontracts_edit" name="contract_edit" />
22
+ </reference>
23
+ </adminhtml_payline_managecontracts_edit>
24
+
25
+ <adminhtml_payline_managecontracts_grid>
26
+ <block type="core/text_list" name="root" output="toHtml">
27
+ <block type="payline/adminhtml_managecontracts_grid" name="admin.contracts.grid"/>
28
+ </block>
29
+ </adminhtml_payline_managecontracts_grid>
30
+
31
+ <adminhtml_payline_manageproductcategories_index>
32
+ <reference name="content">
33
+ <block type="payline/adminhtml_manageproductcategories" name="productcategories_container">
34
+ <block type="adminhtml/system_config_switcher" name="store_switcher" as="store_switcher" template="payline/switcher.phtml"></block>
35
+ </block>
36
+ </reference>
37
+ </adminhtml_payline_manageproductcategories_index>
38
+
39
+ <adminhtml_payline_manageproductcategories_assign>
40
+ <reference name="content">
41
+ <block type="payline/adminhtml_manageproductcategories_assign_form" name="manageproductcategories_assign" template="payline/assignProductCategories.phtml">
42
+ </block>
43
+ </reference>
44
+ </adminhtml_payline_manageproductcategories_assign>
45
+
46
+ <adminhtml_sales_order_view>
47
+ <reference name="order_totals">
48
+ <block type="payline/adminhtml_sales_order_total_nxfees" name="nxfees_total" as="nxfees_total"/>
49
+ </reference>
50
+ </adminhtml_sales_order_view>
51
+
52
+ <adminhtml_sales_order_invoice_new>
53
+ <reference name="invoice_totals">
54
+ <block type="payline/adminhtml_sales_order_total_nxfees" name="nxfees_total" as="nxfees_total"/>
55
+ </reference>
56
+ </adminhtml_sales_order_invoice_new>
57
+
58
+ <adminhtml_sales_order_invoice_updateqty>
59
+ <reference name="invoice_totals">
60
+ <block type="payline/adminhtml_sales_order_total_nxfees" name="nxfees_total" as="nxfees_total"/>
61
+ </reference>
62
+ </adminhtml_sales_order_invoice_updateqty>
63
+
64
+ <adminhtml_sales_order_invoice_view>
65
+ <reference name="invoice_totals">
66
+ <block type="payline/adminhtml_sales_order_total_nxfees" name="nxfees_total" as="nxfees_total"/>
67
+ </reference>
68
+ </adminhtml_sales_order_invoice_view>
69
+
70
+ <adminhtml_system_config_edit>
71
+ <reference name="head">
72
+ <action method="addItem"><type>skin_css</type><name>payline.css</name><params/></action>
73
+ </reference>
74
+ </adminhtml_system_config_edit>
75
+
76
  </layout>
app/design/adminhtml/base/default/template/payline/Cpt.phtml CHANGED
File without changes
app/design/adminhtml/base/default/template/payline/Direct.phtml CHANGED
File without changes
app/design/adminhtml/base/default/template/payline/Payline.phtml CHANGED
File without changes
app/design/adminhtml/base/default/template/payline/assignProductCategories.phtml CHANGED
@@ -1,20 +1,20 @@
1
- <?php
2
- /**
3
- * @see Monext_Payline_Block_Adminhtml_Manageproductcategories
4
- */
5
- ?>
6
- <div class="content-header">
7
- <table cellspacing="0">
8
- <tr>
9
- <td style="width:50%;"><h3 class="icon-head head-products"><?php echo $this->getHeaderText()?></h3></td>
10
- <td class="a-right">
11
- <?php echo $this->getButtonsHtml() ?>
12
- </td>
13
- </tr>
14
- </table>
15
- </div>
16
- <div>
17
- <?php
18
- echo $this->getFormHtml();
19
- ?>
20
- </div>
1
+ <?php
2
+ /**
3
+ * @see Monext_Payline_Block_Adminhtml_Manageproductcategories
4
+ */
5
+ ?>
6
+ <div class="content-header">
7
+ <table cellspacing="0">
8
+ <tr>
9
+ <td style="width:50%;"><h3 class="icon-head head-products"><?php echo $this->getHeaderText()?></h3></td>
10
+ <td class="a-right">
11
+ <?php echo $this->getButtonsHtml() ?>
12
+ </td>
13
+ </tr>
14
+ </table>
15
+ </div>
16
+ <div>
17
+ <?php
18
+ echo $this->getFormHtml();
19
+ ?>
20
+ </div>
app/design/adminhtml/base/default/template/payline/contracts.phtml CHANGED
@@ -1,21 +1,21 @@
1
- <?php
2
- /**
3
- * @see Monext_Payline_Block_Adminhtml_Managecontracts
4
- */
5
- ?>
6
- <div class="content-header">
7
- <table cellspacing="0">
8
- <tr>
9
- <td style="width:50%;"><h3 class="icon-head head-products"><?php echo Mage::helper('payline')->__('Manage Payline Contracts') ?></h3></td>
10
- <td class="a-right">
11
- <?php echo $this->getButtonsHtml() ?>
12
- </td>
13
- </tr>
14
- </table>
15
- </div>
16
- <?php if( !$this->isSingleStoreMode() ): ?>
17
- <?php echo $this->getChildHtml('store_switcher');?>
18
- <?php endif;?>
19
- <div>
20
- <?php echo $this->getGridHtml() ?>
21
- </div>
1
+ <?php
2
+ /**
3
+ * @see Monext_Payline_Block_Adminhtml_Managecontracts
4
+ */
5
+ ?>
6
+ <div class="content-header">
7
+ <table cellspacing="0">
8
+ <tr>
9
+ <td style="width:50%;"><h3 class="icon-head head-products"><?php echo Mage::helper('payline')->__('Manage Payline Contracts') ?></h3></td>
10
+ <td class="a-right">
11
+ <?php echo $this->getButtonsHtml() ?>
12
+ </td>
13
+ </tr>
14
+ </table>
15
+ </div>
16
+ <?php if( !$this->isSingleStoreMode() ): ?>
17
+ <?php echo $this->getChildHtml('store_switcher');?>
18
+ <?php endif;?>
19
+ <div>
20
+ <?php echo $this->getGridHtml() ?>
21
+ </div>
app/design/adminhtml/base/default/template/payline/customer/tab/view.phtml CHANGED
@@ -1,62 +1,62 @@
1
- <?php
2
- /**
3
- * Template for block Mage_Adminhtml_Block_Customer_Edit_Tab_View
4
- */
5
- ?>
6
- <?php
7
- $lastLoginDateAdmin = $this->getLastLoginDate();
8
- $lastLoginDateStore = $this->getStoreLastLoginDate();
9
-
10
- $createDateAdmin = $this->getCreateDate();
11
- $createDateStore = $this->getStoreCreateDate();
12
- ?>
13
- <div class="entry-edit">
14
- <div class="entry-edit-head"><h4 class="icon-head head-customer-view"><?php echo Mage::helper('customer')->__('Personal Information') ?></h4></div>
15
- <fieldset>
16
- <table cellspacing="2" class="box-left">
17
- <tr>
18
- <td><strong><?php echo $this->__('Last Logged In:') ?></strong></td>
19
- <td><?php echo $lastLoginDateAdmin ?> (<?php echo $this->getCurrentStatus() ?>)</td>
20
- </tr>
21
- <?php if ($lastLoginDateAdmin != $lastLoginDateStore): ?>
22
- <tr>
23
- <td><strong><?php echo $this->__('Last Logged In (%s):', $this->getStoreLastLoginDateTimezone()) ?></strong></td>
24
- <td><?php echo $lastLoginDateStore ?> (<?php echo $this->getCurrentStatus() ?>)</td>
25
- </tr>
26
- <?php endif; ?>
27
- <tr>
28
- <td><strong><?php echo $this->__('Confirmed email:') ?></strong></td>
29
- <td><?php echo $this->getIsConfirmedStatus() ?></td>
30
- </tr>
31
- <tr>
32
- <td><strong><?php echo $this->__('Account Created on:') ?></strong></td>
33
- <td><?php echo $createDateAdmin ?></td>
34
- </tr>
35
- <?php if ($createDateAdmin != $createDateStore): ?>
36
- <tr>
37
- <td><strong><?php echo $this->__('Account Created on (%s):', $this->getStoreCreateDateTimezone()) ?></strong></td>
38
- <td><?php echo $createDateStore ?></td>
39
- </tr>
40
- <?php endif; ?>
41
- <tr>
42
- <td><strong><?php echo $this->__('Account Created in:') ?></strong></td>
43
- <td><?php echo $this->getCreatedInStore() ?></td>
44
- </tr>
45
- <tr>
46
- <td><strong><?php echo $this->__('Customer Group:') ?></strong></td>
47
- <td><?php echo $this->getGroupName() ?></td>
48
- </tr>
49
- <?php if ($this->getCustomer()->getWalletId() != null) :?>
50
- <tr>
51
- <td><strong><?php echo $this->__('Payline Wallet ID:') ?></strong></td>
52
- <td><?php echo $this->getCustomer()->getWalletId() ?></td>
53
- </tr>
54
- <?php endif?>
55
- </table>
56
- <address class="box-right">
57
- <strong><?php echo $this->__('Default Billing Address') ?></strong><br/>
58
- <?php echo $this->getBillingAddressHtml() ?>
59
- </address>
60
- </fieldset>
61
- </div>
62
  <?php echo $this->getChildHtml('', true, true); ?>
1
+ <?php
2
+ /**
3
+ * Template for block Mage_Adminhtml_Block_Customer_Edit_Tab_View
4
+ */
5
+ ?>
6
+ <?php
7
+ $lastLoginDateAdmin = $this->getLastLoginDate();
8
+ $lastLoginDateStore = $this->getStoreLastLoginDate();
9
+
10
+ $createDateAdmin = $this->getCreateDate();
11
+ $createDateStore = $this->getStoreCreateDate();
12
+ ?>
13
+ <div class="entry-edit">
14
+ <div class="entry-edit-head"><h4 class="icon-head head-customer-view"><?php echo Mage::helper('customer')->__('Personal Information') ?></h4></div>
15
+ <fieldset>
16
+ <table cellspacing="2" class="box-left">
17
+ <tr>
18
+ <td><strong><?php echo $this->__('Last Logged In:') ?></strong></td>
19
+ <td><?php echo $lastLoginDateAdmin ?> (<?php echo $this->getCurrentStatus() ?>)</td>
20
+ </tr>
21
+ <?php if ($lastLoginDateAdmin != $lastLoginDateStore): ?>
22
+ <tr>
23
+ <td><strong><?php echo $this->__('Last Logged In (%s):', $this->getStoreLastLoginDateTimezone()) ?></strong></td>
24
+ <td><?php echo $lastLoginDateStore ?> (<?php echo $this->getCurrentStatus() ?>)</td>
25
+ </tr>
26
+ <?php endif; ?>
27
+ <tr>
28
+ <td><strong><?php echo $this->__('Confirmed email:') ?></strong></td>
29
+ <td><?php echo $this->getIsConfirmedStatus() ?></td>
30
+ </tr>
31
+ <tr>
32
+ <td><strong><?php echo $this->__('Account Created on:') ?></strong></td>
33
+ <td><?php echo $createDateAdmin ?></td>
34
+ </tr>
35
+ <?php if ($createDateAdmin != $createDateStore): ?>
36
+ <tr>
37
+ <td><strong><?php echo $this->__('Account Created on (%s):', $this->getStoreCreateDateTimezone()) ?></strong></td>
38
+ <td><?php echo $createDateStore ?></td>
39
+ </tr>
40
+ <?php endif; ?>
41
+ <tr>
42
+ <td><strong><?php echo $this->__('Account Created in:') ?></strong></td>
43
+ <td><?php echo $this->getCreatedInStore() ?></td>
44
+ </tr>
45
+ <tr>
46
+ <td><strong><?php echo $this->__('Customer Group:') ?></strong></td>
47
+ <td><?php echo $this->getGroupName() ?></td>
48
+ </tr>
49
+ <?php if ($this->getCustomer()->getWalletId() != null) :?>
50
+ <tr>
51
+ <td><strong><?php echo $this->__('Payline Wallet ID:') ?></strong></td>
52
+ <td><?php echo $this->getCustomer()->getWalletId() ?></td>
53
+ </tr>
54
+ <?php endif?>
55
+ </table>
56
+ <address class="box-right">
57
+ <strong><?php echo $this->__('Default Billing Address') ?></strong><br/>
58
+ <?php echo $this->getBillingAddressHtml() ?>
59
+ </address>
60
+ </fieldset>
61
+ </div>
62
  <?php echo $this->getChildHtml('', true, true); ?>
app/design/adminhtml/base/default/template/payline/payment/info/monext.phtml CHANGED
@@ -1,22 +1,22 @@
1
-
2
- <?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?>
3
- <br />
4
- <?php
5
- $name = Mage::helper('payline')->getPaymentContractType(
6
- $this->getMethod()->getCode(),
7
- $this->getInfo()->getCcType() );
8
- echo $name;
9
- ?>
10
-
11
- <?php if ($_specificInfo = $this->getSpecificInformation()):?>
12
- <table>
13
- <?php foreach ($_specificInfo as $_label => $_value):?>
14
- <tr>
15
- <td><?php echo $this->escapeHtml($_label)?>:</td>
16
- <td><?php echo nl2br(implode($this->getValueAsArray($_value, false), "\n"))?></td>
17
- </tr>
18
- <?php endforeach; ?>
19
- </table>
20
- <?php endif;?>
21
-
22
  <?php echo $this->getChildHtml()?>
1
+
2
+ <?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?>
3
+ <br />
4
+ <?php
5
+ $name = Mage::helper('payline')->getPaymentContractType(
6
+ $this->getMethod()->getCode(),
7
+ $this->getInfo()->getCcType() );
8
+ echo $name;
9
+ ?>
10
+
11
+ <?php if ($_specificInfo = $this->getSpecificInformation()):?>
12
+ <table>
13
+ <?php foreach ($_specificInfo as $_label => $_value):?>
14
+ <tr>
15
+ <td><?php echo $this->escapeHtml($_label)?>:</td>
16
+ <td><?php echo nl2br(implode($this->getValueAsArray($_value, false), "\n"))?></td>
17
+ </tr>
18
+ <?php endforeach; ?>
19
+ </table>
20
+ <?php endif;?>
21
+
22
  <?php echo $this->getChildHtml()?>
app/design/adminhtml/base/default/template/payline/productcategories.phtml CHANGED
@@ -1,18 +1,18 @@
1
- <?php
2
- /**
3
- * @see Monext_Payline_Block_Adminhtml_Manageproductcategories
4
- */
5
- ?>
6
- <div class="content-header">
7
- <table cellspacing="0">
8
- <tr>
9
- <td style="width:50%;"><h3 class="icon-head head-products"><?php echo Mage::helper('payline')->__('Manage Payline Product Categories') ?></h3></td>
10
- <td class="a-right">
11
- <?php echo $this->getButtonsHtml() ?>
12
- </td>
13
- </tr>
14
- </table>
15
- </div>
16
- <div>
17
- <?php echo $this->getGridHtml() ?>
18
- </div>
1
+ <?php
2
+ /**
3
+ * @see Monext_Payline_Block_Adminhtml_Manageproductcategories
4
+ */
5
+ ?>
6
+ <div class="content-header">
7
+ <table cellspacing="0">
8
+ <tr>
9
+ <td style="width:50%;"><h3 class="icon-head head-products"><?php echo Mage::helper('payline')->__('Manage Payline Product Categories') ?></h3></td>
10
+ <td class="a-right">
11
+ <?php echo $this->getButtonsHtml() ?>
12
+ </td>
13
+ </tr>
14
+ </table>
15
+ </div>
16
+ <div>
17
+ <?php echo $this->getGridHtml() ?>
18
+ </div>
app/design/adminhtml/base/default/template/payline/switcher.phtml CHANGED
@@ -1,18 +1,18 @@
1
- <div class="switcher">
2
- <label for="store_switcher"><?php echo $this->__('Current Configuration Scope:') ?></label>
3
- <select id="store_switcher" class="system-config-store-switcher" onchange="location.href=this.options[this.selectedIndex].getAttribute('url')">
4
- <?php foreach ($this->getStoreSelectOptions() as $_value=>$_option): ?>
5
- <?php if (isset($_option['is_group'])): ?>
6
- <?php if ($_option['is_close']): ?>
7
- </optgroup>
8
- <?php else: ?>
9
- <optgroup label="<?php echo $_option['label'] ?>" style="<?php echo $_option['style'] ?>">
10
- <?php endif; ?>
11
- <?php continue ?>
12
- <?php endif; ?>
13
- <option value="<?php echo $_value ?>" url="<?php echo $_option['url'] ?>" <?php echo $_option['selected']?'selected="selected"':'' ?> style="<?php echo $_option['style'] ?>">
14
- <?php echo $_option['label'] ?>
15
- </option>
16
- <?php endforeach ?>
17
- </select>
18
  </div>
1
+ <div class="switcher">
2
+ <label for="store_switcher"><?php echo $this->__('Current Configuration Scope:') ?></label>
3
+ <select id="store_switcher" class="system-config-store-switcher" onchange="location.href=this.options[this.selectedIndex].getAttribute('url')">
4
+ <?php foreach ($this->getStoreSelectOptions() as $_value=>$_option): ?>
5
+ <?php if (isset($_option['is_group'])): ?>
6
+ <?php if ($_option['is_close']): ?>
7
+ </optgroup>
8
+ <?php else: ?>
9
+ <optgroup label="<?php echo $_option['label'] ?>" style="<?php echo $_option['style'] ?>">
10
+ <?php endif; ?>
11
+ <?php continue ?>
12
+ <?php endif; ?>
13
+ <option value="<?php echo $_value ?>" url="<?php echo $_option['url'] ?>" <?php echo $_option['selected']?'selected="selected"':'' ?> style="<?php echo $_option['style'] ?>">
14
+ <?php echo $_option['label'] ?>
15
+ </option>
16
+ <?php endforeach ?>
17
+ </select>
18
  </div>
app/design/adminhtml/base/default/template/payline/system/config/fieldset/welcome.phtml CHANGED
@@ -1,46 +1,46 @@
1
- <?php
2
-
3
- ?>
4
- <div class="payline-welcome">
5
- <table class="payline-head"><tr>
6
- <td>
7
- <div class="payline-payment-logo">
8
- <img src="<?php echo $this->getPaylineLogo()?>" />
9
- </div>
10
- <div class="title">
11
- <?php echo Mage::helper('payline')->__('Welcome in the Payline configuration payment center for Magento'); ?>
12
- </div>
13
- </td>
14
- <td>
15
- <div class="contact-us">
16
- <?php echo $this->__('Need help? contact us')?>
17
- <br/><a href="mailto:support@payline.com">support@payline.com</a>
18
- </div>
19
- </td>
20
- </tr></table>
21
- <br/>
22
-
23
- <div class="version">
24
- <?php if($this->getVersion()): ?>
25
- <?php echo $this->__('Module version: %s', $this->getVersion()); ?>
26
- <?php endif;?>
27
-
28
- <?php if($this->getRelease()): ?>
29
- <?php echo $this->__('(release: %s)', $this->getRelease()); ?>
30
- <?php endif;?>
31
- </div>
32
-
33
-
34
-
35
- <div>
36
- <?php if($this->isProduction()): ?>
37
- <?php echo $this->__('Access your <a href="https://admin.payline.com/userManager.do?reqCode=prepareLogin" >Monext Administrative Center</a> in order to manage your Payline account, check follow transactions or check technical issues.'); ?>
38
- <?php else:?>
39
- <?php echo $this->__('In order to configure and try the module you need to <a href="http://www.payline.com/index.php/integrez/compte-de-test" >create a test account</a>'); ?>
40
- <br/>
41
- <?php echo $this->__('Access your <a href="https://homologation-admin.payline.com/userManager.do?reqCode=prepareLogin" >Monext Administrative Center</a> in order to manage your Payline account, check follow transactions or check technical issues.'); ?>
42
- <?php endif;?>
43
-
44
- </div>
45
- </div>
46
- <br/>
1
+ <?php
2
+
3
+ ?>
4
+ <div class="payline-welcome">
5
+ <table class="payline-head"><tr>
6
+ <td>
7
+ <div class="payline-payment-logo">
8
+ <img src="<?php echo $this->getPaylineLogo()?>" />
9
+ </div>
10
+ <div class="title">
11
+ <?php echo Mage::helper('payline')->__('Welcome in the Payline configuration payment center for Magento'); ?>
12
+ </div>
13
+ </td>
14
+ <td>
15
+ <div class="contact-us">
16
+ <?php echo $this->__('Need help? contact us')?>
17
+ <br/><a href="mailto:support@payline.com">support@payline.com</a>
18
+ </div>
19
+ </td>
20
+ </tr></table>
21
+ <br/>
22
+
23
+ <div class="version">
24
+ <?php if($this->getVersion()): ?>
25
+ <?php echo $this->__('Module version: %s', $this->getVersion()); ?>
26
+ <?php endif;?>
27
+
28
+ <?php if($this->getRelease()): ?>
29
+ <?php echo $this->__('(release: %s)', $this->getRelease()); ?>
30
+ <?php endif;?>
31
+ </div>
32
+
33
+
34
+
35
+ <div>
36
+ <?php if($this->isProduction()): ?>
37
+ <?php echo $this->__('Access your <a href="https://admin.payline.com/userManager.do?reqCode=prepareLogin" >Monext Administrative Center</a> in order to manage your Payline account, check follow transactions or check technical issues.'); ?>
38
+ <?php else:?>
39
+ <?php echo $this->__('In order to configure and try the module you need to <a href="http://www.payline.com/index.php/integrez/compte-de-test" >create a test account</a>'); ?>
40
+ <br/>
41
+ <?php echo $this->__('Access your <a href="https://homologation-admin.payline.com/userManager.do?reqCode=prepareLogin" >Monext Administrative Center</a> in order to manage your Payline account, check follow transactions or check technical issues.'); ?>
42
+ <?php endif;?>
43
+
44
+ </div>
45
+ </div>
46
+ <br/>
app/design/adminhtml/base/default/template/payline/system/config/form/field/array.phtml CHANGED
@@ -1,105 +1,105 @@
1
- <?php
2
-
3
- $_htmlId = $this->getHtmlId() ? $this->getHtmlId() : '_' . uniqid();
4
-
5
- $_colspan = 2;
6
- if (!$this->_addAfter) {
7
- $_colspan -= 1;
8
- }
9
- $_colspan = $_colspan > 1 ? 'colspan="' . $_colspan . '"' : '';
10
- ?>
11
-
12
-
13
-
14
- <?php if (!$this->getArrayRows()):?>
15
- <?php echo $this->__('You need to import your contracts to get the Payline module working.'); ?>
16
- <br/>
17
- <?php else:?>
18
- <div class="grid" id="grid<?php echo $_htmlId ?>">
19
- <table cellpadding="0" cellspacing="0" class="border">
20
- <tbody>
21
- <tr class="headings" id="headings<?php echo $_htmlId ?>">
22
- <?php foreach ($this->_columns as $columnName => $column):?>
23
- <th <?php echo (!empty($column['style']) ? 'style="'.$column['style'].'"' : ''); ?>><?php echo $column['label'] ?></th>
24
- <?php endforeach;?>
25
- </tr>
26
- </tbody>
27
- </table>
28
- <?php //Needed to access Monext_Payline_Model_Adminhtml_System_Config_Backend_Contract::_afterSave ?>
29
- <input type="hidden" name="<?php echo $this->getElement()->getName() ?>" value="" />
30
- </div>
31
- <?php endif;?>
32
-
33
- <?php if ($this->canDisplayImportButton()):?>
34
- <button style="" onclick="window.location='<?php echo $this->getImportContractUrl() ?>'" class="scalable" type="button" title="<?php echo $this->__('Import contracts');?>">
35
- <span><span><span><?php echo $this->__('Import contracts');?></span></span></span>
36
- </button>
37
- <?php endif;?>
38
-
39
- <script type="text/javascript">
40
- //<![CDATA[
41
- // create row creator
42
- var arrayRow<?php echo $_htmlId ?> = {
43
- // define row prototypeJS template
44
- template : new Template(
45
- '<tr id="#{_id}">'
46
- <?php foreach ($this->_columns as $columnName => $column):?>
47
- +'<td>'
48
- +'<?php echo $this->_renderCellTemplate($columnName)?>'
49
- +'<\/td>'
50
- <?php endforeach;?>
51
- +'<\/tr>'
52
- ),
53
-
54
- rowsCount : 0,
55
-
56
- add : function(templateData, insertAfterId)
57
- {
58
- // generate default template data
59
- if ('' == templateData) {
60
- var d = new Date();
61
- var templateData = {
62
- <?php foreach ($this->_columns as $columnName => $column):?>
63
- <?php echo $columnName ?> : '',
64
- <?php endforeach;?>
65
- _id : '_' + d.getTime() + '_' + d.getMilliseconds()
66
- };
67
- }
68
-
69
- // insert before last row
70
- if ('' == insertAfterId) {
71
- Element.insert($('addRow<?php echo $_htmlId ?>'), {before: this.template.evaluate(templateData)});
72
- }
73
- // insert after specified row
74
- else {
75
- Element.insert($(insertAfterId), {after: this.template.evaluate(templateData)});
76
- }
77
-
78
- this.rowsCount += 1;
79
- },
80
-
81
- showButtonOnly : function()
82
- {
83
- $('grid<?php echo $_htmlId ?>').hide();
84
- $('empty<?php echo $_htmlId ?>').show();
85
- }
86
- }
87
-
88
- // bind add action to "Add" button in last row
89
- //Event.observe('addToEndBtn<?php echo $_htmlId ?>', 'click', arrayRow<?php echo $_htmlId ?>.add.bind(arrayRow<?php echo $_htmlId ?>, '', ''));
90
-
91
- // add existing rows
92
- <?php
93
- $_addAfterId = "headings{$_htmlId}";
94
- foreach ($this->getArrayRows() as $_rowId => $_row) {
95
- echo "arrayRow{$_htmlId}.add(" . $_row->toJson() . ", '{$_addAfterId}');\n";
96
- $_addAfterId = $_rowId;
97
- }
98
- ?>
99
-
100
- // toggle the grid, if element is disabled (depending on scope)
101
- <?php if ($this->getElement()->getDisabled()):?>
102
- toggleValueElements({checked:true}, $('grid<?php echo $_htmlId ?>').parentNode);
103
- <?php endif;?>
104
- //]]>
105
- </script>
1
+ <?php
2
+
3
+ $_htmlId = $this->getHtmlId() ? $this->getHtmlId() : '_' . uniqid();
4
+
5
+ $_colspan = 2;
6
+ if (!$this->_addAfter) {
7
+ $_colspan -= 1;
8
+ }
9
+ $_colspan = $_colspan > 1 ? 'colspan="' . $_colspan . '"' : '';
10
+ ?>
11
+
12
+
13
+
14
+ <?php if (!$this->getArrayRows()):?>
15
+ <?php echo $this->__('You need to import your contracts to get the Payline module working.'); ?>
16
+ <br/>
17
+ <?php else:?>
18
+ <div class="grid" id="grid<?php echo $_htmlId ?>">
19
+ <table cellpadding="0" cellspacing="0" class="border">
20
+ <tbody>
21
+ <tr class="headings" id="headings<?php echo $_htmlId ?>">
22
+ <?php foreach ($this->_columns as $columnName => $column):?>
23
+ <th <?php echo (!empty($column['style']) ? 'style="'.$column['style'].'"' : ''); ?>><?php echo $column['label'] ?></th>
24
+ <?php endforeach;?>
25
+ </tr>
26
+ </tbody>
27
+ </table>
28
+ <?php //Needed to access Monext_Payline_Model_Adminhtml_System_Config_Backend_Contract::_afterSave ?>
29
+ <input type="hidden" name="<?php echo $this->getElement()->getName() ?>" value="" />
30
+ </div>
31
+ <?php endif;?>
32
+
33
+ <?php if ($this->canDisplayImportButton()):?>
34
+ <button style="" onclick="window.location='<?php echo $this->getImportContractUrl() ?>'" class="scalable" type="button" title="<?php echo $this->__('Import contracts');?>">
35
+ <span><span><span><?php echo $this->__('Import contracts');?></span></span></span>
36
+ </button>
37
+ <?php endif;?>
38
+
39
+ <script type="text/javascript">
40
+ //<![CDATA[
41
+ // create row creator
42
+ var arrayRow<?php echo $_htmlId ?> = {
43
+ // define row prototypeJS template
44
+ template : new Template(
45
+ '<tr id="#{_id}">'
46
+ <?php foreach ($this->_columns as $columnName => $column):?>
47
+ +'<td>'
48
+ +'<?php echo $this->_renderCellTemplate($columnName)?>'
49
+ +'<\/td>'
50
+ <?php endforeach;?>
51
+ +'<\/tr>'
52
+ ),
53
+
54
+ rowsCount : 0,
55
+
56
+ add : function(templateData, insertAfterId)
57
+ {
58
+ // generate default template data
59
+ if ('' == templateData) {
60
+ var d = new Date();
61
+ var templateData = {
62
+ <?php foreach ($this->_columns as $columnName => $column):?>
63
+ <?php echo $columnName ?> : '',
64
+ <?php endforeach;?>
65
+ _id : '_' + d.getTime() + '_' + d.getMilliseconds()
66
+ };
67
+ }
68
+
69
+ // insert before last row
70
+ if ('' == insertAfterId) {
71
+ Element.insert($('addRow<?php echo $_htmlId ?>'), {before: this.template.evaluate(templateData)});
72
+ }
73
+ // insert after specified row
74
+ else {
75
+ Element.insert($(insertAfterId), {after: this.template.evaluate(templateData)});
76
+ }
77
+
78
+ this.rowsCount += 1;
79
+ },
80
+
81
+ showButtonOnly : function()
82
+ {
83
+ $('grid<?php echo $_htmlId ?>').hide();
84
+ $('empty<?php echo $_htmlId ?>').show();
85
+ }
86
+ }
87
+
88
+ // bind add action to "Add" button in last row
89
+ //Event.observe('addToEndBtn<?php echo $_htmlId ?>', 'click', arrayRow<?php echo $_htmlId ?>.add.bind(arrayRow<?php echo $_htmlId ?>, '', ''));
90
+
91
+ // add existing rows
92
+ <?php
93
+ $_addAfterId = "headings{$_htmlId}";
94
+ foreach ($this->getArrayRows() as $_rowId => $_row) {
95
+ echo "arrayRow{$_htmlId}.add(" . $_row->toJson() . ", '{$_addAfterId}');\n";
96
+ $_addAfterId = $_rowId;
97
+ }
98
+ ?>
99
+
100
+ // toggle the grid, if element is disabled (depending on scope)
101
+ <?php if ($this->getElement()->getDisabled()):?>
102
+ toggleValueElements({checked:true}, $('grid<?php echo $_htmlId ?>').parentNode);
103
+ <?php endif;?>
104
+ //]]>
105
+ </script>
app/design/adminhtml/base/default/template/payline/wallet/form.phtml CHANGED
File without changes
app/design/frontend/base/default/layout/payline.xml CHANGED
@@ -1,211 +1,211 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <layout version="0.1.0">
3
- <default>
4
- <reference name="right">
5
- <block type="payline/wallet_sidebar" ifconfig="payment/PaylineWALLET/active" name="left.payline-wallet-sidebar" template="payline/wallet/sidebar.phtml" after="cart_sidebar"/>
6
- </reference>
7
- <reference name="head">
8
- <action method="addCss"><stylesheet>css/payline.css</stylesheet></action>
9
- </reference>
10
- </default>
11
-
12
- <catalog_product_view>
13
- <reference name="right">
14
- <block type="payline/logo" name="right.payline-logo" template="payline/logo.phtml"/>
15
- </reference>
16
- </catalog_product_view>
17
- <catalog_category_default>
18
- <reference name="right">
19
- <block type="payline/logo" name="right.payline-logo" template="payline/logo.phtml"/>
20
- </reference>
21
- </catalog_category_default>
22
- <catalog_category_layered>
23
- <reference name="right">
24
- <block type="payline/logo" name="right.payline-logo" template="payline/logo.phtml"/>
25
- </reference>
26
- </catalog_category_layered>
27
- <cms_index_index>
28
- <reference name="right">
29
- <block type="payline/logo" name="right.payline-logo" template="payline/logo.phtml"/>
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>
37
- <action method="setInfoTemplate"><method>PaylineDIRECT</method><template>payline/checkout/onepage/info/default.phtml</template></action>
38
- <action method="setInfoTemplate"><method>PaylineNX</method><template>payline/checkout/onepage/info/default.phtml</template></action>
39
- <action method="setInfoTemplate"><method>PaylineWALLET</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>
56
- </reference>
57
- <reference name="left">
58
- <block type="payline/wallet_sidebar" name="left.payline-wallet-sidebar" template="payline/wallet/sidebar.phtml" after="cart_sidebar" ifconfig="payment/PaylineWALLET/active"/>
59
- </reference>
60
- </customer_account>
61
-
62
- <checkout_cart_index>
63
- <reference name="checkout.cart.methods">
64
- <block type="payline/wallet_checkoutbtn" after="checkout.cart.methods.onepage" name="payline-wallet.checkoutbtn" ifconfig="payment/PaylineWALLET/active"/>
65
- </reference>
66
- <reference name="checkout.cart.top_methods">
67
- <block type="payline/wallet_checkoutbtn" after="checkout.cart.methods.onepage" name="payline-wallet.checkoutbtn" ifconfig="payment/PaylineWALLET/active"/>
68
- </reference>
69
- </checkout_cart_index>
70
-
71
- <payline_wallet_manage>
72
- <update handle="customer_account"/>
73
- <reference name="content">
74
- <block type="core/template" name="payline-wallet-manage" template="payline/wallet/manage.phtml">
75
- <block type="payline/wallet_details" name="payline-wallet-details" />
76
- </block>
77
- </reference>
78
- </payline_wallet_manage>
79
-
80
- <payline_wallet_subscribe>
81
- <update handle="customer_account"/>
82
- <reference name="root">
83
- <action method="setHeaderTitle" translate="title"><title>Subscribe to wallet</title></action>
84
- </reference>
85
- <reference name="content">
86
- <block type="core/template" name="payline-wallet-subscribe" template="payline/wallet/subscribe.phtml">
87
- <block type="cms/block" name="payline-wallet-subscribe-cmsblock" ifconfig="payment/PaylineWALLET/payline_register-oneclick_customeraccount" >
88
- <!-- <action method="setBlockId"><id>payline_register-oneclick_customeraccount</id></action>-->
89
- </block>
90
- <block type="core/template" name="payline-wallet-subscribe-iframe" template="payline/iframe.phtml" />
91
- </block>
92
- </reference>
93
- </payline_wallet_subscribe>
94
-
95
- <payline_unloggedwallet_subscribereturn>
96
- <reference name="root">
97
- <action method="setTemplate"><template>payline/page/empty.phtml</template></action>
98
- </reference>
99
- <reference name="content">
100
- <block name="payline-iframe-leaver" type="core/template" template="payline/iframeleaver.phtml" />
101
- </reference>
102
- </payline_unloggedwallet_subscribereturn>
103
- <payline_unloggedwallet_subscribecancel>
104
- <reference name="root">
105
- <action method="setTemplate"><template>payline/page/empty.phtml</template></action>
106
- </reference>
107
- <reference name="content">
108
- <block name="payline-iframe-leaver" type="core/template" template="payline/iframeleaver.phtml" />
109
- </reference>
110
- </payline_unloggedwallet_subscribecancel>
111
-
112
-
113
- <payline_wallet_update>
114
- <update handle="customer_account"/>
115
- <reference name="root">
116
- <action method="setHeaderTitle" translate="title"><title>Update wallet</title></action>
117
- </reference>
118
- <reference name="content">
119
- <block type="core/template" name="payline-wallet-update" template="payline/wallet/update.phtml">
120
- <block type="core/template" name="payline-wallet-update-iframe" template="payline/iframe.phtml" />
121
- </block>
122
- </reference>
123
- </payline_wallet_update>
124
-
125
- <payline_unloggedwallet_updatereturn>
126
- <reference name="root">
127
- <action method="setTemplate"><template>payline/page/empty.phtml</template></action>
128
- </reference>
129
- <reference name="content">
130
- <block name="payline-iframe-leaver" type="core/template" template="payline/iframeleaver.phtml" />
131
- </reference>
132
- </payline_unloggedwallet_updatereturn>
133
- <payline_unloggedwallet_updatecancel>
134
- <reference name="root">
135
- <action method="setTemplate"><template>payline/page/empty.phtml</template></action>
136
- </reference>
137
- <reference name="content">
138
- <block name="payline-iframe-leaver" type="core/template" template="payline/iframeleaver.phtml" />
139
- </reference>
140
- </payline_unloggedwallet_updatecancel>
141
-
142
- <payline_checkoutonepage_index>
143
- <update handle="checkout_onepage_index" />
144
- <reference name="content">
145
- <block type="core/template" name="payline-checkoutonepage" template="payline/checkout/onepage.phtml" />
146
- </reference>
147
- </payline_checkoutonepage_index>
148
-
149
-
150
- <payline_index_directsecurized>
151
- <reference name="root">
152
- <action method="setTemplate"><template>payline/page/empty.phtml</template></action>
153
- </reference>
154
-
155
- <reference name="content">
156
- <block type="core/template" name="payline-directsecurized" template="payline/checkout/directsecurized.phtml" />
157
- </reference>
158
- </payline_index_directsecurized>
159
-
160
- <checkout_onepage_index>
161
- <reference name="head">
162
- <action method="addItem"><type>skin_js</type><name>js/payline.js</name></action>
163
- </reference>
164
- </checkout_onepage_index>
165
-
166
- <sales_order_view>
167
- <reference name="order_totals">
168
- <block type="payline/adminhtml_sales_order_total_nxfees" name="nxfees_total" as="nxfees_total"/>
169
- </reference>
170
- </sales_order_view>
171
-
172
- <sales_order_print>
173
- <reference name="order_totals">
174
- <block type="payline/adminhtml_sales_order_total_nxfees" name="nxfees_total" as="nxfees_total"/>
175
- </reference>
176
- </sales_order_print>
177
-
178
- <sales_order_invoice>
179
- <reference name="invoice_totals">
180
- <block type="payline/adminhtml_sales_order_total_nxfees" name="nxfees_total" as="nxfees_total"/>
181
- </reference>
182
- </sales_order_invoice>
183
-
184
- <sales_order_printinvoice>
185
- <reference name="invoice_totals">
186
- <block type="payline/adminhtml_sales_order_total_nxfees" name="nxfees_total" as="nxfees_total"/>
187
- </reference>
188
- </sales_order_printinvoice>
189
-
190
- <payline_remove_onepage_payment_step_handler>
191
- <reference name="head">
192
- <block type="payline/checkout_widget_header" name="checkout.onepage.review.payline.widget.header" as="payline-review-widget-header" translate="label"/>
193
- </reference>
194
-
195
- <reference name="payment.progress">
196
- <action method="setTemplate"><name>payline/checkout/onepage/progress/order.phtml</name></action>
197
- </reference>
198
-
199
- <reference name="content">
200
- <remove name="checkout.onepage.payment" />
201
- </reference>
202
- </payline_remove_onepage_payment_step_handler>
203
-
204
- <payline_onepage_review_handler>
205
- <reference name="checkout.onepage.review.info.items.after">
206
- <block type="payline/checkout_widget_opcheckout" name="checkout.onepage.review.payline.widget.update" as="payline-review-widget-update" translate="label" template="payline/checkout/onepage/widget-opcheckout-js-update.phtml" />
207
- </reference>
208
- </payline_onepage_review_handler>
209
-
210
-
211
- </layout>
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <layout version="0.1.0">
3
+ <default>
4
+ <reference name="right">
5
+ <block type="payline/wallet_sidebar" ifconfig="payment/PaylineWALLET/active" name="left.payline-wallet-sidebar" template="payline/wallet/sidebar.phtml" after="cart_sidebar"/>
6
+ </reference>
7
+ <reference name="head">
8
+ <action method="addCss"><stylesheet>css/payline.css</stylesheet></action>
9
+ </reference>
10
+ </default>
11
+
12
+ <catalog_product_view>
13
+ <reference name="right">
14
+ <block type="payline/logo" name="right.payline-logo" template="payline/logo.phtml"/>
15
+ </reference>
16
+ </catalog_product_view>
17
+ <catalog_category_default>
18
+ <reference name="right">
19
+ <block type="payline/logo" name="right.payline-logo" template="payline/logo.phtml"/>
20
+ </reference>
21
+ </catalog_category_default>
22
+ <catalog_category_layered>
23
+ <reference name="right">
24
+ <block type="payline/logo" name="right.payline-logo" template="payline/logo.phtml"/>
25
+ </reference>
26
+ </catalog_category_layered>
27
+ <cms_index_index>
28
+ <reference name="right">
29
+ <block type="payline/logo" name="right.payline-logo" template="payline/logo.phtml"/>
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>
37
+ <action method="setInfoTemplate"><method>PaylineDIRECT</method><template>payline/checkout/onepage/info/default.phtml</template></action>
38
+ <action method="setInfoTemplate"><method>PaylineNX</method><template>payline/checkout/onepage/info/default.phtml</template></action>
39
+ <action method="setInfoTemplate"><method>PaylineWALLET</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>
56
+ </reference>
57
+ <reference name="left">
58
+ <block type="payline/wallet_sidebar" name="left.payline-wallet-sidebar" template="payline/wallet/sidebar.phtml" after="cart_sidebar" ifconfig="payment/PaylineWALLET/active"/>
59
+ </reference>
60
+ </customer_account>
61
+
62
+ <checkout_cart_index>
63
+ <reference name="checkout.cart.methods">
64
+ <block type="payline/wallet_checkoutbtn" after="checkout.cart.methods.onepage" name="payline-wallet.checkoutbtn" ifconfig="payment/PaylineWALLET/active"/>
65
+ </reference>
66
+ <reference name="checkout.cart.top_methods">
67
+ <block type="payline/wallet_checkoutbtn" after="checkout.cart.methods.onepage" name="payline-wallet.checkoutbtn" ifconfig="payment/PaylineWALLET/active"/>
68
+ </reference>
69
+ </checkout_cart_index>
70
+
71
+ <payline_wallet_manage>
72
+ <update handle="customer_account"/>
73
+ <reference name="content">
74
+ <block type="core/template" name="payline-wallet-manage" template="payline/wallet/manage.phtml">
75
+ <block type="payline/wallet_details" name="payline-wallet-details" />
76
+ </block>
77
+ </reference>
78
+ </payline_wallet_manage>
79
+
80
+ <payline_wallet_subscribe>
81
+ <update handle="customer_account"/>
82
+ <reference name="root">
83
+ <action method="setHeaderTitle" translate="title"><title>Subscribe to wallet</title></action>
84
+ </reference>
85
+ <reference name="content">
86
+ <block type="core/template" name="payline-wallet-subscribe" template="payline/wallet/subscribe.phtml">
87
+ <block type="cms/block" name="payline-wallet-subscribe-cmsblock" ifconfig="payment/PaylineWALLET/payline_register-oneclick_customeraccount" >
88
+ <!-- <action method="setBlockId"><id>payline_register-oneclick_customeraccount</id></action>-->
89
+ </block>
90
+ <block type="core/template" name="payline-wallet-subscribe-iframe" template="payline/iframe.phtml" />
91
+ </block>
92
+ </reference>
93
+ </payline_wallet_subscribe>
94
+
95
+ <payline_unloggedwallet_subscribereturn>
96
+ <reference name="root">
97
+ <action method="setTemplate"><template>payline/page/empty.phtml</template></action>
98
+ </reference>
99
+ <reference name="content">
100
+ <block name="payline-iframe-leaver" type="core/template" template="payline/iframeleaver.phtml" />
101
+ </reference>
102
+ </payline_unloggedwallet_subscribereturn>
103
+ <payline_unloggedwallet_subscribecancel>
104
+ <reference name="root">
105
+ <action method="setTemplate"><template>payline/page/empty.phtml</template></action>
106
+ </reference>
107
+ <reference name="content">
108
+ <block name="payline-iframe-leaver" type="core/template" template="payline/iframeleaver.phtml" />
109
+ </reference>
110
+ </payline_unloggedwallet_subscribecancel>
111
+
112
+
113
+ <payline_wallet_update>
114
+ <update handle="customer_account"/>
115
+ <reference name="root">
116
+ <action method="setHeaderTitle" translate="title"><title>Update wallet</title></action>
117
+ </reference>
118
+ <reference name="content">
119
+ <block type="core/template" name="payline-wallet-update" template="payline/wallet/update.phtml">
120
+ <block type="core/template" name="payline-wallet-update-iframe" template="payline/iframe.phtml" />
121
+ </block>
122
+ </reference>
123
+ </payline_wallet_update>
124
+
125
+ <payline_unloggedwallet_updatereturn>
126
+ <reference name="root">
127
+ <action method="setTemplate"><template>payline/page/empty.phtml</template></action>
128
+ </reference>
129
+ <reference name="content">
130
+ <block name="payline-iframe-leaver" type="core/template" template="payline/iframeleaver.phtml" />
131
+ </reference>
132
+ </payline_unloggedwallet_updatereturn>
133
+ <payline_unloggedwallet_updatecancel>
134
+ <reference name="root">
135
+ <action method="setTemplate"><template>payline/page/empty.phtml</template></action>
136
+ </reference>
137
+ <reference name="content">
138
+ <block name="payline-iframe-leaver" type="core/template" template="payline/iframeleaver.phtml" />
139
+ </reference>
140
+ </payline_unloggedwallet_updatecancel>
141
+
142
+ <payline_checkoutonepage_index>
143
+ <update handle="checkout_onepage_index" />
144
+ <reference name="content">
145
+ <block type="core/template" name="payline-checkoutonepage" template="payline/checkout/onepage.phtml" />
146
+ </reference>
147
+ </payline_checkoutonepage_index>
148
+
149
+
150
+ <payline_index_directsecurized>
151
+ <reference name="root">
152
+ <action method="setTemplate"><template>payline/page/empty.phtml</template></action>
153
+ </reference>
154
+
155
+ <reference name="content">
156
+ <block type="core/template" name="payline-directsecurized" template="payline/checkout/directsecurized.phtml" />
157
+ </reference>
158
+ </payline_index_directsecurized>
159
+
160
+ <checkout_onepage_index>
161
+ <reference name="head">
162
+ <action method="addItem"><type>skin_js</type><name>js/payline.js</name></action>
163
+ </reference>
164
+ </checkout_onepage_index>
165
+
166
+ <sales_order_view>
167
+ <reference name="order_totals">
168
+ <block type="payline/adminhtml_sales_order_total_nxfees" name="nxfees_total" as="nxfees_total"/>
169
+ </reference>
170
+ </sales_order_view>
171
+
172
+ <sales_order_print>
173
+ <reference name="order_totals">
174
+ <block type="payline/adminhtml_sales_order_total_nxfees" name="nxfees_total" as="nxfees_total"/>
175
+ </reference>
176
+ </sales_order_print>
177
+
178
+ <sales_order_invoice>
179
+ <reference name="invoice_totals">
180
+ <block type="payline/adminhtml_sales_order_total_nxfees" name="nxfees_total" as="nxfees_total"/>
181
+ </reference>
182
+ </sales_order_invoice>
183
+
184
+ <sales_order_printinvoice>
185
+ <reference name="invoice_totals">
186
+ <block type="payline/adminhtml_sales_order_total_nxfees" name="nxfees_total" as="nxfees_total"/>
187
+ </reference>
188
+ </sales_order_printinvoice>
189
+
190
+ <payline_remove_onepage_payment_step_handler>
191
+ <reference name="head">
192
+ <block type="payline/checkout_widget_header" name="checkout.onepage.review.payline.widget.header" as="payline-review-widget-header" translate="label"/>
193
+ </reference>
194
+
195
+ <reference name="payment.progress">
196
+ <action method="setTemplate"><name>payline/checkout/onepage/progress/order.phtml</name></action>
197
+ </reference>
198
+
199
+ <reference name="content">
200
+ <remove name="checkout.onepage.payment" />
201
+ </reference>
202
+ </payline_remove_onepage_payment_step_handler>
203
+
204
+ <payline_onepage_review_handler>
205
+ <reference name="checkout.onepage.review.info.items.after">
206
+ <block type="payline/checkout_widget_opcheckout" name="checkout.onepage.review.payline.widget.update" as="payline-review-widget-update" translate="label" template="payline/checkout/onepage/widget-opcheckout-js-update.phtml" />
207
+ </reference>
208
+ </payline_onepage_review_handler>
209
+
210
+
211
+ </layout>
app/design/frontend/base/default/template/payline/Cpt.phtml CHANGED
File without changes
app/design/frontend/base/default/template/payline/Direct.phtml CHANGED
File without changes
app/design/frontend/base/default/template/payline/Payline.phtml CHANGED
File without changes
app/design/frontend/base/default/template/payline/checkout/directsecurized.phtml CHANGED
@@ -1,26 +1,26 @@
1
- <?php
2
-
3
- ?>
4
- <center>
5
- <span class="please-wait" id="final-review-please-wait">
6
- <img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif') ?>" alt="<?php echo $this->__('Redirecting to ACS...') ?>" title="<?php echo $this->__('Redirecting to ACS...') ?>" class="v-middle" />
7
- <?php echo $this->__('Redirecting to ACS...') ?>
8
- </span>
9
- <br/><br/>
10
- <?php echo $this->__('You will be redirect to your bank website to validate your transaction.'); ?>
11
- </center>
12
-
13
- <form name="3DSForm" action="<?php echo $this->getSecureUrl();?>" method='POST'>
14
- <?php foreach ($this->getSecureParams() as $paramKey=>$paramValue): ?>
15
- <input type="hidden" name="<?php echo $paramKey;?>" value="<?php echo $paramValue;?>">
16
- <?php endforeach;?>
17
- <noscript><input type='submit' name='submit' value='<?php echo $this->__('Click to manual redirect to ACS'); ?>'></noscript>
18
- </form>
19
-
20
- <script type="text/javascript">
21
- //<![CDATA[
22
- window.onload = function(){
23
- document.createElement('form').submit.call(document.forms['3DSForm']);
24
- }
25
- //]]>
26
  </script>
1
+ <?php
2
+
3
+ ?>
4
+ <center>
5
+ <span class="please-wait" id="final-review-please-wait">
6
+ <img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif') ?>" alt="<?php echo $this->__('Redirecting to ACS...') ?>" title="<?php echo $this->__('Redirecting to ACS...') ?>" class="v-middle" />
7
+ <?php echo $this->__('Redirecting to ACS...') ?>
8
+ </span>
9
+ <br/><br/>
10
+ <?php echo $this->__('You will be redirect to your bank website to validate your transaction.'); ?>
11
+ </center>
12
+
13
+ <form name="3DSForm" action="<?php echo $this->getSecureUrl();?>" method='POST'>
14
+ <?php foreach ($this->getSecureParams() as $paramKey=>$paramValue): ?>
15
+ <input type="hidden" name="<?php echo $paramKey;?>" value="<?php echo $paramValue;?>">
16
+ <?php endforeach;?>
17
+ <noscript><input type='submit' name='submit' value='<?php echo $this->__('Click to manual redirect to ACS'); ?>'></noscript>
18
+ </form>
19
+
20
+ <script type="text/javascript">
21
+ //<![CDATA[
22
+ window.onload = function(){
23
+ document.createElement('form').submit.call(document.forms['3DSForm']);
24
+ }
25
+ //]]>
26
  </script>
app/design/frontend/base/default/template/payline/checkout/onepage.phtml CHANGED
@@ -1,31 +1,31 @@
1
- <?php /* @var $this Monext_Payline_Block_Checkout_Onepage */?>
2
- <span class="please-wait" id="final-review-please-wait">
3
- <img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif') ?>" alt="<?php echo $this->__('Loading next step...') ?>" title="<?php echo $this->__('Loading next step...') ?>" class="v-middle" /> <?php echo $this->__('Loading next step...') ?>
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',
14
- '<?php echo $this->getUrl('*/*/review');?>',
15
- {method: 'get',
16
- onFailure: checkout.ajaxFailure.bind(checkout),
17
- evalScripts: true,
18
- onComplete: function(){
19
- $('final-review-please-wait').hide();
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>
1
+ <?php /* @var $this Monext_Payline_Block_Checkout_Onepage */?>
2
+ <span class="please-wait" id="final-review-please-wait">
3
+ <img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif') ?>" alt="<?php echo $this->__('Loading next step...') ?>" title="<?php echo $this->__('Loading next step...') ?>" class="v-middle" /> <?php echo $this->__('Loading next step...') ?>
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',
14
+ '<?php echo $this->getUrl('*/*/review');?>',
15
+ {method: 'get',
16
+ onFailure: checkout.ajaxFailure.bind(checkout),
17
+ evalScripts: true,
18
+ onComplete: function(){
19
+ $('final-review-please-wait').hide();
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/base/default/template/payline/checkout/onepage/info/default.phtml CHANGED
@@ -1,19 +1,19 @@
1
- <?php /* @var $this Monext_Payline_Block_Info_Direct */ ?>
2
- <?php $_specificInfo = $this->getSpecificInformation()?>
3
- <?php if (!empty($_specificInfo)) :?>
4
- <table class="payline-payment">
5
- <tbody>
6
- <?php foreach ($_specificInfo as $_label => $_value):?>
7
- <tr>
8
- <th><?php echo $this->escapeHtml($_label)?>:</th>
9
- <td><?php echo $_value?></td>
10
- </tr>
11
- <?php endforeach; ?>
12
- </tbody>
13
- </table>
14
- <?php else :?>
15
- <p><?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?></p>
16
- <?php endif?>
17
- <div class="payline-payment-logo">
18
- <img src="<?php echo $this->getSkinUrl('images/monext/payline-logo.png')?>" />
19
  </div>
1
+ <?php /* @var $this Monext_Payline_Block_Info_Direct */ ?>
2
+ <?php $_specificInfo = $this->getSpecificInformation()?>
3
+ <?php if (!empty($_specificInfo)) :?>
4
+ <table class="payline-payment">
5
+ <tbody>
6
+ <?php foreach ($_specificInfo as $_label => $_value):?>
7
+ <tr>
8
+ <th><?php echo $this->escapeHtml($_label)?>:</th>
9
+ <td><?php echo $_value?></td>
10
+ </tr>
11
+ <?php endforeach; ?>
12
+ </tbody>
13
+ </table>
14
+ <?php else :?>
15
+ <p><?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?></p>
16
+ <?php endif?>
17
+ <div class="payline-payment-logo">
18
+ <img src="<?php echo $this->getSkinUrl('images/monext/payline-logo.png')?>" />
19
  </div>
app/design/frontend/base/default/template/payline/checkout/onepage/payment/methods.phtml CHANGED
@@ -1,74 +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>
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>
app/design/frontend/base/default/template/payline/checkout/onepage/progress/order.phtml CHANGED
@@ -1,5 +1,5 @@
1
- <?php
2
- ?>
3
- <dt>
4
- <?php echo $this->__('Your order') ?>
5
  </dt>
1
+ <?php
2
+ ?>
3
+ <dt>
4
+ <?php echo $this->__('Your order') ?>
5
  </dt>
app/design/frontend/base/default/template/payline/checkout/onepage/shipping-method.phtml CHANGED
@@ -1,20 +1,20 @@
1
- <form id="co-shipping-method-form" action="">
2
- <div id="checkout-shipping-method-load">
3
- <?php echo $this->getChildHtml('available') ?>
4
- </div>
5
- <script type="text/javascript">
6
- //<![CDATA[
7
- var shippingMethod = new ShippingMethod('co-shipping-method-form', "<?php echo $this->getUrl('payline/checkoutonepage/saveShippingMethod') ?>");
8
- //]]>
9
- </script>
10
- <div id="onepage-checkout-shipping-method-additional-load">
11
- <?php echo $this->getChildHtml('additional') ?>
12
- </div>
13
- <div class="buttons-set" id="shipping-method-buttons-container">
14
- <p class="back-link"><a href="#" onclick="checkout.back(); return false;"><small>&laquo; </small><?php echo $this->__('Back') ?></a></p>
15
- <button id="btn-submit-shipping-method" type="button" class="button" onclick="shippingMethod.save()"><span><span><?php echo $this->__('Continue') ?></span></span></button>
16
- <span id="shipping-method-please-wait" class="please-wait" style="display:none;">
17
- <img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif') ?>" alt="<?php echo $this->__('Loading next step...') ?>" title="<?php echo $this->__('Loading next step...') ?>" class="v-middle" /> <?php echo $this->__('Loading next step...') ?>
18
- </span>
19
- </div>
20
- </form>
1
+ <form id="co-shipping-method-form" action="">
2
+ <div id="checkout-shipping-method-load">
3
+ <?php echo $this->getChildHtml('available') ?>
4
+ </div>
5
+ <script type="text/javascript">
6
+ //<![CDATA[
7
+ var shippingMethod = new ShippingMethod('co-shipping-method-form', "<?php echo $this->getUrl('payline/checkoutonepage/saveShippingMethod') ?>");
8
+ //]]>
9
+ </script>
10
+ <div id="onepage-checkout-shipping-method-additional-load">
11
+ <?php echo $this->getChildHtml('additional') ?>
12
+ </div>
13
+ <div class="buttons-set" id="shipping-method-buttons-container">
14
+ <p class="back-link"><a href="#" onclick="checkout.back(); return false;"><small>&laquo; </small><?php echo $this->__('Back') ?></a></p>
15
+ <button id="btn-submit-shipping-method" type="button" class="button" onclick="shippingMethod.save()"><span><span><?php echo $this->__('Continue') ?></span></span></button>
16
+ <span id="shipping-method-please-wait" class="please-wait" style="display:none;">
17
+ <img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif') ?>" alt="<?php echo $this->__('Loading next step...') ?>" title="<?php echo $this->__('Loading next step...') ?>" class="v-middle" /> <?php echo $this->__('Loading next step...') ?>
18
+ </span>
19
+ </div>
20
+ </form>
app/design/frontend/base/default/template/payline/checkout/onepage/widget-opcheckout-js-init.phtml CHANGED
@@ -1,93 +1,93 @@
1
- <?php
2
- /**
3
- * Call via observer Monext_Payline_Model_Observer::alterBlockHtmlAfter
4
- *
5
- * @var $this Monext_Payline_Block_Checkout_Widget_Opcheckout
6
- */
7
- ?>
8
- <script type="text/javascript">
9
- //<![CDATA[
10
- customPmHandler = function () {
11
- return widgetWrapper.getPmMethods();
12
- }
13
-
14
- //Dummy payment initWhatIsCvvListeners method
15
- Payment.prototype.initWhatIsCvvListeners = function () {
16
- }
17
-
18
- var paymentTemplate = new Template('<div id="pl-pmLayout-column-pmForm-custom-2" class="pl-pmForm" style="display: block;"><div id="pl-pm-custom_5-view" class="pl-paymentMethod-view pl-clear-after">'
19
- + '<p id="pl-pm-custom_5-message" class="pl-message"/><div id="pl-pm-custom_5-formContainer" class="pl-form-container pl-hide-labels">'
20
- + '<div id="pl-pm-custom_5-accountContainer" class="pl-form-group pl-has-feedback pl-accountContainer pl-clear-after"><p id="pl-pm-custom_5-account_message" class="pl-message"/><div class="pl-input-group-container">'
21
- + '<div class="pl-input-group pl-input-container">'
22
- + '<div class="magento-payline-custom-html">#{paymentHtml}</div>'
23
- + '</div></div>'
24
- + '</div><button id="pl-pm-custom_5-payBtn" class="pl-pay-btn" type="button" onclick="widgetWrapper.saveCustomPayment(\'#{paymentCode}\')">Payer</button></div></div></div>');
25
-
26
- // Dummy payment object
27
- var payment = new Payment();
28
-
29
- var quoteBaseGrandTotal = <?php echo $this->getQuoteBaseGrandTotal(); ?>;
30
- var lastPrice;
31
-
32
- var widgetWrapper = new PaylineWidgetWrapper('<?php echo Mage::helper('payline/widget')->getDataToken() ?>',
33
- '<?php echo Mage::helper('payline/widget')->getDataTemplate() ?>',
34
- '<?php echo $this->getSaveUrl() ?>',
35
- <?php echo $this->getJsonAllMethods()?>,
36
- <?php echo $this->getQuoteBaseGrandTotal()?>,
37
- "<?php echo $this->getCurrencyCode(); ?>",
38
- paymentTemplate
39
- );
40
-
41
- Review.prototype.isAgreementPassed = function () {
42
- var agreementPassed = true;
43
- this.elemDivAgreements = $('checkout-agreements')
44
- if (this.elemDivAgreements) {
45
- this.elemDivAgreements.select('input[type=checkbox][id^=agreement]').each(function (elem) {
46
- if (!elem.checked) {
47
- agreementPassed = false;
48
- }
49
- });
50
- }
51
-
52
- return agreementPassed;
53
- };
54
-
55
- Review.prototype.save = function () {
56
- if (checkout.loadWaiting != false) return;
57
- if (this.isAgreementPassed()) {
58
- if (this.elemDivAgreements) {
59
- this.elemDivAgreements.hide();
60
- }
61
- widgetWrapper.showWidget();
62
- } else {
63
- $('review-buttons-container').show();
64
- alert('<?php echo $this->jsQuoteEscape($this->__('Please agree to all the terms and conditions before placing the order.')); ?>');
65
- }
66
- };
67
-
68
- Review.prototype.initialize = function (saveUrl, successUrl, agreementsForm) {
69
- this.saveUrl = saveUrl;
70
- this.successUrl = successUrl;
71
- this.agreementsForm = agreementsForm;
72
- this.onSave = this.nextStep.bindAsEventListener(this);
73
- this.onComplete = this.resetLoadWaiting.bindAsEventListener(this);
74
-
75
-
76
- var noAgreement = this.isAgreementPassed();
77
- var that = this;
78
-
79
- var quoteBaseGrandTotalINT=Math.round(String(quoteBaseGrandTotal*100));
80
- var datasPayline = {"payment":{"amount":quoteBaseGrandTotalINT},"order":{"amount":quoteBaseGrandTotalINT}};
81
-
82
-
83
- Payline.Api.updateWebpaymentData('<?php echo $this->helper('payline/widget')->getDataToken(); ?>', datasPayline,function (){
84
- widgetWrapper.initPayline(noAgreement);
85
- if (noAgreement) {
86
- that.save();
87
- }
88
- });
89
- }
90
-
91
-
92
- //]]>
93
- </script>
1
+ <?php
2
+ /**
3
+ * Call via observer Monext_Payline_Model_Observer::alterBlockHtmlAfter
4
+ *
5
+ * @var $this Monext_Payline_Block_Checkout_Widget_Opcheckout
6
+ */
7
+ ?>
8
+ <script type="text/javascript">
9
+ //<![CDATA[
10
+ customPmHandler = function () {
11
+ return widgetWrapper.getPmMethods();
12
+ }
13
+
14
+ //Dummy payment initWhatIsCvvListeners method
15
+ Payment.prototype.initWhatIsCvvListeners = function () {
16
+ }
17
+
18
+ var paymentTemplate = new Template('<div id="pl-pmLayout-column-pmForm-custom-2" class="pl-pmForm" style="display: block;"><div id="pl-pm-custom_5-view" class="pl-paymentMethod-view pl-clear-after">'
19
+ + '<p id="pl-pm-custom_5-message" class="pl-message"/><div id="pl-pm-custom_5-formContainer" class="pl-form-container pl-hide-labels">'
20
+ + '<div id="pl-pm-custom_5-accountContainer" class="pl-form-group pl-has-feedback pl-accountContainer pl-clear-after"><p id="pl-pm-custom_5-account_message" class="pl-message"/><div class="pl-input-group-container">'
21
+ + '<div class="pl-input-group pl-input-container">'
22
+ + '<div class="magento-payline-custom-html">#{paymentHtml}</div>'
23
+ + '</div></div>'
24
+ + '</div><button id="pl-pm-custom_5-payBtn" class="pl-pay-btn" type="button" onclick="widgetWrapper.saveCustomPayment(\'#{paymentCode}\')">Payer</button></div></div></div>');
25
+
26
+ // Dummy payment object
27
+ var payment = new Payment();
28
+
29
+ var quoteBaseGrandTotal = <?php echo $this->getQuoteBaseGrandTotal(); ?>;
30
+ var lastPrice;
31
+
32
+ var widgetWrapper = new PaylineWidgetWrapper('<?php echo Mage::helper('payline/widget')->getDataToken() ?>',
33
+ '<?php echo Mage::helper('payline/widget')->getDataTemplate() ?>',
34
+ '<?php echo $this->getSaveUrl() ?>',
35
+ <?php echo $this->getJsonAllMethods()?>,
36
+ <?php echo $this->getQuoteBaseGrandTotal()?>,
37
+ "<?php echo $this->getCurrencyCode(); ?>",
38
+ paymentTemplate
39
+ );
40
+
41
+ Review.prototype.isAgreementPassed = function () {
42
+ var agreementPassed = true;
43
+ this.elemDivAgreements = $('checkout-agreements')
44
+ if (this.elemDivAgreements) {
45
+ this.elemDivAgreements.select('input[type=checkbox][id^=agreement]').each(function (elem) {
46
+ if (!elem.checked) {
47
+ agreementPassed = false;
48
+ }
49
+ });
50
+ }
51
+
52
+ return agreementPassed;
53
+ };
54
+
55
+ Review.prototype.save = function () {
56
+ if (checkout.loadWaiting != false) return;
57
+ if (this.isAgreementPassed()) {
58
+ if (this.elemDivAgreements) {
59
+ this.elemDivAgreements.hide();
60
+ }
61
+ widgetWrapper.showWidget();
62
+ } else {
63
+ $('review-buttons-container').show();
64
+ alert('<?php echo $this->jsQuoteEscape($this->__('Please agree to all the terms and conditions before placing the order.')); ?>');
65
+ }
66
+ };
67
+
68
+ Review.prototype.initialize = function (saveUrl, successUrl, agreementsForm) {
69
+ this.saveUrl = saveUrl;
70
+ this.successUrl = successUrl;
71
+ this.agreementsForm = agreementsForm;
72
+ this.onSave = this.nextStep.bindAsEventListener(this);
73
+ this.onComplete = this.resetLoadWaiting.bindAsEventListener(this);
74
+
75
+
76
+ var noAgreement = this.isAgreementPassed();
77
+ var that = this;
78
+
79
+ var quoteBaseGrandTotalINT=Math.round(String(quoteBaseGrandTotal*100));
80
+ var datasPayline = {"payment":{"amount":quoteBaseGrandTotalINT},"order":{"amount":quoteBaseGrandTotalINT}};
81
+
82
+
83
+ Payline.Api.updateWebpaymentData('<?php echo $this->helper('payline/widget')->getDataToken(); ?>', datasPayline,function (){
84
+ widgetWrapper.initPayline(noAgreement);
85
+ if (noAgreement) {
86
+ that.save();
87
+ }
88
+ });
89
+ }
90
+
91
+
92
+ //]]>
93
+ </script>
app/design/frontend/base/default/template/payline/checkout/onepage/widget-opcheckout-js-update.phtml CHANGED
@@ -1,13 +1,13 @@
1
- <?php
2
- /**
3
- * Call via observer Monext_Payline_Model_Observer::alterBlockHtmlAfter
4
- *
5
- * @var $this Monext_Payline_Block_Checkout_Widget_Opcheckout
6
- */
7
- ?>
8
- <script type="text/javascript">
9
- //<![CDATA[
10
- quoteBaseGrandTotal = <?php echo Mage::getSingleton('checkout/session')->getQuote()->getBaseGrandTotal(); ?>;
11
- widgetWrapper.setFinalPaymentMethods(<?php echo $this->getJsonCurrentMethods(); ?>);
12
- //]]>
13
- </script>
1
+ <?php
2
+ /**
3
+ * Call via observer Monext_Payline_Model_Observer::alterBlockHtmlAfter
4
+ *
5
+ * @var $this Monext_Payline_Block_Checkout_Widget_Opcheckout
6
+ */
7
+ ?>
8
+ <script type="text/javascript">
9
+ //<![CDATA[
10
+ quoteBaseGrandTotal = <?php echo Mage::getSingleton('checkout/session')->getQuote()->getBaseGrandTotal(); ?>;
11
+ widgetWrapper.setFinalPaymentMethods(<?php echo $this->getJsonCurrentMethods(); ?>);
12
+ //]]>
13
+ </script>
app/design/frontend/base/default/template/payline/checkout/onepage/widget-opcheckout-js.phtml CHANGED
@@ -1,94 +1,94 @@
1
- <?php
2
- /**
3
- * Call via observer Monext_Payline_Model_Observer::alterBlockHtmlAfter
4
- *
5
- * @var $this Monext_Payline_Block_Checkout_Widget_Opcheckout
6
- */
7
- ?>
8
- <script type="text/javascript">
9
- //<![CDATA[
10
- customPmHandler = function () {
11
- return widgetWrapper.getPmMethods();
12
- }
13
-
14
- //Dummy payment initWhatIsCvvListeners method
15
- Payment.prototype.initWhatIsCvvListeners = function () {
16
- }
17
-
18
- var paymentTemplate = new Template('<div id="pl-pmLayout-column-pmForm-custom-2" class="pl-pmForm" style="display: block;"><div id="pl-pm-custom_5-view" class="pl-paymentMethod-view pl-clear-after">'
19
- + '<p id="pl-pm-custom_5-message" class="pl-message"/><div id="pl-pm-custom_5-formContainer" class="pl-form-container pl-hide-labels">'
20
- + '<div id="pl-pm-custom_5-accountContainer" class="pl-form-group pl-has-feedback pl-accountContainer pl-clear-after"><p id="pl-pm-custom_5-account_message" class="pl-message"/><div class="pl-input-group-container">'
21
- + '<div class="pl-input-group pl-input-container">'
22
- + '<div class="magento-payline-custom-html">#{paymentHtml}</div>'
23
- + '</div></div>'
24
- + '</div><button id="pl-pm-custom_5-payBtn" class="pl-pay-btn" type="button" onclick="widgetWrapper.saveCustomPayment(\'#{paymentCode}\')">Payer</button></div></div></div>');
25
-
26
- // Dummy payment object
27
- var payment = new Payment();
28
-
29
- var quoteBaseGrandTotal = <?php echo $this->getQuoteBaseGrandTotal(); ?>;
30
- var lastPrice;
31
-
32
- var widgetWrapper = new PaylineWidgetWrapper('<?php echo Mage::helper('payline/widget')->getDataToken() ?>',
33
- '<?php echo Mage::helper('payline/widget')->getDataTemplate() ?>',
34
- '<?php echo $this->getSaveUrl() ?>',
35
- <?php echo $this->getJsonAllMethods()?>,
36
- <?php echo $this->getQuoteBaseGrandTotal()?>,
37
- "<?php echo $this->getCurrencyCode(); ?>",
38
- paymentTemplate
39
- );
40
-
41
- Review.prototype.isAgreementPassed = function () {
42
- var agreementPassed = true;
43
- this.elemDivAgreements = $('checkout-agreements')
44
- if (this.elemDivAgreements) {
45
- this.elemDivAgreements.select('input[type=checkbox][id^=agreement]').each(function (elem) {
46
- if (!elem.checked) {
47
- agreementPassed = false;
48
- }
49
- });
50
- }
51
-
52
- return agreementPassed;
53
- };
54
-
55
- Review.prototype.save = function () {
56
- if (checkout.loadWaiting != false) return;
57
- if (this.isAgreementPassed()) {
58
- if (this.elemDivAgreements) {
59
- this.elemDivAgreements.hide();
60
- }
61
- widgetWrapper.showWidget();
62
- } else {
63
- $('review-buttons-container').show();
64
- alert('<?php echo $this->jsQuoteEscape($this->__('Please agree to all the terms and conditions before placing the order.')); ?>');
65
- }
66
- };
67
-
68
- Review.prototype.initialize = function (saveUrl, successUrl, agreementsForm) {
69
- this.saveUrl = saveUrl;
70
- this.successUrl = successUrl;
71
- this.agreementsForm = agreementsForm;
72
- this.onSave = this.nextStep.bindAsEventListener(this);
73
- this.onComplete = this.resetLoadWaiting.bindAsEventListener(this);
74
-
75
-
76
- var noAgreement = this.isAgreementPassed();
77
- var that = this;
78
-
79
- var quoteBaseGrandTotalINT=String(quoteBaseGrandTotal*100).split('.')[0];
80
- var datasPayline = {"payment":{"amount":quoteBaseGrandTotalINT},"order":{"amount":quoteBaseGrandTotalINT}};
81
-
82
-
83
- Payline.Api.updateWebpaymentData('<?php echo $this->helper('payline/widget')->getDataToken(); ?>', datasPayline,function (){
84
- widgetWrapper.setFinalPaymentMethods(<?php echo $this->getJsonCurrentMethods(); ?>);
85
- widgetWrapper.initPayline(noAgreement);
86
- if (noAgreement) {
87
- that.save();
88
- }
89
- });
90
- }
91
-
92
-
93
- //]]>
94
- </script>
1
+ <?php
2
+ /**
3
+ * Call via observer Monext_Payline_Model_Observer::alterBlockHtmlAfter
4
+ *
5
+ * @var $this Monext_Payline_Block_Checkout_Widget_Opcheckout
6
+ */
7
+ ?>
8
+ <script type="text/javascript">
9
+ //<![CDATA[
10
+ customPmHandler = function () {
11
+ return widgetWrapper.getPmMethods();
12
+ }
13
+
14
+ //Dummy payment initWhatIsCvvListeners method
15
+ Payment.prototype.initWhatIsCvvListeners = function () {
16
+ }
17
+
18
+ var paymentTemplate = new Template('<div id="pl-pmLayout-column-pmForm-custom-2" class="pl-pmForm" style="display: block;"><div id="pl-pm-custom_5-view" class="pl-paymentMethod-view pl-clear-after">'
19
+ + '<p id="pl-pm-custom_5-message" class="pl-message"/><div id="pl-pm-custom_5-formContainer" class="pl-form-container pl-hide-labels">'
20
+ + '<div id="pl-pm-custom_5-accountContainer" class="pl-form-group pl-has-feedback pl-accountContainer pl-clear-after"><p id="pl-pm-custom_5-account_message" class="pl-message"/><div class="pl-input-group-container">'
21
+ + '<div class="pl-input-group pl-input-container">'
22
+ + '<div class="magento-payline-custom-html">#{paymentHtml}</div>'
23
+ + '</div></div>'
24
+ + '</div><button id="pl-pm-custom_5-payBtn" class="pl-pay-btn" type="button" onclick="widgetWrapper.saveCustomPayment(\'#{paymentCode}\')">Payer</button></div></div></div>');
25
+
26
+ // Dummy payment object
27
+ var payment = new Payment();
28
+
29
+ var quoteBaseGrandTotal = <?php echo $this->getQuoteBaseGrandTotal(); ?>;
30
+ var lastPrice;
31
+
32
+ var widgetWrapper = new PaylineWidgetWrapper('<?php echo Mage::helper('payline/widget')->getDataToken() ?>',
33
+ '<?php echo Mage::helper('payline/widget')->getDataTemplate() ?>',
34
+ '<?php echo $this->getSaveUrl() ?>',
35
+ <?php echo $this->getJsonAllMethods()?>,
36
+ <?php echo $this->getQuoteBaseGrandTotal()?>,
37
+ "<?php echo $this->getCurrencyCode(); ?>",
38
+ paymentTemplate
39
+ );
40
+
41
+ Review.prototype.isAgreementPassed = function () {
42
+ var agreementPassed = true;
43
+ this.elemDivAgreements = $('checkout-agreements')
44
+ if (this.elemDivAgreements) {
45
+ this.elemDivAgreements.select('input[type=checkbox][id^=agreement]').each(function (elem) {
46
+ if (!elem.checked) {
47
+ agreementPassed = false;
48
+ }
49
+ });
50
+ }
51
+
52
+ return agreementPassed;
53
+ };
54
+
55
+ Review.prototype.save = function () {
56
+ if (checkout.loadWaiting != false) return;
57
+ if (this.isAgreementPassed()) {
58
+ if (this.elemDivAgreements) {
59
+ this.elemDivAgreements.hide();
60
+ }
61
+ widgetWrapper.showWidget();
62
+ } else {
63
+ $('review-buttons-container').show();
64
+ alert('<?php echo $this->jsQuoteEscape($this->__('Please agree to all the terms and conditions before placing the order.')); ?>');
65
+ }
66
+ };
67
+
68
+ Review.prototype.initialize = function (saveUrl, successUrl, agreementsForm) {
69
+ this.saveUrl = saveUrl;
70
+ this.successUrl = successUrl;
71
+ this.agreementsForm = agreementsForm;
72
+ this.onSave = this.nextStep.bindAsEventListener(this);
73
+ this.onComplete = this.resetLoadWaiting.bindAsEventListener(this);
74
+
75
+
76
+ var noAgreement = this.isAgreementPassed();
77
+ var that = this;
78
+
79
+ var quoteBaseGrandTotalINT=String(quoteBaseGrandTotal*100).split('.')[0];
80
+ var datasPayline = {"payment":{"amount":quoteBaseGrandTotalINT},"order":{"amount":quoteBaseGrandTotalINT}};
81
+
82
+
83
+ Payline.Api.updateWebpaymentData('<?php echo $this->helper('payline/widget')->getDataToken(); ?>', datasPayline,function (){
84
+ widgetWrapper.setFinalPaymentMethods(<?php echo $this->getJsonCurrentMethods(); ?>);
85
+ widgetWrapper.initPayline(noAgreement);
86
+ if (noAgreement) {
87
+ that.save();
88
+ }
89
+ });
90
+ }
91
+
92
+
93
+ //]]>
94
+ </script>
app/design/frontend/base/default/template/payline/checkout/onepage/widget-update.phtml CHANGED
@@ -1,14 +1,14 @@
1
- <?php
2
- $data=array('payment'=>array('amount'=>$this->getQuoteBaseGrandTotal()),
3
- 'order'=>array('amount'=>$this->getQuoteBaseGrandTotal()));
4
- ?>
5
- <script type="text/javascript">
6
- var urlPayline='<?php echo $this->helper('payline/widget')->getUrlUpdate($this->helper('payline/widget')->getDataToken()); ?>';
7
- var datas=<?php echo json_encode($data); ?>;
8
-
9
- jQuery.ajax({
10
- url: urlPayline,
11
- type: 'PUT',
12
- data:datas
13
- });
1
+ <?php
2
+ $data=array('payment'=>array('amount'=>$this->getQuoteBaseGrandTotal()),
3
+ 'order'=>array('amount'=>$this->getQuoteBaseGrandTotal()));
4
+ ?>
5
+ <script type="text/javascript">
6
+ var urlPayline='<?php echo $this->helper('payline/widget')->getUrlUpdate($this->helper('payline/widget')->getData