Authorize and capture
Separate payment authorization and capture to create a charge now, but capture funds later.
Tell wooshpay to authorize only
manual
when creating the PaymentIntent.{
"amount": 100000,
"currency": "USD",
"confirm": true,
"payment_method_data": {
"type": "card",
"card": {
"exp_month": "**",
"exp_year": "****",
"number": "5204*******01011",
"cvc": "***",
"name": "John Wick"
}
},
"merchant_order_id": "Order112344343",
"capture_method": "manual",
"return_url": "https://wooshpay.com"
}
{
"id": "pi_1693466278934609920",
"object": "payment_intent",
"created": 1692588799000,
"livemode": false,
"currency": "USD",
"amount": 100000,
"status": "requires_action",
"merchant_order_id": "Order112344343",
"client_secret": "pi_1693466278934609920_secret_xjsfriry3X8stv3ROmynz0kz",
"next_action": {
"type": "challenge_redirect",
"challenge_redirect": {
"url": "https://jstest.wooshpay.com/v1/3ds/index.html?c=3.1&type=challenge&dataId=pi_1693466278934609920&force3ds=false&k1=cGtfdGVzdF9OVEUyTmpnMU1EZ3dORFV6T1RZNE1EYzJPREF4T205T2EzcGpOMDQzVTJkWVdFODRWVmhHWm1GNGNUaHZUVEUyT0RZMk16Z3lPVFl6TWpV&clientSecret=pi_1693466278934609920_secret_xjsfriry3X8stv3ROmynz0kz",
"return_url": "https://wooshpay.com"
}
},
"payment_method_types": [
"card"
],
"confirmation_method": "automatic",
"payment_method_options": {
"card": {
"request_three_d_secure": "auto",
}
},
"return_url": "https://wooshpay.com",
"payment_method": "pm_1693466278808780800",
"capture_method": "manual"
}
Capture the funds
status
transitions to requires_capture
. To capture the authorized funds, make the Wooshpay PaymentIntent capture request.amount_to_capture
option. Partially capturing will automatically releases the remaining amount.{
"amount_to_capture":8000
}
{
"id": "pi_1694233070128857088",
"object": "payment_intent",
"created": 1692771616000,
"livemode": false,
"currency": "USD",
"amount": 100000,
"status": "succeeded",
"merchant_order_id": "Order112344343",
"client_secret": "pi_1694233070128857088_secret_NsqzB1sC1nS8DZo7mn6wpoXn",
"payment_method_types": [
"card"
],
"confirmation_method": "automatic",
"payment_method_options": {
"card": {
"request_three_d_secure": "auto"
}
},
"amount_capturable": 92000,
"return_url": "https://wooshpay.com",
"payment_method": "pm_1694233069961084928",
"amount_received": 8000,
"capture_method": "manual",
"latest_charge": "ch_1694233070229520384"
}
payment_intent.amount_capturable_updated
event. And you can see the total amount that you can capture by amount_capturable
of PaymentIntent.Cancel the authorization
Modified at 2023-08-23 06:24:03