vexor.subscribe()
Subscription Creation
The vexor.subscribe()
method allows you to create subscription checkouts for various platforms. It supports both a generic method and platform-specific shortcuts.
The vexor.subscribe()
method and its platform-specific shortcuts (vexor.subscribe.mercadopago()
, vexor.subscribe.stripe()
, vexor.subscribe.paypal()
) can be used after instantiating Vexor with the project ID and publishable key. The secret key is not mandatory for this method.
Methodvexor.subscribe(params)
vexor.subscribe()
Create a subscription checkout for a specified platform.
Parameters
Returns
Returns a Promise that resolves to a VexorSubscriptionResponse object.
Usage Examples
Here are some examples of how to use the vexor.subscribe()
method:
Generic Usage
- Generic usage:
vexor.subscribe.stripe()
- Platform-specific shortcut for Stripe:
vexor.subscribe.mercadopago()
- Platform-specific shortcut for MercadoPago:
vexor.subscribe.paypal()
- Platform-specific shortcut for PayPal:
Choose the method that best fits your application's needs and the payment platform you're using.
The vexor.subscribe()
method and its platform-specific shortcuts (vexor.subscribe.mercadopago()
, vexor.subscribe.stripe()
, vexor.subscribe.paypal()
) all return a Promise that resolves to a VexorSubscriptionResponse object. This object contains the subscription URL, a unique identifier, and the raw response from the payment platform.