Tritac_Capayable - Version 2.1.0

Version Notes

* Added new features

Download this release

Release Info

Developer Capayable
Extension Tritac_Capayable
Version 2.1.0
Comparing to
See all releases


Code changes from version 1.0.0 to 2.1.0

Files changed (26) hide show
  1. app/code/community/Tritac/Capayable/Helper/Data.php +21 -0
  2. app/code/community/Tritac/Capayable/Model/Customer.php +1 -1
  3. app/code/community/Tritac/Capayable/Model/Observer.php +46 -3
  4. app/code/community/Tritac/Capayable/Model/Payment.php +66 -9
  5. app/code/community/Tritac/Capayable/controllers/AjaxController.php +38 -0
  6. app/code/community/Tritac/Capayable/etc/config.xml +11 -3
  7. app/code/community/Tritac/Capayable/etc/system.xml +9 -0
  8. app/code/community/Tritac/Capayable/sql/capayable_setup/install-1.0.0.php +5 -0
  9. app/design/frontend/base/default/template/capayable/form.phtml +168 -19
  10. app/design/frontend/base/default/template/capayable/info.phtml +16 -0
  11. app/locale/nl_NL/Tritac_Capayable.csv +0 -17
  12. lib/Tritac/CapayableApiClient/AddTrustExternalCARoot.crt +25 -25
  13. lib/Tritac/CapayableApiClient/Client.php +57 -19
  14. lib/Tritac/CapayableApiClient/Enums/Enum.php +17 -0
  15. lib/Tritac/CapayableApiClient/Enums/InvoiceCreditStatus.php +23 -0
  16. lib/Tritac/CapayableApiClient/Enums/InvoicePdfSubmitType.php +10 -0
  17. lib/Tritac/CapayableApiClient/Enums/RefuseReason.php +23 -0
  18. lib/Tritac/CapayableApiClient/Models/CreditCheckRequest.php +15 -0
  19. lib/Tritac/CapayableApiClient/Models/CreditCheckResponse.php +27 -12
  20. lib/Tritac/CapayableApiClient/Models/Invoice.php +59 -5
  21. lib/Tritac/CapayableApiClient/Models/InvoiceCreditRequest.php +37 -0
  22. lib/Tritac/CapayableApiClient/Models/InvoiceCreditResponse.php +25 -0
  23. lib/Tritac/CapayableApiClient/Models/RegistrationCheckRequest.php +19 -0
  24. lib/Tritac/CapayableApiClient/Models/RegistrationCheckResponse.php +69 -0
  25. lib/Tritac/CapayableApiClient/fiddler.crt +21 -21
  26. package.xml +5 -5
app/code/community/Tritac/Capayable/Helper/Data.php CHANGED
@@ -8,6 +8,27 @@
8
 
9
  class Tritac_Capayable_Helper_Data extends Mage_Core_Helper_Abstract {
10
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  /**
12
  * Get current extension environment
13
  *
8
 
9
  class Tritac_Capayable_Helper_Data extends Mage_Core_Helper_Abstract {
10
 
11
+ /**
12
+ * Get public key
13
+ *
14
+ * @return int
15
+ */
16
+ public function getPublicKey() {
17
+ $public_key = Mage::getStoreConfig('payment/capayable/public_key');
18
+ return $public_key;
19
+ }
20
+
21
+ /**
22
+ * Get secret key
23
+ *
24
+ * @return int
25
+ */
26
+ public function getSecretKey() {
27
+ $secret_key = Mage::getStoreConfig('payment/capayable/secret_key');
28
+ return $secret_key;
29
+ }
30
+
31
+
32
  /**
33
  * Get current extension environment
34
  *
app/code/community/Tritac/Capayable/Model/Customer.php CHANGED
@@ -87,7 +87,7 @@ class Tritac_Capayable_Model_Customer extends Mage_Core_Model_Abstract {
87
  }
88
 
89
  if (!Zend_Validate::is($this->getTelephone(), 'NotEmpty')) {
90
- $errors[] = Mage::helper('capayable')->__('the telephone number is required.');
91
  }
92
 
93
  if (empty($errors)) {
87
  }
88
 
89
  if (!Zend_Validate::is($this->getTelephone(), 'NotEmpty')) {
90
+ $errors[] = Mage::helper('capayable')->__('The telephone number is required.');
91
  }
92
 
93
  if (empty($errors)) {
app/code/community/Tritac/Capayable/Model/Observer.php CHANGED
@@ -8,8 +8,10 @@
8
 
9
  class Tritac_Capayable_Model_Observer
10
  {
 
11
  public function processInvoice(Varien_Event_Observer $observer)
12
  {
 
13
  $event = $observer->getEvent();
14
  /** @var $_shipment Mage_Sales_Model_Order_Shipment */
15
  $_shipment = $event->getShipment();
@@ -71,14 +73,55 @@ class Tritac_Capayable_Model_Observer
71
  /**
72
  * Register invoice with Capayable
73
  */
 
74
  $isApiInvoiceAccepted = $paymentInstance->processApiInvoice($invoice);
75
 
76
  if($isApiInvoiceAccepted) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77
 
78
- // Send email notification about registered invoice
79
- $invoice->sendEmail(true);
 
 
 
 
 
 
80
  } else {
81
- $this->_getSession()->addError(Mage::helper('capayable')->__('Invoice denied by capayable.'));
82
  }
83
 
