blackberry / BB10-WebWorks-Framework

The BB10 WebWorks Framework is packaged within an application BAR file to run on a BB10 device (or simulator)
61 stars 34 forks source link

blackberry.payment.checkExisting() for SKU claiming virtual good not purchased #638

Open achan opened 11 years ago

achan commented 11 years ago

I'm using the payment api as follows:

...
restoreVirtualGood: function() {
  var onsuccess = function(data) {
    if (data.subscriptionExists) {
      // user purchased virtual good!
    }
  };

  var onfailure = function(error) {
    // could not restore
  };

  blackberry.payment.checkExisting({ sku: 'VRTLGD-002' }, onsuccess, onfailure);
},
...

And it appears to always return false for data.subscriptionExists. I've also noticed that all examples/unit tests for blackberry.payment.checkExisting() pass an ID instead of an SKU... so I have seen no proof of this method working with an SKU. Can I have some confirmation that this method works with an SKU? Perhaps add a unit test?

I'm not sure if using an id instead will fix my problem... and I'm not sure how I can verify it without submitting to the App World. Any suggestions?

kwallis commented 11 years ago

cc @rwmtse Any thoughts?

rwmtse commented 11 years ago

@scdowney Do you have any suggestions?

scdowney commented 11 years ago

This is a defect in the underlying payment service, that is on our backlog.

Currently, checkExisting will always return false for non-subscription digital goods. The desired behavior is to return true for regular goods, true for subscription goods that are currently valid, but false otherwise.

kwallis commented 11 years ago

I assume once the payment service is fixed that this API will just work appropriately? I.e. no API or client side changes required?


This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.

achan commented 11 years ago

How do we check for check for existing purchased goods in the meantime? Would getExistingPurchases return regular goods or does it suffer from the same defect?

scdowney commented 11 years ago

@kwallis that is correct. whenever the fix goes out, the API will work as expected.

@achan getExistingPurchases will indeed have the information, so you can use that in the meantime.

achan commented 11 years ago

@scdowney Thank you!

What's the ideal way to test this? Should I just stub the payment service? Or is there a better way?

scdowney commented 11 years ago

Unfortunately there isn't really any exact way to test that functionality. Even for sandbox mode apps, as far as I know, checkExisting won't work as expected for purchased goods/subscriptions (since in this environment purchases are not charged).

Using local/development mode, checkExisting should always return true.

In order to fully test different digital good/subscription good states, you may need to stub out to provide the desired information in checkExisting and/or getExistingPurchases responses.

achan commented 11 years ago

Thanks. I'll carry on from here.

I'll leave it up to you guys whether you consider this issue closed or not...