ZMObject
|
+--ZMCoupons
public class ZMCoupons
extends ZMObject
| Field Summary | |
|---|---|
| final mixed | |
| final mixed | |
| final mixed | |
| final mixed | |
| final mixed | |
| final mixed | |
| Fields inherited from org.zenmagick.ZMObject | |
|---|---|
| properties_ | |
| Constructor Summary | |
|---|---|
Create new instance. |
|
| Method Summary | |
|---|---|
| ZMCoupon | createCoupon(mixed couponCode, float amount, string type, int accountId) Create a new coupon. |
| string | createCouponCode(string salt, int length) Create a new coupon code. |
| void | createCouponTracker(ZMCoupon coupon, ZMAccount account, ZMGVReceiver gvreceiver) Create a new coupon tracker record. |
| void | creditCoupon(int couponId, int accountId) Credit coupon for account. |
| void | finalizeCoupon(int couponId, int accountId, string remoteIp) Finalize a coupon. |
| ZMCoupon | getCouponForCode(string code, int languageId) Coupon lookup for the given code. |
| ZMCoupon | getCouponForId(int id, int languageId) Coupon lookup for the given id. |
| ZMCouponQueue | getCouponQueueEntryForId(int queueId) Get a coupon queue entry. |
| ZMCouponRestrictions | getRestrictionsForCouponId(mixed couponId, int id) Load coupon restrictions for the given coupon id. |
| float | getVoucherBalanceForAccountId(int accountId) Get the coupon/voucher balance for the given account. |
| static void | instance() Get instance. |
| boolean | isCouponRedeemable(string couponId) Check if a given coupon code can be redeemed. |
| void | redeemCoupon(int couponId, int accountId, string remoteIp) Redeem a coupon. |
| void | setVoucherBalanceForAccountId(int accountId, float amount) Update the coupon/coucher balance for the given account id. |
| protected void | updateVoucherBalanceForAccountId(int accountId, float amount, string mode) Update the coupon/coucher balance for the given account id. |
| Methods inherited from org.zenmagick.ZMObject | |
|---|---|
| attachMethod, get, getAttachedMethods, getPropertyNames, set, singleton | |
public final mixed BALANCE_ADD = 'balance_add'
public final mixed BALANCE_SET = 'balance_set'
public final mixed TYPPE_FIXED = 'F'
public final mixed TYPPE_GV = 'G'
public final mixed TYPPE_PERCENT = 'P'
public final mixed TYPPE_SHIPPING = 'S'
public ZMCoupons()
Create new instance. /
public ZMCoupon createCoupon(mixed couponCode, float amount, string type, int accountId)
Create a new coupon.
ZMCoupon instance or null.public string createCouponCode(string salt, int length)
Create a new coupon code.
public void createCouponTracker(ZMCoupon coupon, ZMAccount account, ZMGVReceiver gvreceiver)
Create a new coupon tracker record.
public void creditCoupon(int couponId, int accountId)
Credit coupon for account.
public void finalizeCoupon(int couponId, int accountId, string remoteIp)
Finalize a coupon.
public ZMCoupon getCouponForCode(string code, int languageId)
Coupon lookup for the given code.
null for session language.ZMCoupon instance or null.public ZMCoupon getCouponForId(int id, int languageId)
Coupon lookup for the given id.
null for session language.ZMCoupon instance or null.public ZMCouponQueue getCouponQueueEntryForId(int queueId)
Get a coupon queue entry.
null.public ZMCouponRestrictions getRestrictionsForCouponId(mixed couponId, int id)
Load coupon restrictions for the given coupon id.
public float getVoucherBalanceForAccountId(int accountId)
Get the coupon/voucher balance for the given account.
0.public static void instance()
Get instance. /
public boolean isCouponRedeemable(string couponId)
Check if a given coupon code can be redeemed.
true if the coupon can be redeemed, false if not.public void redeemCoupon(int couponId, int accountId, string remoteIp)
Redeem a coupon.
This will call finalizeCoupon(...) and creditCoupon(...).
public void setVoucherBalanceForAccountId(int accountId, float amount)
Update the coupon/coucher balance for the given account id.
protected void updateVoucherBalanceForAccountId(int accountId, float amount, string mode)
Update the coupon/coucher balance for the given account id.
BALANCE_SET or BALANCE_ADD.
Coupons.