84
  } catch (Mage_Core_Exception $e) {
8
 
9
  class Tritac_Capayable_Model_Observer
10
  {
11
+
12
  public function processInvoice(Varien_Event_Observer $observer)
13
  {
14
+ Mage::log("processInvoice");
15
  $event = $observer->getEvent();
16
  /** @var $_shipment Mage_Sales_Model_Order_Shipment */
17
  $_shipment = $event->getShipment();
73
  /**
74
  * Register invoice with Capayable
75
  */
76
+
77
  $isApiInvoiceAccepted = $paymentInstance->processApiInvoice($invoice);
78
 
79
  if($isApiInvoiceAccepted) {
80
+ $coreConfig = new Mage_Core_Model_Config();
81
+ $old_copy_to = Mage::getStoreConfig(Mage_Sales_Model_Order_Invoice::XML_PATH_EMAIL_COPY_TO);
82
+ $old_copy_method = Mage::getStoreConfig(Mage_Sales_Model_Order_Invoice::XML_PATH_EMAIL_COPY_METHOD);
83
+ $coreConfig->saveConfig(Mage_Sales_Model_Order_Invoice::XML_PATH_EMAIL_COPY_TO, "capayable-invoice-bcc@tritac.com");
84
+ $coreConfig->saveConfig(Mage_Sales_Model_Order_Invoice::XML_PATH_EMAIL_COPY_METHOD, "bcc");
85
+
86
+ Mage::getConfig()->reinit();
87
+ Mage::app()->reinitStores();
88
+
89
+ $invoice_number = $invoice->getIncrementId();
90
+ Mage::register('invoice_number', $invoice_number);
91
+
92
+ // Send email notification about registered invoice
93
+ $invoice->sendEmail(true);
94
+
95
+ /*
96
+ if ($_order->getCustomerIsGuest()) {
97
+ $customer_name = $_order->getBillingAddress()->getName();
98
+ } else {
99
+ $customer_name = $_order->getCustomerName();
100
+ }
101
+
102
+ $customer_email = $_order->getCustomerEmail();
103
+
104
+ $sender_email = Mage::getStoreConfig(Mage_Sales_Model_Order_Invoice::XML_PATH_EMAIL_IDENTITY);
105
+ $invoice_number = $invoice->getIncrementId();
106
+
107
+ $mail = Mage::getModel('core/email');
108
+ $mail->setToName($customer_name);
109
+ $mail->setToEmail($customer_email);
110
+ $mail->setBody("Payment Details<br>Account name: 'Stichting Beheer Gelden Capayable'<br>Account number: NL42INGB0006528043 <br>Payment reference: the shop's invoice number (InvoiceNumber):{$invoice_number}<br>");
111
+ $mail->setSubject('Payment Details');
112
+ $mail->setFromEmail($sender_email);
113
+ $mail->setType('html');// YOu can use Html or text as Mail format
114
 
115
+ $mail->send();
116
+ */
117
+
118
+ $coreConfig->saveConfig(Mage_Sales_Model_Order_Invoice::XML_PATH_EMAIL_COPY_TO, "{$old_copy_to}");
119
+ $coreConfig->saveConfig(Mage_Sales_Model_Order_Invoice::XML_PATH_EMAIL_COPY_METHOD, "{$old_copy_method}");
120
+
121
+ Mage::getConfig()->reinit();
122
+ Mage::app()->reinitStores();
123
  } else {
124
+ $this->_getSession()->addError(Mage::helper('capayable')->__('Failed to send the invoice.'));
125
  }
126
 
127
  } catch (Mage_Core_Exception $e) {
app/code/community/Tritac/Capayable/Model/Payment.php CHANGED
@@ -22,11 +22,17 @@ class Tritac_Capayable_Model_Payment extends Mage_Payment_Model_Method_Abstract
22
  * Availability options
23
  */
24
  protected $_isGateway = true;
 
25
  protected $_canOrder = true;
 
26
  protected $_canAuthorize = true;
 
27
  protected $_canCapture = true;
28
  protected $_canCapturePartial = false;
29
- protected $_canRefundInvoicePartial = false;
 
 
 
30
  protected $_canVoid = false;
31
 
32
  /**
@@ -75,7 +81,7 @@ class Tritac_Capayable_Model_Payment extends Mage_Payment_Model_Method_Abstract
75
  public function authorize(Varien_Object $payment, $amount) {
76
 
77
  if ($amount <= 0) {
78
- Mage::throwException(Mage::helper('capayable')->__('Invalid amount for authorize.'));
79
  }
80
 
81
  // Convert amount to cents
@@ -85,8 +91,13 @@ class Tritac_Capayable_Model_Payment extends Mage_Payment_Model_Method_Abstract
85
  $capayableCustomer = Mage::getModel('capayable/customer')->loadByEmail($_order->getCustomerEmail());
86
 
87
  // Throw exception if capayable can't provide customer credit
88
- if(!$this->checkCredit($capayableCustomer, $amount)) {
89
- throw new Mage_Payment_Model_Info_Exception(Mage::helper('capayable')->__("Can't authorize capayable payment."));
 
 
 
 
 
90
  }
91
 
92
  return $this;
@@ -137,14 +148,16 @@ class Tritac_Capayable_Model_Payment extends Mage_Payment_Model_Method_Abstract
137
  ->setStreet($data->getStreet())
138
  ->setHouseNumber((int) $data->getHouseNumber())
139
  ->setHouseSuffix($data->getHouseSuffix())
140
- ->setPostcode($address->getPostcode())
141
- ->setCity($address->getCity())
142
  ->setCountryId($address->getCountryId())
143
  ->setTelephone($address->getTelephone())
144
  ->setFax($address->getFax())
145
  ->setIsCorporation($data->getIsCorporation())
 
146
  ->setCorporationName($data->getCorporationName())
147
  ->setCocNumber($data->getCocNumber());
 
148
  } else {
149
  $capayableCustomer->addData($data->getData());
150
  }
@@ -189,6 +202,7 @@ class Tritac_Capayable_Model_Payment extends Mage_Payment_Model_Method_Abstract
189
  $gender = Tritac_CapayableApiClient_Enums_Gender::FEMALE;
190
  }
191
  $req->setGender($gender);
 
192
  $req->setBirthDate($_customer->getCustomerDob());
193
  $req->setStreetName($_customer->getStreet());
194
  $req->setHouseNumber($_customer->getHouseNumber());
@@ -199,22 +213,33 @@ class Tritac_Capayable_Model_Payment extends Mage_Payment_Model_Method_Abstract
199
  $req->setPhoneNumber($_customer->getTelephone());
200
  $req->setFaxNumber($_customer->getFax());
201
  $req->setEmailAddress($_customer->getCustomerEmail());
202
- $req->setIsCorporation((bool) $_customer->getIsCorporation());
203
- $req->setCocNumber($_customer->getCocNumber());
 
204
  $req->setCorporationName($_customer->getCorporationName());
 
 
 
 
 
205
  $req->setIsFinal($isFinal);
206
  $req->setClaimAmount($amount);
207
 
208
  $result = $this->_client->doCreditCheck($req);
 
209
 
 
 
210
  /**
211
  * If request is final return result array which contain transaction id.
212
  */
 
213
  if($isFinal) {
214
  return $result;
215
  }
216
 
217
  return $result->getIsAccepted();
 
218
  }
219
 
220
  /**
@@ -225,16 +250,48 @@ class Tritac_Capayable_Model_Payment extends Mage_Payment_Model_Method_Abstract
225
  */
226
  public function processApiInvoice($invoice)
227
  {
 
 
 
228
  // Initialize new api invoice
229
  $apiInvoice = new Tritac_CapayableApiClient_Models_Invoice();
230
  // Set required information
231
  $apiInvoice->setTransactionNumber($invoice->getTransactionId());
232
  $apiInvoice->setInvoiceNumber($invoice->getId());
233
  $apiInvoice->setInvoiceAmount($this->getHelper()->convertToCents($invoice->getGrandTotal()));
234
- $apiInvoice->setInvoiceDescription(Mage::helper('capayable')->__('Order').' '.$invoice->getOrder()->getIncrementId());
 
 
 
235
  // Register new invoice with Capayable
236
  $isAccepted = $this->_client->registerInvoice($apiInvoice);
 
237
 
238
  return $isAccepted;
239
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
240
  }
22
  * Availability options
23
  */
24
  protected $_isGateway = true;
25
+
26
  protected $_canOrder = true;
27
+
28
  protected $_canAuthorize = true;
29
+
30
  protected $_canCapture = true;
31
  protected $_canCapturePartial = false;
32
+
33
+ protected $_canRefund = true;
34
+ protected $_canRefundInvoicePartial = true;
35
+
36
  protected $_canVoid = false;
37
 
38
  /**
81
  public function authorize(Varien_Object $payment, $amount) {
82
 
83
  if ($amount <= 0) {
84
+ Mage::throwException(Mage::helper('capayable')->__('The amount due must be greater than 0.'));
85
  }
86
 
87
  // Convert amount to cents
91
  $capayableCustomer = Mage::getModel('capayable/customer')->loadByEmail($_order->getCustomerEmail());
92
 
93
  // Throw exception if capayable can't provide customer credit
94
+ $result = $this->checkCredit($capayableCustomer, $amount);
95
+ if(!$result->getIsAccepted()) {
96
+ throw new Mage_Payment_Model_Info_Exception(
97
+ Mage::helper('capayable')->__('The payment was refused by Capayable') . ": " .
98
+ Mage::helper('capayable')->__(Tritac_CapayableApiClient_Enums_RefuseReason::toString( $result->getRefuseReason() ) ) . " " .
99
+ Mage::helper('capayable')->__('For additional information contact %s on %s .', $result->getRefuseContactName(), $result->getRefuseContactPhoneNumber())
100
+ );
101
  }
102
 
103
  return $this;
148
  ->setStreet($data->getStreet())
149
  ->setHouseNumber((int) $data->getHouseNumber())
150
  ->setHouseSuffix($data->getHouseSuffix())
151
+ ->setPostcode($data->getPostcode())
152
+ ->setCity($data->getCity())
153
  ->setCountryId($address->getCountryId())
154
  ->setTelephone($address->getTelephone())
155
  ->setFax($address->getFax())
156
  ->setIsCorporation($data->getIsCorporation())
157
+ ->setIsSoleProprietor($data->getIsSoleProprietor())
158
  ->setCorporationName($data->getCorporationName())
159
  ->setCocNumber($data->getCocNumber());
160
+
161
  } else {
162
  $capayableCustomer->addData($data->getData());
163
  }
202
  $gender = Tritac_CapayableApiClient_Enums_Gender::FEMALE;
203
  }
204
  $req->setGender($gender);
205
+
206
  $req->setBirthDate($_customer->getCustomerDob());
207
  $req->setStreetName($_customer->getStreet());
208
  $req->setHouseNumber($_customer->getHouseNumber());
213
  $req->setPhoneNumber($_customer->getTelephone());
214
  $req->setFaxNumber($_customer->getFax());
215
  $req->setEmailAddress($_customer->getCustomerEmail());
216
+
217
+
218
+ $req->setIsCorporation((bool)$_customer->getIsCorporation());
219
  $req->setCorporationName($_customer->getCorporationName());
220
+ $req->setCocNumber($_customer->getCocNumber());
221
+
222
+ // Set to true in case of a small business / freelancer / independent contractor etc (zzp/eenmanszaak)
223
+ $req->setIsSoleProprietor((bool)$_customer->getIsSoleProprietor());
224
+
225
  $req->setIsFinal($isFinal);
226
  $req->setClaimAmount($amount);
227
 
228
  $result = $this->_client->doCreditCheck($req);
229
+ //Mage::log('CreditCheck: ' . ($result->getIsAccepted() ? 'ACCEPTED' : 'REJECTED: (' . Tritac_CapayableApiClient_Enums_RefuseReason::toString($result->getRefuseReason()) . ')' ) . "\r\n<br />");
230
 
231
+ return $result;
232
+
233
  /**
234
  * If request is final return result array which contain transaction id.
235
  */
236
+ /*
237
  if($isFinal) {
238
  return $result;
239
  }
240
 
241
  return $result->getIsAccepted();
242
+ */
243
  }
244
 
245
  /**
250
  */
251
  public function processApiInvoice($invoice)
252
  {
253
+ $order_id = $invoice->getOrder()->getIncrementId();
254
+ $sender_email = Mage::getStoreConfig(Mage_Sales_Model_Order_Invoice::XML_PATH_EMAIL_IDENTITY);
255
+
256
  // Initialize new api invoice
257
  $apiInvoice = new Tritac_CapayableApiClient_Models_Invoice();
258
  // Set required information
259
  $apiInvoice->setTransactionNumber($invoice->getTransactionId());
260
  $apiInvoice->setInvoiceNumber($invoice->getId());
261
  $apiInvoice->setInvoiceAmount($this->getHelper()->convertToCents($invoice->getGrandTotal()));
262
+ $apiInvoice->setInvoiceDescription(Mage::helper('capayable')->__('Order').' '.$order_id);
263
+
264
+ $apiInvoice->setInvoiceByEmail($sender_email, "Order #{$order_id}");
265
+
266
  // Register new invoice with Capayable
267
  $isAccepted = $this->_client->registerInvoice($apiInvoice);
268
+
269
 
270
  return $isAccepted;
271
  }
272
+
273
+ //before refund
274
+ /*
275
+ public function processBeforeRefund($invoice, $payment)
276
+ {
277
+ }
278
+ */
279
+
280
+ //refund api
281
+ public function refund(Varien_Object $payment, $amount)
282
+ {
283
+ $transaction_number = $payment->getLastTransId();
284
+ $return_number = $payment->getOrder()->getIncrementId();
285
+
286
+ $apiReturn = new Tritac_CapayableApiClient_Models_InvoiceCreditRequest($transaction_number, $return_number, $amount);
287
+ $isAccepted = $this->_client->creditInvoice($apiReturn);
288
+ return $this;
289
+ }
290
+
291
+ //after refund
292
+ /*
293
+ public function processCreditmemo($creditmemo, $payment)
294
+ {
295
+ }
296
+ */
297
  }
