diff --git a/Gateway/Validator/ResponseValidator.php b/Gateway/Validator/ResponseValidator.php index 2a52c884..8b376e08 100755 --- a/Gateway/Validator/ResponseValidator.php +++ b/Gateway/Validator/ResponseValidator.php @@ -29,7 +29,13 @@ static function ($response) { && isset($response->transaction) && in_array( $response->transaction->status, - [Transaction::AUTHORIZED, Transaction::SUBMITTED_FOR_SETTLEMENT, Transaction::SETTLING, Transaction::SETTLEMENT_PENDING] + [ + Transaction::AUTHORIZED, + Transaction::SUBMITTED_FOR_SETTLEMENT, + Transaction::SETTLING, + Transaction::SETTLEMENT_PENDING + ], + true ), [__('Wrong transaction status')] ]; diff --git a/view/adminhtml/templates/payment/script.phtml b/view/adminhtml/templates/payment/script.phtml index a542bd7d..71b76bd2 100755 --- a/view/adminhtml/templates/payment/script.phtml +++ b/view/adminhtml/templates/payment/script.phtml @@ -20,7 +20,7 @@ $code = $block->escapeHtml($block->getCode()); ], function(Braintree, $) { let config = getPaymentConfig() ?>, payment, - form = $('#payment_form_escapeJs($code) ?>'); + form = $('#payment_form_'); config.active = form.length > 0 && !form.is(':hidden'); payment = new Braintree(config); diff --git a/view/adminhtml/web/js/braintree.js b/view/adminhtml/web/js/braintree.js index 17e51eea..6075a40e 100755 --- a/view/adminhtml/web/js/braintree.js +++ b/view/adminhtml/web/js/braintree.js @@ -234,7 +234,7 @@ define([ * Place order */ placeOrder: function () { - $('#' + this.container).find('[type="submit"]').trigger('click'); + $('#' + this.selector).trigger('realOrder'); }, /** @@ -312,7 +312,7 @@ define([ } } else { this.setPaymentDetails(payload.nonce); - this.placeOrder(); + $('#' + this.container).find('[type="submit"]').trigger('click'); } }.bind(this)); }