Closed jimkaler closed 6 years ago
Hi @jimkaler,
Are u running the script directly? Because this is probably because your $_POST["id"] is undefined.
The webhook is called by our server with an id
in the POST.
So to test your script you should POST an id to it.
@Smitsel i am not running it directly, I am calling it after payment. It was running fine but suddenly it stopped working. i have changed API key, is it causing problem?
Jim, I had the same issue. You need to use the live API key and for testing purposes use a hardcoded ID like this:
$payment = $mollie->payments->get('tr_WFF8qARVHQ');
Thanks for reply , may i use that same id? or from where will i get that id dude?
The ID is given to you by Mollie once you make payment requests in live mode. Testing mode won't give you that. Yes, use some random ID for testing purpose
Ok ok Thanks @flowroma .
You can, but you need to use a hardcoded ID
@flowroma still not getting result. :( Its saying "The payment id is invalid".
Hi @jimkaler can you email us at techsupport@mollie.com with an example of your code?
Closing the issue for now.
Hi, I am using laravel framework, I am getting error ErrorException: Undefined index: id while retrieving payment. I am using testing mode. here is the code
$mollie = new \Mollie_API_Client(); $mollie->setApiKey("APKIKEY");
try { $payment = $mollie->payments->get($_POST['id']); $order_id = $payment->metadata->order_id; // File::put(public_path('/aaaaaaaa.txt'),); //Update Database Actest_QunbwFVUMEsGsbCSUj3x5PvsRNEvRdcording Payment status if ($payment->isPaid()) {
$report = Report::where('order_id',$order_id)->first(); $report["status"] = 'Paid'; $report->save(); //Stock Getting Update after Payment has been done. $CoinValue = $report->btc_value; $stock = AvalableStock::where('type',$report->coins_type)->first(); $UpdateStock = $stock->coins-$CoinValue; $stock['coins'] = $UpdateStock; $stock->save();
else {
Thanks in advance.