Vexor

vexor.portal()

Billing Portal Creation

The vexor.portal() method allows you to create billing portal sessions for various platforms. It supports both a generic method and platform-specific shortcuts.

The vexor.portal() method and its platform-specific shortcuts (vexor.portal.mercadopago(), vexor.portal.stripe(), vexor.portal.paypal()) can be used after instantiating Vexor with the project ID and publishable key.

Methodvexor.portal(params)

vexor.portal()

Create a billing portal session for a specified platform.

Parameters

Returns

Returns a Promise that resolves to a VexorPortalResponse object.

const response : VexorPortalResponse = await vexor.portal({
platform: 'stripe',
  identifier: 'abc-123-def-456',
  returnUrl: 'https://example.com/return'
});

Usage Examples

Here are some examples of how to use the vexor.portal() method:

Generic Usage

  1. Generic usage:
const response : VexorPortalResponse = await vexor.portal({
  platform: 'stripe',
  identifier: 'abc-123-def-456',
  returnUrl: 'https://mystore.com/account'
});

vexor.portal.stripe()

  1. Platform-specific shortcut for Stripe:
const response : VexorPortalResponse = await vexor.portal.stripe({
  identifier: 'abc-123-def-456',
  returnUrl: 'https://mystore.com/account'
});

vexor.portal.mercadopago()

  1. Platform-specific shortcut for MercadoPago:
const response : VexorPortalResponse = await vexor.portal.mercadopago({
  identifier: 'abc-123-def-456',
  returnUrl: 'https://mystore.com/account'
});

vexor.portal.paypal()

  1. Platform-specific shortcut for PayPal:
const response : VexorPortalResponse = await vexor.portal.paypal({
  identifier: 'abc-123-def-456',
  returnUrl: 'https://mystore.com/account'
});

Choose the method that best fits your application's needs and the payment platform you're using.

The vexor.portal() method and its platform-specific shortcuts (vexor.portal.mercadopago(), vexor.portal.stripe(), vexor.portal.paypal()) all return a Promise that resolves to a VexorPortalResponse object. This object contains the portal URL and potentially raw data from the payment platform.

On this page