Skip to main content

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.

product_showcase payment_method_selection_page payment_confirmation_page

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.

img_2_1 img_2_2 img_2_3 img_2_4

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.

img_3_1 img_3_2 img_3_3 img_3_4

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

img_8_1

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

img_4_1

1.4.3 SDK acquisition

info

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:

ParametersRequiredTypeDescription
listYListList of Amounts Supported by SMS Payment or Online Subscription
supportOnlinePayYbooleanWhether online payment is supported, true is support
countryCurrencyDataYObjectCurrent country currency information entity

onFail returns the code parameter:

result codetypedescription
1000intInitialization successful
102intInvalid IMSI (Invalid SIM/No SIM inserted/M platform does not have READ_PHONE_STATE permission)
103intInvalid ap_id
104intInvalid cp_id
105intInvalid api_key

SupportPayInfoEntity object description:

parameterstypedescription
mccStringThe country mcc of the operator, such as 460
mncStringoperator, like 20
simIndexintMobile SIM number
payTypeintPayment type, such as StartPayEntity.PAY_MODE_ONLINE/StartPayEntity.PAY_MODE_SMS/StartPayEntity.PAY_MODE_ALL
priceEntitiesListAmount Currency List
isOnlineMode()Methodtrue-Online payment mode
isSmsMode()Methodtrue-SMS payment mode

PriceEntity object description:

parameterstypedescription
pricedoubleamount
currencyStringcurrency
keyCodesListSMS Payment Information
modeintIdentifies the online subscription
cycleStringSubscription Cycle
codeListPayment method code collection
isSupportSub()Methodtrue-support subscription payment
isSupportNormal()Methodtrue-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:

parameterstypedescription
countryCodeStringcountry code
currencyStringcurrency
mccStringThe mcc of the country to which the operator belongs, such as 460
usdRatedoubleThe exchange rate between the local currency and the US dollar, 1 US dollar is equal to how much local currency
minAmountdoubleMinimum amount that can be used for online payments
maxAmountdoubleMaximum amount that can be used for online payments
smsMinAmountdoubleMinimum amount paid by SMS
smsMaxAmountdoubleMaximum amount paid by SMS
smsRandomAmountdoubleRandom amount paid by SMS
smsOptimalAmountdoubleOptimal 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:

ParametersRequiredTypeDescription
contextYContextContext Object
contextYcontextCommodity Collection
CurrencyConvertCallBackYObjectinterface

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:

ParametersRequiredTypeDescription
contextYContextContext Object
contextYcontextCommodity Collection
CurrencyConvertCallBackYObjectinterface

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:

ParametersRequiredTypeDescription
productIdYStringProduct ID of which currency to be converted
usdPriceYDoubleThe USD price of the commodity that needs to be converted into currency
virtualPriceYDoubleThe price of the commodity virtual currency that needs to be converted
virtualCurrencyYStringThe virtual currency to be converted - currently only AHA currency

CurrencyConvertResultEntity object description:

ParametersRequiredTypeDescription
productIdYStringProduct ID of which currency to be converted
toCurrencyYStringLocal Currency Code
toCountryCodeYStringThe country code of the local currency
fromPriceYDoubleAmount in USD before amount conversion
toPriceYDoubleAmount in local currency after amount conversion

Step 3: Initiate payment

Request parameters:

ParametersRequiredTypeDescription
contextYContextContext Object
StartPayEntityYObjectPayment parameter encapsulation
StartPayCallBackYObjectCallback Object

StartPayEntity parameter description:

