Skip to content

Commit

Permalink
Squash and merge PIWOO-319
Browse files Browse the repository at this point in the history
This PR adds Apple express button
  • Loading branch information
mmaymo committed Nov 4, 2024
1 parent a282149 commit e5969a9
Show file tree
Hide file tree
Showing 17 changed files with 336 additions and 225 deletions.
Empty file.
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 e5969a9

Please sign in to comment.