-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
4 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -164,7 +164,7 @@ const customer: Customer = { | |
lastName: 'lname', | ||
email: '[email protected]', | ||
}; | ||
const productType = ProductType.non_consumable | ||
const productType = ProductType.NON_CONSUMABLE | ||
try { | ||
const result: OneTimePurchase = await Chargebee.purchaseNonSubscriptionProduct("product-id", productType, customer); | ||
console.log(result); | ||
|
@@ -177,7 +177,7 @@ The given code defines a function named `purchaseNonSubscriptionProduct` in the | |
|
||
- `product`: An instance of `Product` class, representing the product to be purchased from the Apple App Store or Google Play Store. | ||
- `customer`: Optional. An instance of `CBCustomer` class, initialized with the customer's details such as `customerId`, `firstName`, `lastName`, and `email`. | ||
- `productType`: An enum instance of `productType` type, indicating the type of product to be purchased. It can be either .`consumable`, or `non_consumable`, or `non_renewing_subscription`. Note that `non_renewing_subscription` is supported only in Apple App Store. | ||
- `productType`: An enum instance of `productType` type, indicating the type of product to be purchased. It can be either .`consumable`, or `non_consumable`, or `non_renewing_subscription` Note that `non_renewing_subscription` is supported only in Apple App Store. | ||
|
||
The function is called asynchronously, and it returns a `Result` object with a `success` or `failure` case, as mentioned are below. | ||
- If the purchase is successful, it returns `OneTimePurchase` object. which includes the `invoiceId`, `chargeId`, and `customerId` associated with the purchase. | ||
|
@@ -324,7 +324,7 @@ const customer: Customer = { | |
lastName: 'lname', | ||
email: '[email protected]', | ||
}; | ||
const productType = ProductType.non_consumable | ||
const productType = ProductType.NON_CONSUMABLE | ||
try { | ||
const result: OneTimePurchase = await Chargebee.validateReceiptForNonSubscriptions(productId, productType, customer) | ||
} catch (error) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters