How do I test the IAP SDK in China?

My app is integrating IAP 6.1.1 for in-app subscriptions. However, the startPayment interface could not succeed, prompting: Server error (currency: CNY)

Prerequisites:

  1. I have applied for a Samsung account in the United States.
  2. The beta version of my app has been deployed.
  3. I logged into my Samsung account on my device.
  4. My account has been added to the license test list.
  5. My device is connected to wifi and VPN.

When I pull up the payment page, I keep being prompted: Server error (currency: CNY), error code: -1002.
Error Code: UP1002/app_package_name
[Mode: Beta]

What can I do to get rid of this bug, or in other words, how can I test the IAP SDK in China?

Thank.

Hello hongyun1223654
Welcome to Samsung Developer Community.

VPN can’t be used. For testing IAP in China, real payment needs other country’s usim.
Test payments(no charge) is available by OPERATION_MODE_TEST or closed beta with license tester.

Thank you,
Jakia

Hi Jakia:

As you said, the operation mode I currently set in the code is OPERATION_MODE_TEST, and the account I logged on the device is the license test account, but I still can’t pay normally. the error message is: Server error occurred. (currency: CNY).

I don’t know how this error occurred, what should I do?

Thank.

image

1 Like

I have the same question, have you solved it?

Hi hongyun1223654,
Could you please reproduce your issue and get the dumpstate log of your device? Please share the log by creating a support request from Developer Support channel.

We will investigate your issue and try to assist you accordingly.

Thank you,
Jakia

The error you’re encountering suggests a mismatch or issue with the configuration between your app, the Samsung IAP server, and your testing environment. The Server error (currency: CNY) along with error code: -1002 typically points to a currency or regional settings problem, especially when testing in China. Here’s how you can troubleshoot and resolve the issue:


Steps to Resolve:

  1. Verify Currency and Regional Settings:
  • Ensure your Samsung account, app settings, and device regional settings align. Since your account is in the United States but you’re testing in China, this mismatch could cause the error.
  • Set the region in your app’s IAP configuration to match your test device’s region (e.g., China for CNY).
  1. Check IAP Configuration in the Samsung Developer Console:
  • Confirm that your app supports the correct currency (CNY) for in-app purchases.
  • If CNY is not configured in your app’s in-app products, update the pricing in the Developer Console to include this currency.
  1. Enable Testing in China:
  • Ensure your app is correctly set up for testing in China. Samsung services in China may require additional configurations or restrictions.
  • Add your test device and Samsung account to the license test list explicitly configured for the China region.
  1. Update the IAP SDK:
  • Use the latest version of the Samsung IAP SDK. While you mentioned version 6.1.1, check if there’s an updated version with bug fixes or better support for China.
  1. VPN Considerations:
  • While connected to a VPN, ensure the VPN server’s region matches your testing region (China).
  • If possible, test without a VPN to eliminate potential network or geolocation issues.
  1. Test on a Device with a Chinese Samsung Account:
  • Samsung IAP might enforce regional restrictions based on the Samsung account used for testing. Try using a Samsung account registered in China.
  1. Check App Package Name:
  • Ensure the app package name in your Samsung Developer Console matches the app you are testing.
  • The error UP1002/app_package_name indicates there could be an issue with the app’s identifier or package name.
  1. Review Samsung IAP Documentation:
  • Refer to the Samsung IAP SDK documentation https://developer.samsung.com/iap for details about setting up your app for specific regions like China.
  • Ensure you’ve followed all guidelines for implementing and testing IAP features.

If the Problem Persists:

  • Contact Samsung Developer Support:
    • Provide detailed logs, including the error codes and steps to reproduce the issue.
    • Mention your test region and configuration.
    • Samsung support can help resolve region-specific issues.
  • Switch to Production Testing:
    • If your setup in beta mode is causing issues, consider releasing a limited production version to test the IAP system with real transactions.

Additional Debugging Steps:

  • Check logs for detailed error messages related to currency: CNY.
  • Test with different network conditions or devices.
  • Verify that the payment method for the test account supports the specified currency.

By aligning your app’s settings with the test environment and resolving potential region-currency conflicts, you should be able to test the IAP SDK successfully in China.