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

V3 v2 #644

Merged
merged 31 commits into from
Jun 19, 2024
Merged

V3 v2 #644

Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
2841a53
Use PestPHP for PHP 8.1+
srmklive Oct 9, 2023
fd8846e
Fix build.
srmklive Oct 10, 2023
b958d55
Disable LFS.
srmklive Oct 10, 2023
a2c8e09
Update docs link.
srmklive Oct 10, 2023
196009f
CI fixes.
srmklive Oct 10, 2023
dadc0b0
Fix PHP 8.3
srmklive Nov 2, 2023
1a88106
Move method check to function.
srmklive Nov 5, 2023
3ae53c0
Add Codecov to build.
srmklive Nov 8, 2023
79560c5
Add remaining Partner Referral API endpoints. (fixes #594)
srmklive Nov 9, 2023
7829379
Refactor API Parameters (implements #597).
srmklive Nov 22, 2023
6bde2b2
Add installments. (fixes #602)
srmklive Dec 20, 2023
a929594
Add lang it (#609)
matheo-2001 Feb 19, 2024
f8fd1a0
Add lang de (#610)
matheo-2001 Feb 19, 2024
d2bf6c0
Add lang ar (#611)
matheo-2001 Feb 19, 2024
5de81a7
Add lang es (#612)
matheo-2001 Feb 19, 2024
719c8a0
Add lang ja (#613)
matheo-2001 Feb 19, 2024
2fb0d56
Add lang ja (#614)
matheo-2001 Feb 19, 2024
b3ac557
Add lang cn (#615)
matheo-2001 Feb 19, 2024
dc680c6
Add custom id for invoice id (#603)
buzzclue Feb 19, 2024
d82936f
Apply fixes from StyleCI (#621)
srmklive Feb 20, 2024
ec50129
Add billing_plan_id and product_id after creating recurring subscript…
otnansirk Feb 21, 2024
cf2db31
Error handler for addProduct and addBillingPlan for subscription help…
otnansirk Mar 3, 2024
d511038
Bump dependencies for Laravel 11 (#625)
laravel-shift Mar 3, 2024
df4122c
Use PHPUnit 11.
srmklive Mar 22, 2024
4146c7f
Fix price format for addSetupFee method(fixes #634)
otnansirk May 29, 2024
378ac23
Only set subscription start_time if passed (#640)
willcurry May 29, 2024
6651530
Start build from PHP 8.0.
srmklive Jun 18, 2024
24c2a26
Allow failures for PHP 8.0.
srmklive Jun 18, 2024
77baff8
Merge branch 'v2.0' into v3-v2
srmklive Jun 19, 2024
3722bb6
Fix tests.
srmklive Jun 19, 2024
2ac8b81
CI fixes.
srmklive Jun 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php-versions: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2']
php-versions: ['8.0', '8.1', '8.2', '8.3']
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
30 changes: 24 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,17 @@ jobs:
strategy:
fail-fast: false
matrix:
php-versions: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2']
php-versions: ['8.0', '8.1', '8.2', '8.3']
include:
- php-versions: '8.0'
continue-on-error: true
steps:
- name: Checkout
uses: actions/checkout@v2
with:
lfs: true
- name: Checkout LFS objects
run: git lfs checkout
# with:
# lfs: true
# - name: Checkout LFS objects
# run: git lfs checkout
- name: Setup PHP with Composer and extensions
with:
php-version: ${{ matrix.php-versions }}
Expand All @@ -33,10 +36,21 @@ jobs:
env:
PHP_VERSION: ${{ matrix.php-versions }}
run: composer install --no-progress --prefer-dist --optimize-autoloader $(if [ "$PHP_VERSION" == "8.0" || "$PHP_VERSION" == "8.1" ]; then echo "--ignore-platform-reqs"; fi;)
- name: Run tests with code coverage
- name: Run tests for PHP 7.2 to 8.0 with code coverage
if: matrix.php-versions == '7.2' || matrix.php-versions == '7.3' || matrix.php-versions == '7.4' || matrix.php-versions == '8.0'
env:
PHP_VERSION: ${{ matrix.php-versions }}
run: vendor/bin/phpunit $(if [ "$PHP_VERSION" == "7.2" ]; then echo "-c phpunit.xml.dist.php72"; fi;) $(if [ "$PHP_VERSION" == "7.3" ]; then echo "-c phpunit.xml.dist.php8"; fi;) $(if [ "$PHP_VERSION" == "7.4" ]; then echo "-c phpunit.xml.dist.php8"; fi;) $(if [ "$PHP_VERSION" == "8.0" ]; then echo "-c phpunit.xml.dist.php8"; fi;) --coverage-clover build/logs/clover.xml
- name: Install PestPHP
if: matrix.php-versions == '8.1' || matrix.php-versions == '8.2' || matrix.php-versions == '8.3'
env:
PHP_VERSION: ${{ matrix.php-versions }}
run: composer require pestphp/pest --dev --with-all-dependencies
- name: Run tests for PHP 8.1+ with code coverage
if: matrix.php-versions == '8.1' || matrix.php-versions == '8.2' || matrix.php-versions == '8.3'
env:
PHP_VERSION: ${{ matrix.php-versions }}
run: vendor/bin/pest --coverage-clover build/logs/clover.xml
- name: Install PHP Coveralls library
env:
PHP_VERSION: ${{ matrix.php-versions }}
Expand All @@ -50,6 +64,10 @@ jobs:
COVERALLS_FLAG_NAME: php-${{ matrix.php-versions }}
run:
php-coveralls -v
- name: Upload coverage results to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
coveralls-finish:
needs: [paypal]
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@

The documentation for the package can be viewed by clicking the following link:

[https://laravel-paypal.readthedocs.io/en/latest/](https://laravel-paypal.readthedocs.io/en/latest/)

The old documentation can be found at the following link:

[https://srmklive.github.io/laravel-paypal/docs.html](https://srmklive.github.io/laravel-paypal/docs.html)

<a name="usage"></a>
Expand Down
13 changes: 8 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,19 @@
"php": ">=7.2|^8.0",
"ext-curl": "*",
"guzzlehttp/guzzle": "~7.0",
"illuminate/support": "~6.0|~7.0|~8.0|~9.0|^10.0",
"nesbot/carbon": "~2.0"
"illuminate/support": "~6.0|~7.0|~8.0|~9.0|^10.0|^11.0",
"nesbot/carbon": "~2.0|^3.0"
},
"require-dev": {
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^8.0|^9.0|^10.0",
"symfony/var-dumper": "~5.0"
"phpunit/phpunit": "^8.0|^9.0|^10.0|^11.0",
"symfony/var-dumper": "~5.0|^6.0|^7.0"
},
"config": {
"sort-packages": true
"sort-packages": true,
"allow-plugins": {
"pestphp/pest-plugin": true
}
},
"extra": {
"laravel": {
Expand Down
7 changes: 7 additions & 0 deletions lang/ar/error.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

return [
'paypal_transaction_declined' => 'غير قادر على معالجة الدفعة لأن معاملتك تم رفضها على PayPal',
'paypal_transaction_not_verified' => 'غير قادر على التحقق من المعاملة من PayPal',
'paypal_connection_error' => 'غير قادر على الاتصال بـ PayPal. الرجاء المحاولة مرة أخرى',
];
7 changes: 7 additions & 0 deletions lang/cn/error.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

return [
'paypal_transaction_declined' => '由于您的交易在PayPal上被拒绝,无法处理付款',
'paypal_transaction_not_verified' => '无法从PayPal验证交易',
'paypal_connection_error' => '无法连接到PayPal。请重试',
];
7 changes: 7 additions & 0 deletions lang/de/error.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

return [
'paypal_transaction_declined' => 'Zahlung konnte nicht verarbeitet werden, da Ihre Transaktion bei PayPal abgelehnt wurde',
'paypal_transaction_not_verified' => 'Transaktion konnte bei PayPal nicht verifiziert werden',
'paypal_connection_error' => 'Verbindung zu PayPal konnte nicht hergestellt werden. Bitte versuchen Sie es erneut',
];
7 changes: 7 additions & 0 deletions lang/es/error.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

return [
'paypal_transaction_declined' => 'Imposible procesar el pago ya que tu transacción fue rechazada en PayPal',
'paypal_transaction_not_verified' => 'Imposible verificar la transacción desde PayPal',
'paypal_connection_error' => 'Imposible conectarse a PayPal. Por favor, inténtalo de nuevo',
];
7 changes: 7 additions & 0 deletions lang/hy/error.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

return [
'paypal_transaction_declined' => 'Nem lehet feldolgozni a fizetést, mivel a tranzakciódat elutasították a PayPal-on',
'paypal_transaction_not_verified' => 'A tranzakciót nem lehet ellenőrizni a PayPal-ról',
'paypal_connection_error' => 'Nem lehet csatlakozni a PayPal-hoz. Kérjük, próbálja újra',
];
7 changes: 7 additions & 0 deletions lang/it/error.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

return [
'paypal_transaction_declined' => 'Impossibile elaborare il pagamento perché la tua transazione è stata rifiutata su PayPal',
'paypal_transaction_not_verified' => 'Impossibile verificare la transazione su PayPal',
'paypal_connection_error' => 'Impossibile connettersi a PayPal. Si prega di riprovare',
];
7 changes: 7 additions & 0 deletions lang/ja/error.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

return [
'paypal_transaction_declined' => 'PayPalでお取引が拒否されたため、支払いを処理できません',
'paypal_transaction_not_verified' => 'PayPalからの取引を確認できません',
'paypal_connection_error' => 'PayPalに接続できません。もう一度お試しください',
];
2 changes: 1 addition & 1 deletion src/Traits/PayPalAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public function setCurrentPage(int $page): \Srmklive\PayPal\Services\PayPal
*/
public function showTotals(bool $totals): \Srmklive\PayPal\Services\PayPal
{
$this->show_totals = $totals;
$this->show_totals = var_export($totals, true);

return $this;
}
Expand Down
62 changes: 62 additions & 0 deletions src/Traits/PayPalAPI/PartnerReferrals.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,66 @@ public function showReferralData(string $partner_referral_id)

return $this->doPayPalRequest();
}

/**
* List Seller Tracking Information.
*
* @param string $partner_id
* @param string $tracking_id
*
* @throws \Throwable
*
* @return array|\Psr\Http\Message\StreamInterface|string
*
* @see https://developer.paypal.com/docs/api/partner-referrals/v1/#merchant-integration_find
*/
public function listSellerTrackingInformation(string $partner_id, string $tracking_id)
{
$this->apiEndPoint = "v1/customer/partners/{$partner_id}/merchant-integrations?tracking_id={$tracking_id}";

$this->verb = 'get';

return $this->doPayPalRequest();
}

/**
* Show Seller Status.
*
* @param string $partner_id
* @param string $merchant_id
*
* @throws \Throwable
*
* @return array|\Psr\Http\Message\StreamInterface|string
*
* @see https://developer.paypal.com/docs/api/partner-referrals/v1/#merchant-integration_status
*/
public function showSellerStatus(string $partner_id, string $merchant_id)
{
$this->apiEndPoint = "v1/customer/partners/{$partner_id}/merchant-integrations/{$merchant_id}";

$this->verb = 'get';

return $this->doPayPalRequest();
}

/**
* List Merchant Credentials.
*
* @param string $partner_id
*
* @throws \Throwable
*
* @return array|\Psr\Http\Message\StreamInterface|string
*
* @see https://developer.paypal.com/docs/api/partner-referrals/v1/#merchant-integration_credentials
*/
public function listMerchantCredentials(string $partner_id)
{
$this->apiEndPoint = "v1/customer/partners/{$partner_id}/merchant-integrations/credentials";

$this->verb = 'get';

return $this->doPayPalRequest();
}
}
Loading
Loading