Skip to content

Commit

Permalink
Update SDK payment card for patch
Browse files Browse the repository at this point in the history
  • Loading branch information
dara committed Jun 12, 2018
1 parent 61bbd7a commit 203536d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
* @method void head($path, $params = [], $headers = [])
* @method mixed post($payload, $path, $params = [], $headers = [])
* @method mixed put($payload, $path, $params = [], $headers = [])
* @method mixed patch($payload, $path, $params = [], $headers = [])
* @method void delete($path, $params = [], $headers = [])
*
* Magic methods for services factories:
Expand Down Expand Up @@ -349,6 +350,7 @@ public function __call($name, $arguments)
return call_user_func_array([$this, 'send'], $arguments);
case 'POST':
case 'PUT':
case 'PATCH':
array_unshift($arguments, $name);
return call_user_func_array([$this, 'send'], $arguments);
}
Expand Down
13 changes: 13 additions & 0 deletions src/Services/PaymentCardService.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,19 @@ public function createFromToken($token, $data, $cardId = null)
return $this->create($data, $cardId);
}

/**
* @param array|JsonSerializable|PaymentCardAuthorization $data
* @param string $cardId
*
* @throws UnprocessableEntityException The input data does not valid
*
* @return PaymentCard
*/
public function update($data, $cardId)
{
return $this->client()->patch($data, 'payment-cards/{cardId}', ['cardId' => $cardId]);
}

/**
* @param array|JsonSerializable|PaymentCardAuthorization $data
* @param string $cardId
Expand Down

0 comments on commit 203536d

Please sign in to comment.