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

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -