Projects:LoyaltyManagement/Technical Guide/PaymentConnector
Contents |
How to create a Payment Connector for loyalty
Introduction
This document explains an example how to create a payment connector for the redemption of loyalty points. In this case it is useful to get used to work with payment connector on WebPOS. You can find some information on the following link. http://wiki.openbravo.com/wiki/Retail:Developers_Guide/External_Payment_Providers
Create the kind
You will need to know the basics of Openbravo's JavaScript code, such as modularization, Component Providers, etc...
Here you can find an example of a dummy implementation of a payment connector for loyalty.
It is useful to extend from OBLOY_.UI.PaymentProvider kind since there is already implemented a payment connector.
enyo.kind({ name: 'SALOY_.UI.PaymentProvider', kind: 'OBLOY_.UI.PaymentProvider', initComponents: function () { this.inherited(arguments); } });
The payment connector is extensible so you can modify the components and the functions of the predefined payment connector.
In order to see if the default Payment Connector fits your development go to the Functional Specs. Link to functional specs pending
Parameters
When you extend a kind you can override some values, we have some defined that will change the behavior of the connector:
- isAllowedToCancel
Set as true to allow voiding a transaction done with loyalty program. (Set as false by default)
- isPinAllowed
Set as true to ask for a PIN while paying with loyalty program. (Set as true by default)
Example:
enyo.kind({ name: 'SALOY_.UI.PaymentProvider', kind: 'OBLOY_.UI.PaymentProvider', // In case you don't want PIN isPinAllowed: false, initComponents: function () { this.inherited(arguments); } });