[#203] ConfirmBookingBatch

Migrated from Redmine #203 | Author: Karl Oskar Andersen
Status: Closed | Priority: Normal | Created: 2018-07-26


Hello,

I am having trouble with the “Company public service methods” (http://user-api.simplybook.it/) “confirmBookingBatch” method.

I have created a batch, and added 1-3 booking into the batch (amount does not matter).

When I call the method to confirm the batch, this is the result I get:

{
“error”: {
“code”: -32090,
“message”: “Confirmation with this key type is not available”,
“data”:
},
“id”: “1”,
“jsonrpc”: “2.0”
}

Here is one of the batches I attempted to use:

{
“require_confirm”: true,
“bookings”: [
{
“id”: “394”,
“event_id”: “2”,
“unit_id”: “2”,
“client_id”: “32”,
“client_hash”: “11fa5937914dd04be045f95ac7bee3a8”,
“start_date_time”: “2018-07-26 07:00:00”,
“end_date_time”: “2018-07-26 08:00:00”,
“time_offset”: “0”,
“is_confirmed”: “1”,
“code”: “38caxks2”,
“hash”: “3870024f6922364d0e0a09bf1f60f774”
}
],
“batch_type”: “batch_multiple_booking”,
“group_booking_batch_id”: 14,
“batch_hash”: “992816e71680bd8100242e1262a2a2c1”
}

I double checked this was not an expiration issue.

What is strange about this, is that I am able to call the the “Company public service methods” (http://user-api.simplybook.it/) “confirmBookingBatchPayment” method without any problems.

{
“result”: true,
“id”: “1”,
“jsonrpc”: “2.0”
}

I am not sure if this is a bug, or if I am doing something wrong?

Karl Oskar Andersen wrote:

I found confirmBookingBatchPayment at Company public service methods - Company public service methods - SimplyBook.me for those wondering.

Karl Oskar Andersen wrote:

Hello,

Is there any update regarding this question?

Vitaliy Kordiak wrote:

Hi,
please provide the code of your request and company login

Karl Oskar Andersen wrote:

Hello,

I have created a new batch:

Result: ‘25’.

Then I proceed to add bookings to the batch:

{
“require_confirm”: true,
“bookings”: [
{
“id”: “602”,
“event_id”: “2”,
“unit_id”: “2”,
“client_id”: “42”,
“client_hash”: “5eb40ee447ae680e055f6ca4fa6e52a0”,
“start_date_time”: “2018-08-24 12:00:00”,
“end_date_time”: “2018-08-24 13:00:00”,
“time_offset”: “0”,
“is_confirmed”: “1”,
“code”: “38cgpmp5”,
“hash”: “2c0593f2f682441b5970fbdcc7a86853”
},
{
“id”: “603”,
“event_id”: “2”,
“unit_id”: “2”,
“client_id”: “42”,
“client_hash”: “5eb40ee447ae680e055f6ca4fa6e52a0”,
“start_date_time”: “2018-08-24 13:00:00”,
“end_date_time”: “2018-08-24 14:00:00”,
“time_offset”: “0”,
“is_confirmed”: “1”,
“code”: “38cgqng6”,
“hash”: “85655d1d2e3d175eb738de79b92ec7da”
}
],
“batch_type”: “batch_multiple_booking”,
“group_booking_batch_id”: 25,
“batch_hash”: “f623202151cce7922ac2bc5a81f51a39”
}

Then I try to confirm the batch:

confirmBookingBatch( 25 , “batch_multiple_booking”, “” )

sign = md5( “25” + “f623202151cce7922ac2bc5a81f51a39” + “<my_secret>” )

Leaving sign out as md5 is easily reversible.

This is the response I get:

{
“error”: {
“code”: -32090,
“message”: “Confirmation with this key type is not available”,
“data”:
},
“id”: “1”,
“jsonrpc”: “2.0”
}

The company login is: ‘wogow’

Redmine Admin wrote:

It seems you are trying to confirm bookings with payment but delayed payment is not enabled in your settings. There are 2 optinons: enable delayed payments or to use function confirmBookingBatchPayment($batchId, $batchType, $paymentProcessor, $sign) function where $paymnetProcessor is string (name of payment processor used to receive payment, this name should not be ‘delay’)

Karl Oskar Andersen wrote:

Hello,

I enabled delayed payment now, and it works.

{
“result”: true,
“id”: “1”,
“jsonrpc”: “2.0”
}

Thanks.