One of our clients requested several times that we set him with a recurring payment.
Initially we thought that was not that important and we kind of dismissed it.
The lesson here was (again) to pay a close attention to client requests. Maybe we should have asked the client how important that was from a scale of 1 to 10 and then decide if we should implement right away or with a delay or ignore the request.
Here's a video explanation to this blog post too:
Over the last two months we’ve noticed that the client paid the invoice in about 1-2 weeks and after several email reminders. We have clients that pay our invoices hours after an invoice is sent out. There are also others, however, that pay in about 3-6 months which is not good. In the latter cases we have a chat and continue working only with a payment in advance.
Ok back to the Stripe Subscription Product.
The thing that made it really clear that recurring payment was really important for the client is that the client mentioned that out of all the invoices he has to pay ours was the only manual one. That hurt and we had to come up with a solution.
We at Orbisius (and all other brands such as qSandbox, WPSandbox.net, WPdemo.net) are all about productivity and building tools that and saving people time & money.
We had to come up with a solution.
The initial plan was to set up a dedicated site just for the billing but that was going to take some time to properly implement and test. We're dealing with money after all.
We’ve decided to check if it was possible to set this up via the Stripe’s control panel.
It turned out that we could do about 95% of the stuff from the UI and about 5% with little bit of Stripe API calling.
In our case the customer has made 2 payments via Stripe so we didn’t have to ask for a credit card or ask him to do re-enter it which was nice.
- The customer must have made at least one payment via Stripe.
- Some programming skills OR access to command line of a Linux machine.
As of the time of writing it was not possible to directly link the payment method id to an existing customer profile which is odd. That’s why it was necessary to use the Stripe payment_methods API and call attach method for that customer.
I’ve chatted with Stripe reps and they’ve confirmed that.
- Create a product
- Create a pricing
- Create a customer
- Attach payment to the customer
- Set up recurring subscription
Create a product
To create a product go to: https://dashboard.stripe.com/subscriptions/products
Next, create a pricing.
Make sure you set this up correctly because you can’t update the pricing for some odd reason.
See more on this discussion.
Create a customer
To create a customer go to:
Attach payment to the customer
To do this you need to get
- your Stripe secret API key
- customer id
- payment method id
- access to either programming language or Linux command line
I chose to use the example provided in the API that used a Linux program called curl instead of writing things in a programming language.
The API endpoint that we need to call is this:
To get the API keys go to: https://dashboard.stripe.com/apikeys
To get payment id go https://dashboard.stripe.com/payments and then click on the payment you want to view. Scroll down to “Payment method” section and look for ID.
It should start with pm_.....
To find the customer id go to Customers and click on the record you want.
Look for the ID field in the record.
To attach a payment to a customer you need to get its id.
Important: Make sure you replace these parameters in the snippet above with yours.
If you've missed a detail or if the Stripe's API has changed you will get an error in JSON format.
"message": "No such PaymentMethod: pi_oaisf8u3uasf9ouasf",
Set up recurring subscription
To set up a recurring subscription go to this link and click on New button.
If you’ve followed the previous steps you should be able to create the subscription without any issues.
Just follow the prompts on the page.
- Stripe Subscription Product
- How to Set Up Stripe Subscription Product
- How to Set Up Stripe Subscription Product an Existing Payment Charge
- How to Set Up a Recurring Subscription Payment from Stripe Control Panel
- How to Set up a Recurring Subscription Payment from Stripe Control Panel mostly
- How to Set up a Stripe Recurring Subscription Payment from an Existing Payment Charge