Update Payment Method
Use the Update Payment Method screen to collect new card details when the current payment method requires an update.
This screen includes:
| # | Element | Description |
|---|---|---|
| 1 | Screen title | Displays Update payment details |
| 2 | Payment instructions | Requests new payment details |
| 3 | Card fields | Collect card number, expiration date, and security code |
| 4 | Country field | Selects the cardholder country |
| 5 | Continue action | Submits the payment details |
Workflow
- Open the Update payment details screen.
- Enter the card details.
- Select the cardholder country.
- Select Provide payment details and continue.
- Submit the payment method.
- Continue the payment flow after a successful update.
Validations
| Scenario | App behavior | SDK output |
|---|---|---|
| Card number is missing or invalid | Display a field error | error = invalid_card_number |
| Expiration date is missing or invalid | Display a field error | error = invalid_expiration_date |
| Security code is missing or invalid | Display a field error | error = invalid_security_code |
| Country is not selected | Block submission | error = country_required |
| Payment details are valid | Enable submission | state = valid |
| Payment update fails | Display a payment error | state = error |
Actions
| Scenario | App behavior | SDK output |
|---|---|---|
| Card details entered | Update the form state | Input update |
| Country selected | Update the country value | country = updated |
| Continue selected | Submit the payment details | PATCH request |
| Update succeeds | Continue the payment flow | state = success |
| Update fails | Preserve the entered details | state = error |
Endpoint Resources
Update Payment Method
PUT
v3/payment-method
Returns the screen that collects updated payment details.
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
appointment-id | Query | Integer | No | Identifies the appointment associated with the payment update |
Confirm Payment Method
PATCH
v3/payment-method
Attaches the updated payment method to the user account and appointment.