iaphub / react-native-iaphub

The easiest way to implement IAP (In-app purchase) in your React Native app.
https://www.iaphub.com/
MIT License
319 stars 21 forks source link

Typescript error! #66

Closed dancixx closed 3 years ago

dancixx commented 3 years ago

Hi guys!

I would like refractor my payment method to ts, but i get an ts error in this section:

var transaction = await Iaphub.buy("pack10_tier15", {
    // Optional property to override the default proration mode on Android (https://developer.android.com/reference/com/android/billingclient/api/BillingFlowParams.ProrationMode)
    androidProrationMode: 1,
    // Optional callback triggered before the receipt is processed
    onReceiptProcess: (receipt) => {
      console.log('Purchase success, processing receipt...');
    }
  });

When i am checking the typedef receipt: IapHubReciept is ok, but androidPortraitMode: string, and the .buy function options object has no onRecieptProcess property. Do you give some advice, maybe something wrong or just a typedef bug?

iaphub commented 3 years ago

Hi @dancixx,

It seems like the 'onReceiptProcess' option was missing from the typescript definitions. I just updated the definitions in the new version 6.2.0, let me know if it works 🙂

dancixx commented 3 years ago

Thank you.