Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SP-981 Update PDP SDK to latest version #7

Merged
merged 11 commits into from
Aug 15, 2024
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:

strategy:
matrix:
php-version: [8.0, 8.1, 8.2]
php-version: [ 8.1, 8.2 ]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: php-actions/composer@v6
with:
php_version: ${{ matrix.php-version }}
Expand All @@ -37,10 +37,10 @@ jobs:

strategy:
matrix:
php-version: [ 8.0, 8.1, 8.2 ]
php-version: [ 8.1, 8.2 ]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: php-actions/composer@v6
with:
php_version: ${{ matrix.php-version }}
Expand All @@ -59,10 +59,10 @@ jobs:

strategy:
matrix:
php-version: [ 8.0, 8.1, 8.2 ]
php-version: [ 8.1, 8.2 ]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: php-actions/composer@v6
with:
php_version: ${{ matrix.php-version }}
Expand Down
2 changes: 1 addition & 1 deletion app/Features/Invoice/CreateInvoice/CreateInvoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ private function createBitpayInvoice(BitPayInvoice $requestedInvoice): BitPayInv
$client = $this->bitPayClientFactory->create();

$facade = $this->bitPayConfiguration->getFacade();
$signRequest = $facade !== Facade::Pos;
$signRequest = $facade !== Facade::POS;

return $client->createInvoice($requestedInvoice, $facade, $signRequest);
}
Expand Down
16 changes: 8 additions & 8 deletions app/Features/Shared/InvoiceSaver.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,9 @@ private function saveItemizedDetails(BitPayInvoice $bitpayInvoice, Invoice $invo
}

$invoiceItemizedDetail = new InvoiceItemizedDetail([
'amount' => $itemizedDetail['amount'],
'description' => $itemizedDetail['description'],
'is_fee' => $itemizedDetail['isFee'],
'amount' => $itemizedDetail->getAmount(),
'description' => $itemizedDetail->getDescription(),
'is_fee' => $itemizedDetail->getIsFee(),
]);
$result[] = $invoiceItemizedDetail;
}
Expand Down Expand Up @@ -268,9 +268,9 @@ private function getInvoicePaymentCurrency(
$invoicePaymentCurrency = new InvoicePaymentCurrency([
'currency_code' => $currency,
'total' => $amount,
'subtotal' => $bitpayInvoice->getPaymentSubTotals()->$currency ?? null,
'display_total' => $bitpayInvoice->getPaymentDisplayTotals()->$currency ?? null,
'display_subtotal' => $bitpayInvoice->getPaymentDisplaySubTotals()->$currency ?? null,
'subtotal' => $bitpayInvoice->getPaymentSubtotals()[$currency] ?? null,
'display_total' => $bitpayInvoice->getPaymentDisplayTotals()[$currency] ?? null,
'display_subtotal' => $bitpayInvoice->getPaymentDisplaySubTotals()[$currency] ?? null,
]);
$invoicePaymentCurrency->invoicePayment()->associate($invoicePayment);

Expand All @@ -284,7 +284,7 @@ private function getInvoicePaymentCurrency(

$invoicePaymentCurrency->save();

$bitpayPaymentCodes = $bitpayInvoice->getPaymentCodes()->$currency ?? null;
$bitpayPaymentCodes = $bitpayInvoice->getPaymentCodes()[$currency] ?? null;
if ($bitpayPaymentCodes) {
$invoicePaymentCurrencyCodes = [];
foreach ($bitpayPaymentCodes as $code => $value) {
Expand Down Expand Up @@ -389,7 +389,7 @@ private function getExchangeRates(
InvoicePaymentCurrency $invoicePaymentCurrency,
string $currency
): array {
$bitpayExchangeRates = $bitpayInvoice->getExchangeRates()->$currency ?? null;
$bitpayExchangeRates = $bitpayInvoice->getExchangeRates()[$currency] ?? null;
if (!$bitpayExchangeRates) {
return [];
}
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"license": "MIT",
"require": {
"php": "^8.1",
"bitpay/sdk": "dev-8.0.0-dev",
"bitpay/sdk": "^9.0.4",
"guzzlehttp/guzzle": "^7.2",
"laravel/framework": "^10.0",
"laravel/sanctum": "^3.2",
Expand Down
Loading