Question

I would like to process credit cards in my webapp. I do not need recurrent billing in the app.

Instead I would like to implement payments triggered by a certain event: for example, based on a fact that a user did/did not do some action in the app.

For instance, Gym Pact charges the user's card if the user does not log in the app from a certain location at a certain time.

Which SaaS payment solution can I use to implement such functionality?

So, basically I need a payment solution that allows my app to charge the user when the app needs to, but not when the user clicks the "Confirm payment" button.

P.S. I am also interested in the way the cards' numbers are stored and security means to maintain that (you need to have the card's number stored to charge it on certain events, right?).

Was it helpful?

Solution

If you want to make ad-hoc charges, then you simply need to work with a payment service provider that offers 'payment token' services. Most of them do these days.

The business logic is something like:

  • When user signs up, they register their credit card details (via web, speaking directly to payment gateway)

  • Payment gateway stores the card details in a PCI compliant manner, and returns to you a token id.

  • You store the token id and link it to the user.

Then, whenever you want to make a charge against that card you submit payment details to the gateway using the token id to refer to the card. The only things to be aware of is that card details will become invalid over time, either expire or reported as lost/stolen by the cardholder etc. You need logic to handle these types of situation and allow card details to be updated where necessary

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top