Version Notes
Stable Version
Download this release
Release Info
Developer | Apruve |
Extension | Apruve_B2B_Payment_Gateway |
Version | 1.0.10 |
Comparing to | |
See all releases |
Code changes from version 1.0.9 to 1.0.10
- app/code/community/Apruve/ApruvePayment/Block/Payment/Form.php +0 -23
- app/code/community/Apruve/ApruvePayment/Helper/Data.php +17 -1
- app/code/community/Apruve/ApruvePayment/Model/Api/PaymentRequest.php +11 -3
- app/code/community/Apruve/ApruvePayment/Model/Api/Rest.php +2 -4
- app/code/community/Apruve/ApruvePayment/Model/PaymentMethod.php +26 -18
- app/code/community/Apruve/ApruvePayment/controllers/WebhookController.php +40 -29
- app/code/community/Apruve/ApruvePayment/etc/config.xml +1 -1
- app/design/frontend/base/default/template/apruvepayment/payment/form.phtml +16 -1
- app/design/frontend/base/default/template/apruvepayment/payment/mark.phtml +0 -35
- js/Apruve/ApruvePayment.js +0 -1
- package.xml +6 -6
app/code/community/Apruve/ApruvePayment/Block/Payment/Form.php
CHANGED
@@ -25,27 +25,4 @@ class Apruve_ApruvePayment_Block_Payment_Form extends Mage_Payment_Block_Form
|
|
25 |
parent::_construct();
|
26 |
$this->setTemplate('apruvepayment/payment/form.phtml');
|
27 |
}
|
28 |
-
|
29 |
-
/**
|
30 |
-
* Check if payment method has title
|
31 |
-
* @return bool
|
32 |
-
*/
|
33 |
-
public function hasMethodTitle()
|
34 |
-
{
|
35 |
-
return true;
|
36 |
-
}
|
37 |
-
|
38 |
-
/**
|
39 |
-
* Set Mark template
|
40 |
-
*/
|
41 |
-
public function getMethodTitle()
|
42 |
-
{
|
43 |
-
$title = $this->getMethod()->getTitle(); //title set in admin area
|
44 |
-
|
45 |
-
$mark = Mage::getConfig()->getBlockClassName('core/template');
|
46 |
-
$mark = new $mark;
|
47 |
-
$mark->setTemplate('apruvepayment/payment/mark.phtml');
|
48 |
-
|
49 |
-
$this->setMethodLabelAfterHtml($title.$mark->toHtml());
|
50 |
-
}
|
51 |
}
|
25 |
parent::_construct();
|
26 |
$this->setTemplate('apruvepayment/payment/form.phtml');
|
27 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
}
|
app/code/community/Apruve/ApruvePayment/Helper/Data.php
CHANGED
@@ -18,7 +18,6 @@
|
|
18 |
* @copyright Copyright (coffee) 2014 Apruve, Inc. (http://www.apruve.com).
|
19 |
* @license http://opensource.org/licenses/Apache-2.0 Apache License, Version 2.0
|
20 |
*/
|
21 |
-
|
22 |
class Apruve_ApruvePayment_Helper_Data extends Mage_Core_Helper_Abstract
|
23 |
{
|
24 |
/**
|
@@ -42,4 +41,21 @@ class Apruve_ApruvePayment_Helper_Data extends Mage_Core_Helper_Abstract
|
|
42 |
$sourceArray = $sourceModel->toSrcArray();
|
43 |
return $sourceArray[Mage::getStoreConfig('payment/apruvepayment/mode')];
|
44 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
}
|
18 |
* @copyright Copyright (coffee) 2014 Apruve, Inc. (http://www.apruve.com).
|
19 |
* @license http://opensource.org/licenses/Apache-2.0 Apache License, Version 2.0
|
20 |
*/
|
|
|
21 |
class Apruve_ApruvePayment_Helper_Data extends Mage_Core_Helper_Abstract
|
22 |
{
|
23 |
/**
|
41 |
$sourceArray = $sourceModel->toSrcArray();
|
42 |
return $sourceArray[Mage::getStoreConfig('payment/apruvepayment/mode')];
|
43 |
}
|
44 |
+
|
45 |
+
/**
|
46 |
+
* @param Mage_Sales_Model_Quote $quote
|
47 |
+
*/
|
48 |
+
public function getAmountsFromQuote($quote)
|
49 |
+
{
|
50 |
+
$result['amount_cents'] = $quote->getGrandTotal();
|
51 |
+
$result['tax_cents'] = 0;
|
52 |
+
$result['shipping_cents'] = 0;
|
53 |
+
foreach ($quote->getAllAddresses() as $address) {
|
54 |
+
/** @var Mage_Sales_Model_Quote_Address $address */
|
55 |
+
$result['tax_cents'] += $address->getTaxAmount();
|
56 |
+
$result['shipping_cents'] += $address->getShippingAmount();
|
57 |
+
}
|
58 |
+
|
59 |
+
return $result;
|
60 |
+
}
|
61 |
}
|
app/code/community/Apruve/ApruvePayment/Model/Api/PaymentRequest.php
CHANGED
@@ -112,18 +112,26 @@ class Apruve_ApruvePayment_Model_Api_PaymentRequest extends Apruve_ApruvePayment
|
|
112 |
{
|
113 |
/** @var Mage_Sales_Model_Quote $quote */
|
114 |
$quote = Mage::getSingleton('checkout/session')->getQuote();
|
|
|
|
|
|
|
|
|
|
|
|
|
115 |
$paymentRequest = array(
|
116 |
'merchant_id' => $this->_getMerchantKey(),
|
117 |
-
'amount_cents' => $this->_convertPrice($
|
118 |
'currency' => 'USD',
|
119 |
-
'tax_cents' => $this->_convertPrice($
|
120 |
-
'shipping_cents' => $this->_convertPrice($
|
121 |
'line_items' => $this->_getLineItems($quote)
|
122 |
);
|
123 |
|
124 |
return $paymentRequest;
|
125 |
}
|
126 |
|
|
|
|
|
127 |
/**
|
128 |
* @param Mage_Sales_Model_Quote $quote
|
129 |
*/
|
112 |
{
|
113 |
/** @var Mage_Sales_Model_Quote $quote */
|
114 |
$quote = Mage::getSingleton('checkout/session')->getQuote();
|
115 |
+
$amounts = Mage::getSingleton('checkout/session')->getApruveAmounts();
|
116 |
+
if (!$amounts) {
|
117 |
+
$amounts = Mage::helper('apruvepayment')->getAmountsFromQuote($quote);
|
118 |
+
Mage::getSingleton('checkout/session')->setApruveAmounts($amounts);
|
119 |
+
}
|
120 |
+
|
121 |
$paymentRequest = array(
|
122 |
'merchant_id' => $this->_getMerchantKey(),
|
123 |
+
'amount_cents' => $this->_convertPrice($amounts['amount_cents']),
|
124 |
'currency' => 'USD',
|
125 |
+
'tax_cents' => $this->_convertPrice($amounts['tax_cents']),
|
126 |
+
'shipping_cents' => $this->_convertPrice($amounts['shipping_cents']),
|
127 |
'line_items' => $this->_getLineItems($quote)
|
128 |
);
|
129 |
|
130 |
return $paymentRequest;
|
131 |
}
|
132 |
|
133 |
+
|
134 |
+
|
135 |
/**
|
136 |
* @param Mage_Sales_Model_Quote $quote
|
137 |
*/
|
app/code/community/Apruve/ApruvePayment/Model/Api/Rest.php
CHANGED
@@ -42,14 +42,13 @@ class Apruve_ApruvePayment_Model_Api_Rest extends Apruve_ApruvePayment_Model_Api
|
|
42 |
curl_setopt($c, CURLOPT_HTTPHEADER, $this->_getHeaders());
|
43 |
curl_setopt($c, CURLOPT_POST, true);
|
44 |
curl_setopt($c, CURLOPT_RETURNTRANSFER, true );
|
45 |
-
curl_setopt($c, CURLOPT_HEADER, true);
|
46 |
curl_setopt($c, CURLOPT_POSTFIELDS, $data );
|
47 |
$response = curl_exec($c);
|
48 |
$http_status = curl_getinfo($c, CURLINFO_HTTP_CODE);
|
49 |
curl_close($c);
|
50 |
|
51 |
if($http_status == '201') {
|
52 |
-
return
|
53 |
} else {
|
54 |
return false;
|
55 |
}
|
@@ -78,7 +77,6 @@ class Apruve_ApruvePayment_Model_Api_Rest extends Apruve_ApruvePayment_Model_Api
|
|
78 |
curl_setopt($c, CURLOPT_HTTPHEADER, $this->_getHeaders());
|
79 |
curl_setopt($c, CURLOPT_CUSTOMREQUEST, "PUT");
|
80 |
curl_setopt($c, CURLOPT_RETURNTRANSFER, true );
|
81 |
-
curl_setopt($c, CURLOPT_HEADER, true);
|
82 |
curl_setopt($c, CURLOPT_POSTFIELDS, $data );
|
83 |
$response = curl_exec($c);
|
84 |
$http_status = curl_getinfo($c, CURLINFO_HTTP_CODE);
|
@@ -86,7 +84,7 @@ class Apruve_ApruvePayment_Model_Api_Rest extends Apruve_ApruvePayment_Model_Api
|
|
86 |
|
87 |
|
88 |
if($http_status == '200') {
|
89 |
-
return
|
90 |
} else {
|
91 |
return false;
|
92 |
}
|
42 |
curl_setopt($c, CURLOPT_HTTPHEADER, $this->_getHeaders());
|
43 |
curl_setopt($c, CURLOPT_POST, true);
|
44 |
curl_setopt($c, CURLOPT_RETURNTRANSFER, true );
|
|
|
45 |
curl_setopt($c, CURLOPT_POSTFIELDS, $data );
|
46 |
$response = curl_exec($c);
|
47 |
$http_status = curl_getinfo($c, CURLINFO_HTTP_CODE);
|
48 |
curl_close($c);
|
49 |
|
50 |
if($http_status == '201') {
|
51 |
+
return json_decode($response);
|
52 |
} else {
|
53 |
return false;
|
54 |
}
|
77 |
curl_setopt($c, CURLOPT_HTTPHEADER, $this->_getHeaders());
|
78 |
curl_setopt($c, CURLOPT_CUSTOMREQUEST, "PUT");
|
79 |
curl_setopt($c, CURLOPT_RETURNTRANSFER, true );
|
|
|
80 |
curl_setopt($c, CURLOPT_POSTFIELDS, $data );
|
81 |
$response = curl_exec($c);
|
82 |
$http_status = curl_getinfo($c, CURLINFO_HTTP_CODE);
|
84 |
|
85 |
|
86 |
if($http_status == '200') {
|
87 |
+
return json_decode($response);
|
88 |
} else {
|
89 |
return false;
|
90 |
}
|
app/code/community/Apruve/ApruvePayment/Model/PaymentMethod.php
CHANGED
@@ -18,17 +18,16 @@
|
|
18 |
* @copyright Copyright (coffee) 2014 Apruve, Inc. (http://www.apruve.com).
|
19 |
* @license http://opensource.org/licenses/Apache-2.0 Apache License, Version 2.0
|
20 |
*/
|
21 |
-
|
22 |
class Apruve_ApruvePayment_Model_PaymentMethod extends Mage_Payment_Model_Method_Abstract
|
23 |
{
|
24 |
protected $_code = 'apruvepayment';
|
25 |
protected $_formBlockType = 'apruvepayment/payment_form';
|
26 |
|
27 |
-
protected $_canAuthorize
|
28 |
-
protected $_canCapture
|
29 |
-
protected $_canVoid
|
30 |
-
protected $_canUseCheckout
|
31 |
-
protected $_canCreateBillingAgreement
|
32 |
|
33 |
/**
|
34 |
* Assign data to info model instance
|
@@ -41,8 +40,7 @@ class Apruve_ApruvePayment_Model_PaymentMethod extends Mage_Payment_Model_Method
|
|
41 |
//$result = parent::assignData($data);
|
42 |
if (is_array($data)) {
|
43 |
$this->getInfoInstance()->setAdditionalInformation('aprt', isset($data['aprt']) ? $data['aprt'] : null);
|
44 |
-
}
|
45 |
-
elseif ($data instanceof Varien_Object) {
|
46 |
$aprt = $data->getAprt();
|
47 |
$this->getInfoInstance()->setAdditionalInformation('aprt', isset($aprt) ? $aprt : null);
|
48 |
}
|
@@ -55,7 +53,7 @@ class Apruve_ApruvePayment_Model_PaymentMethod extends Mage_Payment_Model_Method
|
|
55 |
*/
|
56 |
public function validate()
|
57 |
{
|
58 |
-
if(!$this->getInfoInstance()->getAdditionalInformation('aprt')) {
|
59 |
Mage::throwException('Smth going wrong, try again to post order with apruve');
|
60 |
}
|
61 |
}
|
@@ -69,22 +67,32 @@ class Apruve_ApruvePayment_Model_PaymentMethod extends Mage_Payment_Model_Method
|
|
69 |
public function authorize(Varien_Object $payment, $amount)
|
70 |
{
|
71 |
$additionalInformation = $payment->getAdditionalInformation();
|
72 |
-
$token =
|
|
|
73 |
$rest = Mage::getModel('apruvepayment/api_rest');
|
|
|
74 |
$order = $payment->getOrder();
|
75 |
-
|
76 |
-
$
|
77 |
-
$
|
78 |
-
|
79 |
-
|
80 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
}
|
82 |
|
83 |
-
|
|
|
84 |
Mage::throwException('Apruve couldn\'t process order information');
|
85 |
}
|
86 |
|
87 |
-
$payment->setTransactionId($token)
|
88 |
->setIsTransactionClosed(0);
|
89 |
return $this;
|
90 |
}
|
18 |
* @copyright Copyright (coffee) 2014 Apruve, Inc. (http://www.apruve.com).
|
19 |
* @license http://opensource.org/licenses/Apache-2.0 Apache License, Version 2.0
|
20 |
*/
|
|
|
21 |
class Apruve_ApruvePayment_Model_PaymentMethod extends Mage_Payment_Model_Method_Abstract
|
22 |
{
|
23 |
protected $_code = 'apruvepayment';
|
24 |
protected $_formBlockType = 'apruvepayment/payment_form';
|
25 |
|
26 |
+
protected $_canAuthorize = true;
|
27 |
+
protected $_canCapture = true;
|
28 |
+
protected $_canVoid = true;
|
29 |
+
protected $_canUseCheckout = true;
|
30 |
+
protected $_canCreateBillingAgreement = true;
|
31 |
|
32 |
/**
|
33 |
* Assign data to info model instance
|
40 |
//$result = parent::assignData($data);
|
41 |
if (is_array($data)) {
|
42 |
$this->getInfoInstance()->setAdditionalInformation('aprt', isset($data['aprt']) ? $data['aprt'] : null);
|
43 |
+
} elseif ($data instanceof Varien_Object) {
|
|
|
44 |
$aprt = $data->getAprt();
|
45 |
$this->getInfoInstance()->setAdditionalInformation('aprt', isset($aprt) ? $aprt : null);
|
46 |
}
|
53 |
*/
|
54 |
public function validate()
|
55 |
{
|
56 |
+
if (!$this->getInfoInstance()->getAdditionalInformation('aprt')) {
|
57 |
Mage::throwException('Smth going wrong, try again to post order with apruve');
|
58 |
}
|
59 |
}
|
67 |
public function authorize(Varien_Object $payment, $amount)
|
68 |
{
|
69 |
$additionalInformation = $payment->getAdditionalInformation();
|
70 |
+
$token = $additionalInformation['aprt'];
|
71 |
+
/** @var Apruve_ApruvePayment_Model_Api_Rest $rest */
|
72 |
$rest = Mage::getModel('apruvepayment/api_rest');
|
73 |
+
/** @var Mage_Sales_Model_Order $order */
|
74 |
$order = $payment->getOrder();
|
75 |
+
$amounts = Mage::helper('apruvepayment')->getAmountsFromQuote($order->getQuote());
|
76 |
+
$oldAmounts = Mage::getSingleton('checkout/session')->getApruveAmounts();
|
77 |
+
if ($oldAmounts != $amounts) {
|
78 |
+
$updateResult = $rest->updatePaymentRequest(
|
79 |
+
$token,
|
80 |
+
$amounts['amount_cents'],
|
81 |
+
$amounts['tax_cents'],
|
82 |
+
$amounts['shipping_cents']
|
83 |
+
);
|
84 |
+
Mage::getSingleton('checkout/session')->setApruveAmounts($amounts);
|
85 |
+
if (!$updateResult) {
|
86 |
+
Mage::throwException('Couldn\'t update order totals to Apruve');
|
87 |
+
}
|
88 |
}
|
89 |
|
90 |
+
$apruvePayment = $rest->postPayment($token, $amount);
|
91 |
+
if (!$apruvePayment) {
|
92 |
Mage::throwException('Apruve couldn\'t process order information');
|
93 |
}
|
94 |
|
95 |
+
$payment->setTransactionId($token . "_" . $apruvePayment->id)
|
96 |
->setIsTransactionClosed(0);
|
97 |
return $this;
|
98 |
}
|
app/code/community/Apruve/ApruvePayment/controllers/WebhookController.php
CHANGED
@@ -35,16 +35,18 @@ class Apruve_ApruvePayment_WebhookController extends Mage_Core_Controller_Front_
|
|
35 |
$data = json_decode($input);
|
36 |
|
37 |
$status = $data->status;
|
38 |
-
$paymentRequestId = $data->payment_request_id;
|
|
|
|
|
39 |
|
40 |
//todo: compare status by rest request
|
41 |
if($status == 'rejected') {
|
42 |
-
if(!$this->_cancelOrder($paymentRequestId)) {
|
43 |
header("HTTP/1.1 404 Not Found");
|
44 |
exit;
|
45 |
};
|
46 |
} elseif($status == 'captured' ) {
|
47 |
-
if(!$this->_addPayed($paymentRequestId)) {
|
48 |
header("HTTP/1.1 404 Not Found");
|
49 |
exit;
|
50 |
};
|
@@ -56,47 +58,56 @@ class Apruve_ApruvePayment_WebhookController extends Mage_Core_Controller_Front_
|
|
56 |
}
|
57 |
|
58 |
|
59 |
-
protected function _addPayed($paymentRequestId)
|
60 |
{
|
|
|
61 |
$transaction = Mage::getModel('sales/order_payment_transaction')->getCollection()
|
62 |
-
->addAttributeToFilter('txn_id', array('eq' => $paymentRequestId))
|
63 |
->getFirstItem();
|
64 |
-
if(
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
$order = $transaction->getOrder();
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
}
|
72 |
}
|
73 |
|
74 |
return false;
|
75 |
}
|
76 |
|
77 |
|
78 |
-
protected function _cancelOrder($paymentRequestId)
|
79 |
{
|
|
|
80 |
$transaction = Mage::getModel('sales/order_payment_transaction')->getCollection()
|
81 |
-
->addAttributeToFilter('txn_id', array('eq' => $paymentRequestId))
|
82 |
->getFirstItem();
|
83 |
-
if(!$transaction->getId()) {
|
84 |
-
|
|
|
|
|
|
|
85 |
}
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
}
|
92 |
-
|
93 |
-
$order->save();
|
94 |
-
|
95 |
-
$payment = $transaction->getOrder()->getPayment();
|
96 |
-
$transaction->setOrderPaymentObject($payment);
|
97 |
-
$transaction->setIsClosed(true);
|
98 |
-
$transaction->save();
|
99 |
-
return true;
|
100 |
}
|
101 |
|
102 |
|
35 |
$data = json_decode($input);
|
36 |
|
37 |
$status = $data->status;
|
38 |
+
$paymentRequestId = $data->payment_request_id;
|
39 |
+
$paymentId = $data->payment_id;
|
40 |
+
Mage::log($data, null, 'webtex.log');
|
41 |
|
42 |
//todo: compare status by rest request
|
43 |
if($status == 'rejected') {
|
44 |
+
if(!$this->_cancelOrder($paymentRequestId, $paymentId)) {
|
45 |
header("HTTP/1.1 404 Not Found");
|
46 |
exit;
|
47 |
};
|
48 |
} elseif($status == 'captured' ) {
|
49 |
+
if(!$this->_addPayed($paymentRequestId, $paymentId)) {
|
50 |
header("HTTP/1.1 404 Not Found");
|
51 |
exit;
|
52 |
};
|
58 |
}
|
59 |
|
60 |
|
61 |
+
protected function _addPayed($paymentRequestId, $paymentId)
|
62 |
{
|
63 |
+
/** @var Mage_Sales_Model_Order_Payment_Transaction $transaction */
|
64 |
$transaction = Mage::getModel('sales/order_payment_transaction')->getCollection()
|
65 |
+
->addAttributeToFilter('txn_id', array('eq' => $paymentRequestId . "_" . $paymentId))
|
66 |
->getFirstItem();
|
67 |
+
if (!$transaction->getId()) {
|
68 |
+
/** @var Mage_Sales_Model_Order_Payment_Transaction $transaction */
|
69 |
+
$transaction = Mage::getModel('sales/order_payment_transaction')->getCollection()
|
70 |
+
->addAttributeToFilter('txn_id', array('eq' => $paymentRequestId))
|
71 |
+
->getFirstItem();
|
72 |
+
}
|
73 |
+
if ($transaction->getId()) {
|
74 |
$order = $transaction->getOrder();
|
75 |
+
/** @var Mage_Sales_Model_Order_Invoice_Api $iApi */
|
76 |
+
$iApi = Mage::getModel('sales/order_invoice_api');
|
77 |
+
$invoiceId = $iApi->create($order->getIncrementId(), array());
|
78 |
+
$iApi->capture($invoiceId);
|
79 |
+
return true;
|
|
|
80 |
}
|
81 |
|
82 |
return false;
|
83 |
}
|
84 |
|
85 |
|
86 |
+
protected function _cancelOrder($paymentRequestId, $paymentId)
|
87 |
{
|
88 |
+
/** @var Mage_Sales_Model_Order_Payment_Transaction $transaction */
|
89 |
$transaction = Mage::getModel('sales/order_payment_transaction')->getCollection()
|
90 |
+
->addAttributeToFilter('txn_id', array('eq' => $paymentRequestId . "_" . $paymentId))
|
91 |
->getFirstItem();
|
92 |
+
if (!$transaction->getId()) {
|
93 |
+
/** @var Mage_Sales_Model_Order_Payment_Transaction $transaction */
|
94 |
+
$transaction = Mage::getModel('sales/order_payment_transaction')->getCollection()
|
95 |
+
->addAttributeToFilter('txn_id', array('eq' => $paymentRequestId))
|
96 |
+
->getFirstItem();
|
97 |
}
|
98 |
+
if ($transaction->getId()) {
|
99 |
+
$payment = $transaction->getOrder()->getPayment();
|
100 |
+
$transaction->setOrderPaymentObject($payment);
|
101 |
+
$transaction->setIsClosed(true);
|
102 |
+
$transaction->save();
|
103 |
+
$order = $transaction->getOrder();
|
104 |
+
if($order && $order->getId() && !$order->isCanceled()) {
|
105 |
+
$order->cancel();
|
106 |
+
$order->save();
|
107 |
+
return true;
|
108 |
+
}
|
109 |
}
|
110 |
+
return false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
111 |
}
|
112 |
|
113 |
|
app/code/community/Apruve/ApruvePayment/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Apruve_ApruvePayment>
|
5 |
-
<version>1.0.
|
6 |
</Apruve_ApruvePayment>
|
7 |
</modules>
|
8 |
<frontend>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Apruve_ApruvePayment>
|
5 |
+
<version>1.0.10</version>
|
6 |
</Apruve_ApruvePayment>
|
7 |
</modules>
|
8 |
<frontend>
|
app/design/frontend/base/default/template/apruvepayment/payment/form.phtml
CHANGED
@@ -22,4 +22,19 @@
|
|
22 |
<div id="payment_form_apruvepayment">
|
23 |
Press continue to review order.
|
24 |
<input type="hidden" id="aprt" value="" name="payment[aprt]"/>
|
25 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
<div id="payment_form_apruvepayment">
|
23 |
Press continue to review order.
|
24 |
<input type="hidden" id="aprt" value="" name="payment[aprt]"/>
|
25 |
+
</div>
|
26 |
+
|
27 |
+
<?php
|
28 |
+
$helper = Mage::helper('apruvepayment');
|
29 |
+
$paymentRequestModel = $helper->getPaymentRequestApiModel();
|
30 |
+
?>
|
31 |
+
|
32 |
+
<script type="text/javascript">
|
33 |
+
$$('label[for=p_method_apruvepayment]')[0].innerHTML += '<div id="apruveDiv" style="display: inline-block; position: absolute; margin-top: -3px; margin-left: 7px;"></div>';
|
34 |
+
var sh = '<?php echo $paymentRequestModel->getSecureHash();?>';
|
35 |
+
var pr = <?php echo $paymentRequestModel->getPaymentRequestJSON();?>;
|
36 |
+
var shopperName = '<?php echo $paymentRequestModel->getShopperInfo('name');?>';
|
37 |
+
var shopperEmail = '<?php echo $paymentRequestModel->getShopperInfo('email');?>';
|
38 |
+
var oApruvePayment = new ApruvePayment(sh, pr, shopperName, shopperEmail);
|
39 |
+
</script>
|
40 |
+
|
app/design/frontend/base/default/template/apruvepayment/payment/mark.phtml
DELETED
@@ -1,35 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Apache License, Version 2.0
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/Apache-2.0
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@apruve.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
-
* @category Apruve
|
16 |
-
* @package Apruve_Payment
|
17 |
-
* @copyright Copyright (coffee) 2014 Apruve, Inc. (http://www.apruve.com).
|
18 |
-
* @license http://opensource.org/licenses/Apache-2.0 Apache License, Version 2.0
|
19 |
-
*/
|
20 |
-
?>
|
21 |
-
|
22 |
-
<?php
|
23 |
-
$helper = Mage::helper('apruvepayment');
|
24 |
-
$paymentRequestModel = $helper->getPaymentRequestApiModel();
|
25 |
-
?>
|
26 |
-
|
27 |
-
<div id="apruveDiv" style="display: inline-block; position: absolute; margin-top: -3px; margin-left: 7px;"></div>
|
28 |
-
|
29 |
-
<script type="test/javascript">
|
30 |
-
var sh = '<?php echo $paymentRequestModel->getSecureHash();?>';
|
31 |
-
var pr = <?php echo $paymentRequestModel->getPaymentRequestJSON();?>;
|
32 |
-
var shopperName = '<?php echo $paymentRequestModel->getShopperInfo('name');?>';
|
33 |
-
var shopperEmail = '<?php echo $paymentRequestModel->getShopperInfo('email');?>';
|
34 |
-
var oApruvePayment = new ApruvePayment(sh, pr, shopperName, shopperEmail);
|
35 |
-
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/Apruve/ApruvePayment.js
CHANGED
@@ -43,7 +43,6 @@ ApruvePayment.prototype = {
|
|
43 |
|
44 |
_resetApruveRadio: function () {
|
45 |
if (!apruve.paymentRequestId) {
|
46 |
-
console.log('works')
|
47 |
document.getElementById("p_method_apruvepayment").checked = false;
|
48 |
document.getElementById("payment_form_apruvepayment").style.display = 'none';
|
49 |
document.getElementById("aprt").value = '';
|
43 |
|
44 |
_resetApruveRadio: function () {
|
45 |
if (!apruve.paymentRequestId) {
|
|
|
46 |
document.getElementById("p_method_apruvepayment").checked = false;
|
47 |
document.getElementById("payment_form_apruvepayment").style.display = 'none';
|
48 |
document.getElementById("aprt").value = '';
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Apruve_B2B_Payment_Gateway</name>
|
4 |
-
<version>1.0.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.apache.org/licenses/LICENSE-2.0">Apache License, 2.0</license>
|
7 |
<channel>community</channel>
|
@@ -9,10 +9,10 @@
|
|
9 |
<summary>Payments designed for business spending. Increase sales and reduce cart abandonment by allowing your shoppers to send purchases directly to their company or client for payment, simply by using an email address instead of a credit card. Learn more and sign up for a free merchant account at http://www.apruve.com.</summary>
|
10 |
<description>Payments designed for business spending. Increase sales and reduce cart abandonment by allowing your shoppers to send purchases directly to their company or client for payment, simply by using an email address instead of a credit card. Learn more and sign up for a free merchant account at http://www.apruve.com.</description>
|
11 |
<notes>Stable Version</notes>
|
12 |
-
<authors><author><name>Apruve</name><user>
|
13 |
-
<date>2015-
|
14 |
-
<time>
|
15 |
-
<contents><target name="magecommunity"><dir name="Apruve"><dir name="ApruvePayment"><dir name="Block"><dir name="Admin"><file name="Webhook.php" hash="339e11982444fd861a8ab3ee78e81f6e"/></dir><dir name="Payment"><file name="Form.php" hash="
|
16 |
<compatible/>
|
17 |
-
<dependencies
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Apruve_B2B_Payment_Gateway</name>
|
4 |
+
<version>1.0.10</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.apache.org/licenses/LICENSE-2.0">Apache License, 2.0</license>
|
7 |
<channel>community</channel>
|
9 |
<summary>Payments designed for business spending. Increase sales and reduce cart abandonment by allowing your shoppers to send purchases directly to their company or client for payment, simply by using an email address instead of a credit card. Learn more and sign up for a free merchant account at http://www.apruve.com.</summary>
|
10 |
<description>Payments designed for business spending. Increase sales and reduce cart abandonment by allowing your shoppers to send purchases directly to their company or client for payment, simply by using an email address instead of a credit card. Learn more and sign up for a free merchant account at http://www.apruve.com.</description>
|
11 |
<notes>Stable Version</notes>
|
12 |
+
<authors><author><name>Apruve</name><user>Apruve</user><email>magento@apruve.com</email></author></authors>
|
13 |
+
<date>2015-09-24</date>
|
14 |
+
<time>14:16:57</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="Apruve"><dir name="ApruvePayment"><dir name="Block"><dir name="Admin"><file name="Webhook.php" hash="339e11982444fd861a8ab3ee78e81f6e"/></dir><dir name="Payment"><file name="Form.php" hash="c84481487b8a831fc382d90c76eeb962"/></dir></dir><dir name="Helper"><file name="Data.php" hash="c9ccc4476aadaa87db245e0ee0e29243"/></dir><file name="LICENSE.txt" hash="9b76dd4b62de4f9840b5d462fcb25e39"/><dir name="Model"><dir name="Api"><file name="Abstract.php" hash="a72657b7fd5a6ec061d73df511ecdb3e"/><file name="PaymentRequest.php" hash="03d01ce2331baa581175cad124ccb8cb"/><file name="Rest.php" hash="862b5c60f01975db7d37ffcea5e53443"/></dir><file name="Mode.php" hash="680b0b1bbcece8ac6d6606b80e4669df"/><dir name="Mysql4"><file name="Setup.php" hash="8b3e5b033dac91b47e59c024e16c04ec"/></dir><file name="PaymentMethod.php" hash="a3584c00f1e8e1bdf063c495dbb462b4"/></dir><dir name="controllers"><file name="WebhookController.php" hash="185f4757d5d289982f55d551d1b4d5ae"/></dir><dir name="etc"><file name="config.xml" hash="6d6201a0656cd00ccadcbc64d4460c82"/><file name="system.xml" hash="b2761cff5a27a724bdd165c816e3f092"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="apruvepayment.xml" hash="a5f41c280270a5fa44212c9d4cfe043a"/></dir><dir name="template"><dir name="apruvepayment"><file name="head.phtml" hash="36809c6a8fa5aad587b03e2107482bdf"/><dir name="payment"><file name="form.phtml" hash="d81bd872b9b6c9808e038a8972b99c94"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Apruve_ApruvePayment.xml" hash="b9d4a9486387dce0b7911d46f1ab81c7"/></dir></target><target name="mage"><dir name="js"><dir name="Apruve"><file name="ApruvePayment.js" hash="a359d9f296b87bf2c2ac3a75bf30b640"/></dir></dir></target></contents>
|
16 |
<compatible/>
|
17 |
+
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
</package>
|