Payment Process – Need Help with Payment Process Using Stripe

Architecturedesignpaymentprocess

I am not sure which stackexchange website is correct website to post this question.

I haven't worked on payment process before – and I need help with payment process using Stripe –

we are developing a website in which we will be selling items from different businesses.

Now the flow of the Application is like this:

  1. Customer comes to our system and signs up
  2. Customer searches for a business
  3. Customer adds items from that business to a shopping cart
  4. If the customer selects pay online we get the debit card information and generate a token using Stripe.

  5. Now an order can only be placed if the business accepts the order. For this we have a Dashboard where the Business user will login and wait for the orders.
    As soon as the order is placed by the customer the Dashboard receives a notification (SignalR connection). The business owner then can accept or decline the order.

If declined we notify the customer that order was declined.
If accepted we notify the customer that order was accepted.

Question:

Now the problem I am having understanding is that when do we charge the client/customer?

We have a token generated on the Browser using Stripe. But we only want to charge the Customer if the order is accepted.

The problem with charging the customer AFTER the order is accepted is that WHAT IF the CARD details entered by the customer where incorrect? In this case the charge will fail – but the Admin has already been notified about the order and the Admin has accepted it.

The problem with charging the customer BEFORE is that what if the Admin declines the order. In this case we will have to issue a refund – Which might make the customer upset and not use our system in the future?

What is the best way to do this?

When do we charge the customer?

Best Answer

This is a business rule.

The answer is you write business logic code in a business logic layer that says when to charge the customer. You don't dictate this with your design. You implement whatever your boss decides to do. Do it in a way they leaves your boss free to change their mind later.

Don't turn your company into either an escrow or a credit service without letting your boss know.

Related Topic