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

Commit

Permalink
Now updates the user mandate id
Browse files Browse the repository at this point in the history
  • Loading branch information
sandervanhooft committed Jun 3, 2019
1 parent 18e94a4 commit 32365d8
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions src/FirstPayment/FirstPaymentHandler.php
Expand Up @@ -12,19 +12,13 @@

class FirstPaymentHandler
{
/**
* @var \Illuminate\Database\Eloquent\Model
*/
/** @var \Illuminate\Database\Eloquent\Model */
protected $owner;

/**
* @var \Mollie\Api\Resources\Payment
*/
/** @var \Mollie\Api\Resources\Payment */
protected $payment;

/**
* @var \Illuminate\Support\Collection
*/
/** @var \Illuminate\Support\Collection */
protected $actions;

/**
Expand All @@ -47,12 +41,15 @@ public function __construct(Payment $payment)
public function execute()
{
return DB::transaction(function () {
$this->owner->update([
'mollie_mandate_id' => $this->payment->mandateId
]);
$this->owner->mollie_mandate_id = $this->payment->mandateId;
$this->owner->save();

$orderItems = $this->executeActions();

return Order::createProcessedFromItems($orderItems);
return Order::createProcessedFromItems($orderItems, [
'mollie_payment_id' => $this->payment->id,
'mollie_payment_status' => $this->payment->status,
]);
});
}

Expand Down

0 comments on commit 32365d8

Please sign in to comment.