paymentwall_magento_module - Version 1.1.3

Version Notes

* Add Delivery Confirmation API support
* Update latest lib

Download this release

Release Info

Developer Paymentwall
Extension paymentwall_magento_module
Version 1.1.3
Comparing to
See all releases


Code changes from version 1.1.2 to 1.1.3

Files changed (54) hide show
  1. app/code/community/Paymentwall/Paymentwall/Block/Checkout/Form/Method/Abstract.php +0 -0
  2. app/code/community/Paymentwall/Paymentwall/Block/Checkout/Form/Method/Pwbrick.php +0 -0
  3. app/code/community/Paymentwall/Paymentwall/Block/Checkout/Form/Method/Pwlocal.php +0 -0
  4. app/code/community/Paymentwall/Paymentwall/Block/Checkout/Info/Method/Pwbrick.php +0 -0
  5. app/code/community/Paymentwall/Paymentwall/Block/Checkout/Info/Method/Pwlocal.php +0 -0
  6. app/code/community/Paymentwall/Paymentwall/Helper/Data.php +0 -0
  7. app/code/community/Paymentwall/Paymentwall/Model/Method/Abstract.php +44 -3
  8. app/code/community/Paymentwall/Paymentwall/Model/Method/Pwbrick.php +0 -0
  9. app/code/community/Paymentwall/Paymentwall/Model/Method/Pwlocal.php +1 -1
  10. app/code/community/Paymentwall/Paymentwall/Model/Pingback.php +11 -7
  11. app/code/community/Paymentwall/Paymentwall/controllers/PaymentController.php +8 -15
  12. app/code/community/Paymentwall/Paymentwall/etc/config.xml +2 -1
  13. app/code/community/Paymentwall/Paymentwall/etc/system.xml +7 -16
  14. app/design/frontend/base/default/layout/paymentwall.xml +0 -0
  15. app/design/frontend/base/default/template/paymentwall/checkout/form/method/pwbrick.phtml +0 -0
  16. app/design/frontend/base/default/template/paymentwall/checkout/form/method/pwlocal.phtml +0 -0
  17. app/design/frontend/base/default/template/paymentwall/checkout/info/method/pwbrick.phtml +0 -0
  18. lib/paymentwall-php/.gitignore +15 -0
  19. lib/paymentwall-php/LICENSE +0 -0
  20. lib/paymentwall-php/README.md +0 -0
  21. lib/paymentwall-php/composer.json +4 -1
  22. lib/paymentwall-php/features/bootstrap/ChargeContext.php +0 -0
  23. lib/paymentwall-php/features/bootstrap/FeatureContext.php +0 -0
  24. lib/paymentwall-php/features/bootstrap/PingbackContext.php +0 -0
  25. lib/paymentwall-php/features/bootstrap/WidgetContext.php +0 -0
  26. lib/paymentwall-php/features/charge.feature +0 -0
  27. lib/paymentwall-php/features/pingback.feature +0 -0
  28. lib/paymentwall-php/features/widget.feature +0 -0
  29. lib/paymentwall-php/lib/Paymentwall/ApiObject.php +12 -1
  30. lib/paymentwall-php/lib/Paymentwall/ApiObjectInterface.php +0 -0
  31. lib/paymentwall-php/lib/Paymentwall/Base.php +0 -0
  32. lib/paymentwall-php/lib/Paymentwall/Card.php +0 -0
  33. lib/paymentwall-php/lib/Paymentwall/Charge.php +0 -0
  34. lib/paymentwall-php/lib/Paymentwall/Config.php +0 -0
  35. lib/paymentwall-php/lib/Paymentwall/GenerericApiObject.php +57 -0
  36. lib/paymentwall-php/lib/Paymentwall/HttpAction.php +0 -0
  37. lib/paymentwall-php/lib/Paymentwall/Instance.php +0 -0
  38. lib/paymentwall-php/lib/Paymentwall/OneTimeToken.php +0 -0
  39. lib/paymentwall-php/lib/Paymentwall/Pingback.php +0 -0
  40. lib/paymentwall-php/lib/Paymentwall/Product.php +0 -0
  41. lib/paymentwall-php/lib/Paymentwall/Response/Abstract.php +0 -0
  42. lib/paymentwall-php/lib/Paymentwall/Response/Error.php +0 -0
  43. lib/paymentwall-php/lib/Paymentwall/Response/Factory.php +0 -0
  44. lib/paymentwall-php/lib/Paymentwall/Response/Interface.php +0 -0
  45. lib/paymentwall-php/lib/Paymentwall/Response/Success.php +0 -0
  46. lib/paymentwall-php/lib/Paymentwall/Signature/Abstract.php +0 -0
  47. lib/paymentwall-php/lib/Paymentwall/Signature/Pingback.php +0 -0
  48. lib/paymentwall-php/lib/Paymentwall/Signature/Widget.php +0 -0
  49. lib/paymentwall-php/lib/Paymentwall/Subscription.php +0 -0
  50. lib/paymentwall-php/lib/Paymentwall/Widget.php +0 -0
  51. lib/paymentwall-php/lib/paymentwall.php +6 -4
  52. package.xml +6 -5
  53. skin/frontend/base/default/css/paymentwall.css +0 -0
  54. skin/frontend/base/default/js/paymentwall.js +0 -0
app/code/community/Paymentwall/Paymentwall/Block/Checkout/Form/Method/Abstract.php CHANGED
File without changes
app/code/community/Paymentwall/Paymentwall/Block/Checkout/Form/Method/Pwbrick.php CHANGED
File without changes
app/code/community/Paymentwall/Paymentwall/Block/Checkout/Form/Method/Pwlocal.php CHANGED
File without changes
app/code/community/Paymentwall/Paymentwall/Block/Checkout/Info/Method/Pwbrick.php CHANGED
File without changes
app/code/community/Paymentwall/Paymentwall/Block/Checkout/Info/Method/Pwlocal.php CHANGED
File without changes
app/code/community/Paymentwall/Paymentwall/Helper/Data.php CHANGED
File without changes
app/code/community/Paymentwall/Paymentwall/Model/Method/Abstract.php CHANGED
@@ -42,6 +42,7 @@ class Paymentwall_Paymentwall_Model_Method_Abstract extends Mage_Payment_Model_M
42
  $order = $this->getCurrentOrder();
43
  if ($order->getState() === Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW || $order->getState() === Mage_Sales_Model_Order::STATE_NEW) {
44
  if ($pingback->isDeliverable()) {
 
45
  $this->makeInvoice();
46
  } elseif ($pingback->isCancelable()) {
47
  $reason = $pingback->getParameter('reason');
@@ -78,7 +79,7 @@ class Paymentwall_Paymentwall_Model_Method_Abstract extends Mage_Payment_Model_M
78
  * @param $order
79
  * @return array
80
  */
81
- protected function prepareUserProfile($order)
82
  {
83
  $billing = $order->getBillingAddress();
84
  $data = array(
@@ -105,16 +106,56 @@ class Paymentwall_Paymentwall_Model_Method_Abstract extends Mage_Payment_Model_M
105
  ));
106
  } else {
107
  $data = array_merge($data, array(
108
- 'customer[username]' => $billing->getCustomerEmail(),
109
  'customer[firstname]' => $billing->getFirstname(),
110
  'customer[lastname]' => $billing->getLastname(),
111
- 'email' => $billing->getEmail()
112
  ));
113
  }
114
 
115
  return $data;
116
  }
117
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
118
  /**
119
  * Log Function
120
  * @param $message
42
  $order = $this->getCurrentOrder();
43
  if ($order->getState() === Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW || $order->getState() === Mage_Sales_Model_Order::STATE_NEW) {
44
  if ($pingback->isDeliverable()) {
45
+ $this->callDeliveryApi($pingback->getReferenceId());
46
  $this->makeInvoice();
47
  } elseif ($pingback->isCancelable()) {
48
  $reason = $pingback->getParameter('reason');
79
  * @param $order
80
  * @return array
81
  */
82
+ protected function prepareUserProfile(Mage_Sales_Model_Order $order)
83
  {
84
  $billing = $order->getBillingAddress();
85
  $data = array(
106
  ));
107
  } else {
108
  $data = array_merge($data, array(
109
+ 'customer[username]' => $billing->getEmail(),
110
  'customer[firstname]' => $billing->getFirstname(),
111
  'customer[lastname]' => $billing->getLastname(),
 
112
  ));
113
  }
114
 
115
  return $data;
116
  }
117
 
118
+ public function callDeliveryApi($ref)
119
+ {
120
+ $this->initPaymentwallConfig();
121
+ if ($this->getConfigData('paymentwall_delivery')) {
122
+ $delivery = new Paymentwall_GenerericApiObject('delivery');
123
+ $response = $delivery->post($this->prepareDeliveryData($this->getCurrentOrder(), $ref));
124
+ }
125
+ }
126
+
127
+ /**
128
+ * @param Mage_Sales_Model_Order $order
129
+ * @param $ref
130
+ * @return array
131
+ */
132
+ private function prepareDeliveryData(Mage_Sales_Model_Order $order, $ref)
133
+ {
134
+ $billing = $order->getBillingAddress();
135
+ $shipping = $order->getShippingAddress();
136
+
137
+ return array(
138
+ 'payment_id' => $ref,
139
+ 'type' => 'digital',
140
+ 'status' => 'delivered',
141
+ 'estimated_delivery_datetime' => date('Y/m/d H:i:s'),
142
+ 'estimated_update_datetime' => date('Y/m/d H:i:s'),
143
+ 'refundable' => 'yes',
144
+ 'details' => 'Item will be delivered via email by ' . date('Y/m/d H:i:s'),
145
+ 'shipping_address[email]' => $billing->getEmail(),
146
+ 'shipping_address[firstname]' => $shipping->getFirstname(),
147
+ 'shipping_address[lastname]' => $shipping->getLastname(),
148
+ 'shipping_address[country]' => $shipping->getCountry(),
149
+ 'shipping_address[street]' => $shipping->getStreetFull(),
150
+ 'shipping_address[state]' => $shipping->getRegion(),
151
+ 'shipping_address[phone]' => $shipping->getTelephone(),
152
+ 'shipping_address[zip]' => $shipping->getPostcode(),
153
+ 'shipping_address[city]' => $shipping->getCity(),
154
+ 'reason' => 'none',
155
+ 'is_test' => $this->getConfigData('paymentwall_istest') ? 1 : 0,
156
+ );
157
+ }
158
+
159
  /**
160
  * Log Function
161
  * @param $message
app/code/community/Paymentwall/Paymentwall/Model/Method/Pwbrick.php CHANGED
File without changes
app/code/community/Paymentwall/Paymentwall/Model/Method/Pwlocal.php CHANGED
@@ -51,7 +51,7 @@ class Paymentwall_Paymentwall_Model_Method_Pwlocal extends Paymentwall_Paymentwa
51
  * @param $order
52
  * @return Paymentwall_Widget
53
  */
54
- public function getPaymentWidget($order)
55
  {
56
  $this->initPaymentwallConfig();
57
 
51
  * @param $order
52
  * @return Paymentwall_Widget
53
  */
54
+ public function getPaymentWidget(Mage_Sales_Model_Order $order)
55
  {
56
  $this->initPaymentwallConfig();
57
 
app/code/community/Paymentwall/Paymentwall/Model/Pingback.php CHANGED
@@ -22,32 +22,36 @@ class Paymentwall_Paymentwall_Model_Pingback extends Mage_Core_Model_Abstract
22
 
23
  $pingback = new Paymentwall_Pingback($_GET, $_SERVER['REMOTE_ADDR']);
24
 
25
- if ($pingback->validate(true)) {
26
  $order = Mage::getModel('sales/order')->loadByIncrementId($pingback->getProductId());
27
  if ($order->getId()) {
28
  try {
29
  if ($pingback->isDeliverable()) {
 
30
  $paymentModel = $order->getPayment()->getMethodInstance();
31
- $paymentModel->setCurrentOrder($order)->processPendingPayment($pingback);
32
- $result = self::DEFAULT_PINGBACK_RESPONSE;
 
 
33
  } elseif ($pingback->isCancelable()) {
34
  $order->registerCancellation(Mage::helper('sales')->__('Order marked as cancelled by Paymentwall.'))
35
  ->save();
36
- $result = Mage::helper('sales')->__('Order marked as cancelled by Paymentwall.');
37
  }
38
  } catch (Exception $e) {
39
  Mage::log($e->getMessage());
40
  $result = 'Internal server error';
41
  $result .= ' ' . $e->getMessage();
 
42
  }
43
  } else {
44
- $result = 'Invalid order';
45
  }
46
  } else {
47
- $result = $pingback->getErrorSummary();
48
  }
49
 
50
- return $result;
51
  }
52
 
53
 
22
 
23
  $pingback = new Paymentwall_Pingback($_GET, $_SERVER['REMOTE_ADDR']);
24
 
25
+ if ($pingback->validate()) {
26
  $order = Mage::getModel('sales/order')->loadByIncrementId($pingback->getProductId());
27
  if ($order->getId()) {
28
  try {
29
  if ($pingback->isDeliverable()) {
30
+
31
  $paymentModel = $order->getPayment()->getMethodInstance();
32
+ $paymentModel->setCurrentOrder($order)
33
+ ->processPendingPayment($pingback);
34
+
35
+ return self::DEFAULT_PINGBACK_RESPONSE;
36
  } elseif ($pingback->isCancelable()) {
37
  $order->registerCancellation(Mage::helper('sales')->__('Order marked as cancelled by Paymentwall.'))
38
  ->save();
39
+ return Mage::helper('sales')->__('Order marked as cancelled by Paymentwall.');
40
  }
41
  } catch (Exception $e) {
42
  Mage::log($e->getMessage());
43
  $result = 'Internal server error';
44
  $result .= ' ' . $e->getMessage();
45
+ return $result;
46
  }
47
  } else {
48
+ return 'Invalid order';
49
  }
50
  } else {
51
+ return $pingback->getErrorSummary();
52
  }
53
 
54
+ return '';
55
  }
56
 
57
 
app/code/community/Paymentwall/Paymentwall/controllers/PaymentController.php CHANGED
@@ -10,6 +10,7 @@
10
  */
11
  class Paymentwall_Paymentwall_PaymentController extends Mage_Core_Controller_Front_Action
