File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
app/code/Magento/InstantPurchase
view/frontend/web/js/view Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,8 @@ public function getJsLayout(): string
42
42
{
43
43
$ buttonText = $ this ->instantPurchaseConfig ->getButtonText ();
44
44
$ this ->jsLayout ['components ' ]['instant-purchase ' ]['config ' ]['buttonText ' ] = $ buttonText ;
45
+ $ this ->jsLayout ['components ' ]['instant-purchase ' ]['config ' ]['purchaseUrl ' ] =
46
+ $ this ->getUrl ('instantpurchase/button/placeOrder ' , ['_secure ' => true ]);
45
47
46
48
return parent ::getJsLayout ();
47
49
}
Original file line number Diff line number Diff line change @@ -30,7 +30,8 @@ define(
30
30
currentShipping : ko . observable ( null ) ,
31
31
defaults : {
32
32
template : 'Magento_InstantPurchase/instant-purchase' ,
33
- buttonText : $ . mage . __ ( 'Instant Purchase' )
33
+ buttonText : $ . mage . __ ( 'Instant Purchase' ) ,
34
+ purchaseUrl : urlBuilder . build ( 'instantpurchase/button/placeOrder' )
34
35
} ,
35
36
options : {
36
37
message : $ . mage . __ ( 'Are you sure you want to place order and pay?' ) ,
@@ -124,7 +125,7 @@ define(
124
125
/** @inheritdoc */
125
126
confirm : function ( ) {
126
127
$ . ajax ( {
127
- url : urlBuilder . build ( 'instantpurchase/button/placeOrder' ) ,
128
+ url : self . purchaseUrl ,
128
129
data : form . serialize ( ) ,
129
130
type : 'post' ,
130
131
dataType : 'json' ,
You can’t perform that action at this time.
0 commit comments