php - update stripe plan with incorrect amount due -
i m using stripe payment. works fine exept 1 thing.
i have 4 different plans : free(0€) / free + (4,90€) / premium (49€) / premium + (53,90€).
the user can update subsciption, :
// $plan variable ajax request $newplan = $plan; // find name of current user's plan in database $payment = $em->getrepository('cacpaymentbundle:payment')->findonebyuser($id); $customerid = $payment->getcustomerid(); // update user's stripe plan $cu = \stripe\customer::retrieve($customerid); $planid = $cu->subscriptions->data[0]->id; $subscription = $cu->subscriptions->retrieve($planid); $subscription->plan = $newplan; // update plan in database $subscription->save(); $payment->setplan($newplan); $em->persist($payment); $em->flush();
here probleme : in stripe office, user has right plan amount due not correct.
when update free + premium extra, amount due 102€ , few cents
i don't understand why amount not correct , plan correct
any idea welcome :)
thanks
stripe calculates percentage of subscription respect time.
that's why amount not 1 wanted
Comments
Post a Comment