NETBANKING
Request Details
| Parameter Name | Data Type | Mandatory | Description |
|---|---|---|---|
merchantOrderId | String | yes | Unique order ID generated by merchant |
amount | long | yes | Amount of order in Paisa |
contraints | List<InstrumentConstraint> | yes | Different type of constraints that must be applied to the payment |
bankId | String | yes | Bank id from where payment will be completed. |
Example :
import {CustomCheckoutClient, Env}
from 'pg-sdk-node'
import { PgPaymentRequest, PgPaymentResponse }
from 'pg-sdk-node';
import { v4
as uuid }
from 'uuid';
const clientId:
string = "<clientId>";
const clientSecret:
string = "<clientSecret>";
const clientVersion:number = 1; //insert your client version here
const env = Env.SANDBOX; //change to Env.PRODUCTION when you go live
const client = CustomCheckoutClient.
getInstance(clientId, clientSecret, clientVersion, env);
const merchantOrderId =
uuid();
const amount = 100;
const bankId = 'HDFC';
const merchantUserId = '';
const request = PgPaymentRequest.
NetBankingPayRequestBuilder()
.
merchantOrderId(merchantOrderId)
.
amount(amount)
.
bankId(bankId)
.
merchantUserId(merchantUserId)
.
build();
client.
pay(request).
then((response) => {
const redirectUrl = response.redirectUrl;
});Extract the redirectUrl from the response received
Response Details
| Property | Type | Description |
|---|---|---|
orderId | String | Order Id created by PhonePe |
state | String | State of the order. Initially it will be PENDING. |
expireAt | Long | Order expire date in epoch |
redirectUrl | String | Redirect url to perform the Net Banking for mentioned bankId |