api - Multiple charges to equal specified amount using Stripe -


getting confused on how should set up. need charge customer 2 separate amounts on 2 separate dates provide. provided total , able choose 2 dates charged , how on each date.

after reading through docs , faqs on stripe's website day, think might know how tackle this.

  1. create customer.

  2. setup plan specified amount want pay , calculate how many days until should charged using trial_end start on specified date.

  3. listen first charge. cancel current plan, take second amount , preferred charge date (stored in database) , create new plan. again, using trial_end charge on correct date provided.

  4. listen second charge , cancel plan.

is ideal way accomplish want? trying not waste bunch of time, have tight deadline project. appreciate insight. thanks!

i'd recommend following.

  1. create customer , store customer token
  2. store 2 dates in database
  3. write script looks 1 of 2 dates , tries run charge customer token. schedule cron or similar scheduler.
  4. on charge failure or denied, act accordingly
  5. on success, delete customer token, , act accordingly

Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -