Payments
move to finance and/or BackBone, finance is the singl place to make transactions and BackBone the place to keep a record for everything fron the users like logs and transactions
danger
this is deprecated last update 8/5/2021
Add source /card
*post
http://us-central1-calm-commerce.cloudfunctions.net/api/v1/add_source
Query Parameters
{
"token": "your_token_here"
}
request body
{
"card_number": 5555555555554444,
"exp_month": 11,
"exp_year": 28,
"cvc_number": 496,
"user_email": "example@example.com"
}
post
Set Default Source
https://us-central1-calm-commerce.cloudfunctions.net/api/v1/set_source
note
use this if the user has multiple cards/bank accounts and he wants to change default methods
Request
{
"customer_id": "customer_id",
"source_id": "card/bank id"
}
Delete source
https://us-central1-calm-commerce.cloudfunctions.net/api/v1/delete_source
Request
"customer_id":"customer_id",
"source_id":"card/bank id"
note
This will delete source/card and then return any card/source available in customer account
All Payments
https://us-central1-calm-commerce.cloudfunctions.net/api/v1/charges
use get
This return all payments in database Transfer money from customers to vendors *post
https://us-central1-calm-commerce.cloudfunctions.net/api/v1/transfer_money
Transfer Money
Request
{
"amount": 1500, //int this is what customer pay,
"transfer_amount": 1000, //this is what vendors get
"payment_method": "PSKjCUkrBDPqbYiguwas",
"payment_method_types": "card",
"description": "string",
"receipt_email": "vendor@gmail.com",
"currency": "CAD",
"confirm": true,
// Set to true to attempt to confirm this PaymentIntent immediately
"customer_id": "stripe id ",
"destination": "vendor stripe id",
"sender": "user id in your database",
"receiver": "user id in your database"
}
Refund
https://us-central1-calm-commerce.cloudfunctions.net/api/v1/refund
Request body
{
"payment_id": "string",
"amount": "pass null if you want refund full amount"
}
Finish Auth Flow
post // For vendors (connected account) finish auth after redirect to your page
https://us-central1-calm-commerce.cloudfunctions.net/api/v1/finish_flow
Request
{
"auth_code": "string you will get from stripe url"
}
This will return connected account id Response
{
"id": "ZdTjczDIf8dtl6DnxXGX"
}