China Mobile mm Android/ophone pay SDK--MMBILLINGSDK, Integration issues Summary

Source: Internet
Author: User

Original address: http://www.j2megame.com/html/xwzx/ty/2916.html

China Mobile mm Android/ophone pay SDK--MMBILLINGSDK, Integration issues Summary

In the recent integration of the MM Android/ophone pay SDK into the game, here are some of the issues I encountered in the integration process to reconcile

Solution:

I. Landing mm system backstage, there is no solution for in-app billing information.

1, install the MM electronic signature certificate, this thing must be installed, or can not enter the background normally.

2, enter from the service area, input http://dev.10086.cn/oms/newflow/ChargeAppAction.action?act=apply, into

"In-app billing" Configuration interface.

In the application interface, there are several useful things: Apply the APPID in the code corresponding program, check the app KEY corresponding program

APPKEY, configure in-app product paycode corresponding program Items_paycode, remember the key to save Oh.

Configure in-app products: up to 15RMB, if you want to repeat the purchase, tick the "repeatable purchase" option. When buying items repeatedly,

There will be a period of protection, that is, users in a short period of time can not repeat the purchase of the same props, this in the design of the game should be careful

。

Configure the self-test environment: Fill in your mobile phone number, do not fill in the words, pay for themselves.

Second, the billing procedure transplant please refer to: Mmbillingsdk_release (v1.0.6). 1.0.6 is proguard.cfg is the foot that can be correctly confused

Ben, there is a problem with the confusion of 1.0.5.

Code porting is very simple, basically copy the past can be used, remember when the program is initialized to join purchase must initialize:

Initialize, mm third-party information
Initmsgs ();
Initializing the SDK
purchase = new Purchase (this, APPID, APPKEY, cachelicense);

Order business unsuccessful There are 2 situations: 1 are authorized to fail, one is to pay failure. These 2 are to be captured separately.

Onlicenselistener Liclistener =new Onlicenselistener () {

@Override
public void Onlicensefinish (Onlicenselistener.statuscode code) {
Unable to obtain valid authorization information, it is recommended that the app terminate the run
LOG.D (TAG, "license finish, Status code =" + Code.name ());
if (MainMIDlet4.MID.isFinishing ()) {
Return
}
if (Code.equals (OnLicenseListener.StatusCode.SUCCEED)) {
ShowDialog (Mainmidlet4.mid, "Authorization verification passed (business ordered)");
if (currentreq = = 1) {
Handler.obtainmessage (Msg_event_enable_unsubscribe). Sendtotarget ();
Return
}
} else {
Unsuccessful ordering, capturing unsuccessful payment due to authorization, etc.
ShowDialog (Mainmidlet4.mid, Msgmap.get (code));
}

Handler.obtainmessage (msg_event_check_finished). Sendtotarget ();
}

public void onbeforeapply () {
Handler.obtainmessage (msg_event_before_apply). Sendtotarget ();
}

public void onafterapply () {
Handler.obtainmessage (msg_event_after_apply). Sendtotarget ();
}

};

There are only 1 cases of success in order business:

@Override
public void Onbillingfinish (Onbillinglistener.statuscode code) {
Payment failure, recommended retry, depending on the number of failures to continue running
LOG.D (TAG, "Billing finish, Status code =" + Code.name ());
System.out.println ("Bill Finish" + Code.name ());
if (MainMIDlet4.MID.isFinishing ()) {
Return
}
if (Code.equals (OnBillingListener.StatusCode.SUCCEED)) {
ShowDialog (Mainmidlet4.mid, "order Success");
A successful order, only 1 in this case, just to capture the successful order
if (currentreq = = 1) {
Handler.obtainmessage (Msg_event_enable_unsubscribe). Sendtotarget ();
Return
}
} else {
Unsuccessful ordering, capturing unsuccessful subscription due to payment failure
ShowDialog (Mainmidlet4.mid, Msgmap.get (code));
}

Handler.obtainmessage (msg_event_check_finished). Sendtotarget ();
}

};

Three, to the APK program to sign, the creation of mm backstage copyright files. Signed

1. Run self-signed tool. EXE, import apk program, MM electronic certificate, private key, generate. Signed Copyright file

2, upload the copyright file to the background of the application, and click Save, pay attention to do not point to submit oh. Copyright information is automatically generated in the system background

, which is used to verify that copyright is verified when the phone is accessed. This step must be saved, or the phone will be reported invalid

The copyright information cannot be paid properly.

Four, test whether the successful access.

1, the test must ensure that the mobile network is open, mobile phone number must be mobile number.

2, the authorization test will be slow, you should wait patiently. Authorization detection after the identity detection, after passing, the system will pop up a verification box, let

The authentication information inside the user input. After the user sends the verification information, the system returns the order success information or other reasons that cause the payment to fail, and then the program is processed accordingly.

by www.J2meGame.com Original, reprint please explain.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.