12
  {
 
13
 
14
  /**
15
  * Action that handles pingback call from paymentwall system
@@ -48,21 +49,8 @@ class Paymentwall_Paymentwall_PaymentController extends Mage_Core_Controller_Fro
48
  if ($curOrderId) {
49
  $order = Mage::getModel('sales/order')->loadByIncrementId($curOrderId);
50
  if ($order->getId()) {
51
-
52
- if ($response['status'] = $order->getStatus() == Mage_Sales_Model_Order::STATE_PROCESSING
53
- || $order->getStatus() == Mage_Sales_Model_Order::STATE_CANCELED
54
- ) {
55
- $response['status'] = 1;
56
- $response['message'] = $order->getStatus() == Mage_Sales_Model_Order::STATE_CANCELED
57
- ? "<h3>{$this->__("Payment Canceled")}</h3>"
58
- : "<h3>{$this->__("Payment Processed")}</h3>";
59
-
60
- // Clear shopping cart
61
- Mage::getSingleton('checkout/cart')->truncate();
62
-
63
- } else {
64
- $response['status'] = 0;
65
- }
66
  // Get success page redirect url
67
  $response['url'] = '';
68
  } else {
@@ -70,6 +58,11 @@ class Paymentwall_Paymentwall_PaymentController extends Mage_Core_Controller_Fro
70
  $response['message'] = 'Order Invalid';
71
  }
72
  }
 
 
 
 
 
73
 
74
  $this->getResponse()->clearHeaders()->setHeader('Content-type', 'application/json', true);
75
  $this->getResponse()->setBody(json_encode($response));
10
  */
11
  class Paymentwall_Paymentwall_PaymentController extends Mage_Core_Controller_Front_Action
12
  {
13
+ const ORDER_STATUS_AFTER_PINGBACK_SUCCESS = 'processing';
14
 
15
  /**
16
  * Action that handles pingback call from paymentwall system
49
  if ($curOrderId) {
50
  $order = Mage::getModel('sales/order')->loadByIncrementId($curOrderId);
51
  if ($order->getId()) {
52
+ $response['status'] = $order->getStatus() == self::ORDER_STATUS_AFTER_PINGBACK_SUCCESS
53
+ ? 1 : 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
54
  // Get success page redirect url
55
  $response['url'] = '';
56
  } else {
58
  $response['message'] = 'Order Invalid';
59
  }
60
  }
61
+ if ($response['status'] == 1) {
62
+ $response['message'] = "<h3>{$this->__("Payment Processed")}</h3>";
63
+ // Clear shopping cart
64
+ Mage::getSingleton('checkout/cart')->truncate();
65
+ }
66
 
67
  $this->getResponse()->clearHeaders()->setHeader('Content-type', 'application/json', true);
68
  $this->getResponse()->setBody(json_encode($response));
app/code/community/Paymentwall/Paymentwall/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Paymentwall_Paymentwall>
5
- <version>1.1.2</version>
6
  </Paymentwall_Paymentwall>
7
  </modules>
8
  <frontend>
@@ -50,6 +50,7 @@
50
  <fee_payer>buyer</fee_payer>
51
  <allowspecific>0</allowspecific>
52
  <paymentwall_istest>0</paymentwall_istest>
 
53
  <debug_mode>0</debug_mode>
54
  </paymentwall_pwlocal>
55
  <paymentwall_pwbrick>
2
  <config>
3
  <modules>
4
  <Paymentwall_Paymentwall>
5
+ <version>1.1.3</version>
6
  </Paymentwall_Paymentwall>
7
  </modules>
8
  <frontend>
50
  <fee_payer>buyer</fee_payer>
51
  <allowspecific>0</allowspecific>
52
  <paymentwall_istest>0</paymentwall_istest>
53
+ <paymentwall_delivery>1</paymentwall_delivery>
54
  <debug_mode>0</debug_mode>
55
  </paymentwall_pwlocal>
56
  <paymentwall_pwbrick>
app/code/community/Paymentwall/Paymentwall/etc/system.xml CHANGED
@@ -60,24 +60,24 @@
60
  <show_in_website>1</show_in_website>
61
  <show_in_store>0</show_in_store>
62
  </paymentwall_url>
63
- <paymentwall_delivery translate="label">
64
- <label>Enable Delivery Confirmation API</label>
65
  <frontend_type>select</frontend_type>
66
  <source_model>adminhtml/system_config_source_yesno</source_model>
67
- <sort_order>6</sort_order>
68
  <show_in_default>1</show_in_default>
69
  <show_in_website>1</show_in_website>
70
  <show_in_store>0</show_in_store>
71
- </paymentwall_delivery>
72
- <paymentwall_istest translate="label">
73
- <label>Test Mode</label>
74
  <frontend_type>select</frontend_type>
75
  <source_model>adminhtml/system_config_source_yesno</source_model>
76
  <sort_order>7</sort_order>
77
  <show_in_default>1</show_in_default>
78
  <show_in_website>1</show_in_website>
79
  <show_in_store>0</show_in_store>
80
- </paymentwall_istest>
81
  <debug_mode translate="label">
82
  <label>Debug Mode</label>
83
  <frontend_type>select</frontend_type>
@@ -150,15 +150,6 @@
150
  <show_in_website>1</show_in_website>
151
  <show_in_store>0</show_in_store>
152
  </allowspecific>
153
- <paymentwall_delivery translate="label">
154
- <label>Enable Delivery Confirmation API</label>
155
- <frontend_type>select</frontend_type>
156
- <source_model>adminhtml/system_config_source_yesno</source_model>
157
- <sort_order>51</sort_order>
158
- <show_in_default>1</show_in_default>
159
- <show_in_website>1</show_in_website>
160
- <show_in_store>0</show_in_store>
161
- </paymentwall_delivery>
162
  <debug_mode translate="label">
163
  <label>Debug Mode</label>
164
  <frontend_type>select</frontend_type>
60
  <show_in_website>1</show_in_website>
61
  <show_in_store>0</show_in_store>
62
  </paymentwall_url>
63
+ <paymentwall_istest translate="label">
64
+ <label>Test Mode</label>
65
  <frontend_type>select</frontend_type>
66
  <source_model>adminhtml/system_config_source_yesno</source_model>
67
+ <sort_order>7</sort_order>
68
  <show_in_default>1</show_in_default>
69
  <show_in_website>1</show_in_website>
70
  <show_in_store>0</show_in_store>
71
+ </paymentwall_istest>
72
+ <paymentwall_delivery translate="label">
73
+ <label>Enable Delivery Api</label>
74
  <frontend_type>select</frontend_type>
75
  <source_model>adminhtml/system_config_source_yesno</source_model>
76
  <sort_order>7</sort_order>
77
  <show_in_default>1</show_in_default>
78
  <show_in_website>1</show_in_website>
79
  <show_in_store>0</show_in_store>
80
+ </paymentwall_delivery>
81
  <debug_mode translate="label">
82
  <label>Debug Mode</label>
83
  <frontend_type>select</frontend_type>
150
  <show_in_website>1</show_in_website>
151
  <show_in_store>0</show_in_store>
152
  </allowspecific>
 
 
 
 
 
 
 
 
 
153
  <debug_mode translate="label">
154
  <label>Debug Mode</label>
155
  <frontend_type>select</frontend_type>
app/design/frontend/base/default/layout/paymentwall.xml CHANGED
File without changes
app/design/frontend/base/default/template/paymentwall/checkout/form/method/pwbrick.phtml CHANGED
File without changes
app/design/frontend/base/default/template/paymentwall/checkout/form/method/pwlocal.phtml CHANGED
File without changes
app/design/frontend/base/default/template/paymentwall/checkout/info/method/pwbrick.phtml CHANGED
File without changes
lib/paymentwall-php/.gitignore ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Vagrant
2
+ .vagrant/*
3
+ Vagrantfile
4
+
5
+ # SublimeText
6
+ *.sublime-project
7
+ *.sublime-workspace
8
+
9
+ # Composer
10
+ composer.phar
11
+ vendor/
12
+ composer.lock
13
+
14
+ # Behat
15
+ behat*
lib/paymentwall-php/LICENSE CHANGED
File without changes
lib/paymentwall-php/README.md CHANGED
File without changes
lib/paymentwall-php/composer.json CHANGED
@@ -1,7 +1,7 @@
1
  {
2
  "name": "paymentwall/paymentwall-php",
3
  "description": "Paymentwall PHP Library. Paymentwall is the leading digital payments platform for globally monetizing digital goods and services.",
4
- "version": "2.0.0",
5
  "type": "library",
6
  "homepage": "http://paymentwall.com?source=gh",
7
  "keywords": [
@@ -27,6 +27,9 @@
27
  "ext-curl": "*",
28
  "ext-json": "*"
29
  },
 
 
 
30
  "config": {
31
  "bin-dir": "bin/"
32
  },
1
  {
2
  "name": "paymentwall/paymentwall-php",
3
  "description": "Paymentwall PHP Library. Paymentwall is the leading digital payments platform for globally monetizing digital goods and services.",
4
+ "version": "2.1.0",
5
  "type": "library",
6
  "homepage": "http://paymentwall.com?source=gh",
7
  "keywords": [
27
  "ext-curl": "*",
28
  "ext-json": "*"
29
  },
30
+ "require-dev": {
31
+ "behat/behat": "2.4.*@stable"
32
+ },
33
  "config": {
34
  "bin-dir": "bin/"
35
  },
lib/paymentwall-php/features/bootstrap/ChargeContext.php CHANGED
File without changes
lib/paymentwall-php/features/bootstrap/FeatureContext.php CHANGED
File without changes
lib/paymentwall-php/features/bootstrap/PingbackContext.php CHANGED
File without changes
lib/paymentwall-php/features/bootstrap/WidgetContext.php CHANGED
File without changes
lib/paymentwall-php/features/charge.feature CHANGED
File without changes
lib/paymentwall-php/features/pingback.feature CHANGED
File without changes
lib/paymentwall-php/features/widget.feature CHANGED
File without changes
lib/paymentwall-php/lib/Paymentwall/ApiObject.php CHANGED
@@ -2,6 +2,7 @@
2
 
3
  abstract class Paymentwall_ApiObject extends Paymentwall_Instance
4
  {
 
5
  const API_OBJECT_CHARGE = 'charge';
6
  const API_OBJECT_SUBSCRIPTION = 'subscription';
7
  const API_OBJECT_ONE_TIME_TOKEN = 'token';
@@ -9,6 +10,9 @@ abstract class Paymentwall_ApiObject extends Paymentwall_Instance
9
  protected $properties = array();
10
  protected $_id;
11
  protected $_rawResponse = '';
 
 
 
12
 
13
  abstract function getEndpointName();
14
 
@@ -38,7 +42,7 @@ abstract class Paymentwall_ApiObject extends Paymentwall_Instance
38
  if ($this->getEndpointName() === self::API_OBJECT_ONE_TIME_TOKEN && !$this->getConfig()->isTest()) {
39
  return Paymentwall_OneTimeToken::GATEWAY_TOKENIZATION_URL;
40
  } else {
41
- return $this->getApiBaseUrl() . '/brick/' . $this->getEndpointName();
42
  }
43
  }
44
 
@@ -67,6 +71,13 @@ abstract class Paymentwall_ApiObject extends Paymentwall_Instance
67
  }
68
  }
69
 
 
 
 
 
 
 
 
70
  protected function getPropertiesFromResponse()
71
  {
72
  return $this->properties;
2
 
3
  abstract class Paymentwall_ApiObject extends Paymentwall_Instance
4
  {
5
+ const API_BRICK_SUBPATH = 'brick';
6
  const API_OBJECT_CHARGE = 'charge';
7
  const API_OBJECT_SUBSCRIPTION = 'subscription';
8
  const API_OBJECT_ONE_TIME_TOKEN = 'token';
10
  protected $properties = array();
11
  protected $_id;
12
  protected $_rawResponse = '';
13
+ protected $brickSubEndpoints = array(
14
+ self::API_OBJECT_CHARGE, self::API_OBJECT_SUBSCRIPTION, self::API_OBJECT_ONE_TIME_TOKEN
15
+ );
16
 
17
  abstract function getEndpointName();
18
 
42
  if ($this->getEndpointName() === self::API_OBJECT_ONE_TIME_TOKEN && !$this->getConfig()->isTest()) {
43
  return Paymentwall_OneTimeToken::GATEWAY_TOKENIZATION_URL;
44
  } else {
45
+ return $this->getApiBaseUrl() . $this->getSubPath() . '/' . $this->getEndpointName();
46
  }
47
  }
48
 
71
  }
72
  }
73
 
74
+ protected function getSubPath()
75
+ {
76
+ return (in_array($this->getEndpointName(), $this->brickSubEndpoints))
77
+ ? '/' . self::API_BRICK_SUBPATH
78
+ : '';
79
+ }
80
+
81
  protected function getPropertiesFromResponse()
82
  {
83
  return $this->properties;
lib/paymentwall-php/lib/Paymentwall/ApiObjectInterface.php CHANGED
File without changes
lib/paymentwall-php/lib/Paymentwall/Base.php CHANGED
File without changes
lib/paymentwall-php/lib/Paymentwall/Card.php CHANGED
File without changes
lib/paymentwall-php/lib/Paymentwall/Charge.php CHANGED
File without changes
lib/paymentwall-php/lib/Paymentwall/Config.php CHANGED
File without changes
lib/paymentwall-php/lib/Paymentwall/GenerericApiObject.php ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Paymentwall_GenerericApiObject extends Paymentwall_ApiObject
4
+ {
5
+ /**
6
+ * API type
7
+ *
8
+ * @var string
9
+ */
10
+ protected $api;
11
+
12
+ /**
13
+ * Paymentwall_HttpAction object
14
+ *
15
+ * @var \Paymentwall_HttpAction
16
+ */
17
+ protected $httpAction;
18
+
19
+ /**
20
+ * @see \Paymentwall_ApiObject
21
+ */
22
+ public function getEndpointName()
23
+ {
24
+ return $this->api;
25
+ }
26
+
27
+ public function __construct($type)
28
+ {
29
+ $this->api = $type;
30
+ $this->httpAction = new Paymentwall_HttpAction($this);
31
+ }
32
+
33
+ /**
34
+ * Make post request
35
+ *
36
+ * @param array $params
37
+ * @param array $headers
38
+ *
39
+ * @return array
40
+ */
41
+ public function post($params = array(), $headers = array())
42
+ {
43
+ if (empty($params)) {
44
+ return null;
45
+ }
46
+
47
+ $this->httpAction->setApiParams($params);
48
+
49
+ $this->httpAction->setApiHeaders(array_merge(array($this->getApiBaseHeader()), $headers));
50
+
51
+ return (array) $this->preparePropertiesFromResponse(
52
+ $this->httpAction->post(
53
+ $this->getApiUrl()
54
+ )
55
+ );
56
+ }
57
+ }
lib/paymentwall-php/lib/Paymentwall/HttpAction.php CHANGED
File without changes
lib/paymentwall-php/lib/Paymentwall/Instance.php CHANGED
File without changes
lib/paymentwall-php/lib/Paymentwall/OneTimeToken.php CHANGED
File without changes
lib/paymentwall-php/lib/Paymentwall/Pingback.php CHANGED
File without changes
lib/paymentwall-php/lib/Paymentwall/Product.php CHANGED
File without changes
lib/paymentwall-php/lib/Paymentwall/Response/Abstract.php CHANGED
File without changes
lib/paymentwall-php/lib/Paymentwall/Response/Error.php CHANGED
File without changes
lib/paymentwall-php/lib/Paymentwall/Response/Factory.php CHANGED
File without changes
lib/paymentwall-php/lib/Paymentwall/Response/Interface.php CHANGED
File without changes
lib/paymentwall-php/lib/Paymentwall/Response/Success.php CHANGED
File without changes
lib/paymentwall-php/lib/Paymentwall/Signature/Abstract.php CHANGED
File without changes
lib/paymentwall-php/lib/Paymentwall/Signature/Pingback.php CHANGED
File without changes
lib/paymentwall-php/lib/Paymentwall/Signature/Widget.php CHANGED
File without changes
lib/paymentwall-php/lib/Paymentwall/Subscription.php CHANGED
File without changes
lib/paymentwall-php/lib/Paymentwall/Widget.php CHANGED
File without changes
lib/paymentwall-php/lib/paymentwall.php CHANGED
@@ -26,11 +26,11 @@ require_once(dirname(__FILE__) . '/Paymentwall/ApiObject.php');
26
 
27
  require_once(dirname(__FILE__) . '/Paymentwall/ApiObjectInterface.php');
28
 
29
- require_once (dirname(__FILE__) . '/Paymentwall/OneTimeToken.php');
30
 
31
- require_once (dirname(__FILE__) . '/Paymentwall/Charge.php');
32
 
33
- require_once (dirname(__FILE__) . '/Paymentwall/Subscription.php');
34
 
35
  require_once(dirname(__FILE__) . '/Paymentwall/HttpAction.php');
36
 
@@ -48,4 +48,6 @@ require_once(dirname(__FILE__) . '/Paymentwall/Response/Interface.php');
48
 
49
  require_once(dirname(__FILE__) . '/Paymentwall/Response/Success.php');
50
 
51
- require_once(dirname(__FILE__) . '/Paymentwall/Response/Error.php');
 
 
26
 
27
  require_once(dirname(__FILE__) . '/Paymentwall/ApiObjectInterface.php');
28
 
29
+ require_once(dirname(__FILE__) . '/Paymentwall/OneTimeToken.php');
30
 
31
+ require_once(dirname(__FILE__) . '/Paymentwall/Charge.php');
32
 
33
+ require_once(dirname(__FILE__) . '/Paymentwall/Subscription.php');
34
 
35
  require_once(dirname(__FILE__) . '/Paymentwall/HttpAction.php');
36
 
48
 
49
  require_once(dirname(__FILE__) . '/Paymentwall/Response/Success.php');
50
 
51
+ require_once(dirname(__FILE__) . '/Paymentwall/Response/Error.php');
52
+
53
+ require_once(dirname(__FILE__) . '/Paymentwall/GenerericApiObject.php');
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>paymentwall_magento_module</name>
4
- <version>1.1.2</version>
5
  <stability>stable</stability>
6
  <license>MITL</license>
7
  <channel>community</channel>
@@ -9,11 +9,12 @@
9
  <summary>Paymentwall payment extension for Magento. 120+ payment methods in more than 200 countries.</summary>
10
  <description>Paymentwall payment extension for Magento. 120+ payment methods in more than 200 countries.&#xD;
11
  </description>
12
- <notes>version 1.1.2</notes>
 
13
  <authors><author><name>Paymentwall</name><user>platforms</user><email>platforms@paymentwall.com</email></author></authors>
14
- <date>2015-07-29</date>
15
- <time>07:57:17</time>
16
- <contents><target name="magecommunity"><dir name="Paymentwall"><dir name="Paymentwall"><dir name="Block"><dir name="Checkout"><dir name="Form"><dir name="Method"><file name="Abstract.php" hash="de9bfa933a6e1757c3bab53768ec4d62"/><file name="Pwbrick.php" hash="c01cabde8670bdff801534fe283b0534"/><file name="Pwlocal.php" hash="2d4a1fb4fdfcaaf5d7cf72eae4231965"/></dir></dir><dir name="Info"><dir name="Method"><file name="Pwbrick.php" hash="4d8bc2a37e04c180896a708dabf9cfa7"/><file name="Pwlocal.php" hash="52d3d7580cbdcc8bf0f98834b9a9e5a0"/></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="4270b082a8264e63f6a82228b3e2c1d2"/></dir><dir name="Model"><dir name="Method"><file name="Abstract.php" hash="25ab2e01f2d88c883e0b4923ed66fe2e"/><file name="Pwbrick.php" hash="4a942085fcf47ed79997cd111c2ca5ef"/><file name="Pwlocal.php" hash="0080900a8f0bb52011b59cf4f8f2850b"/></dir><file name="Pingback.php" hash="c969c2dd6282f40dfefab136ad02c944"/></dir><dir name="controllers"><file name="PaymentController.php" hash="968e141ae56e9b44b480861e272ad1fb"/></dir><dir name="etc"><file name="config.xml" hash="a1d366df16f0754c21d42dffd5908879"/><file name="system.xml" hash="bfcc8a3c6c5d6836016a572999872c91"/></dir></dir></dir></target><target name="magelib"><dir name="paymentwall-php"><file name="LICENSE" hash="001561189374b83bcd6bc7f962daee8a"/><file name="README.md" hash="094753cc8aed5d682e40ae82de375ad1"/><file name="composer.json" hash="87fd93ee0a600f718e34403acd6e05f5"/><dir name="features"><dir name="bootstrap"><file name="ChargeContext.php" hash="f1d0604f2fc16dd5932535f9c24995a3"/><file name="FeatureContext.php" hash="146d6e79c6704cfb24ee6f2a7b7fba5a"/><file name="PingbackContext.php" hash="b6c86d8f3c9caa21435f47ddb2d5add1"/><file name="WidgetContext.php" hash="70c8d608eb407e346467c2a8f7162732"/></dir><file name="charge.feature" hash="04258fc641535794c48c6c55aad7f94f"/><file name="pingback.feature" hash="05869da8a3e36b6bec0293a22c1a9235"/><file name="widget.feature" hash="198999d8bf357de175f3268cc88337f6"/></dir><dir name="lib"><dir name="Paymentwall"><file name="ApiObject.php" hash="ce506a90666727844479b04a956f0ee9"/><file name="ApiObjectInterface.php" hash="4922ff334356aac33a5b159f8d001b93"/><file name="Base.php" hash="9bdae1c385327dadbd0ca5c9bbbe6107"/><file name="Card.php" hash="d8aa72a3e8ea0cdd132867164c8352c1"/><file name="Charge.php" hash="0ca04683046e9abdf3968f495db625c4"/><file name="Config.php" hash="9253f2afd5523653dd9e5fce2afc15c4"/><file name="HttpAction.php" hash="66bc684bf7476bd21ed6f3275c3ed758"/><file name="Instance.php" hash="86422afa5d43aac945021ef694b9bbc1"/><file name="OneTimeToken.php" hash="e3b9c56c34920c9b5ea53609d95acb3b"/><file name="Pingback.php" hash="fefcc3b656ab048d1f136c2b6896562a"/><file name="Product.php" hash="8b382cb28b68f77c9784e5dbc40512cb"/><dir name="Response"><file name="Abstract.php" hash="f59033acb9e14fa7a90cc2f812b6970c"/><file name="Error.php" hash="4554a0b337a2748221fb7dfae2daa8c2"/><file name="Factory.php" hash="7036d21f4682b505d5b1ff04ec79e355"/><file name="Interface.php" hash="e75f22329b3c8cbdf389aee8366ceaf3"/><file name="Success.php" hash="1f3c6c58b4273eadff5ef4b482b65187"/></dir><dir name="Signature"><file name="Abstract.php" hash="dea8f9c03b02db7462d276e3611a3a98"/><file name="Pingback.php" hash="1ab1e00037d395f9bc55bea929397927"/><file name="Widget.php" hash="2e1e2a712a0eca4f54f834838df51a59"/></dir><file name="Subscription.php" hash="7110f0292dbe01e4bc1517b5cc206ed2"/><file name="Widget.php" hash="6a91e8c0f4fe930facde52c2750824da"/></dir><file name="paymentwall.php" hash="1f3be3cc3145b4e23ad051bca926a9b8"/></dir><file name=".git" hash="0954c63dae646ef899522917f34f8484"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><file name="paymentwall.css" hash="408b3eb269441b27d262c3abc6da78f3"/></dir><dir name="js"><file name="paymentwall.js" hash="cd7c024937af425dc35fcfdc772caf9f"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="paymentwall.xml" hash="15713872f2239c9b3cb615291b36e54b"/></dir><dir name="template"><dir name="paymentwall"><dir name="checkout"><dir name="form"><dir name="method"><file name="pwbrick.phtml" hash="6413a19e7fd7ec011c09ee7d2be73489"/><file name="pwlocal.phtml" hash="b964770e54bb91fca23a49951e3c744c"/></dir></dir><dir name="info"><dir name="method"><file name="pwbrick.phtml" hash="02d1fd8185430bb1f8d0946df1391ccd"/></dir></dir></dir></dir></dir></dir></dir></dir></target></contents>
17
  <compatible/>
18
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
19
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>paymentwall_magento_module</name>
4
+ <version>1.1.3</version>
5
  <stability>stable</stability>
6
  <license>MITL</license>
7
  <channel>community</channel>
9
  <summary>Paymentwall payment extension for Magento. 120+ payment methods in more than 200 countries.</summary>
10
  <description>Paymentwall payment extension for Magento. 120+ payment methods in more than 200 countries.&#xD;
11
  </description>
12
+ <notes>* Add Delivery Confirmation API support&#xD;
13
+ * Update latest lib</notes>
14
  <authors><author><name>Paymentwall</name><user>platforms</user><email>platforms@paymentwall.com</email></author></authors>
15
+ <date>2015-08-07</date>
16
+ <time>09:50:00</time>
17
+ <contents><target name="magecommunity"><dir name="Paymentwall"><dir name="Paymentwall"><dir name="Block"><dir name="Checkout"><dir name="Form"><dir name="Method"><file name="Abstract.php" hash="de9bfa933a6e1757c3bab53768ec4d62"/><file name="Pwbrick.php" hash="c01cabde8670bdff801534fe283b0534"/><file name="Pwlocal.php" hash="2d4a1fb4fdfcaaf5d7cf72eae4231965"/></dir></dir><dir name="Info"><dir name="Method"><file name="Pwbrick.php" hash="4d8bc2a37e04c180896a708dabf9cfa7"/><file name="Pwlocal.php" hash="52d3d7580cbdcc8bf0f98834b9a9e5a0"/></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="4270b082a8264e63f6a82228b3e2c1d2"/></dir><dir name="Model"><dir name="Method"><file name="Abstract.php" hash="9569622bded9c0da37b101a3873b0613"/><file name="Pwbrick.php" hash="4a942085fcf47ed79997cd111c2ca5ef"/><file name="Pwlocal.php" hash="214c700db4b9c81173bb1ec9ee63f0c9"/></dir><file name="Pingback.php" hash="1f72ce87c04bd771d9f5f3d6121d45a2"/></dir><dir name="controllers"><file name="PaymentController.php" hash="6d576fabeef93bc1e36a1dad97a26f9c"/></dir><dir name="etc"><file name="config.xml" hash="0adf8e66e5ae287aa10156dbea4d5cd4"/><file name="system.xml" hash="82abac90b5d8edf1b47e72135245b2ea"/></dir></dir></dir></target><target name="magelib"><dir name="paymentwall-php"><file name="LICENSE" hash="001561189374b83bcd6bc7f962daee8a"/><file name="README.md" hash="094753cc8aed5d682e40ae82de375ad1"/><file name="composer.json" hash="4e7035c64f2d74ba0a5f5cf80effe45e"/><dir name="features"><dir name="bootstrap"><file name="ChargeContext.php" hash="f1d0604f2fc16dd5932535f9c24995a3"/><file name="FeatureContext.php" hash="146d6e79c6704cfb24ee6f2a7b7fba5a"/><file name="PingbackContext.php" hash="b6c86d8f3c9caa21435f47ddb2d5add1"/><file name="WidgetContext.php" hash="70c8d608eb407e346467c2a8f7162732"/></dir><file name="charge.feature" hash="04258fc641535794c48c6c55aad7f94f"/><file name="pingback.feature" hash="05869da8a3e36b6bec0293a22c1a9235"/><file name="widget.feature" hash="198999d8bf357de175f3268cc88337f6"/></dir><dir name="lib"><dir name="Paymentwall"><file name="ApiObject.php" hash="dae810eb439b239392a7706f5421f5b8"/><file name="ApiObjectInterface.php" hash="4922ff334356aac33a5b159f8d001b93"/><file name="Base.php" hash="9bdae1c385327dadbd0ca5c9bbbe6107"/><file name="Card.php" hash="d8aa72a3e8ea0cdd132867164c8352c1"/><file name="Charge.php" hash="0ca04683046e9abdf3968f495db625c4"/><file name="Config.php" hash="9253f2afd5523653dd9e5fce2afc15c4"/><file name="GenerericApiObject.php" hash="6016e500c2c6736048c2f27ae8924a1c"/><file name="HttpAction.php" hash="66bc684bf7476bd21ed6f3275c3ed758"/><file name="Instance.php" hash="86422afa5d43aac945021ef694b9bbc1"/><file name="OneTimeToken.php" hash="e3b9c56c34920c9b5ea53609d95acb3b"/><file name="Pingback.php" hash="fefcc3b656ab048d1f136c2b6896562a"/><file name="Product.php" hash="8b382cb28b68f77c9784e5dbc40512cb"/><dir name="Response"><file name="Abstract.php" hash="f59033acb9e14fa7a90cc2f812b6970c"/><file name="Error.php" hash="4554a0b337a2748221fb7dfae2daa8c2"/><file name="Factory.php" hash="7036d21f4682b505d5b1ff04ec79e355"/><file name="Interface.php" hash="e75f22329b3c8cbdf389aee8366ceaf3"/><file name="Success.php" hash="1f3c6c58b4273eadff5ef4b482b65187"/></dir><dir name="Signature"><file name="Abstract.php" hash="dea8f9c03b02db7462d276e3611a3a98"/><file name="Pingback.php" hash="1ab1e00037d395f9bc55bea929397927"/><file name="Widget.php" hash="2e1e2a712a0eca4f54f834838df51a59"/></dir><file name="Subscription.php" hash="7110f0292dbe01e4bc1517b5cc206ed2"/><file name="Widget.php" hash="6a91e8c0f4fe930facde52c2750824da"/></dir><file name="paymentwall.php" hash="6f4ee78ffb0677d2a49d2417dae2c038"/></dir><file name=".git" hash="50da8e1bb8ed3a4d1e1413fe2d6c0d68"/><file name=".gitignore" hash="d22fe2936066c576100994c62f32761e"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><file name="paymentwall.css" hash="408b3eb269441b27d262c3abc6da78f3"/></dir><dir name="js"><file name="paymentwall.js" hash="cd7c024937af425dc35fcfdc772caf9f"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="paymentwall.xml" hash="15713872f2239c9b3cb615291b36e54b"/></dir><dir name="template"><dir name="paymentwall"><dir name="checkout"><dir name="form"><dir name="method"><file name="pwbrick.phtml" hash="6413a19e7fd7ec011c09ee7d2be73489"/><file name="pwlocal.phtml" hash="b964770e54bb91fca23a49951e3c744c"/></dir></dir><dir name="info"><dir name="method"><file name="pwbrick.phtml" hash="02d1fd8185430bb1f8d0946df1391ccd"/></dir></dir></dir></dir></dir></dir></dir></dir></target></contents>
18
  <compatible/>
19
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
20
  </package>
skin/frontend/base/default/css/paymentwall.css CHANGED
File without changes
skin/frontend/base/default/js/paymentwall.js CHANGED
File without changes