Migrated from Redmine #1245 | Author: Gym Master Status: Feedback | Priority: High, I’m very impatient | Created: 2024-06-21
Hi, I have 2 questions regarding the API:
I want to use book function from public service. Is it possible to pass client id so that it doesn’t create a new client everytime? OR, if I can only use the book function from admin service to pass the client id, is it possible to make it not auto confirmed so then I can proceed to create/get invoice and let the user pay the the invoice first.
I want to use getBookingCart to let the user to book for multiple booking. AFAIK, if I use getBookingDetails(bookingId, sign) of a booking, I get the invoice_id and continue to payment flow. Is it possible to get invoice_id from a cart? how? if it isn’t possible, should I create invoice in my system myself and process the payment myself (without using SBPay)? or there’s another way to keep using SBPay?
I want to use book function from public service. Is it possible to pass client id so that it doesn’t create a new client everytime? OR, if I can only use the book function from admin service to pass the client id, is it possible to make it not auto confirmed so then I can proceed to create/get invoice and let the user pay the the invoice first.
I want to use getBookingCart to let the user to book for multiple booking. AFAIK, if I use getBookingDetails(bookingId, sign) of a booking, I get the invoice_id and continue to payment flow. Is it possible to get invoice_id from a cart? how? if it isn’t possible, should I create invoice in my system myself and process the payment myself (without using SBPay)? or there’s another way to keep using SBPay?
Another question: The getClientBookings($clientId, $sign, $filter) function, need sign param, in the documentation, the sign param is generated using md5(bookingId, bookingHash, secretKey), this is weird, how can I know the booking id and hash while I don’t have the booking list yet?
yes you can. In $clientData you can pass client_id and client_sign , where client_sign is md5(clientId + clientHash + secretKey).
clientHash you can receive after first booking or when you create client, get client info, etc.
Unfortunately this method is deprecated. Please pass handle_invoice: true in $additional and you will receive invoice object if payment is required.
It is not possible at the moment.
Yes it is ok.
One more question, how to pass product ids to the public service book function?
You can pass it in $additional parameter as products: [{id: 1, qty: 1}, …]
Another question: The getClientBookings($clientId, $sign, $filter) function, need sign param, in the documentation, the sign param is generated using md5(bookingId, bookingHash, secretKey), this is weird, how can I know the booking id and hash while I don’t have the booking list yet?
this is client signature the same as above.
So, you said that getBookingCart is deprecated, but I still can use it by passing handle_invoice param. Is there any plan to remove getBookingCart? What is the replacement of this function that’s more future proof? What’s the difference between cart vs batch?
Hi, I tried to call the public service book function with additional value client_id and client_sign, but I got error “-32061 Client name value is wrong”. I tried providing the name, email, and phone, but it still creating a new client. Is there anything I missed?