Script: Class dw.order.GiftCertificate

Class GiftCertificate

Represents a Gift Certificate that can be used to purchase products.

Constants

STATUS_ISSUED : Number=1

Represents a status of 'issued', which indicates that the Gift Certificate has been created and that it can be used to purchase products.

STATUS_PARTIALLY_REDEEMED : Number=2

Represents a status of 'partially redeemed', which indicates that the Gift Certificate has been used to purchase products, but that there is still a balance on the gift certificate.

STATUS_PENDING : Number=0

Represents a status of 'pending', which indicates that the Gift Certificate has been created but that it cannot be used yet.

STATUS_REDEEMED : Number=3

Represents a status of 'redeemed', which indicates that the Gift Certificate has been used and no longer contains a balance.

Properties

amount : Money Read Only

The original amount on the gift certificate.

balance : Money Read Only

The balance on the gift certificate.

description : String

The description string.

enabled : boolean

Returns true if the Gift Certificate is enabled, false otherwise.

giftCertificateCode : String Read Only

The code of the gift certificate. This redemption code is send to gift certificate recipient.

ID : String Read Only

The code of the gift certificate. This redemption code is send to gift certificate recipient.

Deprecated:

Use getGiftCertificateCode()

maskedGiftCertificateCode : String Read Only

The masked gift certificate code with all but the last 4 characters replaced with a '*' character.

merchantID : String Read Only

The merchant ID of the gift certificate.

message : String

The message to include in the email of the person receiving the gift certificate.

orderNo : String

The order number

recipientEmail : String

The email address of the person receiving the gift certificate.

recipientName : String

The name of the person receiving the gift certificate.

senderName : String

The name of the person or organization that sent the gift certificate or null if undefined.

status : Number

The status where the possible values are STATUS_PENDING, STATUS_ISSUED, STATUS_PARTIALLY_REDEEMED or STATUS_REDEEMED.

Constructor Summary

This class does not have a constructor, so you cannot create it directly.

Method Summary

getAmount() : Money

Returns the original amount on the gift certificate.

getBalance() : Money

Returns the balance on the gift certificate.

getDescription() : String

Returns the description string.

getGiftCertificateCode() : String

Returns the code of the gift certificate.

getID() : String

Returns the code of the gift certificate.

getMaskedGiftCertificateCode() : String

Returns the masked gift certificate code with all but the last 4 characters replaced with a '*' character.

getMaskedGiftCertificateCode(ignore : Number) : String

Returns the masked gift certificate code with all but the specified number of characters replaced with a '*' character.

getMerchantID() : String

Returns the merchant ID of the gift certificate.

getMessage() : String

Returns the message to include in the email of the person receiving the gift certificate.

getOrderNo() : String

Returns the order number

getRecipientEmail() : String

Returns the email address of the person receiving the gift certificate.

getRecipientName() : String

Returns the name of the person receiving the gift certificate.

getSenderName() : String

Returns the name of the person or organization that sent the gift certificate or null if undefined.

getStatus() : Number

Returns the status where the possible values are STATUS_PENDING, STATUS_ISSUED, STATUS_PARTIALLY_REDEEMED or STATUS_REDEEMED.

isEnabled() : boolean

Returns true if the Gift Certificate is enabled, false otherwise.

setDescription(description : String) : void

An optional description that you can use to categorize the gift certificate.

setEnabled(enabled : boolean) : void

Controls if the Gift Certificate is enabled.

setMessage(message : String) : void

Sets the message to include in the email of the person receiving the gift certificate.

setOrderNo(orderNo : String) : void

Sets the order number

setRecipientEmail(recipientEmail : String) : void

Sets the email address of the person receiving the gift certificate.

setRecipientName(recipient : String) : void

Sets the name of the person receiving the gift certificate.

setSenderName(sender : String) : void

Sets the name of the person or organization that sent the gift certificate.

setStatus(status : Number) : void

Sets the status of the gift certificate.

Methods inherited from class ExtensibleObject

describe, getCustom

Methods inherited from class PersistentObject

getCreationDate, getLastModified, getUUID

Methods inherited from class Object

