[#1203] Not working as expected

Olaf Siebert wrote:

ok, i am currently user getClientList from the admin but this does not return client_hash and getClient does not exist looking in the documentation.

Dmytro Bondarev wrote:

Sorry my bad, getClientInfo.

Olaf Siebert wrote:

Ok, but using the public api with following data:

const data = [
Number(eventId),
Number(unitId),
time[0],
time[1],
{
client_id: client.id,
client_sign: createSignature(client.id, client.client_hash, process.env.SIMPLEBOOKME_API_SECRET),
},
additionalFieldsData,
1
];

is returning an error:

makeBooking {
error: {
code: -32061,
message: ‘Client name value is wrong’,
data: { field: ‘name’ }
},
id: ‘1’,
jsonrpc: ‘2.0’
}

Olaf Siebert wrote:

is ok, this seems to fix it:

const data = [
Number(eventId),
Number(unitId),
time[0],
time[1],
{
client_id: client.id,
client_sign: createSignature(client.id, client.client_hash, process.env.SIMPLEBOOKME_API_SECRET),
name: client.name,
email: client.email,
phone: client.phone,
},
additionalFieldsData,
1
];

Olaf Siebert wrote:

Right, I hope this my final request. I switched booking over to public api now. All works as expected, except the payment confirmation.

Sending the [ ‘120’, ‘stripe’, ‘66a22b760699de1f53e84108156fdf23’ ] to the confirmBookingPayment method returns an error:

{“error”:{“code”:-32000,“message”:“Unexpected error”,“data”:null},“id”:“1”,“jsonrpc”:“2.0”}

with the booking being cancelled soon after later.

Redmine Admin wrote:

hi, there is no way to confirm payments via public API (otherwise clients would always confirm their payments and pay nothing). It is only possible to do via admin API

Olaf Siebert wrote:

Ok, but you only have confirmBookingPayment method listed under the public api. How do I confirm the payment then?

Dmytro Bondarev wrote:

Hi, confirmBookingPayment is deprecated API and unfortunately you can not use it.
You should use
[[API documentation | SimplyBook.me Online Scheduling]]
or
[[API documentation | SimplyBook.me Online Scheduling]]

As suggested above.

Olaf Siebert wrote:

Well, I am getting the same error on confirmInvoice.

confirmInvoice {
error: { code: -32000, message: ‘Unexpected error’, data: null },
id: ‘1’,
jsonrpc: ‘2.0’
}

Dmytro Bondarev wrote:

Please provide parameters that you pass.
Note that you should pass invoice id, not booking id.

Olaf Siebert wrote:

Yes,

params: [
invoiceId,
‘stripe’
]

Dmytro Bondarev wrote:

To investigate your issue please provide invoice id, and company login.

Olaf Siebert wrote:

This one is cancelled now

Invoice Id: 29
SIMPLEBOOKME_COMPANY_LOGIN=myelementalbeing

Thanks

Olaf Siebert wrote:

I just tested it manually and it was working, I need check the stripe webhook. Possible something not quite right.