Getting a token for recurring payments via FPS without charging
To get a token for recurring payments via FPS without charging, you need to complete all the standard steps required to make a payment via FPS.
When sending a session/start/payment or session/init/payment request, specify "type": "faster_payment_system_binding" and "recurrent": true.
In the amount_details object specify 1 kopeck (the amount will not be charged).
The payment_finished webhook will return a token for recurring payments.
Request example
curl -X POST \
https://demo.smart-glocal.com/api/v2/session/init/payment \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
"payment_details": {
"type": "faster_payment_system_binding"
},
"amount_details": {
"amount": 1,
"currency": "rub"
},
"customer": {
"reference": "lucky"
},
"payment_options": {
"recurrent": true
}
}'
Once you have a token, accept recurring payments in a standard way.
Request example
curl -X POST \
https://demo.smart-glocal.com/api/v2/session/init/payment \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
"payment_details": {
"type": "recurrent",
"recurrent": {
"token": "e9876f32bcd947f79c324cf2da5726304a894f6ae2037de7705fdb3e0a134d48"
}
},
"amount_details": {
"amount": 10000,
"currency": "rub"
},
"customer": {
"reference": "lucky"
}
}'