Skip to content

Examples ​

Example 1 ​

This page demonstrates usage of some of the plugin code provided by Cordova Codeeshop Cespay.

js
CustomPayment.startPayment({
  url: 'YOUR_PAYMENT_REDIRECT_URL', 
  callbackErrorURL: 'YOUR_PAYMENT_FAILURE_URL', 
  callbackSuccessURL: 'YOUR_PAYMENT_SUCCESS_URL'
})

// Return Payment Response Event
window.addEventListener('paymentmessage', this.paymentCallBack)

function paymentCallBack(e) {
  if(typeof e.detail != 'undefined') {
    console.debug(e.detail.data, 'paramsparams1')
  } else {
    console.debug(e, 'other paramsparamsparams')
  }
}
CustomPayment.startPayment({
  url: 'YOUR_PAYMENT_REDIRECT_URL', 
  callbackErrorURL: 'YOUR_PAYMENT_FAILURE_URL', 
  callbackSuccessURL: 'YOUR_PAYMENT_SUCCESS_URL'
})

// Return Payment Response Event
window.addEventListener('paymentmessage', this.paymentCallBack)

function paymentCallBack(e) {
  if(typeof e.detail != 'undefined') {
    console.debug(e.detail.data, 'paramsparams1')
  } else {
    console.debug(e, 'other paramsparamsparams')
  }
}

Live Demo ​