vexor.connect()
Account Connection
The vexor.connect()
method allows you to connect accounts to various payment platforms. It supports both a generic method and platform-specific shortcuts.
The vexor.connect()
method and its platform-specific shortcuts (vexor.connect.mercadopago()
, vexor.connect.stripe()
) can be used after instantiating Vexor with the project ID and secret key. The secret key is mandatory for this method.
Also take into account that most of the methods in this section will only work if you are also using the vexor.webhook()
method.
Methodvexor.connect(params)
vexor.connect()
Connect an account to a specified payment platform.
Parameters
Returns
Returns a Promise that resolves to a VexorConnectResponse object.
Usage Examples
Here are some examples of how to use the vexor.connect()
method:
Generic Usage
- Generic usage:
vexor.connect.stripe()
- Platform-specific shortcut for Stripe:
vexor.connect.mercadopago()
- Platform-specific shortcut for MercadoPago:
Choose the method that best fits your application's needs and the payment platform you're connecting to.
Additional Connect Methods
vexor.connect.auth() (MercadoPago only)
Authenticate and get credentials for a MercadoPago account.
vexor.connect.pay()
Create a payment using a connected account.
vexor.connect.dashboard() (Stripe only)
Get a URL for accessing the Stripe Express dashboard.
vexor.connect.auth.refresh() (MercadoPago only)
Refresh the credentials for a connected MercadoPago account.
vexor.connect.refund()
Refund a payment made with a connected account. This method supports both generic and platform-specific usage.
Generic Usage:
Platform-specific Usage:
The method accepts the following parameters:
Returns
Returns a Promise that resolves to a VexorConnectResponse object:
All vexor.connect()
methods and their platform-specific shortcuts return a Promise that resolves to a VexorConnectResponse object. This object contains the connection URL, a unique identifier, and the raw response from the payment platform.