Skip to content

Commit

Permalink
2.1/bug fix (#21)
Browse files Browse the repository at this point in the history
* [magento-2.1] Remove place order function and use native fn

* Fix response data scope
  • Loading branch information
73SL4 authored Aug 16, 2016
1 parent daefa0c commit 59380ef
Showing 1 changed file with 4 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,10 @@ define(
key: self.getKeyId(),
name: self.getMerchantName(),
amount: data.amount,
handler: self.placeOrder.bind(this),
handler: function (data) {
self.rzp_response = data;
self.placeOrder(data);
},
order_id: data.rzp_order,
modal: {
ondismiss: function() {
Expand All @@ -173,28 +176,6 @@ define(
this.rzp.open();
},

placeOrder: function (data, event) {
var self = this,
placeOrder;

this.rzp_response = data;

if (event) {
event.preventDefault();
}

if (this.validate() && additionalValidators.validate()) {
this.isPlaceOrderActionAllowed(false);
placeOrder = placeOrderAction(this.getData(), this.redirectAfterPlaceOrder, this.messageContainer);

$.when(placeOrder).fail(function () {
self.isPlaceOrderActionAllowed(true);
}).done(this.afterPlaceOrder.bind(this));
return true;
}
return false;
},

getData: function() {
return {
"method": this.item.method,
Expand Down

0 comments on commit 59380ef

Please sign in to comment.