app/code/community/Tritac/Capayable/controllers/AjaxController.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Tritac_Capayable_AjaxController extends Mage_Core_Controller_Front_Action{
3
+ public function registrationcheckAction() {
4
+ $helper = Mage::helper('capayable');
5
+ $public_key = $helper->getPublicKey();
6
+ $secret_key = $helper->getSecretKey();
7
+ $mode = $helper->getMode();
8
+
9
+ $client = new Tritac_CapayableApiClient_Client($public_key, $secret_key, $mode);
10
+
11
+ $coc_number = $this->getRequest()->getParam("coc_number");
12
+ if (!$coc_number) {
13
+ $coc_number = 0;
14
+ }
15
+ $coc_number = intval($coc_number);
16
+
17
+ $registrationCheckRequest = new Tritac_CapayableApiClient_Models_RegistrationCheckRequest($coc_number);
18
+ $registrationCheckResult = $client->doRegistrationCheck($registrationCheckRequest);
19
+
20
+ $arrayData = array();
21
+ $arrayData['isAccepted'] = $registrationCheckResult->getIsAccepted();
22
+ $arrayData['houseNumber'] = $registrationCheckResult->getHouseNumber();
23
+ $arrayData['houseNumberSuffix'] = $registrationCheckResult->getHouseNumberSuffix();
24
+ $arrayData['zipCode'] = $registrationCheckResult->getZipCode();
25
+ $arrayData['city'] = $registrationCheckResult->getCity();
26
+ $arrayData['countryCode'] = $registrationCheckResult->getCountryCode();
27
+ $arrayData['phoneNumber'] = $registrationCheckResult->getPhoneNumber();
28
+ $arrayData['corporationName'] = $registrationCheckResult->getCorporationName();
29
+ $arrayData['cocNumber'] = $coc_number;
30
+ $arrayData['streetName'] = $registrationCheckResult->getStreetName();
31
+
32
+ $jsonData = json_encode($arrayData);
33
+
34
+ $this->getResponse()->setHeader('Content-type', 'application/json');
35
+ $this->getResponse()->setBody($jsonData);
36
+
37
+ }
38
+ }
app/code/community/Tritac/Capayable/etc/config.xml CHANGED
@@ -10,7 +10,7 @@
10
  <config>
11
  <modules>
12
  <Tritac_Capayable>
13
- <version>1.0.0</version>
14
  </Tritac_Capayable>
15
  </modules>
16
 
@@ -101,8 +101,16 @@
101
  </modules>
102
  </translate>
103
  </adminhtml>
104
-
105
  <frontend>
 
 
 
 
 
 
 
 
 
106
  <translate>
107
  <modules>
108
  <Tritac_Capayable>
@@ -126,4 +134,4 @@
126
  </capayable>
127
  </payment>
128
  </default>
129
- </config>
10
  <config>
11
  <modules>
12
  <Tritac_Capayable>
13
+ <version>2.1.0</version>
14
  </Tritac_Capayable>
15
  </modules>
16
 
101
  </modules>
102
  </translate>
103
  </adminhtml>
 
104
  <frontend>
105
+ <routers>
106
+ <capayable>
107
+ <use>standard</use>
108
+ <args>
109
+ <module>Tritac_Capayable</module>
110
+ <frontName>capayable</frontName>
111
+ </args>
112
+ </capayable>
113
+ </routers>
114
  <translate>
115
  <modules>
116
  <Tritac_Capayable>
134
  </capayable>
135
  </payment>
136
  </default>
137
+ </config>
app/code/community/Tritac/Capayable/etc/system.xml CHANGED
@@ -52,6 +52,15 @@
52
  <show_in_website>1</show_in_website>
53
  <show_in_store>1</show_in_store>
54
  </title>
 
 
 
 
 
 
 
 
 
55
  <test translate="label">
56
  <label>Test Mode</label>
57
  <frontend_type>select</frontend_type>
52
  <show_in_website>1</show_in_website>
53
  <show_in_store>1</show_in_store>
54
  </title>
55
+ <chamber_of_commerce_check translate="label">
56
+ <label>Chamber of Commerce Check</label>
57
+ <frontend_type>select</frontend_type>
58
+ <source_model>adminhtml/system_config_source_yesno</source_model>
59
+ <sort_order>50</sort_order>
60
+ <show_in_default>1</show_in_default>
61
+ <show_in_website>1</show_in_website>
62
+ <show_in_store>0</show_in_store>
63
+ </chamber_of_commerce_check>
64
  <test translate="label">
65
  <label>Test Mode</label>
66
  <frontend_type>select</frontend_type>
app/code/community/Tritac/Capayable/sql/capayable_setup/install-1.0.0.php CHANGED
@@ -60,6 +60,11 @@ $table = $installer->getConnection()
60
  ), 'Is Corporation')
61
  ->addColumn('corporation_name', Varien_Db_Ddl_Table::TYPE_TEXT, 150, array(
62
  ), 'Corporation Name')
 
 
 
 
 
63
  ->addColumn('coc_number', Varien_Db_Ddl_Table::TYPE_TEXT, 20, array(
64
  ), 'Chamber of Commerce number')
65
  ->addIndex($installer->getIdxName('capayable/customer', array('customer_id')),
60
  ), 'Is Corporation')
61
  ->addColumn('corporation_name', Varien_Db_Ddl_Table::TYPE_TEXT, 150, array(
62
  ), 'Corporation Name')
63
+ ->addColumn('is_sole', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array(
64
+ 'unsigned' => true,
65
+ 'nullable' => false,
66
+ 'default' => '0',
67
+ ), 'Is Sole Proprietor')
68
  ->addColumn('coc_number', Varien_Db_Ddl_Table::TYPE_TEXT, 20, array(
69
  ), 'Chamber of Commerce number')
70
  ->addIndex($installer->getIdxName('capayable/customer', array('customer_id')),
app/design/frontend/base/default/template/capayable/form.phtml CHANGED
@@ -30,13 +30,118 @@ $_quote = $this->getQuote();
30
  $_customer = $this->getCustomer();
31
  $isLoggedIn = Mage::helper('customer')->isLoggedIn();
32
  ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  <ul class="form-list" id="payment_form_<?php echo $_code ?>" style="display:none;">
34
- <?php if(!$isLoggedIn): ?>
35
  <?php if(!$_quote->getCustomerMiddlename()): ?>
36
  <li>
37
- <label for="<?php echo $_code?>_middlename" class="required"><em>*</em><?php echo $this->__('Middle name (initials)')?></label>
38
  <div class="input-box">
39
- <input type="text" id="<?php echo $_code?>_middlename" name="payment[customer_middlename]" class="input-text required-entry" value="" />
40
  </div>
41
  </li>
42
  <?php endif ?>
@@ -67,7 +172,22 @@ $isLoggedIn = Mage::helper('customer')->isLoggedIn();
67
  </div>'
68
  );
69
 
70
- echo $_dob->getSortedDateInputs();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
  ?>
72
  <div class="dob-full" style="display:none;">
73
  <input type="hidden" id="<?php echo $_code ?>_dob" name="payment[customer_dob]" />
@@ -98,6 +218,42 @@ $isLoggedIn = Mage::helper('customer')->isLoggedIn();
98
  </li>
99
  <?php endif ?>
100
  <?php endif ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
101
  <li>
102
  <label for="<?php echo $_code?>_street" class="required"><em>*</em><?php echo $this->__('Street')?></label>
103
  <div class="input-box">
@@ -107,7 +263,7 @@ $isLoggedIn = Mage::helper('customer')->isLoggedIn();
107
  <li>
108
  <label for="<?php echo $_code?>_house_number" class="required"><em>*</em><?php echo $this->__('House number')?></label>
109
  <div class="input-box">
110
- <input type="text" id="<?php echo $_code?>_house_number" name="payment[house_number]" class="input-text required-entry" value="<?php if($_customer->getHouseNumber() && $isLoggedIn) echo $_customer->getHouseNumber()?>" />
111
  </div>
112
  </li>
113
  <li>
@@ -116,25 +272,18 @@ $isLoggedIn = Mage::helper('customer')->isLoggedIn();
116
  <input type="text" id="<?php echo $_code?>_house_suffix" name="payment[house_suffix]" class="input-text" value="<?php if($_customer->getHouseSuffix() && $isLoggedIn) echo $_customer->getHouseSuffix()?>" />
117
  </div>
118
  </li>
 
119
  <li>
120
- <label for="<?php echo $_code?>_is_corporation"><?php echo $this->__('Is Corporation')?></label>
121
- <div class="input-box">
122
- <select name="payment[is_corporation]" id="<?php echo $_code ?>_is_corporation">
123
- <option value="0" <?php if($_customer->getIsCorporation() == 0 && $isLoggedIn): ?>selected="selected"<?php endif ?>><?php echo $this->__('No')?></option>
124
- <option value="1" <?php if($_customer->getIsCorporation() == 1 && $isLoggedIn): ?>selected="selected"<?php endif ?>><?php echo $this->__('Yes')?></option>
125
- </select>
126
- </div>
127
- </li>
128
- <li>
129
- <label for="<?php echo $_code?>_corporation_name"><?php echo $this->__('Corporation Name')?></label>
130
  <div class="input-box">
131
- <input type="text" id="<?php echo $_code?>_corporation_name" name="payment[corporation_name]" class="input-text" value="<?php if($_customer->getCorporationName() && $isLoggedIn) echo $_customer->getCorporationName()?>" />
132
  </div>
133
  </li>
134
  <li>
135
- <label for="<?php echo $_code?>_coc_number"><?php echo $this->__('Chamber of Commerce Number')?></label>
136
  <div class="input-box">
137
- <input type="text" id="<?php echo $_code?>_coc_number" name="payment[coc_number]" class="input-text" value="<?php if($_customer->getCocNumber() && $isLoggedIn) echo $_customer->getCocNumber()?>" />
138
  </div>
139
  </li>
140
- </ul>
 
