Skip to content

Commit

Permalink
Added check for duplicate payment data
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrey Helldar committed Aug 19, 2021
1 parent 8d61597 commit 7b4749c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,11 @@ protected function init(): void

$details = $this->details($response->toArray());

$this->payment->cashier()->updateOrCreate(compact('external_id'), compact('details'));
$content = compact('external_id', 'details');

$this->payment->cashier()->exists()
? $this->payment->cashier()->update($content)
: $this->payment->cashier()->create($content);

$this->model->refresh();
}
Expand Down

0 comments on commit 7b4749c

Please sign in to comment.