Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/apple express piwoo 319 #949

Open
wants to merge 15 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions inc/settings/mollie_applepay_settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,14 @@
'value' => isset($applePayOption['mollie_apple_pay_button_enabled_product']) ? $applePayOption['mollie_apple_pay_button_enabled_product'] : 'no',

],
[
'id' => 'mollie_apple_pay_button_enabled_express_checkout',
'title' => __('Enable Apple Pay Express Button on Checkout page', 'mollie-payments-for-woocommerce'),
'desc' => __('Enable the Apple Pay direct buy button on the Express Buttons section of the Checkout page', 'mollie-payments-for-woocommerce'),
'type' => 'checkbox',
'default' => 'no',
'value' => isset($applePayOption['mollie_apple_pay_button_enabled_express_checkout']) ? $applePayOption['mollie_apple_pay_button_enabled_express_checkout'] : 'no',
],
[
'id' => $pluginName . '_' . 'sectionend',
'type' => 'sectionend',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"webpack": "^5.89.0"
},
"scripts": {
"watch": "webpack --watch",
"watch": "BASE_PATH=. node_modules/.bin/encore dev --watch",
"build": "BASE_PATH=. node_modules/.bin/encore dev",
"setup": "gulp setup",
"e2e-activation": "npx playwright test --project=activation",
Expand Down
30 changes: 30 additions & 0 deletions resources/js/applepayButtonBlock.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import {ApplePayButtonComponent} from "./blocks/ApplePayButtonComponent";

(
function ({mollieApplePayBlockDataCart}) {
if (mollieApplePayBlockDataCart.length === 0) {
return
}
const {ApplePaySession} = window;
if (!(ApplePaySession && ApplePaySession.canMakePayments())) {
return null;
}

const {registerExpressPaymentMethod} = wc.wcBlocksRegistry;

registerExpressPaymentMethod({
name: 'mollie_wc_gateway_applepay_express',
content: < ApplePayButtonComponent/>,
edit: < ApplePayButtonComponent/>,
ariaLabel: 'Apple Pay',
canMakePayment: () => true,
paymentMethodId: 'mollie_wc_gateway_applepay',
supports: {
features: ['products'],
},
});
}
)
(
window
)
194 changes: 0 additions & 194 deletions resources/js/applepayButtonBlockComponent.js

This file was deleted.

Loading
Loading