Setup Recurring
Last updated
Was this helpful?
Was this helpful?
const { PaymentClient } = require('hyperswitch-prism');
const paymentClient = new PaymentClient({
connector: 'stripe',
apiKey: 'YOUR_API_KEY',
environment: 'SANDBOX'
});const request = {
merchantRecurringPaymentId: "recurring_001",
amount: {
minorAmount: 2900,
currency: "USD"
},
paymentMethod: {
card: {
cardNumber: { value: "4242424242424242" },
cardExpMonth: { value: "12" },
cardExpYear: { value: "2027" },
cardCvc: { value: "123" },
cardHolderName: { value: "John Doe" }
}
},
address: {
billing: {
line1: "123 Main St",
city: "San Francisco",
state: "CA",
zip: "94102",
country: "US"
}
},
authType: "NO_THREE_DS",
setupFutureUsage: "OFF_SESSION"
};
const response = await paymentClient.setupRecurring(request);{
merchantRecurringPaymentId: "recurring_001",
connectorRecurringPaymentId: "seti_3Oxxx...",
status: "ACTIVE",
mandateReference: {
mandateId: "pm_3Oxxx...",
mandateStatus: "ACTIVE"
},
statusCode: 200
}