0

Please include: I buy the product but I can not buy it the second time.

I use devextreme;

Your code / steps to reproduce

 inAppPurchase
  .buy(urunID)
  .then(function (data) {
    return inAppPurchase.consume(data.type, data.receipt, data.signature);
  })
  .then(function () {
    alert("Satın alma Başarılı");
  })
  .catch(function (err) {
    alert("Başarısız! "+ err);
  });
Cœur
  • 37,241
  • 25
  • 195
  • 267
zafer
  • 29
  • 7

1 Answers1

0

Friends can solve this problem with a different plugin:

Plugin:

   Cordova plugin add cordova-plugin-inapppurchase

Manifest.json

{ "play_store_key": "YOUR PLAY STORE KEY" }

LoadProducs function

var productIds=['com.company.app.product1','com.company.app.product2'];
inAppPurchase
 .getProducts(productIds)
 .then(function (products) {

//products ok 
})
 .catch(function (err) {

  console.log(err);
});

buy function

 var productId='com.company.app.product1';
         inAppPurchase
       .buy(productId)
       .then(function (data) {
         console.log(JSON.stringify(data));
         // The consume() function should only be called after purchasing consumable products
         // otherwise, you should skip this step
         return inAppPurchase.consume(data.type, data.receipt, data.signature);
       })
       .then(function () {
         console.log('consume done!');
         //purchase ok
       })
       .catch(function (err) {
         console.log(err);
       });
zafer
  • 29
  • 7