Stripe payments with Business Logic?

Anyone know if you can process payments using Stripe on the server side?
I’d like to create an app which sells a limited number of products. Do I need to run stock checks and process payments on the server side to ensure 2 people don’t accidentally buy the last item in stock at the same time?
Any advice in this area would be much appreciated.
Cheers

Hi Gurminder,

You can integrate Stripe in your custom business logic. Make sure to register an external host where Stripe API is available. This way you can start making calls to Stripe from your server-side code running in Backendless.

I am sorry, I didn’t understand the following question: “Do I need to run stock checks and process payments on the server side to ensure 2 people don’t accidentally buy the last item in stock at the same time?”

Regards,
Mark

Thanks Mark for the prompt response.

Yeah I didn’t make it very clear. I’ll try again;

I was just thinking about the process involved of having a mobile app to purchase products. Let’s say there is only 1 item left and 2 people are browsing it at the same time. If they both click buy, both of them will goto the checkout screen, then both users will have their cards charged (via Stripe) and only one person will have an item. How do I avoid this? Do I need to use async server side code/business logic?
Cheers
G

Hey G,

You could use the Atomic counters API to maintain the count of available items in the inventory:
https://backendless.com/documentation/utilities/android/ut_atomic_counters_api_android.htm

Any time someone places an item into the shopping cart, you would decrement the counter. If they abandon the shopping cart and do not complete the transaction, you increment the counter.

Regards,
Mark

Thanks Mark :slight_smile:

Appreciate it.