How to use the @mollie/api-client.SequenceType.recurring function in @mollie/api-client

To help you get started, we’ve selected a few @mollie/api-client examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mollie / mollie-api-node / examples / customers / create-recurring-payment.ts View on Github external
(async () => {
  try {
    const customerId = 'cst_pzhEvnttJ2';

    const payment: Payment = await mollieClient.customers_payments.create({
      amount: { value: '10.00', currency: 'EUR' },
      description: 'Recurring payment',
      redirectUrl: 'https://example.org/redirect',
      webhookUrl: 'http://example.org/webhook',
      metadata: { orderId: 'Order #23' },
      customerId,
      sequenceType: SequenceType.recurring,
    });

    console.log(payment);
  } catch (error) {
    console.warn(error);
  }
})();