From 4146c7fcfa39f2d6e5d6912644530834dd449e8a Mon Sep 17 00:00:00 2001 From: Kris Date: Wed, 29 May 2024 16:13:59 +0700 Subject: [PATCH] Fix price format for addSetupFee method(fixes #634) --- src/Traits/PayPalAPI/Subscriptions/Helpers.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Traits/PayPalAPI/Subscriptions/Helpers.php b/src/Traits/PayPalAPI/Subscriptions/Helpers.php index 054304cf..ecba57c1 100644 --- a/src/Traits/PayPalAPI/Subscriptions/Helpers.php +++ b/src/Traits/PayPalAPI/Subscriptions/Helpers.php @@ -338,7 +338,6 @@ public function addProduct(string $name, string $description, string $type, stri if ($error = data_get($product, 'error', false)) { throw new \RuntimeException(data_get($error, 'details.0.description', 'Failed to add product')); } - $this->product = $product; return $this; @@ -438,7 +437,7 @@ public function addSetupFee(float $price): \Srmklive\PayPal\Services\PayPal $this->payment_preferences = [ 'auto_bill_outstanding' => true, 'setup_fee' => [ - 'value' => $price, + 'value' => bcdiv($price, 1, 2), 'currency_code' => $this->getCurrency(), ], 'setup_fee_failure_action' => 'CONTINUE',