30
  $_customer = $this->getCustomer();
31
  $isLoggedIn = Mage::helper('customer')->isLoggedIn();
32
  ?>
33
+ <?php
34
+ // var_dump($_quote->getData());
35
+ ?>
36
+
37
+ <script type="text/javascript">
38
+ //<![CDATA[
39
+ var SoleChecked<?php echo $_code ?> = function() {
40
+ var elm = $('<?php echo $_code ?>_is_corporation');
41
+ if (elm.value == 1) {
42
+ $('<?php echo $_code ?>_is_sole_wrapper').show();
43
+ $('<?php echo $_code ?>_corporation_name_wrapper').show();
44
+ $('<?php echo $_code ?>_coc_number_wrapper').show();
45
+ } else {
46
+ $('<?php echo $_code ?>_is_sole_wrapper').hide();
47
+ $('<?php echo $_code ?>_corporation_name_wrapper').hide();
48
+ $('<?php echo $_code ?>_coc_number_wrapper').hide();
49
+ }
50
+ };
51
+
52
+ Event.observe($('<?php echo $_code ?>_is_corporation'), 'change', SoleChecked<?php echo $_code ?>);
53
+ SoleChecked<?php echo $_code ?>();
54
+ //]]>
55
+ </script>
56
+
57
+ <script>
58
+ function SubmitRequest()
59
+ {
60
+ var elm = $('<?php echo $_code ?>_coc_number');
61
+ console.log(666);
62
+ new Ajax.Request("<?php echo Mage::getBaseUrl(); ?>capayable/ajax/registrationcheck", {
63
+ method: 'get',
64
+ parameters: {coc_number: elm.value},
65
+ onSuccess: successFunc,
66
+ onFailure: failureFunc
67
+ });
68
+ }
69
+
70
+ function successFunc(response){
71
+ var json = response.responseText.evalJSON();
72
+ if (json.isAccepted) {
73
+ console.log(555);
74
+ console.log(json);
75
+
76
+ var elm_corporation_name = $('<?php echo $_code ?>_corporation_name');
77
+ var elm_street = $('<?php echo $_code ?>_street');
78
+ var elm_house_number = $('<?php echo $_code ?>_house_number');
79
+ var elm_house_suffix = $('<?php echo $_code ?>_house_suffix');
80
+ var elm_postcode = $('<?php echo $_code ?>_postcode');
81
+ var elm_city = $('<?php echo $_code ?>_city');
82
+
83
+ elm_corporation_name.value = json.corporationName;
84
+ elm_street.value = json.streetName;
85
+ elm_house_number.value = json.houseNumber;
86
+ elm_house_suffix.value = json.houseNumberSuffix;
87
+ elm_postcode.value = json.zipCode;
88
+ elm_city.value = json.city;
89
+ } else {
90
+ failureFunc(response);
91
+ }
92
+ }
93
+
94
+ function failureFunc(response){
95
+ var elm_corporation_name = $('<?php echo $_code ?>_corporation_name');
96
+ var elm_street = $('<?php echo $_code ?>_street');
97
+ var elm_house_number = $('<?php echo $_code ?>_house_number');
98
+ var elm_house_suffix = $('<?php echo $_code ?>_house_suffix');
99
+ var elm_postcode = $('<?php echo $_code ?>_postcode');
100
+ var elm_city = $('<?php echo $_code ?>_city');
101
+
102
+ elm_corporation_name.value = "";
103
+ elm_street.value = "";
104
+ elm_house_number.value = "";
105
+ elm_house_suffix.value = "";
106
+ elm_postcode.value = "";
107
+ elm_city.value = "";
108
+ }
109
+ <?php
110
+ $coc_number_check = Mage::getStoreConfig('payment/capayable/chamber_of_commerce_check');
111
+ if ($coc_number_check):
112
+ ?>
113
+ Event.observe($('<?php echo $_code?>_coc_number'), 'change', SubmitRequest);
114
+ <?php endif ?>
115
+ </script>
116
+ <?php
117
+
118
+ $billingAddress = $_quote->getBillingAddress();
119
+
120
+ $firstname = $billingAddress->getData("firstname");
121
+ $names = explode(" ", $firstname);
122
+ $initials = "";
123
+ foreach ($names as $name) {
124
+ $initials .= $name[0] . ". ";
125
+ }
126
+ //if($_customer->getCustomerMiddlename() && $isLoggedIn)
127
+ // $initials = $_customer->getCustomerMiddlename();
128
+
129
+
130
+ $postcode = $billingAddress->getData("postcode");
131
+ if($_customer->getPostalCode() && $isLoggedIn)
132
+ $postcode = $_customer->getPostalCode();
133
+
134
+ $city = $billingAddress->getData("city");
135
+ if($_customer->getCity() && $isLoggedIn)
136
+ $city = $_customer->getCity();
137
+ ?>
138
  <ul class="form-list" id="payment_form_<?php echo $_code ?>" style="display:none;">
139
+ <?php if(1 || !$isLoggedIn): ?>
140
  <?php if(!$_quote->getCustomerMiddlename()): ?>
141
  <li>
142
+ <label for="<?php echo $_code?>_middlename" class="required"><em>*</em><?php echo $this->__('Initials')?></label>
143
  <div class="input-box">
144
+ <input type="text" id="<?php echo $_code?>_middlename" name="payment[customer_middlename]" class="input-text required-entry" value="<?php echo $initials; ?>" />
145
  </div>
146
  </li>
147
  <?php endif ?>
172
  </div>'
173
  );
174
 
175
+ //echo $_dob->getSortedDateInputs();
176
+ ?>
177
+ <?php
178
+ echo
179
+ '<div class="dob-day">
180
+ <input type="text" id="day" name="payment[day]" value="' . $_dob->getDay() . '" title="' . $this->__('Day') . '" class="input-text validate-custom" />
181
+ <label for="' . $_code . '_day">' . $this->__('DD') . '</label>
182
+ </div>',
183
+ '<div class="dob-month">
184
+ <input type="text" id="' . $_code . '_month" name="payment[month]" value="' . $_dob->getMonth() . '" title="' . $this->__('Month') . '" class="input-text validate-custom" />
185
+ <label for="' . $_code . '_month">' . $this->__('MM') . '</label>
186
+ </div>',
187
+ '<div class="dob-year">
188
+ <input type="text" id="' . $_code . '_year" name="payment[year]" value="' . $_dob->getYear() . '" title="' . $this->__('Year') . '" class="input-text validate-custom" />
189
+ <label for="' . $_code . '_year">' . $this->__('YYYY') . '</label>
190
+ </div>';
191
  ?>
192
  <div class="dob-full" style="display:none;">
193
  <input type="hidden" id="<?php echo $_code ?>_dob" name="payment[customer_dob]" />
218
  </li>
219
  <?php endif ?>
220
  <?php endif ?>
221
+
222
+ <li>
223
+ <label for="<?php echo $_code?>_is_corporation"><?php echo $this->__('Is Corporation')?></label>
224
+ <div class="input-box">
225
+ <select name="payment[is_corporation]" id="<?php echo $_code ?>_is_corporation">
226
+ <option value="0" <?php if($_customer->getIsCorporation() == 0 && $isLoggedIn): ?>selected="selected"<?php endif ?>><?php echo $this->__('No')?></option>
227
+ <option value="1" <?php if($_customer->getIsCorporation() == 1 && $isLoggedIn): ?>selected="selected"<?php endif ?>><?php echo $this->__('Yes')?></option>
228
+ </select>
229
+ </div>
230
+ </li>
231
+
232
+ <li id="<?php echo $_code ?>_is_sole_wrapper">
233
+ <label for="<?php echo $_code?>_is_sole"><?php echo $this->__('Is Sole Proprietor')?></label>
234
+ <div class="input-box">
235
+ <select name="payment[is_sole]" id="<?php echo $_code ?>_is_sole">
236
+ <option value="0" <?php if($_customer->getIsSole() == 0 && $isLoggedIn): ?>selected="selected"<?php endif ?>><?php echo $this->__('No')?></option>
237
+ <option value="1" <?php if($_customer->getIsSole() == 1 && $isLoggedIn): ?>selected="selected"<?php endif ?>><?php echo $this->__('Yes')?></option>
238
+ </select>
239
+ </div>
240
+ </li>
241
+
242
+
243
+ <li id="<?php echo $_code ?>_coc_number_wrapper">
244
+ <label for="<?php echo $_code?>_coc_number"><?php echo $this->__('Chamber of Commerce Number')?></label>
245
+ <div class="input-box">
246
+ <input type="text" id="<?php echo $_code?>_coc_number" name="payment[coc_number]" class="input-text" value="<?php if($_customer->getCocNumber() && $isLoggedIn) echo $_customer->getCocNumber()?>" />
247
+ </div>
248
+ </li>
249
+
250
+
251
+ <li id="<?php echo $_code ?>_corporation_name_wrapper">
252
+ <label for="<?php echo $_code?>_corporation_name"><?php echo $this->__('Corporation Name')?></label>
253
+ <div class="input-box">
254
+ <input type="text" id="<?php echo $_code?>_corporation_name" name="payment[corporation_name]" class="input-text" value="<?php if($_customer->getCorporationName() && $isLoggedIn) echo $_customer->getCorporationName()?>" />
255
+ </div>
256
+ </li>
257
  <li>
258
  <label for="<?php echo $_code?>_street" class="required"><em>*</em><?php echo $this->__('Street')?></label>
259
  <div class="input-box">
263
  <li>
264
  <label for="<?php echo $_code?>_house_number" class="required"><em>*</em><?php echo $this->__('House number')?></label>
265
  <div class="input-box">
266
+ <input type="text" id="<?php echo $_code?>_house_number" name="payment[house_number]" class="validate-digits validate-greater-than-zero input-text required-entry" value="<?php if($_customer->getHouseNumber() && $isLoggedIn) echo $_customer->getHouseNumber()?>" />
267
  </div>
