npm install @xmoney/api-sdk
import InlineCheckoutApiSdk from "@xmoney/api-sdk";
const inlineCheckout = new InlineCheckoutApiSdk({
secretKey: "mySecretKey",
});
const order = inlineCheckout.initializeCheckout({
siteId: 1,
customer: {
identifier: "customerIdentifier",
firstName: "John",
lastName: "Doe",
country: "RO",
city: "Bucharest",
email: "[email protected]",
},
order: {
orderId: "myUniqueOrderId",
description: "Order Description",
type: "purchase",
amount: 100,
currency: "EUR",
},
cardTransactionMode: "authAndCapture",
backUrl: "https://127.0.0.1:8080",
});
import InlineCheckoutApiSdk from "@xmoney/api-sdk";
const inlineCheckout = new InlineCheckoutApiSdk({
secretKey: "mySecretKey",
});
const webhookPayload = 'ecryptedPayload';
console.log(
inlineCheckout.decryptOrderResponse(webhookPayload)
);