Save CC (1009)
Title
Saved Credit Card feature
Description / Background
Currently on our platform, we still don’t have a "Save Credit Card" feature. Compared with other reservation platforms, each time, the user must input his credit/debit card details again to complete the booking/order process.
Objectives
User can save credits card 2 places
- On the profile page via payment methods
- user can: add a new credit or debit card;
- can set which credit or debit card to be primary;
- can delete an unwanted card.
- On the payment page
- user can add a new credit or debit card and choose which card will be used for this booking.
- If a user adds a new card on this page, they can decide
- if this new card is to be primary or not. And when this user needs to be pre-paid again next time, he can set this card to be primary. He’s not supposed to add the credit card details again because it’s already defaulted.
Scope
Available on all platforms. Add save credit card feature on 2 places which are on profile page & on payment page. To reduce user journey time.
Sequence Diagram / Flow
ERD
[
drive.google.com
https://drive.google.com/file/d/1apckEqN4jYIUr6xsXCRcxsBeF4KLa6_L/view
](https://drive.google.com/file/d/1apckEqN4jYIUr6xsXCRcxsBeF4KLa6_L/view)
DB Schema / Database Migration
| Column Name | Table Name | Data Type | Description |
|---|---|---|---|
| is_primary | externals_gb_primepay_cards | boolean | Add this column, mark the cc as primary |
| card_location | externals_gb_primepay_cards | string | |
| card_type | externals_gb_primepay_cards | string | |
| gb_primepay_card_id | Externals_omise_sources | integer |
API Blueprint
| Path | URL | Description | payload | |
|---|---|---|---|---|
| GET | /users/{user_id}/credit_cards.json | Get credit card list | { "access_token": "0aqu4-ue6swEUPN_E_VwMIooenkuHaKCs4kBFXlzF_U" } | |
| GET | /users/{user_id}/credit_cards/{credit_card_id}.json | Get 1 credit card | { "access_token": "0aqu4-ue6swEUPN_E_VwMIooenkuHaKCs4kBFXlzF_U" } | |
| POST | /users/{user_id}/credit_cards.json | { "access_token": "0aqu4-ue6swEUPN_E_VwMIooenkuHaKCs4kBFXlzF_U", "card": { "token": "2987f087-f40b-457b-97d1-0119a97a7794", "number": "1111XXXXXXXX5555", "last_digits": "4444", "name": "Card Holder", "expiration_month": "01", "expiration_year": "25", "is_primary": false, "card_locations": "Indonesia", "card_type": "VIS" } } | ||
| PATCH | /users/{user_id}/credit_cards/{credit_card_id}.json | { "access_token": "0aqu4-ue6swEUPN_E_VwMIooenkuHaKCs4kBFXlzF_U", "card": { "token": "2987f087-f40b-457b-97d1-0119a97a7794", "number": "1111XXXXXXXX4422", "last_digits": "4444", "name": "Card Holder", "expiration_month": "01", "expiration_year": "25", "is_primary": false, "card_locations": "Indonesia", "card_type": "VIS" } } | ||
| DEL | /users/{user_id}/credit_cards/{credit_card_id}.json | { "access_token": "0aqu4-ue6swEUPN_E_VwMIooenkuHaKCs4kBFXlzF_U" } | ||
| POST | /reservations.json | ada perubahan payload ketika member menggunakan CC yang telah di save "gb_primepay_card": { "hungryhub_card_id": {externals_gb_primepay_cards_id} }, | "omise_payment_type": "cc", "gb_primepay_card": { "hungryhub_card_id": "2605" }, | |
Notes, Constraint & Assumptions
TODO List / Action Items
References
Change History
| NO | Date Time | What Chaged | Description |
|---|---|---|---|
| 1 | 3 Oct 2022 14:30 | - | Initiate Document |
| 2 |