Skip to content

Commit

Permalink
Merge branch 'v3.0' into v3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
srmklive authored Feb 19, 2024
2 parents f8c8a72 + dc680c6 commit 2b0ac9e
Show file tree
Hide file tree
Showing 9 changed files with 75 additions and 1 deletion.
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に接続できません。もう一度お試しください',
];
25 changes: 25 additions & 0 deletions src/Traits/PayPalAPI/Subscriptions/Helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ trait Helpers
*/
protected $taxes;

/**
* @var string
*/
protected $custom_id;

/**
* Setup a subscription.
*
Expand Down Expand Up @@ -97,6 +102,12 @@ public function setupSubscription(string $customer_name, string $customer_email,
$subscription['billing_plan_id'] = $this->billing_plan['id'];
$subscription['product_id'] = $this->product['id'];

if (isset($this->custom_id)) {
$body['custom_id'] = $this->custom_id;
}

$subscription = $this->createSubscription($body);

unset($this->product);
unset($this->billing_plan);
unset($this->trial_pricing);
Expand Down Expand Up @@ -477,4 +488,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;
}
}
2 changes: 1 addition & 1 deletion src/Traits/PayPalVerifyIPN.php
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down

0 comments on commit 2b0ac9e

Please sign in to comment.