Skip to content

Commit 1bbcd67

Browse files
Update README.md
1 parent 0f0fc2a commit 1bbcd67

1 file changed

Lines changed: 3 additions & 199 deletions

File tree

README.md

Lines changed: 3 additions & 199 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# license: Copyright © 2011-2016 MOLPay Sdn Bhd. All Rights Reserved.
33
-->
44

5-
# rms-mobile-xdk-nativescript
5+
# [Mobile XDK] – RazerMS NativeScript
66

77
<img src="https://user-images.githubusercontent.com/38641542/74424311-a9d64000-4e8c-11ea-8d80-d811cfe66972.jpg">
88

@@ -23,205 +23,9 @@ This is the functional Razer Merchant Services NativeScript payment module that
2323

2424
- Minimum target version: iOS 8
2525

26-
## Installation
27-
28-
```
29-
tns plugin add molpay-mobile-xdk-nativescript
30-
```
31-
32-
## Sample Result
33-
34-
```
35-
=========================================
36-
Sample transaction result in JSON string:
37-
=========================================
38-
39-
{"status_code":"11","amount":"1.01","chksum":"34a9ec11a5b79f31a15176ffbcac76cd","pInstruction":0,"msgType":"C6","paydate":1459240430,"order_id":"3q3rux7dj","err_desc":"","channel":"Credit","app_code":"439187","txn_ID":"6936766"}
40-
41-
Parameter and meaning:
42-
43-
"status_code" - "00" for Success, "11" for Failed, "22" for *Pending.
44-
(*Pending status only applicable to cash channels only)
45-
"amount" - The transaction amount
46-
"paydate" - The transaction date
47-
"order_id" - The transaction order id
48-
"channel" - The transaction channel description
49-
"txn_ID" - The transaction id generated by Razer Merchant Services
26+
## Installation Guidance
5027

51-
* Notes: You may ignore other parameters and values not stated above
52-
53-
=====================================
54-
* Sample error result in JSON string:
55-
=====================================
56-
57-
{"Error":"Communication Error"}
58-
59-
Parameter and meaning:
60-
61-
"Communication Error" - Error starting a payment process due to several possible reasons, please contact Razer Merchant Services support should the error persists.
62-
1) Internet not available
63-
2) API credentials (username, password, merchant id, verify key)
64-
3) Razer Merchant Services server offline.
65-
```
66-
67-
## Prepare the Payment detail object
68-
69-
```
70-
var paymentDetails = {
71-
// Optional, REQUIRED when use online Sandbox environment and account credentials.
72-
'mp_dev_mode': false,
73-
74-
// Mandatory String. Values obtained from Razer Merchant Services.
75-
'mp_username' : 'username',
76-
'mp_password' : 'password',
77-
'mp_merchant_ID' : 'merchantid',
78-
'mp_app_name' : 'appname',
79-
'mp_verification_key' : 'vkey123',
80-
81-
// Mandatory String. Payment values.
82-
'mp_amount' : '1.10',, // Minimum 1.01
83-
'mp_order_ID' : 'orderid123',
84-
'mp_currency' : 'MYR',
85-
'mp_country' : 'MY',
86-
87-
// Optional String.
88-
'mp_channel' : '', // Use 'multi' for all available channels option. For individual channel seletion, please refer to https://github.com/RazerMS/rms-mobile-xdk-examples/blob/master/channel_list.tsv.
89-
'mp_bill_description' : '',
90-
'mp_bill_name' : '',
91-
'mp_bill_email' : '',
92-
'mp_bill_mobile' : '',
93-
'mp_channel_editing' : false, // Option to allow channel selection.
94-
'mp_editing_enabled' : false, // Option to allow billing information editing.
95-
96-
// Optional, but required payment values. User input will be required when values not passed.
97-
'mp_channel' : 'multi', // Use 'multi' for all available channels option. For individual channel seletion, please refer to https://github.com/RazerMS/rms-mobile-xdk-examples/blob/master/channel_list.tsv.
98-
'mp_bill_description' : 'billdesc',
99-
'mp_bill_name' : 'billname',
100-
'mp_bill_email' : 'email@domain.com',
101-
'mp_bill_mobile' : '+1234567',
102-
103-
// Optional, allow channel selection.
104-
'mp_channel_editing' : false,
105-
106-
// Optional, allow billing information editing.
107-
'mp_editing_enabled' : false,
108-
109-
// Optional, for Escrow.
110-
'mp_is_escrow': '0', // Put "1" to enable escrow
111-
112-
// Optional, for credit card BIN restrictions and campaigns.
113-
'mp_bin_lock' : ['414170', '414171'],
114-
115-
// Optional, for mp_bin_lock alert error.
116-
'mp_bin_lock_err_msg': 'Only UOB allowed',
117-
118-
// WARNING! FOR TRANSACTION QUERY USE ONLY, DO NOT USE THIS ON PAYMENT PROCESS.
119-
// Optional, provide a valid cash channel transaction id here will display a payment instruction screen. Required if mp_request_type is 'Receipt'.
120-
'mp_transaction_id': '',
121-
// Optional, use 'Receipt' for Cash channels, and 'Status' for transaction status query.
122-
'mp_request_type': '',
123-
124-
// Optional, use this to customize the UI theme for the payment info screen, the original XDK custom.css file can be obtained at https://github.com/RazerMS/rms-mobile-xdk-examples/blob/master/custom.css.
125-
'mp_custom_css_url': '',
126-
127-
// Optional, set the token id to nominate a preferred token as the default selection, set "new" to allow new card only.
128-
'mp_preferred_token': '',
129-
130-
// Optional, credit card transaction type, set "AUTH" to authorize the transaction.
131-
'mp_tcctype': '',
132-
133-
// Optional, required valid credit card channel, set true to process this transaction through the recurring api, please refer the Razer Merchant Services Recurring API pdf.
134-
'mp_is_recurring': false,
135-
136-
// Optional, show nominated channels.
137-
'mp_allowed_channels': ['credit', 'credit3'],
138-
139-
// Optional, simulate offline payment, set boolean value to enable.
140-
'mp_sandbox_mode': true,
141-
142-
// Optional, required a valid mp_channel value, this will skip the payment info page and go direct to the payment screen.
143-
'mp_express_mode': true,
144-
145-
// Optional, extended email format validation based on W3C standards.
146-
'mp_advanced_email_validation_enabled': true,
147-
148-
// Optional, extended phone format validation based on Google i18n standards.
149-
'mp_advanced_phone_validation_enabled': true,
150-
151-
// Optional, explicitly force disable user input.
152-
'mp_bill_name_edit_disabled': true,
153-
'mp_bill_email_edit_disabled': true,
154-
'mp_bill_mobile_edit_disabled': true,
155-
'mp_bill_description_edit_disabled': true,
156-
157-
// Optional, EN, MS, VI, TH, FIL, MY, KM, ID, ZH.
158-
'mp_language': 'EN',
159-
160-
// Optional, Cash channel payment request expiration duration in hour.
161-
'mp_cash_waittime': 48,
162-
163-
// Optional, allow bypass of 3DS on some credit card channels.
164-
'mp_non_3DS': true,
165-
166-
// Optional, disable card list option.
167-
'mp_card_list_disabled': true,
168-
169-
// Optional for channels restriction, this option has less priority than mp_allowed_channels.
170-
'mp_disabled_channels': ['credit']
171-
172-
};
173-
```
174-
175-
## Start the payment module
176-
177-
```
178-
//XML view ready a view for Razer Merchant Services to display
179-
<GridLayout id="molpayExampleView"></GridLayout>
180-
181-
//Typescript
182-
//import Razer Merchant Services package
183-
import * as molpay from 'molpay-mobile-xdk-nativescript';
184-
185-
//Javascript
186-
//import Razer Merchant Services package
187-
var molpay = require("molpay-mobile-xdk-nativescript");
188-
189-
exports.pageLoaded = function(args) {
190-
var page = args.object;
191-
192-
//set the view
193-
var molpayView = page.getViewById("molpayExampleView");
194-
195-
//start Razer Merchant Services payment pass the view and the payment Details
196-
molpay.startMolpay(molpayView ,paymentDetails , function(data){
197-
//callback after payment success
198-
console.log(data);
199-
alert(data);
200-
});
201-
};
202-
203-
204-
```
205-
206-
## Cash channel payment process (How does it work?)
207-
208-
This is how the cash channels work on XDK:
209-
210-
1) The user initiate a cash payment, upon completed, the XDK will pause at the “Payment instruction” screen, the results would return a pending status.
211-
212-
2) The user can then click on “Close” to exit the Razer Merchant Services XDK aka the payment screen.
213-
214-
3) When later in time, the user would arrive at say 7-Eleven to make the payment, the host app then can call the XDK again to display the “Payment Instruction” again, then it has to pass in all the payment details like it will for the standard payment process, only this time, the host app will have to also pass in an extra value in the payment details, it’s the “mp_transaction_id”, the value has to be the same transaction returned in the results from the XDK earlier during the completion of the transaction. If the transaction id provided is accurate, the XDK will instead show the “Payment Instruction" in place of the standard payment screen.
215-
216-
4) After the user done the paying at the 7-Eleven counter, they can close and exit Razer Merchant Services XDK by clicking the “Close” button again.
217-
218-
## XDK built-in checksum validator caveats
219-
220-
All XDK come with a built-in checksum validator to validate all incoming checksums and return the validation result through the "mp_secured_verified" parameter. However, this mechanism will fail and always return false if merchants are implementing the private secret key (which the latter is highly recommended and prefereable.) If you would choose to implement the private secret key, you may ignore the "mp_secured_verified" and send the checksum back to your server for validation.
221-
222-
## Private Secret Key checksum validation formula
223-
224-
chksum = MD5(mp_merchant_ID + results.msgType + results.txn_ID + results.amount + results.status_code + merchant_private_secret_key)
28+
[Installation](https://github.com/RazerMS/rms-mobile-xdk-nativescript/wiki/Installation-Guidance)
22529

22630
## Support
22731

0 commit comments

Comments
 (0)