Skip to main content
Vindicia Knowledge Center

GiftCard.statusInquiry

GiftCard.statusInquiry

GiftCard.statusInquiry

The statusInquiry method causes CashBox to check with the gift card processor to learn the latest status of an input GiftCard. CashBox populates the status attribute in the GiftCard object it returns in response. Call this method before redeeming a gift card. If the status is Active, the gift card is redeemable.

Input

srd: sparse response description, a SOAP string (which must be a JSON object), in which you specify the elements you want returned.This parameter enables the calling system to constrain a method call to return only components you specify. This gives you greater control over returned content, and improves response time within the Vindicia platform by reducing the processing needed for the call.

Some fields are required, either practically or in the WSDL, and will be returned regardless of the srd. A null srd returns the complete response.

giftCard: the GiftCard object for which you want a status check. If this is a new gift card, be certain to specify the pin attribute. If this is an existing GiftCard object, you may specify only the VID attribute.

Output

return: an object of type Return that indicates the success or failure of the call.

giftcard: the GiftCard object requested, with an updated status.

Returns

In addition to those listed in Standard Return Codes, this call returns:

Return Code

Return String

400

Gift Card could not be saved prior to status. Status Inquiry attempt failed error-description.

Example

$gc = new GiftCard();

// set the PIN provided by the customer

$gc->setPin('683092298403');
$gc->setPaymentProvider('InComm');

// Now make API call to check the status of the gift card

$response = $gc->statusInquiry();
if($response['returnCode'] == 200) {

// The API call is successful. Now check the
// status in the updated GiftCard object returned by this call

$updatedGc = $response['data']->giftcard;
$status = $updatedGc->getStatus();

// the status thus obtained is an object of type GiftCardStatus
// Now check if it indicates gift card is redeemable

if ($status->getStatus() == 'Active') {

// The gift card is redeemable, so retrieve its VID
// so that we can reference it just by VID when we redeem it

$gcVID = $updatedGc->getVID();

}

else {

// Gift card is not redeemable. Inform the customer here
// You may want to include the response received from the gift
// card processor

$responseCode = $status->getProviderResponseCode();
$responseMsg = $status->getProviderResponseMessage();

}

}

For Users

Learn More
For Users

Cashbox Features

Learn More
Cashbox Features
Back to Top