Detailed documentation
Demo obtained from business
1.1 Scenario Description
Paynicorn provides developers with an aggregated payment SDK development kit, which can help developers shorten the development cycle, improve the development experience, and meet the differentiated payment method needs of the access party in different scenarios. By integrating the payment SDK, one-stop access to the world can be achieved Mainstream localized payment methods, including online payment, SMS payment, subscription payment, etc.
Online Payment
Scenes:
It is suitable for scenarios with network communication, and users make online payments through electronic wallets, credit cards, bank transfers, text messages, etc.
Specific operation process:
Step 1: The user enters the merchant APP, selects the product to place an order, confirms the purchase, and enters the payment link, as shown in Figure 1.1;
Step 2: The user enters the paynicorn cashier interface and selects the appropriate online payment method, as shown in Figure 1.2;
Step 3: The user enters payment elements on the payment page, such as account mobile phone number, email address and other information, and confirms the initiation of payment, as shown in Figure 1.3;
Step 4: The user returns to the merchant APP, and the APP releases the service or product according to the obtained payment result.
Figure 1.1 Product display page Figure 1.2 Payment method selection page Figure 1.3 Payment confirmation page
SMS payment
Scenes:
Applicable to scenarios without network communication, the user completes the payment by deducting the balance of the call charge in the user's mobile phone card by sending a deduction SMS to the telecom operator.
Specific operation process:
Step 1: The user enters the merchant APP, selects the product to place an order, confirms the purchase, and enters the payment link, as shown in Figure 2.1;
Step 2: The user confirms the sending of the SMS, as shown in Figure 2.2;
Step 3: The user sends a payment SMS, as shown in Figure 2.3 and Figure 2.4;
Step 4: The user returns to the merchant APP, and the APP releases the service or product according to the obtained payment result.
Figure 2.1 Product Display Page Figure 2.2 SMS Sending Confirmation Page Figure 2.3 SMS Sending Page Figure 2.4 SMS Sending Results
Subscription payment
Scenes:
Applicable to scenarios that require periodic deduction. After the user successfully completes the subscription, the user's mobile phone card bill balance is deducted according to a fixed period of time to complete the payment.
Specific operation process:
Step 1: The user enters the merchant APP, selects the product to place an order, confirms the purchase, and enters the payment link, as shown in Figure 3.1;
Step 2: The user enters the payment elements on the payment page and confirms the initiation of payment, as shown in Figure 3.2;
Step 3: The user confirms the subscription information, see Figure 3.3;
Step 4: The user sends a deduction SMS, see Figure 3.4;
Step 5: The user returns to the merchant APP, and the APP releases the service or product according to the obtained payment result.
Step 6: According to the user's subscription information, the fee will be deducted according to the subscription time period, and the merchant will release the service or product according to the deduction result of each period.
Figure 3.1 Product display page Figure 3.2 Payment confirmation page Figure 3.3 Subscription information confirmation page Figure 3.4 Send a deduction SMS
1.2 Which payment method to use
The access party selects the appropriate payment method according to network conditions, business needs and other factors, and will continue to optimize and update in the future to apply to more scenarios, so stay tuned...
1.3 Preparation before access
Reference: Preparation before access
1.4 Access Instructions
1.4.1 Access content
SDK access requires two parts of access: The first part is the Android client, and the recommended access tool is AndroidStudio; The second part is server access, the main interface is the interface, and the language is not limited. For details, please refer to: server access documentation.
1.4.2 Access process
1.4.3 SDK acquisition
The latest version of SDK is1.5.4.18. It is recommended to replace X.X.X.X in the sample code with the latest version number.
1、View Historical Versions Pay SDK Version
2、V1.5.4.7, V1.5.4.8, V1.5.4.9, V1.5.4.10, V1.5.4.11, V1.5.4.12, V1.5.4.15 are customized versions of internal mini programs, please consult business personnel before accessing
1.4.4 SDK client configuration
Add the maven configuration to the root build.gradle of the Android Studio project
buildscript {
repositories {
...
maven{ url 'https://mvn.shalltry.com/repository/maven-public'}
}
...
}
allprojects {
repositories {
...
maven{ url 'https://mvn.shalltry.com/repository/maven-public'}
}
}
Configured in the app's build.gradle file
dependencies {
...
api("com.transsion.pay:paysdk:X.X.X.X")
...
}
After version 1.5.0.0, support adding a login module, or removing any payment method
dependencies {
...
api('com.transsion.pay:paysdk:X.X.X.X'){
exclude module: 'sms-lib'//Remove SMS payment
// exclude module: 'paynicorn-lib'//Remove online payment
}
//If you need the login function, introduce the following dependencies
//implementation("com.transsion.pay:palmid-lib:X.X.X.X")
...
}
```
#### Dynamic permission application
It is recommended to dynamically apply for the following permissions when the application is opened, which can make the payment process more processful.
```xml
android.permission.READ_PHONE_STATE
android.permission.SEND_SMS
```
:::info
1. The payment SDK integrates the SMS sending function to support SMS payment. This method requires the application to obtain more sensitive permissions. If your business scenario does not require deduction from the user's mobile phone bill balance, you do not need to obtain the android.permission.SEND_SMS permission
2. During the initialization process, the initialization of a single payment method is supported. Mode-optional PaySDKManager.MODE_BOTH, PaySDKManager.MODE_PAYNICORN, PaySDKManager.MODE_SMS, if your business only needs online payment, you can pass PaySDKManager.MODE_PAYNICORN, which is not required at this time. User's android.permission.READ_PHONE_STATE permission
:::
## 1.5 Interface call process
### Step 1: Initialize at program startup
Request method: initAriesPay
Interface function: initialize the payment SDK
Request parameters:
|Parameters|Required|Type|Description|
|---|---|---|---|
|context|Y|Context|Context Object|
|ap_id|Y|String|Channel ID|
|cp_id|Y|String|Merchant ID|
|api_key|Y|String|Item ID/Product Key|
|InitResultCallBack|Y|interface|Callback Object|
Code example:
````java
PaySDKManager.getsInstance().setStrict(true);//Set strict mode, the default is true, after setting true, after multiple queries, the payment will also return failure
//Initialization has a variety of input parameters
//support all payment methods
PaySDKManager.getsInstance().initAriesPay(context, ap_id, cp_id,api_key,
new InitResultCallBack() {
@Override
public void onSuccess(List<SupportPayInfoEntity> list, boolean supportOnlinePay, CountryCurrencyData countryCurrencyData) {
}
@Override
public void onFail(int code) {
}
});
}
//Support the initialization of a single payment method, mode-optional: StartPayEntity.PAY_MODE_SMS, StartPayEntity.PAY_MODE_ONLINE, StartPayEntity.PAY_MODE_ALL
PaySDKManager.getsInstance().initAriesPay(context, ap_id, cp_id, api_key, mode
new InitResultCallBack() {
@Override
public void onSuccess(List<SupportPayInfoEntity> list, boolean supportOnlinePay, CountryCurrencyData countryCurrencyData) {
}
@Override
public void onFail(int code) {
}
});
}
onSuccess returns parameters:
Parameters | Required | Type | Description |
---|---|---|---|
list | Y | List | List of Amounts Supported by SMS Payment or Online Subscription |
supportOnlinePay | Y | boolean | Whether online payment is supported, true is support |
countryCurrencyData | Y | Object | Current country currency information entity |
onFail returns the code parameter:
result code | type | description |
---|---|---|
1000 | int | Initialization successful |
102 | int | Invalid IMSI (Invalid SIM/No SIM inserted/M platform does not have READ_PHONE_STATE permission) |
103 | int | Invalid ap_id |
104 | int | Invalid cp_id |
105 | int | Invalid api_key |
SupportPayInfoEntity object description:
parameters | type | description |
---|---|---|
mcc | String | The country mcc of the operator, such as 460 |
mnc | String | operator, like 20 |
simIndex | int | Mobile SIM number |
payType | int | Payment type, such as StartPayEntity.PAY_MODE_ONLINE/StartPayEntity.PAY_MODE_SMS/StartPayEntity.PAY_MODE_ALL |
priceEntities | List | Amount Currency List |
isOnlineMode() | Method | true-Online payment mode |
isSmsMode() | Method | true-SMS payment mode |
PriceEntity object description:
parameters | type | description |
---|---|---|
price | double | amount |
currency | String | currency |
keyCodes | List | SMS Payment Information |
mode | int | Identifies the online subscription |
cycle | String | Subscription Cycle |
code | List | Payment method code collection |
isSupportSub() | Method | true-support subscription payment |
isSupportNormal() | Method | true-support normal payment |
Note: The method isSupportSub() can be used to filter the online subscription amount collection and SMS payment amount collection from the original data list collection
CountryCurrencyData object description:
parameters | type | description |
---|---|---|
countryCode | String | country code |
currency | String | currency |
mcc | String | The mcc of the country to which the operator belongs, such as 460 |
usdRate | double | The exchange rate between the local currency and the US dollar, 1 US dollar is equal to how much local currency |
minAmount | double | Minimum amount that can be used for online payments |
maxAmount | double | Maximum amount that can be used for online payments |
smsMinAmount | double | Minimum amount paid by SMS |
smsMaxAmount | double | Maximum amount paid by SMS |
smsRandomAmount | double | Random amount paid by SMS |
smsOptimalAmount | double | Optimal amount paid by SMS |
Step 2: Currency Conversion (Optional)
USD to Standard Currency
Request method: convertUsdToLocal Interface function: provide currency exchange rate conversion, the caller decides whether to call according to the business Request parameters:
Parameters | Required | Type | Description |
---|---|---|---|
context | Y | Context | Context Object |
context | Y | context | Commodity Collection |
CurrencyConvertCallBack | Y | Object | interface |
code example:
private void initConvert(){
//usd product prices
List<ConvertPriceInfo> priceEntities = new ArrayList<>();
for(int i = 0;i < 5;i++){
ConvertPriceInfo priceEntity = new ConvertPriceInfo();
priceEntity.productId = i+""; //productId
priceEntity.usdPrice = i; //product price :usd
priceEntities.add(priceEntity);
}
//convert
PaySDKManager.getsInstance().convertUsdToLocal(TestActivity2.this, priceEntities, new CurrencyConvertCallBack() {
@Override
public void convertResult(List<CurrencyConvertResultEntity> convertResultEntities) {
if(convertResultEntities.size() <= 0){
Log.i("MainActivity","not support country");
return;
}
for(CurrencyConvertResultEntity resultEntity:convertResultEntities){
Log.i("MainActivity","local currency price:" + resultEntity.toPrice + " " + resultEntity.toCurrency);
}
}
});
}
Convert virtual currency to local currency
Request method: convertVirtualToLocal Interface function: virtual currency to standard currency Request parameters:
Parameters | Required | Type | Description |
---|---|---|---|
context | Y | Context | Context Object |
context | Y | context | Commodity Collection |
CurrencyConvertCallBack | Y | Object | interface |
code example:
private void convertVirtualToLocal(){
//usd product prices
List<ConvertPriceInfo> priceEntities = new ArrayList<>();
for(int i = 0;i < 5;i++){
ConvertPriceInfo priceEntity = new ConvertPriceInfo();
priceEntity.productId = i+""; //productId
priceEntity.virtualPrice = i; //Amount of virtual currency
priceEntity.virtualCurrency = "AHA"; //virtual currency
priceEntities.add(priceEntity);
}
//convert
PaySDKManager.getsInstance().convertVirtualToLocal(TestActivity.this, priceEntities, new CurrencyConvertCallBack() {
@Override
public void convertResult(List<CurrencyConvertResultEntity> convertResultEntities) {
if(convertResultEntities.size() <= 0){
Log.i("MainActivity","not support country");
return;
}
for(CurrencyConvertResultEntity resultEntity:convertResultEntities){
Log.i("MainActivity","local currency price:" + resultEntity.toPrice + " " + resultEntity.toCurrency);
}
}
});
}
ConvertPriceInfo object description:
Parameters | Required | Type | Description |
---|---|---|---|
productId | Y | String | Product ID of which currency to be converted |
usdPrice | Y | Double | The USD price of the commodity that needs to be converted into currency |
virtualPrice | Y | Double | The price of the commodity virtual currency that needs to be converted |
virtualCurrency | Y | String | The virtual currency to be converted - currently only AHA currency |
CurrencyConvertResultEntity object description:
Parameters | Required | Type | Description |
---|---|---|---|
productId | Y | String | Product ID of which currency to be converted |
toCurrency | Y | String | Local Currency Code |
toCountryCode | Y | String | The country code of the local currency |
fromPrice | Y | Double | Amount in USD before amount conversion |
toPrice | Y | Double | Amount in local currency after amount conversion |
Step 3: Initiate payment
Request parameters:
Parameters | Required | Type | Description |
---|---|---|---|
context | Y | Context | Context Object |
StartPayEntity | Y | Object | Payment parameter encapsulation |
StartPayCallBack | Y | Object | Callback Object |
StartPayEntity parameter description:
Parameters | Required | Type | Description |
---|---|---|---|
amount | Y | double | Item price |
payMode | N | int | Payment mode code: StartPayEntity.PAY_MODE_ONLINE: Online payment, StartPayEntity.PAY_MODE_SMS: SMS payment, StartPayEntity.PAY_MODE_ALL: All payment methods |
netPaySp | N | String | Online payment channel code, used to specify the detailed channel of online payment, from the server callback data |
orderNum | Y | String | payment order number (cannot be repeated, used for payment transaction processing) |
referenceNo | N | String | Merchant's internal order number (only transparently transmitted, not processed, used for merchants to mark internal orders, referenceNo can be obtained through the server callback interface and query interface on the payment side, and the merchant can match order information) |
currency | Y | String | Order currency |
countryCode | Y | String | Order country code |
description | N | String | Description of the order, which will be displayed at the checkout counter |
matchDown | N | boolean | is set to true - the function of fetching the supported amount is supported. When the amount supported by the payment method is less than the amount of the payment initiated, this function can be enabled to match the payment method. Default is true |
minDiscountRatio | N | double | Minimum Discount |
type | Y | int | Whether the payment method is subscription, StartPayEntity.PAY_TYPE_SUB is subscription, the default is normal payment |
adjustMode | N | int | (SMS payment is set to -1, online payment is set by yourself) Set adjustMode according to the set mode, combined with the corresponding currency to process the incoming amount of each digit rounding to prevent incoming The amount channel is not supported and cannot be paid. For the value of mode, see each mode of BigDecimal, and it is not set by default. |
N | String | ||
phone | N | String | Phone Number |
payMethod | N | String | Subscription operator code |
cycle | N | String | Subscription Cycle |
orderDescription | Subscription payment must be passed -Y, others can not be passed -N | String | Order description will be displayed at the cashier (content cp master defines by himself) |
serviceConfigPriority | N | boolean | Payment method background configuration priority default true |
memo | N | String | The amount is a parameter |
Initiate online payment or SMS payment
code example:
private void startPay(){
//Non-required fields can be empty
StartPayEntity startPayEntity = new StartPayEntity();
startPayEntity.amount = 10;//SMS initialization return amount, any value between the minimum and maximum amount supported by online payment
startPayEntity.countryCode = countryCurrencyData.countryCode;//Initialization returns countryCurrencyData object
startPayEntity.currency = countryCurrencyData.currency;
startPayEntity.orderNum = "orderNum";//Merchant order (maintain by yourself)
//StartPayEntity.PAY_MODE_ONLINE: Online payment, StartPayEntity.PAY_MODE_SMS: SMS payment, StartPayEntity.PAY_MODE_ALL: All payment methods
startPayEntity.payMode = StartPayEntity.PAY_MODE_SMS;
startPayEntity.type = 0;
//AHA quick game add field
//startPayEntity.apiKey = "";
//startPayEntity.cpId = "";
try {
//payOrderNum: payment order number
String payOrderNum=PaySDKManager.getsInstance().startPay(activity, startPayEntity, new StartPayCallBack() {
@Override
public void onOrderCreated(OrderEntity orderEntity) {
//The order is successfully created, and the payment is started. If the result is not received due to crashes and other reasons, you can query the order result according to the order number here.
}
@Override
public void onPaySuccess(OrderEntity orderEntity) {
//payment successful
}
@Override
public void onPaying(OrderEntity orderEntity) {
//The query times out, and then go to the server to confirm
}
@Override
public void onPayFail(int code, OrderEntity orderEntity) {
//payment failed
}
});
} catch (Exception e) {
e.printStackTrace();
}
}
Note: When the payment fails, the result code of the response will be returned to the merchant, and the merchant can prompt the user according to the return code
OrderEntity object description:
Parameters | Required | Type | Parameter Description |
---|---|---|---|
orderNum | Y | String | Platform order number |
cpOrderNum | Y | String | Merchant Order Number |
txnId | Y | String | paynicorn order number |
payMode | Y | int | Payment Mode |
netPaySp | Y | String | The channel ID of this payment |
netErrorMsg | Y | String | The reason for the failure of network pre-ordering |
subscriptionTime | Y | long | Subscription Time |
unSubscriptionTime | Y | long | Unsubscribe Time |
lastDeductionTime | Y | long | The last successful deduction time |
deductionCount | Y | int | Number of successful deductions |
Initiate subscription payment
code example:
private void startOnLineSubPay(){
//Non-required fields can be empty
StartPayEntity startPayEntity = new StartPayEntity();
startPayEntity.amount = 10;//Returned from initialization
startPayEntity.countryCode = countryCurrencyData.countryCode;//Initialization returns countryCurrencyData object
startPayEntity.currency = countryCurrencyData.currency;
startPayEntity.orderNum = "orderNum";//Merchant order number (maintain by yourself)
startPayEntity.cycle = "";//empty
startPayEntity.email = "";//If there is no value - empty
startPayEntity.phone = "";//If there is no value - empty
startPayEntity.payMethod = "";//If there is no value - empty
startPayEntity.orderDescription = "order description";//Must upload, cannot be empty, merchants define their own content
startPayEntity.netPaySp = "";//empty
try {
String subOrderNum=PaySDKManager.getsInstance().startOnLineSubPay(activity, startPayEntity, new StartPayCallBack() {
@Override
public void onOrderCreated(OrderEntity orderEntity) {
//The order is successfully created, and the payment is started. If the result is not received due to crashes and other reasons, you can query the order result according to the order number here.
}
@Override
public void onPaySuccess(OrderEntity orderEntity) {
//payment successful
}
@Override
public void onPaying(OrderEntity orderEntity) {
//The query times out, and then go to the server to confirm
}
@Override
public void onPayFail(int code, OrderEntity orderEntity) {
//payment failed
}
});
} catch (Exception e) {
e.printStackTrace();
}
}
Note: subOrderNum order number is saved by itself, and the order number is required for order query
Initiate quick payment
Rendering payment method for pure S2S connection
Open payment page example
//The incoming quickPayUrl is the url address returned by s2s
Intent intent = PaySDKManager.getsInstance().getQuickPayIntent(this, quickPayUrl);
startActivityForResult(intent, REQUEST_CODE);
return result
//The incoming quickPayUrl is the url address returned by s2s. The relevant code values are as follows. Finish means that the payment behavior is completed. You can use the order number to query the order result.
/*public static final int CODE_QUICK_PAY_INTENT_FINISH = 1;
public static final int CODE_QUICK_PAY_INTENT_CANCEL = -1;
public static final int CODE_QUICK_PAY_CONFIRM_FINISH = 2;
public static final int CODE_QUICK_PAY_CONFIRM_CANCEL = -2;
*/
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == REQUEST_CODE && resultCode == RESULT_OK) {
String result = data.getStringExtra(Consts.QUICK_PAY_KEY_RESULT);
int code = data.getIntExtra(Consts.QUICK_PAY_KEY_CODE, 0);
}
}
1.6 Payment result code table
The error codes starting from 1 are all system types, which are the error codes returned when the system fails to send SMS messages.
result | Description |
---|---|
101 | The number of payments exceeds the daily or monthly limit |
102 | Invalid IMSI (invalid SIM card or no SIM card inserted, etc.) |
103 | Invalid ap_id (null) |
104 | Invalid cp_id (null) |
105 | Invalid api_key (null) |
106 | Could not match code (mcc, mnc mismatch) |
107 | Invalid amount (the amount is 0 or the current payment amount cannot match the code) |
108 | The last payment has not been completed |
110 | No permission to read phone information READ_PHONE_STATE |
111 | No permission to send SMS SEND_SMS |
112 | Payment Failed |
113 | AriesPayBroadcastReceiver broadcast not registered in manifest file (obsolete) |
114 | User canceled payment |
115 | SMS sending timeout |
116 | Payment configuration error |
117 | Paying too frequently |
118 | Requires initialization |
124 | No matching payment method |
125 | No suitable amount |
128 | In strict mode, the queried payment is regarded as a payment failure |
129 | No network in payment |
130 | Cancel payment when sending SMS |
888 | No local country information found |
1 | Error sending (such as number not received, etc.) |
2 | Radio has been explicitly turned off (eg airplane mode turned on) |
3 | No pdu provided (SMS system is abnormal) |
4 | Service is currently unavailable (SMS service unavailable) |
5 | The sending queue limit has been reached (for example, the message is too long) |
6 | Result error FDN check failed |
7 | Reject advanced short codes (for example, when the second verification SMS sending is rejected) |
8 | Reject advanced short codes (for example, when the second verification SMS sending is rejected) |
Other | Unknown error, less than 100 is the system sending SMS error |
1.7 Order query interface
Request parameters:
Parameters | Required | Type | Description |
---|---|---|---|
orderNum | Y | String | Order Number |
apiKey | Y | String | Item ID/Product Key |
cpid | Y | String | Merchant ID |
OrderResultEntity object description:
Parameter | Type | Parameter Description |
---|---|---|
txnNum | String | Transaction Flow |
subscriptionTime | long | Subscription Time |
unSubscriptionTime | long | Unsubscribe Time |
deductionCount | int | Number of successful deductions |
lastDeductionTime | long | The last successful deduction time |
message | String | Description message |
orderNum | String | Query order number |
txnType | String | Payment Type |
payMethod | String | Payment Method |
status | int | Order Status Subscription Failed-OrderResultEntity.PAY_RESULT_FAIL/Subscribing-OrderResultEntity.PAY_RESULT_PAYING/Subscription Successful-OrderResultEntity.PAY_RESULT_SUCCESS/Subscription CancelledOrderResultEntity.SUB_RESULT_CANCEL |
referenceNo | String | Merchant's internal order number (only transparently transmitted, not processed, used for merchants to mark internal orders, referenceNo can be obtained through the server callback interface and query interface on the payment side, and the merchant can match order information) |
Online subscription query interface
Request method: queryOnlineSubOrderStatus Interface function: online subscription query interface
Code example:
PaySDKManager.getsInstance().queryOnlineSubOrderStatus(orderNum, apiKey, cpid, new OrderQuery() {
@Override
public void onSuccess(OrderResultEntity orderQueryEntity){
//Subscribe successfully
}
@Override
public void orderError(OrderResultEntity orderQueryEntity, String code, String errorMessage) {
//caused by network error - subscription failed
}
@Override
public void onPaying(OrderResultEntity orderQueryEntity) {
//Subscribing - unconfirmed result
}
@Override
public void orderFail(OrderResultEntity orderQueryEntity) {
//Subscription failed
}
});
Note: The next subscription payment can be handled in the orderError()/onPaying()/orderFail() callback
Common payment query interface
Request method: queryOrderStatus Interface function: common payment query interface
Code example:
PaySDKManager.getsInstance().queryOrderStatus(orderNum, apiKey, cpId, new OrderQuery() {
@Override
public void onSuccess(OrderResultEntity orderQueryEntity) {
//Order successful
}
@Override
public void orderError(OrderResultEntity orderQueryEntity,String code,String errorMessage) {
//Order error, such as order number error, network failure, etc.
}
@Override
public void onPaying(OrderResultEntity orderQueryEntity) {
//Order unconfirmed result
}
@Override
public void orderFail(OrderResultEntity orderQueryEntity) {
//Order payment failed
}
});
1.8 Firebase Access
1. Follow the Firebase official documentation - use the Firebase console to set up the workflow scheme to access Firebase official address
2, google-services.json file to find business acquisition
3. Payment SDK buried point data callback interface
Code example:
PaySDKManager.getsInstance().setStatisticsSynchroListener(new StatisticsSynchroListener() {
@Override
public void track(String event, Bundle bundle) {
FirebaseAnalytics.getInstance(activity).logEvent(event, bundle);
if (event.equals(PaySDKStatistics.ARIES_EVENT_INIT_NAME)) {
FirebaseAnalytics.getInstance(context).setUserProperty("mccmnc", PayUtil.getSimOperator(context);
FirebaseAnalytics.getInstance(context).setUserProperty("AP_ID", bundle.getString("ap_id"));
FirebaseAnalytics.getInstance(context).setUserProperty("CP_ID", bundle.getString("cp_id"));
FirebaseAnalytics.getInstance(context).setUserProperty("API_KEY", bundle.getString("appkey"));
} }
} }
});
1.9 Billing point query interface
1. Interface address
2. Instructions for SMS payment and billing points:
- mcc country code, mnc mobile operator network code, mcc and mnc determine the supported countries and operator charging channels;
- Match to the list of available charging point amount money fields under each operator (mnc) in the content returned by the interface. The charging point whose weight (managerWeight) is not 0 is the available charging point, and the weight value will be determined by the Channel adjustments are subject to change at any time;
- Only if the operator of the user's mobile phone sim card and the operator of the corresponding billing point are completely matched, it is possible to guarantee the transaction success, otherwise, it must fail;
- In principle, it is recommended to call the payment SDK to send the deduction instruction. It is not recommended to encapsulate the content of the SMS and send it, which may cause the transaction to fail to match and ultimately fail to settle.
- The value of needNetwork is 1, which means that the precondition of the charging point must be unblocked.
1.10 Test mode
SMS Payment Test
Mainly for the test design of the SMS payment function part, because there is no operator's SIM card during development, it can be simulated by the following method
SMSTestUtil.setTestMode(true)//Close by default, when set to true, it means the test mode is turned on, and it is a dual-card mode
SMSTestUtil.setTestMCCMNC("62160");// The mccmnc of the first card is set here
SMSTestUtil.setTestMCCMNC2("62120");// here is to set the mccmnc of the second card
//For example, if you want to simulate the operation of Airtel in Nigeria, then set 62120
//Then when simulating other operators, find the mccmnc of the corresponding operator and set it
Online Payment Test Mode
The application defaults to the test mode. When you need to go online, you need to contact the business and switch to the official mode.
1.11 Support game authorization through account - get authCode
Call paynicorn server interface to get openId according to authCode
PaySDKManager.getsInstance().getAuthCode(Activity.this, new PaynicornAuthListener() {
@Override
public void authResult(PaynicornOauthRsp oauthRsp) {
if (oauthRsp.code == 200) {
String authCode = oauthRsp.authCode;
}
}
});
1.12 Glossary of terms
Online Payment:
Relying on the network, payment is completed through electronic wallets, credit cards, bank transfers, DCB mode short-generation, etc.
SMS payment:
Divided into DCB mode, VAS mode. Among them: DCB short-generation payment is a type of online payment. The payment is completed by sending a deduction SMS to the telecom operator and deducting the balance of the call, but it needs to rely on network communication to obtain the payment result in real time; VAS short-generation payment does not depend on the network. Conditions, after sending a deduction SMS to the telecom operator, the payment result depends on the operator's notification.
Subscription payment:
By sending a deduction SMS to the telecom operator, the operator periodically deducts the balance of the call charge according to the agreement to complete the payment; ####MCC: 3-digit country code, there are multiple MCC codes in the same country.
MNC:
Mobile operator network code, there are multiple MCC codes for the same operator.
Billing Points:
By sending a certain deduction SMS content, the telecom operator can deduct the corresponding amount from the call balance, which is the charging point, and the charging point and the content of the deduction SMS are determined by the telecom operator.
1.13 Changelog
V1.5.1.7
Increase the phone bill recharge entry
AHA integrates Aries SDK to provide VAS payment capability to Quick Games
Optimize CP access efficiency
V1.5.1.6
Short-generation process optimization
Initialize the pure online payment method to remove the phone permission
V1.5.1.5
- Short-generation payment permission optimization - deny permission and jump to the system interface for authorization - can't pay without authorization
V1.5.1.4
- Optimize the code
V1.5.2.3
- Support virtual currency payment
- Support account authorization
- Payment input optimization