Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue when purchase testing Android IAP product using "Slow test card" method #50

Open
RedHunter7 opened this issue Aug 22, 2022 · 8 comments
Labels
bug Something isn't working

Comments

@RedHunter7
Copy link

Bug Description
https://forum.defold.com/t/issue-when-purchase-testing-android-iap-product-using-slow-test-card-method/71474

When using "Slow test card, approves after few minutes" method on purchase testing, the transaction state become error with reason iap.REASON_UNSPECIFIED. After 3-5 minutes, transaction state become iap.TRANS_STATE_PURCHASED.

Same with "Slow test card, declines after few minutes", the transaction state also become error with reason iap.REASON_UNSPECIFIED. But after 3-5 minutes, the API does not give any information if transaction is fail/error.

Expected behaviour

  1. On method "Slow test card, approves after few minutes", the transaction state should become PENDING. After few minutes, transaction state becomes PURCHASED
  2. On method "Slow test card, declines after few minutes", the transaction state should become PENDING. After few minutes, transaction state becomes FAILED or error
@britzl
Copy link
Collaborator

britzl commented Sep 8, 2022

I'm not able to reproduce this when testing with the recent extension update to Google Play Billing Version 5

@britzl britzl closed this as completed Sep 8, 2022
@britzl britzl reopened this Sep 15, 2022
@britzl
Copy link
Collaborator

britzl commented Sep 15, 2022

User has tested on Samsung A32 (Android 12) & Google Pixel 4 (Android 11)

image

@britzl britzl added the bug Something isn't working label Aug 7, 2023
@dri-richard
Copy link

We also see this. Slightly different output. This is on a Xiaomi-MI 9, Android 10.

ERROR:IAPEXT: IAP error 5
DEBUG:SCRIPT: IAP Error
DEBUG:SCRIPT: {
error = "failed to buy product",
reason = 0
}

@dri-richard
Copy link

I suspect that the default auto-completion option assumes a sequence & timing of events that is incompatible with that caused by the slow test card option (and presumably, the real-life equivalent situation)

@britzl
Copy link
Collaborator

britzl commented Sep 15, 2023

We also see this. Slightly different output. This is on a Xiaomi-MI 9, Android 10.

ERROR:IAPEXT: IAP error 5
DEBUG:SCRIPT: IAP Error
DEBUG:SCRIPT: {
error = "failed to buy product",
reason = 0
}

How are you testing this? Last time I tried I failed to repro the issue.

@dri-richard
Copy link

To reproduce:

  1. In game project, remove iap.auto_finish_transactions = 0 (the default setting is 1, i.e. enabled)
  2. Modify the Android bundle ID, and the product IDs in main.gui_script as required
  3. Bundle and run
  4. Click 'Goldbars - S'
  5. Ensure the 'Slow test card. Approves after a few minutes' option is set in the Google Play overlay.
  6. Purchase
  7. Observe the error in logcat.

@britzl
Copy link
Collaborator

britzl commented Nov 7, 2023

7. Observe the error in logcat.

I tried reproducing this issue using the instructions above but to no avail. Here's me being it:

11-07 23:56:29.979 24424 24424 D IapGooglePlay: billingResponseCodeToDefoldResponse: 0 defoldResponse: 0
11-07 23:56:29.979 24424 24424 D IapGooglePlay: convertPurchase() original json: {"orderId":"GPA.3381-8816-4353-20615","packageName":"com.defold.extension.iap","productId":"com.defold.iap.goldbar.small","purchaseTime":1699397788166,"purchaseState":4,"purchaseToken":"hbalapelmcaccckkiidohkpo.AO-J1OyCmHpgSbma5UVLk27munHw8ERPvjoSwxMs99-S_wpCSs1sQnTBR6rdXud8hUIPCt5z3-owy6WHtyrff66Yac8GK30NdlBW1R3KWYIewMj5nrktvSQ","quantity":1,"acknowledged":false}

And one minute later when the transaction goes though I get this:;

11-07 23:57:30.825 24424 24424 D IapGooglePlay: billingResponseCodeToDefoldResponse: 0 defoldResponse: 0
11-07 23:57:30.825 24424 24424 D IapGooglePlay: convertPurchase() original json: {"orderId":"GPA.3381-8816-4353-20615","packageName":"com.defold.extension.iap","productId":"com.defold.iap.goldbar.small","purchaseTime":1699397788166,"purchaseState":0,"purchaseToken":"hbalapelmcaccckkiidohkpo.AO-J1OyCmHpgSbma5UVLk27munHw8ERPvjoSwxMs99-S_wpCSs1sQnTBR6rdXud8hUIPCt5z3-owy6WHtyrff66Yac8GK30NdlBW1R3KWYIewMj5nrktvSQ","quantity":1,"acknowledged":false}

I do not see any erros or warnings in logcat during this process. Anything in particular l should look out for?

@jcbk101
Copy link

jcbk101 commented Jul 7, 2024

  1. Observe the error in logcat.

I tried reproducing this issue using the instructions above but to no avail. Here's me being it:

11-07 23:56:29.979 24424 24424 D IapGooglePlay: billingResponseCodeToDefoldResponse: 0 defoldResponse: 0
11-07 23:56:29.979 24424 24424 D IapGooglePlay: convertPurchase() original json: {"orderId":"GPA.3381-8816-4353-20615","packageName":"com.defold.extension.iap","productId":"com.defold.iap.goldbar.small","purchaseTime":1699397788166,"purchaseState":4,"purchaseToken":"hbalapelmcaccckkiidohkpo.AO-J1OyCmHpgSbma5UVLk27munHw8ERPvjoSwxMs99-S_wpCSs1sQnTBR6rdXud8hUIPCt5z3-owy6WHtyrff66Yac8GK30NdlBW1R3KWYIewMj5nrktvSQ","quantity":1,"acknowledged":false}

And one minute later when the transaction goes though I get this:;

11-07 23:57:30.825 24424 24424 D IapGooglePlay: billingResponseCodeToDefoldResponse: 0 defoldResponse: 0
11-07 23:57:30.825 24424 24424 D IapGooglePlay: convertPurchase() original json: {"orderId":"GPA.3381-8816-4353-20615","packageName":"com.defold.extension.iap","productId":"com.defold.iap.goldbar.small","purchaseTime":1699397788166,"purchaseState":0,"purchaseToken":"hbalapelmcaccckkiidohkpo.AO-J1OyCmHpgSbma5UVLk27munHw8ERPvjoSwxMs99-S_wpCSs1sQnTBR6rdXud8hUIPCt5z3-owy6WHtyrff66Yac8GK30NdlBW1R3KWYIewMj5nrktvSQ","quantity":1,"acknowledged":false}

I do not see any erros or warnings in logcat during this process. Anything in particular l should look out for?

Hello,

Have you tried this issue with slow card, always decline? I receive the initial "Pending..." message, but the decline message never arrives.

The successful purchase version works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants