-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add FireCheckout support * Remove unnecessary variables
- Loading branch information
Showing
6 changed files
with
103 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
app/design/frontend/base/default/template/razorpay/extensions/firecheckout/payments.phtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<?php $helper = Mage::helper('razorpay_payments'); ?> | ||
<?php if ($helper->isRazorpayEnabled()) : ?> | ||
<?php $code = Razorpay_Payments_Model_Paymentmethod::METHOD_CODE ; ?> | ||
<script type="text/javascript"> | ||
var formId = 'firecheckout-form'; | ||
var paymentIdField = 'razorpay_payment_id'; | ||
var nativeButton = $$('#review-buttons-container .btn-checkout').first(); | ||
|
||
// Change native extension place order button onclick | ||
nativeButton.setAttribute('onclick', 'processRazorpayOrder()'); | ||
|
||
// Click extension "place order" button | ||
var processNativeExtensionOrder = function(){ | ||
nativeButton.show(); | ||
|
||
checkout.save(); | ||
}; | ||
|
||
var showErrorMessage = function(message){ | ||
alert(message); | ||
|
||
nativeButton.show(); | ||
}; | ||
|
||
var processRazorpayOrder = function() { | ||
if (payment.currentMethod == '<?php echo $code ?>') { | ||
|
||
if (razorpayUtils.isOrderSet()) { | ||
placeRazorpayOrder(); | ||
} else { | ||
razorpayUtils.createOrder(placeRazorpayOrder, showErrorMessage); | ||
} | ||
} else { | ||
processNativeExtensionOrder(); | ||
} | ||
}; | ||
|
||
var placeRazorpayOrder = function() { | ||
var onUserClose = function() { | ||
nativeButton.disabled = false; | ||
nativeButton.show(); | ||
}; | ||
|
||
var onSuccess = function(data) { | ||
$(paymentIdField).value = data.razorpay_payment_id; | ||
|
||
processNativeExtensionOrder(); | ||
}; | ||
|
||
var beforeStart = function() { | ||
nativeButton.disabled = true; | ||
}; | ||
|
||
razorpayUtils.placeOrder( | ||
onSuccess, | ||
onUserClose, | ||
beforeStart, | ||
formId, | ||
paymentIdField | ||
); | ||
}; | ||
</script> | ||
<?php endif; ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<?xml version="1.0"?> | ||
<package> | ||
<name>Razorpay_Payments</name> | ||
<version>0.2.1</version> | ||
<version>0.2.2</version> | ||
<stability>beta</stability> | ||
<license>MIT</license> | ||
<channel>community</channel> | ||
|
@@ -16,8 +16,8 @@ | |
<email>[email protected]</email> | ||
</author> | ||
</authors> | ||
<date>2016-04-09</date> | ||
<time>17:36:04</time> | ||
<date>2016-04-13</date> | ||
<time>06:34:34</time> | ||
<contents> | ||
<target name="magecommunity"> | ||
<dir name="Razorpay"> | ||
|
@@ -30,13 +30,13 @@ | |
<file hash="3eb01c681f348c86a4ec3c7dc7855439" name="Data.php"/> | ||
</dir> | ||
<dir name="Model"> | ||
<file hash="0fbad0dbec0c8dcf1d597a4a3d15b1c7" name="Paymentmethod.php"/> | ||
<file hash="894e998fb9cdc2da005e418240ad4e65" name="Paymentmethod.php"/> | ||
</dir> | ||
<dir name="controllers"> | ||
<file hash="e50ee030f720f26ef439a1dc6b8c66f8" name="CheckoutController.php"/> | ||
</dir> | ||
<dir name="etc"> | ||
<file hash="2686b409f17d4c9466fa0efc7f8d00b3" name="config.xml"/> | ||
<file hash="ac5ef3a3615dcd41b4fea208aec70276" name="config.xml"/> | ||
<file hash="890c3193ccf85870cb0bd25f31ddf076" name="system.xml"/> | ||
</dir> | ||
</dir> | ||
|
@@ -47,13 +47,16 @@ | |
<dir name="base"> | ||
<dir name="default"> | ||
<dir name="layout"> | ||
<file hash="c0098eef0d3e3571a97834c9cdfd90d5" name="razorpay.xml"/> | ||
<file hash="38102684ebb4f6d3896b724632d39171" name="razorpay.xml"/> | ||
</dir> | ||
<dir name="template"> | ||
<dir name="razorpay"> | ||
<dir name="extensions"> | ||
<dir name="firecheckout"> | ||
<file hash="b792a741e5e8839202e93e6b9442b58b" name="payments.phtml"/> | ||
</dir> | ||
<dir name="iwd_opc"> | ||
<file hash="b5525d043934d55eda8bfb90a89efcd9" name="payments.phtml"/> | ||
<file hash="48fec536ebfee1dbe0c48c208f41b5c8" name="payments.phtml"/> | ||
</dir> | ||
</dir> | ||
<file hash="1493e996886160b37b930251f7ac78ce" name="order.phtml"/> | ||
|