From a92959472c7f3fcea25f99ede0b93a0cdd049975 Mon Sep 17 00:00:00 2001 From: matheo-2001 <62428974+matheo-2001@users.noreply.github.com> Date: Mon, 19 Feb 2024 15:01:09 +0100 Subject: [PATCH 1/8] Add lang it (#609) --- lang/it/error.php | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 lang/it/error.php diff --git a/lang/it/error.php b/lang/it/error.php new file mode 100644 index 00000000..676afb89 --- /dev/null +++ b/lang/it/error.php @@ -0,0 +1,7 @@ + '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', +]; From f8fd1a0c10a9474f1c0ad2cf9e34669d42a521bd Mon Sep 17 00:00:00 2001 From: matheo-2001 <62428974+matheo-2001@users.noreply.github.com> Date: Mon, 19 Feb 2024 15:06:39 +0100 Subject: [PATCH 2/8] Add lang de (#610) --- lang/de/error.php | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 lang/de/error.php diff --git a/lang/de/error.php b/lang/de/error.php new file mode 100644 index 00000000..d76df8c8 --- /dev/null +++ b/lang/de/error.php @@ -0,0 +1,7 @@ + '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', +]; From d2bf6c01c44650b8b51e5e15f162e10f546dcec4 Mon Sep 17 00:00:00 2001 From: matheo-2001 <62428974+matheo-2001@users.noreply.github.com> Date: Mon, 19 Feb 2024 15:08:38 +0100 Subject: [PATCH 3/8] Add lang ar (#611) --- lang/ar/error.php | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 lang/ar/error.php diff --git a/lang/ar/error.php b/lang/ar/error.php new file mode 100644 index 00000000..77583bc3 --- /dev/null +++ b/lang/ar/error.php @@ -0,0 +1,7 @@ + 'غير قادر على معالجة الدفعة لأن معاملتك تم رفضها على PayPal', + 'paypal_transaction_not_verified' => 'غير قادر على التحقق من المعاملة من PayPal', + 'paypal_connection_error' => 'غير قادر على الاتصال بـ PayPal. الرجاء المحاولة مرة أخرى', +]; From 5de81a7e9b12a6bb2d65916025229c9955faeb11 Mon Sep 17 00:00:00 2001 From: matheo-2001 <62428974+matheo-2001@users.noreply.github.com> Date: Mon, 19 Feb 2024 15:10:44 +0100 Subject: [PATCH 4/8] Add lang es (#612) --- lang/es/error.php | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 lang/es/error.php diff --git a/lang/es/error.php b/lang/es/error.php new file mode 100644 index 00000000..cca29fd1 --- /dev/null +++ b/lang/es/error.php @@ -0,0 +1,7 @@ + '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', +]; From 719c8a0a7fec6e59e54d22cfe2173e41691c62b5 Mon Sep 17 00:00:00 2001 From: matheo-2001 <62428974+matheo-2001@users.noreply.github.com> Date: Mon, 19 Feb 2024 15:13:04 +0100 Subject: [PATCH 5/8] Add lang ja (#613) --- lang/ja/error.php | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 lang/ja/error.php diff --git a/lang/ja/error.php b/lang/ja/error.php new file mode 100644 index 00000000..5ef634df --- /dev/null +++ b/lang/ja/error.php @@ -0,0 +1,7 @@ + 'PayPalでお取引が拒否されたため、支払いを処理できません', + 'paypal_transaction_not_verified' => 'PayPalからの取引を確認できません', + 'paypal_connection_error' => 'PayPalに接続できません。もう一度お試しください', +]; From 2fb0d564206e915aefa5960f619d49a1494a0bc3 Mon Sep 17 00:00:00 2001 From: matheo-2001 <62428974+matheo-2001@users.noreply.github.com> Date: Mon, 19 Feb 2024 15:15:15 +0100 Subject: [PATCH 6/8] Add lang ja (#614) --- lang/hy/error.php | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 lang/hy/error.php diff --git a/lang/hy/error.php b/lang/hy/error.php new file mode 100644 index 00000000..52bff408 --- /dev/null +++ b/lang/hy/error.php @@ -0,0 +1,7 @@ + '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', +]; From b3ac557524942858be8696432c0cb3ee2e81b4c5 Mon Sep 17 00:00:00 2001 From: matheo-2001 <62428974+matheo-2001@users.noreply.github.com> Date: Mon, 19 Feb 2024 15:18:10 +0100 Subject: [PATCH 7/8] Add lang cn (#615) --- lang/cn/error.php | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 lang/cn/error.php diff --git a/lang/cn/error.php b/lang/cn/error.php new file mode 100644 index 00000000..e9db1423 --- /dev/null +++ b/lang/cn/error.php @@ -0,0 +1,7 @@ + '由于您的交易在PayPal上被拒绝,无法处理付款', + 'paypal_transaction_not_verified' => '无法从PayPal验证交易', + 'paypal_connection_error' => '无法连接到PayPal。请重试', +]; From dc680c6a85c65e0abe8db40d4f650e658af86c4e Mon Sep 17 00:00:00 2001 From: Abbas Arif <43321373+buzzclue@users.noreply.github.com> Date: Mon, 19 Feb 2024 19:19:02 +0500 Subject: [PATCH 8/8] Add custom id for invoice id (#603) * Add custom id for invoice id --- .../PayPalAPI/Subscriptions/Helpers.php | 23 +++++++++++++++++++ src/Traits/PayPalVerifyIPN.php | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/Traits/PayPalAPI/Subscriptions/Helpers.php b/src/Traits/PayPalAPI/Subscriptions/Helpers.php index 8b65faa2..cb3a7a9e 100644 --- a/src/Traits/PayPalAPI/Subscriptions/Helpers.php +++ b/src/Traits/PayPalAPI/Subscriptions/Helpers.php @@ -48,6 +48,11 @@ trait Helpers */ protected $taxes; + /** + * @var string + */ + protected $custom_id; + /** * Setup a subscription. * @@ -93,6 +98,10 @@ public function setupSubscription(string $customer_name, string $customer_email, $body['taxes'] = $this->taxes; } + if (isset($this->custom_id)) { + $body['custom_id'] = $this->custom_id; + } + $subscription = $this->createSubscription($body); unset($this->product); @@ -475,4 +484,18 @@ public function addTaxes(float $percentage) return $this; } + + /** + * Add custom id. + * + * @param string $custom_id + * + * @return \Srmklive\PayPal\Services\PayPal + */ + public function addCustomId(string $custom_id) + { + $this->custom_id = $custom_id; + + return $this; + } } diff --git a/src/Traits/PayPalVerifyIPN.php b/src/Traits/PayPalVerifyIPN.php index cff1437d..63478683 100644 --- a/src/Traits/PayPalVerifyIPN.php +++ b/src/Traits/PayPalVerifyIPN.php @@ -36,7 +36,7 @@ public function verifyIPN(\Illuminate\Http\Request $request) return ['error' => 'Invalid headers or webhook id provided']; } - $params = $request->all(); + $params = json_decode($request->getContent()); $payload = [ 'auth_algo' => $headers['PAYPAL-AUTH-ALGO'][0],