Skip to content

Commit

Permalink
Update README and store-android.md
Browse files Browse the repository at this point in the history
  • Loading branch information
j3k0 committed Jun 9, 2016
1 parent cb2f4f8 commit bef30f1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

## Summary

This plugin allows **In-App Purchases** to be made from **Cordova and PhoneGap** applications, on **Android**, **iOS** and **Windows** (Store/Phone 8.1)
This plugin allows **In-App Purchases** to be made from **Cordova and PhoneGap** applications, on **Android**, **iOS** and **Windows** (Store/Phone)

It lets you handle all platforms with a single codebase.

Expand Down Expand Up @@ -58,7 +58,7 @@ See [Setup iOS Applications](https://github.com/j3k0/cordova-plugin-purchase/wik
- **iOS** version 6.0 or higher.
- **Android** version 2.2 (API level 8) or higher
- with Google Play client version 3.9.16 or higher
- **Windows** Store/Phone 8.1
- **Windows** Store/Phone 8.1 or higher

## Extensions

Expand Down
10 changes: 6 additions & 4 deletions www/store-android.js
Original file line number Diff line number Diff line change
Expand Up @@ -2059,11 +2059,11 @@ InAppBilling.prototype.subscribe = function (success, fail, productId) {
}
return cordova.exec(success, errorCb(fail), "InAppBillingPlugin", "subscribe", [productId]);
};
InAppBilling.prototype.consumePurchase = function (success, fail, productId) {
InAppBilling.prototype.consumePurchase = function (success, fail, productId, transactionId) {
if (this.options.showLog) {
log('consumePurchase called!');
}
return cordova.exec(success, errorCb(fail), "InAppBillingPlugin", "consumePurchase", [productId]);
return cordova.exec(success, errorCb(fail), "InAppBillingPlugin", "consumePurchase", [productId, transactionId]);
};
InAppBilling.prototype.getAvailableProducts = function (success, fail) {
if (this.options.showLog) {
Expand Down Expand Up @@ -2254,7 +2254,6 @@ store.when("requested", function(product) {
if (product.type === store.FREE_SUBSCRIPTION || product.type === store.PAID_SUBSCRIPTION) {
method = 'subscribe';
}

store.inappbilling[method](function(data) {
// Success callabck.
//
Expand Down Expand Up @@ -2301,6 +2300,7 @@ store.when("requested", function(product) {
store.when("product", "finished", function(product) {
store.log.debug("plugin -> consumable finished");
if (product.type === store.CONSUMABLE || product.type === store.NON_RENEWING_SUBSCRIPTION) {
var transaction = product.transaction;
product.transaction = null;
store.inappbilling.consumePurchase(
function() { // success
Expand All @@ -2314,7 +2314,9 @@ store.when("product", "finished", function(product) {
message: err
});
},
product.id);
product.id,
transaction.id
);
}
else {
product.set('state', store.OWNED);
Expand Down

0 comments on commit bef30f1

Please sign in to comment.