-
Notifications
You must be signed in to change notification settings - Fork 69
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
GrabPay: Add settings page. #10235
base: develop
Are you sure you want to change the base?
GrabPay: Add settings page. #10235
Conversation
Test the buildOption 1. Jetpack Beta
Option 2. Jurassic Ninja - available for logged-in A12s🚀 Launch a JN site with this branch 🚀 ℹ️ Install this Tampermonkey script to get more options. Build info:
Note: the build is updated when a new commit is pushed to this PR. |
Size Change: +554 B (0%) Total Size: 1.36 MB
ℹ️ View Unchanged
|
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.
This all tests well - just a couple notes to clear up before approving.
// Note: If Malaysia support is added to WooPayments in the future, we'll need to not only add MYR here, but also implement | ||
// logic to limit the currency based on the Stripe account country, so SG accounts only accept SGD, and MY accounts only accept MYR. | ||
$this->currencies = [ Currency_Code::SINGAPORE_DOLLAR ]; | ||
$this->stripe_id = self::PAYMENT_METHOD_STRIPE_ID; | ||
$this->is_reusable = false; | ||
$this->is_bnpl = false; | ||
$this->icon_url = plugins_url( 'assets/images/payment-methods/grabpay.svg', WCPAY_PLUGIN_FILE ); | ||
$this->accept_only_domestic_payment = false; | ||
$this->countries = [ Country_Code::SINGAPORE, Country_Code::MALAYSIA ]; |
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.
I see the note about Malaysia support, but I also see that Malaysia was added to the countries list. Should Malaysia be listed here yet?
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.
The countries listed here are the countries where the payment method is available for shoppers. The payment method eligibility for merchants (based on the Stripe account's country) is determined by the server, and that is what I meant in the comment. I'll edit the comment to provide more clarity.
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.
Thanks for the clarification and the updates. 👍
@brettshumaker I made a couple small changes to restrict this payment method to only shoppers in Singapore in the newest commits. This is based on this comment and Stripe docs https://docs.stripe.com/payments/grabpay/accept-a-payment?web-or-mobile=web&payments-ui-type=direct-api#supported-currencies (although my testing in sandbox showed a different behavior, we'll stick with Stripe documentation). |
The failing Playwright test https://github.com/Automattic/woocommerce-payments/actions/runs/13162794210?pr=10235 doesn't seem related to the changes in this PR and it's also failing for other branches https://github.com/Automattic/woocommerce-payments/actions/runs/13163174104?pr=10307 so it shouldn't be a blocker. |
Fixes #10100
Changes proposed in this Pull Request
Adds the required definitions to add GrabPay to the settings page for eligible accounts. The eligibility in the Settings page is based on the data returned by the server, most importantly if fees exist for the Stripe account's country.
This branch is based on the proof of concept PR, so this also contains some code related to checkout. I found unnecessary to revert those changes only to re-apply them in a future PR, as they are pretty minimal. In #10101 we can take care of any specific fixes required in checkout.
Testing instructions
Pre-requisite: Use the
add/grabpay-fees-and-capabilities
branch in your local server. Create the fees in your local database.Regression Testing
Other countries:
npm run changelog
to add a changelog file, choosepatch
to leave it empty if the change is not significant. You can add multiple changelog files in one PR by running this command a few times.Post merge