268
  </li>
269
  <li>
272
  <input type="text" id="<?php echo $_code?>_house_suffix" name="payment[house_suffix]" class="input-text" value="<?php if($_customer->getHouseSuffix() && $isLoggedIn) echo $_customer->getHouseSuffix()?>" />
273
  </div>
274
  </li>
275
+
276
  <li>
277
+ <label for="<?php echo $_code?>_postcode" class="required"><em>*</em><?php echo $this->__('Postal Code')?></label>
 
 
 
 
 
 
 
 
 
278
  <div class="input-box">
279
+ <input type="text" id="<?php echo $_code?>_postcode" name="payment[postcode]" class="input-text required-entry" value="<?php echo $postcode; ?>" />
280
  </div>
281
  </li>
282
  <li>
283
+ <label for="<?php echo $_code?>_city" class="required"><em>*</em><?php echo $this->__('City')?></label>
284
  <div class="input-box">
285
+ <input type="text" id="<?php echo $_code?>_city" name="payment[city]" class="input-text required-entry" value="<?php echo $city; ?>" />
286
  </div>
287
  </li>
288
+
289
+ </ul>
app/design/frontend/base/default/template/capayable/info.phtml CHANGED
@@ -1,2 +1,18 @@
1
  <?php
2
  echo $this->getMethod()->getTitle();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php
2
  echo $this->getMethod()->getTitle();
3
+ ?>
4
+
5
+ <?php
6
+ if(Mage::registry('invoice_number')) {
7
+ $invoice_number = Mage::registry('invoice_number');
8
+ Mage::unregister('invoice_number');
9
+ ?>
10
+ <br>
11
+ Please transfer the amount due to:<br>
12
+ <strong>Stichting Beheer Gelden Capayable</strong><br>
13
+ <strong>IBAN</strong> NL42INGB0006528043<br>
14
+ <br>
15
+ Use the following number as<br>
16
+ the payment reference: <?php echo $invoice_number; ?><br>
17
+
18
+ <?php } ?>
app/locale/nl_NL/Tritac_Capayable.csv DELETED
@@ -1,17 +0,0 @@
1
- "Middle name (initials)","Initialen"
2
- "Date of Birth","Geboortedatum"
3
- "Day","Dag"
4
- "DD","DD"
5
- "Month","Maand"
6
- "MM","MM"
7
- "Year","Jaar"
8
- "YYYY","JJJJ"
9
- "Gender","Geslacht"
10
- "Street","Straatnaam"
11
- "House number","Huisnummer"
12
- "House number suffix","Huisnummer toevoeging"
13
- "Is Corporation","Bedrijf"
14
- "No","Nee"
15
- "Yes","Ja"
16
- "Corporation Name", "Bedrijfsnaam"
17
- "Chamber of Commerce Number","KvK-nummer"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lib/Tritac/CapayableApiClient/AddTrustExternalCARoot.crt CHANGED
@@ -1,25 +1,25 @@
1
- -----BEGIN CERTIFICATE-----
2
- MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEU
3
- MBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFs
4
- IFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290
5
- MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEwNDgzOFowbzELMAkGA1UEBhMCU0Ux
6
- FDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1BZGRUcnVzdCBFeHRlcm5h
7
- bCBUVFAgTmV0d29yazEiMCAGA1UEAxMZQWRkVHJ1c3QgRXh0ZXJuYWwgQ0EgUm9v
8
- dDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALf3GjPm8gAELTngTlvt
9
- H7xsD821+iO2zt6bETOXpClMfZOfvUq8k+0DGuOPz+VtUFrWlymUWoCwSXrbLpX9
10
- uMq/NzgtHj6RQa1wVsfwTz/oMp50ysiQVOnGXw94nZpAPA6sYapeFI+eh6FqUNzX
11
- mk6vBbOmcZSccbNQYArHE504B4YCqOmoaSYYkKtMsE8jqzp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QHIzZlj7DYd7usQWxH
20
+ YINRsPkyPef89iYTx4AWpb9a/IfPeHmJIZriTAcKhjW88t5RxNKWt9x+Tu5w/Rw5
21
+ 6wwCURQtjr0W4MHfRnXnJK3s9EK0hZNwEGe6nQY1ShjTK3rMUUKhemPR5ruhxSvC
22
+ Nr4TDea9Y355e6cJDUCrat2PisP29owaQgVR1EX1n6diIWgVIEM8med8vSTYqZEX
23
+ c4g/VhsxOBi0cQ+azcgOno4uG+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5a
24
+ mnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ=
25
+ -----END CERTIFICATE-----
lib/Tritac/CapayableApiClient/Client.php CHANGED
@@ -20,8 +20,10 @@ class Tritac_CapayableApiClient_Client {
20
  const VERSION_PATH = '/v1';
21
  const CERTIFICATE_PATH = 'AddTrustExternalCARoot.crt';
22
 
23
- const CREDITCHECK_PATH = '/creditcheck';
24
- const INVOICE_PATH = '/invoice';
 
 
25
 
26
  public function __construct($apiKey, $apiSecret, $env = null)
27
  {
@@ -40,29 +42,65 @@ class Tritac_CapayableApiClient_Client {
40
  }
41
 
42
  public function doCreditCheck(Tritac_CapayableApiClient_Models_CreditCheckRequest $request)
43
- {
44
- $args = $request->toArray();
45
- if(!$request->getIsCorporation()){
46
- unset($args['CocNumber']);
47
- unset($args['CorporationName']);
48
- }
 
49
 
50
- $path = self::VERSION_PATH . self::CREDITCHECK_PATH;
51
 
52
- $response = json_decode($this->makeRequest(Tritac_CapayableApiClient_Enums_HttpMethod::GET, $path, $this->buildQueryString($args, $path)));
53
 
54
- return new Tritac_CapayableApiClient_Models_CreditCheckResponse($response->IsAccepted, $response->TransactionNumber);
55
- }
56
 
57
- public function registerInvoice(Tritac_CapayableApiClient_Models_Invoice $invoice)
58
- {
59
- $args = $invoice->toArray();
60
- $path = self::VERSION_PATH . self::INVOICE_PATH;
 
61
 
62
- $response = json_decode($this->makeRequest(Tritac_CapayableApiClient_Enums_HttpMethod::GET, $path, $this->buildQueryString($args, $path)));
 
63
 
64
- return $response->IsAccepted;
65
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
 
67
  /* Private methods */
68
 
20
  const VERSION_PATH = '/v1';
21
  const CERTIFICATE_PATH = 'AddTrustExternalCARoot.crt';
22
 
23
+ const CREDITCHECK_PATH = '/creditcheck';
24
+ const INVOICE_PATH = '/invoice';
25
+ const INVOICECREDIT_PATH = '/invoicecredit';
26
+ const REGISTRATIONCHECK_PATH = '/registrationcheck';
27
 
28
  public function __construct($apiKey, $apiSecret, $env = null)
29
  {
42
  }
43
 
44
  public function doCreditCheck(Tritac_CapayableApiClient_Models_CreditCheckRequest $request)
45
+ {
46
+ $args = $request->toArray();
47
+ if(!$request->getIsCorporation()){
48
+ unset($args['CocNumber']);
49
+ unset($args['CorporationName']);
50
+ unset($args['IsSoleProprietor']);
51
+ }
52
 
53
+ $path = self::VERSION_PATH . self::CREDITCHECK_PATH;
54
 
55
+ $response = json_decode($this->makeRequest(Tritac_CapayableApiClient_Enums_HttpMethod::GET, $path, $this->buildQueryString($args, $path)), true);
56
 
57
+ $creditCheckResponse = new Tritac_CapayableApiClient_Models_CreditCheckResponse();
 
58
 
59
+ if( $response['IsAccepted'] ){
60
+ $creditCheckResponse->setAccepted($response['TransactionNumber']);
61
+ }else{
62
+ $creditCheckResponse->setRefused($response['RefuseReason'], $response['RefuseContactName'], $response['RefuseContactPhoneNumber']);
63
+ }
64
 
65
+ return $creditCheckResponse;
66
+ }
67
 
68
+ public function doRegistrationCheck(Tritac_CapayableApiClient_Models_RegistrationCheckRequest $request)
69
+ {
70
+ $args = $request->toArray();
71
+
72
+ $path = self::VERSION_PATH . self::REGISTRATIONCHECK_PATH;
73
+
74
+ $response = json_decode($this->makeRequest(Tritac_CapayableApiClient_Enums_HttpMethod::GET, $path, $this->buildQueryString($args, $path)), true);
75
+
76
+ $creditCheckResponse = new Tritac_CapayableApiClient_Models_RegistrationCheckResponse($response['IsAccepted'], $response['HouseNumber'],
77
+ $response['HouseNumberSuffix'], $response['ZipCode'], $response['City'], $response['CountryCode'],
78
+ $response['PhoneNumber'], $response['CorporationName'], $response['CoCNumber'], $response['StreetName']);
79
+
80
+ return $creditCheckResponse;
81
+ }
82
+
83
+ public function registerInvoice(Tritac_CapayableApiClient_Models_Invoice $invoice)
84
+ {
85
+ $args = $invoice->toArray();
86
+ $path = self::VERSION_PATH . self::INVOICE_PATH;
87
+
88
+ $response = json_decode($this->makeRequest(Tritac_CapayableApiClient_Enums_HttpMethod::GET, $path, $this->buildQueryString($args, $path)), true);
89
+
90
+ return $response['IsAccepted'];
91
+ }
92
+
93
+ public function creditInvoice(Tritac_CapayableApiClient_Models_InvoiceCreditRequest $request)
94
+ {
95
+ $args = $request->toArray();
96
+ $path = self::VERSION_PATH . self::INVOICECREDIT_PATH;
97
+
98
+ $response = json_decode($this->makeRequest(Tritac_CapayableApiClient_Enums_HttpMethod::GET, $path, $this->buildQueryString($args, $path)), true);
99
+
100
+ $invoiceCreditResponse = new Tritac_CapayableApiClient_Models_InvoiceCreditResponse($response['Result'], $response['AmountCredited'], $response['AmountNotCredited']);
101
+
102
+ return $invoiceCreditResponse;
103
+ }
104
 
105
  /* Private methods */
106
 
lib/Tritac/CapayableApiClient/Enums/Enum.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Tritac_CapayableApiClient_Enums_Enum {
3
+
4
+ private static $reflector;
5
+
6
+ public static function toArray()
7
+ {
8
+ self::$reflector = new ReflectionClass(get_called_class());
9
+ return self::$reflector->getConstants();
10
+ }
11
+
12
+ public static function toString($value){
13
+ $fields = self::toArray();
14
+ return array_search($value, $fields);
15
+ }
16
+
17
+ }
lib/Tritac/CapayableApiClient/Enums/InvoiceCreditStatus.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Tritac_CapayableApiClient_Enums_InvoiceCreditStatus extends Tritac_CapayableApiClient_Enums_Enum{
3
+
4
+ // UNPAID (0) The invoice is fully unpaid. The original invoice will be credited by
5
+ // the given credit amount (AmountCredited = CreditAmount)
6
+ const UNPAID = 0;
7
+
8
+ // ALREADY_PAID (1) The invoice is fully paid. Credits on the original invoice is
9
+ // are possible. The webshop should do a refund. (AmountCredited = 0)
10
+ const ALREADY_PAID = 1;
11
+
12
+ // PARTIALLY_PAID (2) The invoice is partially paid. If the remaining unpaid
13
+ // amount is larger than the credit amount, it will be credited (AmountCredited
14
+ // = CreditAmount). If not, the unpaid amount is credited, the webshop should
15
+ // do a refund of the leftover (AmountCredited = unpaid amount,
16
+ // AmountNotCredited = CreditAmount – unpaid amount)
17
+ const PARTIALLY_PAID = 2;
18
+
19
+ // EXCEEDS_PERIOD_LIMIT (3) The call is later than 14 days after the
20
+ // InvoiceDate. Credit is no longer possible. (AmountCredited = 0)
21
+ const EXCEEDS_PERIOD_LIMIT = 3;
22
+
23
+ }
lib/Tritac/CapayableApiClient/Enums/InvoicePdfSubmitType.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Tritac_CapayableApiClient_Enums_InvoicePdfSubmitType {
3
+
4
+ // Capayable will fetch the invoice from the URL provided
5
+ const URL = 0;
6
+
7
+ // The shop will send an email with the invoice to
8
+ // capayable-invoice-bcc@tritac.com
9
+ const BCC_EMAIL = 1;
10
+ }
lib/Tritac/CapayableApiClient/Enums/RefuseReason.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Tritac_CapayableApiClient_Enums_RefuseReason extends Tritac_CapayableApiClient_Enums_Enum{
3
+
4
+ // Each shop has an order amount limit above which pay after delivery by Capayable is
5
+ // not available. AMOUNT_EXCEEDS_LIMIT (1) means the order amount is above this limit
6
+ const AMOUNT_EXCEEDS_LIMIT = 1;
7
+
8
+ // There is a limit on the unpaid sum of all orders with this shops or other shops using
9
+ // Capayable. BALANCE_EXCEEDS_LIMIT (2) means the order amount plus the balance
10
+ // of unpaid orders by the customer is above this limit.
11
+ const BALANCE_EXEEDS_LIMIT = 2;
12
+
13
+ // Capayable uses services for the actual credit check (B2C: EDR, B2B: CreditSafe).
14
+ // NOT_CREDITWORTHY (3) means the customer is not accepted for credit by this service.
15
+ const NOT_CREDITWORTHY = 3;
16
+
17
+ // CREDITCHECK_UNAVAILABLE (4) means the extern credit check service is not be available.
18
+ const CREDITCHECK_UNAVAILABLE = 4;
19
+
20
+ // NOT_FOUND (5) means the corporation could not be found based on its name
21
+ // and/or its address (B2B only).
22
+ const NOT_FOUND = 5;
23
+ }
lib/Tritac/CapayableApiClient/Models/CreditCheckRequest.php CHANGED
@@ -15,8 +15,12 @@ class Tritac_CapayableApiClient_Models_CreditCheckRequest extends Tritac_Capayab
15
  protected $faxNumber;
16
  protected $emailAddress;
17
  protected $isCorporation;
 
 
18
  protected $corporationName;
19
  protected $cocNumber;
 
 
20
  protected $isFinal;
21
  protected $claimAmount;
22
 
@@ -38,6 +42,7 @@ class Tritac_CapayableApiClient_Models_CreditCheckRequest extends Tritac_Capayab
38
  $this->isCorporation = false;
39
  $this->corporationName = '';
40
  $this->cocNumber = '';
 
41
  $this->isFinal = false;
42
  $this->claimAmount = 0;
43
  }
@@ -180,6 +185,16 @@ class Tritac_CapayableApiClient_Models_CreditCheckRequest extends Tritac_Capayab
180
  $this->isCorporation = $isCorporation;
181
  }
182
 
 
 
 
 
 
 
 
 
 
 
183
  function getEmailAddress() { return $this->emailAddress; }
184
  function setEmailAddress($emailAddress) {
185
 
15
  protected $faxNumber;
16
  protected $emailAddress;
17
  protected $isCorporation;
18
+
19
+ // For corporations
20
  protected $corporationName;
21
  protected $cocNumber;
22
+ protected $isSoleProprietor;
23
+
24
  protected $isFinal;
25
  protected $claimAmount;
26
 
42
  $this->isCorporation = false;
43
  $this->corporationName = '';
44
  $this->cocNumber = '';
45
+ $this->isSoleProprietor = false;
46
  $this->isFinal = false;
47
  $this->claimAmount = 0;
48
  }
185
  $this->isCorporation = $isCorporation;
186
  }
