Skip to content
This repository has been archived by the owner on Feb 2, 2022. It is now read-only.

Commit

Permalink
Store the definite mollie payment id
Browse files Browse the repository at this point in the history
  • Loading branch information
sandervanhooft committed Dec 5, 2019
1 parent ac40e7a commit 3d51814
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/Http/Controllers/WebhookController.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,12 @@ protected function getOrder(Payment $payment)
{
$order = Order::findByPaymentId($payment->id);

if(!$order) {
if(isset($payment->metadata, $payment->metadata->temporary_mollie_payment_id)) {
$order = Order::findByPaymentId($payment->metadata->temporary_mollie_payment_id);
if(!$order && isset($payment->metadata, $payment->metadata->temporary_mollie_payment_id)) {
$order = Order::findByPaymentId($payment->metadata->temporary_mollie_payment_id);

if($order) {
// Store the definite payment id.
$order->update(['mollie_payment_id' => $payment->id]);
}
}

Expand Down

0 comments on commit 3d51814

Please sign in to comment.