Skip to content

Commit

Permalink
Added support for PUT requests via update, following Fote's action …
Browse files Browse the repository at this point in the history
…verb API
  • Loading branch information
oojacoboo committed Aug 12, 2021
1 parent 7ced9bc commit efcf63c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
21 changes: 21 additions & 0 deletions src/Client/SubResource/TransactionSubResource.php
Expand Up @@ -44,6 +44,27 @@ public function create(
}


/**
* Updates an existing transaction
*
* @param Attribute\Id\OrganizationId $organizationId Use reseller org id if reseller
*/
public function update(
Attribute\Id\OrganizationId $organizationId,
Attribute\Id\LocationId $locationId,
Model\Transaction $transaction
): Model\Transaction
{
$uri = UriBuilder::build('organizations/%s/locations/%s/transactions/', [
$organizationId->getValue(),
$locationId->getValue(),
]);

return $this->getHttpClient()
->makeModelRequest('put', $uri, Model\Transaction::class, $transaction);
}


/**
* Finds a single transaction
*
Expand Down
2 changes: 1 addition & 1 deletion src/Model/Transaction.php
Expand Up @@ -10,7 +10,7 @@

class Transaction extends AbstractModel
{

/**
* @var Attribute\Id\OrganizationId
*/
Expand Down

0 comments on commit efcf63c

Please sign in to comment.