-
Notifications
You must be signed in to change notification settings - Fork 53
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
mmaymo
wants to merge
15
commits into
develop
Choose a base branch
from
feature/apple-express-PIWOO-319
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
1904d91
Add apple express button
mmaymo 9fae4de
Show selected method in apple window
mmaymo 2dc86db
Show selected method in apple window on load
mmaymo 1f5ff00
Remove log
mmaymo f00a94c
Update tests
mmaymo d0109d5
Fix cs
mmaymo a691410
Handle null shipping rates to prevent errors when they are unavailable
mmaymo 71ff364
Remove empty complete and logs
mmaymo 970d798
Remove empty complete
mmaymo 6be2bf2
Add responsive styling for ApplePay button to adapt based on screen size
mmaymo 962ea04
Prevent default form validation on clicking the button
mmaymo 84e1681
Add new setting for the express button
mmaymo 673d4b9
Show button only if enabled
mmaymo 35f7b10
Fix CS
mmaymo 45f5d84
Remove extra space & refactor variable assignment
mmaymo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,21 +49,24 @@ import ApplePayButtonComponent from './blocks/ApplePayButtonComponent' | |
gatewayData.forEach(item => { | ||
let register = () => registerPaymentMethod(molliePaymentMethod(useEffect, ajaxUrl, filters, gatewayData, availableGateways, item, jQuery, requiredFields, isCompanyFieldVisible, isPhoneFieldVisible)); | ||
if (item.name === 'mollie_wc_gateway_applepay' && !isBlockEditor) { | ||
const isExpressEnabled = item.isExpressEnabled; | ||
if ((isAppleSession && window.ApplePaySession.canMakePayments())) { | ||
register(); | ||
if (isExpressEnabled !== true) { | ||
return; | ||
} | ||
const {registerExpressPaymentMethod} = wc.wcBlocksRegistry; | ||
registerExpressPaymentMethod({ | ||
name: 'mollie_wc_gateway_applepay_express', | ||
content: <ApplePayButtonComponent />, | ||
edit: <ApplePayButtonComponent />, | ||
content: < ApplePayButtonComponent />, | ||
edit: < ApplePayButtonComponent />, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This extra space can cause problems. Do these components still work? |
||
ariaLabel: 'Apple Pay', | ||
canMakePayment: () => true, | ||
paymentMethodId: 'mollie_wc_gateway_applepay', | ||
supports: { | ||
features: ['products'], | ||
}, | ||
}) | ||
|
||
} | ||
return; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If a new variable has the same name as the object property, you can do just that:
const {isExpressEnabled} = item;