Skip to content

Commit

Permalink
Let AppStoreServerAPIReceiptExtender throw AppStoreServerAPIException…
Browse files Browse the repository at this point in the history
… to allow its proper handling
  • Loading branch information
pkotets committed Aug 30, 2023
1 parent f58a0bd commit 29eb58e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
### [1.4.1] 2023-08-30

**BUGFIX:**

- Let AppStoreServerAPIReceiptExtender throw AppStoreServerAPIException to allow its proper handling

### [1.4.0] 2023-08-29

**IMPROVEMENTS:**
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"php"
],
"homepage": "https://github.com/readdle/app-store-receipt-verification",
"version": "1.4.0",
"version": "1.4.1",
"autoload": {
"psr-4": {
"Readdle\\AppStoreReceiptVerification\\": "src/"
Expand Down
8 changes: 1 addition & 7 deletions src/ReceiptExtender/AppStoreServerAPIReceiptExtender.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use DateTimeZone;
use Exception;
use Readdle\AppStoreServerAPI\AppStoreServerAPIInterface;
use Readdle\AppStoreServerAPI\Exception\AppStoreServerAPIException;
use Readdle\AppStoreServerAPI\TransactionInfo;

final class AppStoreServerAPIReceiptExtender implements ReceiptExtenderInterface
Expand All @@ -32,12 +31,7 @@ public function extend(string $serializedReceipt, bool $mergeNewEntries = true):

$originalTransactionId = $receipt['receipt']['in_app'][0]['original_transaction_id'];

try {
$transactionHistory = $this->api->getTransactionHistory($originalTransactionId);
} catch (AppStoreServerAPIException $e) {
throw new Exception('AppStoreServerAPIException: ' . $e->getMessage());
}

$transactionHistory = $this->api->getTransactionHistory($originalTransactionId);
$transactionsMerged = false;

foreach ($transactionHistory->getTransactions() as $transaction) {
Expand Down

0 comments on commit 29eb58e

Please sign in to comment.