createTransaction( )


Retrieves information about a newly created payment provider transaction.

This function is called by Wix Payments when a site visitor places an order on your site. The code implemented in this function creates a new transaction with a payment provider. The function returns the transaction information, or error information if transaction creation fails. Wix uses the return values from this function to add the new transaction to your site.

Note: This function has a second parameter called context. This parameter is for internal Wix use only. You don't need to use it in your code.

Where to find createTransaction()

When you add the Payment Provider service plugin, a folder is automatically added to your site. Use the .js file in the folder to write the custom code for your payment provider.

For more information on customizing your payment provider, see Tutorial: Payment Provider Service Plugin.

Method Declaration
Copy
Method Parameters
optionsCreateTransactionOptionsRequired

Information to use when creating a new transaction.


contextContextRequired

Metadata about the request.

Returns
Return Type:Promise<CreateTransactionResponse>
Was this helpful?
Yes
No