Skip to content

Commit

Permalink
Add shortcut for updating SSL card list
Browse files Browse the repository at this point in the history
  • Loading branch information
voronkovich committed Aug 19, 2018
1 parent b6b70a4 commit d1bdf36
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,23 @@ public function verifyEnrollment(string $pan, array $data = []): array
return $this->execute('/payment/rest/verifyEnrollment.do', $data);
}

/**
* Update an SSL card list.
*
* @see https://securepayments.sberbank.ru/wiki/doku.php/integration:api:rest:requests:updateSSLCardList
*
* @param int|string $orderId An order identifier
* @param array $data Additional data
*
* @return array A server's response
*/
public function updateSSLCardList($orderId, array $data = []): array
{
$data['mdorder'] = $orderId;

return $this->execute('/payment/rest/updateSSLCardList.do', $data);
}

/**
* Get last orders for merchants.
*
Expand Down
18 changes: 18 additions & 0 deletions tests/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,24 @@ public function testVerifiesACardEnrollment()
$client->verifyEnrollment('aaazzz', ['currency' => 200]);
}

/**
* @testdox Updates an SSL card list
*/
public function testUpdatesAnSSLCardList()
{
$httpClient = $this->getHttpClientToTestSendingData(
'/payment/rest/updateSSLCardList.do',
'mdorder=aaazzz&token=abrakadabra'
);

$client = new Client([
'token' => 'abrakadabra',
'httpClient' => $httpClient,
]);

$client->updateSSLCardList('aaazzz');
}

public function testPaysAnOrderUsingBinding()
{
$httpClient = $this->getHttpClientToTestSendingData(
Expand Down

0 comments on commit d1bdf36

Please sign in to comment.