SG Payment system incorporates third-party vendors billing system to help you implement in-app purchasing (IAP) function easier.
Please add following meta-data
setting in AndroidManifest.xml before using IAP functions:
1 2 3 4 5 6 7 8 | <application......> ...... ...... <meta-data android:name="SDKChannel" android:value="googleplay" /> <meta-data android:name="Base64PublicKey" android:value="xxxxxxxxxxxxxxxxx" /> </application> |
void pay(SGPayRequest req)Description
pay
function initializes (once) Google IAP service automatically.
It also consumes the product automatically, after purchased successfully.
void getOrder(String orderId, String gameKey, String openId, String sign)Description
gameKey | Your developer identification. |
openId | SG member ID. You can obtain it through GetOpenID() after user login. |
orderId | Order ID you passed in when making the purchase. |
sign |
Signature generated from above three parameters. Please refer to signature algorithm. |
void consumePurchasedItems()Description
response code 1174
(purchase successful yet consume failed). It consumes all previous purchased but not consumed items.
onResume
event.