AlexDisler / cordova-plugin-inapppurchase

A lightweight cordova plugin for in app purchases on iOS/Android
316 stars 192 forks source link

How reverse pay in-app purchase IOS #273

Open christiantigre opened 5 years ago

christiantigre commented 5 years ago

how I can return or reverse a payment, How is the method?? is

Your code / steps to reproduce

 restore in app purchase (required)
  restoreMembership( id ) {

    this.productId = id;

    this.iap.restorePurchases().then( result => {

        // loop through purchases to find the one we are looking for
        for (var i = 0; i < result.length; ++i) {

          // TODO: check result[i].state for cancelled or refunded

          if( result[i].productId == this.productId ) {

            console.log( 'Purchase found! Do something...', result )

            return;

          }

        }

    })
    .catch( err => {
        console.log(err)
    })

  }
rbrand21 commented 4 years ago

Ever figure this out?