SGSDK can call Google, WeChat or Apple payment.
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> |
PaymentChannel = "WeChat"
you can call WeChat payment.
void IAPInit(string productsJSON)Description
SGSDK.Instance.IAPInit ("[ConsumbleItem, NonConsumable, AutoSubscription, NonAutoSbuscriptions]");
void Pay(SGPayRequest req)Description
void getOrder(string orderId, string gameKey, string openId, string sign)Description
Parameters | 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.
void IAPRestore()Description