Stripe Refund implement in Mendix :

Everything must be immediate in today's world; from coffee to connections, it's all about getting what you want now. Why should reimbursements made online differ from other methods? Refund processing typically takes 7 to 10 days for clients to request one.

Occasionally, this wait can be unbearable. Consider a client who has purchased a costly item online, like an Air Conditioner. Not more than a week should pass before customers receive a refund if they must cancel for some reason. Customer experience may be impacted by the lengthy refund cycle.

"Many people don't understand why refunds aren't as immediate when internet payments can be done in a matter of minutes. An unfavorable brand perception may result from this refund processing delay. "

Online refunds do, however, take some time for a cause. We must look more closely at the refunding procedure in order to comprehend this.

The Refunding Process for Online Payments

Online transactions include a minimum of three parties: the customer who initiates the payment, the business that receives the payment, and the intermediary.

In general, it is uncommon for the banks of the customer and the merchant to match. A payment gateway is used by merchants to manage the transaction between these two parties. The intermediary between the initiating bank and the acquiring bank is a payment gateway.

The request has to be processed through this network when an online refund process is started due to a failed transaction or a cancelled transaction on the part of the merchant or the customer. The refund request will initially be received by the payment gateway. The gateway will then use APIs to send this information to their banking partner. The banking partner must then inform the bank that the customer used to initiate the transaction. The refund is lodged and processed once it has been communicated to and approved by all parties. The sum doesn't appear in all accounts until this is finished.

The fact that not all banking system processes are fully automated is the reason why this takes time. They occasionally require manual approval. These requests take time to file and map because the online refund process involves at least three parties and occasionally more.

Refunds for cash-on-delivery purchases are handled quite differently. It entails validating the transaction, getting client bank account information to execute the refund, picking up the item, and starting the return amount.

Stripe Refund implement in Mendix:

You will need an account on Stripe in order to access the Stripe Refund API. Create the Stripe account here https://dashboard.stripe.com and generate the API key for authorization. The secret key and publishable key will be visible in the dashboard.

Click the eye icon, then the value, to copy it. **Make a note of it for future reference. **

Once the Payment is done in stripe. We will start the Refund Process:

NOTE :

Capture the Payment Intent after the payment process.

Next, we need to create the domain model. We only need Four fields on our entity and then we can generate the overview pages for the requests.

After creating the domain model and generating the overview pages, we need to make the JSON structure for the data mapping.

Click anywhere in or on the module and select Add other →JSON structure

After creating the JSON structure right-click on the module and select “Add other” → “Import mapping”.

Finally, make sure to click on “Expand all” → “Check all” in order to ensure all fields from the API are mapped.

After creating the JSON structure right-click on the module and Select Add other →Import mapping

Then we need to create a new microflow to call the API from our app.

Below you can see an example of my implementation:

Add this microflow to the Refund button to get the response.

Call Rest Service Activity Configuration

METHOD : Post

Location : https://api.stripe.com

Headers :

Content-Type: “application/json”

Authorization: “Bearer sk_test_51NQ6ImEWS**********0Z2s9k4iu

Headers :

Refund Output in Mendix

Refund Output in Stripe:

I hope this article helped you to understand how to use Stripe Refund API in Mendix. Thank You for reading this!