Global Payments HPP (Hosted Payment Page) SDK for RealexHpp integration
npm install global-payments-hpp-tsTypeScript SDK for Global Payments HPP (Hosted Payment Page) / RealexHpp integration.
``bash`
npm install global-payments-hpp-ts
`typescript
import { RealexHpp } from "global-payments-hpp-ts";
// JSON response from your backend endpoint
const exampleJsonResponse = {
MERCHANT_ID: "YOUR_MERCHANT_ID",
ORDER_ID: "ORDER_123456",
TIMESTAMP: "20231215120000",
AUTH_CODE: "AUTH123",
RESULT: "00",
// GP can ask other fields
};
const getJsonFromYourEndpoint = (): Promise
Promise.resolve(exampleJsonResponse);
const processPaymentForGP = () =>
getJsonFromYourEndpoint().then((json) => {
console.log(json);
RealexHpp.setHppUrl("https://pay.sandbox.realexpayments.com/pay");
RealexHpp.lightbox.init("autoload", "", json);
});
`
- setHppUrl(url: string) - Set HPP URL (sandbox or production)lightbox.init(mode, callback, json)
- - Initialize lightbox payment form
- Sandbox: https://pay.sandbox.realexpayments.com/payhttps://pay.realexpayments.com/pay`
- Production:
MIT