public class Coupon extends InsertableEntity<Coupon>
| Modifier and Type | Class and Description |
|---|---|
static class |
Coupon.CouponTarget |
| Modifier and Type | Field and Description |
|---|---|
protected Coupon.CouponTarget |
appliesTo |
protected String |
appliesToID |
protected String |
couponCode |
protected Integer |
coupons |
protected String |
currency |
protected boolean |
deleted |
protected List<CouponDiscount> |
discounts |
protected String |
name |
protected String |
parentCouponCode |
protected boolean |
parentCouponCodeRedeemable |
protected String |
product |
protected String |
productID |
protected String |
productName |
protected String |
productRatePlan |
protected String |
productRatePlanID |
protected String |
productRatePlanName |
protected int |
quantity |
protected Integer |
remainingUses |
protected static ResourcePath |
resourcePath |
protected Integer |
used |
protected Integer |
uses |
protected Date |
validUntil |
m_client, PRETTY_PRINT_GSON| Constructor and Description |
|---|
Coupon() |
Coupon(BillForwardClient client_) |
Coupon(String productRateID_) |
Coupon(String product_,
String productRatePlan_) |
create, create, createExplicitPath, retire, retire, retire, retireExplicitPathprotected String name
protected String couponCode
protected Integer coupons
protected Integer uses
protected String product
protected String productRatePlan
protected String currency
protected boolean parentCouponCodeRedeemable
protected String productRatePlanName
protected String productRatePlanID
protected String productID
protected String productName
protected boolean deleted
protected List<CouponDiscount> discounts
protected String parentCouponCode
protected Coupon.CouponTarget appliesTo
protected String appliesToID
protected Integer remainingUses
protected Integer used
protected Date validUntil
protected int quantity
protected static ResourcePath resourcePath
public Coupon(BillForwardClient client_)
public Coupon()
public Coupon(String productRateID_)
public String getName()
public void setName(String name)
public String getCouponCode()
public int getCoupons()
public Coupon setCoupons(int coupons)
public int getUses()
public Coupon setUses(int uses)
public String getCurrencyAsString()
public Currency getCurrency()
public boolean isParentCouponCodeRedeemable()
public Coupon setParentCouponCodeRedeemable(boolean parentCouponCodeRedeemable)
public String getProductRatePlan()
public void setProductRatePlan(String productRatePlan)
public String getProductRatePlanName()
public void setProductRatePlanName(String productRatePlanName)
public String getProductRatePlanID()
public void setProductRatePlanID(String productRatePlanID)
public String getProductID()
public void setProductID(String productID)
public String getProductName()
public void setProductName(String productName)
public String getParentCouponCode()
public Coupon.CouponTarget getAppliesTo()
public String getAppliesToID()
public Integer getRemainingUses()
public Integer getUsed()
public Date getValidUntil()
public List<CouponDiscount> getDiscounts()
public Coupon addDiscount(CouponDiscount discount)
public Coupon removeDiscount(CouponDiscount discount)
public static Coupon create(Coupon coupon) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException
public static Coupon getByCode(String code) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException
public static Coupon[] getAll() throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException
protected ResourcePath getResourcePath()
getResourcePath in class BillingEntityprotected static ResourcePath ResourcePath()
public Coupon[] createUniqueCodes(int quantity) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException
public static Coupon[] createCouponCodes(String couponCode, int quantity) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException
public Coupon[] getCouponCodes() throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException
public static Coupon[] getCouponCodes(String couponCode) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException
public Coupon addPercentageDiscount(int percentOff)
public Coupon addCashDiscount(int discountAmount)
public Coupon addToSubscription(String subscriptionID) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException
public static Coupon addCouponCodeToSubscription(String couponCode, String subscriptionID) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException
public static Coupon[] getCouponsForSubscription(String subscriptionID) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException
public static Coupon removeCouponCode(String couponCode) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException
Copyright © 2015 BillForward. All rights reserved.