xendit-php
xendit-php copied to clipboard
When I create new customer this error was caused. "There was an error with the format submitted to the server".
Request ==>
{
"customer": {
"addresses": [
{
"city": "Jakarta Selatan",
"country": "PH",
"postal_code": "12160",
"province": "Daerah Khusus Ibukota Jakarta",
"street_line1": "Jalan Makan",
"street_line2": "Kecematan Kebayoran Baru"
}
],
"date_of_birth": "2000-01-01",
"email": "[email protected]",
"given_names": "John",
"mobile_number": "+6323123123",
"nationality": "PH",
"phone_number": "+6323123123",
"reference_id": "demo_1475801962607",
"surname": "Doe"
}
}
Response ==>
{
"message": "There was an error with the format submitted to the server.",
"exception": "Xendit\\Exceptions\\ApiException",
"file": "/home/tabish/programming/laravel/sabong/vendor/xendit/xendit-php/src/HttpClient/GuzzleClient.php",
"line": 171,
}
same here
same problem here, is there any solution or workaround for this one?
facing same issue when creating customer, is there any solution for it?
Try this format for saving customers.
$customerParamsNew = [ 'reference_id' => referenceID(25), 'type' => $customer->type, 'email' => $customer->email, 'mobile_number' => $customer->tel, 'kyc_documents' => [], 'individual_detail' => [ 'given_names' => $customer->name, ], 'identity_accounts' => [], 'api-version' => '2020-10-31' ];
you should see what is customer type, i coded this long time, i don't know what it should be and also update the api version to your installed one or try to remove api-version. Generate your own ref id according to your choice.
Closing this as resolved