Introduction
Welcome to the PMC Graphene API documentation. This document contains an overview of PMC’s Graphene system, a brief description of the major tasks involved in the integration and the overall resources needed to support the integration effort.
The product integration details below define the activities required to integrate PMC’s Graphene services into the web host/web ePOS system. This document is targeted at developers of web HOST/web ePOS and should be used in conjunction with the product guide.
Definition
Terminology/Abbreviation | Description |
---|---|
HOST | Any website/ePos invoking Graphene Service like Scan,Print,Payment |
POS | Point of Sale |
Graphene | Graphene Mobile Application |
PSP | Payment Service Provider |
SECash | Service offered by Graphene |
Overview
The Graphene product consists of an application running on a mobile platform that allows a remote web host/web-enabled ePOS to perform the main retail functions:
- To Scan
- To initiate Payments through different Payment Providers (PSP)
- To Print on different printers
The current version of Graphene supports tablets running onwards:
- Android 4.1
- iOS 11.0
- Windows 10
Pre-Requisite
The first step to invoke Graphene is to include the below JavaScript files into your HOST. These js files will be provided by PMC.
JavaScript Files
-cordova_android.js Android
Download
-cordova_ios.js iOS
Download
-w_Plugins.js Windows 10
Download
Plugin files Android
iOS
Download
These JavaScript acts as a bridge to pass events from website or HTML page to native Graphene application.
<script>
var js = document.createElement("script");
js.type = "text/javascript";
if (navigator.userAgent.indexOf("iPad")>0 || navigator.userAgent.indexOf("iPhone")>0 || navigator.userAgent.indexOf("iPod")>0){
js.src = "js/cordova_ios.js";
}
else if (navigator.userAgent.indexOf("Android")>0){
js.src = "js/cordova_android.js";
}
else if (navigator.userAgent.indexOf("Windows")>0){
js.src = "js/w_Plugins.js";
}
document.body.appendChild(js);
</script>
// Below file is only for iOS and Android
<script type="text/javascript" src="js/plugins.js"></script>
The above tells the browser which version of Graphene API to load depending on device type used.
Scanning
The subsequent sections describe the major tasks involved in integrating Graphene’s barcode scanning service into your web host/web ePOS system.
Graphene supports the scanning using two methods:
- Scan using the
internal camera
– uses internal mobile device camera or use a 3rd party scanning SDK like Scandit - Scan using
External Bluetooth scanner
like opticon.
Attributes for Scan Request
This input attributes would help to create JSON request to call a specific request.
Attribute Name | Description | Mandatory(M)/ Optional(O) | Values/Example |
---|---|---|---|
ReturnURL | It should be supplied as a valid http url string. Example: returnURL: ‘http://yourhost.com/handlebarcodescanning' | O | http://example.com/handlingscanning |
Parameter | Specifies the key to use when returning data to the return URL. This is mandatory if ‘RETURNURL’ is present. Key should be supplied as a string. | O | Any valid string |
Method | Method to send data back to the webhost/server. This can be a GET or a POST . Mandatory if ‘ReturnURL’ is specified. |
O | GET or POST |
scanning_mode | single is by default value (Only applicable for Camera scanning ) |
O | single,multiple |
redirect_needed | true is by default value |
O | true,false |
orientation | By default it will take advanced settings configuration in case invalid value or value not provided in request. (Only applicable for Camera scanning ) |
O | RIGHT, LEFT, TOP, BOTTOM, FULL SCREEN |
getContinuesUpdate | false is by default value |
O | true,false |
Camera Scanning
This section gives detailed information to scan product using an internal camera
.
Insert JavaScript call in your website/host to activate the Scanning via Internal camera.
Follow steps as given in the example.
Step 1 : Include platform specific Graphene javascript file and plugin.js (Refer)
Step 2 : Create request for starting internal camera scanner.
Step1 : Include platform specific Graphene javascript file and plugin.js
Step 2 : Create request for starting camera scanner as shown below.
var paramPost ={
"returnURL":"http://yourhost.com",
"parameter":"data",
"method":"post",
"scanning_mode":"single",
"orientation":'left',
"redirect_needed":'true',
"getContinuesUpdate":"false"
};
window.plugins.cameraBarcodeScanner.scan(
function(result){
//result
},
function(error){
//error
},
paramPost);
Check out which symbologies are supported by Camera Scanner.
Symbologies
For the internal camera
, the symbologies support is mainly based on the third party library that Graphene is using. Refer to the below section for the supported symbologies for different platforms.
Symbologies | iOS | Android | Windows 10 |
---|---|---|---|
EAN-13 | √ | √ | √ |
UPC-E | √ | √ | √ |
EAN-8 | √ | √ | √ |
Code 128 | √ | √ | √ |
Code 39 | √ | √ | √ |
Code 93 | √ | √ | √ |
ITF14 | √ | √ | √ |
QR Code | √ | √ | √ |
PDF417(N) | √ | √ | √ |
Aztec | √ | √ | |
DataMatrix | √ | √ | |
UPC-A | √ | √ | √ |
Bluetooth Scanning
Insert the below JavaScript call in your HOST to activate the Scanning via Bluetooth Scanners.
Step 1: Include platform specific Graphene javascript file and plugin.js (Refer)
Step 2: Create request for starting Bluetooth scanner. (Check example)
Step 3: Call plugin to start Bluetooth scanning
Step 4: Call this plugin to stop Bluetooth scanning
//Step 1 : Include platform specific Graphene javascript file and plugin.js
//Step 2 : Create request for starting Bluetooth scanner.
var startBluetoothScanRequest = {
"returnURL": "http://yourhost.com/handlebluetoothscanning", // option URL of page where response is posted back
"parameter": "data",
"method":"post", // HTTP method used to send data back to host. Can be GET or POST.
"redirect_needed":'true',
"getContinuesUpdate":"false"
};
Step 3: Call plugin to start Bluetooth scanning
window.plugins.bluetoothBarcodeScanner.bluetoothscannerstart(function(result) {
// handle the result here.
},function(error){
// handle the error here.
},startBluetoothScanRequest)
Step 4: Call this plugin to stop Bluetooth scanning
var stopBluetoothScanning = {
"returnURL": "http://yourhost/handlebluetoothscanning", //return URL where scanning result will be posted back
"parameter": "data",
"method":"post",
"redirect_needed":'true',
"getContinuesUpdate":"false"
};
window.plugins.bluetoothBarcodeScanner.bluetoothscannerstop(function(result) {
// handle the result here.
},function(error){
// handle the error here.
}, stopBluetoothScanning);
Supported Bluetooth Scanners
Symbologies | iOS | Android | Windows 10 |
---|---|---|---|
Opticon 4000i | √ | √ | √ |
Socket MFI | √ | √ | √ |
Datecs | √ | ||
Chainway | √ | ||
Opticon 2005 | √ |
Scanning Error Codes
Graphene will send back a set of specific error code when errors occur in barcode scanning. Refer to Generic Errors (Section 8) for any other errors.
Following is the list of Error Codes for Scanning
Error Type | Error Code | Message String | Resolution |
---|---|---|---|
When scanning fails due to unknown reason and it is unrelated to User action | BSCN001 | Barcode Scanning Failed | Verify the devices camera or the paired Bluetooth devices are working correctly and the devices are supported by Graphene. |
// Error format
{
"error_code":"BSCN001",
"message":"Barcode Scanning Failed"
}
Payment
The subsequent sections describe the integration and major tasks involved in invoking the payments engine within Graphene. The integration is seamless and supports different payment providers with ease.
Payment Sale Request
Insert the below JavaScript call in your website/host to activate the Payment sale request for Graphene.
Step 1 : Include platform specific Graphene javascript file and plugin.js (Refer)
Step 2: Create payment sale request
Step 1 : Include platform specific Graphene javascript file and plugin.js
Step 2: Create payment sale request
var salePaymentRequest = {
"returnURL": "http://www.yourhost.com/handlepayment", // Required URL of page where response is posted back
"paymentprocessor":"worldpay", // Payment provider
"action":"SALE", // Payment action
"method":"post", // HTTP method used to send data back to host. Can be POST only.
"transactionRef": "SE123456", // Transaction reference generated from host site
"amount": "12.78",
"description":'Purchase from online.",
"sendReceiptBack":true, // Send payment receipt back in response or not
"printLocally":true, // Print receipt locally after payment or not
"payerEmail":"test@email.com",
"CurrencyCode":"GBP",
"hmacsha1":"1234567890", // HMAC generate using amount, transaction reference and payment key
"redirect_needed": false
}
Step3: Start payment
window.plugins.paymentPlugin.payment(function(result){
// Handle successful response
},function(error){
// Handle error
},salePaymentRequest);
Payment Refund Request
Insert the below JavaScript call in your website/host to activate the Payment sale request for Graphene.
Step 1 : Include platform specific Graphene javascript file and plugin.js (Refer )
Step 2: Create payment refund request
Step 1 : Include platform specific Graphene javascript file and plugin.js
Step 2: Create payment refund request
var refundPaymentRequest = {
"returnURL": "http://www.yourhost.com/handlepayment", // Required URL of page where response is posted back
"paymentprocessor":"worldpay", // Payment provider
"action":"refund", // Payment action
"method":"post", // HTTP method used to send data back to host. Can be POST only.
"transactionRef: "SE123456", // Transaction reference generated from host site
"amount: "12.78",
"description:"Purchase from online.",
"sendReceiptBack:true, // Send payment receipt back in response or not
"printLocally:true, // Print receipt locally after payment or not
"payerEmail":"test@email.com",
"transactionId":"935ea77f-e8ad-477f-a46b-ad0e7fc9cbac", //Only for 'referenced refund' like PayPal
"CurrencyCode":"GBP",
"hmacsha1":"1234567890", // Generate HMAC using amount,transactionRef and payment key (shared by HOST & Graphene)
"redirect_needed": false
};
Step3: Start payment
window.plugins.paymentPlugin.payment(function(result){
// Handle successful response
},function(error){
// Handle error
},refundPaymentRequest);
Payment Referenced Refund Request
Step 1 : Include platform specific Graphene javascript file and plugin.js
Step 2: Create payment refund request
var refundPaymentRequest = {
returnURL: "http://www.yourhost.com/handlepayment", // Required URL of page where response is posted back
paymentprocessor:"worldpay", // Payment provider
action:"refund", // Payment action
method:"post", // HTTP method used to send data back to host. Can be POST only.
amount: "12.78",
description:"Purchase from online.",
sendReceiptBack:true, // Send payment receipt back in response or not
rintLocally:true, // Print receipt locally after payment or not
payerEmail:"test@email.com",
transactionRef: "SE123456", // Transaction reference generated from host site
transactionId : "7Udz001617777884000.882617777907299C",//Only for 'referenced refund' like Adyen
transactionDate : "2021-04-06T09:50:42.940Z"//Only for 'referenced refund' like Adyen
CurrencyCode:"GBP",
hmacsha1:"1234567890", // Generate HMAC using amount,transactionRef and payment key (shared by HOST & Graphene)
redirect_needed: false
};
Step3: Start payment
window.plugins.paymentPlugin.payment(function(result){
// Handle successful response
},function(error){
// Handle error
},refundPaymentRequest);
Once the Pinpad has been selected and the refund request created we need to perform the referenced refund based on transactionId & transactionDate value is present or not. (if not a present(blank,empty), perform unreferenced refund).
There will be no difference from Graphene for partial and full refunds. It depends on the host request amount
Payment PreAuth
Insert the below JavaScript call in your website/host to activate the Payment PreAuth request for Graphene.
Step 1 : Include platform specific Graphene javascript file and plugin.js (Refer)
Step 2: Create payment PreAuth request
Step 1 : Include platform specific Graphene javascript file and plugin.js
Step 2: Create payment PreAuth request
var preAuthRequest = {
"returnURL": "http://www.yourhost.com/handlepayment",// Required URL of page where response is posted
"paymentprocessor": "sepay",// Payment provider
"action": "sale",// Payment action
"method": "post",// HTTP method used to send data back to host. Can be POST only.
"action_method": "PRE_AUTH", // action_method for Only PreAuth request
"transactionRef": "12345678", // Transaction reference generated from host site
"amount": "10.25",
"description": "Purchase from online.",
"currencycode": "GBP",
"sendReceiptBack": true,// Send payment receipt back in response or not
"printLocally": false,// Print receipt locally after payment or not
"payerEmail": "test@email.com",
"redirect_needed": true,
"hmacsha1": "1234567890"// HMAC generate using amount, transaction reference and payment key
}
Step3: Start payment
window.plugins.paymentPlugin.payment(function(result){
// Handle successful response
},function(error){
// Handle error
},preAuthRequest);
Payment PreAuth and Capture both
Insert the below JavaScript call in your website/host to activate the PreAuth & Capture both in single request for Graphene.
Step 1 : Include platform specific Graphene javascript file and plugin.js (Refer)
Step 2: Create payment PreAuth & Capture Both request
Step 1 : Include platform specific Graphene javascript file and plugin.js
Step 2: Create PreAuth & Capture Both request
var bothRequest = {
"returnURL": "http://www.yourhost.com/handlepayment",// Required URL of page where response is posted
"paymentprocessor": "sepay",// Payment provider
"action": "sale",// Payment action
"method": "post",// HTTP method used to send data back to host. Can be POST only.
"action_method": "BOTH", // action_method for Only BOTH(PreAuth, Capture) request
"transactionRef": "12345678", // Transaction reference generated from host site
"amount": "10.25",
"inStoreAmount": "5.25",//This amount will be Capture after PreAuth
"additionalDetails": { "accessToken": "Bearer token"},// Access token for cloud API request
"description": "Purchase from online.",
"currencycode": "GBP",
"sendReceiptBack": true,// Send payment receipt back in response or not
"printLocally": false,// Print receipt locally after payment or not
"payerEmail": "test@email.com",
"redirect_needed": true,
"hmacsha1": "1234567890"// HMAC generate using amount, transaction reference and payment key
}
Step3: Start payment
window.plugins.paymentPlugin.payment(function(result){
// Handle successful response
},function(error){
// Handle error
},bothRequest);
Payment With PayByLink
Insert the below JavaScript call in your website/host to activate the PreAuth & Capture both in single request for Integration Enabler.
Step 1 : Include platform specific Integration Enabler javascript file and plugin.js (Refer)
Step 2: Create payment PayByLink payment request
Field | Description | Type | Mandatory |
---|---|---|---|
waitForPayment | Boolean flag to determine whether to wait for payment to complete | Boolean | Optional & Default false |
expiresAt | Date and time of link expiry | ISO8601 datetime | Optional |
description | free text description to be displayed in link | string | Optional |
payByLink | Determines whether pay by link request | boolean | Mandatory for pay by link requests |
Step 1 : Include platform specific Integration Enabler javascript file and plugin.js
Step 2: Create PayByLink request
var adyenSalePayByLinkRequest = {
returnURL: 'http://www.yourhost.com/handlepayment',
paymentprocessor: 'sepay',
payByLink : true,// Adyen Pay By Link fields
expiresAt : "",// Adyen Pay By Link fields
waitForPayment : true,// Adyen Pay By Link fields
description: 'Purchase from online.',
action: 'sale',
transactionRef: '<?= $transactionRef ?>',
amount: <?= $amountStr ?>,
currencycode: 'EUR',
sendReceiptBack: true,
printLocally: false,
payerEmail: '<?= $payerEmail ?>',
redirect_needed: false,
hmacsha1: '<?= hash_hmac("sha1", $amountStr . $transactionRef, "8c75cf54-494d-4c89-9f81-adc13490caab"); ?>'
};
Step3: Start payment
window.plugins.paymentPlugin.payment(function(result){
// Handle successful response
},function(error){
// Handle error
},adyenSalePayByLinkRequest);
Cash Drawer Status
var param = {
"returnURL": "http://www.yourhost.com/handlepayment",
"redirect_needed": false,
"apiKey": "87654431351223",
"drawer": {
"drawerName": "drawer1",
"id": "877878",
"provider": "STAR",
"qr_data": "123adfjbfds23423"
//IP drawer setting
"ipAddress": "10.0.0.01",
"port": 1234,
"drawer_type": 0,
//Bluetooth drawer setting
"drawer_type": 1,
"mac": "5247546574rt",
//Prefix for Android is pending
}
}
window.plugins.paymentPlugin.cashDrawerStatus(function(result)
{
// Handle successful response
},
function(error)
{
// Handle error
},param);
This method is used to get selected drawer status
- Validations & Errors
If invalid apiKey : COM004: Invalid API key
While the opening drawer any error return : CSDRW001 - Connecting issue. Please try again
drawer key is mandatory field
Invalid value of the parameter key - 'value' for drawerName, provider, drawer_type, ipAddress, port, required_status. In case not present consider empty/null for error.
Incase of missing drawer key return error - COM004 : Drawer details not found
For drawer does not support status provide response not supporting operation
The status of the drawer is only supported by the APG Drawer & STARPRNT Drawer. For ESPN/STAR does not apply this.
Open Cash Drawer
var param = {
"returnURL": "http://www.yourhost.com/handlepayment",
"redirect_needed": false,
"apiKey": "87654431351223",
"waitTillClosed": true,
"drawer": {
"drawerName": "drawer1",
"id": "877878", //Not in use
"provider": "STAR",
"qr_data": "123adfjbfds23423"
//IP drawer setting
"ipAddress": "10.0.0.01",
"port": 1234,
"drawer_type": 0,
//Bluetooth drawer setting
"drawer_type": 1,
"mac": "5247546574rt",
//Prefix for Android is pending
}
}
window.plugins.paymentPlugin.openCashDrawer(function(result)
{
// Handle successful response
},
function(error)
{
// Handle error
},param);
7
This method is used to open selected drawer
- If waitTillClosed: false
return a successful message - { "ResultData" : "Cashdrawer Open Successfully" }
- If waitTillClosed: true
try fetching drawer status till drawer status changes from open to close
once drawer status closed return response as following
User will wait till this process is done and Graphene will show Progress on UI.
{ "ResultData" : "Transaction completed.Drawer is closed now." }
Attributes for Payment Request
Request Parameters remain same for all providers including Cash Management module of Graphene, only the payment service provider (PSP) should be passed as per the details shown in supported payment providers.
Attribute Name | Description | Mandatory/ Optional | Values/Example |
---|---|---|---|
ReturnURL | Address of the http POST. ‘https’ is also supported. The POST URL should be supplied as a string. E.g. returnURL: ‘http://yourhost.com/handlepayments’ | M | |
PaymentProcessor | Name of the payment service provider. This specifies the supported PSP. Allowable values: Worldpay, Ayden, adyen_applepay, PayPal, Handpoint, Anderson Zaks, SumUp, SECASH (case insensitive), Hicaps | O | |
Action | Transaction type : SALE/REFUND (case insensitive) | M | |
Method | Method to send data back to the server. This is always 'POST’. | M | |
TransactionRef | Unique identifier for the transaction. Example: Unique transaction number, basket/order reference. | M | |
Amount | Transaction amount. | M | |
Description | Description of the transaction. E.g. Description of the purchase made. | O | |
sendReceiptBack | Whether or not to send the receipt data back to the returnURL. False - do not send receipt data back True - send receipt data back | O | |
Printlocally | Whether or not to print customer and merchant receipts locally. False - do not print receipt locally True - print receipt locally | O | |
CurrencyCode | Mandatory if the payment provider is other than WorldPay and supports different types of currency as per list. Check detailed list | O (WorldPay) M (all other Payment Providers) | |
PayerEmail | Configure to send the transaction receipts. | O | |
transactionId | For referenced refund like PayPal Only applicable for Refund request |
M | |
redirect_needed | true is by default value |
O | true,false |
getContinuesUpdate | false is by default value |
O | true,false |
Supported Currency Codes
Below is the list of Payment Providers and the Currency Codes each support and Graphene accepts.
PSP | Supported Currency Code |
---|---|
WorldPay | GBP |
Ayden | EUR, GBP |
PayPal | AUD , BRL , CAD , CHF , CZK , DKK , EUR , GBP , HKD , HUF , ILS , JPY , MXN , MYR , NOK , NZD , PHP , PLN , SEK , SGD , THB , TED , USD. |
SumUp | N/A |
Handpoint/ Anderson Zaks | AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BOV, BRL, BSD, BTN, BWP, BYR, BZD, CAD, CDF, CHE, CHF, CHW, CLF, CLP, CNY, COP, COU, CRC, CUC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JMD, JOD, JPY, KES, KGS, KHR, KMF, KPW, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LTL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRO, MUR, MVR, MWK, MXN, MXV, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLL, SOS, SRD, SSP, STD, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, USN, USS, UYI, UYU, UZS, VEF, VND, VUV, WST, XAF, XAG, XAU, XBA, XBB, XBC, XBD, XCD, XDR, XOF, XPD, XPF, XPT, XSU, XTS, XUA, XXX, YER, ZAR, ZMW, ZWD |
Creditcall | ZAR, CAD, JPY, CZK, HKD, EUR, NOK, USD, KRW, PLN, SAR, SEK, AUD, ILS, BRL, RUB, GBP, DKK, MXN, CHF |
Response for Payment Transaction
Example of Response:
- Response for Successful transaction (HandPoint)
{
amount = "40.00";
applicationVersion = "1.6.11.22";
authcode = 011295;
cardType = MAESTRO;
currency = GBP;
customerReceipt = (
"Paul Mason Consulting Ltd", "30/32 Blacklands Way ",
"MID: **99999",
"TID: ****4814",
"Date: 17.08.2015",
"Time: 12:54",
"Auth code: 011295",
"Reference: e1bd33eb-2e45-490b-a867-77394accef45",
" CARDHOLDER COPY ",
"Application Label: MAESTRO",
"Entry: ICC", "Card Scheme: Maestro",
"CardNumber: * 0 010",
"Aid: A0000000043060",
"APP PSN: 13",
"{COPY_RECEIPT}",
SALE,
"GBP40.00",
"Your account will be debited with the above amount",
" Verified by signature ",
" AUTHORISED ",
"Please keep this receipt for your records"
);
cvm = "Signature Verified";
entryMethod = ICC;
hmacsha1 = 5d0cbb5851a6a7a2d570a5b49babefd2c319669d;
hostReferenceId = "e1bd33eb-2e45-490b-a867-77394accef45";
merchantReceipt = ( "Paul Mason Consulting Ltd", "30/32 Blacklands Way ",
"MID: 9999999",
"TID: 14004814",
"Date: 17.08.2015",
"Time: 12:54",
"Transaction No: 0001544",
"Auth code: 011295",
"Reference: e1bd33eb-2e45-490b-a867-77394accef45",
" MERCHANT COPY ",
"Application Label: MAESTRO",
"Entry: ICC",
"Card Scheme: Maestro",
"CardNumber: * 0 010",
"Aid: A0000000043060",
"APP EFFECTIVE date: 01/2004",
"APP EXP date: 12/2014",
"APP PSN: 13",
"{COPY_RECEIPT}",
SALE, "GBP40.00",
"Please debit my account with the above amount",
" Verified by signature ",
"--------------------------------",
"Cardholder signature",
" AUTHORISED ",
"Please keep this receipt for your records"
);
result = AUTHORISED;
tid = 614004814;
transactionDate = "17/08/2015 12:54:46";
transactionReference = SE1439796218;
transactionType = SALE;
}
Attributes for Payment Response
The service providers may differ, however, the Graphene will send a harmonious response as below in its payment response. In case the details are not present it will be sent back with no value (blank).
Attribute Name | Description |
---|---|
Result | Uniquely identifies the transaction response. e.g. Failed, Successful, Authorized, Cancelled, Declined For a detailed list of attribute values, please refer the PSP’s integration guide of respective payment providers. |
Currency | Currency code. E.g. GBP |
Amount | Amount/Value that is entered for the transaction |
AuthCode | Holds the value generated by the issuer for an approved transaction. Present only in case of a successful transaction. |
PAN | Primary Account Number (PAN) holds the valid cardholder account number. Masked PAN consists of first 6 digits and last 4 digits: e.g. 492949 XXXXXX 0002 |
CardType | Type of card. E.g. VISA, MASTERCARD |
TransactionDate | Date of transaction |
CardHolder | Cardholder Name indicates cardholder name according to ISO 7813. Cardholder Name Extended indicates the whole cardholder name when greater than 26 characters using the same coding convention as in ISO 7813. |
MID | Merchant Identifier |
TID | Terminal Identifier |
CVM | Card Verification Method, Signature verified, Pin verified, Cardholder not present, No CVM, Signature and Pin verified |
hostReferenceId | This is the payment gateway transaction reference number which is the transaction id by 3rdparty application. |
AID | Application Identifier (AID), which identifies the application as described in ISO/IEC 7816-5. |
receiptNo | Receipt number details |
Expirydate | Card Expiry Date |
TransactionReference | Uniquely identifies the transaction with a user defined tag (as unique transaction number or basket/order reference) |
applicationVersion | Application version of the payment provider |
Customer receipt | If print locally is set to yes, all the customer receipt information will be sent in this field. |
Merchant receipt | Merchant receipt information for the printer is sent in this field. |
HMACSHA1 | Sent back for authorization and security. This is generated from the amount and host reference id (given by the 3rd party app) along with the payment key. |
Payment Error Codes
Graphene will send back a set of error codes when errors occur in payment. The website controller will need to inspect the response and take the appropriate action.
{
"error_code":"Pay002",
"message":"Unsuccessful Payment"
}
Error Type | Error Code | Message String | Resolution |
---|---|---|---|
If any parameter is invalid in Payment Request Object. | PAY001 | Payment Request Invalid | Ensure that the Payment Request has valid and acceptable values. |
When Payment is unsuccessful | PAY002 | Unsuccessful Payment | Ensure that the connection with the PEDs is maintained. Contact the payment bureau if the payment has been unsuccessful from the third party application side. |
If Payment application is not installed on the device | PAY003 | Payment Application not found | Ensure that the Payment processors are correctly installed and running on the device. |
Payment Security: HMAC
It is important that the payment transaction is secured. HMAC digest is thus, used to establish secured communication between HOST and Graphene application. This HMAC digest plays an important role to make sure that only the authenticated HOST is connected withGraphene . For this, the HMAC secret key should be shared with the HOST and Graphene both. The payment secret key can be modified via Config settings once the integration is complete.
- Generate HMAC digest using HMAC-SHA1 algorithm. This is generated by concatenating amount, transactionRef against payment secret key.
- Then add this (digest value)to the payment sale/refund request JSON
- For example using
PHP
code from HOST side HMAC would be generated as below
hash_hmac("sha1", $amountStr.$transactionRef, "KEY54321")
$amountStr - indicates amount
value for example, 12.78
$transactionRef - indicates transaction reference value
, for example 'SE1465559164'
Concatenation of amount and transaction
i.e "12.78SE1465559164" along with sharedpayment secret key
'KEY54321' , HMAC would be generated and will be used by Graphene application to verify for correct HOST.
In case an incorrect key is shared between HOST and Graphene, Graphene would send error code regarding digest mismatch, as mentioned in Payment error codes.
Response from Graphene to HOST
- Once the payment process is completed by Graphene app, it would send a response back to HOST.
- HOST has to again calculate digest based on the
amount
andhostRefenceId
value sent by Graphene to validate its authentication.
Below is sample payment response received from Graphene application.
{
"amount" = "12.78"; // amount
"applicationVersion" = "1.6.11.22";
"authcode" = 011295;
"cardType" = "MAESTRO";
"currency" = "GBP";
"hmacsha1" = "5d0cbb5851a6a7a2d570a5b49babefd2c319669d"; //Generate using amount and hostReferenceId with Payment Secret key
"hostReferenceId" = "e1bd33eb-2e45-490b-a867-77394accef45"; //hostReferenceId
}
- Generate HMACand verify with the received digest ("hmacsha1").
- Refer response for payment transaction for details.
Supported PSP
PSP | iOS | Android | Windows 10 |
---|---|---|---|
WorldPay | √ | √ | √ |
WorldPay IPC3 | √ | X | X |
Creditcall | √ | X | X |
Adyen | √ | √ | √ |
Sumup | √ | √ | X |
HandPoint | √ | √ | X |
PayPal | √ | √ | X |
Anderson Zaks | X | √ | X |
FIS | X | X | * |
Adyen ApplePay | √ | X | X |
WorldPay ApplePay | √ | X | X |
Printing
Once the payment cycle is complete, the next operation is printing of the card receipts. The Merchant receipt
and the Customer receipt
is of the utmost importance when cards are used. Thus, to ease the print, from the Graphene, it supports a number of printers. These printers can be configured in Advanced settings ofGraphene . We will see, the types of printers supported and how they are configured.
EFSTA - Italy
EFSTA is the leading fiscal software developer for companies of all sizes. The EFSTA fiscal solution, consisting of the fiscal middleware "Electronic Fiscal Registers" (EFR) and the EFSTA Cloud, can be used across borders to comply with national and international fiscal regulations.
Fiscal print request (Sale)
var FiscalPrintRequest = {
returnURL: 'http://10.62.0.61:8888/SE/SEWindows/index.php',
redirect_needed:true,
basket_xml : '<BasketXML>',
parameter:'data',
printMethod: "Print"
}
//Following is Plugin call
window.plugins.printerPlugin.print(function(result) {},function(error){
},FiscalPrintRequest)
Fiscal print request (Sale)
<POSBasket>
<Keyword>1|5001|1|19</Keyword>
<ID>ALL.GW.5001|20191016125316|19</ID>
<XMLSchemaVersion>2</XMLSchemaVersion>
<LastUpdated>2019-10-16T12:53:47+01:00</LastUpdated>
<MajorVersion>1</MajorVersion>
<MinorVersion>0</MinorVersion>
<ManifestVersion>RPOS_12.3_GAMESWORKSHOP</ManifestVersion>
<DatabaseSchemaVersion>1.0.496.45.1.2.2</DatabaseSchemaVersion>
<BasketType>Sale</BasketType>
<State>Completed</State>
<ExternalState>1</ExternalState>
<Header>
<TimeZoneOffset>-60</TimeZoneOffset>
<DateTimeCreated>2019-10-16T12:53:16+01:00</DateTimeCreated>
<OriginatedBy>
<DeviceID>ALL.GW.5001</DeviceID>
<CashierID>ITCS</CashierID>
<CompanyID>1</CompanyID>
<StoreID>5001</StoreID>
<BranchID>5001</BranchID>
<TerminalNumber>1</TerminalNumber>
<TransactionNumber>19</TransactionNumber>
</OriginatedBy>
<TaxMethodID>15</TaxMethodID>
<EmployeeID>5001000001</EmployeeID>
<EmployeeName>
<XMLSchemaVersion>1</XMLSchemaVersion>
<LastUpdated>2019-10-16T12:53:10+01:00</LastUpdated>
<MajorVersion>1</MajorVersion>
<MinorVersion>0</MinorVersion>
<Surname>Test</Surname>
<Forename>Employee</Forename>
<Initials>TE</Initials>
<Title></Title>
<Sex></Sex>
<AllowMarketingInternal>0</AllowMarketingInternal>
<AllowMarketingThirdParty>0</AllowMarketingThirdParty>
</EmployeeName>
<EmployeeStartingBalance>0</EmployeeStartingBalance>
<EmployeePAN>5001000001</EmployeePAN>
<EmployeeSaleType>2</EmployeeSaleType>
<TransactionReasonID>IT_ES101</TransactionReasonID>
<AuthorisingUserID>ITCS</AuthorisingUserID>
<EuroZone>1</EuroZone>
<BasketLanguageID>it</BasketLanguageID>
<BasketCountryID>IT</BasketCountryID>
<BasketCurrencyID>EUR</BasketCurrencyID>
<TradingRegionID>12</TradingRegionID>
<EuroBaseExchangeRate>1.0</EuroBaseExchangeRate>
<PrintableName>ITALIAN CS</PrintableName>
</Header>
<ProductSale>
<XMLSchemaVersion>1</XMLSchemaVersion>
<LineNumber>1</LineNumber>
<NetValue>1650</NetValue>
<EffectiveNetValue>1650</EffectiveNetValue>
<Description>CODEX:TYRANIDES FRA</Description>
<DeviceID>ALL.GW.5001</DeviceID>
<UserID>ITCS</UserID>
<DateTimeCreated>2019-10-16T12:53:16+01:00</DateTimeCreated>
<ExtendedValue>3300</ExtendedValue>
<UnitPrice>3300</UnitPrice>
<MMGroupID>010603</MMGroupID>
<Quantity>1.0</Quantity>
<SalespersonID>ITCS</SalespersonID>
<SalespersonName>ITALIAN CS</SalespersonName>
<EmployeeDiscount>
<ModifierValue>-1650</ModifierValue>
<ModifierDateTime>2019-10-16T12:53:16+01:00</ModifierDateTime>
<ModifierReasonID>IT_ES101</ModifierReasonID>
<ModifierReasonDescription>Personale di sconto</ModifierReasonDescription>
<ModifierDescription>Employee Discount</ModifierDescription>
<AuthorisingUserID>ITCS</AuthorisingUserID>
<XMLSchemaVersion>1</XMLSchemaVersion>
<DiscountType>0</DiscountType>
<DiscountPercentage>0.5</DiscountPercentage>
<DiscountedValue>3300</DiscountedValue>
<RoundingRule>2</RoundingRule>
<AccountID>5001000001</AccountID>
<PAN>5001000001</PAN>
</EmployeeDiscount>
<TaxCode>1</TaxCode>
<TaxModifiable>1</TaxModifiable>
<TaxAmount>63.46154</TaxAmount>
<OriginalTaxAmount>126.92308</OriginalTaxAmount>
<OriginalTaxAmountSet>1</OriginalTaxAmountSet>
<ProductID>01030106006</ProductID>
<HandKeyed>1</HandKeyed>
<CustomerDetails></CustomerDetails>
<Perishable>1</Perishable>
</ProductSale>
<ModifierItem>
<XMLSchemaVersion>1</XMLSchemaVersion>
<LineNumber>2</LineNumber>
<NetValue>0</NetValue>
<EffectiveNetValue>0</EffectiveNetValue>
<Description>Employee Discount</Description>
<DeviceID>ALL.GW.5001</DeviceID>
<UserID>ITCS</UserID>
<DateTimeCreated>2019-10-16T12:53:16+01:00</DateTimeCreated>
<AuthorisingUserID>ITCS</AuthorisingUserID>
<ReasonCodeID>IT_ES101</ReasonCodeID>
<ModifiedLineNumber>1</ModifiedLineNumber>
<ModifiedIndex>1</ModifiedIndex>
</ModifierItem>
<ProductSale>
<XMLSchemaVersion>1</XMLSchemaVersion>
<LineNumber>3</LineNumber>
<NetValue>1650</NetValue>
<EffectiveNetValue>1650</EffectiveNetValue>
<Description>TYRANIDEN (SB) DEU</Description>
<DeviceID>ALL.GW.5001</DeviceID>
<UserID>ITCS</UserID>
<DateTimeCreated>2019-10-16T12:53:24+01:00</DateTimeCreated>
<ExtendedValue>3300</ExtendedValue>
<UnitPrice>3300</UnitPrice>
<MMGroupID>010603</MMGroupID>
<Quantity>1.0</Quantity>
<SalespersonID>ITCS</SalespersonID>
<SalespersonName>ITALIAN CS</SalespersonName>
<EmployeeDiscount>
<ModifierValue>-1650</ModifierValue>
<ModifierDateTime>2019-10-16T12:53:24+01:00</ModifierDateTime>
<ModifierReasonID>IT_ES101</ModifierReasonID>
<ModifierReasonDescription>Personale di sconto</ModifierReasonDescription>
<ModifierDescription>Employee Discount</ModifierDescription>
<AuthorisingUserID>ITCS</AuthorisingUserID>
<XMLSchemaVersion>1</XMLSchemaVersion>
<DiscountType>0</DiscountType>
<DiscountPercentage>0.5</DiscountPercentage>
<DiscountedValue>3300</DiscountedValue>
<RoundingRule>2</RoundingRule>
<AccountID>5001000001</AccountID>
<PAN>5001000001</PAN>
</EmployeeDiscount>
<TaxCode>1</TaxCode>
<TaxModifiable>1</TaxModifiable>
<TaxAmount>63.46154</TaxAmount>
<OriginalTaxAmount>126.92308</OriginalTaxAmount>
<OriginalTaxAmountSet>1</OriginalTaxAmountSet>
<ProductID>04030106006</ProductID>
<HandKeyed>1</HandKeyed>
<CustomerDetails></CustomerDetails>
<Perishable>1</Perishable>
</ProductSale>
<ModifierItem>
<XMLSchemaVersion>1</XMLSchemaVersion>
<LineNumber>4</LineNumber>
<NetValue>0</NetValue>
<EffectiveNetValue>0</EffectiveNetValue>
<Description>Employee Discount</Description>
<DeviceID>ALL.GW.5001</DeviceID>
<UserID>ITCS</UserID>
<DateTimeCreated>2019-10-16T12:53:24+01:00</DateTimeCreated>
<AuthorisingUserID>ITCS</AuthorisingUserID>
<ReasonCodeID>IT_ES101</ReasonCodeID>
<ModifiedLineNumber>3</ModifiedLineNumber>
<ModifiedIndex>1</ModifiedIndex>
</ModifierItem>
<ProductSale>
<XMLSchemaVersion>1</XMLSchemaVersion>
<LineNumber>5</LineNumber>
<NetValue>1000</NetValue>
<EffectiveNetValue>1000</EffectiveNetValue>
<Description>SM WHIRLWIND/HUNTER</Description>
<DeviceID>ALL.GW.5001</DeviceID>
<UserID>ITCS</UserID>
<DateTimeCreated>2019-10-16T12:53:41+01:00</DateTimeCreated>
<ExtendedValue>2000</ExtendedValue>
<UnitPrice>2000</UnitPrice>
<MMGroupID>030106</MMGroupID>
<Quantity>1.0</Quantity>
<SalespersonID>ITCS</SalespersonID>
<SalespersonName>ITALIAN CS</SalespersonName>
<EmployeeDiscount>
<ModifierValue>-1000</ModifierValue>
<ModifierDateTime>2019-10-16T12:53:41+01:00</ModifierDateTime>
<ModifierReasonID>IT_ES101</ModifierReasonID>
<ModifierReasonDescription>Personale di sconto</ModifierReasonDescription>
<ModifierDescription>Employee Discount</ModifierDescription>
<AuthorisingUserID>ITCS</AuthorisingUserID>
<XMLSchemaVersion>1</XMLSchemaVersion>
<DiscountType>0</DiscountType>
<DiscountPercentage>0.5</DiscountPercentage>
<DiscountedValue>2000</DiscountedValue>
<RoundingRule>2</RoundingRule>
<AccountID>5001000001</AccountID>
<PAN>5001000001</PAN>
</EmployeeDiscount>
<TaxCode>2</TaxCode>
<TaxAmount>180.327865</TaxAmount>
<OriginalTaxAmount>360.655731</OriginalTaxAmount>
<OriginalTaxAmountSet>1</OriginalTaxAmountSet>
<ProductID>99060301014</ProductID>
<HandKeyed>1</HandKeyed>
<CustomerDetails></CustomerDetails>
<Perishable>1</Perishable>
</ProductSale>
<ModifierItem>
<XMLSchemaVersion>1</XMLSchemaVersion>
<LineNumber>6</LineNumber>
<NetValue>0</NetValue>
<EffectiveNetValue>0</EffectiveNetValue>
<Description>Employee Discount</Description>
<DeviceID>ALL.GW.5001</DeviceID>
<UserID>ITCS</UserID>
<DateTimeCreated>2019-10-16T12:53:41+01:00</DateTimeCreated>
<AuthorisingUserID>ITCS</AuthorisingUserID>
<ReasonCodeID>IT_ES101</ReasonCodeID>
<ModifiedLineNumber>5</ModifiedLineNumber>
<ModifiedIndex>1</ModifiedIndex>
</ModifierItem>
<CashTenderItem>
<XMLSchemaVersion>1</XMLSchemaVersion>
<LineNumber>7</LineNumber>
<NetValue>-4300</NetValue>
<EffectiveNetValue>-4300</EffectiveNetValue>
<Description>Contanti</Description>
<DeviceID>ALL.GW.5001</DeviceID>
<UserID>ITCS</UserID>
<DateTimeCreated>2019-10-16T12:53:45+01:00</DateTimeCreated>
<TenderType>1</TenderType>
<TenderSubType>0</TenderSubType>
<TenderAmount>-4300</TenderAmount>
<CurrencyID>EUR</CurrencyID>
<CurrencyDescription>EUR</CurrencyDescription>
<IncludeInTransactionTotalCheck>1</IncludeInTransactionTotalCheck>
<AllowRechargeableVoucherSales>1</AllowRechargeableVoucherSales>
<OpenDrawerAtEnd>1</OpenDrawerAtEnd>
</CashTenderItem>
<Trailer>
<DateTimeCompleted>2019-10-16T12:53:47+01:00</DateTimeCompleted>
<CompletedBy>
<DeviceID>ALL.GW.5001</DeviceID>
<CashierID>ITCS</CashierID>
<StoreID>5001</StoreID>
<BranchID>5001</BranchID>
<TerminalNumber>1</TerminalNumber>
</CompletedBy>
<Total>4300</Total>
<ItemCount>7</ItemCount>
<ItemQuantity>3</ItemQuantity>
<NetItemQuantity>3</NetItemQuantity>
<TaxTotal>307</TaxTotal>
<TaxItem>
<XMLSchemaVersion>1</XMLSchemaVersion>
<TaxRate>1</TaxRate>
<TaxableTotal>3300</TaxableTotal>
<TaxTotal>127</TaxTotal>
<TaxDescription>Reduced IVA</TaxDescription>
<TaxIncluded>1</TaxIncluded>
<TaxPercentage>0.04</TaxPercentage>
</TaxItem>
<TaxItem>
<XMLSchemaVersion>1</XMLSchemaVersion>
<TaxRate>2</TaxRate>
<TaxableTotal>1000</TaxableTotal>
<TaxTotal>180</TaxTotal>
<TaxDescription>Full IVA</TaxDescription>
<TaxIncluded>1</TaxIncluded>
<TaxPercentage>0.22</TaxPercentage>
</TaxItem>
<SequenceDeviceID>ALL.GW.5001</SequenceDeviceID>
<SequenceNumber>70</SequenceNumber>
</Trailer>
</POSBasket>
Following parameter needed.
Payments Params | Values |
---|---|
basket_xml | BasketXML |
Check Print JSON for Fiscal request as shown.
Request -->
Reprint request
var RePrintRequest = {
returnURL: 'http://10.62.0.61:8888/SE/SEWindows/index.php',
redirect_needed:true,
last_transaction : true,
parameter:'data',
printMethod: "Print"
}
//Following is Plugin call
window.plugins.printerPlugin.print(function(result) {},function(error){
},RePrintRequest)
Following parameter needed.
Payments Params | Values |
---|---|
last_transaction | Boolean |
Check Reprint JSON request as shown.
Request -->
Print for Print Operation as Non-Fiscal
var NonFiscalPrintRequest = {
returnURL: 'http://10.62.0.61:8888/SE/SEWindows/index.php',
redirect_needed:true,
print_detail : '<PrintDetails>',
parameter:'data',
printMethod: "Print"
}
//Following is Plugin call
window.plugins.printerPlugin.print(function(result) {},function(error){
},NonFiscalPrintRequest)
Following parameter needed.
Payments Params | Values |
---|---|
print_detail | PrintDetails |
Check Print JSON request for Non-Fiscal as shown.
Request -->
Print EFSTA - XML (Refund)
var FiscalPrintRequest = {
returnURL: 'http://10.62.0.61:8888/SE/SEWindows/index.php',
redirect_needed:true,
basket_xml : '<BasketXML>',
parameter:'data',
printMethod: "Print"
}
//Following is Plugin call
window.plugins.printerPlugin.print(function(result) {},function(error){
},FiscalPrintRequest)
Print EFSTA - XML (Refund)
<POSBasket>
<Keyword>1|5001|1|88</Keyword>
<ID>ALL.GW.5001|20191003151048|88</ID>
<XMLSchemaVersion>2</XMLSchemaVersion>
<LastUpdated>2019-10-03T15:10:54+01:00</LastUpdated>
<MajorVersion>1</MajorVersion>
<MinorVersion>0</MinorVersion>
<ManifestVersion>RPOS_12.3_GAMESWORKSHOP</ManifestVersion>
<DatabaseSchemaVersion>1.0.496.45.1.2.2</DatabaseSchemaVersion>
<BasketType>Sale</BasketType>
<State>Completed</State>
<ExternalState>1</ExternalState>
<Header>
<TimeZoneOffset>-60</TimeZoneOffset>
<DateTimeCreated>2019-10-03T15:10:48+01:00</DateTimeCreated>
<OriginatedBy>
<DeviceID>ALL.GW.5001</DeviceID>
<CashierID>ADMIN</CashierID>
<CompanyID>1</CompanyID>
<StoreID>5001</StoreID>
<BranchID>5001</BranchID>
<TerminalNumber>1</TerminalNumber>
<TransactionNumber>88</TransactionNumber>
</OriginatedBy>
<TaxMethodID>15</TaxMethodID>
<EuroZone>1</EuroZone>
<BasketLanguageID>it</BasketLanguageID>
<BasketCountryID>IT</BasketCountryID>
<BasketCurrencyID>EUR</BasketCurrencyID>
<TradingRegionID>12</TradingRegionID>
<EuroBaseExchangeRate>1.0</EuroBaseExchangeRate>
</Header>
<ProductReturn>
<XMLSchemaVersion>1</XMLSchemaVersion>
<LineNumber>1</LineNumber>
<NetValue>-12500</NetValue>
<EffectiveNetValue>-12500</EffectiveNetValue>
<Description>WRATH & RAPTURE FRE</Description>
<DeviceID>ALL.GW.5001</DeviceID>
<UserID>ADMIN</UserID>
<DateTimeCreated>2019-10-03T15:10:48+01:00</DateTimeCreated>
<ExtendedValue>-12500</ExtendedValue>
<UnitPrice>12500</UnitPrice>
<MMGroupID>991501</MMGroupID>
<Quantity>-1.0</Quantity>
<TaxCode>2</TaxCode>
<TaxModifiable>1</TaxModifiable>
<TaxAmount>-2254.098388</TaxAmount>
<OriginalTaxAmount>-2254.098388</OriginalTaxAmount>
<OriginalTaxAmountSet>1</OriginalTaxAmountSet>
<Return>
<OriginalReceiptSupplied>1</OriginalReceiptSupplied>
<OriginalBranchID>5001</OriginalBranchID>
<OriginalTerminalNumber>1</OriginalTerminalNumber>
<OriginalTransactionNumber>67</OriginalTransactionNumber>
<OriginalCashierNumber>00009</OriginalCashierNumber>
</Return>
<ProductID>01019915001</ProductID>
<HandKeyed>1</HandKeyed>
<CustomerDetails></CustomerDetails>
<Perishable>1</Perishable>
</ProductReturn>
<CashTenderItem>
<XMLSchemaVersion>1</XMLSchemaVersion>
<LineNumber>2</LineNumber>
<NetValue>12500</NetValue>
<EffectiveNetValue>12500</EffectiveNetValue>
<Description>Contanti</Description>
<DeviceID>ALL.GW.5001</DeviceID>
<UserID>ADMIN</UserID>
<DateTimeCreated>2019-10-03T15:10:52+01:00</DateTimeCreated>
<TenderType>1</TenderType>
<TenderSubType>0</TenderSubType>
<TenderAmount>12500</TenderAmount>
<CurrencyID>EUR</CurrencyID>
<CurrencyDescription>EUR</CurrencyDescription>
<IncludeInTransactionTotalCheck>1</IncludeInTransactionTotalCheck>
<AllowRechargeableVoucherSales>1</AllowRechargeableVoucherSales>
<OpenDrawerAtEnd>1</OpenDrawerAtEnd>
</CashTenderItem>
<Trailer>
<DateTimeCompleted>2019-10-03T15:10:54+01:00</DateTimeCompleted>
<CompletedBy>
<DeviceID>ALL.GW.5001</DeviceID>
<CashierID>ADMIN</CashierID>
<StoreID>5001</StoreID>
<BranchID>5001</BranchID>
<TerminalNumber>1</TerminalNumber>
</CompletedBy>
<Total>-12500</Total>
<ItemCount>2</ItemCount>
<ItemQuantity>0</ItemQuantity>
<NetItemQuantity>-1</NetItemQuantity>
<TaxTotal>-2254</TaxTotal>
<TaxItem>
<XMLSchemaVersion>1</XMLSchemaVersion>
<TaxRate>2</TaxRate>
<TaxableTotal>-12500</TaxableTotal>
<TaxTotal>-2254</TaxTotal>
<TaxDescription>Full IVA</TaxDescription>
<TaxIncluded>1</TaxIncluded>
<TaxPercentage>0.22</TaxPercentage>
</TaxItem>
<SequenceDeviceID>ALL.GW.5001</SequenceDeviceID>
<SequenceNumber>193</SequenceNumber>
</Trailer>
</POSBasket>
Following parameter needed.
Payments Params | Values |
---|---|
basket_xml | BasketXML |
Check Print JSON for Fiscal request as shown.
Request -->
Print EFSTA - XML (Known Loss)
var FiscalPrintRequest = {
returnURL: 'http://10.62.0.61:8888/SE/SEWindows/index.php',
redirect_needed:true,
basket_xml : '<BasketXML>',
parameter:'data',
printMethod: "Print"
}
//Following is Plugin call
window.plugins.printerPlugin.print(function(result) {},function(error){
},FiscalPrintRequest)
Print EFSTA - XML (Known Loss)
<ProductWastage>
<Keyword>1|5001|1|83</Keyword>
<ID>ALL.GW.5001|20191003144431|83</ID>
<XMLSchemaVersion>2</XMLSchemaVersion>
<LastUpdated>2019-10-03T14:44:45+01:00</LastUpdated>
<MajorVersion>1</MajorVersion>
<MinorVersion>0</MinorVersion>
<ManifestVersion>RPOS_12.3_GAMESWORKSHOP</ManifestVersion>
<DatabaseSchemaVersion>1.0.496.45.1.2.2</DatabaseSchemaVersion>
<BasketType>ProductWastage</BasketType>
<State>Completed</State>
<ExternalState>1</ExternalState>
<Header>
<TimeZoneOffset>-60</TimeZoneOffset>
<DateTimeCreated>2019-10-03T14:44:31+01:00</DateTimeCreated>
<OriginatedBy>
<DeviceID>ALL.GW.5001</DeviceID>
<CashierID>000009</CashierID>
<CompanyID>1</CompanyID>
<StoreID>5001</StoreID>
<BranchID>5001</BranchID>
<TerminalNumber>1</TerminalNumber>
<TransactionNumber>83</TransactionNumber>
</OriginatedBy>
<TaxMethodID>15</TaxMethodID>
<TransactionReasonID>IT_PW005</TransactionReasonID>
<CustomerDetails>
<CustomerAddress>
<XMLSchemaVersion>1</XMLSchemaVersion>
</CustomerAddress>
<CustomerName>
<XMLSchemaVersion>1</XMLSchemaVersion>
<LastUpdated>2019-10-03T14:44:19+01:00</LastUpdated>
<MajorVersion>1</MajorVersion>
<MinorVersion>0</MinorVersion>
<Surname></Surname>
<Forename></Forename>
<Initials></Initials>
<Title></Title>
<Sex></Sex>
<AllowMarketingInternal>0</AllowMarketingInternal>
<AllowMarketingThirdParty>0</AllowMarketingThirdParty>
</CustomerName>
<DeliveryName>
<XMLSchemaVersion>1</XMLSchemaVersion>
<LastUpdated>2019-10-03T14:44:19+01:00</LastUpdated>
<MajorVersion>1</MajorVersion>
<MinorVersion>0</MinorVersion>
<Surname></Surname>
<Forename></Forename>
<Initials></Initials>
<Title></Title>
<Sex></Sex>
<AllowMarketingInternal>0</AllowMarketingInternal>
<AllowMarketingThirdParty>0</AllowMarketingThirdParty>
</DeliveryName>
<DeliveryAddress>
<XMLSchemaVersion>1</XMLSchemaVersion>
</DeliveryAddress>
</CustomerDetails>
<EuroZone>1</EuroZone>
<BasketLanguageID>it</BasketLanguageID>
<BasketCountryID>IT</BasketCountryID>
<BasketCurrencyID>EUR</BasketCurrencyID>
<TradingRegionID>12</TradingRegionID>
<EuroBaseExchangeRate>1.0</EuroBaseExchangeRate>
<PrintableName>ITSS</PrintableName>
</Header>
<ProductWastageItem>
<XMLSchemaVersion>1</XMLSchemaVersion>
<LineNumber>1</LineNumber>
<NetValue>2275</NetValue>
<EffectiveNetValue>2275</EffectiveNetValue>
<Description>UNIFORMS OF EMP GER</Description>
<DeviceID>ALL.GW.5001</DeviceID>
<UserID>000009</UserID>
<DateTimeCreated>2019-10-03T14:44:31+01:00</DateTimeCreated>
<ExtendedValue>2275</ExtendedValue>
<UnitPrice>2275</UnitPrice>
<MMGroupID>020204</MMGroupID>
<Quantity>1.0</Quantity>
<SalespersonID>000009</SalespersonID>
<SalespersonName>ITSS</SalespersonName>
<TaxCode>1</TaxCode>
<TaxAmount>87.5</TaxAmount>
<OriginalTaxAmount>87.5</OriginalTaxAmount>
<OriginalTaxAmountSet>1</OriginalTaxAmountSet>
<ProductID>04040202004</ProductID>
<HandKeyed>1</HandKeyed>
<CustomerDetails></CustomerDetails>
<Perishable>1</Perishable>
<SourceInventoryType>1</SourceInventoryType>
<DestinationInventoryType>0</DestinationInventoryType>
</ProductWastageItem>
<ProductWastageItem>
<XMLSchemaVersion>1</XMLSchemaVersion>
<LineNumber>2</LineNumber>
<NetValue>12500</NetValue>
<EffectiveNetValue>12500</EffectiveNetValue>
<Description>WRATH & RAPTURE FRA</Description>
<DeviceID>ALL.GW.5001</DeviceID>
<UserID>000009</UserID>
<DateTimeCreated>2019-10-03T14:44:43+01:00</DateTimeCreated>
<ExtendedValue>12500</ExtendedValue>
<UnitPrice>12500</UnitPrice>
<MMGroupID>991501</MMGroupID>
<Quantity>1.0</Quantity>
<SalespersonID>000009</SalespersonID>
<SalespersonName>ITSS</SalespersonName>
<TaxCode>2</TaxCode>
<TaxAmount>2254.098388</TaxAmount>
<OriginalTaxAmount>2254.098388</OriginalTaxAmount>
<OriginalTaxAmountSet>1</OriginalTaxAmountSet>
<ProductID>01019915001</ProductID>
<HandKeyed>1</HandKeyed>
<CustomerDetails></CustomerDetails>
<Perishable>1</Perishable>
<SourceInventoryType>1</SourceInventoryType>
<DestinationInventoryType>0</DestinationInventoryType>
</ProductWastageItem>
<Trailer>
<DateTimeCompleted>2019-10-03T14:44:45+01:00</DateTimeCompleted>
<CompletedBy>
<DeviceID>ALL.GW.5001</DeviceID>
<CashierID>000009</CashierID>
<StoreID>5001</StoreID>
<BranchID>5001</BranchID>
<TerminalNumber>1</TerminalNumber>
</CompletedBy>
<Total>14775</Total>
<ItemCount>2</ItemCount>
<ItemQuantity>2</ItemQuantity>
<NetItemQuantity>2</NetItemQuantity>
<TaxTotal>2342</TaxTotal>
<TaxItem>
<XMLSchemaVersion>1</XMLSchemaVersion>
<TaxRate>1</TaxRate>
<TaxableTotal>2275</TaxableTotal>
<TaxTotal>88</TaxTotal>
<TaxDescription>Reduced IVA</TaxDescription>
<TaxIncluded>1</TaxIncluded>
<TaxPercentage>0.04</TaxPercentage>
</TaxItem>
<TaxItem>
<XMLSchemaVersion>1</XMLSchemaVersion>
<TaxRate>2</TaxRate>
<TaxableTotal>12500</TaxableTotal>
<TaxTotal>2254</TaxTotal>
<TaxDescription>Full IVA</TaxDescription>
<TaxIncluded>1</TaxIncluded>
<TaxPercentage>0.22</TaxPercentage>
</TaxItem>
<SequenceDeviceID>ALL.GW.5001</SequenceDeviceID>
<SequenceNumber>182</SequenceNumber>
</Trailer>
</ProductWastage>
Following parameter needed.
Payments Params | Values |
---|---|
basket_xml | BasketXML |
Check Print JSON request as shown.
Request -->
printMethod - All Case handle print/email/both
var PrintWithPrintMethod = {
redirect_needed:true,
print_detail : '<PrintDetails>',
basket_xml : '<BasketXML>',
email_detail:'<EmailDetails>',
raw_response : true/false,
printMethod: 'Print' or 'Email' or 'Both' or 'Default'
}
//Following is Plugin call
window.plugins.printerPlugin.print(function(result) {},function(error){
},PrintWithPrintMethod)
PrinterPlugin - print method
printMethod present in the request and valid then Graphene will not show pop up of Print, Email, Both. Instead, Graphene will perform directly print, email or both
Request -->
EFSTA - France
EFSTA is the leading fiscal software developer for companies of all sizes. The EFSTA fiscal solution, consisting of the fiscal middleware "Electronic Fiscal Registers" (EFR) and the EFSTA Cloud, can be used across borders to comply with national and international fiscal regulations.
Fiscal Print request
var fiscalPrintRequest = {
returnURL: 'http://10.62.0.61:8888/SE/SEWindows/index.php',
redirect_needed:true,
basket_xml : '<BasketXML>', //XML
basket_detail : '<BasketDetail>', //JSON
parameter:'data',
printMethod: "Print"
}
//Following is Plugin call
window.plugins.printerPlugin.print(function(result) {},function(error){
},fiscalPrintRequest)
Basket Request (PRINT)
{
"type": "SALE",
"id": "",
"baseCurrency": "GBP",
"dateTime": "2022-01-24T12:24:47.608Z",
"basket": {
"lineDiscount": [],
"linePromotion": [],
"products": [
{
"SKU": "483629",
"description": "GLOSSY BALLS NK | 4711/239 | ONE | FUSCHIA",
"price": 10,
"imageUrls": [
"https://www.crewclothing.co.uk/images/products/large/4711/239_FUSCHIA.jpg"
],
"totalLinePrice": 50,
"quantity": 5,
"excludePromotion": false,
"itemLineId": "1",
"barCode": "5051953029414"
}
],
"taxBreakdown": {
"taxLines": [
{
"VAT": 20,
"VATCode": "H",
"itemLineId": 1,
"taxableAmount": 50,
"taxLineTotal": 10
}
],
"totalTaxableAmount": 50
},
"transactionPromotion": []
},
"operationStatus": "PAY_SUCCESS",
"saleTotal": null,
"transactionRef": "AT4BZfCC012022-01-24T12:24:47.607Zb98b",
"terminalId": "CC01113",
"storeId": "CC01",
"deviceId": "9b3e81cdbd9791b1",
"userId": "ed360021-167d-403b-b457-a009e2b03751",
"transactionId": "A0005250",
"storeNodeId": "1a5868ed-8bed-4019-8159-fdee12fbfe13",
"basketSummary": {
"saleTotal": 50,
"totalItems": 5,
"discountTotal": 0,
"refundTotal": 0,
"basketTotal": 50,
"VATTotal": 10
},
"createdAt": "2022-01-24T12:24:47.613Z",
"orgCode": "AT4BZf",
"updatedAt": "2022-01-24T12:25:20.672Z",
"transCompletedAt": "2022-01-24T12:25:20.669Z",
"paymentDetails": {
"currency": "GBP",
"result": "AUTHORISED",
"amount": "50.00",
"hostReferenceId": "NA",
"cardType": "NA",
"transactionDate": "2022-01-24T12:24:47.608Z",
"authcode": "NA",
"transactionType": "SALE",
"totalamount": "50.00",
"pan": "NA",
"entryMethod": "NA",
"aid": "NA",
"paymentType": "PDQ",
"transactionReference": "AT4BZfCC012022-01-24T12:24:47.607Zb98b"
},
"customer": {
"id": "C13112914",
"postCode": "390012",
"firstName": "RUCHIT",
"lastName": "PANCHIWALA (PMC India)",
"addressDetail": "Line 1, BARODA 390012 IND",
"email": "ruchit.panchiwala@pmcretail.com",
"noCustomerSelected": false
},
"currentTransactionDetails": {},
"offlineTransactionId": "",
"storeNodeStructure": [
{
"isOverride": true,
"name": "Bristol",
"nodeId": "NODE::1a5868ed-8bed-4019-8159-fdee12fbfe13",
"nodeType": "STORE",
"parentId": "NODE::1c3ebdf2-f5ea-4fa4-8b99-5c80a9a15b08",
"status": true
},
{
"isOverride": true,
"name": "West Midlands",
"nodeId": "NODE::1c3ebdf2-f5ea-4fa4-8b99-5c80a9a15b08",
"nodeType": "STORE_GROUP",
"parentId": "NODE::8a9fbfa5-757b-469e-8163-f636979921b0",
"status": true
},
{
"isOverride": true,
"name": "Midlands",
"nodeId": "NODE::8a9fbfa5-757b-469e-8163-f636979921b0",
"nodeType": "TRADING_REGION",
"parentId": "NODE::883b1b46-a907-44fa-aaae-9b92621efc11",
"status": true
},
{
"isOverride": false,
"name": "Crew Clothing",
"nodeId": "NODE::883b1b46-a907-44fa-aaae-9b92621efc11",
"nodeType": "COMPANY",
"parentId": "NODE::91fa9f54-db08-4ed3-8886-3d5d2935ee86",
"status": true
},
{
"isOverride": false,
"name": "hybrid_orgsetup",
"nodeId": "NODE::91fa9f54-db08-4ed3-8886-3d5d2935ee86",
"nodeType": "ORGANIZATION",
"parentId": "",
"status": true,
"checked": true
}
]
}
Graphene Prepare EFSTA Request (PRINT)
{
"Tra":{
"ESR":{
"D":"2022-01-24T12:25:20.669Z",
"TN":"A0005250",
"TL":"CC01",
"TT":"CC01113",
"PosA":[
{
"_":"Pos",
"Dsc":"GLOSSY BALLS NK | 4711\/239 | ONE | FUSCHIA",
"Pri":"10.00",
"Qty":5,
"PN":1,
"IN":"483629",
"ID":"GLOSSY BALLS NK | 4711\/239 | ONE | FUSCHIA",
"Amt":"50.00"
}
],
"TaxA":[
{
"Tax":"1",
"TAmt":"50.00",
"TaxG":"H",
"Amt":"50.00",
"Prc":20
}
],
"T":"50.00",
"PayA":[
{
"Dsc":"AUTHORISED",
"Amt":"50.00",
"UID":"NA"
}
]
}
}
}
Following parameter needed.
Params | Values |
---|---|
basket_xml | XML |
OR | |
basket_detail | JSON |
Check Print JSON for Fiscal request as shown.
Request -->
Reprint request
var rePrintRequest = {
returnURL: 'http://10.62.0.61:8888/SE/SEWindows/index.php',
redirect_needed:true,
last_transaction : true,
parameter:'data',
printMethod: "Print"
}
//Following is Plugin call
window.plugins.printerPlugin.print(function(result) {},function(error){
},rePrintRequest)
Following parameter needed.
Params | Values |
---|---|
last_transaction | Boolean |
Check Reprint JSON request as shown.
Request -->
Non-Fiscal Print Request
var nonFiscalPrintRequest = {
returnURL: 'http://10.62.0.61:8888/SE/SEWindows/index.php',
redirect_needed:true,
basket_xml : '<BasketXML>', //XML
basket_detail : '<BasketDetail>', //JSON
parameter:'data',
printMethod: "Print"
}
//Following is Plugin call
window.plugins.printerPlugin.print(function(result) {},function(error){
},nonFiscalPrintRequest)
Basket Request (ABORT)
{
"storeId": "CC01",
"basket": {
"lineDiscount": [],
"products": [
{
"price": 30,
"SKU": "1113208",
"quantity": 1,
"description": "DUMPAX | 99999 | 14 | TESTNAVY",
"barCode": "5054409062867",
"excludePromotion": false,
"itemLineId": "1",
"imageUrls": [
"https://www.crewclothing.co.uk/images/products/large/99999_TESTNAVY.jpg"
],
"totalLinePrice": 30
}
],
"linePromotion": [],
"transactionPromotion": []
},
"createdAt": "2022-02-17T05:16:32.188Z",
"orgCode": "AT4BZf",
"override": {
"userId": "ed360021-167d-403b-b457-a009e2b03751",
"automaticApprove": "true",
"originalUserId": "ed360021-167d-403b-b457-a009e2b03751"
},
"reasonCode": "CCRC016",
"updatedAt": "2022-02-17T05:18:24.690Z",
"terminalId": "CC01183",
"basketSummary": {
"refundTotal": 0,
"totalItems": 1,
"basketTotal": 30,
"saleTotal": 30,
"discountTotal": 0,
"VATTotal": 0
},
"baseCurrency": "GBP",
"currentTransactionDetails": {},
"userId": "ed360021-167d-403b-b457-a009e2b03751",
"storeNodeId": "1a5868ed-8bed-4019-8159-fdee12fbfe13",
"transactionId": "A0005591",
"reasonDescription": "NotReadyForPayment",
"saleTotal": null,
"type": "VOID",
"storeNodeStructure": [
{
"nodeId": "NODE::1a5868ed-8bed-4019-8159-fdee12fbfe13",
"nodeType": "STORE",
"parentId": "NODE::1c3ebdf2-f5ea-4fa4-8b99-5c80a9a15b08",
"status": true,
"isOverride": true,
"name": "Bristol"
},
{
"nodeType": "STORE_GROUP",
"parentId": "NODE::8a9fbfa5-757b-469e-8163-f636979921b0",
"status": true,
"isOverride": true,
"name": "West Midlands",
"nodeId": "NODE::1c3ebdf2-f5ea-4fa4-8b99-5c80a9a15b08"
},
{
"nodeId": "NODE::8a9fbfa5-757b-469e-8163-f636979921b0",
"nodeType": "TRADING_REGION",
"parentId": "NODE::883b1b46-a907-44fa-aaae-9b92621efc11",
"status": true,
"isOverride": true,
"name": "Midlands"
},
{
"nodeId": "NODE::883b1b46-a907-44fa-aaae-9b92621efc11",
"nodeType": "COMPANY",
"parentId": "NODE::91fa9f54-db08-4ed3-8886-3d5d2935ee86",
"status": true,
"isOverride": false,
"name": "Crew Clothing"
},
{
"isOverride": false,
"name": "hybrid_orgsetup",
"nodeId": "NODE::91fa9f54-db08-4ed3-8886-3d5d2935ee86",
"nodeType": "ORGANIZATION",
"parentId": "",
"status": true,
"type": "ORGANIZATION",
"checked": true
}
],
"transactionRef": "AT4BZfCC012022-02-17T05:16:32.186Z23ec",
"operationStatus": "INITIAL",
"dateTime": "2022-02-17T05:16:32.186Z",
"offlineTransactionId": "",
"id": "",
"deviceId": "6A599FBD-3331-49A9-9A24-4765B9C8D820"
}
Graphene Prepare EFSTA Reqeuest (ABORT)
{
"Tra":{
"ESR":{
"D":"2022-02-17T05:16:32.186Z",
"TN":"A0005591",
"RTN":"A0005283",
"TL":"CC01",
"TT":"CC01183",
"NFS": "ABORT",
"PosA":[
{
"_":"Pos",
"Dsc":"DUMPAX | 99999 | 14 | TESTNAVY",
"Pri":"30.00",
"Qty":1,
"PN":1,
"IN":"1113208",
"ID":"DUMPAX | 99999 | 14 | TESTNAVY",
"Amt":"30.00"
}
],
"T":"30.00"
}
}
}
Following parameter needed.
Params | Values |
---|---|
basket_xml | XML |
OR | |
basket_detail | JSON |
Check Print JSON for NON-Fiscal request as shown.
Request -->
PAYIN/PAYOUT request
var payinPayoutRequest = {
returnURL: 'http://10.62.0.61:8888/SE/SEWindows/index.php',
redirect_needed:true,
action_type : "PAYIN" or "PAYOUT",
parameter:'data',
printMethod: "Print"
}
//Following is Plugin call
window.plugins.printerPlugin.print(function(result) {},function(error){
},payinPayoutRequest)
Following parameter needed.
Params | Values |
---|---|
action_type | String |
Check Print JSON request as shown.
Request -->
printMethod - All Case handle print/email/both
var printWithPrintMethod = {
redirect_needed:true,
print_detail : '<PrintDetails>',
basket_xml : '<BasketXML>',
email_detail:'<EmailDetails>',
raw_response : true/false,
printMethod: 'Print' or 'Email' or 'Both' or 'Default'
}
//Following is Plugin call
window.plugins.printerPlugin.print(function(result) {},function(error){
},printWithPrintMethod)
PrinterPlugin - print method
printMethod present in the request and valid then Graphene will not show pop up of Print, Email, Both. Instead, Graphene will perform directly print, email or both
Request -->
Print Request
Insert the below JavaScript call in your HOST for Printing functionality:
Step 1: Include platform specific Graphene javascript file and plugin.js (Refer)
Step 2: Create print request which is a JSON object and contains a printing operation.
Step 3: Calling printer plugin.
Step 1 : Include platform specific Graphene javascript file and plugin.js
Step 2 : Create print request which is a JSON object and contains a printing operation.
var printingRequest ={
"returnURL":"http://yourhost.com",
"parameter":"printerresponse",
"method":"post",
"formatting":"true",
"language":"en",
"redirect_needed": false,
"print_detail":[
{
"operation":"text",
"text":"Normal test"
}
]
};
Step 3 : Calling printer plugin.
window.plugins.printerPlugin.print(function(result) {
//success callback
}, function(error) {
//error
},printingRequest)
Printing Attributes
Attribute Name | Description | Mandatory(M)/ Optional(O) | Value/Example |
---|---|---|---|
ReturnURL | Address of HTTP(S) POST. It should be supplied as a string. | O | Example: returnURL: ‘http://yourhost.com/handleprinting' |
Parameter | Specifies the key to use when returning data to the return URL. | O | Mandatory if ‘ReturnURL’ is specified. Key should be supplied as a string. |
Method | POST/GET. Default: ‘POST’ Method to send data back to the server. | O | Mandatory if ReturnURL is specified. |
Formatting | To enabler SMART Printing. This enables the printer text to wrap text smartly. | O | True/False Default: False |
Language Supported | Key "Language" This applies to all of the print operation. A change of language within a print operation is not allowed. Default language is English. | O | language: en-eu en-us en-gb en-nz en-in en-cn de-eu fr-eu ru-eu |
Print_detail | Key “Print_detail” JSON encoded Array[] | M | Print_detail[{Key: “Operation”:”operators supports”} ] |
redirect_needed | true is by default value |
O | true,false |
getContinuesUpdate | false is by default value |
O | true,false |
Supported Print Operations
Key | Description | Example |
---|---|---|
Text | "text". A print operation that consists of a single line. It allows leading and trailing spaces to be printed. | "operation":"text", "text":" PMC Retail" |
Multiline | A print operation that supports a number of lines of text as an array. | "operation":"multiline", "multiline":[ {"text": "123 Oakland street", "text": "this town in England", "text": "Bartshire", "text": "BR45 8EU" } |
Double Text | A print operation to print text on left and right simultaneously according to the printer width. | {"operation":"doubletext","text":"Text Left","text2":"Text Right"} |
Double Height | This sets the result in a printed output as double height characters. | { operation:'double height'} |
Double Width | This sets the result in a printed output as double width characters. | {operation:'double width'} |
Normal Height | This operation sets the result in a printed output as normal height characters. | {operation:'normal height'} |
Normal Width | This operation sets the result in a printed output as normal width characters. | {operation:'normal width'} |
Cut | This operation will perform a cut operation. Where the printer does not support cut operations Graphene will perform n line feeds to allow the paper to be pulled across the tear mechanism. | {"operation":"cut"} |
Feed | This will perform one or more line feed operations. If no count value is passed then the value of 1 is assumed. | {"operation":"feed", "count":"4"} |
Barcode | "symbology" Allowable values "UPC-A" "UPC-E" "JAN13" "EAN13" "JAN8" “EAN8” “ CODE39” "ITF" “CODABAR” “CODE93” “CODE128” Data to be printed in the barcode. Graphene will default to print in the centre of the print layout. | {operation:'barcode', symbology:'ITF',height:'100',alignment : ‘center’,width:'2',hri:"below",data:"123 45678"} |
QRCode | "data" | Data to be printed in the QR code |
Raw Data | To print Base64 encoded text | {"operation":"raw base64","data":"base64 encoded text data"} |
Open Drawer | Opens the cash drawer attached to the printer. Useful with Cash Management module for open drawer action. | {"operation":"open drawer"} |
Image | Key ‘image’ will print the image. | operation:'image’,data: |
Logo | The company logo will be fetched and printed using key ‘logo’, if configured | {operation:'logo'} |
Right | The entire printing will be printed right aligned/justify. | {operation:'right'} |
Left | The entire printing will be printed left aligned/justify. | {operation:'left'} |
Center | The entire printing will be printed in center alignment. | {operation:'center'} |
Priting Request Examples
Below are some examples of different printing requests using various operations as described in the above table.
Image Logo and Priting
var imagePrintingRequest = {
returnURL: 'http://yourhost.com/home.php',
parameter: 'data',
method: 'post',
language: 'en',
formatting: 'true',
redirect_needed: 'false',
print_detail: [{
operation: 'image',
data: 'base64encodeimagedata' // Base64 encoded image data
},
{
operation: 'feed',
count: '1'
}
]
};
var logoPrintingRequest = {
returnURL: 'http://yourhost.com/home.php',
parameter: 'data',
method: 'post',
language: 'en',
formatting: 'true',
redirect_needed: 'false',
print_detail: [{
operation: 'logo'
}, // Operation will print the logo configured in advanced settings of Graphene mobile application.
{
operation: 'feed',
count: '1'
}
]
}
Barcode Priting
var barcodePrintingRequest = {
returnURL: 'http://yourhost.com/home.asp',
parameter: 'data',
method: 'post',
language: 'en',
redirect_needed: 'false',
print_detail: [
{
operation: 'barcode', // Operation name, case insensitive
symbology: 'UPC-A', // Allowable barcode symbology
height: '100', // Allowable barcode height, mini. 2 max. 127 default 100
width: '4', // Allowable barcode width, mini. 1 max. 6 default 3
alignment: 'center' // Allowable barcode alignment - center, left, right. Default value is "left" and case insensitive.
hri: "below", // Allowable HRI values - none, above, below, both. Default value is "none" and is case insensitive.
data: "01230000064" // Barcode data, based on symbology used.
},
{
operation: 'feed',
count: '1'
}
]
}
QR Code Priting
var qrcodePrintingRequest = {
returnURL: 'http://yourhost.com/home.php',
parameter: 'data',
method: 'post',
language: 'en',
formatting: 'false',
redirect_needed: 'false',
print_detail: [
{
operation: 'qrcode', // Operation name, case insensitive
model: 'model1', // Allowable QRCode models - model1, model2. Default is "model1" and case insensitive.
size: '3', // QRCode size - min. 1, max 16, default 3
alignment: 'right', // Allowable qrcode alignment - center, left, right. Default value is "left" and case insensitive.
errorlevel: 'M', // Allowable qrcode error levels - L, M, Q, H. Default value is "L" and case insensitive.
data: "http://storeenabler.com" // Allowable qrcode data.
},
{
operation: 'feed',
count: '3'
}
]
};
Printer Alignment
var leftPrintingRequest = {
returnURL: 'http://yourhost.com',
parameter: 'printerresponse',
method: 'post',
language: 'en',
redirect_needed: 'false',
"print_detail": [
{
operation: 'left'
}, // Set alignment left. All the operations below this operation will be left aligned excluding barcode and qrcode operations.
{
"operation": "text",
"text": "Normal test"
}
]
};
var rightPrintingRequest = {
returnURL: 'http://yourhost.com',
parameter: 'printerresponse',
method: 'post',
language: 'en',
redirect_needed: 'false',
"print_detail": [
{
operation: 'right'
}, // Set alignment right. All the operations below this operation will be right aligned excluding barcode and qrcode operations.
{
"operation": "text",
"text": "Normal test"
}
]
};
var centerPrintingRequest = {
returnURL: 'http://yourhost.com',
parameter: 'printerresponse',
method: 'post',
language: 'en',
redirect_needed: 'false',
"print_detail": [
{
operation: 'center'
}, // Set alignment center. All the operations below this operation will be center aligned excluding barcode and qrcode operations.
{
"operation": "text",
"text": "Normal test"
}
]
};
Get Printer Call
The main purpose of the Get Printer API, is to give the ability to the user to select one particular printer from Graphene and use this value to print the next time for printing. This is a value addition so that HOST can store the value of the selected printer, and the user in turn does not have to select the printer each time a print is required.
Step 1: Include platform specific Graphene javascript file and plugin.js
Step 2: Include our (PMC specific) Location.js class
<script type = "text/javascript" src = "js/Location.js" > </script>
Step 3: Create request for fetching printer information
var locationObject = new Location('http://yourhost.com/getprinters.php',
'post',
'data');
Step 4: Call get printer Plugin
window.plugins.printerPlugin.getPrinter(function(printer) {
// Handle the printer object here
paramPrint = new PrintObject(locationTest, 'en', paramDetails, printer);
alert("Selected Printer : " + JSON.stringify(printer));
}, function(error) {
// Handle error here
}, locationObject)
//Passing printer object fetched using GetPrinters API in printing request
var printingRequest = {
returnURL: 'http://yourhost.com',
parameter: 'printerresponse',
method: 'post',
redirect_needed: 'false',
language: 'en',
"print_detail": [{
"operation": "text",
"text": "Normal test"
}
]
};
var printObject = new PrintObject(locationTest, 'en', printingRequest, null);
window.plugins.printerPlugin.print(function(printer) {
// Handle success response here
}, function(error) {
// Handle error here
}, printObject);
Print Error Codes
Graphene will send back a set of error codes when errors occur in printing. Refer Generic Errors for any other errors.
Following is the list of Error Codes for Print:
Error Type | Error Code | Message String | Resolution |
---|---|---|---|
If any parameter is invalid in Printing Request Object | PRT001 | Printing Request Invalid | Verify the Printing Request object parameters are correct or not. Verify all print actions are correctly configured as part of the JavaScript calls and JSON. |
Unable to connect to Printer | PRT002 | Printer Connection Error | Verify if the connection with Printer is broken. |
If Printer is out of paper error, and the response from printer is out of paper error | PRT003 | Out of Paper | Ensure that the paper roll is filled in the printer device |
If the printer cover is open and response from printer is error | PRT004 | Cover is Open | Ensure that the printer cover is closed. |
If the printer sends any other generic error (each printer might capture other/different errors) | PRT005 | Other general errors from printers | Depending on the error, try and resolve the hardware issue |
Types of Printers Supported
MANUFACTURER | MODEL | TYPE | iOS | Android | Windows 10 |
---|---|---|---|---|---|
EPSON | XML | WEB SERVICE | √ | √ | √ |
TM-T88 | IP | √ | √ | √ | |
P20 | BLUETOOTH | √ | √ | √ | |
ZEBRA | EM 220 II | IP | √ | √ | √ |
ZQ 110 | BLUETOOTH | √ | √ | √ | |
DATECS | DPP 250 | BLUETOOTH | √ | ||
STAR | TSP 743 | IP | √ | √ | √ |
SM-L200 | BLE | √ | √ | √ | |
SEWOO | LK-P31 | BLUETOOTH | √ |
Note: For STAR and EPSON most other ESC/POS Printer models are supported.
Web Service - PMC
This enhancement is an alternative to automatic fetching of printers. You will need to host a printer web service with the help of PMC. This Web Service will return Printer configuration for store and will be consumed by printing functionality of Graphene. Below is the JSON details for configuration of the printers.
Attribute | Type | Description | Acceptable Values/Example |
---|---|---|---|
BEACONUUID | String | Reserved for future use | Can be blank for now “” |
MAC | String | For Bluetooth Printer mac address will be sent back to Graphene. Android: Mac address will be used for connection iOS: Print to the connected printer based on MFR. | Example: 00116204d911 |
IP | String | This will be used to initiate connection with Printer. Type IPV4. Default timeout 5000 (5 sec) | Example: 10.60.1.150 |
MFR | String | Will identify the supported printer make below: EPSON, ZEBRA, DATECS, STAR, SAEWOO. | Example: Star |
WIDTH | Integer | To identify printer width. Allowable values 10 to 100. | Default: 30. |
POLLTIME | String | Reserved for future use. | Right now blank. |
CONNTYPE | Integer | Mentions the type of connection by which printer can be connected. 1 -> IP Printer 2 -> Bluetooth Printer 3 -> COM (Serial Connection printer) – For Future use 4 -> USB Printer – For Future Use | Example: 1 or 2. |
MODEL | String | This will be holding detail for Printer Model. Will be displayed to user along with Location and MFR in Printer List. Example: TSP654 (STR_T-001) LOCATION String This describes the user friendly name for the printer and will be displayed in the printer list for selection. | For Example "Bolton Store Printer 1", "Abingdon Store1 Bluetooth Printer". |
PORT | Integer | Indicates the port number used for connection to the printer. | Example: 9100 |
INACTIVE | String | Inactive means connection status with printer. Allowable values: True/False | False |
Email & Print
To send e-receipt in Email along with normal print request, pass following parameters as shown.
Key | Description | Value | Mandatory(M)/Optional(O) |
---|---|---|---|
email_allowed | Set to true for sending email receipt | true /false | O; By default - true |
email_id | Recipient's Email ID | Valid Email ID | M |
email_detail (Its JSON object) | contains params like Recipient Email, Subject, Multiple Attachmment data (if any), content and its type | Key: recipient_email, subject, attachments_detail ,content, content_type (Further detailed information of Key mentions as below ) | M |
recipient_email | Valid email address to whom receipt email needs to send | Any valid email address | M |
subject | Email subject | Any valid String | O |
content | Email content / Body | Valid body content depends on Content-Type | M |
content_type | Mention type of Body content | text/html or text/plain | O - By default text/plain |
attachments_detail | contains params like Attachment Name, Attachment Data | Key: name, attachment, content_type (Further detailed information of Key mentions as below ) | O |
name | Attachment Name | attachment title name | M (if attachments_detail added) |
attachment | Attachment Data string in html | attachment data string | M (if attachments_detail added) |
redirect_needed | true is by default value |
true,false | O |
Step 1:Create Email&Print request as shown in the example
{
"returnURL":"http://yourhost.com",
"parameter":"data",
"method":"post",
"Language":"en",
"redirect_needed": false,
"print_detail":[
{
"operation":"feed",
"count":"1"
},
{
"operation":"text",
"text":"Normal test"
}
],
"email_allowed":"true",
"email_id":"john@example.com",
"email_detail":{
"recipient_email":"test@example.com",
"subject":"RECEIPT",
"content":"<b>CUSTOMER RECEIPT</b><br>Checknet House, I53 East Barnet Road</b></I><br><br>",
"content_type":"text/html",
"attachments_detail":[
{"name":"Invoice1","attachment":"attachment data"},
{"name":"Invoice2","attachment":"<html><body>This is attachment 2 sample<body><html>"},
{"name":"Invoice3","attachment":"<html><body>This is attachment 3 sample<body><html>"}]
}
}
The subsequent sections describe the integration and major tasks involved for integrating Graphene’s email receipt service into your web host/web ePOS system.
To send e-receipt in Email, pass following parameters as shown.
Key | Description | Value | Mandatory(M)/Optional(O) |
---|---|---|---|
returnURL | This is the url on which respose will be posted after successful email sent | valid URL | O |
Parameter | Specifies the key to use when returning data to the return URL. This is mandatory if ‘RETURNURL’ is present. Key should be supplied as a string. | Any valid string | O |
Method | Method to send data back to the webhost/server. This can be a GET or a POST . Mandatory if ‘ReturnURL’ is specified. |
GET or POST | O |
redirect_needed | true is by default value. |
true,false | O |
recipient_email | Valid email address to whom receipt email needs to send | valid email address | M |
subject | Text for subject for receipt email | Any valid string | M |
content | Email content / Body | Valid body content depends on Content-Type | M |
content_type | Mention type of Body content | text/html or text/plain | O - By default text/plain |
attachments_detail | contains params like Attachment Name, Attachment Data | Key: name, attachment, content_type (Further detailed information of Key mentions as below ) | O |
name | Attachment Name | attachment title name | M (if attachments_detail added) |
attachment | Attachment Data string in html | attachment data string | M (if attachments_detail added) |
getContinuesUpdate | false is by default value |
true,false | O |
Email Request
Insert the below JavaScript call in your HOST for email functionality:
Step 1: Include platform specific Graphene javascript file and plugin.js (Refer )
Step 2: Create email request which is a JSON object and contains a email details.
Step 3: Calling email plugin.
Email Request
var paramEmail= {
redirect_needed:'true',
returnURL: 'http://10.62.0.61:8888/SE/Dev/index.php',
parameter: 'data',
method:'get',language:'en',
email_detail:{
recipient_email:'test@test.com',
subject:'RECEIPT',
content:contents,
content_type:'text/html',
"attachments_detail":[
{"name":"Invoice1","attachment":"attachment data"},
{"name":"Invoice2","attachment":"<html><body>This is attachment 2 sample<body><html>"},
{"name":"Invoice3","attachment":"<html><body>This is attachment 3 sample<body><html>"}]
}
};
Call Email printer Plugin
window.plugins.printerPlugin.email(function(result)
{
alert(JSON.stringify(result));
},
function(error)
{
alert(JSON.stringify(error));
},paramEmail)
Integrator Plugin
Third Party Integrator permits to develop custom applications that connect directly with third-party software so that features can be added or improve upon business processes. For customers, the experience can be enhanced by providing seamless integrations with apps they are already using.
Mago
MAGO is a client that come up with the requirement for automating the sale process on the airport stores. Basically, the issue is the difference between the count of customer visit store and customer came to pick up the products from the store is huge. Graphene is helping MAGO for reducing that difference and able to automate the whole process of payment including scanning of QR Code and printing of receipts.
MAGO uses all the three Graphene services like Scanning ,Payment and Printing.
MAGO Payment Request
Following two parameters are needed along with payment request attributes for making payment.
Payments Params | Values |
---|---|
orderreference | string |
paymentprocessor | value should be 'mago' while making payment request |
Check payment JSON request as shown.
var mago_sale_Req =
{
'returnURL': 'http://10.62.0.61:8888/rjBackoffice/seposservlet',
'paymentprocessor':'mago', // pass value - mago
'action':'sale',
'method':'post',
'currencycode':'GBP',
'transactionRef': 'A1234000',
'amount': 10,
'hmacsha1':'234c28394nt8w904dsf8ds7g834h5j5hj'
'orderReference': '12AD97BCSKJ' // pass orderReference value
}
window.plugins.paymentPlugin.payment(function(result) {
//success callback
}, function(error) {
//error
},mago_sale_Req)
MAGO Printing Request
There is no change in Printing request so refer Printing section for more detailed information.
MAGO Scanning Request
There is no change in Scanning request so refer Scanning section for more detailed information.
MAGO Integrator Plugin Call
Events | Description |
---|---|
Order_Details | For initiating the process, user needs to confirm order items for purchasing, so order_details event is fired. |
Order_Status | This event will ask Graphene to update MAGO for complete basket details. |
Step 1 : Include platform specific Graphene javascript file and plugin.js Refer
Step 2 : Create request for Event - Order_Details
// Request : Order_Details
var mago_order_details_Req =
{
'returnURL': 'http://10.62.0.61:8888/rjBackoffice/seposservlet',
'receiver':'mago',
'method':'post',
'event':'order_detail',
'transactionRef': '',
content: {
}
}
Response for event - Order_Details from Graphene application
Following params are received as result in JSON format.
Parameter | Data type |
---|---|
orderReference | string |
orderLines | JSON Object |
sku | string |
price | numeric |
quantity | numeric |
flightDetails | JSON Object |
destination | string |
terminal | string |
airport | string |
flightDateTime | date&time e.g. 2019-03-14T04:17:48.902Z |
customerDetails | JSON Object |
firstname | string |
lastname | string |
paymentStatus | JSON Object |
amount | numeric |
currencyCode | string |
retailerReference | string |
paymentReference | string |
status | Enumeration |
// Response : Order_detail
{
"orderLines":{
"sku":"236744578",
"price":12.33,
"quantity":2,
"flightDetails":{
"destination":"",
"terminal":"",
"airport":"",
"flightDateTime":"2019-03-14T04:17:48.902Z",
"customerDetails":{
"firstname":"John",
"lastname":"",
"paymentStatus":{
"amount":12.77,
"currencyCode":"GBP",
"retailerReference":"",
"status":"",
"paymentReference":"234345gfh56778"
}
}
MAGO Order status request
Step 1 : Include platform specific Graphene javascript file and plugin.js Refer
Step 2 : Create request for Event - Order_Status
// Request : Order_Status
var mago_order_status_Req =
{
'returnURL': 'http://10.62.0.61:8888/rjBackoffice/seposservlet',
'paymentprocessor':'mago',
'event':order_status,
'method':'post',
'transactionRef': '',
'orderReference':'',
'content':
{
"orderLines": [
{
"sku": "WDF__12132",
"price": 23.88,
"quantity": 2
},
{
"sku": "WDF__67767",
"price": 1999.88,
"quantity": 1
}
]
}
}
Response for event - Order status from Graphene application
| Parameter | Data type |
| ---------------------- | ------------------------------------------- |
| orderReference | string |
| orderLines | JSON Object |
| sku | string |
| price | numeric |
| quantity | numeric |
| updateOrderStatus | JSON Object |
| retailerReference | string |
| transactionDateTimeUtc | date&time e.g. 2019-03-13T09:01:43.8108361Z |
| retailerData | JSON Object |
| receiptData | string |
| raw | string |
| status | Enumeration |
```javascript
//Response : Order_Status
{
"orderReference":"3434534756756",
"orderLines":{
"sku":"236744578",
"price":12.33,
"quantity":2
},
"updateOrderStatus":{
"retailerReference":"35756sdfdsf",
"transactionDateTimeUtc":"2019-03-13T09:01:43.8108361Z"
},
"retailerData":{
"receiptData":"",
"raw":""
}
}
Error Codes
Code | Meaning |
---|---|
200 | Success |
401 | Unauthorized |
403 | Forbidden |
404 | Order does not exist |
500 | Server Error |
Hicaps
Health Industry Claims and Payments Service. It’s an electronic health claims system that allows you to claim Medicare, WorkSafe Victoria, or private-health Extras benefits at the time of payment.
When a service provider gives you the bill for your treatment, you hand them your Medicare, WorkSafe Victoria, or health-fund membership card, and they swipe it through an electronic HICAPS machine. The machine then automatically processes your claim. If you are claiming from your health fund, its contribution will be processed on the spot, and you pay the remaining gap if applicable.claim
HICAPS covers most ancillary services from a variety of providers including participating doctors, dentists, optometrists, chiropractors and physiotherapists.
Claim Request
Step 1 : Include platform specific Graphene javascript file and plugin.js Refer
Step 2 : Plugin request for claim
// Claim Request
var hicaps_claim_Req = {
returnURL: 'http://10.62.0.61:8888/SE/Dev/HICAPS/hicapsNew.php',
receiver:'hicaps',
method:'post',
event:'claim',
transactionRef: 'SE1568973854',
content: {
"$id": "10",
"OrderDate": "2018-08-28T03:03:38.081Z",
"TRNumber": "TESTTR01",
"DRNumber": "TESTDR01",
"HiCapsClaimPersonIndex": 1,
"ClaimLines": [
{
"$id": "11",
"ItemNumber": "501",
"Description": "Frame",
"ItemType": "FRAME",
"BodyPart": "EYE",
"ServiceDate": "2018-08-28T03:03:38.081Z",
"Price": 149
},
{
"$id": "12",
"ItemNumber": "502",
"Description": "Lens",
"ItemType": "LENS",
"BodyPart": "EYE",
"ServiceDate": "2018-08-28T03:03:38.081Z",
"Price": 50
},
{
"$id": "13",
"ItemNumber": "662",
"Description": "Multi/AntiReflectiveCoating(Pair)",
"ItemType": "C",
"BodyPart": "EYE",
"ServiceDate": "2018-08-28T03:03:38.081Z",
"Price": 50
}
]
}
}
window.plugins.integratorPlugin.integrate(function(result) {
//success callback
}, function(error) {
//error
},hicaps_claim_Req)
Sale Request
Step 3 : Plugin request for sale
Following two parameters are needed along with payment request attributes for making payment.
Payments Params | Value |
---|---|
TRNumber | string |
paymentprocessor | value should be 'hicaps' while making payment request |
DRNumber | string |
Check payment JSON request as shown.
// Payment Request
vat hicapsSaleObj = {
returnURL: 'http://10.62.0.61:8888/SE/Dev/HICAPS/hicapsNew.php',
paymentprocessor:'hicaps',
action:'sale',
method:'post',
currencycode:'GBP',
transactionRef: '1234567890',
amount: 50.00,
description:'Purchase made online',
TRNumber:'SE1568973854',
DRNumber:'123432',
hmacsha1:'b595b62b8a47a8819766f039fcaffd940b283d62',
payerEmail:'test@gmail.com'
}
window.plugins.paymentPlugin.payment(function(result) {
//success callback
}, function(error) {
//error
},hicapsSaleObj)
Email & Print request
Step 4 : Plugin request for email & Print Invoice
For more information on how to create request Refer
// Email & Print Request
var paramEmailPrint {
"returnURL":"http://yourhost.com",
"parameter":"data",
"method":"post",
"Language":"sp",
"formatting":"true",
"print_detail":[
{
"operation":"feed",
"count":"1"
},
{
"operation":"logo"
}
],
"email_allowed":"true",
"email_id":"john@mail.com",
"lookup_allowed":"true",
"cid":"12345",
"email_detail":{
"storeAddress":{
"storeName":"sas9053",
"street1":"520 Graham Street",
"street2":"",
"street3":"",
"town":"Port Melbourne",
"country":"AU",
"county":"VIC",
"postCode":"3207"
},
"Header":{
"invoice":"TAX INVOICE",
"copy":"Customer Copy",
"customerName":"Jhon Walker",
"customerNumber":"1",
"trNumber":"1"
},
"TransactionTypeHeader":{
"type":"Collect Sale"
},
"TransactionDetails":{
"frames":[
{
"prodDesc":"UK SUN RX 18",
"amount":"109"
},
{
"prodDesc":"COLUM 56:17 140 SHY GLD NON",
"amount":"59"
},
{
"prodDesc":"RED OR DEAD 2 48:18 MAT BLU",
"amount":"109"
}
],
"lenses":[
{
"prodDesc":"PRM ET&L VAR UC",
"amount":"250"
},
{
"prodDesc":"ULT Polaroid",
"amount":"40"
},
{
"prodDesc":"LENSES SUB-TOTAL",
"amount":"50"
}
],
"treatments":[
{
"prodDesc":"EYES Treatment",
"amount":"200"
},
{
"prodDesc":"EYE Drop",
"amount":"50"
}
],
"tenders":[
{
"tender":"HICAPS",
"amount":"-9950"
},
{
"tender":"Card",
"amount":"-5000"
},
{
"tender":"HICAPS",
"amount":"-9950"
},
{
"tender":"Card",
"amount":"-4950"
}
],
"treatmentsSubTotal":"250",
"framesSubTotal":"277",
"lensesSubTotal":"340",
"grandTotal":"867"
},
"TaxBreakDown":{
"GSTZ":"780.3",
"GSTG":"86.7"
},
"HealthFundSummary":{
"items":[
{
"itemCode":"110",
"itemAmount":"109"
}
]
},
"Trailer":{
"trailerLine1":"Specsavers sas9053",
"trailerLine2":"ABN 99999999999",
"trailerLine3":"",
"providerName":"",
"providerNumber":""
},
"TralerInformationLine":{
"dateTime":"24/09/18 17:18"
},
"Barcode":{
"receiptNo":"0905300500015180821112140"
}
}
}
window.plugins.printerPlugin.print(function(result) {
//success callback
}, function(error) {
//error
},paramEmailPrint)
Mercaux
Mercaux is Business Intelligence based e-commerce site that provides assistance to its customer in suggesting product/ group of products based on algorithms set by Mercaux. This basically helps the customer to choose a related product and have an excellent customer experience.
Currently, Mercaux can only suggest the products, but it does not have any payment module by which it can take payment.
Graphene with its payment module (WPTM preferred by Mercaux) will take the ownership of accepting payment.
Mercaux has its Host and Graphene needs to communicate with this Host, Mercaux application and settle payment request.
Mercaux Integrator Plugin Call
Events | Description |
---|---|
newbasket | Creation of new basket for addition of new products |
checkout | After selection of products which user wants to buy, checkout needs to be fired to ensure that selection of products is over. |
sale | After payment, final list of products needs to shared for which payment was already done |
closebasket | Event for ensuring that transaction is completed. |
Step 1 : Include platform specific Graphene javascript file and plugin.js Refer
Step 2 : Plugin request to create new basket
// Step 2: Request for newbasket
var mercaux_new_basket_Req
{
"returnURL":"http://targetpage.html",
"receiver":"mercaux",
"method":"post",
"event":"newbasket",
"content":{
"token":"acf53388L"
}
}
window.plugins.integratorPlugin.integrate(function(result) {
//success callback
}, function(error) {
//error
},mercaux_new_basket_Req)
Step 3 : Response from Graphene application once the Checkout process is initiated.
// Step 3 : Response for checkout
{
"event":"checkout",
"content":{
"products":[
{
"name":"product 1",
"sku":"1234",
"quantity":6
},
{
"name":"product 2",
"sku":"5678",
"quantity":2
},
{
"name":"product 3",
"sku":"3457",
"quantity":3
}
]
}
}
Step 4 : Payment request after checkout
Here,Payment response will be received from Graphene application once a request is sent to Graphene.
// Step 4: Request for payment request
var mercauxSaleObj =
{
"returnURL":"http://yourhost.com",
"paymentprocessor":"worldpay",
"action":"sale",
"method":"post",
"currencycode":"GBP",
"transactionRef":"A1234000",
"amount":10,
"hmacsha1":"234c28394nt8w904dsf8ds7g834h5j5hj"
}
window.plugins.paymentPlugin.payment(function(result) {
//success callback
}, function(error) {
//error
},mercauxSaleObj)
Step 5 : Send Product list once Payment is done.
The final list of products which payment is done.
// Step 5 : Request for sending product list to Graphene
var mercaux_close_basket_Req =
{
"returnURL": "http://10.62.0.61:8888/SE/Dev/MercauxDemo1.php",
"receiver":"Mercaux",
"method":"POST",
"event":"payment",
"content":{
"token":"SE4568",
"products":[
{
"name":"product 1",
"sku":"1234",
"quantity":6
},
{
"name":"product 2",
"sku":"5678",
"quantity":2
},
{
"name":"product 3",
"sku":"3457",
"quantity":3
}
]
}
}
window.plugins.integratorPlugin.integrate(function(result) {
//success callback
}, function(error) {
//error
},mercaux_close_basket_Req)
Step 6 : Close session
This event will be received from Graphene for the closing session.
// Step 6: Response for close session event from Mercaux
{
"event":"closebasket",
}
Integrator Error Codes
Graphene will send back a set of error codes when errors occur in intergrator module plugin. Refer Generic Errors for any other errors.
{
"error_code":"TP001",
"message":"Invalid URL for event"
}
Following is the list of Error Codes for Integrator:
Error Type | Error Code | Message String | Resolution |
---|---|---|---|
If any parameter is invalid in Request Object | TP001 | Unsupported event. Please check integration guide. | Ensure that the Request has valid and acceptable values. |
If any parameter is invalid in Request Object | TP001 | Settings needs to be a valid JSON string. Please check integration guide. | Ensure that the Request has valid and acceptable values. |
If any parameter is invalid in Request Object | TP001 | Invalid URL for event. | Ensure that the Request has valid and acceptable values. |
If any parameter is invalid in Request Object | TP001 | MAGO order detail request content is invalid. | Ensure that the Request has valid and acceptable values. |
If any parameter is invalid in Request Object | TP001 | Content needs to be a valid JSON string. Please check integration guide. | Ensure that the Request has valid and acceptable values. |
If any parameter is invalid in Request Object | TP001 | MAGO update payment request content is invalid. | Ensure that the Request has valid and acceptable values. |
If any parameter is invalid in Request Object | TP001 | Invalid payment amount. | Ensure that the Request has valid and acceptable values. |
If any parameter is invalid in Request Object | TP001 | Invalid currency code : GBP. Please refer integration guide. | Ensure that the Request has valid and acceptable values. |
If any parameter is invalid in Request Object | TP001 | HICAPS lookup request content is invalid. | Ensure that the Request has valid and acceptable values. |
If any parameter is invalid in Request Object | TP001 | HICAPS sale request content is invalid. | Ensure that the Request has valid and acceptable values. |
If any parameter is invalid in Request Object | TP001 | Unsupported receiver. Please check integration guide | Ensure that the Request has valid and acceptable values. |
If any parameter is invalid in Request Object | TP001 | Invalid Mercaux URL. | Ensure that the Request has valid and acceptable values. |
If fail to perform any operation | TP001 | Unable to fetch order detail.Please check integration guide. | Ensure that internet connection is working also check all settings are configured properly. |
If fail to perform any operation | TP001 | Unable to update payment details.Please check integration guide. | Ensure that internet connection is working also check all settings are configured properly. |
If fail to perform any operation | TP001 | Unable to fetch timeout detail.Please check integration guide. | Ensure that internet connection is working also check all settings are configured properly. |
If fail to perform any operation | TP001 | Connection Timeout. | Ensure that internet connection is working also check all settings are configured properly. |
If fail to perform any operation | TP001 | Unable to lookup for email. Please check integration guide. | Ensure that internet connection is working also check all settings are configured properly. |
If fail to perform any operation | TP001 | Unable to get pinpad list. Please check integration guide. | Ensure that internet connection is working also check all settings are configured properly. |
If fail to perform any operation | TP001 | Unable to get bundle list. Please check integration guide. | Ensure that internet connection is working also check all settings are configured properly. |
If fail to perform any operation | TP001 | Unable to perform claim request. Please check integration guide. | Ensure that internet connection is working also check all settings are configured properly. |
If fail to perform any operation | TP001 | Unable to perform sale request. Please check integration guide. | Ensure that internet connection is working also check all settings are configured properly. |
If fail to perform any operation | TP001 | Unable to perform config timeout request. Please check integration guide. | Ensure that internet connection is working also check all settings are configured properly. |
If fail to perform any operation | TP001 | Unable to get email config. Please check integration guide | Ensure that internet connection is working also check all settings are configured properly. |
If fail to perform any operation | TP001 | Unable to get print config. Please check integration guide | Ensure that internet connection is working also check all settings are configured properly. |
If fail to perform any operation | TP001 | Unable to perform print request. Please check integration guide. | Ensure that internet connection is working also check all settings are configured properly. |
If fail to perform any operation | TP001 | Unable to perform audit request. Please check integration guide. | Ensure that internet connection is working also check all settings are configured properly. |
If fail to perform any operation | TP001 | Something went wrong. | Ensure that internet connection is working also check all settings are configured properly. |
If fail to get response from server | TP002 | Failed to get any response from server, please try again in sometime. | Ensure that internet connection is working also check all settings are configured properly. |
If fail to get response from server | TP002 | Connection Failed. | Ensure that internet connection is working also check all settings are configured properly. |
If third party app is not installed | TP003 | application is not installed | Ensure that third party app is there. |
If third party service is disable | TP003 | HICAPS Service is disabled. | Ensure that third party service is turn on. |
If printer make is not supported | TP004 | Make not supported for Custom Print | Ensure that printer make settings are configured properly |
If error occured in pdf generation | TP004 | Error occurred while generating the invoice pdf | Ensure that all data related to pdf and settings are configured properly. |
Auth Plugin
This Auth plugin is used by Host/Hybrid client to save/retrieve auth details into/from Couchbase lite database
The subsequent sections describe the integration and major tasks involved for integrating Graphene’s Auth plugin service into your web host/web ePOS system.
Attributes for Auth Request
This input attributes would help to create JSON request to call a specific request.
Attribute Name | Description | Mandatory(M)/ Optional(O) | Values/Example |
---|---|---|---|
apiKey | api key to validate host | M | Any valid string |
type | This field is used to set or get data from CouchbaseDB | M | Any valid string and should not as SEConfiguration |
data | JSON which contains auth details(Only applicable for Set Auth plugin ) |
M | valid JSON |
accessToken | Part of user data to store in database | O | valid string |
idToken | Part of user data to store in database | O | valid string |
refreshToken | Part of user data to store in database | O | valid string |
getContinuesUpdate | false is by default value |
O | true,false |
Insert JavaScript call in your website/host to activate the auth plugin.
Set Auth Details
Follow steps as given in example.
Step 1 : Include platform specific Graphene javascript file and plugin.js (Refer)
Step 2 : Create request for set auth details.
// Create Request to set auth details
var setAuthDetailsRequest = {
apiKey:'MIICXAIBAAKBgQCqGKukO1De7zhZj6+H0qtjTkVxwTCpvKe4eCZ0FPqri0cb2JZfXJ/DgYSF6vUp',
data: {
'type':'USER',
'accessToken':'testAccessToken',
'idToken':'testIDToken',
'refreshToken':'testRefreshToken'
}
};
// Call below method to set auth details
window.plugins.authPlugin.setAuthDetails(function(result)
{
alert(JSON.stringify(result));
document.getElementById('testdata').innerText = JSON.stringify(result);
},
function(error)
{
alert(JSON.stringify(error));
document.getElementById('testdata').innerText = JSON.stringify(error);
},setAuthDetailsRequest);
Get Auth Details
Follow steps as given in example.
Step 1 : Include platform specific Graphene javascript file and plugin.js (Refer)
Step 2 : Create request for set auth details.
// Create Request to get auth details
var getAuthDetailsRequest = {
apiKey:'MIICXAIBAAKBgQCqGKukO1De7zhZj6+H0qtjTkVxwTCpvKe4eCZ0FPqri0cb2JZfXJ/DgYSF6vUp',
type:'USER'};
// Call below method to get auth details
window.plugins.authPlugin.getAuthDetails(function(result)
{
alert(JSON.stringify(result));
document.getElementById('testdata').innerText = JSON.stringify(result);
},
function(error)
{
alert(JSON.stringify(error));
document.getElementById('testdata').innerText = JSON.stringify(error);
},getAuthDetailsRequest);
Set AutoLogout Details
Follow steps as given in example.
Step 1 : Include platform specific Graphene javascript file and plugin.js (Refer)
Step 2 : Create request for set autologout details.
// Create Request to set auth details
const param = {
apiKey: this.constants.API_KEY,
//idleDuration: 5*60
};
var setAutoLogoutRequest = {
apiKey:'MIICXAIBAAKBgQCqGKukO1De7zhZj6+H0qtjTkVxwTCpvKe4eCZ0FPqri0cb2JZfXJ/DgYSF6vUp',
type:'USER',
idleDuration: 300000 // 5 minutes which is 300000 Milliseconds
};
// Call below method to set auth details
window.plugins.authPlugin.setAuthDetails(function(result)
{
alert(JSON.stringify(result));
document.getElementById('testdata').innerText = JSON.stringify(result);
},
function(error)
{
alert(JSON.stringify(error));
document.getElementById('testdata').innerText = JSON.stringify(error);
},setAutoLogoutRequest);
Stop AutoLogout Details
Follow steps as given in example.
Step 1 : Include platform specific Graphene javascript file and plugin.js (Refer)
Step 2 : Create request for stop autologout details.
// Create Request to set auth details
const param = {
apiKey: this.constants.API_KEY,
//idleDuration: 5*60
};
var stopAutoLogoutRequest = {
apiKey:'MIICXAIBAAKBgQCqGKukO1De7zhZj6+H0qtjTkVxwTCpvKe4eCZ0FPqri0cb2JZfXJ/DgYSF6vUp',
};
// Call below method to set auth details
window.plugins.authPlugin.stopAutoLogout(function(result)
{
alert(JSON.stringify(result));
document.getElementById('testdata').innerText = JSON.stringify(result);
},
function(error)
{
alert(JSON.stringify(error));
document.getElementById('testdata').innerText = JSON.stringify(error);
},stopAutoLogoutRequest);
Logger Plugin
The subsequent sections describe the integration and major tasks involved in invoking the logger functionality within Graphene. The integration is seamless and supports different types of logs
INFO
This log type is used to log info level log messages.
console.info("Info Log by logger plugin");
WARNING
This log type is used to log warning log messages.
console.warn("warn Log by logger plugin");
ERROR
This log type is used to log error log messages.
console.error("error Log by logger plugin");
DEBUG
This log type is used to log debug log messages.
console.debug("debug Log by logger plugin");
LOG
This log type is used to log messages.
console.log("Log by logger plugin");
Storage
The subsequent sections describe the Storage module which is used to perform different database related operations Like: Create Database and Create Document, this modules supports database-related multiple functions and also support Peer to Peer connection support.
Storage Request
Insert the below JavaScript call in your HOST for Storage functionality:
Step 1: Include platform specific Graphene javascript file and plugin.js (Refer )
Step 2: Create storage request which is a JSON object and contains a storage operation.
Step 3: Calling storage plugin.
Step 1 : Include platform specific Graphene javascript file and plugin.js
Step 2 : Create storage request which is a JSON object and contains a storage operation.
var storageRequest ={
"returnURL":"http://yourhost.com",
"parameter":"storageresponse",
"method":"post",
"databaseName":"TestingDB",
"apiKey":"1234567890"
};
Step 3 : Calling storage plugin.
window.plugins.storagePlugin.createDatabase(function(result) {
//success callback
}, function(error) {
//error
},storageRequest)
Storage Attributes
Attribute Name | Description | Mandatory(M)/ Optional(O) |
---|---|---|
ReturnURL | Address of HTTP(S) POST. It should be supplied as a string. Example: returnURL: ‘http://yourhost.com/handlestorage' | O |
Parameter | Specifies the key to use when returning data to the return URL. Mandatory if ‘ReturnURL’ is specified. Key should be supplied as a string. | O |
Method | POST/GET. Default: ‘POST’ Method to send data back to the server. This can be a GET or a POST. Mandatory if ‘ReturnURL’ is specified. | O |
Database Name | Unique database name which used to perform operation, Mandatory field for database operations | O |
ApiKey | Unique apikey for each modules, Mandatory as Each module have a saperate ApiKey. | M |
redirect_needed | true is by default value or false |
O |
data | Dictionary with values, Mandatory if plugin require data field and it should be a valid key value paired dictionary, Example: data: {"Drawer_id": 4,"type":"Drawer"} | O |
docID | Unique name of document, Mandatory if plugin require docID | O |
docData | Data of document, Mandatory for create and update the document plugin | O |
url | Url of database server, Mandatory for start sync plugin | O |
userName | Username credentail for database server, Mandatory for start sync plugin | O |
password | Password credentail for database server, Mandatory for start sync plugin | O |
continuous | Continuous connection type, false is by default, Mandatory for start sync plugin and Peer to Peer sync plugin |
O |
type | Connection type PUSH/PULL/PUSH_PULL and PUSH_PULL is by default, Mandatory for start sync plugin |
O |
channel | Array of multiple channel IDs or for provide "" for all channels Example: ["123243"]/[""], Mandatory for start sync plugin |
O |
getContinuesUpdate | false is by default value, possisble values are true,false |
O |
serviceType | String for service type, Mandatory for Peer to Peer sync plugin | O |
peerName | String for peer name, Mandatory for Peer to Peer sync plugin | O |
acceptPeer | String for accept peer, Mandatory for Peer to Peer sync plugin | O |
pushFilter | Contains key value pair of types and docIDs array, Example: {"types":["CONFIG"],"docIDs":["123"]}, Mandatory for Peer to Peer sync plugin | O |
pullFilter | Contains key value pair of types and docIDs array, Example: {"types":["CONFIG"],"docIDs":["123"]}, Mandatory for Peer to Peer sync plugin | O |
peerType | Possible values are ACTIVE/PASSIVE , ACTIVE is by default value, Mandatory for Peer to Peer sync plugin |
O |
Create Database Plugin
Insert the below JavaScript call in your HOST for create database plugin functionality:
Step 1: Include platform specific Graphene javascript file and plugin.js (Refer )
Step 2: Create storage request which is a JSON object and contains a storage operation.
Step 3: Calling storage plugin.
Step 1 : Include platform specific Graphene javascript file and plugin.js
Step 2 : Create storage request which is a JSON object and contains a storage operation.
var storageRequest ={
"returnURL":"http://yourhost.com",
"parameter":"storageresponse",
"method":"post",
"databaseName":"TestingDB",
"apiKey":"1234567890"
};
Step 3 : Calling storage plugin.
window.plugins.storagePlugin.createDatabase(function(result) {
//success callback
}, function(error) {
//error
},storageRequest)
Create Document Plugin
Insert the below JavaScript call in your HOST for create document plugin functionality:
Step 1: Include platform specific Graphene javascript file and plugin.js (Refer )
Step 2: Create storage request which is a JSON object and contains a storage operation.
Step 3: Calling storage plugin.
Step 1 : Include platform specific Graphene javascript file and plugin.js
Step 2 : Create storage request which is a JSON object and contains a storage operation.
var storageRequest ={
"returnURL":"http://yourhost.com",
"parameter":"storageresponse",
"method":"post",
"databaseName":"TestingDB",
"apiKey":"1234567890"
"redirect_needed":"false",
"data":{"key1":"Value1","key2":"Value2","key3":"Value3"}
};
Step 3 : Calling storage plugin.
window.plugins.storagePlugin.createDocument(function(result) {
//success callback
}, function(error) {
//error
},storageRequest)
Create Document by ID Plugin
Insert the below JavaScript call in your HOST for create document by ID plugin functionality:
Step 1: Include platform specific Graphene javascript file and plugin.js (Refer )
Step 2: Create storage request which is a JSON object and contains a storage operation.
Step 3: Calling storage plugin.
Step 1 : Include platform specific Graphene javascript file and plugin.js
Step 2 : Create storage request which is a JSON object and contains a storage operation.
var storageRequest ={
"returnURL":"http://yourhost.com",
"parameter":"storageresponse",
"method":"post",
"databaseName":"TestingDB",
"apiKey":"1234567890"
"redirect_needed":"false",
"data":{"docID":"doc12",
"docData":{"key1":"Value1","key2":"Value2","key3":"Value3"}}
};
Step 3 : Calling storage plugin.
window.plugins.storagePlugin.createDocumentByID(function(result) {
//success callback
}, function(error) {
//error
},storageRequest)
Get Document by ID Plugin
Insert the below JavaScript call in your HOST for get document by ID plugin functionality:
Step 1: Include platform specific Graphene javascript file and plugin.js (Refer )
Step 2: Create storage request which is a JSON object and contains a storage operation.
Step 3: Calling storage plugin.
Step 1 : Include platform specific Graphene javascript file and plugin.js
Step 2 : Create storage request which is a JSON object and contains a storage operation.
var storageRequest ={
"returnURL":"http://yourhost.com",
"parameter":"storageresponse",
"method":"post",
"databaseName":"TestingDB",
"apiKey":"1234567890"
"redirect_needed":"false",
"data":{"docID":"doc12"}
};
Step 3 : Calling storage plugin.
window.plugins.storagePlugin.documentByID(function(result) {
//success callback
}, function(error) {
//error
},storageRequest)
Update Document Plugin
Insert the below JavaScript call in your HOST for update document plugin functionality:
Step 1: Include platform specific Graphene javascript file and plugin.js (Refer )
Step 2: Create storage request which is a JSON object and contains a storage operation.
Step 3: Calling storage plugin.
Step 1 : Include platform specific Graphene javascript file and plugin.js
Step 2 : Create storage request which is a JSON object and contains a storage operation.
var storageRequest ={
"returnURL":"http://yourhost.com",
"parameter":"storageresponse",
"method":"post",
"databaseName":"TestingDB",
"apiKey":"1234567890"
"redirect_needed":"false",
"data":{"docID":"doc12",
"docData":{"key4":"Value4","key5":"Value5","key6":"Value6"}}
};
Step 3 : Calling storage plugin.
window.plugins.storagePlugin.updateDocument(function(result) {
//success callback
}, function(error) {
//error
},storageRequest)
Delete Document Plugin
Insert the below JavaScript call in your HOST for delete document plugin functionality:
Step 1: Include platform specific Graphene javascript file and plugin.js (Refer )
Step 2: Create storage request which is a JSON object and contains a storage operation.
Step 3: Calling storage plugin.
Step 1 : Include platform specific Graphene javascript file and plugin.js
Step 2 : Create storage request which is a JSON object and contains a storage operation.
var storageRequest ={
"returnURL":"http://yourhost.com",
"parameter":"storageresponse",
"method":"post",
"databaseName":"TestingDB",
"apiKey":"1234567890"
"redirect_needed":"false",
"data":{"docID":"doc12"}
};
Step 3 : Calling storage plugin.
window.plugins.storagePlugin.deleteDocument(function(result) {
//success callback
}, function(error) {
//error
},storageRequest)
Delete Document(Multiple Documents) Plugin
Insert the below JavaScript call in your HOST for delete Multiple document plugin functionality:
Step 1: Include platform specific Graphene javascript file and plugin.js (Refer )
Step 2: Create storage request which is a JSON object and contains a storage operation.
Step 3: Calling storage plugin.
Step 1 : Include platform specific Graphene javascript file and plugin.js
Step 2 : Create storage request which is a JSON object and contains a storage operation.
var storageRequest ={
"returnURL":"http://yourhost.com",
"parameter":"data",
"method":"post",
"databaseName":"TestingDB",
"apiKey":"1234567890"
"redirect_needed":"false",
"data":{'docID': ["11", "12", "13", "18", "14", "15"]}
};
Step 3 : Calling storage plugin.
window.plugins.storagePlugin.deleteDocument(function(result) {
//success callback
}, function(error) {
//error
},storageRequest)
Delete Database Plugin
Insert the below JavaScript call in your HOST for delete database plugin functionality:
Step 1: Include platform specific Graphene javascript file and plugin.js (Refer )
Step 2: Create storage request which is a JSON object and contains a storage operation.
Step 3: Calling storage plugin.
Step 1 : Include platform specific Graphene javascript file and plugin.js
Step 2 : Create storage request which is a JSON object and contains a storage operation.
var storageRequest ={
"returnURL":"http://yourhost.com",
"parameter":"storageresponse",
"method":"post",
"databaseName":"TestingDB",
"apiKey":"1234567890"
"redirect_needed":"false",
};
Step 3 : Calling storage plugin.
window.plugins.storagePlugin.deleteDatabase(function(result) {
//success callback
}, function(error) {
//error
},storageRequest)
Start Sync Plugin
Insert the below JavaScript call in your HOST for start database sync plugin functionality:
Step 1: Include platform specific Graphene javascript file and plugin.js (Refer )
Step 2: Create storage request which is a JSON object and contains a storage operation.
Step 3: Calling storage plugin.
Step 1 : Include platform specific Graphene javascript file and plugin.js
Step 2 : Create storage request which is a JSON object and contains a storage operation.
var storageRequest ={
"returnURL":"http://yourhost.com",
"parameter":"storageresponse",
"method":"post",
"databaseName":"TestingDB",
"apiKey":"1234567890"
"redirect_needed":"false",
"data":{ // contain details to connect host
"url": "ws://192.168.2.152:4984/yourDB/",
"userName": "sync_manager",
"password":"123456",
"continuous": true, // true/false
"type":"PUSH_PULL", // PUSH/PULL/PUSH_PULL
"channel": ["*"] // array of channel IDs or all channels ["*"]
}
};
Step 3 : Calling storage plugin.
window.plugins.storagePlugin.startSync(function(result) {
//success callback
}, function(error) {
//error
},storageRequest)
Query Database Plugin
Insert the below JavaScript call in your HOST for perform query into database plugin functionality:
Step 1: Include platform specific Graphene javascript file and plugin.js (Refer )
Step 2: Create storage request which is a JSON object and contains a storage operation.
Step 3: Calling storage plugin.
Step 1 : Include platform specific Graphene javascript file and plugin.js
Step 2 : Create storage request which is a JSON object and contains a storage operation.
var execute_query_distinct = { //Distinct query
"returnURL": "http://10.62.0.61:8888/SE/Dev/StorageModule.php",
"parameter": "data",
"method":"post",
"databaseName":"TestingDB",
"apiKey":"MIICXAIBAAKBgQCqGKukO1De7zhZj6+H0qtjTkVxwTCpvKe4eCZ0FPqri0cb2JZfXJ/DgYSF6vUp",
"redirect_needed":"false",
"data":{'query': ['SELECT',
{
'WHAT' : [
["."],['.','hostRetryCount']
],
'WHERE' : ['=',['.', 'type'],'Sample'],
"LIMIT":1,
'DISTINCT': true}]
}
};
var execute_query_offset = { //Offset query
"returnURL": "http://10.62.0.61:8888/SE/Dev/StorageModule.php",
"parameter": "data",
"method":"post",
"databaseName":"TestingDB",
"apiKey":"MIICXAIBAAKBgQCqGKukO1De7zhZj6+H0qtjTkVxwTCpvKe4eCZ0FPqri0cb2JZfXJ/DgYSF6vUp",
"redirect_needed":"false",
"data":{'query': ['SELECT',
{
'WHAT' : [
["."],['.','_id']
],
'WHERE' : ['=',['.', 'type'],'Sample'],
"LIMIT":2,
"OFFSET":2}]
}
};
var simpleWhereRequest ={ // WHAT WITH AS
"returnURL":"http://yourhost.com",
"parameter":"storageresponse",
"method":"post",
"databaseName":"TestingDB",
"apiKey":"1234567890"
"redirect_needed":"false",
"data":{"query":["SELECT",
{
"WHAT" : [
["."] // select all
],
"WHERE" : [
"=",
[".", "type"],
"Configuration"
]
}
]
}
};
var likeRequest ={ // WHERE WITH LIKE
"returnURL":"http://yourhost.com",
"parameter":"storageresponse",
"method":"post",
"databaseName":"TestingDB",
"apiKey":"1234567890"
"redirect_needed":"false",
"data":{"query":["SELECT",
{
"WHAT":[
"AS",
[
".",
"name"
],
"productName"
],
"WHERE":[
"LIKE",
[
".",
"name"
],
"%PRO%"
]
}] }
};
var fetchDocRequest ={ // query to fetch document id from the database where the type of document is CONFIG
"returnURL":"http://yourhost.com",
"parameter":"storageresponse",
"method":"post",
"databaseName":"TestingDB",
"apiKey":"1234567890"
"redirect_needed":"false",
"data":{"query":[
"SELECT",{
"WHAT" : [[".","_id"]],
"WHERE" : ["=",
[".", "type"],
"CONFIG"]
}
]}
};
var whereRequest ={ // query to fetch document id, first name and last name with help of OPERATORS(AND,=,>=,GROUP_BY,ORDER_BY,LIMIT), host can use (=,!=,<,>,<=,>=) in place of = and >= also
"returnURL":"http://yourhost.com",
"parameter":"storageresponse",
"method":"post",
"databaseName":"TestingDB",
"apiKey":"1234567890"
"redirect_needed":"false",
"data":{"query":[
"SELECT", {
"WHAT": [
[".","_id"], // document id
[".", "name", "first"], // name.first
[".", "name", "last"] ], // name.last
"WHERE":
["AND", // AND | OR
["=",
[".", "grade"],
12],
[">=",
[".", "gpa"],
["$", "GPA"] ]],
"GROUP_BY":[[".","company"]], // one or more group by
"ORDER_BY":[["DESC",[".","title"]],["DESC",[".","sample"]]], // one or more order by
"LIMIT" : 10
}
]}
};
var orderbyWithNotRequest ={ // Order by with NOT operation
"returnURL":"http://yourhost.com",
"parameter":"storageresponse",
"method":"post",
"databaseName":"TestingDB",
"apiKey":"1234567890"
"redirect_needed":"false",
"data":{"query":[
"SELECT",
{
"WHAT":[
[
".",
"_id"
],
[
".",
"name",
"first"
],
[
".",
"name",
"last"
]
],
"WHERE":[
"NOT",
[
"=",
[
".",
"userCount"
],
0
]
],
"GROUP_BY":[
[
".",
"company"
]
],
"ORDER_BY":[
[
"DESC",
[
".",
"title"
]
],
[
".",
"sample"
]
],
"LIMIT":10
}
]}
};
var simpleCountRequest ={ // WHAT WITH COUNT query support
"returnURL":"http://yourhost.com",
"parameter":"storageresponse",
"method":"post",
"databaseName":"TestingDB",
"apiKey":"1234567890"
"redirect_needed":"false",
"data":{
'query': ["SELECT",
{"WHAT":[
["COUNT",[".","_id"]],
["COUNT",[".","type"]]
]
}]
}
};
var simpleInQueryRequest ={ // IN Query support
"returnURL":"http://yourhost.com",
"parameter":"storageresponse",
"method":"post",
"databaseName":"TestingDB",
"apiKey":"1234567890"
"redirect_needed":"false",
"data": {
"query": [
"SELECT",
{
"WHAT": [
[
"."
]
],
"WHERE": [
"AND",
[
"=",
[
".",
"type"
],
"SKU"
],
[
"IN",
[
".",
"SKU"
],
[
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"15319",
"11",
"12",
"13"
]
]
],
"LIMIT": 70
}
]
}
};
Step 3 : Calling storage plugin.
window.plugins.storagePlugin.queryDatabase(function(result) {
//success callback
}, function(error) {
//error
},simpleWhereRequest)
Queries Support: Like operation with Array of Dictionary
Requested Data
{
"descriptions": [{
"name": "SHORT_DESSCRIPTION",
"countryCode": "GB",
"value": "1 PK BOXER BOX"
},
{
"name": "SHORT_DESSCRIPTION",
"countryCode": "FR",
"value": "1 PK BOXER BOX "
}
]
}
var execQuery = {
"returnURL": "http://www.yourhost.com/handlepayment",
"parameter": "data",
"databaseName": "dbname",
"method": "post",
"apiKey": "apiKey",
"redirect_needed": "false",
"data": {
'query': ['SELECT', {
'WHAT': [
['.', 'descriptions']
],
'WHERE': ["AND", ["=", [".", "type"], "SKU"],
['LIKE', ['.', 'descriptions', '*', 'name'], '%SHORT%']
]
}]
}
}
window.plugins.storagePlugin.queryDatabase(function(result)
{
// Handle successful response
},
function(error)
{
// Handle error
}, execQuery);
If JSON has a * at second last position, Means it requested to fetch data from dictionary inside an array.
If JSON has a * at last position, Means it requested to fetch value from array.
Only supported for root level array query
Queries Support: Like operation with Array of String
Requested Data
{
"barcodes": [
"5059595116059",
"5059595116060"
]
}
var execQuery = {
"returnURL": "http://www.yourhost.com/handlepayment",
"parameter": "data",
"databaseName": "dbname",
"method": "post",
"apiKey": "apiKey",
"redirect_needed": "false",
"data": {
'query': ['SELECT', {
'WHAT': [
['.', 'barcodes']
],
'WHERE': ["AND", ["=", [".", "type"], "SKU"],
['LIKE', ['.', 'barcodes', '*'], '%505%']
]
}]
}
}
window.plugins.storagePlugin.queryDatabase(function(result)
{
// Handle successful response
},
function(error)
{
// Handle error
}, execQuery);
If JSON has a * at second last position, Means it requested to fetch data from dictionary inside an array.
If JSON has a * at last position, Means it requested to fetch value from array.
Only supported for root level array query
Queries Support: Equal operation with Array of Dictionary
Requested Data
{
"descriptions": [{
"name": "SHORT_DESSCRIPTION",
"countryCode": "GB",
"value": "1 PK BOXER BOX"
},
{
"name": "SHORT_DESSCRIPTION",
"countryCode": "FR",
"value": "1 PK BOXER BOX "
}
]
}
var execQuery = {
"returnURL": "http://www.yourhost.com/handlepayment",
"parameter": "data",
"databaseName": "dbname",
"method": "post",
"apiKey": "apiKey",
"redirect_needed": "false",
"data": {
"query": [
"SELECT",
{
"WHAT": [
["."]
],
"WHERE": [
"AND",
["=", [".", "type"], "SKU"],
["=", [".", "descriptions", "*", "value"], "1 PK BOXER BOX"]
]
}
]
}
}
window.plugins.storagePlugin.queryDatabase(function(result)
{
// Handle successful response
},
function(error)
{
// Handle error
}, execQuery);
If JSON has a * at second last position, Means it requested to fetch data from dictionary inside an array.
If JSON has a * at last position, Means it requested to fetch value from array.
Only supported for root level array query
Queries Support: Equal operation with Array of String
Requested Data
{
"barcodes": [
"5059595116059",
"5059595116060"
]
}
var execQuery = {
"returnURL": "http://www.yourhost.com/handlepayment",
"parameter": "data",
"databaseName": "dbname",
"method": "post",
"apiKey": "apiKey",
"redirect_needed": "false",
"data": {
"query": [
"SELECT",
{
"WHAT": [
["."]
],
"WHERE": [
"AND",
["=", [".", "type"], "SKU"],
["=", [".", "barcodes", "*"], "5059595116059"]
]
}
]
}
}
window.plugins.storagePlugin.queryDatabase(function(result)
{
// Handle successful response
},
function(error)
{
// Handle error
}, execQuery);
If JSON has a * at second last position, Means it requested to fetch data from dictionary inside an array.
If JSON has a * at last position, Means it requested to fetch value from array.
Only supported for root level array query
Start Advertiser Plugin
Insert the below JavaScript call in your HOST for start advertiser for peer to peer sync plugin functionality:
Step 1: Include platform specific Graphene javascript file and plugin.js (Refer )
Step 2: Create storage request which is a JSON object and contains a storage operation.
Step 3: Calling storage plugin.
Step 1 : Include platform specific Graphene javascript file and plugin.js
Step 2 : Create storage request which is a JSON object and contains a storage operation.
var storageRequest ={
"returnURL":"http://yourhost.com",
"parameter":"storageresponse",
"method":"post",
"apiKey":"1234567890"
"redirect_needed":"false",
"serviceType" : "basketReview",
"peerName":"customerdeviceID",
"acceptPeer":"store_staff",
"getContinuesUpdate":"TRUE"
};
Step 3 : Calling storage plugin.
window.plugins.storagePlugin.startAdvertiser(function(result) {
//success callback
}, function(error) {
//error
},storageRequest)
Start Browser Plugin
Insert the below JavaScript call in your HOST for start browser for peer to peer sync plugin functionality:
Step 1: Include platform specific Graphene javascript file and plugin.js (Refer )
Step 2: Create storage request which is a JSON object and contains a storage operation.
Step 3: Calling storage plugin.
Step 1 : Include platform specific Graphene javascript file and plugin.js
Step 2 : Create storage request which is a JSON object and contains a storage operation.
var storageRequest ={
"returnURL":"http://yourhost.com",
"parameter":"storageresponse",
"method":"post",
"apiKey":"1234567890"
"redirect_needed":"false",
"serviceType" : "basketReview",
"peerName":"store_staff",
"acceptPeer":"customerdeviceID",
"getContinuesUpdate":"TRUE"
};
Step 3 : Calling storage plugin.
window.plugins.storagePlugin.startDeviceBrowser(function(result) {
//success callback
}, function(error) {
//error
},storageRequest)
Stop Advertiser Plugin
Insert the below JavaScript call in your HOST for stop advertiser for peer to peer sync plugin functionality:
Step 1: Include platform specific Graphene javascript file and plugin.js (Refer )
Step 2: Create storage request which is a JSON object and contains a storage operation.
Step 3: Calling storage plugin.
Step 1 : Include platform specific Graphene javascript file and plugin.js
Step 2 : Create storage request which is a JSON object and contains a storage operation.
var storageRequest ={
"apiKey":"1234567890"
};
Step 3 : Calling storage plugin.
window.plugins.storagePlugin.stopAdvertiser(function(result) {
//success callback
}, function(error) {
//error
},storageRequest)
Stop Browser Plugin
Insert the below JavaScript call in your HOST for stop browser for peer to peer sync plugin functionality:
Step 1: Include platform specific Graphene javascript file and plugin.js (Refer )
Step 2: Create storage request which is a JSON object and contains a storage operation.
Step 3: Calling storage plugin.
Step 1 : Include platform specific Graphene javascript file and plugin.js
Step 2 : Create storage request which is a JSON object and contains a storage operation.
var storageRequest ={
"apiKey":"1234567890"
};
Step 3 : Calling storage plugin.
window.plugins.storagePlugin.stopDeviceBrowser(function(result) {
//success callback
}, function(error) {
//error
},storageRequest)
Start Peer to Peer Sync Plugin
Insert the below JavaScript call in your HOST for start peer to peer sync plugin functionality:
Step 1: Include platform specific Graphene javascript file and plugin.js (Refer )
Step 2: Create storage request which is a JSON object and contains a storage operation.
Step 3: Calling storage plugin.
Step 1 : Include platform specific Graphene javascript file and plugin.js
Step 2 : Create storage request which is a JSON object and contains a storage operation.
var storageRequest ={
"apiKey":"1234567890"
"type" : "PUSH_PULL", // PUSH/PULL/PUSH_PULL
"databaseName":"TestingDB",
"continuous": true, // true/false
"pushFilter":{"types":["CONFIG"],"docIDs":["123"]}, // array of document types and IDs
"pullFilter":{"types":[],"docIDs":[]}, //default can be pass as empty
"peerType":"PASSIVE", // ACTIVE/PASSIVE
"getContinuesUpdate":"TRUE" // true/false
};
Step 3 : Calling storage plugin.
window.plugins.storagePlugin.startPeerToPeerSync(function(result) {
//success callback
}, function(error) {
//error
},storageRequest)
Stop Peer to Peer Sync Plugin
Insert the below JavaScript call in your HOST for stop peer to peer sync plugin functionality:
Step 1: Include platform specific Graphene javascript file and plugin.js (Refer )
Step 2: Create storage request which is a JSON object and contains a storage operation.
Step 3: Calling storage plugin.
Step 1 : Include platform specific Graphene javascript file and plugin.js
Step 2 : Create storage request which is a JSON object and contains a storage operation.
var storageRequest ={
"apiKey":"1234567890"
"databaseName":"TestingDB",
};
Step 3 : Calling storage plugin.
window.plugins.storagePlugin.stopPeer2PeerSync(function(result) {
//success callback
}, function(error) {
//error
},storageRequest)
Start Document Change Listener Plugin
Insert the below JavaScript call in your HOST for start document change listener plugin functionality:
Step 1: Include platform specific Graphene javascript file and plugin.js (Refer )
Step 2: Create storage request which is a JSON object and contains a storage operation.
Step 3: Calling storage plugin.
Step 1 : Include platform specific Graphene javascript file and plugin.js
Step 2 : Create storage request which is a JSON object and contains a storage operation.
var storageRequest ={
"apiKey":"1234567890"
"databaseName":"TestingDB",
"getContinuesUpdate":"TRUE" // true/false
};
Step 3 : Calling storage plugin.
window.plugins.storagePlugin.startListeningToDocumentChanges(function(result) {
//success callback
}, function(error) {
//error
},storageRequest)
Create Index(Value Index)
var paramsIndex = {
"returnURL":"http://yourhost.com",
"parameter": 'data',
"method": 'post',
"databaseName": "TestingDB",
"apiKey": "1234567890",
"data": {
"indexProperty": [
"type",
"receiptType"
],
"indexName": "receiptIndex"
},
"redirect_needed": false
};
Step 3 : Calling storage plugin.
window.plugins.storagePlugin.createIndex(function(result) {
//success callback
}, function(error) {
//error
},paramsIndex)
Insert the below JavaScript call in your HOST for Create index plugin functionality:
Step 1: Include platform specific Graphene javascript file and plugin.js (Refer )
Step 2: Create index request which is a JSON object and contains a index creation operation.
Step 3: Calling storage plugin.
Create FTS Index(Full Text Index)
var paramsFTSIndex = {
"returnURL":"http://yourhost.com",
"parameter": 'data',
"method": 'post',
"databaseName": "TestingDB",
"apiKey": "1234567890",
"data": {
"indexProperty": [
"descriptions",
"barcodes"
],
"indexName": "ftsIndex"
},
"redirect_needed": false
};
Insert the below JavaScript call in your HOST for Create FTS index plugin functionality:
Step 3 : Calling storage plugin.
window.plugins.storagePlugin.createFTSIndex(function(result) {
//success callback
}, function(error) {
//error
},paramsFTSIndex)
Step 1: Include platform specific Graphene javascript file and plugin.js (Refer )
Step 2: Create index request which is a JSON object and contains a Full Text index creation operation.
Step 3: Calling storage plugin.
Full Text Search Query
var execQuery = {
"returnURL":"http://yourhost.com",
"parameter": "data",
"databaseName": "TestingDB",
"method": 'post',
"apiKey": "1234567890",
"redirect_needed": 'false',
"data": {
"query": [
"SELECT",
{
"WHERE": [ "*", [ ".", "ftsIndex" ], "SKU_121" ],
"LIMIT": 500,
"WHAT": [
[
"."
]
]
}
]
}
};
Insert the below JavaScript call in your HOST for Create Full Text Search query support plugin functionality:
Step 3 : Calling storage plugin.
window.plugins.storagePlugin.queryDatabase(function(result) {
//success callback
}, function(error) {
//error
},execQuery)
Step 1: Include platform specific Graphene javascript file and plugin.js (Refer )
Step 2: Create index request which is a JSON object and contains a Full Text Search query operation.
Step 3: Calling storage plugin.
Storage Error Codes
Graphene will send back a set of error codes when errors occur in storage. Refer Generic Errors for any other errors.
{
"error_code":"STR001",
"message":"invalid database name"
}
Following is the list of Error Codes for Storage:
Error Type | Error Code | Message String | Resolution |
---|---|---|---|
If any parameter is invalid in Storage Request Object or any operation is failed to execute in database | STR001 | - invalid database name - Error occurred while creating database |
Verify the Storage Request object parameters are correct or not. Verify all params are correctly configured as part of the JavaScript calls and JSON. |
If Database already exists | DB001 | Database with this name already exists | Vefify that database name and pass correctly. |
If a user tries to create more then a defined database | DB002 | Maximum number of Databases already created | Verify that user should not create more then maximum limit of databases. |
If the database name does not exist | DB003 | The database with this name does not exist | Check databsae name or create new database. |
If Database unable to open to perform any operation | DB004 | Unable to open database | Check database configuration or database name. |
If unable to delete database or unable to find a document with ID | DB005 | - Document with this ID does not exist - Unable to delete the database |
For delete database check database connections closed properly or not, for find document check document with ID exist or not. |
If unable to delete document by document id | DB006 | Unable to delete document | Check document exist or not also check for valid document ID. |
If Error in building Query | DB007 | Unable to prepare query from JSON provided | Verify the Storage Request object parameters are correct or not. Verify all params are correctly configured as part of the JSON. |
If document ID is not provided in the request | DB008 | Document id not found in parameter | Verify the Storage Request object parameters are correct or not. Verify all params are correctly configured as part of the JSON. |
If data is not a valid JSON object | DB009 | Invalid Json Object | Verify the Storage Request object parameters are correct or not. Verify all params are correctly configured as part of the JSON. |
Query execution Error | DB010 | Cblite Error | Check database configuration and query format. |
If Advertiser or Browser is already started & user try to start it again | DB011 | - Device browsing is already running - Advertiser is already running |
Stop Advertiser or Browser which is already started. |
If sync is not running or sync running and unable to stop sync | DB011 | - Unable to stop sync - Peer to Peer sync is not running |
Check sync scenarios and perform it correctly. |
Status Plugin
The subsequent sections describe the integration and major tasks involved for integrating Graphene’s status plugin service into your web host/web ePOS system to get the status of modules configured in the application.
Status Attributes
This input attributes would help to create JSON request to call a specific request.
Attribute Name | Description | Mandatory(M)/ Optional(O) | Values/Example |
---|---|---|---|
ReturnURL | It should be supplied as a valid http url string. Example: returnURL: ‘http://yourhost.com/handleStatus' | O | http://example.com/handlingStatus |
Parameter | Specifies the key to use when returning data to the return URL. This is mandatory if ‘RETURNURL’ is present. Key should be supplied as a string. | O | Any valid string |
Method | Method to send data back to the webhost/server. This can be a GET or a POST . Mandatory if ‘ReturnURL’ is specified. |
O | GET or POST |
redirect_needed | true is by default value. |
O | true,false |
module | name of module for which status required. | M | Ex. payment, printing, scanning, third_party_integrator etc. |
Request parameter
Follow steps as given in example.
Step 1 : Include platform specific Graphene javascript file and plugin.js (Refer)
Step 2 : Create request for set auth details.
// Create Request to get status
var paymentParam = {'returnURL':'http://yourhost.com/handleStatus','redirect_needed':true,
'module': 'payment'};
// Call Plugin and pass request
window.plugins.statusPlugin.getStatus(function(result){document.getElementById('contextdata').innerText = JSON.stringify(result);},function(error){alert(JSON.stringify(error));},paymentParam)
Admin Plugin
The subsequent sections describe the integration and major tasks involved for integrating Graphene’s admin plugin service into your web host/web ePOS system to get the information related to application settings which are configured in application.
Request parameter
Follow steps as given in example.
Step 1 : Include platform specific Graphene javascript file and plugin.js (Refer)
Step 2 : Create request for admin plugin details.
// Create Request to get status
var param = {};
// Call Plugin and pass request
window.plugins.adminPlugin.getConfigurations(function(result){document.getElementById('contextdata').innerText = JSON.stringify(result);},function(error){alert(JSON.stringify(error));},param)
Module Plugin
The subsequent sections describe the integration and major tasks involved for integrating Graphene’s module plugin service into your web host/web ePOS system to set and get document and manage auth details realted information in to application.
Do Operation
Generic plugin to perform any operation
var doOperationRequest = {
apiKey: "B911EF717FD6D677D4EE9E572C2A1",
operationType: "LAUNCH/PAGE",
module: "AMC/TMC/CREST",
data:{
//Operation Data in form of JSON
action: "LOGIN"/"getCurrency()"
}
}
window.plugins.modulesPlugin.doOperation(function(result)
{
// Handle successful response
},
function(error)
{
// Handle error
},doOperationRequest);
Attribute Name | Description | Mandatory(M)/ Optional(O) |
---|---|---|
apiKey | Unique apikey for each module, Mandatory as Each module have a separate ApiKey. | M |
action | Operation Data in form of JSON | M |
module | Module name | M |
operationType | Type - LAUNCH/PAGE | M |
Complete Operation
It will be response coming from host/module for any of the operations requested from it.
var completeOperationRequest = {
apiKey: "B911EF717FD6D677D4EE9E572C2A1",
success: false/true,
close: true/false
data: {
//------Success false------//
error_code: "CAS001",
error_message: "Invalid tender",
//------Success true (not to be checked)------//
transactionRef: '121e1j2432hi',
sale_amount: 10,
currency : USD,
.
.
.
}
}
window.plugins.modulesPlugin.completeOperation(function(result)
{
// Handle successful response
},
function(error)
{
// Handle error
},completeOperationRequest);
Attribute Name | Description | Mandatory(M)/ Optional(O) |
---|---|---|
apiKey | Unique apikey for each module, Mandatory as Each module have a separate ApiKey. | M |
success | Host will get either success or failure callback response. | M |
close | Graphene will close module screen if the key is true | M |
data | This “Data“ in a request, Graphene will send as a response to doOperation | M |
- If success is false then send response as error
- If success is true then send response as success.
Response -
Success - NA
Failure - Send error response back
- default value for “close“ will be true
Get Operation Details
This method is used to get operation details
var getInfoDetails_valid = {
apiKey: 'MIICXAIBAAKBgQCqGKukO1De7zhZj6+H0qtjTkVxwTCpvKe4eCZ0FPqri0cb2JZfXJ/DgYSF6vUp'
};
window.plugins.modulesPlugin.getInfo(function(result)
{
// Handle successful response
},
function(error)
{
// Handle error
},getInfoDetails_valid);
- The respone is the “data“ JSON of doOperation
Module Attributes
Attribute Name | Description | Mandatory(M)/ Optional(O) |
---|---|---|
ApiKey | Unique apikey for each module, Mandatory as Each module have a separate ApiKey. | M |
redirect_needed | true is by default value or false |
O |
param | Dictionary with values, Mandatory if plugin require param field and it should be a valid key value paired dictionary, Example: param: {"name": "test","type":"Drawer"} | O |
Set Info Plugin
Insert the below JavaScript call in your HOST for set document related info plugin functionality:
Step 1: Include platform specific Graphene javascript file and plugin.js (Refer)
Step 2: Create module request which is a JSON object and contains a module operation.
Step 3: Calling module plugin.
Step 1 : Include platform specific Graphene javascript file and plugin.js
Step 2 : Create module request which is a JSON object and contains a module operation.
var setInfoRequest ={
"apiKey":"1234567890",
"param": {
"name":"USER",
"accessToken":"testAccessToken",
"idToken":"testIDToken",
"refreshToken":"testRefreshToken"
}
};
Step 3 : Calling module plugin.
window.plugins.modulesPlugin.setInfo(function(result) {
//success callback
}, function(error) {
//error
},setInfoRequest)
Get Info Plugin
Insert the below JavaScript call in your HOST for get document related info plugin functionality:
Step 1: Include platform specific Graphene javascript file and plugin.js (Refer)
Step 2: Create module request which is a JSON object and contains a module operation.
Step 3: Calling module plugin.
Step 1 : Include platform specific Graphene javascript file and plugin.js
Step 2 : Create module request which is a JSON object and contains a module operation.
var getInfoRequest ={ "apiKey":"1234567890" };
Step 3 : Calling module plugin.
window.plugins.modulesPlugin.getInfo(function(result) {
//success callback
}, function(error) {
//error
},getInfoRequest)
Get Unique Device ID Plugin
Insert the below JavaScript call in your HOST for get Unique Device ID related info plugin functionality:
Step 1: Include platform specific Graphene javascript file and plugin.js (Refer)
Step 2: Create module request which is a JSON object and contains a module operation.
Step 3: Calling module plugin.
Step 1 : Include platform specific Graphene javascript file and plugin.js
Step 2 : Create module request which is a JSON object and contains a module operation.
var getInfoRequest ={ "apiKey":"1234567890" };
Step 3 : Calling module plugin.
window.plugins.modulesPlugin.getUniqueDeviceID(function(result) {
//success callback
}, function(error) {
//error
},getInfoRequest)
Remove Auth Plugin
Insert the below JavaScript call in your HOST for remove auth details plugin functionality:
Step 1: Include platform specific Graphene javascript file and plugin.js (Refer)
Step 2: Create module request which is a JSON object and contains a module operation.
Step 3: Calling module plugin.
Step 1 : Include platform specific Graphene javascript file and plugin.js
Step 2 : Create module request which is a JSON object and contains a module operation.
var removeAuthDetails_valid = {
apiKey:'MIICXAIBAAKBgQCqGKukO1De7zhZj6+H0qtjTkVxwTCpvKe4eCZ0FPqri0cb2JZfXJ/DgYSF6vUp',
type:'USER'};
Step 3 : Calling module plugin.
window.plugins.modulesPlugin.removeAuthDetails(function(result) {
//success callback
}, function(error) {
//error
},removeAuthDetails_valid)
Pennies Plugin
Graphene Enables Third Party Application to use donation feature for sale payments with legal advice and agreement. Donation calculation and log entries of donation can be found in logs of Graphene Application
Pennies Plug-in Attributes
Attribute Name | Description | Mandatory/ Optional | Values/Example |
---|---|---|---|
ReturnURL | Address of the http POST. ‘https’ is also supported. The POST URL should be supplied as a string. E.g. returnURL: ‘http://yourhost.com/handlepayments’ | M | |
PaymentProcessor | Name of the payment service provider. This specifies the supported PSP. Allowable values: Worldpay, Ayden, adyen_applepay, PayPal, Handpoint, Anderson Zaks, SumUp, SECASH (case insensitive), Hicaps | O | |
Action | Transaction type : SALE/REFUND (case insensitive) | M | |
Method | Method to send data back to the server. This is always 'POST’. | M | |
TransactionRef | Unique identifier for the transaction. Example: Unique transaction number, basket/order reference. | M | |
Amount | Transaction amount. | M | |
Description | Description of the transaction. E.g. Description of the purchase made. | O | |
sendReceiptBack | Whether or not to send the receipt data back to the returnURL. False - do not send receipt data back True - send receipt data back | O | |
Printlocally | Whether or not to print customer and merchant receipts locally. False - do not print receipt locally True - print receipt locally | O | |
CurrencyCode | Mandatory if the payment provider is other than WorldPay and supports different types of currency as per list. Check detailed list | O (WorldPay) M (all other Payment Providers) | |
PayerEmail | Configure to send the transaction receipts. | O | |
transactionId | For referenced refund like PayPal Only applicable for Refund request |
M | |
redirect_needed | true is by default value |
O | true,false |
getContinuesUpdate | false is by default value |
O | true,false |
Calculate Donation
Insert the below JavaScript call in your HOST for Calculate Donation related to Pennies plugin functionality:
Step 1: Include platform specific Graphene javascript file and plugin.js (Refer)
Step 2: Create pennies plugin request which is a JSON object and contains a pennies operation.
Step 3: Calling pennies plugin.
Step 1 : Include platform specific Graphene javascript file and plugin.js
Step 2 : Create pennies plugin request which is a JSON object and contains a pennies operation.
var calculateDonationReq =
{
returnURL: 'http://10.62.0.61:8888/SE/Dev/iOS/cardscanner.php',
processor:"pennies",
apiKey:'87654431351223',
currency:"GP",
method:'post',
amount:"100.45",
redirect_needed: false,
transactionRef: '<?= "IE".$date->getTimestamp()?>'
};
Step 3 : Calling module plugin.
PaymentPlugin.prototype.calculateDonation(function(result) {
//success callback
}, function(error) {
//error
},calculateDonationReq)
Log Donation
Insert the below JavaScript call in your HOST for Logging Donation related to Pennies plugin functionality:
Step 1: Include platform specific Graphene javascript file and plugin.js (Refer)
Step 2: Create pennies plugin request which is a JSON object and contains a pennies operation.
Step 3: Calling pennies plugin.
Step 1 : Include platform specific Graphene javascript file and plugin.js
Step 2 : Create pennies plugin request which is a JSON object and contains a pennies operation.
var loggingDonationStatusReq = {
returnURL: 'http://10.62.0.61:8888/SE/Dev/cardscanner.php',
apiKey:'87654431351223',
status: "true",
redirect_needed: false,
};
Step 3 : Calling module plugin.
PaymentPlugin.prototype.loggingDonationStatus (function(result) {
//success callback
}, function(error) {
//error
},loggingDonationStatusReq)
Make Donation
Insert the below JavaScript call in your HOST for Make Donation related to Pennies plugin functionality:
Step 1: Include platform specific Graphene javascript file and plugin.js (Refer)
Step 2: Create pennies plugin request which is a JSON object and contains a pennies operation.
Step 3: Calling pennies plugin.
Step 1 : Include platform specific Graphene javascript file and plugin.js
Step 2 : Create pennies plugin request which is a JSON object and contains a pennies operation.
var calculateDonationReq = {
returnURL: 'http://10.62.0.61:8888/SE/Dev/iOS/cardscanner.php',
apiKey:'87654431351223',
processor:"pennies",
donationAmount:"1.50",
transactionRef: '<?= "IE".$date->getTimestamp()?>',
currency:"GBP",
donationDateTime:'<?=date('Y-m-d H:i:s')?>',
deviceId:"dev4567890123456",
storeId:"STO4567890123456",
terminal_id:"ter4567890123456",
paymentMethod:"PAY4567890123456",
redirect_needed: false,
};
Step 3 : Calling module plugin.
PaymentPlugin.prototype.makeDonation (function(result) {
//success callback
}, function(error) {
//error
},calculateDonationReq)
Audit Plugin
The subsequent sections describe the integration and major tasks involved for integrating Graphene’s Audit plugin service into your web host/web ePOS system to get the audit of EFSTA-France Transactions in the application.
Audit Void Item
var auditVoidItem = {
User: "99", // Default or pass the OPR value from Basket XML
AuditCode: "150", // Audit code (According to the scenario)
AuditDescription: "Audit Message (According to the scenario)" // Message
}
//Following is Plugin call
window.plugins.auditPlugin.auditVoidItem(function(result) {},function(error){
},auditVoidItem)
Request -> Audit Void Item
{
"Audit": {
"Opr": "99",
"Code": "150",
"Dsc": "Description",
"TL": "CC00113",
"TT": "C001"
}
}
Response -> Audit Void Item
{
"AuditC": {
"SQ": 3831,
"Result": {
"RC": "OK"
}
}
}
Following parameter needed.
Params | Values |
---|---|
User | String |
AuditCode | String |
AuditDescription | String |
Check Audit JSON request as shown.
Request -->
Audit
var audit = {
User: "99", // Default or pass the OPR value from Basket XML
AuditCode: "150", // Audit code (According to the scenario)
AuditDescription: "Audit Message (According to the scenario)" // Message
}
//Following is Plugin call
window.plugins.auditPlugin.audit(function(result) {},function(error){
},audit)
Request -> Audit
{
"Audit": {
"Opr": "99",
"Code": "150",
"Dsc": "Description",
"TL": "CC00113",
"TT": "C001"
}
}
Response -> Audit
{
"AuditC": {
"SQ": 3831,
"Result": {
"RC": "OK"
}
}
}
Following parameter needed.
Params | Values |
---|---|
User | String |
AuditCode | String |
AuditDescription | String |
Check Audit JSON request as shown.
Request -->
LogSignIn
var logSignIn = {
User: "99", // Default or pass the OPR value from Basket XML
}
//Following is Plugin call
window.plugins.auditPlugin.logSignIn(function(result) {},function(error){
},logSignIn)
Request -> LogSignIn
{
"Audit": {
"ESR": {
"NF": "LOGIN"
}
}
}
Response -> LogSignIn
{
"AuditC": {
"SQ": 3831,
"Result": {
"RC": "OK"
}
}
}
Following parameter needed.
Params | Values |
---|---|
User | String |
Check Audit JSON request as shown.
Request -->
PAYIN
var payIn = {
User: "99", // Default or pass the OPR value from Basket XML
}
//Following is Plugin call
window.plugins.auditPlugin.payin(function(result) {},function(error){
},payIn)
Request -> PAYIN
{
"Audit": {
"ESR": {
"NF": "PAYIN"
}
}
}
Response -> PAYIN
{
"AuditC": {
"SQ": 3831,
"Result": {
"RC": "OK"
}
}
}
Following parameter needed.
Params | Values |
---|---|
User | String |
Check Audit JSON request as shown.
Request -->
PAYOUT
var payOut = {
User: "99", // Default or pass the OPR value from Basket XML
}
//Following is Plugin call
window.plugins.auditPlugin.payout(function(result) {},function(error){
},payOut)
Request -> PAYOUT
{
"Audit": {
"ESR": {
"NF": "PAYOUT"
}
}
}
Response -> PAYOUT
{
"AuditC": {
"SQ": 3831,
"Result": {
"RC": "OK"
}
}
}
Following parameter needed.
Params | Values |
---|---|
User | String |
Check Audit JSON request as shown.
Request -->
Register transaction (No UI) Skip
var registerTransactionRequest = {
basket_detail : "<JSON basket or xml basket>"
provider: "eBasket" // eBasket or RJ
}
//Following is Plugin call
window.plugins.auditPlugin.registerTransaction(function(result) {},function(error){
},registerTransactionRequest)
AuditPlugin - registerTransaction method
Register transcation call API in the background no UI will be visible in case of succsss/failure
Request -->
Outbound Plugin
The subsequent sections describe the integration and major tasks involved for integrating Graphene’s Outboung plugin service into your web host/web ePOS system to process and send files to the host.
FTP
var pushFTP = {
data: [
{
rawData: "<note><to>Tove</to><from>Jani</from><heading>Reminder</heading><body>Don't forget me this weekend</body></note>",
dataKind: "Text",
Name: "Demo.xml"
}
],
pushConfiguration: [
{ type : "FTP",
server: "10.62.0.61",
port: 21,
username: "Devadmin",
password: "1234@pmc",
rootPath: "/Release3.7/"
}
]
};
//Following is Plugin call
window.plugins.outboundPlugin.push(function(result) {},function(error){
},pushFTP)
Following parameters are needed.
Params | Values |
---|---|
data | Array |
pushConfiguration | Array |
Parameters for data | Values |
---|---|
rawData | String |
dataKind | String |
Name | String |
Parameters for pushConfiguration | Values |
---|---|
type | String |
server | String |
port | Integer |
username | String |
password | String |
rootPath | String |
SFTP
var pushSFTP = {
data: [
{
rawData: "<note><to>Tove</to><from>Jani</from><heading>Reminder</heading><body>Don't forget me this weekend</body></note>",
dataKind: "Text",
Name: "Demo.xml"
}
],
pushConfiguration: [
{ type : "SFTP",
server: "10.62.0.61",
port: 22,
username: "DevAdmin",
password: "1234@pmc",
rootPath: "C:/SFTP"
}
]
};
//Following is Plugin call
window.plugins.outboundPlugin.push(function(result) {},function(error){
},pushSFTP)
Following parameters are needed.
Params | Values |
---|---|
data | Array |
pushConfiguration | Array |
Parameters for data | Values |
---|---|
rawData | String |
dataKind | String |
Name | String |
Parameters for pushConfiguration | Values |
---|---|
type | String |
server | String |
port | Integer |
username | String |
password | String |
rootPath | String |
AWS
var pushAWS = {
data: [
{
rawData: "<note><to>Tove</to><from>Jani</from><heading>Reminder</heading><body>Don't forget me this weekend</body></note>",
dataKind: "Text",
Name: "Demo.xml"
}
],
pushConfiguration: [
{ type: "AWS",
keyId: "AKIAYJ4RRV2Q5YHPUEHZ",
keyName: "D5G2o44JsHMO0iAxslgbVd3QbzAVG6BshBClYpUr",
bucket: "se-dev-store",
region: "eu-west-1"
}
]
};
//Following is Plugin call
window.plugins.outboundPlugin.push(function(result) {},function(error){
},pushAWS)
Following parameters are needed.
Params | Values |
---|---|
data | Array |
pushConfiguration | Array |
Parameters for data | Values |
---|---|
rawData | String |
dataKind | String |
Name | String |
Parameters for pushConfiguration | Values |
---|---|
type | String |
keyId | String |
keyName | String |
bucket | String |
region | String |
var pushEmail = {
data: [
{
rawData: "<note><to>Tove</to><from>Jani</from><heading>Reminder</heading><body>Don't forget me this weekend</body></note>",
dataKind: "Text",
Name: "Demo.xml"
}
],
pushConfiguration: [
{ type : "Email",
server: "in-v3.mailjet.com",
port: 587,
username: "a7a36545993cb9ecffba6881368092f7",
password: "3c4906958e22e4f1e1f35836db3c0dd4",
serverOnly: "false",
fromAddress: "storeenablertest@gmail.com",
recipient: "test.test@pmcretail.com",
subject: "Attachments from Outbound Plugin",
content: "Please find the below attachments.\nThank you,\nStore Enabler"
}
]
};
//Following is Plugin call
window.plugins.outboundPlugin.push(function(result) {},function(error){
},pushEmail)
Following parameters are needed.
Params | Values |
---|---|
data | Array |
pushConfiguration | Array |
Parameters for data | Values |
---|---|
rawData | String |
dataKind | String |
Name | String |
Parameters for pushConfiguration | Values |
---|---|
type | String |
server | String |
port | Integer |
username | String |
password | String |
serverOnly | String |
fromAddress | String |
recipient | String |
subject | String |
content | String |
e-Receipt
e-Receipt Attribute
This input attributes would help to create JSON request to call a specific request.
Attribute Name | Description | Mandatory(M)/ Optional(O) | Values/Example |
---|---|---|---|
ReturnURL | It should be supplied as a valid http url string. Example: returnURL: ‘http://yourhost.com/handleEReceipt' | O | http://example.com/handleEReceipt |
Parameter | Specifies the key to use when returning data to the return URL. This is mandatory if ‘RETURNURL’ is present. Key should be supplied as a string. | O | Any valid string |
Method | Method to send data back to the webhost/server. This can be a GET or a POST . Mandatory if ‘ReturnURL’ is specified. |
O | GET or POST |
redirect_needed | true is by default value. |
O | true,false |
TransactionalID | TransactionID sent by HOST | O | Any valid string |
DeviceID | DeviceID sent by HOST | O | Any valid string |
ServerIP | ServerIP sent by HOST | O | Valid IP Address |
isCard | true/false values generated by HOST | O | true,false |
OriginalbranchID | OriginalbranchID generated by HOST | O | Any valid string |
Terminalnumber | Terminalnumber generated by HOST | O | Any valid string |
Originaltransactionnumber | Originaltransactionnumber generated by HOST | O | Any valid string |
Originaltransactiondate | Originaltransactiondate generated by HOST | O | Any valid string |
Request parameter
Follow steps as given in example.
Step 1 : Include platform specific Graphene javascript file and plugin.js (Refer)
Step 2 : Create request
// Create Request
var eReceiptRequest = {
returnURL:'http://yourhost.com/handleEReceipt',
eReceiptsProcessor:'Yocuda',
method:'POST',
transactionId:'IE123456',
deviceId:'1234567890',
serverIp:'10.10.10.10',
isCard:true,
originalBranchId:'0987654321',
terminalNumber:'123445',
redirect_needed:true
};
// Call Plugin and pass request
window.plugins.eReceiptPlugin.eReceipt(function(result) {},function(error){document.getElementById('testdata').innerText = JSON.stringify(error); },eReceiptRequest)
e-Receipt Error code
Following is the list of Error Codes for e-Receipt:
Error Type | Error Code | Message String | Resolution |
---|---|---|---|
If any parameter is invalid in Request Object. | ERE001 | e-Receipts Request Invalid | Ensure that the Request has valid and acceptable values. |
For unsuccessful response from e-Receipt provider. | ERE002 | Unsuccessful e-Receipt Request | Ensure that the Request has valid and acceptable values. |
If e-Receipt provider application is not installed on the device | ERE003 | Yocuda application not found | Ensure that the e-Receipt provider are correctly installed and running on the device. |
Fiscal Integration
The following methods define what you must integrate, alongside the signed agreement with Graphene on operational use and support functionality. By integrating to this guide and utilising EFSTA version as per the supported countries below, you will remain complaint from technical integration persective. No function can be performed on the Point of sale without going through this list of integrations, else you will void your complaince status. EFSTA is the leading fiscal software developer for companies of all sizes. The EFSTA fiscal solution, consisting of the fiscal middleware "Electronic Fiscal Registers" (EFR) and the EFSTA Cloud, can be used across borders to comply with national and international fiscal regulations. This integration layer supports following:
Country | EFR Version |
---|---|
France | 2.3.3 |
Germany | 2.3.3 |
Austria | 2.3.3 |
Poland | 2.3.3 |
Italy | 2.3.3 |
Payments
Open Cash Drawer
var param = {
"returnURL": "http://www.yourhost.com/handlepayment",
"redirect_needed": false,
"apiKey": "87654431351223",
"waitTillClosed": true,
"drawer": {
"drawerName": "drawer1",
"id": "877878", //Not in use
"provider": "STAR",
"qr_data": "123adfjbfds23423"
//IP drawer setting
"ipAddress": "10.0.0.01",
"port": 1234,
"drawer_type": 0,
//Bluetooth drawer setting
"drawer_type": 1,
"mac": "5247546574rt",
//Prefix for Android is pending
}
}
window.plugins.paymentPlugin.openCashDrawer(function(result)
{
// Handle successful response
},
function(error)
{
// Handle error
},param);
7
This method is used to open selected drawer
- If waitTillClosed: false
return a successful message - { "ResultData" : "Cashdrawer Open Successfully" }
- If waitTillClosed: true
try fetching drawer status till drawer status changes from open to close
once drawer status closed return response as following
User will wait till this process is done and Graphene will show Progress on UI.
{ "ResultData" : "Transaction completed.Drawer is closed now." }
Fiscal Print
The below explain how you need to structure the request please review the Printing section for support attributes, images, and Error handling.
Sale print request
var FiscalPrintRequest = {
returnURL: 'http://10.62.0.61:8888/SE/SEWindows/index.php',
redirect_needed:true,
basket_xml : '<BasketXML>',
parameter:'data',
printMethod: "Print"
}
//Following is Plugin call
window.plugins.printerPlugin.print(function(result) {},function(error){
},FiscalPrintRequest)
Fiscal print request (Sale)
<POSBasket>
<Keyword>1|5001|1|19</Keyword>
<ID>ALL.GW.5001|20191016125316|19</ID>
<XMLSchemaVersion>2</XMLSchemaVersion>
<LastUpdated>2019-10-16T12:53:47+01:00</LastUpdated>
<MajorVersion>1</MajorVersion>
<MinorVersion>0</MinorVersion>
<ManifestVersion>RPOS_12.3_GAMESWORKSHOP</ManifestVersion>
<DatabaseSchemaVersion>1.0.496.45.1.2.2</DatabaseSchemaVersion>
<BasketType>Sale</BasketType>
<State>Completed</State>
<ExternalState>1</ExternalState>
<Header>
<TimeZoneOffset>-60</TimeZoneOffset>
<DateTimeCreated>2019-10-16T12:53:16+01:00</DateTimeCreated>
<OriginatedBy>
<DeviceID>ALL.GW.5001</DeviceID>
<CashierID>ITCS</CashierID>
<CompanyID>1</CompanyID>
<StoreID>5001</StoreID>
<BranchID>5001</BranchID>
<TerminalNumber>1</TerminalNumber>
<TransactionNumber>19</TransactionNumber>
</OriginatedBy>
<TaxMethodID>15</TaxMethodID>
<EmployeeID>5001000001</EmployeeID>
<EmployeeName>
<XMLSchemaVersion>1</XMLSchemaVersion>
<LastUpdated>2019-10-16T12:53:10+01:00</LastUpdated>
<MajorVersion>1</MajorVersion>
<MinorVersion>0</MinorVersion>
<Surname>Test</Surname>
<Forename>Employee</Forename>
<Initials>TE</Initials>
<Title></Title>
<Sex></Sex>
<AllowMarketingInternal>0</AllowMarketingInternal>
<AllowMarketingThirdParty>0</AllowMarketingThirdParty>
</EmployeeName>
<EmployeeStartingBalance>0</EmployeeStartingBalance>
<EmployeePAN>5001000001</EmployeePAN>
<EmployeeSaleType>2</EmployeeSaleType>
<TransactionReasonID>IT_ES101</TransactionReasonID>
<AuthorisingUserID>ITCS</AuthorisingUserID>
<EuroZone>1</EuroZone>
<BasketLanguageID>it</BasketLanguageID>
<BasketCountryID>IT</BasketCountryID>
<BasketCurrencyID>EUR</BasketCurrencyID>
<TradingRegionID>12</TradingRegionID>
<EuroBaseExchangeRate>1.0</EuroBaseExchangeRate>
<PrintableName>ITALIAN CS</PrintableName>
</Header>
<ProductSale>
<XMLSchemaVersion>1</XMLSchemaVersion>
<LineNumber>1</LineNumber>
<NetValue>1650</NetValue>
<EffectiveNetValue>1650</EffectiveNetValue>
<Description>CODEX:TYRANIDES FRA</Description>
<DeviceID>ALL.GW.5001</DeviceID>
<UserID>ITCS</UserID>
<DateTimeCreated>2019-10-16T12:53:16+01:00</DateTimeCreated>
<ExtendedValue>3300</ExtendedValue>
<UnitPrice>3300</UnitPrice>
<MMGroupID>010603</MMGroupID>
<Quantity>1.0</Quantity>
<SalespersonID>ITCS</SalespersonID>
<SalespersonName>ITALIAN CS</SalespersonName>
<EmployeeDiscount>
<ModifierValue>-1650</ModifierValue>
<ModifierDateTime>2019-10-16T12:53:16+01:00</ModifierDateTime>
<ModifierReasonID>IT_ES101</ModifierReasonID>
<ModifierReasonDescription>Personale di sconto</ModifierReasonDescription>
<ModifierDescription>Employee Discount</ModifierDescription>
<AuthorisingUserID>ITCS</AuthorisingUserID>
<XMLSchemaVersion>1</XMLSchemaVersion>
<DiscountType>0</DiscountType>
<DiscountPercentage>0.5</DiscountPercentage>
<DiscountedValue>3300</DiscountedValue>
<RoundingRule>2</RoundingRule>
<AccountID>5001000001</AccountID>
<PAN>5001000001</PAN>
</EmployeeDiscount>
<TaxCode>1</TaxCode>
<TaxModifiable>1</TaxModifiable>
<TaxAmount>63.46154</TaxAmount>
<OriginalTaxAmount>126.92308</OriginalTaxAmount>
<OriginalTaxAmountSet>1</OriginalTaxAmountSet>
<ProductID>01030106006</ProductID>
<HandKeyed>1</HandKeyed>
<CustomerDetails></CustomerDetails>
<Perishable>1</Perishable>
</ProductSale>
<ModifierItem>
<XMLSchemaVersion>1</XMLSchemaVersion>
<LineNumber>2</LineNumber>
<NetValue>0</NetValue>
<EffectiveNetValue>0</EffectiveNetValue>
<Description>Employee Discount</Description>
<DeviceID>ALL.GW.5001</DeviceID>
<UserID>ITCS</UserID>
<DateTimeCreated>2019-10-16T12:53:16+01:00</DateTimeCreated>
<AuthorisingUserID>ITCS</AuthorisingUserID>
<ReasonCodeID>IT_ES101</ReasonCodeID>
<ModifiedLineNumber>1</ModifiedLineNumber>
<ModifiedIndex>1</ModifiedIndex>
</ModifierItem>
<ProductSale>
<XMLSchemaVersion>1</XMLSchemaVersion>
<LineNumber>3</LineNumber>
<NetValue>1650</NetValue>
<EffectiveNetValue>1650</EffectiveNetValue>
<Description>TYRANIDEN (SB) DEU</Description>
<DeviceID>ALL.GW.5001</DeviceID>
<UserID>ITCS</UserID>
<DateTimeCreated>2019-10-16T12:53:24+01:00</DateTimeCreated>
<ExtendedValue>3300</ExtendedValue>
<UnitPrice>3300</UnitPrice>
<MMGroupID>010603</MMGroupID>
<Quantity>1.0</Quantity>
<SalespersonID>ITCS</SalespersonID>
<SalespersonName>ITALIAN CS</SalespersonName>
<EmployeeDiscount>
<ModifierValue>-1650</ModifierValue>
<ModifierDateTime>2019-10-16T12:53:24+01:00</ModifierDateTime>
<ModifierReasonID>IT_ES101</ModifierReasonID>
<ModifierReasonDescription>Personale di sconto</ModifierReasonDescription>
<ModifierDescription>Employee Discount</ModifierDescription>
<AuthorisingUserID>ITCS</AuthorisingUserID>
<XMLSchemaVersion>1</XMLSchemaVersion>
<DiscountType>0</DiscountType>
<DiscountPercentage>0.5</DiscountPercentage>
<DiscountedValue>3300</DiscountedValue>
<RoundingRule>2</RoundingRule>
<AccountID>5001000001</AccountID>
<PAN>5001000001</PAN>
</EmployeeDiscount>
<TaxCode>1</TaxCode>
<TaxModifiable>1</TaxModifiable>
<TaxAmount>63.46154</TaxAmount>
<OriginalTaxAmount>126.92308</OriginalTaxAmount>
<OriginalTaxAmountSet>1</OriginalTaxAmountSet>
<ProductID>04030106006</ProductID>
<HandKeyed>1</HandKeyed>
<CustomerDetails></CustomerDetails>
<Perishable>1</Perishable>
</ProductSale>
<ModifierItem>
<XMLSchemaVersion>1</XMLSchemaVersion>
<LineNumber>4</LineNumber>
<NetValue>0</NetValue>
<EffectiveNetValue>0</EffectiveNetValue>
<Description>Employee Discount</Description>
<DeviceID>ALL.GW.5001</DeviceID>
<UserID>ITCS</UserID>
<DateTimeCreated>2019-10-16T12:53:24+01:00</DateTimeCreated>
<AuthorisingUserID>ITCS</AuthorisingUserID>
<ReasonCodeID>IT_ES101</ReasonCodeID>
<ModifiedLineNumber>3</ModifiedLineNumber>
<ModifiedIndex>1</ModifiedIndex>
</ModifierItem>
<ProductSale>
<XMLSchemaVersion>1</XMLSchemaVersion>
<LineNumber>5</LineNumber>
<NetValue>1000</NetValue>
<EffectiveNetValue>1000</EffectiveNetValue>
<Description>SM WHIRLWIND/HUNTER</Description>
<DeviceID>ALL.GW.5001</DeviceID>
<UserID>ITCS</UserID>
<DateTimeCreated>2019-10-16T12:53:41+01:00</DateTimeCreated>
<ExtendedValue>2000</ExtendedValue>
<UnitPrice>2000</UnitPrice>
<MMGroupID>030106</MMGroupID>
<Quantity>1.0</Quantity>
<SalespersonID>ITCS</SalespersonID>
<SalespersonName>ITALIAN CS</SalespersonName>
<EmployeeDiscount>
<ModifierValue>-1000</ModifierValue>
<ModifierDateTime>2019-10-16T12:53:41+01:00</ModifierDateTime>
<ModifierReasonID>IT_ES101</ModifierReasonID>
<ModifierReasonDescription>Personale di sconto</ModifierReasonDescription>
<ModifierDescription>Employee Discount</ModifierDescription>
<AuthorisingUserID>ITCS</AuthorisingUserID>
<XMLSchemaVersion>1</XMLSchemaVersion>
<DiscountType>0</DiscountType>
<DiscountPercentage>0.5</DiscountPercentage>
<DiscountedValue>2000</DiscountedValue>
<RoundingRule>2</RoundingRule>
<AccountID>5001000001</AccountID>
<PAN>5001000001</PAN>
</EmployeeDiscount>
<TaxCode>2</TaxCode>
<TaxAmount>180.327865</TaxAmount>
<OriginalTaxAmount>360.655731</OriginalTaxAmount>
<OriginalTaxAmountSet>1</OriginalTaxAmountSet>
<ProductID>99060301014</ProductID>
<HandKeyed>1</HandKeyed>
<CustomerDetails></CustomerDetails>
<Perishable>1</Perishable>
</ProductSale>
<ModifierItem>
<XMLSchemaVersion>1</XMLSchemaVersion>
<LineNumber>6</LineNumber>
<NetValue>0</NetValue>
<EffectiveNetValue>0</EffectiveNetValue>
<Description>Employee Discount</Description>
<DeviceID>ALL.GW.5001</DeviceID>
<UserID>ITCS</UserID>
<DateTimeCreated>2019-10-16T12:53:41+01:00</DateTimeCreated>
<AuthorisingUserID>ITCS</AuthorisingUserID>
<ReasonCodeID>IT_ES101</ReasonCodeID>
<ModifiedLineNumber>5</ModifiedLineNumber>
<ModifiedIndex>1</ModifiedIndex>
</ModifierItem>
<CashTenderItem>
<XMLSchemaVersion>1</XMLSchemaVersion>
<LineNumber>7</LineNumber>
<NetValue>-4300</NetValue>
<EffectiveNetValue>-4300</EffectiveNetValue>
<Description>Contanti</Description>
<DeviceID>ALL.GW.5001</DeviceID>
<UserID>ITCS</UserID>
<DateTimeCreated>2019-10-16T12:53:45+01:00</DateTimeCreated>
<TenderType>1</TenderType>
<TenderSubType>0</TenderSubType>
<TenderAmount>-4300</TenderAmount>
<CurrencyID>EUR</CurrencyID>
<CurrencyDescription>EUR</CurrencyDescription>
<IncludeInTransactionTotalCheck>1</IncludeInTransactionTotalCheck>
<AllowRechargeableVoucherSales>1</AllowRechargeableVoucherSales>
<OpenDrawerAtEnd>1</OpenDrawerAtEnd>
</CashTenderItem>
<Trailer>
<DateTimeCompleted>2019-10-16T12:53:47+01:00</DateTimeCompleted>
<CompletedBy>
<DeviceID>ALL.GW.5001</DeviceID>
<CashierID>ITCS</CashierID>
<StoreID>5001</StoreID>
<BranchID>5001</BranchID>
<TerminalNumber>1</TerminalNumber>
</CompletedBy>
<Total>4300</Total>
<ItemCount>7</ItemCount>
<ItemQuantity>3</ItemQuantity>
<NetItemQuantity>3</NetItemQuantity>
<TaxTotal>307</TaxTotal>
<TaxItem>
<XMLSchemaVersion>1</XMLSchemaVersion>
<TaxRate>1</TaxRate>
<TaxableTotal>3300</TaxableTotal>
<TaxTotal>127</TaxTotal>
<TaxDescription>Reduced IVA</TaxDescription>
<TaxIncluded>1</TaxIncluded>
<TaxPercentage>0.04</TaxPercentage>
</TaxItem>
<TaxItem>
<XMLSchemaVersion>1</XMLSchemaVersion>
<TaxRate>2</TaxRate>
<TaxableTotal>1000</TaxableTotal>
<TaxTotal>180</TaxTotal>
<TaxDescription>Full IVA</TaxDescription>
<TaxIncluded>1</TaxIncluded>
<TaxPercentage>0.22</TaxPercentage>
</TaxItem>
<SequenceDeviceID>ALL.GW.5001</SequenceDeviceID>
<SequenceNumber>70</SequenceNumber>
</Trailer>
</POSBasket>
Following parameter needed.
Payments Params | Values |
---|---|
basket_xml | BasketXML |
Check Print JSON for Fiscal request as shown.
Request -->
Reprint request
var RePrintRequest = {
returnURL: 'http://10.62.0.61:8888/SE/SEWindows/index.php',
redirect_needed:true,
last_transaction : true,
parameter:'data',
printMethod: "Print"
}
//Following is Plugin call
window.plugins.printerPlugin.print(function(result) {},function(error){
},RePrintRequest)
Following parameter needed.
Payments Params | Values |
---|---|
last_transaction | Boolean |
Check Reprint JSON request as shown.
Request -->
Refund Request
var FiscalPrintRequest = {
returnURL: 'http://10.62.0.61:8888/SE/SEWindows/index.php',
redirect_needed:true,
basket_xml : '<BasketXML>',
parameter:'data',
printMethod: "Print"
}
//Following is Plugin call
window.plugins.printerPlugin.print(function(result) {},function(error){
},FiscalPrintRequest)
Print EFSTA - XML (Refund)
<POSBasket>
<Keyword>1|5001|1|88</Keyword>
<ID>ALL.GW.5001|20191003151048|88</ID>
<XMLSchemaVersion>2</XMLSchemaVersion>
<LastUpdated>2019-10-03T15:10:54+01:00</LastUpdated>
<MajorVersion>1</MajorVersion>
<MinorVersion>0</MinorVersion>
<ManifestVersion>RPOS_12.3_GAMESWORKSHOP</ManifestVersion>
<DatabaseSchemaVersion>1.0.496.45.1.2.2</DatabaseSchemaVersion>
<BasketType>Sale</BasketType>
<State>Completed</State>
<ExternalState>1</ExternalState>
<Header>
<TimeZoneOffset>-60</TimeZoneOffset>
<DateTimeCreated>2019-10-03T15:10:48+01:00</DateTimeCreated>
<OriginatedBy>
<DeviceID>ALL.GW.5001</DeviceID>
<CashierID>ADMIN</CashierID>
<CompanyID>1</CompanyID>
<StoreID>5001</StoreID>
<BranchID>5001</BranchID>
<TerminalNumber>1</TerminalNumber>
<TransactionNumber>88</TransactionNumber>
</OriginatedBy>
<TaxMethodID>15</TaxMethodID>
<EuroZone>1</EuroZone>
<BasketLanguageID>it</BasketLanguageID>
<BasketCountryID>IT</BasketCountryID>
<BasketCurrencyID>EUR</BasketCurrencyID>
<TradingRegionID>12</TradingRegionID>
<EuroBaseExchangeRate>1.0</EuroBaseExchangeRate>
</Header>
<ProductReturn>
<XMLSchemaVersion>1</XMLSchemaVersion>
<LineNumber>1</LineNumber>
<NetValue>-12500</NetValue>
<EffectiveNetValue>-12500</EffectiveNetValue>
<Description>WRATH & RAPTURE FRE</Description>
<DeviceID>ALL.GW.5001</DeviceID>
<UserID>ADMIN</UserID>
<DateTimeCreated>2019-10-03T15:10:48+01:00</DateTimeCreated>
<ExtendedValue>-12500</ExtendedValue>
<UnitPrice>12500</UnitPrice>
<MMGroupID>991501</MMGroupID>
<Quantity>-1.0</Quantity>
<TaxCode>2</TaxCode>
<TaxModifiable>1</TaxModifiable>
<TaxAmount>-2254.098388</TaxAmount>
<OriginalTaxAmount>-2254.098388</OriginalTaxAmount>
<OriginalTaxAmountSet>1</OriginalTaxAmountSet>
<Return>
<OriginalReceiptSupplied>1</OriginalReceiptSupplied>
<OriginalBranchID>5001</OriginalBranchID>
<OriginalTerminalNumber>1</OriginalTerminalNumber>
<OriginalTransactionNumber>67</OriginalTransactionNumber>
<OriginalCashierNumber>00009</OriginalCashierNumber>
</Return>
<ProductID>01019915001</ProductID>
<HandKeyed>1</HandKeyed>
<CustomerDetails></CustomerDetails>
<Perishable>1</Perishable>
</ProductReturn>
<CashTenderItem>
<XMLSchemaVersion>1</XMLSchemaVersion>
<LineNumber>2</LineNumber>
<NetValue>12500</NetValue>
<EffectiveNetValue>12500</EffectiveNetValue>
<Description>Contanti</Description>
<DeviceID>ALL.GW.5001</DeviceID>
<UserID>ADMIN</UserID>
<DateTimeCreated>2019-10-03T15:10:52+01:00</DateTimeCreated>
<TenderType>1</TenderType>
<TenderSubType>0</TenderSubType>
<TenderAmount>12500</TenderAmount>
<CurrencyID>EUR</CurrencyID>
<CurrencyDescription>EUR</CurrencyDescription>
<IncludeInTransactionTotalCheck>1</IncludeInTransactionTotalCheck>
<AllowRechargeableVoucherSales>1</AllowRechargeableVoucherSales>
<OpenDrawerAtEnd>1</OpenDrawerAtEnd>
</CashTenderItem>
<Trailer>
<DateTimeCompleted>2019-10-03T15:10:54+01:00</DateTimeCompleted>
<CompletedBy>
<DeviceID>ALL.GW.5001</DeviceID>
<CashierID>ADMIN</CashierID>
<StoreID>5001</StoreID>
<BranchID>5001</BranchID>
<TerminalNumber>1</TerminalNumber>
</CompletedBy>
<Total>-12500</Total>
<ItemCount>2</ItemCount>
<ItemQuantity>0</ItemQuantity>
<NetItemQuantity>-1</NetItemQuantity>
<TaxTotal>-2254</TaxTotal>
<TaxItem>
<XMLSchemaVersion>1</XMLSchemaVersion>
<TaxRate>2</TaxRate>
<TaxableTotal>-12500</TaxableTotal>
<TaxTotal>-2254</TaxTotal>
<TaxDescription>Full IVA</TaxDescription>
<TaxIncluded>1</TaxIncluded>
<TaxPercentage>0.22</TaxPercentage>
</TaxItem>
<SequenceDeviceID>ALL.GW.5001</SequenceDeviceID>
<SequenceNumber>193</SequenceNumber>
</Trailer>
</POSBasket>
Following parameter needed.
Payments Params | Values |
---|---|
basket_xml | BasketXML |
Check Print JSON for Fiscal request as shown.
Request -->
Known Loss Request
var FiscalPrintRequest = {
returnURL: 'http://10.62.0.61:8888/SE/SEWindows/index.php',
redirect_needed:true,
basket_xml : '<BasketXML>',
parameter:'data',
printMethod: "Print"
}
//Following is Plugin call
window.plugins.printerPlugin.print(function(result) {},function(error){
},FiscalPrintRequest)
Print EFSTA - XML (Known Loss)
<ProductWastage>
<Keyword>1|5001|1|83</Keyword>
<ID>ALL.GW.5001|20191003144431|83</ID>
<XMLSchemaVersion>2</XMLSchemaVersion>
<LastUpdated>2019-10-03T14:44:45+01:00</LastUpdated>
<MajorVersion>1</MajorVersion>
<MinorVersion>0</MinorVersion>
<ManifestVersion>RPOS_12.3_GAMESWORKSHOP</ManifestVersion>
<DatabaseSchemaVersion>1.0.496.45.1.2.2</DatabaseSchemaVersion>
<BasketType>ProductWastage</BasketType>
<State>Completed</State>
<ExternalState>1</ExternalState>
<Header>
<TimeZoneOffset>-60</TimeZoneOffset>
<DateTimeCreated>2019-10-03T14:44:31+01:00</DateTimeCreated>
<OriginatedBy>
<DeviceID>ALL.GW.5001</DeviceID>
<CashierID>000009</CashierID>
<CompanyID>1</CompanyID>
<StoreID>5001</StoreID>
<BranchID>5001</BranchID>
<TerminalNumber>1</TerminalNumber>
<TransactionNumber>83</TransactionNumber>
</OriginatedBy>
<TaxMethodID>15</TaxMethodID>
<TransactionReasonID>IT_PW005</TransactionReasonID>
<CustomerDetails>
<CustomerAddress>
<XMLSchemaVersion>1</XMLSchemaVersion>
</CustomerAddress>
<CustomerName>
<XMLSchemaVersion>1</XMLSchemaVersion>
<LastUpdated>2019-10-03T14:44:19+01:00</LastUpdated>
<MajorVersion>1</MajorVersion>
<MinorVersion>0</MinorVersion>
<Surname></Surname>
<Forename></Forename>
<Initials></Initials>
<Title></Title>
<Sex></Sex>
<AllowMarketingInternal>0</AllowMarketingInternal>
<AllowMarketingThirdParty>0</AllowMarketingThirdParty>
</CustomerName>
<DeliveryName>
<XMLSchemaVersion>1</XMLSchemaVersion>
<LastUpdated>2019-10-03T14:44:19+01:00</LastUpdated>
<MajorVersion>1</MajorVersion>
<MinorVersion>0</MinorVersion>
<Surname></Surname>
<Forename></Forename>
<Initials></Initials>
<Title></Title>
<Sex></Sex>
<AllowMarketingInternal>0</AllowMarketingInternal>
<AllowMarketingThirdParty>0</AllowMarketingThirdParty>
</DeliveryName>
<DeliveryAddress>
<XMLSchemaVersion>1</XMLSchemaVersion>
</DeliveryAddress>
</CustomerDetails>
<EuroZone>1</EuroZone>
<BasketLanguageID>it</BasketLanguageID>
<BasketCountryID>IT</BasketCountryID>
<BasketCurrencyID>EUR</BasketCurrencyID>
<TradingRegionID>12</TradingRegionID>
<EuroBaseExchangeRate>1.0</EuroBaseExchangeRate>
<PrintableName>ITSS</PrintableName>
</Header>
<ProductWastageItem>
<XMLSchemaVersion>1</XMLSchemaVersion>
<LineNumber>1</LineNumber>
<NetValue>2275</NetValue>
<EffectiveNetValue>2275</EffectiveNetValue>
<Description>UNIFORMS OF EMP GER</Description>
<DeviceID>ALL.GW.5001</DeviceID>
<UserID>000009</UserID>
<DateTimeCreated>2019-10-03T14:44:31+01:00</DateTimeCreated>
<ExtendedValue>2275</ExtendedValue>
<UnitPrice>2275</UnitPrice>
<MMGroupID>020204</MMGroupID>
<Quantity>1.0</Quantity>
<SalespersonID>000009</SalespersonID>
<SalespersonName>ITSS</SalespersonName>
<TaxCode>1</TaxCode>
<TaxAmount>87.5</TaxAmount>
<OriginalTaxAmount>87.5</OriginalTaxAmount>
<OriginalTaxAmountSet>1</OriginalTaxAmountSet>
<ProductID>04040202004</ProductID>
<HandKeyed>1</HandKeyed>
<CustomerDetails></CustomerDetails>
<Perishable>1</Perishable>
<SourceInventoryType>1</SourceInventoryType>
<DestinationInventoryType>0</DestinationInventoryType>
</ProductWastageItem>
<ProductWastageItem>
<XMLSchemaVersion>1</XMLSchemaVersion>
<LineNumber>2</LineNumber>
<NetValue>12500</NetValue>
<EffectiveNetValue>12500</EffectiveNetValue>
<Description>WRATH & RAPTURE FRA</Description>
<DeviceID>ALL.GW.5001</DeviceID>
<UserID>000009</UserID>
<DateTimeCreated>2019-10-03T14:44:43+01:00</DateTimeCreated>
<ExtendedValue>12500</ExtendedValue>
<UnitPrice>12500</UnitPrice>
<MMGroupID>991501</MMGroupID>
<Quantity>1.0</Quantity>
<SalespersonID>000009</SalespersonID>
<SalespersonName>ITSS</SalespersonName>
<TaxCode>2</TaxCode>
<TaxAmount>2254.098388</TaxAmount>
<OriginalTaxAmount>2254.098388</OriginalTaxAmount>
<OriginalTaxAmountSet>1</OriginalTaxAmountSet>
<ProductID>01019915001</ProductID>
<HandKeyed>1</HandKeyed>
<CustomerDetails></CustomerDetails>
<Perishable>1</Perishable>
<SourceInventoryType>1</SourceInventoryType>
<DestinationInventoryType>0</DestinationInventoryType>
</ProductWastageItem>
<Trailer>
<DateTimeCompleted>2019-10-03T14:44:45+01:00</DateTimeCompleted>
<CompletedBy>
<DeviceID>ALL.GW.5001</DeviceID>
<CashierID>000009</CashierID>
<StoreID>5001</StoreID>
<BranchID>5001</BranchID>
<TerminalNumber>1</TerminalNumber>
</CompletedBy>
<Total>14775</Total>
<ItemCount>2</ItemCount>
<ItemQuantity>2</ItemQuantity>
<NetItemQuantity>2</NetItemQuantity>
<TaxTotal>2342</TaxTotal>
<TaxItem>
<XMLSchemaVersion>1</XMLSchemaVersion>
<TaxRate>1</TaxRate>
<TaxableTotal>2275</TaxableTotal>
<TaxTotal>88</TaxTotal>
<TaxDescription>Reduced IVA</TaxDescription>
<TaxIncluded>1</TaxIncluded>
<TaxPercentage>0.04</TaxPercentage>
</TaxItem>
<TaxItem>
<XMLSchemaVersion>1</XMLSchemaVersion>
<TaxRate>2</TaxRate>
<TaxableTotal>12500</TaxableTotal>
<TaxTotal>2254</TaxTotal>
<TaxDescription>Full IVA</TaxDescription>
<TaxIncluded>1</TaxIncluded>
<TaxPercentage>0.22</TaxPercentage>
</TaxItem>
<SequenceDeviceID>ALL.GW.5001</SequenceDeviceID>
<SequenceNumber>182</SequenceNumber>
</Trailer>
</ProductWastage>
Following parameter needed.
Payments Params | Values |
---|---|
basket_xml | BasketXML |
Check Print JSON request as shown.
Request -->
printMethod - All Case handle print/email/both
var PrintWithPrintMethod = {
redirect_needed:true,
print_detail : '<PrintDetails>',
basket_xml : '<BasketXML>',
email_detail:'<EmailDetails>',
raw_response : true/false,
printMethod: 'Print' or 'Email' or 'Both' or 'Default'
}
//Following is Plugin call
window.plugins.printerPlugin.print(function(result) {},function(error){
},PrintWithPrintMethod)
PrinterPlugin - print method
printMethod present in the request and valid then Graphene will not show pop up of Print, Email, Both. Instead, Graphene will perform directly print, email or both
Request -->
Non Fiscal Print
var NonFiscalPrintRequest = {
returnURL: 'http://10.62.0.61:8888/SE/SEWindows/index.php',
redirect_needed:true,
print_detail : '<PrintDetails>',
parameter:'data',
printMethod: "Print"
}
//Following is Plugin call
window.plugins.printerPlugin.print(function(result) {},function(error){
},NonFiscalPrintRequest)
Following parameter needed.
Payments Params | Values |
---|---|
print_detail | PrintDetails |
Check Print JSON request for Non-Fiscal as shown.
Request -->
Status
Cash Drawer Status
var param = {
"returnURL": "http://www.yourhost.com/handlepayment",
"redirect_needed": false,
"apiKey": "87654431351223",
"drawer": {
"drawerName": "drawer1",
"id": "877878",
"provider": "STAR",
"qr_data": "123adfjbfds23423"
//IP drawer setting
"ipAddress": "10.0.0.01",
"port": 1234,
"drawer_type": 0,
//Bluetooth drawer setting
"drawer_type": 1,
"mac": "5247546574rt",
//Prefix for Android is pending
}
}
window.plugins.paymentPlugin.cashDrawerStatus(function(result)
{
// Handle successful response
},
function(error)
{
// Handle error
},param);
This method is used to get selected drawer status
- Validations & Errors
If invalid apiKey : COM004: Invalid API key
While the opening drawer any error return : CSDRW001 - Connecting issue. Please try again
drawer key is mandatory field
Invalid value of the parameter key - 'value' for drawerName, provider, drawer_type, ipAddress, port, required_status. In case not present consider empty/null for error.
Incase of missing drawer key return error - COM004 : Drawer details not found
For drawer does not support status provide response not supporting operation
The status of the drawer is only supported by the APG Drawer & STARPRNT Drawer. For ESPN/STAR does not apply this.
Audit Requests
THese are all mandatory for Fiscal Compliance.
Audit Void Item
var auditVoidItem = {
User: "99", // Default or pass the OPR value from Basket XML
AuditCode: "150", // Audit code (According to the scenario)
AuditDescription: "Audit Message (According to the scenario)" // Message
}
//Following is Plugin call
window.plugins.auditPlugin.auditVoidItem(function(result) {},function(error){
},auditVoidItem)
Request -> Audit Void Item
{
"Audit": {
"Opr": "99",
"Code": "150",
"Dsc": "Description",
"TL": "CC00113",
"TT": "C001"
}
}
Response -> Audit Void Item
{
"AuditC": {
"SQ": 3831,
"Result": {
"RC": "OK"
}
}
}
Following parameter needed.
Params | Values |
---|---|
User | String |
AuditCode | String |
AuditDescription | String |
Check Audit JSON request as shown.
Request -->
Audit
var audit = {
User: "99", // Default or pass the OPR value from Basket XML
AuditCode: "150", // Audit code (According to the scenario)
AuditDescription: "Audit Message (According to the scenario)" // Message
}
//Following is Plugin call
window.plugins.auditPlugin.audit(function(result) {},function(error){
},audit)
Request -> Audit
{
"Audit": {
"Opr": "99",
"Code": "150",
"Dsc": "Description",
"TL": "CC00113",
"TT": "C001"
}
}
Response -> Audit
{
"AuditC": {
"SQ": 3831,
"Result": {
"RC": "OK"
}
}
}
Following parameter needed.
Params | Values |
---|---|
User | String |
AuditCode | String |
AuditDescription | String |
Check Audit JSON request as shown.
Request -->
LogSignIn
var logSignIn = {
User: "99", // Default or pass the OPR value from Basket XML
}
//Following is Plugin call
window.plugins.auditPlugin.logSignIn(function(result) {},function(error){
},logSignIn)
Request -> LogSignIn
{
"Audit": {
"ESR": {
"NF": "LOGIN"
}
}
}
Response -> LogSignIn
{
"AuditC": {
"SQ": 3831,
"Result": {
"RC": "OK"
}
}
}
Following parameter needed.
Params | Values |
---|---|
User | String |
Check Audit JSON request as shown.
Request -->
PAYIN
var payIn = {
User: "99", // Default or pass the OPR value from Basket XML
}
//Following is Plugin call
window.plugins.auditPlugin.payin(function(result) {},function(error){
},payIn)
Request -> PAYIN
{
"Audit": {
"ESR": {
"NF": "PAYIN"
}
}
}
Response -> PAYIN
{
"AuditC": {
"SQ": 3831,
"Result": {
"RC": "OK"
}
}
}
Following parameter needed.
Params | Values |
---|---|
User | String |
Check Audit JSON request as shown.
Request -->
PAYOUT
var payOut = {
User: "99", // Default or pass the OPR value from Basket XML
}
//Following is Plugin call
window.plugins.auditPlugin.payout(function(result) {},function(error){
},payOut)
Request -> PAYOUT
{
"Audit": {
"ESR": {
"NF": "PAYOUT"
}
}
}
Response -> PAYOUT
{
"AuditC": {
"SQ": 3831,
"Result": {
"RC": "OK"
}
}
}
Following parameter needed.
Params | Values |
---|---|
User | String |
Check Audit JSON request as shown.
Request -->
Logger
Although not mandatory, we would recommend that you follow the logger section above and add any errors, alerts or information provided to you from our applciation, this will make it easier to identify corrlated issues should they occur.
Change History
Version 1.0
- Initial setup
Version 1.1
- Updated Application name to Integration Enabler from StoreEnabler
- Updated Scanning plugin
- Updated Logger Plugin
- Updated Email Plugin
- Updated Adyen apple pay and SECash payment processor.
- Updated Auth plugin details
- Updated Storage plugin details
Version 1.2
- Updated Theme of document
- Updated Storage Peer to Peer plugins with error codes
- Updated Status plugin
- Updated Admin plugin
- Updated Module plugin
- Updated e-Receipt plugin
- Updated Integrator plugin
Version 1.3
- Updated Query Database : Distinct/Offset methods
- Updated Status plugin
- Updated Pennies plugin
- Updated Module plugin
- Updated Supported PSP list under Payment
Version 1.4
- Updated Application name to Graphene from Integration Enabler
- Updated Query Database : IN & COUNT query support
- PreAuth & Capture support for Payment
Version 1.5
- Updated to include a dedicated Fiscal Compliance section and not just methods split across the whoe document.
- Also added the support JSON structures in requests.
Version 1.6
- Added PayByLink under Payment Plugin
- Added registerTransaction under Audit Plugin
FAQ
Support
This concludes the complete integration of your Web/ePOS/HOST with all the major functionalities of Graphene. Refer to the User Guide of Graphene to see the actual uses and Admin configurations details. For any further details contact our support team at info@storeenabler.com or feel free to call us at: +44 (0)1235-521900.