How to configure custom payment gateway

241 views
Skip to first unread message

ravi teja

unread,
Mar 14, 2017, 9:26:23 AM3/14/17
to Shopizer
Hi,

Can someone tell me how to configure custom payment gateway or wallet(ex: paytm ) in my application to accept payments.

carlo

unread,
Mar 27, 2017, 12:03:38 PM3/27/17
to Shopizer
The easiest way to do this is to look at another payment module

for instance com.salesmanager.core.business.modules.integration.payment.impl.StripePayment

1) have to implement PaymentModule interface which requires to add code for 

validateModuleConfiguration : When creating a UI from the admin this method will be invoked for validating payment configuration
authorize : when doing an authorize on the payment
authorizeAndCapture : when you want to process a payement
capture : when you want to process a payment that was captures
refund : yep for refund

2) create a configuration for this payment module in integrationmodules.json with gateway details

{
"module": "PAYMENT",
"code": "stripe",
"type":"creditcard",
"version":"",
"regions": ["US","CA","GB","AU","FI","DK","IE","NO","SE"],
"image":"stripe.png",
"configuration":[{"env":"TEST","scheme":"https","host":"www.stripe.com","port":"443","uri":"/"},{"env":"PROD","scheme":"https","host":"www.stripe.com","port":"443","uri":"/"}]

}

** don't forget to reload data

If you want to build a UI in the admin to let you configure your payment you should look as an example shopizer\sm-shop\src\main\webapp\pages\admin\payment\stripe.jsp

Create a jsp havint he name <payment code>.jsp and drop it in webapp/pages/admin/payment

Upon submission you configurations will be saved in the DB and ready to be used at runtime in your PaymentModule class
Reply all
Reply to author
Forward
0 new messages