Skip to content

Commit 2818d80

Browse files
author
Jan Polak
committed
Using secure url for instant purchase
1 parent 019191a commit 2818d80

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

app/code/Magento/InstantPurchase/Block/Button.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ public function getJsLayout(): string
4242
{
4343
$buttonText = $this->instantPurchaseConfig->getButtonText();
4444
$this->jsLayout['components']['instant-purchase']['config']['buttonText'] = $buttonText;
45+
$this->jsLayout['components']['instant-purchase']['config']['purchaseUrl'] =
46+
$this->getUrl('instantpurchase/button/placeOrder', ['_secure' => true]);
4547

4648
return parent::getJsLayout();
4749
}

app/code/Magento/InstantPurchase/view/frontend/web/js/view/instant-purchase.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ define(
3030
currentShipping: ko.observable(null),
3131
defaults: {
3232
template: 'Magento_InstantPurchase/instant-purchase',
33-
buttonText: $.mage.__('Instant Purchase')
33+
buttonText: $.mage.__('Instant Purchase'),
34+
purchaseUrl: urlBuilder.build('instantpurchase/button/placeOrder')
3435
},
3536
options: {
3637
message: $.mage.__('Are you sure you want to place order and pay?'),
@@ -124,7 +125,7 @@ define(
124125
/** @inheritdoc */
125126
confirm: function () {
126127
$.ajax({
127-
url: urlBuilder.build('instantpurchase/button/placeOrder'),
128+
url: self.purchaseUrl,
128129
data: form.serialize(),
129130
type: 'post',
130131
dataType: 'json',

0 commit comments

Comments
 (0)