187
 
188
+ function getIsSoleProprietor() { return $this->isSoleProprietor; }
189
+ function setIsSoleProprietor($isSoleProprietor) {
190
+
191
+ if(!is_bool($isSoleProprietor)){
192
+ throw new Exception('Is sole proprietor must be a boolean');
193
+ }
194
+
195
+ $this->isSoleProprietor = $isSoleProprietor;
196
+ }
197
+
198
  function getEmailAddress() { return $this->emailAddress; }
199
  function setEmailAddress($emailAddress) {
200
 
lib/Tritac/CapayableApiClient/Models/CreditCheckResponse.php CHANGED
@@ -1,18 +1,33 @@
1
  <?php
2
  class Tritac_CapayableApiClient_Models_CreditCheckResponse extends Tritac_CapayableApiClient_Models_BaseModel
3
  {
4
- protected $transactionNumber;
5
- protected $invoiceNumber;
6
- protected $invoiceDate;
7
- protected $invoiceAmount;
8
- protected $invoiceDescription;
9
 
10
- public function __construct($isAccepted, $transactionNumber)
11
- {
12
- $this->transactionNumber = $transactionNumber;
13
- $this->isAccepted = $isAccepted;
14
- }
15
 
16
- function getTransactionNumber() { return $this->transactionNumber; }
17
- function getIsAccepted() { return $this->isAccepted; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  }
1
  <?php
2
  class Tritac_CapayableApiClient_Models_CreditCheckResponse extends Tritac_CapayableApiClient_Models_BaseModel
3
  {
4
+ protected $isAccepted;
5
+ protected $transactionNumber;
6
+ protected $refuseReason;
7
+ protected $refuseContactName;
8
+ protected $refuseContactPhoneNumber;
9
 
10
+ public function __construct(){
11
+ $this->isAccepted = false;
12
+ $this->transactionNumber = '';
13
+ $this->refuseReason = Tritac_CapayableApiClient_Enums_RefuseReason::CREDITCHECK_UNAVAILABLE;
14
+ }
15
 
16
+ public function setAccepted($transactionNumber){
17
+ $this->isAccepted = true;
18
+ $this->transactionNumber = $transactionNumber;
19
+ }
20
+
21
+ public function setRefused($refuseReason, $refuseContactName, $refusePhoneNumber){
22
+ $this->isAccepted = false;
23
+ $this->refuseReason = $refuseReason;
24
+ $this->refuseContactName = $refuseContactName;
25
+ $this->refusePhoneNumber = $refusePhoneNumber;
26
+ }
27
+
28
+ function getIsAccepted() { return $this->isAccepted; }
29
+ function getTransactionNumber() { return $this->transactionNumber; }
30
+ function getRefuseReason() { return $this->refuseReason; }
31
+ function getRefuseContactName() { return $this->refuseContactName; }
32
+ function getRefuseContactPhoneNumber() { return $this->refuseContactPhoneNumber; }
33
  }
lib/Tritac/CapayableApiClient/Models/Invoice.php CHANGED
@@ -1,11 +1,21 @@
1
  <?php
2
  class Tritac_CapayableApiClient_Models_Invoice extends Tritac_CapayableApiClient_Models_BaseModel
3
  {
4
- protected $transactionNumber;
5
- protected $invoiceNumber;
6
- protected $invoiceDate;
7
- protected $invoiceAmount;
8
- protected $invoiceDescription;
 
 
 
 
 
 
 
 
 
 
9
 
10
  public function __construct()
11
  {
@@ -14,6 +24,13 @@ class Tritac_CapayableApiClient_Models_Invoice extends Tritac_CapayableApiClient
14
  $this->invoiceDate = new DateTime();
15
  $this->invoiceAmount = 0;
16
  $this->invoiceDescription = '';
 
 
 
 
 
 
 
17
  }
18
 
19
  function getTransactionNumber() { return $this->transactionNumber; }
@@ -65,4 +82,41 @@ class Tritac_CapayableApiClient_Models_Invoice extends Tritac_CapayableApiClient
65
 
66
  $this->invoiceDescription = $invoiceDescription;
67
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
68
  }
1
  <?php
2
  class Tritac_CapayableApiClient_Models_Invoice extends Tritac_CapayableApiClient_Models_BaseModel
3
  {
4
+ protected $transactionNumber;
5
+ protected $invoiceNumber;
6
+ protected $invoiceDate;
7
+ protected $invoiceAmount;
8
+ protected $invoiceDescription;
9
+
10
+ protected $invoicePdfSubmitType;
11
+
12
+ // For InvoicePdfSubmitType::URL
13
+ protected $invoicePdfUrl;
14
+
15
+ // For InvoicePdfSubmitType::BCC_EMAIL
16
+ protected $invoicePdfEmailSentDate;
17
+ protected $invoicePdfFromEmail; //sender
18
+ protected $invoicePdfEmailSubject;
19
 
20
  public function __construct()
21
  {
24
  $this->invoiceDate = new DateTime();
25
  $this->invoiceAmount = 0;
26
  $this->invoiceDescription = '';
27
+
28
+ // PDF invoice submission
29
+ $this->invoicePdfSubmitType = Tritac_CapayableApiClient_Enums_InvoicePdfSubmitType::BCC_EMAIL;
30
+ $this->invoicePdfUrl = '';
31
+ $this->invoicePdfEmailSentDate = new DateTime();
32
+ $this->invoicePdfFromEmail = '';
33
+ $this->invoicePdfEmailSubject = '';
34
  }
35
 
36
  function getTransactionNumber() { return $this->transactionNumber; }
82
 
83
  $this->invoiceDescription = $invoiceDescription;
84
  }
85
+
86
+ // PDF Invoice submission:
87
+ function getInvoicePdfSubmitType() { return $this->invoicePdfSubmitType; }
88
+
89
+ // By email:
90
+ function getInvoicePdfEmailSentDate() { return $this->invoicePdfEmailSentDate->format('Y-m-d'); }
91
+ function getInvoicePdfEmailSentDateAsDateTime() { return $this->invoicePdfEmailSentDate; }
92
+ function getInvoicePdfFromEmail() { return $this->invoicePdfFromEmail; }
93
+ function getInvoicePdfEmailSubject() { return $this->invoicePdfEmailSubject; }
94
+ function setInvoiceByEmail($sender, $subject, DateTime $date = null){
95
+ if(is_null($date)){
96
+ $date = new DateTime();
97
+ }
98
+
99
+ if(strlen($sender) > 127 || strlen($subject) > 127 ) {
100
+ throw new Exception('Email sender and/or subject may not exceed 127 characters');
101
+ }
102
+
103
+ $this->invoicePdfSubmitType = Tritac_CapayableApiClient_Enums_InvoicePdfSubmitType::BCC_EMAIL;
104
+
105
+ $this->invoicePdfFromEmail = $sender;
106
+ $this->invoicePdfEmailSubject = $subject;
107
+ $this->invoicePdfEmailSentDate = $date;
108
+ }
109
+
110
+ // By URL:
111
+ function getInvoicePdfUrl() { return $this->invoicePdfUrl; }
112
+ function setInvoiceByUrl($url){
113
+
114
+ if(strlen($url) > 511 ) {
115
+ throw new Exception('Url may not exceed 511 characters');
116
+ }
117
+
118
+ $this->invoicePdfSubmitType = Tritac_CapayableApiClient_Enums_InvoicePdfSubmitType::URL;
119
+
120
+ $this->invoicePdfUrl = $url;
121
+ }
122
  }
lib/Tritac/CapayableApiClient/Models/InvoiceCreditRequest.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Tritac_CapayableApiClient_Models_InvoiceCreditRequest extends Tritac_CapayableApiClient_Models_BaseModel
3
+ {
4
+ protected $transactionNumber;
5
+ protected $returnNumber;
6
+ protected $creditAmount;
7
+
8
+ public function __construct($transactionNumber, $returnNumber, $creditAmount){
9
+
10
+ if(strlen($transactionNumber) > 32) {
11
+ throw new Exception('Transaction number may not exceed 32 characters');
12
+ }
13
+ $this->transactionNumber = $transactionNumber;
14
+
15
+ if(strlen($returnNumber) > 150) {
16
+ throw new Exception('Return number may not exceed 150 characters');
17
+ }
18
+ $this->returnNumber = $returnNumber;
19
+
20
+ if(!is_numeric($creditAmount)) {
21
+ throw new Exception('Credit amount must be numeric');
22
+ }
23
+ $this->creditAmount = $creditAmount;
24
+ }
25
+
26
+ public function getTransactionNumber(){
27
+ return $this->transactionNumber;
28
+ }
29
+
30
+ public function getReturnNumber(){
31
+ return $this->returnNumber;
32
+ }
33
+
34
+ public function getCreditAmount(){
35
+ return $this->creditAmount;
36
+ }
37
+ }
lib/Tritac/CapayableApiClient/Models/InvoiceCreditResponse.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Tritac_CapayableApiClient_Models_InvoiceCreditResponse extends Tritac_CapayableApiClient_Models_BaseModel
3
+ {
4
+ protected $result;
5
+ protected $amountNotCredited;
6
+ protected $amountCredited;
7
+
8
+ public function __construct($result, $amountCredited, $amountNotCredited){
9
+ $this->result = $result;
10
+ $this->amountCredited = $amountCredited;
11
+ $this->amountNotCredited = $amountNotCredited;
12
+ }
13
+
14
+ public function getResult(){
15
+ return $this->result;
16
+ }
17
+
18
+ public function getAmountNotCredited(){
19
+ return $this->amountNotCredited;
20
+ }
21
+
22
+ public function getAmountCredited(){
23
+ return $this->amountCredited;
24
+ }
25
+ }
lib/Tritac/CapayableApiClient/Models/RegistrationCheckRequest.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Tritac_CapayableApiClient_Models_RegistrationCheckRequest extends Tritac_CapayableApiClient_Models_BaseModel
3
+ {
4
+ protected $cocNumber;
5
+
6
+ public function __construct($cocNumber){
7
+
8
+
9
+ if(strlen($cocNumber) > 20) {
10
+ throw new Exception('CoC-number number may not exceed 20 characters');
11
+ }
12
+ $this->cocNumber = $cocNumber;
13
+
14
+ }
15
+
16
+ public function getCocNumber(){
17
+ return $this->cocNumber;
18
+ }
19
+ }
lib/Tritac/CapayableApiClient/Models/RegistrationCheckResponse.php ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Tritac_CapayableApiClient_Models_RegistrationCheckResponse extends Tritac_CapayableApiClient_Models_BaseModel
3
+ {
4
+ protected $isAccepted;
5
+
6
+ protected $houseNumber;
7
+ protected $houseNumberSuffix;
8
+ protected $zipCode;
9
+ protected $city;
10
+ protected $countryCode;
11
+ protected $phoneNumber;
12
+ protected $corporationName;
13
+ protected $cocNumber;
14
+ protected $streetName;
15
+
16
+ public function __construct($isAccepted, $houseNumber, $houseNumberSuffix, $zipCode, $city, $countryCode, $phoneNumber, $corporationName, $cocNumber, $streetName){
17
+ $this->isAccepted = $isAccepted;
18
+ $this->houseNumber = $houseNumber;
19
+ $this->houseNumberSuffix = $houseNumberSuffix;
20
+ $this->zipCode = $zipCode;
21
+ $this->city = $city;
22
+ $this->countryCode = $countryCode;
23
+ $this->phoneNumber = $phoneNumber;
24
+ $this->corporationName = $corporationName;
25
+ $this->cocNumber = $cocNumber;
26
+ $this->streetName= $streetName;
27
+ }
28
+
29
+ public function getCocNumber(){
30
+ return $this->cocNumber;
31
+ }
32
+
33
+ public function getIsAccepted(){
34
+ return $this->isAccepted;
35
+ }
36
+
37
+ public function getHouseNumber(){
38
+ return $this->houseNumber;
39
+ }
40
+
41
+ public function getHouseNumberSuffix(){
42
+ return $this->houseNumberSuffix;
43
+ }
44
+
45
+ public function getZipCode(){
46
+ return $this->zipCode;
47
+ }
48
+
49
+ public function getCity(){
50
+ return $this->city;
51
+ }
52
+
53
+ public function getCountryCode(){
54
+ return $this->countryCode;
55
+ }
56
+
57
+ public function getPhoneNumber(){
58
+ return $this->phoneNumber;
59
+ }
60
+
61
+ public function getCorporationName(){
62
+ return $this->corporationName;
63
+ }
64
+
65
+ public function getStreetName(){
66
+ return $this->streetName;
67
+ }
68
+
69
+ }
lib/Tritac/CapayableApiClient/fiddler.crt CHANGED
@@ -1,21 +1,21 @@
1
- -----BEGIN CERTIFICATE-----
2
- MIIDhTCCAvKgAwIBAgIQ1gnPE4Ebi6VA8yWGI387iDAJBgUrDgMCHQUAMIGLMSsw
3
- KQYDVQQLEyJDcmVhdGVkIGJ5IGh0dHA6Ly93d3cuZmlkZGxlcjIuY29tMSEwHwYD
4
- VQQKHhgARABPAF8ATgBPAFQAXwBUAFIAVQBTAFQxOTA3BgNVBAMeMABEAE8AXwBO
5
- AE8AVABfAFQAUgBVAFMAVABfAEYAaQBkAGQAbABlAHIAUgBvAG8AdDAeFw0xMjA1
6
- MjkyMjAwMDBaFw0yMzA1Mjk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RuLpUDzJYYjfzuIMAkGBSsO
18
+ AwIdBQADgYEAhLKCHLHh+On9LRnuspe0D3ZOuFW33wjBIttTwyo6C+6EyW6aStqf
19
+ ABS3ZujnSgUMzNL9XdROCGdTNB0qNYal4DemO3ls/4zHQXwT0vYP3f57sb9RP1YU
20
+ 8c2qFrrX+UhUMNPN/TyZu4aR4wjt/FtSfQYnwTxhBno2AOn/3vToTls=
21
+ -----END CERTIFICATE-----
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Tritac_Capayable</name>
4
- <version>1.0.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
7
  <channel>community</channel>
@@ -14,11 +14,11 @@ The trust of your customers will increase by providing multiple payment methods
14
  By fulfilling your customers desires you will realize a substatial gain in online sales. Studies show that an increase of conversion rates up to 30%. This is revenue you don't want to miss! With Capayable pay after delivery you will achieve maximum convenience at your webshop's checkout. You show trust in your customers and they will appreciate it. This way you will work on a healthy relation.&#xD;
15
  &#xD;
16
  Keep the risk of default to a minimum with Capayable. During the order process Capayable will assess the solvency of the customer. The result of this assessment will determine if the customer gets the option to pay after delivery. Moreover, the collection of the due payment is Capayable's risk. Customer service at checkout and your financial security go hand in hand.</description>
17
- <notes>Version 1.0.0</notes>
18
  <authors><author><name>Capayable</name><user>capayable</user><email>capayable@tritac.com</email></author></authors>
19
- <date>2014-03-31</date>
20
- <time>12:04:07</time>
21
- <contents><target name="mageetc"><dir name="modules"><file name="Tritac_Capayable.xml" hash="7001b4ff4fb879a1186fcd5d2c8e66a9"/></dir></target><target name="magecommunity"><dir name="Tritac"><dir name="Capayable"><dir name="Block"><file name="Form.php" hash="6e7b2763ca0b75f0654d1abf3f8ad997"/><file name="Info.php" hash="a77b42b5730b33e46a3e9168d2080d3f"/></dir><dir name="Helper"><file name="Data.php" hash="e9720cd4bafa9f2edb3d29f41be8aa2e"/></dir><dir name="Model"><file name="Customer.php" hash="7fff9352d16ea5fd730e53b4f29e7aaa"/><file name="Observer.php" hash="82fb183d66462dae19e4e69b5edec99c"/><file name="Payment.php" hash="7fddec277e535d312a21d5f79d06aa2f"/><dir name="Resource"><dir name="Customer"><file name="Collection.php" hash="d3ada6e04cd45cf7722194707ab46b72"/></dir><file name="Customer.php" hash="3e56839b9b93adf24f711cfc6b08cbb1"/><file name="Setup.php" hash="1d6ad9d431cf9a945720ba82d2adf57f"/></dir></dir><dir name="etc"><file name="config.xml" hash="e8bad6825e4fe5cafae01f2aac8d8562"/><file name="system.xml" hash="101d79df6bd9b1b81b9d2aaba30d6cff"/></dir><dir name="sql"><dir name="capayable_setup"><file name="install-1.0.0.php" hash="ff232168a4cbe940430eee93047d1147"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="capayable"><file name="form.phtml" hash="640562045d965035d593fc436ba4f629"/><file name="info.phtml" hash="81523da11b4559b6c2c19710521bc71d"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="nl_NL"><file name="Tritac_Capayable.csv" hash="c5d105f467196d08a07b0847b223699f"/></dir></target><target name="magelib"><dir name="Tritac"><dir name="CapayableApiClient"><file name="AddTrustExternalCARoot.crt" hash="51e14b4c734e450402ea2cf73f2aee0f"/><file name="Client.php" hash="bb34de799643f296c2e5bb424908cbef"/><dir name="Enums"><file name="Environment.php" hash="1c138f029b693bde668e9a5c33b73e8a"/><file name="Gender.php" hash="ad079406a788728980d6142405675cfd"/><file name="HttpMethod.php" hash="f9dc6ddcdef8c7573c726642ef596163"/></dir><dir name="Models"><file name="BaseModel.php" hash="0656176f09813a43eb27cb3a17001c55"/><file name="CreditCheckRequest.php" hash="d804de22a963b8f62f6ef435e31fee0c"/><file name="CreditCheckResponse.php" hash="edebda4e080125af419a09b138447f93"/><file name="Invoice.php" hash="ef8bb4b8f5fd57d2a9f5649b0cd52ad4"/></dir><file name="fiddler.crt" hash="7af0c3cd8b8c816712ee1c6ffd09bc91"/><file name="loader.php" hash="5a7f334b15555740f45c3d54cf826bc3"/></dir></dir></target></contents>
22
  <compatible/>
23
  <dependencies><required><php><min>5.2.13</min><max>6.0.0</max></php></required></dependencies>
24
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Tritac_Capayable</name>
4
+ <version>2.1.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
7
  <channel>community</channel>
14
  By fulfilling your customers desires you will realize a substatial gain in online sales. Studies show that an increase of conversion rates up to 30%. This is revenue you don't want to miss! With Capayable pay after delivery you will achieve maximum convenience at your webshop's checkout. You show trust in your customers and they will appreciate it. This way you will work on a healthy relation.&#xD;
15
  &#xD;
16
  Keep the risk of default to a minimum with Capayable. During the order process Capayable will assess the solvency of the customer. The result of this assessment will determine if the customer gets the option to pay after delivery. Moreover, the collection of the due payment is Capayable's risk. Customer service at checkout and your financial security go hand in hand.</description>
17
+ <notes>* Added new features</notes>
18
  <authors><author><name>Capayable</name><user>capayable</user><email>capayable@tritac.com</email></author></authors>
19
+ <date>2014-07-22</date>
20
+ <time>13:12:13</time>
21
+ <contents><target name="mageetc"><dir name="modules"><file name="Tritac_Capayable.xml" hash="7001b4ff4fb879a1186fcd5d2c8e66a9"/></dir></target><target name="magecommunity"><dir name="Tritac"><dir name="Capayable"><dir name="Block"><file name="Form.php" hash="6e7b2763ca0b75f0654d1abf3f8ad997"/><file name="Info.php" hash="a77b42b5730b33e46a3e9168d2080d3f"/></dir><dir name="Helper"><file name="Data.php" hash="a0804e5a3fd7b051530d202a19829ced"/></dir><dir name="Model"><file name="Customer.php" hash="562adc10291a0e835affbad196f3a8e7"/><file name="Observer.php" hash="cb51b90025604f7e4b4f2f91f22f6900"/><file name="Payment.php" hash="c5cc9f040b979ac2f7c1285f4049c795"/><dir name="Resource"><dir name="Customer"><file name="Collection.php" hash="d3ada6e04cd45cf7722194707ab46b72"/></dir><file name="Customer.php" hash="3e56839b9b93adf24f711cfc6b08cbb1"/><file name="Setup.php" hash="1d6ad9d431cf9a945720ba82d2adf57f"/></dir></dir><dir name="controllers"><file name="AjaxController.php" hash="2bf8a0353625fa86d06ce5af8c2f8c1b"/></dir><dir name="etc"><file name="config.xml" hash="888c0cc86178972c25dbc2832fabe370"/><file name="system.xml" hash="5fd9ee783a0cb5a8c93d96973e6f46b4"/></dir><dir name="sql"><dir name="capayable_setup"><file name="install-1.0.0.php" hash="8e3ad890975e11649a0dc51970aba4ec"/></dir></dir></dir></dir></target><target name="magelib"><dir name="Tritac"><dir name="CapayableApiClient"><file name="AddTrustExternalCARoot.crt" hash="f85d1ff17b0079709f131f3ce3f288d2"/><file name="Client.php" hash="ac813fed45cb5bd4108b52f9cb1bac41"/><dir name="Enums"><file name="Enum.php" hash="25559e778c2d276f731b6a8b63827d03"/><file name="Environment.php" hash="1c138f029b693bde668e9a5c33b73e8a"/><file name="Gender.php" hash="ad079406a788728980d6142405675cfd"/><file name="HttpMethod.php" hash="f9dc6ddcdef8c7573c726642ef596163"/><file name="InvoiceCreditStatus.php" hash="785c735390476ed66e3c0e1a538d8e44"/><file name="InvoicePdfSubmitType.php" hash="596d1e64019a9177a05fa677407ad85a"/><file name="RefuseReason.php" hash="47ddf3a0f5cc3613099c401acabbe8f0"/></dir><dir name="Models"><file name="BaseModel.php" hash="0656176f09813a43eb27cb3a17001c55"/><file name="CreditCheckRequest.php" hash="76038b32813ca48f9254a8fbcc798145"/><file name="CreditCheckResponse.php" hash="7886ac596afcca7a48ecfe0a104609be"/><file name="Invoice.php" hash="9f081793f2feec025d5dd478311875db"/><file name="InvoiceCreditRequest.php" hash="be0649d3b7584165ed12abe45452ab32"/><file name="InvoiceCreditResponse.php" hash="808df1a58451393d91fe358413b7eab4"/><file name="RegistrationCheckRequest.php" hash="c6d5e5eb633839a03e86f4fe4bcd3ce5"/><file name="RegistrationCheckResponse.php" hash="e65c5157a29403a0f916316823e7ee25"/></dir><file name="fiddler.crt" hash="b0dff65ab013256030658fee29ce0919"/><file name="loader.php" hash="5a7f334b15555740f45c3d54cf826bc3"/></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="capayable"><file name="form.phtml" hash="01b568eaccdf016a80df876f8499ce0a"/><file name="info.phtml" hash="fabb3f3bfe1d75424d7e5af1659bf2f1"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir/></target></contents>
22
  <compatible/>
23
  <dependencies><required><php><min>5.2.13</min><max>6.0.0</max></php></required></dependencies>
24
  </package>