-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #93 from cb-haripriyan/billing-library-5
Changes for Billing library 5
- Loading branch information
Showing
29 changed files
with
501 additions
and
266 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
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
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
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
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
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
58 changes: 58 additions & 0 deletions
58
app/src/main/java/com/chargebee/example/adapter/PurchaseProduct.java
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 |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package com.chargebee.example.adapter; | ||
|
||
import com.chargebee.android.models.CBProduct; | ||
import com.chargebee.android.models.PricingPhase; | ||
import com.chargebee.android.models.SubscriptionOffer; | ||
|
||
public class PurchaseProduct { | ||
private final String productId; | ||
private final CBProduct cbProduct; | ||
private final String basePlanId; | ||
private final String offerId; | ||
private final String offerToken; | ||
private final String price; | ||
|
||
public PurchaseProduct(CBProduct cbProduct, SubscriptionOffer subscriptionOffer) { | ||
this(cbProduct.getId(), cbProduct, subscriptionOffer.getBasePlanId(), subscriptionOffer.getOfferId(), | ||
subscriptionOffer.getOfferToken(), subscriptionOffer.getPricingPhases().get(0).getFormattedPrice()); | ||
} | ||
|
||
public PurchaseProduct(CBProduct cbProduct, PricingPhase oneTimePurchaseOffer) { | ||
this(cbProduct.getId(), cbProduct, | ||
null, null, | ||
null, oneTimePurchaseOffer.getFormattedPrice()); | ||
} | ||
|
||
public PurchaseProduct(String id, CBProduct cbProduct, String basePlanId, String offerId, String offerToken, String formattedPrice) { | ||
this.productId = id; | ||
this.cbProduct = cbProduct; | ||
this.basePlanId = basePlanId; | ||
this.offerId = offerId; | ||
this.offerToken = offerToken; | ||
this.price = formattedPrice; | ||
} | ||
|
||
public String getProductId() { | ||
return productId; | ||
} | ||
|
||
public String getBasePlanId() { | ||
return basePlanId; | ||
} | ||
|
||
public String getOfferId() { | ||
return offerId; | ||
} | ||
|
||
public String getOfferToken() { | ||
return offerToken; | ||
} | ||
|
||
public String getPrice() { | ||
return price; | ||
} | ||
|
||
public CBProduct getCbProduct() { | ||
return cbProduct; | ||
} | ||
} |
Oops, something went wrong.