assign, create, create, defineProperties, defineProperty, entries, freeze, fromEntries, getOwnPropertyDescriptor, getOwnPropertyNames, getOwnPropertySymbols, getPrototypeOf, hasOwnProperty, is, isExtensible, isFrozen, isPrototypeOf, isSealed, keys, preventExtensions, propertyIsEnumerable, seal, setPrototypeOf, toLocaleString, toString, valueOf, values

Method Detail

getAmount

getAmount() : Money

Returns the original amount on the gift certificate.

Returns:

the original amount on the gift certificate.

getBalance

getBalance() : Money

Returns the balance on the gift certificate.

Returns:

the balance on the gift certificate.


getDescription

getDescription() : String

Returns the description string.

Returns:

the description.


getGiftCertificateCode

getGiftCertificateCode() : String

Returns the code of the gift certificate. This redemption code is send to gift certificate recipient.

Returns:

the code of the gift certificate.


getID

getID() : String

Returns the code of the gift certificate. This redemption code is send to gift certificate recipient.

Deprecated:

Use getGiftCertificateCode()

Returns:

the code of the gift certificate.


getMaskedGiftCertificateCode

getMaskedGiftCertificateCode() : String

Returns the masked gift certificate code with all but the last 4 characters replaced with a '*' character.

Returns:

the masked gift certificate code.


getMaskedGiftCertificateCode

getMaskedGiftCertificateCode(ignore : Number) : String

Returns the masked gift certificate code with all but the specified number of characters replaced with a '*' character.

Parameters:

ignore - the number of characters to leave unmasked.

Returns:

the masked gift certificate code.

Throws:

IllegalArgumentException - if ignore is negative.


getMerchantID

getMerchantID() : String

Returns the merchant ID of the gift certificate.

Returns:

the merchant ID of the gift certificate.


getMessage

getMessage() : String

Returns the message to include in the email of the person receiving the gift certificate.

Returns:

the message to include in the email of the person receiving the gift certificate.


getOrderNo

getOrderNo() : String

Returns the order number

Returns:

the order number


getRecipientEmail

getRecipientEmail() : String

Returns the email address of the person receiving the gift certificate.

Returns:

the email address of the person receiving the gift certificate.


getRecipientName

getRecipientName() : String

Returns the name of the person receiving the gift certificate.

Returns:

the name of the person receiving the gift certificate.


getSenderName

getSenderName() : String

Returns the name of the person or organization that sent the gift certificate or null if undefined.

Returns:

the name of the person or organization that sent the gift certificate or null if undefined.


getStatus

getStatus() : Number

Returns the status where the possible values are STATUS_PENDING, STATUS_ISSUED, STATUS_PARTIALLY_REDEEMED or STATUS_REDEEMED.

Returns:

the status.


isEnabled

isEnabled() : boolean

Returns true if the Gift Certificate is enabled, false otherwise.

Returns:

true if the Gift Certificate is enabled, false otherwise.


setDescription

setDescription(description : String) : void

An optional description that you can use to categorize the gift certificate.

Parameters:

description - additional description.


setEnabled

setEnabled(enabled : boolean) : void

Controls if the Gift Certificate is enabled.

Parameters:

enabled - if true, enables the Gift Certificate.


setMessage

setMessage(message : String) : void

Sets the message to include in the email of the person receiving the gift certificate.

Parameters:

message - the message to include in the email of the person receiving the gift certificate.


setOrderNo

setOrderNo(orderNo : String) : void

Sets the order number

Parameters:

orderNo - the order number to be set


setRecipientEmail

setRecipientEmail(recipientEmail : String) : void

Sets the email address of the person receiving the gift certificate.

Parameters:

recipientEmail - the email address of the person receiving the gift certificate.


setRecipientName

setRecipientName(recipient : String) : void

Sets the name of the person receiving the gift certificate.

Parameters:

recipient - the name of the person receiving the gift certificate.


setSenderName

setSenderName(sender : String) : void

Sets the name of the person or organization that sent the gift certificate.

Parameters:

sender - the name of the person or organization that sent the gift certificate.


setStatus

setStatus(status : Number) : void

Sets the status of the gift certificate.
Possible values are: STATUS_ISSUED, STATUS_PENDING, STATUS_PARTIALLY_REDEEMED and STATUS_REDEEMED.

Parameters:

status - Gift certificate status