Closed AlphaNimmi closed 1 year ago
Hello @AlphaNimmi,
My first observation: your code example seems to configure the complete_payment
method for the redirectUrl
, not the webhookUrl
. So you might not be showing us the correct code sample for an issue with the webhook? Note that the request for the webhook call is not related in any way to your customer visiting the website and starting the payment, so the $paymentId
cannot come from session data.
If the Mollie dashboard shows a HTTP 500 error for the webhook, there must be a related HTTP 500 error in your application logging for the webhook. My best guess is that you look into that, rather than trying random code changes: if the webhook fails somewhere in the //update code
block, it mag still issue a HTTP 500.
Apart from that: this is the issue tracker for the Python API client, not the PHP one :) (but feel free to ask questions, your issue doesn't seem to be related to an actual client issue).
Hi @whyscream The issue is from side.The way I am getting the payment id. Its Solved. Sorry For the wrong post ,but I am commenting my answer ,if it helps anyone public function mollie_webhook() {
$api_key =$this->db->where('type', 'mollie')->get('social_keys')->result()[0]->app_id;
try {
$mollie = new MollieApiClient();
$mollie->setApiKey($api_key);
$payment = $mollie->payments->get($_POST["id"]);
.............................. } catch (\Mollie\Api\Exceptions\ApiException $e) {
// Log or handle the error as per your requirements
}
Closing, issue resolved. Related issue in PHP repo: https://github.com/mollie/laravel-mollie/issues/229
I have called webhook for the payment like this
And my webhook public function complete_payment() {
$payment = $mollie->payments->get($paymentId); $status = $payment->status; if ($status === 'paid') { ......... .......... //update code ........... }
}
The code works fine and its updating .but mollie dashboard its showing Webhook failed with status code 500 (Internal Server Error)
Also webhooks works(Webhook called successfully, it took 0.1 seconds) when i commented all code $mollie = new MollieApiClient(); $mollie->setApiKey($api_key);.if i comment this code ans enter die it works