Skip to content
This repository has been archived by the owner on Oct 30, 2020. It is now read-only.

Commit

Permalink
Adds missing customer information to add and update methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Craig Paul committed Oct 26, 2016
1 parent 57f7141 commit db07e97
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/Vault.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ public function add(CreditCard $card)
'expdate' => $card->expiry,
];

if (!is_null($card->customer)) {
$params = array_merge($params, [
'cust_id' => $card->customer->id,
'phone' => $card->customer->phone,
'email' => $card->customer->email,
'note' => $card->customer->note,
]);
}

$transaction = $this->transaction($params);

return $this->process($transaction);
Expand Down Expand Up @@ -199,6 +208,15 @@ public function update($key = '', CreditCard $card)
'expdate' => $card->expiry,
];

if (!is_null($card->customer)) {
$params = array_merge($params, [
'cust_id' => $card->customer->id,
'phone' => $card->customer->phone,
'email' => $card->customer->email,
'note' => $card->customer->note,
]);
}

$transaction = $this->transaction($params);

return $this->process($transaction);
Expand Down

0 comments on commit db07e97

Please sign in to comment.