Trigger Payment

This method explains how to redirect user to Gopay app for payment completion. It returns a promise that resolves with the success data. The payment result will be returned when the user returns to miniapp after completing or cancelling payment.

📝

Note

Merchant should request to whitelist deeplink to make this work. Please connect with our product/support for this.

Integration NeededDetails
Mini App FrontendAvailable since: GoPay 1.45.0
Mini App npm SDK VersionAvailable since: 0.3.19

Sample Request:

// fetch the deeplink from your miniapp backend
const paymentDeeplink = 'gopay://...';

miniAppSdk.triggerPayment({ deeplink: paymentDeeplink }).then((result) => {
  console.log('Payment status:', result.data.status);
});

Sample Response:

Success Response:

 {
  success: true,
  data: {
      status: "success"
  }
}

Error Response:

 {
  success: false,
  error: {
      code: 300,
      message: "Permission denied"
  },
}
  • Data will be null in case of success = false, and vice versa.
  • Error will be null in case of success = true, and vice versa.

This service only requires frontend implementation.

Payment status values:

StatusDescription
successUser has successfully paid the transaction
cancelledUser cancelled the transaction
failedThere's an error processing the transaction
pendingUser goes back to the miniapp without completing or cancelling the payment

Possible Error Codes:

Error CodeDescription
200Incomplete parameter error
201Invalid parameter type error
202Parameter data error
401Network error