Skip to content

Commit 74b5eb9

Browse files
committed
MAGETWO-48372: Billing Agreement popup doesn't appear on product page after clicking on Checkout with Express button
1 parent 5c1e56a commit 74b5eb9

File tree

2 files changed

+19
-8
lines changed

2 files changed

+19
-8
lines changed

app/code/Magento/Paypal/CustomerData/BillingAgreement.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class BillingAgreement implements SectionSourceInterface
6262
* @param ConfigFactory $paypalConfigFactory
6363
* @param UrlInterface $urlBuilder
6464
* @param Escaper $escaper
65-
* @param $startAction
65+
* @param string $startAction
6666
*/
6767
public function __construct(
6868
CurrentCustomer $currentCustomer,

app/code/Magento/Paypal/view/frontend/web/js/in-context/billing-agreement.js

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
*/
55
define([
66
'jquery',
7+
'Magento_Ui/js/modal/confirm',
78
'Magento_Customer/js/customer-data'
8-
], function ($, customerData) {
9+
], function ($, confirm, customerData) {
910
'use strict';
1011

1112
$.widget('mage.billingAgreement', {
@@ -21,17 +22,27 @@ define([
2122
* @private
2223
*/
2324
_create: function () {
25+
var self = this;
26+
2427
if (this.options.invalidateOnCreate) {
2528
this.invalidate();
2629
}
27-
$(this.options.cancelButtonSelector).on('click', $.proxy(function () {
28-
if (confirm(this.options.cancelMessage)) {
29-
this.invalidate();
30-
window.location.href = this.options.cancelUrl;
31-
}
30+
this.element.on('click', function () {
31+
confirm({
32+
content: self.options.cancelMessage,
33+
actions: {
34+
/**
35+
* 'Confirm' action handler.
36+
*/
37+
confirm: function () {
38+
self.invalidate();
39+
window.location.href = self.options.cancelUrl;
40+
}
41+
}
42+
});
3243

3344
return false;
34-
}, this));
45+
});
3546
},
3647

3748
/**

0 commit comments

Comments
 (0)