Introduction

Developer Preview
APIs in Developer Preview are subject to change and are not intended for use in production.
Send us your suggestions for improving this API. Your feedback is valuable to us.

The Payment Provider Backend API allows you to report transaction and refund events when implementing the Payment Provider Custom Extension. Use it together with the Payment Provider SPI.

Learn more about implementing a Payment Provider Custom Extension.

Did this help?

submitEvent( )


Updates the status of a transaction or refund.

The submitEvent() function returns a Promise that resolves to void when the status of a transaction or refund is updated.

Use this function with the Payment Provider SPI and HTTP functions to allow payment providers to send your site updates about refunds and transactions.

The status of a transaction or refund is updated based on the properties included in the argument passed to this function. See the code examples for details.

Learn more about implementing a Payment Provider Custom Extension.

Method Declaration
Copy
function submitEvent(submitEventRequest: SubmitEventRequest): Promise<void>;
Method Parameters
submitEventRequestSubmitEventRequestRequired

Submit event request object.

JavaScript
import wixPaymentProviderBackend from "wix-payment-provider-backend"; /* * Sample submitEventRequest value for a transaction: * { * event : { * transaction: { * wixTransactionId: '3e01dda6-134e-4cc9-a37f-ed2bf756c684', * pluginTransactionId: '22001-123123' * } * } * } */ export async function updateTransaction(submitEventRequest) { try { await wixPaymentProviderBackend.submitEvent(submitEventRequest); console.log("Transaction updated successfully."); return; } catch (error) { console.error(error); // Handle the error } } /* Promise resolves to void */
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?