Migrated from Redmine #1116 | Author: Thomas Luzat Status: Feedback | Priority: Normal | Created: 2023-10-05
I am looking into building a custom payment processor. There are a number of callback methods available (screenshot):
Payment form URL
Rebilling URL
Delete payment method URL
Refund URL
My questions:
a) Which data do the URLs receive? Is there any documentation? For payment form (1.) I found the SDK sample:
… but it’s not clear whether any more data might be available and there seem to be no docs for the other methods.
b) Will the refund URL be called when a paid transaction is cancelled?
c) Will the rebilling URL only be called for recurring payments (subscriptions?)?
d) I need to invoke an additional method after a booked service has started or ended to give the external payment processor a confirmation. Is there any method/callback or do I need to iterate all bookings and check myself?
Payment form URL
You will receive POST request here from browser with following data:
order_id - Order id in SBPay
amount - Amount
currency - Currency
customer_id - Customer reference id
save_payment_method - 1 if customer selected to store payment method/0 if customer selected to not store payment method
recurring_period_type - Recurring period type for recurring payments only (year/month/week/day)
recurring_period - Recurring period for recurring payments only (number)
return_url - Return URL (you should redirect customer here after payment)
cancel_url - Cancel URL (you should redirect customer here if customer cancels payment)
timestamp - Time stamp of request (to validate signature)
algo - Algorithm of signature
signature - Signature for request
Rebilling URL. You will receive HTTP request from our servers, when we need to charge customer again (when he selected to pay with Vaulted payment method or when it is time to charge recurring payment) with following data:
order_id - Order id in SBPay
amount - Amount
currency - Currency
customer_id - Customer reference id
payment_method_reference_id - Payment method reference id (You should pass it durring confirm initial payment)
timestamp - Time stamp of request (to validate signature)
algo - Algorithm of signature
signature - Signature to validate request
Delete payment method URL. You will receive HTTP request from our servers, when customer decided to delete Vaulted payment method (remove card, etc.) with following data:
customer_id - Customer reference id
payment_method_reference_id - Payment method reference id (You should pass it durring confirm initial payment)
timestamp - Time stamp of request (to validate signature)
algo - Algorithm of signature
signature - Signature to validate request
Refund URL. You will receive HTTP request from our servers, when user of SBPay (SimplyBook) makes refund. You will receive following data:
order_id - Order id in SBPay
amount - Amount
transaction_id - Transaction ID of payment (you should pass it during payment confirmation)
currency - Currency
timestamp - Time stamp of request (to validate signature)
algo - Algorithm of signature
signature - Signature trequest
b) Will the refund URL be called when a paid transaction is cancelled?
No, only when user initiate Refund.
c) Will the rebilling URL only be called for recurring payments (subscriptions?)?
Yes
d) I need to invoke an additional method after a booked service has started or ended to give the external payment processor a confirmation. Is there any method/callback or do I need to iterate all bookings and check myself?
Sorry, i didn’t understand your question, could you please clarify what you mean?
Thanks for the extensive information. Is there any page or place within the SDK where the parameters could have been found? Maybe I am missing something.
d) I need to invoke an additional method after a booked service has started or ended to give the external payment processor a confirmation. Is there any method/callback or do I need to iterate all bookings and check myself?
Sorry, i didn’t understand your question, could you please clarify what you mean?
This is actually not directly related to SimplyBook’s payment integration, but I need to notify the 3rd-party-payment provider when the booked event has actually completed so that the provider can clear the payment.
I couldn’t find a callback for when this happens, so I guess I will need to iterate the bookings (GET https://user-api-v2.simplybook.me/admin/bookings?filter[date]=…) once or twice a day and check myself which ones I need to forward to the payment provider.
Payment form URL
You will receive POST request here from browser with following data:
[…]
Rebilling URL. You will receive HTTP request from our servers, when we need to charge customer again (when he selected to pay with Vaulted payment method or when it is time to charge recurring payment) with following data:
[…]
Delete payment method URL. You will receive HTTP request from our servers, when customer decided to delete Vaulted payment method (remove card, etc.) with following data:
[…]
Refund URL. You will receive HTTP request from our servers, when user of SBPay (SimplyBook) makes refund. You will receive following data:
[…]
b) Will the refund URL be called when a paid transaction is cancelled?
No, only when user initiate Refund.
c) Will the rebilling URL only be called for recurring payments (subscriptions?)?
Yes
d) I need to invoke an additional method after a booked service has started or ended to give the external payment processor a confirmation. Is there any method/callback or do I need to iterate all bookings and check myself?
Sorry, i didn’t understand your question, could you please clarify what you mean?
I added a Refund URL, but it is not being called when I (as an admin) initiated the refund.