ParametersRequiredTypeDescription
amountYdoubleItem price
payModeNintPayment mode code: StartPayEntity.PAY_MODE_ONLINE: Online payment, StartPayEntity.PAY_MODE_SMS: SMS payment, StartPayEntity.PAY_MODE_ALL: All payment methods
netPaySpNStringOnline payment channel code, used to specify the detailed channel of online payment, from the server callback data
orderNumYStringpayment order number (cannot be repeated, used for payment transaction processing)
referenceNoNStringMerchant'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)
currencyYStringOrder currency
countryCodeYStringOrder country code
descriptionNStringDescription of the order, which will be displayed at the checkout counter
matchDownNbooleanis 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
minDiscountRatioNdoubleMinimum Discount
typeYintWhether the payment method is subscription, StartPayEntity.PAY_TYPE_SUB is subscription, the default is normal payment
adjustModeNint(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.
emailNStringEmail
phoneNStringPhone Number
payMethodNStringSubscription operator code
cycleNStringSubscription Cycle
orderDescriptionSubscription payment must be passed -Y, others can not be passed -NStringOrder description will be displayed at the cashier (content cp master defines by himself)
serviceConfigPriorityNbooleanPayment method background configuration priority default true
memoNStringThe 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:

ParametersRequiredTypeParameter Description
orderNumYStringPlatform order number
cpOrderNumYStringMerchant Order Number
txnIdYStringpaynicorn order number
payModeYintPayment Mode
netPaySpYStringThe channel ID of this payment
netErrorMsgYStringThe reason for the failure of network pre-ordering
subscriptionTimeYlongSubscription Time
unSubscriptionTimeYlongUnsubscribe Time
lastDeductionTimeYlongThe last successful deduction time
deductionCountYintNumber 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

info

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.

resultDescription
101The number of payments exceeds the daily or monthly limit
102Invalid IMSI (invalid SIM card or no SIM card inserted, etc.)
103Invalid ap_id (null)
104Invalid cp_id (null)
105Invalid api_key (null)
106Could not match code (mcc, mnc mismatch)
107Invalid amount (the amount is 0 or the current payment amount cannot match the code)
108The last payment has not been completed
110No permission to read phone information READ_PHONE_STATE
111No permission to send SMS SEND_SMS
112Payment Failed
113AriesPayBroadcastReceiver broadcast not registered in manifest file (obsolete)
114User canceled payment
115SMS sending timeout
116Payment configuration error
117Paying too frequently
118Requires initialization
124No matching payment method
125No suitable amount
128In strict mode, the queried payment is regarded as a payment failure
129No network in payment
130Cancel payment when sending SMS
888No local country information found
1Error sending (such as number not received, etc.)
2Radio has been explicitly turned off (eg airplane mode turned on)
3No pdu provided (SMS system is abnormal)
4Service is currently unavailable (SMS service unavailable)
5The sending queue limit has been reached (for example, the message is too long)
6Result error FDN check failed
7Reject advanced short codes (for example, when the second verification SMS sending is rejected)
8Reject advanced short codes (for example, when the second verification SMS sending is rejected)
OtherUnknown error, less than 100 is the system sending SMS error

1.7 Order query interface

Request parameters:

ParametersRequiredTypeDescription
orderNumYStringOrder Number
apiKeyYStringItem ID/Product Key
cpidYStringMerchant ID

OrderResultEntity object description:

ParameterTypeParameter Description
txnNumStringTransaction Flow
subscriptionTimelongSubscription Time
unSubscriptionTimelongUnsubscribe Time
deductionCountintNumber of successful deductions
lastDeductionTimelongThe last successful deduction time
messageStringDescription message
orderNumStringQuery order number
txnTypeStringPayment Type
payMethodStringPayment Method
statusintOrder Status Subscription Failed-OrderResultEntity.PAY_RESULT_FAIL/Subscribing-OrderResultEntity.PAY_RESULT_PAYING/Subscription Successful-OrderResultEntity.PAY_RESULT_SUCCESS/Subscription CancelledOrderResultEntity.SUB_RESULT_CANCEL
referenceNoStringMerchant'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:

  1. mcc country code, mnc mobile operator network code, mcc and mnc determine the supported countries and operator charging channels;
  2. 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;
  3. 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;
  4. 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.
  5. 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

  1. Increase the phone bill recharge entry

  2. AHA integrates Aries SDK to provide VAS payment capability to Quick Games

  3. Optimize CP access efficiency

V1.5.1.6

  1. Short-generation process optimization

  2. Initialize the pure online payment method to remove the phone permission

V1.5.1.5

  1. Short-generation payment permission optimization - deny permission and jump to the system interface for authorization - can't pay without authorization

V1.5.1.4

  1. Optimize the code

V1.5.2.3

  1. Support virtual currency payment
  2. Support account authorization
  3. Payment input optimization