diff --git a/hk/docs/sdk/TapPayments/develop/android.mdx b/hk/docs/sdk/TapPayments/develop/android.mdx index 46235c652..0a815d3a0 100644 --- a/hk/docs/sdk/TapPayments/develop/android.mdx +++ b/hk/docs/sdk/TapPayments/develop/android.mdx @@ -42,7 +42,7 @@ import CodeBlock from '@theme/CodeBlock'; ### **SDK 初始化** -TapTap 登录模块依赖于 TapTapSDK 初始化,具体参考 [TapSDK 集成](/sdk/access/quickstart/#初始化) +TapTapIAP 模块依赖于 TapTapSDK 初始化,具体参考 [TapSDK 集成](/sdk/access/quickstart/#初始化) ```java @@ -164,7 +164,6 @@ public void onPurchaseUpdated(TapPaymentResult result, Purchase purchase) { Purchase purchase = ...; FinishPurchaseParams params = FinishPurchaseParams.newBuilder() .setId(purchase.getOrderId()) // Required - .setOrderToken(purchase.getOrderToken()) // Required .setPurchaseToken(purchase.getPurchaseToken()) // Required .build(); tapTapIAP.finishPurchaseAsync(params, new FinishPurchaseResponseListener() { diff --git a/hk/docs/sdk/TapPayments/develop/unity.mdx b/hk/docs/sdk/TapPayments/develop/unity.mdx index 433c3c219..886874065 100644 --- a/hk/docs/sdk/TapPayments/develop/unity.mdx +++ b/hk/docs/sdk/TapPayments/develop/unity.mdx @@ -48,14 +48,14 @@ EDM4U 可以通过 OpenUPM 进行下载,开发者可以通过 **Edit > Project TapTap IAP 可以通过 NPMJS 进行安装, 开发者可以通过 **Edit > Project Settings > Package Manager** 来注册使用 NPMJS。 -![](https://capacity-files.lcfile.com/sJDhXK4vAwAYX7BpQFh1SrQzeUmXk165/taptap.png) +![](https://img.tapimg.com/market/images/4f0d11b80a358ff0f714b37a51d6007f.png) <> 配置完成以后就可以在 Window > Package Manager > My Registries 中安装 TapTapSDK IAP {v4SDKVersions.tapGlobalPayments.unity}。 如果安装目录中没有 TapTap Payments Global V2, 请尝试在 Edit > Project Settings > Package Manager 中重新注册 NPMJS。 -![](https://img.tapimg.com/market/images/cda0911e47723fba9bee9a29ef62260f.png) +![](https://img.tapimg.com/market/images/58581dbaaf3b269c453b0781e3a22a55.png) ### 2、修改 Packages/manifest.json 文件 diff --git a/hk/i18n/en/docusaurus-plugin-content-docs/current/sdk/TapPayments/develop/android.mdx b/hk/i18n/en/docusaurus-plugin-content-docs/current/sdk/TapPayments/develop/android.mdx index 0967bac45..6c5c5013c 100644 --- a/hk/i18n/en/docusaurus-plugin-content-docs/current/sdk/TapPayments/develop/android.mdx +++ b/hk/i18n/en/docusaurus-plugin-content-docs/current/sdk/TapPayments/develop/android.mdx @@ -38,27 +38,29 @@ Open the `project/app/build.gradle` file of your project and add the following g ### **SDK Initialization** -After adding the TapTapIAP dependency, you need to initialize the `TapTapIAP` instance. `TapTapIAP` communicates between the SDK and the rest of your application, providing methods for many common operations. +The TapTapIAP module relies on the initialization of the TapTapSDK. For details, refer to [TapSDK Integration](/sdk/access/quickstart/#Initialization). -First, initialize the SDK during app launch by setting `TapTapSdkOptions` and completing SDK initialization with `TapTapSdk.init`. +```java +import com.taptap.sdk.core.TapTapRegion; +import com.taptap.sdk.core.TapTapSdk; +import com.taptap.sdk.core.TapTapSdkOptions; -You need to set the `ClientID` and `ClientToken` obtained from the developer backend for permission validation to use `TapTapIAP`. +String clientId = ""; -```java -TapTapSdkOptions sdkOptions = new TapTapSdkOptions( - "Your App's ClientID", // clientId obtained from the developer platform - "Your App's ClientToken", // clientToken obtained from the developer platform - TapTapRegion.GLOBAL, // Region - "", // Sub-package channel name - "", // Game version, null will take AppVersion - false, // Automatically report GooglePlay purchase success event, effective only for [TapTapRegion.GLOBAL] - false, // Custom fields can overwrite built-in fields - null, // Custom attributes, included with the first preset event (device_login) - null, // OAID certificate, used for reporting OAID, effective only for [TapTapRegion.CN] - false // Enable log, recommended to enable in Debug and disable in Release +String clientToken = ""; +// Enable the log. It's recommended to turn it on for Debug and off for Release, with it being off by default. +boolean enableLog = BuildConfig.DEBUG; + +TapTapSdkOptions tapSdkOptions = new TapTapSdkOptions( + clientId, // clientId obtained from the developer platform + clientToken, // clientToken obtained from the developer platform + TapTapRegion.GLOBAL // Region: TapTapRegion.CN, TapTapRegion.GLOBAL ); +tapSdkOptions.setEnableLog(enableLog); + +TapTapSdk.init(context, tapSdkOptions); + -TapTapSdk.init(context, sdkOptions); ``` To create `TapTapIAP`, use `newBuilder()`, which will validate the permissions to use `TapTapIAP` based on the `ClientID` and `ClientToken` set in SDK.init. @@ -158,7 +160,6 @@ After a user completes the purchase of any product, confirm that the correspondi Purchase purchase = ...; FinishPurchaseParams params = FinishPurchaseParams.newBuilder() .setId(purchase.getOrderId()) // Required - .setOrderToken(purchase.getOrderToken()) // Required .setPurchaseToken(purchase.getPurchaseToken()) // Required .build(); tapTapIAP.finishPurchaseAsync(params, new FinishPurchaseResponseListener() { diff --git a/hk/i18n/en/docusaurus-plugin-content-docs/current/sdk/TapPayments/develop/unity.mdx b/hk/i18n/en/docusaurus-plugin-content-docs/current/sdk/TapPayments/develop/unity.mdx index 54ede3caa..79473b10e 100644 --- a/hk/i18n/en/docusaurus-plugin-content-docs/current/sdk/TapPayments/develop/unity.mdx +++ b/hk/i18n/en/docusaurus-plugin-content-docs/current/sdk/TapPayments/develop/unity.mdx @@ -46,14 +46,14 @@ Developers can download the UPM package from [Google APIs for Unity](https://dev The TapTap IAP can be installed via NPMJS. Developers can register to use NPMJS through **Edit > Project Settings > Package Manager**. -![](https://capacity-files.lcfile.com/sJDhXK4vAwAYX7BpQFh1SrQzeUmXk165/taptap.png) +![](https://img.tapimg.com/market/images/4f0d11b80a358ff0f714b37a51d6007f.png) <> After configuration, you can install TapTapSDK IAP {v4SDKVersions.tapGlobalPayments.unity} in Window > Package Manager > My Registries. If TapTap Payments Global V2 is not in the installation directory, try re-registering NPMJS in Edit > Project Settings > Package Manager. -![](https://img.tapimg.com/market/images/cda0911e47723fba9bee9a29ef62260f.png) +![](https://img.tapimg.com/market/images/58581dbaaf3b269c453b0781e3a22a55.png) ### 2. Modify the Packages/manifest.json File @@ -71,14 +71,12 @@ The TapTap IAP can be installed via NPMJS. Developers can register to use NPMJS { "name": "taptap", "url": "https://registry.npmjs.org", - "scopes": ["com.tapsdk", "com.taptap", "com.leancloud"] + "scopes": ["com.tapsdk"] }, { "name": "openupm", "url": "https://package.openupm.com", - "scopes": [ - "com.google" - ] + "scopes": ["com.google"] } ]`}