Closed AlexVanSteenhoven closed 3 months ago
Dear @AlexVanSteenhoven,
You're using the wrong payload. Please see https://github.com/buckaroo-it/BuckarooSDK_PHP/blob/master/example/transactions/in3.php for the correct payload.
In addition, please check our documentation https://docs.buckaroo.io/v1/docs/en/php-sdk regarding our PHP SDK.
Dear @ShuCh3n,
Thanks for providing the correct payload.
Now it will work but now in the BuckarooController.php
I get the following error:
Call to undefined method Buckaroo\Laravel\BuckarooManager::client()
Looking in the BuckarooManager there is indeed no client, when I replaced it with Buckaroo::api()
it works.
After this there is no transaction so the ->update([...])
method throws an error. Does this has to be an update statement or should it be create?
public function return(Request $request)
{
$bodyIsValid = Buckaroo::client()->validateBody((!empty($_POST))? $_POST : $request->getContent(), $request->header('Authorization') ?? '', route('buckaroo.return')); // <-- Here
if($bodyIsValid)
{
try{
$transaction_id = $request->get('BRQ_TRANSACTIONS') ?? $request->get('brq_transactions');
$transaction = BuckarooTransaction::firstWhere('brq_transactions', $transaction_id);
$transaction->update([
'brq_statuscode' => $request->get('BRQ_STATUSCODE') ?? $request->get('brq_statuscode'),
'brq_statuscode_detail' => $request->get('BRQ_STATUSCODE_DETAIL') ?? $request->get('brq_statuscode_detail'),
'brq_statusmessage' => $request->get('BRQ_STATUSMESSAGE') ?? $request->get('brq_statusmessage')
]);
}catch(QueryException $e){}
return 'Success';
}
return 'Body is not valid';
}
Have you created the transaction in the first place?
$transaction = BuckarooTransaction::where('brq_transactions', $transaction_id)->firstOrFail();
You'll probably get a 404 or a model not found
No I did not, I was expecting that a transaction already was created.
So where and when do I need to create the transaction? This is a bit unclear for me
Right after you execute the transaction you will get a transaction key from the response.
$response = Buckaroo::api()->method('in3')->pay($payload);
dd($response); //You'll find the transaction key over here
Store this transaction key in the database for further reference.
All right it works now!
The only weird thing is that after the transaction is successfully made, the user is automatically signed out. Could the Wrapper / API cause this or not because this is the only option where this happens.
Dear @AlexVanSteenhoven
We don't touch any parts that are related to the sessions. Please check the middleware whether you have initialized the session. But that has nothing to do with our Buckaroo Laravel Wrapper.
If you contact me directly I would be more the happy to help you. If all the issues that you were facing are resolved, please close this issue ticket.
Thank you!
I see I did not close the issue, my issue is gone and every thing works now.
Closing this issue now. Thanks for all of the help!
Description
We are currently in the process of integrating in3 payments into our application to meet a client's requirements. Despite following the official documentation for the Laravel wrapper, we are encountering issues that prevent successful payment processing. Notably, the lack of autocompletion is adding complexity to the implementation process.
Issue details
Environment:
Code snippet from our application
OrderController.php
iDEAL.php
Error messages
Expected behaviour
A response from the api with data about the new payment made