You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Seting billing address and shipping address to useruser.setBillingAddress(billingAddress)user.setShippingAddress(shippingAddress)//or in case both address are the sameuser.setBillingAddress(billingAddress)user.setShippingAddress(billingAddress)
//Merchant signing on transactionconstsignedTxn=merchant.signTransaction(user,transaction)
7.1 Initiate payment
7.1 Initiate payment with all options
//Redirecting to EBS payment portalapp.get('/pay',function(req,res){
...
...
constsignedTxn=merchant.signTransaction(user,transaction)merchant.initiatePayment(signedTxn,function(error,body){res.send(body);// body contain form element which loads the EBS portal based on your configuration.})...
...
});
7.2.2 Initiate Payment with signed transaction with stored card
app.get('/pay',function(req,res){
...
...
constsignedTxn=merchant.signTransaction(user,transaction,storedCard)merchant.initiatePayment(signedTxn,function(error,body){res.send(body);// body contain form element which loads the EBS portal based on your configuration.})...
...
});
7.3.2 Initiate Payment with signed transaction with stored card
app.get('/pay',function(req,res){
...
...
constsignedTxn=merchant.signTransaction(user,transaction,preferedBank)merchant.initiatePayment(signedTxn,function(error,body){res.send(body);// body contain form element which loads the EBS portal based on your configuration.})...
...
});
8. Using example
cd examples
npm install
export EBS_KEY=<EBS_MERCHANT_KEY> EBS_ACCOUNT_ID=<EBS_MERCHANT_ACCOUNT_ID>
npm start
go to localhost:8000