expo customize:web
to expose an HTML file, which I can then use to pull in Durianpay. If youโre not using expo, you can skip this point. Just use your index.htmldpay-node-sdk
via your package manager of choice.const dpay = new Durianpay({ secret_key: "your_secret_key", // Use your Sandbox or LIVE key });
This /create-order endpoint will generate an access token which the client will use to initialise the checkout.
createDurianPayOrder
is a method that hits the create-order endpoint via POST request.onSuccess
, onClose
and onError
callbacks. A known limitation Iโve come across is that Durianpay will force a refresh and take users to redirect_url
if user does not click the (x) button. This results in onSuccess
, onClose
and onError
callbacks not firing, meaning there is a risk of successful payment but fulfilment logic not being executed.
According to Durianpay, setting up a webhook is an optional step. I highly recommend it. Although it does not fix the refresh, it ensures logic is fired on your backend once payments and/or orders are completed regardless of client status.
Set up your webhook URL on Durianpay dashboard. Listen to order.completed
event
This URL should be whatever route your webhook is sitting on. In my case I have the route set up like so app.post("/api/dpay/webhook", DurianpayWebhook);
Therefore my webhook url is https://yourServerDomain/api/dpay/webhook
if (event === "order.completed") { //onSuccess logic here }
In this use case I am adding a user to a lobby on successful payment, alter this accordingly to suit your needs.
I have this backend deployed via fly.io and the frontend on vercel. Fly has been very impressive so far, similar to heroku but less salesforce bloat and a better experience all around.
Durianpay has an overall decent developer experience. What it lacks in documentation clarity has been more than made up for with prompt response to techincal queries. They even went as far as to add my team to a whatsapp group with some of their engineers which was and continues to be invaluable
The business impact has been fantastic, the ability to enter the indonesian market and gain access to the many country specific payment options proves to be extremely useful.
Seeing how bigger players like stripe, square and xendit all have rather high barriers to entry and or a lack of support for the market, I would recommend Durianpay to any startup looking to break into the space.
Come have a look at Playardโs implementation of Durianpay. Users pay for a slot in a curated game of sport catered to their needs and preferences. There are also wallet, payout and lobby monetisation features, all of which are powered by durianpay.
@playard.id Nguji skill pemain basket lapang umum. Ternyata rame banget!! ๐ฅ #basketball #basketballchallenge #bandung #basketbandung
โฌ Laugh Now Cry Later - Drake
Join a game, sweat it out and make some friends in the process ๐