Skip to content

Commit

Permalink
Add patch method to TransactionService (#415)
Browse files Browse the repository at this point in the history
* Add patch method to TransactionService

* Increase version
  • Loading branch information
XaosSintez authored Jul 2, 2020
1 parent f7028cf commit 8a286be
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ Security - in case of vulnerabilities.

## [Unreleased]

_TBD_

## [2.8.0] 2020-07-02

### Added
- [x] Added new **AML API**
- [x] Added new **Gateway Account Limit API**
Expand All @@ -31,6 +35,7 @@ Security - in case of vulnerabilities.
- [x] Added new methods to `GatewayAccount`: `setDigitalWallets`, `getDigitalWallets`
- [x] Added new properties to `Invoice`: `transactions`, `poNumber`, `notes`
- [x] Added new property to `Subscription`: `recentInvoice`
- [x] Added `patch` method to `TransactionService`

### Deprecated
- [x] Deprecated `PayPalAccount` method: `getApprovalLink`
Expand Down
2 changes: 1 addition & 1 deletion src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ final class Client

public const CURRENT_VERSION = 'v2.1';

public const SDK_VERSION = '2.7.0';
public const SDK_VERSION = '2.8.0';

private static $services = [
'authenticationOptions' => Services\AuthenticationOptionsService::class,
Expand Down
13 changes: 13 additions & 0 deletions src/Services/TransactionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,17 @@ public function create($data)
'transactions'
);
}

/**
* @param string $transactionId
* @param array|JsonSerializable|Transaction $data
*
* @throws UnprocessableEntityException The input data does not valid
*
* @return Transaction
*/
public function patch($transactionId, $data)
{
return $this->client()->patch($data, 'transactions/{transactionId}', ['transactionId' => $transactionId]);
}
}
3 changes: 3 additions & 0 deletions tests/Api/ServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,9 @@ public function transactionService()

$result = $service->cancel('dummy');
$this->assertInstanceOf(Entities\Transaction::class, $result);

$result = $service->patch('dummy', []);
$this->assertInstanceOf(Entities\Transaction::class, $result);
}

/**
Expand Down

0 comments on commit 8a286be

Please sign in to comment.