StartEnd application (before/after payment)

Updated

Define a Pre/Post processing payment service

  1. Code your JavaScript StartEnd Service using TetraJS
  2. Register your weblet as a started into IngeWeb in order to be enabled the service in the terminal
  3. Package your application
  4. Install your application

Create an application as Pre/Post processing payment operation


tetra.startEnd()
.on('SE_START',function(tlv,properties) {
  if(properties.isShortMode) {
    //do very short process
    this.sendResponse();
    return;
 }
 //can do long treatment
 else {
  tetra.weblet.show();
  // ... do something with view
  // ...
  // ... then send response with new tlv or not, or directly send response
  this.sendResponse ();
  tetra.weblet.hide();
 }
})
.on('SE_END',function(tlv,properties) {
  if(properties.isShortMode) {
    //do very short process
    this.sendResponse();
    return;
  }
  //can do long treatment
  else {
    tetra.weblet.show();
    // ... do something with view or directly send response
    // ...
    // ... then send response with new tlv or not
    this.sendResponse ();
    tetra.weblet.hide();
  }
});

0 comments

Please sign in to leave a comment.