Nexstream eGHL Cordova Plugin
Cordova Library for integrating with the eGHL payment gateway's mobile SDK.
Installation
cordova plugin add cordova-plugin-eghl
Usage
Info
To get the version of this plugin at runtime, the following fields are available:
eGHLversion // e.g. '3.0.5'eGHLname // 'eGHL Cordova Plugin'
Note: makePayment()
and mpeRequest()
only
allow one ongoing request at any time. Any subsequent calls made while the
previous request is still ongoing will receive an error.
To request payment via any channel, including Masterpass Express:
eGHL;
Masterpass Express info
Note: makePayment()
and mpeRequest()
only
allow one ongoing request at any time. Any subsequent calls made while the
previous request is still ongoing will receive an error.
eGHL;
Special Android notes
Android may kill your Cordova activity while your user is in the eGHL activity. When this happens, payment results will NOT be sent to the JavaScript callback which you passed to the other methods (above). Instead, it will be sent to your app with the "resume" Cordova event.
document.addEventListener("resume", function (event) { /* Event: { action: "resume", pendingResult: { pluginServiceName: "eGHL", pluginStatus: "OK", // or "Error", etc. result: ... // same result that would have been passed to // your normal callback function. } } */}, false)
See also:
- https://cordova.apache.org/docs/en/latest/guide/platforms/android/index.html#lifecycle-guide
- https://cordova.apache.org/docs/en/latest/guide/platforms/android/plugin.html#launching-other-activities
Message Customisation
iOS:
On iOS, you can only customise the "Finalising Payment" message. Set your own
message by setting the _finaliseMessage
property in the first parameter of
your .makePayment()
call. If you do not set this, the default message set by
eGHL's SDK will be used.
Android:
To customise the messages displayed by the eGHL SDK, set any of these values in
your strings.xml
:
<string name="eghl_progress_message">this is from app strings xml progress </string>
<string name="eghl_verification_message">this is from app strings xml verification</string>
<string name="eghl_cancel_dialog_title">this is from app strings exit title</string>
<string name="eghl_cancel_dialog_message">this is from app strings message</string>
<string name="eghl_prevent_back_toast_message">this is from app strings toast</string>
<string name="eghl_ssl_error_dialog_title">this is from app strings title ssl </string>
<string name="eghl_ssl_error_dialog_message">this is from app strings message ssl </string>