-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suggestion: Rewrite in Typescript? #16
Comments
Hi @brijmcq thanks for the idea & suggestion. While we absolutely agree Typescript is nice and have many benefits, we did review the possibility of that some time ago, but we decided it is not yet good fit for this package due to:
However, here's the good news: Thanks! |
@rizdaprasetya thanks for the reply. I have a client that wants to use your platform and I was kinda late to see that this library existed so I basically recreate some of the functions you already have. I will share it once we started using it in production |
@dimaqq I'm not asking for the maintainer to rewrite it in TS, I'm offering help just in case there's an effort already on going to do it. Of course, if I really want it I'll just fork the project and do it on my own :D |
@brijmcq consider |
@dimaqq that could work. But I also want to rewrite some of the code to make it easier to set it up ( might not be practical given the small number of users ) Take a look at the example code for notification
This notification is handling transactions for credit card users, but other payment channels are not yet considered here. Imagine adding more code to handle other payment channels. If possible, it would be better to have a smooth developer experience where they could integrate your platform in less than 5 or 10 minutes in a custom backend A developer would just provide their code on how to handle these events. Maybe something like this: Where the 2nd parameter will handle the necessary events
Or handle it by payment type since they have different return data. For instance, transanction_status for GoPay are "pending, settlement, expire and deny" while for credit card are "capture, deny and authorize"
Your platform reminds me of Stripe. I guess more devs will use this if there''s more real-world examples. That's just my two cents |
Hehe, no worries guys, we were expecting this question will shows up. It's open source world, so people can (and will have) preferences. @brijmcq Good to hear you are already writing similar functionality in TS, would be good options for those prefer TS. Feel free to publish to NPM, and (if you wish) let us know if you made one, we'll list it on our docs so people can choose their preference. That's some interesting idea with callback/event-based function. |
@rizdaprasetya just curious what are those use cases? In my experience, I guess the hardest part is the notification. Sending transaction is very easy, but handling the notification is hard since there are a lot of variables that could affect the payment and many different scenarios. |
Well I can't exactly describe the unusual ones. But even with usual scenarios, there are many variations. that is largely due to these variable:
So if one want to create callback/event-based function, he should consider based on which: one of those? two of those? or all of those? Which then will impact the "permutation" number of callbacks, eg: So that what's majorly different with Stripe, in Indonesia the payment channels is more fragmented and each payment channels have its own limitation/behaviour (e.g: only card have |
I definitely agree that those 3 variables made it very hard to integrate it with a custom backend. That's also the source of my pain points now. Right now, we're planning to enable selected payment type first ( gopay and bank transfer ). I'm still thinking what would be the best way to handle this complexity that's why I'm asking for edge cases :D Basically, we're doing a divide and conquer here because just like what you've said, there's a lot of combinations here that we may need to handle. I guess implementing all the payment type at once is not practical and would take a lot of time instead of focusing on the other features of our app. If I have more time, I'll try to create a tutorial about this |
@brijmcq yes, nice 👍 I can give some insight with Gopay & BankTransfer. It is quite straight forward overall for both, there's only these major status: Other thing: you can re-fetch VA number via |
Thanks for the tip. | Gopay short lived 15 mins. |
Oops sorry missed the notification for this reply. Can also be overriden by |
Thanks for this awesome SDK. Are there any plans to rewrite this in Typescript? I would love to help
The text was updated successfully, but these errors were encountered: