Skip to content

Commit

Permalink
Fix price format for addSetupFee method(fixes #634)
Browse files Browse the repository at this point in the history
  • Loading branch information
otnansirk authored May 29, 2024
1 parent df4122c commit 4146c7f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/Traits/PayPalAPI/Subscriptions/Helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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',
Expand Down

0 comments on commit 4146c7f

Please sign in to comment.