question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

iOS in-app purchase failure when payment method added live when there is not payment method already present

See original GitHub issue

Version of react-native-iap

react-native-iap": "^2.3.17

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

iOS

Expected behavior

Payment should go through only when finishTransaction is being called

Actual behavior

The amount is being detected after a payment method like credit card is added. But the RNIap.buyProductWithoutFinishTransaction(sku) method reached.

Tested environment (Emulator? Real Device?)

Real Device - iPhone 6s

Steps to reproduce the behavior

  • Check to ensure the Apple account in the device the payments method is set to none or some invalid payment details
  • Make the in-app purchase through the app
  • User is taken to the Account settings page to add a valid payment method
  • Payment method is charged but the transaction receipt is not received in the below mentioned code
ComponentDidMount(){
     await RNIap.initConnection();
     await RNIap.consumeAllItems();
     const prod = await RNIap.getProducts(product);

} 

  async componentWillUnmount() {
       RNIap.endConnection()
}

buyProduct(sku){
await RNIap.clearTransaction();

RNIap.buyProductWithoutFinishTransaction(sku)
.then(purchase => {
  // not reached
 if(calltoserverisSuccess){
    RNIap.finishTransaction();
 }
})
.catch(error => {
 // code enters catch case if ever
}}

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:27 (21 by maintainers)

github_iconTop GitHub Comments

12reactions
hyochancommented, Feb 25, 2019

I think we need to contact apple for this and this looks really terrible that there is a different test case which is not reproducible in sandbox environment. For those who want to understand the problem, I’ve recorded the screen and you can see the clip here. @anandwahed Could you also contact apple for this? Because I know they aren’t that supportive so it is better for more people to have contact with them. Let’s gather up to solve this issue.

4reactions
anandwahedcommented, Nov 1, 2018
Read more comments on GitHub >

github_iconTop Results From Across the Web

iOS in-app purchase failure when p… | Apple Developer Forums
iOS in-app purchase failure when payment method added live when there is not payment method already present.
Read more >
Fix - Apple iPhone Says Your Payment Method was Declined ...
Apple keeps saying my payment method was Declined in iOS 13, why my Apple ID Payment Method was Declined in iOS 15, how...
Read more >
Use a family payment method on Google Play
Family members can use the family payment method to make purchases on Google Play or in-app purchases through Google Play's billing system.
Read more >
Integrate the Google Play Billing Library into your app
Life of a purchase · Show the user what they can buy. · Launch the purchase flow for the user to accept the...
Read more >
In-App Purchasing Overview - Amazon Developer
The IAP API handles details about purchase flow, payment processing, providing a receipt to your app, and managing rights to the purchasable content,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found