Recurring Payments
If you want set recurring payments, it’s all the same method when creating a payment link. Just set recurring to yes and send in recurring_duration as Daily, Weekly, Monthly, Quarterly, Half-Yearly or Yearly.
The call back URL you have specified would receive a response when the user has paid for the invoice, cancelled or has failed. We shall send the following as POST to your call back URL;
call_method == recurring
secret == ‘the secret key sent when creating the payment link’
response == paid, cancelled or failed
api-secret-key == we shall send your secret key via the headers
paid:means the user has paid for the subscription
cancelled:means the user has cancelled the subscription, you should further delete or terminate the service.
failed:means the user doesn't have not enough to pay the subscription, you should further delete or terminate the service.
Peerwallet would continue to send those values to your call back URL until it receives a response.
The expected response is; success (json response)
Returning success via json would indicate that your script has received and has acted accordingly based on the response received.
Values your call back URL would receive
VALUE | SAMPLE | DESCRIPTION |
---|---|---|
call_method | recurring | This is a constant value. The call_method will always return the value: recurring |
secret | Hjyr7yGFUttt7 | Here a unique secret key sent when creating the payment link, this unique code is what identifies each link you have created. |
response | paid | Response would include any of the following:paid, cancelled or failed |
api-secret-key | GUYRERT37674876tUY | We shall send you your secret key on Peerwallet to further secure this the authenticity of this call. |
Expected response
VALUE | EXPECTED RESPONSE | DESCRIPTION |
---|---|---|
status | success | You are expected to return success when this has been processed. If no response is returned, Peerwallet would continue to send values to your specified call back URL for the next 5 days. Response should be in Json |