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

The user loss money, but on the side of the application, he does not receive a reward #463

Closed
abaddonGIT opened this issue Apr 25, 2019 · 4 comments
Labels
🙏 help wanted Extra attention is needed 📱 iOS Related to iOS

Comments

@abaddonGIT
Copy link

abaddonGIT commented Apr 25, 2019

Hi! I have a problem. Now payment process looks like that

try {
      await RNIap.clearTransaction();
    } catch (error) {
      this.ahoy.track('Clear transaction', { error });
    }
    try {
      // start transaction with out finished
      const purchase = await RNIap.buyProductWithoutFinishTransaction(productId);
      this.ahoy.track('Init purchases info:', { purchase });
      // add user points
      __onPurchase(productId, purchase, null);
      // validation purchase
      await this.isValid(purchase);
      // try to finish transaction
      try {
        await RNIap.finishTransaction();
      } catch (error) {
        this.ahoy('Transaction not finished:', { purchase });
      }
    } catch (error) {
      clearTimeout(this.closeDelay);
      this.closeDelay = setTimeout(() => {
        __onPurchase(productId, null, error);
      }, 500);
    }

But at the same time, some users complain that they have money written off from the card but they do not receive the purchased reward. This can occur if an error ({"NSLocalizedDescription":"Cannot connect to iTunes Store"}) occurs in RNIap.buyProductWithoutFinishTransaction, but I don't understand why the money deducted without calling RNIap.finishTransaction.
Tell me what I'm doing wrong?

Version of react-native-iap

2.4.9

Version of react-native

0.57.8

Platforms you faced the error (IOS or Android or both?)

IOS

Tested environment (Emulator? Real Device?)

Real Device

@hyochan hyochan added 🙏 help wanted Extra attention is needed 📱 iOS Related to iOS labels Apr 25, 2019
@hyochan
Copy link
Member

hyochan commented Apr 25, 2019

Please see guide code to prevent such issue. What you are using is quite old detail which we've removed from the readme. You can see related issue in #307 which we've solved in #348.

@hyochan hyochan closed this as completed Apr 25, 2019
@tonycoco
Copy link

@hyochan why is this flow part of the README still then?

@hyochan
Copy link
Member

hyochan commented May 15, 2019

@tonycoco Could you explain further?

@tonycoco
Copy link

https://github.com/dooboolab/react-native-iap#ios-purchasing-process-right-way calls RNIap.finishTransaction right? I guess my question is what is the "old detail" that you are speaking of?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🙏 help wanted Extra attention is needed 📱 iOS Related to iOS
Projects
None yet
Development

No branches or pull requests

3 participants