Skip to content

v13.1.3

Compare
Choose a tag to compare
@j3k0 j3k0 released this 07 Sep 14:04
· 172 commits to master since this release
a326912

Fixing some receipt validation use cases on Apple devices.

  • 9cfce2d Load missing iOS appStoreReceipt when validation call is requested
  • 2569147 Update validator functions to include the receipts
  • f03a751 Refresh appStoreReceipt if empty at validation stage

Update to requestPayment()

In the payment request, the items array now replace the productIds array. Use this array to define the list of items the user is paying for. For example:

CdvPurchase.store.requestPayment({
  platform: CdvPurchase.Platform.BRAINTREE,
  amountMicros: 11000000,
  currency: 'USD',
  items: [{
    id: 'margherita_large',
    title: 'Pizza Margherita Large',
    pricing: {
      priceMicros: 10000000,
    }
  }, {
    id: 'delivery_standard',
    title: 'Delivery',
    pricing: {
      priceMicros: 1000000,
    }
  }]
});

The format for items makes them compatible with products loaded from the stores. You can then manage your inventory on Google Play but allow payment for those Google Play products using Braintree:

store.register([{
  id: 'five_tokens',
  type: ProductType.CONSUMABLE
  platform: Platform.GOOGLE_PLAY,
}]);

// Later on...
store.requestPayment({
  platform: CdvPurchase.Platform.BRAINTREE,
  amountMicros: 11000000,
  currency: 'USD',
  items: [store.get('five_tokens')],
});

See PaymentRequest and PaymentRequestItem for details.

Fixes for Braintree.requestPayment()

Bug fixes:

  • Properly using the provided applePayOptions
  • Detecting payment request cancellations by user

requestPayment() amount computed from items

If the amount is not provided in a payment request, it will be computed as the sum of all items.

Currency will also be retrieved from the items when missing.