Skip to content

Commit

Permalink
Add apple express button
Browse files Browse the repository at this point in the history
added css for the button
added in cart and checkout block
  • Loading branch information
mmaymo committed Oct 10, 2024
1 parent 52d1005 commit 1904d91
Show file tree
Hide file tree
Showing 11 changed files with 236 additions and 199 deletions.
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

0 comments on commit 1904d91

Please sign in to comment.