[#1116] Custom payment processor: POST arguments, invocations

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):

  1. Payment form URL
  2. Rebilling URL
  3. Delete payment method URL
  4. 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?

Thanks!

Dmytro Bondarev wrote:

Hi,

Regarding the data that you will on callbacks:

  1. 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
  1. 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
  1. 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
  1. 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?

Thomas Luzat wrote:

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.

Dmytro Bondarev wrote:

Ok, i see what you mean.
It is better to use Simplybook callbacks.
(In API custom feature you can configure callbacks)

Thomas Luzat wrote:

Thanks for updating the docs in the SDK repository.

JM Kuizon wrote:

Dmytro Bondarev wrote in #note-2:

Hi,

Regarding the data that you will on callbacks:

  1. Payment form URL
    You will receive POST request here from browser with following data:

[…]

  1. 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:

[…]

  1. 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:

[…]

  1. 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.

For more info, regarding our issue, you can check it here: Support #1395: Refund URL not working for custom payment - API - Simplybook.me support for developers

Thank you

Dmytro Bondarev wrote:

Hi, answered in #1395