{"title":"Start gift card transactions","category":"default","creationDate":1776961627,"content":"<h2>Class<\/h2>\n<table style=\"width:100%;\"><colgroup><col style=\"width: 4%\"><col style=\"width: 95%\"><\/colgroup><thead><tr class=\"header\"><th>Name<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td>\n<p><code>MerchantPed<\/code><\/p>\n<\/td><td>\n<p>Extends\u00a0 <code>AdyenPed<\/code>.\u00a0 Class used to implement all PIN entry device (PED) functionality.<\/p>\n<\/td><\/tr><\/tbody><\/table>\n<h2 id=\"special-tender-parameter\">Special tender parameter<\/h2>\n<table>\n<thead>\n<tr>\n<th>Name<\/th>\n<th>Type<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>specialTender<\/code><\/td>\n<td>SpecialTender<\/td>\n<td>Holds tender attributes.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Use the SpecialTenderBuilder to create the SpecialTender object:<\/p>\n<pre><code class=\"language-java\">private SpecialTender buildSpecialTender() {\n\n        SpecialTender specialTender = new SpecialTender(merchantAccount,\n\n                merchantReference,\n\n                \"balanceInquiry\",\n\n                \"goldsmithscard\",\n\n                currency,\n\n                amount);\n\n        return specialTender;\n\n    }\n\u00a0\nSpecialTender specialTender = buildSpecialTender();<\/code><\/pre>\n<h2 id=\"instantiate-special-tender-options\">Instantiate special tender options<\/h2>\n<table>\n<thead>\n<tr>\n<th>Name<\/th>\n<th>Type<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>specialOptions<\/code><\/td>\n<td>SpecialOptions<\/td>\n<td>Holds tender attributes.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3 id=\"parameters\">Parameters<\/h3>\n<table style=\"width:100%;\"><colgroup><col style=\"width: 16%\"><col style=\"width: 6%\"><col style=\"width: 8%\"><col style=\"width: 68%\"><\/colgroup><thead><tr class=\"header\"><th>Name<\/th><th>Type<\/th><th>Required<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td>\n<p><code>transactionType<\/code><\/p>\n<\/td><td>\n<p>String<\/p>\n<\/td><td>\n<p><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/p>\n<\/td><td>\n<p>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).\u00a0<code>TransactionType<\/code>\u00a0takes the following values:<ul><li markdown=\"1\">redeem<\/li><li markdown=\"1\">load<\/li><li markdown=\"1\">balanceInquiry<\/li><\/ul><\/p>\n<\/td><\/tr><tr><td>\n<p><code>paymentMethodType<\/code><\/p>\n<\/td><td>\n<p>String<\/p>\n<\/td><td>\n<p><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/p>\n<\/td><td>\n<p>The type of payment method, in this case gift cards. For example, Givex, SVS, EagleEye.\u00a0<code>PaymentMethodType<\/code> takes the following values:<ul><li markdown=\"1\">givex<\/li><li markdown=\"1\">svs<\/li><\/ul><\/p>\n<\/td><\/tr><tr><td>\n<p><code>shopperReference<\/code><\/p>\n<\/td><td>\n<p>String<\/p>\n<\/td><td>\n<p><img title=\"-x-\" alt=\"-x-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/x.png\" \/><\/p>\n<\/td><td>\n<p>Shopper identification (used for omnichannel digital customer recognition; minimum length three characters).<\/p>\n<\/td><\/tr><tr><td>\n<p><code>shopperEmail<\/code><\/p>\n<\/td><td>\n<p>String<\/p>\n<\/td><td>\n<p><img title=\"-x-\" alt=\"-x-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/x.png\" \/><\/p>\n<\/td><td>\n<p>Shopper identification (used for omnichannel digital customer recognition).<\/p>\n<\/td><\/tr><tr><td>\n<p><code>merchantAccount<\/code><\/p>\n<\/td><td>\n<p>String<\/p>\n<\/td><td>\n<p><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/p>\n<\/td><td>\n<p>The transaction reference provided by the Merchant (reported in the plataforma de pagamentos da Adyen).<\/p>\n<\/td><\/tr><tr><td>\n<p><code>merchantReference<\/code><\/p>\n<\/td><td>\n<p>String<\/p>\n<\/td><td>\n<p><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/p>\n<\/td><td>\n<p>The transaction reference provided by the Merchant (reported in the plataforma de pagamentos da Adyen).<\/p>\n<\/td><\/tr><tr><td>\n<p><code>currency<\/code><\/p>\n<\/td><td>\n<p>long<\/p>\n<\/td><td>\n<p><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/p>\n<\/td><td>\n<p>The transaction currency.<\/p>\n<\/td><\/tr><tr><td>\n<p><code>amount<\/code><\/p>\n<\/td><td>\n<p>String<\/p>\n<\/td><td>\n<p><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/p>\n<\/td><td>\n<p>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)).<\/p>\n<\/td><\/tr><tr><td>\n<p><code>specialOptions<\/code><\/p>\n<\/td><td>\n<p>SpecialTenderOptions<\/p>\n<\/td><td>\n<p><img title=\"-x-\" alt=\"-x-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/x.png\" \/><\/p>\n<\/td><td>\n<p>Holds tender attributes.Activate, load, or refund a balance to a card by creating a special tender and passing the following values as the <code>loadType<\/code> in special options:<\/p>\n<ul>\n<li><strong>activate<\/strong> - Activates a gift card.<\/li>\n<li><strong>load<\/strong> - Adds a balance to a gift card.<\/li>\n<li><strong>merchandise_return<\/strong> -\u00a0Add a refund balance back on to a gift card. This uses the same functionally as a load but is separated for accounting purposes.<\/li>\n<\/ul>\n<div class=\"sc-notice info\"><div>\n<p>The activate and load values can be piped to chain the tasks by passing \"<strong>activate|load<\/strong>\".<\/p>\n<p><\/div><\/div>Perform a cash back or deactivate a card by creating a special tender and passing a <code>redemptionType<\/code>\u00a0as a special option.\u00a0<\/p>\n<ul>\n<li>\n<p><strong>cashback -<\/strong> 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.<\/p>\n<\/li>\n<li>\n<p><strong>deactivate\u00a0<\/strong>- Deactivates a gift card.\u00a0\u00a0(Deactivate is not available for SVS).<\/p>\n<\/li>\n<li>\n<p><strong>gratuity<\/strong> - Used to provide a tip from a gift card. (For SVS cards only).<\/p>\n<\/li>\n<\/ul>\n<div class=\"sc-notice info\"><div>\n<p>The cashback and deactivate values can be piped to chain the tasks by passing\u00a0 \"<strong>cashback|deactivate<\/strong>\".<\/p>\n<\/div><\/div>\n<\/td><\/tr><tr><td>\n<p><code>handleReceipt<\/code><\/p>\n<\/td><td>\n<p>Boolean<\/p>\n<\/td><td>\n<p><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/p>\n<\/td><td>\n<p>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.<\/p>\n<\/td><\/tr><\/tbody><\/table>\n<p>Instantiate <code>specialOptions<\/code> by assigning it to the result of the SpecialTender getter<code>specialtender.getSpecialOptions()<\/code><\/p>\n<pre><code class=\"language-java\">SpecialOptions specialOptions = specialTender.getSpecialOptions();<\/code><\/pre>\n<h2 id=\"entry-modes\">Entry modes<\/h2>\n<p>The gift card can be presented in three ways:\u00a0<\/p>\n<ol>\n<li>Swipe: the gift card is read using a magnetic stripe reader.<\/li>\n<li>MKE on terminal: the card number is manually entered on the payment terminal. The tender should specify that it expects keyed entry on the terminal, and a card mask should be provided.<\/li>\n<li>MKE on POS app: scan a barcode on the back of the card from the POS app. In this scenario, the card number, card mask, and expiry should be provided in special options.<\/li>\n<\/ol>\n<p>You can specify entry modes by passing special tender options. See\u00a0<a href=\"\/pt\/point-of-sale\/gift-cards-terminal-api\">Gift Cards<\/a>.\u00a0<\/p>\n<h2 id=\"use-put-to-set-special-options\">Use put to set special options<\/h2>\n<table><colgroup><col style=\"width: 24%\"><col style=\"width: 75%\"><\/colgroup><thead><tr class=\"header\"><th>Name<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td>\n<p><code>specialOptions.put<\/code><\/p>\n<\/td><td>\n<p>Allows you to add a special option as a key value pair.<\/p>\n<\/td><\/tr><\/tbody><\/table>\n<p>Add special options parameters to the <code>specialTender<\/code>\u00a0using the <code>specialOptions.put<\/code>\u00a0method.\u00a0<\/p>\n<table><thead><tr class=\"header\"><th>Name<\/th><th>Type<\/th><th>Required<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td>\n<p><code>cardNumber\u00a0<\/code><\/p>\n<\/td><td>\n<p>String<\/p>\n<\/td><td>\n<p><img title=\"-x-\" alt=\"-x-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/x.png\" \/><\/p>\n<\/td><td>\n<p>The scanned number from the gift card. If this number:<ul><li markdown=\"1\">Is passed from the POS, Keyed Entry will not be triggered on the PED.<\/li><li markdown=\"1\">Is not passed from the POS Keyed Entry will be triggered on the PED.<\/li><\/ul><\/p>\n<\/td><\/tr><tr><td>\n<p><code>forceEntryMode<\/code><\/p>\n<\/td><td>\n<p>String<\/p>\n<\/td><td>\n<p><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/p>\n<\/td><td>\n<p>The entry mode for the transaction.You can select from two entry modes:<ul><li markdown=\"1\">Keyed - on the PED or POS<\/li><li markdown=\"1\">Magstripe - Use the magnetic stripe from the card<\/li><\/ul><\/p>\n<\/td><\/tr><\/tbody><\/table>\n<pre><code class=\"language-java\">specialOptions.put(\"cardNumber\", \"60362821657200117610\");<\/code><\/pre>\n<h2 id=\"call-the-method\">Call the method<\/h2>\n<table style=\"width:100%;\"><colgroup><col style=\"width: 6%\"><col style=\"width: 93%\"><\/colgroup><thead><tr class=\"header\"><th>Name<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td>\n<p><code>runSpecialTenderSync<\/code><\/p>\n<\/td><td>\n<p>Creates a tender using a number of attributes.<\/p>\n<\/td><\/tr><\/tbody><\/table>\n<pre><code class=\"language-java\">ped.runSpecialTenderSync(specialTender);<\/code><\/pre>\n<h2 id=\"determine-the-current-and-final-tender-state\">Determine the current and final tender state<\/h2>\n<p>Adyen provides a method to determine the current, or final, tender state. For more information, see\u00a0<a href=\"\/pt\/point-of-sale\/classic-library-deprecation\/classic-library-integrations\/java-native-interface-integration\/key-steps-jni\/process-a-basic-transaction-jni\/determine-the-current-and-final-tender-state-jni\">Determine the current and final tender state - JNI<\/a>.<\/p>\n<h2 id=\"callbacks\">Callbacks<\/h2>\n<table>\n<thead>\n<tr>\n<th>Name<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><a href=\"\/pt\/point-of-sale\/classic-library-deprecation\/classic-library-integrations\/java-native-interface-integration\/key-steps-jni\/process-a-basic-transaction-jni\/handle-the-print-receipt-callback-jni\">\n  <code>tenderPrintReceiptCallback<\/code>\n<\/a><\/td>\n<td>Returns the receipt for printing, and requests that the POS confirms it has received the receipt.<\/td>\n<\/tr>\n<tr>\n<td><a href=\"\/pt\/point-of-sale\/classic-library-deprecation\/classic-library-integrations\/java-native-interface-integration\/key-steps-jni\/process-a-basic-transaction-jni\/handle-progress-events-jni\">\n  <code>progressCallback<\/code>\n<\/a><\/td>\n<td>Reports the progress on a running tender<\/td>\n<\/tr>\n<tr>\n<td><a href=\"\/pt\/point-of-sale\/classic-library-deprecation\/classic-library-integrations\/java-native-interface-integration\/key-steps-jni\/process-a-basic-transaction-jni\/handle-the-final-state-callback-jni\">\n  <code>finalCallback<\/code>\n<\/a><\/td>\n<td>When the system finishes processing the tender, it triggers the final state callback.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>","url":"https:\/\/docs.adyen.com\/pt\/point-of-sale\/classic-library-deprecation\/classic-library-integrations\/java-native-interface-integration\/extras-jni\/start-gift-card-transactions-jni","articleFields":{"id":"31503247","type":"page","_expandable":{"operations":""},"status":"current","last_edit_on":"01-05-2019 11:55"},"algolia":{"url":"https:\/\/docs.adyen.com\/pt\/point-of-sale\/classic-library-deprecation\/classic-library-integrations\/java-native-interface-integration\/extras-jni\/start-gift-card-transactions-jni","title":"Start gift card transactions","content":"Class\nNameDescription\nMerchantPed\n\nExtends\u00a0 AdyenPed.\u00a0 Class used to implement all PIN entry device (PED) functionality.\n\nSpecial tender parameter\n\n\n\nName\nType\nDescription\n\n\n\n\nspecialTender\nSpecialTender\nHolds tender attributes.\n\n\n\nUse the SpecialTenderBuilder to create the SpecialTender object:\nprivate SpecialTender buildSpecialTender() {\n\n        SpecialTender specialTender = new SpecialTender(merchantAccount,\n\n                merchantReference,\n\n                \"balanceInquiry\",\n\n                \"goldsmithscard\",\n\n                currency,\n\n                amount);\n\n        return specialTender;\n\n    }\n\u00a0\nSpecialTender specialTender = buildSpecialTender();\nInstantiate special tender options\n\n\n\nName\nType\nDescription\n\n\n\n\nspecialOptions\nSpecialOptions\nHolds tender attributes.\n\n\n\nParameters\nNameTypeRequiredDescription\ntransactionType\n\nString\n\n\n\nType 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).\u00a0TransactionType\u00a0takes the following values:redeemloadbalanceInquiry\n\npaymentMethodType\n\nString\n\n\n\nThe type of payment method, in this case gift cards. For example, Givex, SVS, EagleEye.\u00a0PaymentMethodType takes the following values:givexsvs\n\nshopperReference\n\nString\n\n\n\nShopper identification (used for omnichannel digital customer recognition; minimum length three characters).\n\nshopperEmail\n\nString\n\n\n\nShopper identification (used for omnichannel digital customer recognition).\n\nmerchantAccount\n\nString\n\n\n\nThe transaction reference provided by the Merchant (reported in the plataforma de pagamentos da Adyen).\n\nmerchantReference\n\nString\n\n\n\nThe transaction reference provided by the Merchant (reported in the plataforma de pagamentos da Adyen).\n\ncurrency\n\nlong\n\n\n\nThe transaction currency.\n\namount\n\nString\n\n\n\nThe 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)).\n\nspecialOptions\n\nSpecialTenderOptions\n\n\n\nHolds 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:\n\nactivate - Activates a gift card.\nload - Adds a balance to a gift card.\nmerchandise_return -\u00a0Add a refund balance back on to a gift card. This uses the same functionally as a load but is separated for accounting purposes.\n\n\nThe activate and load values can be piped to chain the tasks by passing \"activate|load\".\nPerform a cash back or deactivate a card by creating a special tender and passing a redemptionType\u00a0as a special option.\u00a0\n\n\ncashback - 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.\n\n\ndeactivate\u00a0- Deactivates a gift card.\u00a0\u00a0(Deactivate is not available for SVS).\n\n\ngratuity - Used to provide a tip from a gift card. (For SVS cards only).\n\n\n\nThe cashback and deactivate values can be piped to chain the tasks by passing\u00a0 \"cashback|deactivate\".\n\n\nhandleReceipt\n\nBoolean\n\n\n\nSpecifies 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.\n\nInstantiate specialOptions by assigning it to the result of the SpecialTender getterspecialtender.getSpecialOptions()\nSpecialOptions specialOptions = specialTender.getSpecialOptions();\nEntry modes\nThe gift card can be presented in three ways:\u00a0\n\nSwipe: the gift card is read using a magnetic stripe reader.\nMKE on terminal: the card number is manually entered on the payment terminal. The tender should specify that it expects keyed entry on the terminal, and a card mask should be provided.\nMKE on POS app: scan a barcode on the back of the card from the POS app. In this scenario, the card number, card mask, and expiry should be provided in special options.\n\nYou can specify entry modes by passing special tender options. See\u00a0Gift Cards.\u00a0\nUse put to set special options\nNameDescription\nspecialOptions.put\n\nAllows you to add a special option as a key value pair.\n\nAdd special options parameters to the specialTender\u00a0using the specialOptions.put\u00a0method.\u00a0\nNameTypeRequiredDescription\ncardNumber\u00a0\n\nString\n\n\n\nThe 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.\n\nforceEntryMode\n\nString\n\n\n\nThe entry mode for the transaction.You can select from two entry modes:Keyed - on the PED or POSMagstripe - Use the magnetic stripe from the card\n\nspecialOptions.put(\"cardNumber\", \"60362821657200117610\");\nCall the method\nNameDescription\nrunSpecialTenderSync\n\nCreates a tender using a number of attributes.\n\nped.runSpecialTenderSync(specialTender);\nDetermine the current and final tender state\nAdyen provides a method to determine the current, or final, tender state. For more information, see\u00a0Determine the current and final tender state - JNI.\nCallbacks\n\n\n\nName\nDescription\n\n\n\n\n\n  tenderPrintReceiptCallback\n\nReturns the receipt for printing, and requests that the POS confirms it has received the receipt.\n\n\n\n  progressCallback\n\nReports the progress on a running tender\n\n\n\n  finalCallback\n\nWhen the system finishes processing the tender, it triggers the final state callback.\n\n\n","type":"page","locale":"pt","boost":14,"hierarchy":{"lvl0":"Home","lvl1":"Terminais","lvl2":"Deprecation of classic libraries","lvl3":"Library integrations","lvl4":"Java Native Interface integration","lvl5":"Extras","lvl6":"Start gift card transactions"},"hierarchy_url":{"lvl0":"https:\/\/docs.adyen.com\/pt","lvl1":"https:\/\/docs.adyen.com\/pt\/point-of-sale","lvl2":"https:\/\/docs.adyen.com\/pt\/point-of-sale\/classic-library-deprecation","lvl3":"https:\/\/docs.adyen.com\/pt\/point-of-sale\/classic-library-deprecation\/classic-library-integrations","lvl4":"https:\/\/docs.adyen.com\/pt\/point-of-sale\/classic-library-deprecation\/classic-library-integrations\/java-native-interface-integration","lvl5":"https:\/\/docs.adyen.com\/pt\/point-of-sale\/classic-library-deprecation\/classic-library-integrations\/java-native-interface-integration\/extras-jni","lvl6":"\/pt\/point-of-sale\/classic-library-deprecation\/classic-library-integrations\/java-native-interface-integration\/extras-jni\/start-gift-card-transactions-jni"},"levels":7,"category":"In-person payments","category_color":"green","tags":["Start","transactions"]}}
