Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Woj_Gabel_FertileSky · Mar 10, 2015 at 03:57 PM · sdkofflinepayment

Get userID in Chinese 360 offline payment plugin implementation.

Hi! I am currently trying to implement 360 offline payment system(ver 0.1.4 from 2.02.2015), and cant figure out how to get some of the parameters needed in correct payment and data gathering method call. For example how can I get userID?

I also am not a Chinese speaking person, I can barley english.

When I call

 Bundle bundle = new Bundle();
 bundle.putInt(ProtocolKeys.FUNCTION_CODE, ProtocolConfigs.FUNC_CODE_LOGIN);
 Intent intent = new Intent(context, ContainerActivity.class);
 Matrix.invokeActivity(context, intent, mLoginCallback);
 
 private static IDispatcherCallback mLoginCallback = new IDispatcherCallback() 
     {
         @Override
         public void onFinished(String data) 
         {
             int returnValue = -1;
             Log.i(TAG, "data is " + data);
             if (!TextUtils.isEmpty(data))
             {
                 try 
                 {
                     JSONObject json = new JSONObject(data);
                     int errCode = json.getInt("error_code");
                     String errorMsg = json.getString("error_msg");
                     if (errCode == 0)
                     {
                         returnValue = 0;
                         
                     }
                 }
                 catch(JSONException e)
                 {
                     e.printStackTrace();
                 }
             }
             Matrix.destroy(UnityPlayer.currentActivity);
             UnityBridge.LoginCallback(Integer.toString(returnValue));
         }
     };

this method returns simple string:

 {"content":"","error_code":"0","error_msg":"登录成功"}

Later in the documentation I can use some methods to post data to servers:

public static void player(String id, int age, int gender, String source, String rank, String server, String comment)

But where can I get this info?

Also in payments method there are parameters that are weird, like userID is needed in the payment process, but it is not given by the server, but it is set in the application, so there could be potentially multiple userID withe the same values. Is this correct? Can I just set this value to "Joe" for every user and everything will be good?

  // Required. User id given by application. 32 characters at most.
 bundle.putString(ProtocolKeys.APP_USER_ID, Constants.DEMO_PAY_APP_USER_ID);


Links to the SDK and documentation(lacking explanation unfortunately )

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by waitWut · Mar 11, 2015 at 01:05 PM

I'm not very familiar with 360, but let's try:

{"content":"","error_code":"0","error_msg":"登录成功"} Seems to give error code: 0 and msg (Login Successful) with google translate. I would assume that information you're seeking is in the 'data' section of the message.

Have you tried the logon interface/ callback section from the documentation you linked? That would look correct way to parse the information:

private IDispatcherCallback mLoginCallbackSupportOffline

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

22 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Using Paypal iOS SDK with a Unity App 0 Answers

What can we do to learn : Create Payment in MyGame 1 Answer

Input video stream via ethernet 1 Answer

Unloading broken assembly Assets/Firebase/Plugins/Mono/Firebase.Database.dll 0 Answers

CommandInvokationFailure: Gradle build failed. 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges