Start gift card transactions with CreateSpecialTender

Class

Name Description
MerchantPed Extends  AdyenPed.  Class used to implement all PIN entry device (PED) functionality.

Special tender parameter 

Name

Type

Description

specialTender

SpecialTender

Holds tender attributes.

Use the SpecialTenderBuilder to create the SpecialTender object:

private SpecialTender buildSpecialTender() {

        SpecialTender specialTender = new SpecialTender(merchantAccount,

                merchantReference,

                "balanceInquiry",

                "goldsmithscard",

                currency,

                amount);

        return specialTender;

    }
 
 
SpecialTender specialTender = buildSpecialTender();

Instantiate special tender options

Name

Type

Description

specialOptions

SpecialOptions

Holds tender attributes.

Parameters

Name Type Required Description
transactionType String (tick)

Type of gift card transaction (Redeem, which uses a card balance to pay for an item, Load, which loads a balance to a card, and Balance Inquiry which returns the current balance of the card). TransactionType takes the following values:

  • redeem
  • load
  • balanceInquiry
paymentMethodType String (tick)

The type of payment method, in this case gift cards, for example: Givex, SVS, EagleEye. PaymentMethodType takes the following values:

  • givex
  • svs
shopperReference

String

(error)

Shopper identification (used for omni-channel digital customer recognition).

shopperEmail

String

(error)

Shopper identification (used for omni-channel digital customer recognition).
merchantAccount String (tick)

The transaction reference provided by the Merchant (reported in the Adyen payments platform).

merchantReference

String

(tick)

The transaction reference provided by the Merchant (reported in the Adyen payments platform).

currency long (tick) The transaction currency.
amount

String

(tick)

The transaction amount in minor units (100 is 1.00 with EUR). The Amount field should be a strong typed field with a string for currency code and a number (long) for the minor digits value (similar to the current API (of the terminal)).

specialOptions SpecialTenderOptions (error)

Holds tender attributes.

Activate, load, or refund a balance to a card by creating a special tender and passing the following values as the loadType in special options:
  • activate - Activates a gift card.
  • load - Loads a balance to a gift card.
  • merchandise_return - Load a refund balance back on to a gift card. This uses the same functionally as a load but is separated for accounting purposes.

The activate and load values can be piped to chain the tasks by passing "activate|load".

Perform a cash back or deactivate a card by creating a special tender and passing a redemptionType as a special option. 
  • cashback - Cash out the value of a gift card. For SVS, you must create a zero-value transaction to cash out the entire balance of a card. You can not cash out a specific amount.
  • deactivate - Deactivates a gift card.  (Deactivate is not available for SVS).

  • gratuity - Used to provide a tip from a gift card. (For SVS cards only).

The cashback and deactivate values can be piped to chain the tasks by passing  "cashback|deactivate".

handleReceipt Boolean (tick)

Specifies that the POS handles and prints receipts. If omitted, it is required that the PED prints the receipt. If there is no printer unit, the transaction will fail.

Instantiate specialOptions by assigning it to the result of the SpecialTender getter specialtender.getSpecialOptions()

SpecialOptions specialOptions = specialTender.getSpecialOptions();

Entry modes

The gift card can be presented on three ways: 

  1. Swipe: The gift card is read through a magnetic stripe.
  2. MKE on PED: The card number is manually entered on the payment terminal (PED). The tender should specify that it expects keyed entry on the terminal, and a card mask should be provided.
  3. MKE on POS: Scan a barcode on the back of the card from the Cash register application (POS). In this scenario, the card number, card mask and expiry should be provided in special options.

You can specify entry modes by passing special tender options. See Gift Card Matrix

Use put to set special options

Name Description

specialOptions.put

Allows you to add a special option as a key value pair.

Add special options parameters to the specialTender using the specialOptions.put method. 

Name Type Required Description
cardNumber  String (error)

The scanned number from the gift card. If this number:

  • Is passed from the POS, Keyed Entry will not be triggered on the PED.
  • Is not passed from the POS Keyed Entry will be triggered on the PED.
forceEntryMode String (tick)

The entry mode for the transaction.

You can select from two entry modes:

  • Keyed - on the PED or POS
  • Magstripe - Use the magnetic stripe from the card
specialOptions.put("cardNumber", "60362821657200117610");

Call the method

Name Description

runSpecialTenderSync

Creates a tender using a number of attributes.

ped.runSpecialTenderSync(specialTender);

Determine the current and final tender state

Adyen provides a method to determine the current, or final, tender state. For more information, see Determine the current and final tender state - JNI.

Callbacks

Name

Description
tenderPrintReceiptCallback Returns the receipt for printing, and requests that the POS confirms it has received the receipt.
progressCallback Reports the progress on a running tender
finalCallback When the system finishes processing the tender, it triggers the final state callback.