-
Notifications
You must be signed in to change notification settings - Fork 13
Existing payment methods
If a user already pays or has paid for a Guardian product via credit/debit card or direct debit, then they can be directed to the contribution/supporter plus checkout from within Manage My Account with an option enabled to pay by one of the existing payment methods we have on file for them. These appear in the payment method selector along with the regular card/direct debit/etc options.
If a signed-in user lands on the checkout with a displayExistingPaymentMethods=true
query parameter in the URL, we make a request to Members Data API for any existing payment methods associated with their account. This will return either:
- An empty list- the user has no saved payment methods, so there's nothing to render.
- A list of objects that only include a
paymentType
key, indicating that the payment methods may be out of date or otherwise unusable. We then offer the user the option to re-authenticate, along with the regular payment methods. - A list of objects that include a
paymentType
along with other information, crucially abillingAccountId
which is what enables us to re-use this payment method. These are rendered as potential options in the payment method selector.
If the user selects to pay using an existing payment method, the associated payment method's billingAccountId
is what's sent as payment information in the same way as we might use a Stripe payment_method
or a PayPal baid
.
- These payment methods can be controlled by switches for
ExistingCard
andExistingDirectDebit
. If both are turned off we don't make the request to MDAPI as there's no point; otherwise the switches control whether any existing payment methods will appear in the payment method selector in the same way as other methods. - This function is currently (Nov 2022) very difficult to test.
- Redux Glossary
- Why Redux Toolkit?
- Writing state slices with Redux Toolkit
- Handling action side effects in Redux
- Presentational and Container Components
- Scoped actions and reducers
- Server Side Rendering
- Form validation
- CI build process
- Post deployment testing
- Post deployment test runbook
- TIP Real User Testing
- Code testing and validation
- Visual testing
- Testing Apple Pay locally
- Test Users
- Deploying to CODE
- Automated IT tests
- Deploying Fastly VCL Snippets
- Archived Components
- Authentication
- Switchboard
- How to make a fake contribution
- The epic and banner
- Environments
- Tech stack
- Supported browsers
- Contributions Internationalisation
- Payment method internationalisation in Guardian Weekly
- Print fulfilment/delivery
- Updating the acquisitions model
- Runscope testing
- Scala Steward for dependency management
- Alarm Investigations
- Ticker data