{"title":"Refund a transaction from the POS","category":"default","creationDate":1776961627,"content":"<h2 id=\"implement-the-callback\">Implement the callback<\/h2>\n<p>Implement the callback based on the signature in the <span translate=\"no\"><strong>cancel_or_refund_extern.h<\/strong><\/span>\u00a0file and pass this as a parameter of the\u00a0<span translate=\"no\"><strong>cancel_or_refund<\/strong><\/span>\u00a0call. For more information on how to do this, see\u00a0<a href=\"\/pt\/point-of-sale\/classic-library-deprecation\/classic-library-integrations\/c-library-integration\/calls-and-callbacks-c-library\/implement-callbacks\">Implement callbacks<\/a>.<\/p>\n<h2 id=\"allocate-the-request-struct\">Allocate the request struct<\/h2>\n<p>Allocates, initializes and returns a\u00a0<code>cancel_or_refund_request<\/code>\u00a0struct. Populate the request by performing string duplication.<\/p>\n<p>If you want the data for later use, retain it, or it will be released automatically.<\/p>\n<table><thead><tr class=\"header\"><th>Name<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td>\n<p><code>cancel_or_refund_allocate<\/code><\/p>\n<\/td><td>\n<p>Allocates, initializes and returns a\u00a0<code>cancel_or_refund_request<\/code>\u00a0struct. Populate the request by performing string duplication.If you want the data for later use, retain it, or it will be released automatically.<\/p>\n<\/td><\/tr><\/tbody><\/table>\n<h2 id=\"call-the-cancel_or_refund-function\">Call the cancel_or_refund\u00a0Function<\/h2>\n<p>Call the <code>cancel_or_refund<\/code> function to initiate a cancel or refund on a transaction that has been processed by the plataforma de pagamentos da Adyen.<\/p>\n<h3 id=\"parameters\">Parameters<\/h3>\n<table>\n<thead>\n<tr>\n<th>Value<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>cancel_or_refund_request<\/code><\/td>\n<td>Pointer to the <code>cancel_or_refund_request<\/code> struct, this struct contains all the input parameters for this call.<\/td>\n<\/tr>\n<tr>\n<td><code>cancel_or_refund_response<\/code><\/td>\n<td>Pointer to the callback function in the POS that will be called with the results of the <code>cancel_or_refund<\/code> call<\/td>\n<\/tr>\n<tr>\n<td><code>echo_struct<\/code><\/td>\n<td>Pointer to a POS defined struct. Returned in the callback. It can be used to share a POS data struct between the call to the library and the callback from the library in response to the call.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2 id=\"handle-the-callback\">Handle the callback<\/h2>\n<p>The\u00a0<code>cancel_or_refund_CB<\/code>\u00a0returns the immediate response to the call and a pointer to the POS-defined echo struct.<\/p>\n<h3 id=\"parameters-1\">Parameters<\/h3>\n<table>\n<thead>\n<tr>\n<th>Value<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>cancel_or_refund_response<\/code><\/td>\n<td>Pointer to the callback function in the POS that will be called with the results of the <code>cancel_or_refund<\/code> call. If the refund was successful, this struct should should return a result of \"<span translate=\"no\"><strong>refund-received<\/strong><\/span>\".\u00a0<\/td>\n<\/tr>\n<tr>\n<td><code>echo_struct<\/code><\/td>\n<td>Pointer to a POS defined struct. Returned in the callback. It can be used to share a POS data struct between the call to the library and the callback from the library in response to the call.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>","url":"https:\/\/docs.adyen.com\/pt\/point-of-sale\/classic-library-deprecation\/classic-library-integrations\/c-library-integration\/key-steps-c-library\/cancel-or-refund-a-transaction-c-library\/refund-a-transaction-from-the-pos-c","articleFields":{"id":"28870669","type":"page","_expandable":{"operations":""},"status":"current"},"algolia":{"url":"https:\/\/docs.adyen.com\/pt\/point-of-sale\/classic-library-deprecation\/classic-library-integrations\/c-library-integration\/key-steps-c-library\/cancel-or-refund-a-transaction-c-library\/refund-a-transaction-from-the-pos-c","title":"Refund a transaction from the POS","content":"Implement the callback\nImplement the callback based on the signature in the cancel_or_refund_extern.h\u00a0file and pass this as a parameter of the\u00a0cancel_or_refund\u00a0call. For more information on how to do this, see\u00a0Implement callbacks.\nAllocate the request struct\nAllocates, initializes and returns a\u00a0cancel_or_refund_request\u00a0struct. Populate the request by performing string duplication.\nIf you want the data for later use, retain it, or it will be released automatically.\nNameDescription\ncancel_or_refund_allocate\n\nAllocates, initializes and returns a\u00a0cancel_or_refund_request\u00a0struct. Populate the request by performing string duplication.If you want the data for later use, retain it, or it will be released automatically.\n\nCall the cancel_or_refund\u00a0Function\nCall the cancel_or_refund function to initiate a cancel or refund on a transaction that has been processed by the plataforma de pagamentos da Adyen.\nParameters\n\n\n\nValue\nDescription\n\n\n\n\ncancel_or_refund_request\nPointer to the cancel_or_refund_request struct, this struct contains all the input parameters for this call.\n\n\ncancel_or_refund_response\nPointer to the callback function in the POS that will be called with the results of the cancel_or_refund call\n\n\necho_struct\nPointer to a POS defined struct. Returned in the callback. It can be used to share a POS data struct between the call to the library and the callback from the library in response to the call.\n\n\n\nHandle the callback\nThe\u00a0cancel_or_refund_CB\u00a0returns the immediate response to the call and a pointer to the POS-defined echo struct.\nParameters\n\n\n\nValue\nDescription\n\n\n\n\ncancel_or_refund_response\nPointer to the callback function in the POS that will be called with the results of the cancel_or_refund call. If the refund was successful, this struct should should return a result of \"refund-received\".\u00a0\n\n\necho_struct\nPointer to a POS defined struct. Returned in the callback. It can be used to share a POS data struct between the call to the library and the callback from the library in response to the call.\n\n\n","type":"page","locale":"pt","boost":13,"hierarchy":{"lvl0":"Home","lvl1":"Terminais","lvl2":"Deprecation of classic libraries","lvl3":"Library integrations","lvl4":"C library integration","lvl5":"Key steps","lvl6":"Cancel or refund a transaction","lvl7":"Refund a transaction from the POS"},"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\/c-library-integration","lvl5":"https:\/\/docs.adyen.com\/pt\/point-of-sale\/classic-library-deprecation\/classic-library-integrations\/c-library-integration\/key-steps-c-library","lvl6":"https:\/\/docs.adyen.com\/pt\/point-of-sale\/classic-library-deprecation\/classic-library-integrations\/c-library-integration\/key-steps-c-library\/cancel-or-refund-a-transaction-c-library","lvl7":"\/pt\/point-of-sale\/classic-library-deprecation\/classic-library-integrations\/c-library-integration\/key-steps-c-library\/cancel-or-refund-a-transaction-c-library\/refund-a-transaction-from-the-pos-c"},"levels":8,"category":"In-person payments","category_color":"green","tags":["Refund","transaction"]}}
