Skip to content

Commit

Permalink
Fixes issue for plans with no one time fees
Browse files Browse the repository at this point in the history
  • Loading branch information
andrelopez committed Sep 7, 2019
1 parent d77ed33 commit 052b0b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/services/Checkout.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ private function handleSubscription(PaymentForm $paymentForm, $postData, $metada

$plan = StripePlugin::$app->plans->getStripePlan($planId);
$setupFee = StripePlugin::$app->orders->getSetupFeeFromMatrix($planId, $paymentForm);
if ($setupFee){
if ($setupFee && $setupFee > 0){
$oneTineFee = [
'amount' => Stripe::$app->orders->convertToCents($setupFee, $paymentForm->currency),
'currency' => $paymentForm->currency,
Expand Down Expand Up @@ -197,7 +197,7 @@ private function handleSubscription(PaymentForm $paymentForm, $postData, $metada

// One time fees
if ($paymentForm->subscriptionType == SubscriptionType::SINGLE_PLAN){
if ($paymentForm->singlePlanSetupFee){
if ($paymentForm->singlePlanSetupFee && $paymentForm->singlePlanSetupFee > 0){
$oneTineFee = [
'amount' => Stripe::$app->orders->convertToCents($paymentForm->singlePlanSetupFee, $paymentForm->currency),
'currency' => $paymentForm->currency,
Expand Down

0 comments on commit 052b0b7

Please sign in to comment.