createPaymentSession - Payment Module Reference

This documentation provides a reference to the createPaymentSession method. This belongs to the Payment Module.

NoteYou should only use this methods when implementing complex customizations. For common cases, check out available workflows instead .

This method creates a payment session in a payment collection.

Example#

Code
1const paymentSession =2  await paymentModuleService.createPaymentSession(3    "pay_col_1",4    {5      provider_id: "stripe",6      currency_code: "usd",7      amount: 3000,8      data: {},9    }10  )

Parameters#

paymentCollectionIdstring
The ID of the payment collection to create the session for.
The details of the payment session.
sharedContextContextOptional
A context used to share resources, such as transaction manager, between the application and the module.

Returns#

PromisePromise<PaymentSessionDTO>
The payment collection's details.
Was this page helpful?