Hi Everyone,
I am working on a product and I want to integrate multiple payment gateways. The problem is I want to create an abstraction for many of the payment gateways out there. Currently I have the following gateways to work on,
- Paytm
- Razorpay
- Hyperpay
- Stripe
- Cybersource
Currently I have following abstraction:
package gateway
type Gateway interface {
GenerateKey(amount int)
Save()
Authorize()
Payment
}
type Payment interface {
Charge(amount int)
Refund(paymentId int,amount int)
}
All the above gateways behave differently and I would like to implement these under one roof. Any suggestion will be really helpful.