Manage users billing settings.
Show a list of user payment methods
Method | URI | Authentication |
---|---|---|
GET |
/cards |
true |
{success} Example Success Response Code
200
Content
{
"success": true,
"message": "Show payment methods",
"data": [
{
"id": 1,
"user_id": 1,
"stripe_customer_id": "cus_FsQcawWaxlmfbs",
"stripe_card_id": "card_1FMflHD2YnIDoaEIqLthZhO8",
"card_type": "Visa",
"card_last4": "4242",
"exp_month": 12,
"exp_year": 2023,
"default": true,
"created_at": "2020-09-22T13:23:49.000000Z",
"updated_at": "2020-09-22T13:23:49.000000Z"
}
]
}
Show a single user payment method.
Method | URI | Authentication |
---|---|---|
GET |
/card/{id} |
true |
{success} Example Success Response Code
200
Content
{
"success": true,
"message": "Show payment method",
"data": {
"id": 1,
"user_id": 1,
"stripe_customer_id": "cus_FsQcawWaxlmfbs",
"stripe_card_id": "card_1FMflHD2YnIDoaEIqLthZhO8",
"card_type": "Visa",
"card_last4": "4242",
"exp_month": 12,
"exp_year": 2023,
"default": true,
"created_at": "2020-09-22T13:23:49.000000Z",
"updated_at": "2020-09-22T13:23:49.000000Z"
}
}
Save a customers payment details via Stripe
Method | URI | Authentication |
---|---|---|
POST |
/cards |
true |
{success} Example Success Response Code
200
Content
{
"success": true,
"message": "Your card has been saved.",
"data": null
}
Make a payment method the default.
Method | URI | Authentication |
---|---|---|
PATCH |
/card/{id} |
true |
{success} Example Success Response Code
200
Content
{
"success": true,
"message": "Default payment method has been saved.",
"data": null
}
Remove a user payment method.
Method | URI | Authentication |
---|---|---|
DELETE |
/card/{id} |
true |
{success} Example Success Response Code
200
Content
{
"success": true,
"message": "This payment method has been removed.",
"data": null
}