MethodsPayment Method | Fire Snippets Docs
Payment Method
Processes payments via Stripe when a button is clicked.
payment(snippetId, variables)
Description
Processes payments by creating a payment link via your backend and redirects the user to the payment page when a button is clicked. It can include additional metadata in the payment request.
Method Signature
Parameters
- snippetId: (string) The ID of the payment snippet configuration.
- variables: (Array) An array of objects containing variable names and values to include as metadata in the payment request.
Returns
- Promise: Resolves with the payment link URL upon successful creation, or rejects with an error.
Usage Example
HTML Elements Required
Ensure your HTML includes the following element with the ID specified in your snippet configuration:
Note: The user is automatically redirected to the payment page upon successful creation of the payment link.
Was this helpful?