{"title":"Refund a completed transaction","category":"default","creationDate":1776961627,"content":"<p>Cancel or refund a transaction from the terminal transaction list, and receive a receipt on the PED or on the POS.<\/p>\n<div class=\"sc-notice note\"><div>\n<p>You can only use this cancel or refund method for transactions that:<\/p>\n<ul>\n<li>have been completed on the PED that is receiving the cancel or refund request.<\/li>\n<li>are still within the PED storage \u2013 this is currently limited to 100 tenders.<\/li>\n<\/ul>\n<\/div><\/div>\n<h2>Class<\/h2>\n<table style=\"width:100%;\"><colgroup><col style=\"width: 8%\"><col style=\"width: 91%\"><\/colgroup><thead><tr class=\"header\"><th>Name<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><code>MerchantPed<\/code><\/td><td><p>Extends\u00a0<code>AdyenPed<\/code>. Class used to implement all PIN entry device (PED) functionality. Implement the\u00a0<code>MerchantPed<\/code>\u00a0object yourself, and use the\u00a0<code>AdyenPed<\/code>\u00a0constructor without\u00a0<code>storeId<\/code> parameter.<\/p><p>\u00a0<\/p><div class=\"sourceCode\" id=\"cb1\"><pre class=\"sourceCode java\"><code class=\"sourceCode java\"><a class=\"sourceLine\" id=\"cb1-1\" title=\"1\"><span class=\"kw\">public<\/span> <span class=\"fu\">AdyenPed<\/span>(<span class=\"bu\">String<\/span> address, <span class=\"bu\">String<\/span> pedName) { (..) }<\/a><\/code><\/pre><\/div><\/td><\/tr><\/tbody><\/table>\n<h2 id=\"method\">Method<\/h2>\n<table style=\"width:100%;\"><colgroup><col style=\"width: 18%\"><col style=\"width: 81%\"><\/colgroup><thead><tr class=\"header\"><th>Name<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><p><code>CancelOrRefund<\/code><\/p><\/td><td>Refund a completed transaction from the terminal transaction list. The transaction must have been completed on the PED that is receiving the cancel or refund request, and must be still within the PED storage (this is currently limited to 100 tenders.)<\/td><\/tr><\/tbody><\/table>\n<h2 id=\"create-request-object\">Create Request Object<\/h2>\n<table style=\"width:100%;\"><colgroup><col style=\"width: 18%\"><col style=\"width: 81%\"><\/colgroup><thead><tr class=\"header\"><th>Name<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><p><code>CancelOrRefundRequest<\/code><\/p><\/td><td>Refund request request object passed with the <code>CancelOrRefund<\/code> method.<\/td><\/tr><\/tbody><\/table>\n<h2 id=\"parameters\">Parameters<\/h2>\n<table>\n<thead>\n<tr>\n<th>Name<\/th>\n<th>Type<\/th>\n<th>Required<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>merchantAccount<\/code><\/td>\n<td>String<\/td>\n<td><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td>The <code>merchantAccount<\/code> that is canceling the transaction and refunding the money (if applicable).<\/td>\n<\/tr>\n<tr>\n<td><code>tenderReference<\/code><\/td>\n<td>String<\/td>\n<td><img title=\"-x-\" alt=\"-x-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/x.png\" \/><\/td>\n<td>Tender reference provided by the library if there is no connection to the PSP.\u00a0Use the Tender reference to identify the transaction to be cancelled.<\/td>\n<\/tr>\n<tr>\n<td><code>handleReceipt<\/code><\/td>\n<td>Boolean<\/td>\n<td><img title=\"-x-\" alt=\"-x-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/x.png\" \/><\/td>\n<td>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.<\/td>\n<\/tr>\n<tr>\n<td><code>additionalData<\/code><\/td>\n<td>AdditionalData<\/td>\n<td><img title=\"-x-\" alt=\"-x-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/x.png\" \/><\/td>\n<td>Contains key\/value pairs that can be used by the merchant to return specific additional data, in particular in the final transaction result.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2 id=\"callback\">Callback<\/h2>\n<table style=\"width:100%;\"><colgroup><col style=\"width: 14%\"><col style=\"width: 85%\"><\/colgroup><thead><tr class=\"header\"><th><p>Name<\/p><\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><p><code>cancelOrRefundCallback<\/code><\/p><\/td><td><p>Returns the result of the request.<\/p><\/td><\/tr><\/tbody><\/table>\n<h2 id=\"parameters-1\">Parameters<\/h2>\n<table style=\"width:93%;\"><colgroup><col style=\"width: 11%\"><col style=\"width: 4%\"><col style=\"width: 76%\"><\/colgroup><thead><tr class=\"header\"><th><p>Name<\/p><\/th><th>Type<\/th><th><p>Description<\/p><\/th><\/tr><\/thead><tbody><tr><td><p><code>CancelOrRefundResult<\/code><\/p><\/td><td><p>result<\/p><\/td><td><p>Object that contains the result of the cancel or refund request (whether it was completed).<\/p><\/td><\/tr><\/tbody><\/table>\n<h2 id=\"getters\">Getters<\/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>getTenderReference<\/code><\/td>\n<td>String<\/td>\n<td>Returns tender reference for the transaction.\u00a0<\/td>\n<\/tr>\n<tr>\n<td><code>getAdyenResult<\/code><\/td>\n<td>AdyenResult<\/td>\n<td>Retrieves the transaction result details\u00a0<\/td>\n<\/tr>\n<tr>\n<td><code>getReceiptSet<\/code><\/td>\n<td>Receipts.ReceiptSet<\/td>\n<td>Returns a\u00a0list of receipt information.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2 id=\"result-parameters\">Result Parameters<\/h2>\n<table><thead><tr class=\"header\"><th><p>Name<\/p><\/th><th><p>Type<\/p><\/th><th><p>Description<\/p><\/th><\/tr><\/thead><tbody><tr><td><p><code>libraryResult<\/code><\/p><\/td><td><p>String<\/p><\/td><td><p>Result code generated by the LIBRARY.<\/p><div class=\"sc-notice warning\"><div><p>As this request is not processed on the PSP, check <code>libraryResult<\/code> for errors instead of the <code>pspResult<\/code>.<\/p><\/div><\/div><\/td><\/tr><tr><td><code>pedResult<\/code><\/td><td>string<\/td><td><p>Result code generated by the PED.<\/p><p>\u00a0<\/p><div class=\"sc-notice warning\"><div><p>As this request is not processed on the PSP, check <code>pedResult<\/code> for errors instead of the <code>pspResult<\/code>.<\/p><\/div><\/div><p><br>\n<\/p><\/td><\/tr><tr><td><code>pspResult<\/code><\/td><td>long<\/td><td><p>Result code generated by the PSP.<\/p><\/td><\/tr><tr><td><code>errorMessage<\/code><\/td><td>String<\/td><td>Information that clarifies the error code.<\/td><\/tr><\/tbody><\/table>","url":"https:\/\/docs.adyen.com\/pt\/point-of-sale\/classic-library-deprecation\/classic-library-integrations\/java-native-interface-integration\/key-steps-jni\/cancel-or-refund-a-transaction-jni\/refund-a-transaction-from-the-ped-jni","articleFields":{"id":"39944698","type":"page","_expandable":{"operations":""},"status":"current"},"algolia":{"url":"https:\/\/docs.adyen.com\/pt\/point-of-sale\/classic-library-deprecation\/classic-library-integrations\/java-native-interface-integration\/key-steps-jni\/cancel-or-refund-a-transaction-jni\/refund-a-transaction-from-the-ped-jni","title":"Refund a completed transaction","content":"Cancel or refund a transaction from the terminal transaction list, and receive a receipt on the PED or on the POS.\n\nYou can only use this cancel or refund method for transactions that:\n\nhave been completed on the PED that is receiving the cancel or refund request.\nare still within the PED storage \u2013 this is currently limited to 100 tenders.\n\n\nClass\nNameDescriptionMerchantPedExtends\u00a0AdyenPed. Class used to implement all PIN entry device (PED) functionality. Implement the\u00a0MerchantPed\u00a0object yourself, and use the\u00a0AdyenPed\u00a0constructor without\u00a0storeId parameter.\u00a0public AdyenPed(String address, String pedName) { (..) }\nMethod\nNameDescriptionCancelOrRefundRefund a completed transaction from the terminal transaction list. The transaction must have been completed on the PED that is receiving the cancel or refund request, and must be still within the PED storage (this is currently limited to 100 tenders.)\nCreate Request Object\nNameDescriptionCancelOrRefundRequestRefund request request object passed with the CancelOrRefund method.\nParameters\n\n\n\nName\nType\nRequired\nDescription\n\n\n\n\nmerchantAccount\nString\n\nThe merchantAccount that is canceling the transaction and refunding the money (if applicable).\n\n\ntenderReference\nString\n\nTender reference provided by the library if there is no connection to the PSP.\u00a0Use the Tender reference to identify the transaction to be cancelled.\n\n\nhandleReceipt\nBoolean\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\n\nadditionalData\nAdditionalData\n\nContains key\/value pairs that can be used by the merchant to return specific additional data, in particular in the final transaction result.\n\n\n\nCallback\nNameDescriptioncancelOrRefundCallbackReturns the result of the request.\nParameters\nNameTypeDescriptionCancelOrRefundResultresultObject that contains the result of the cancel or refund request (whether it was completed).\nGetters\n\n\n\nName\nType\nDescription\n\n\n\n\ngetTenderReference\nString\nReturns tender reference for the transaction.\u00a0\n\n\ngetAdyenResult\nAdyenResult\nRetrieves the transaction result details\u00a0\n\n\ngetReceiptSet\nReceipts.ReceiptSet\nReturns a\u00a0list of receipt information.\n\n\n\nResult Parameters\nNameTypeDescriptionlibraryResultStringResult code generated by the LIBRARY.As this request is not processed on the PSP, check libraryResult for errors instead of the pspResult.pedResultstringResult code generated by the PED.\u00a0As this request is not processed on the PSP, check pedResult for errors instead of the pspResult.\npspResultlongResult code generated by the PSP.errorMessageStringInformation that clarifies the error code.","type":"page","locale":"pt","boost":13,"hierarchy":{"lvl0":"Home","lvl1":"Terminais","lvl2":"Deprecation of classic libraries","lvl3":"Library integrations","lvl4":"Java Native Interface integration","lvl5":"Key steps","lvl6":"Cancel or refund a transaction","lvl7":"Refund a completed transaction"},"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\/key-steps-jni","lvl6":"https:\/\/docs.adyen.com\/pt\/point-of-sale\/classic-library-deprecation\/classic-library-integrations\/java-native-interface-integration\/key-steps-jni\/cancel-or-refund-a-transaction-jni","lvl7":"\/pt\/point-of-sale\/classic-library-deprecation\/classic-library-integrations\/java-native-interface-integration\/key-steps-jni\/cancel-or-refund-a-transaction-jni\/refund-a-transaction-from-the-ped-jni"},"levels":8,"category":"In-person payments","category_color":"green","tags":["Refund","completed","transaction"]}}
