Set up future payments
Supported payment methods
Payment method | Country / Region |
---|---|
Card | Global |
DANA | Indonesia |
Boost | Malaysia |
Touch'n Go | Malaysia |
Alipay | China |
AlipayHK | Hong Kong |
GCash | Philippines |
KakaoPay | South Korea |
Rabbit LINE Pay | Thailand |
TrueMoney | Thailand |
Learn how to Set up payment information and charge them later
1. Create a Customer
{
"email":"testsetup@gmail.com"
}
{
"id": "cus_1704682776109776896",
"object": "customer",
"created": 1695263020000,
"livemode": false,
"address": {},
"email": "testsetup@gmail.com"
}
2. Create a SetupIntent
card
as a payment method with SetupIntent. You can create a Setupintent with payment_method_types = ["card]
{
"customer":"cus_1704682776109776896",
"payment_method_types" : ["card"],
"usage": "off_session",
"return_url":"https://wooshpay.com"
}
{
"id": "seti_1704683221188345856",
"object": "setup_intent",
"created": 1695263126075,
"livemode": false,
"status": "requires_payment_method",
"customer": "cus_1704682776109776896",
"client_secret": "seti_1704683221188345856_secret_0ZrCdUri7enbgZwzRPTPoQXV",
"payment_method_types": [
"card"
],
"payment_method_options": {
"card": {
"request_three_d_secure": "auto",
"setup_future_usage": "off_session"
}
},
"return_url": "https://wooshpay.com"
}
Retrieve the client secret
3. Collect payment details
4. Submit the payment details to Wooshpay
5. Retrieve the payment method attached to the customer
{
"type":"card"
}
6. Charge the saved payment method later
1.
confirm
: If your set it to true
, payment will be confirmed immediately when the paymentintent is created.2.
payment_method
to the ID of the PaymentMethod and Customer
to the ID of the Customer.Create a PaymentIntent
{
"amount": 1000,
"currency": "USD",
"confirm": true,
"off_session":false,
"customer":"cus_1704388704790904832",
"payment_method":"pm_1704478135803707392",
"return_url": "https://wooshpay.com"
}
{
"id": "pi_1704478320244031488",
"object": "payment_intent",
"created": 1695214274000,
"livemode": false,
"currency": "USD",
"amount": 1000,
"status": "succeeded",
"customer": "cus_1704388704790904832",
"client_secret": "pi_1704478320244031488_secret_wqlE0XivPRU1d3zkAaJUir52",
"payment_method_types": [
"card"
],
"confirmation_method": "automatic",
"payment_method_options": {
"card": {
"request_three_d_secure": "auto",
"setup_future_usage": "off_session"
}
},
"return_url": "https://wooshpay.com",
"payment_method": "pm_1704478135803707392",
"amount_received": 1000,
"capture_method": "automatic",
"latest_charge": "ch_1704478320336306176"
}
Modified at 2024-04-11 12:27:42