ZMObject
|
+--ZMCoupons
public class ZMCoupons
extends ZMObject
| 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. |
| 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. |
| Methods inherited from org.zenmagick.ZMObject | |
|---|---|
| backtrace, create, log, singleton | |
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 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.
Coupons.