{"title":"Partially refund a balance","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>\u00a0refund_extern.h<\/strong><\/span>\u00a0file and pass this as a parameter of the\u00a0<span translate=\"no\"><strong>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 <code>refund_request<\/code> struct. 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>refund_allocate<\/code><\/p>\n<\/td><td>\n<p>Allocates, initializes and returns a\u00a0<code>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-refund-function\">Call the refund\u00a0function<\/h2>\n<p>Call the\u00a0<code>refund<\/code>\u00a0function to initiate a cancel or refund on a transaction that has been processed by the\u00a0plataforma de pagamentos da Adyen. In the refund request, include a\u00a0<code>modification_amount_currency<\/code> and <code>m``odification_amount_value<\/code> that specifies the amount to be refunded.<\/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>refund_request<\/code><\/td>\n<td>Pointer to the <code>refund_request<\/code>\u00a0struct, this struct contains all the input parameters for this call.<\/td>\n<\/tr>\n<tr>\n<td><code>refund_response<\/code><\/td>\n<td>Pointer to the callback function in the POS that will be called with the results of the <code>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>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>refund_response<\/code><\/td>\n<td>Pointer to the callback function in the POS that will be called with the results of the <code>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\/partially-refund-a-balance-c-library","articleFields":{"id":"36186029","type":"page","_expandable":{"operations":""},"status":"current","last_edit_on":"13-11-2019 17:46"},"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\/partially-refund-a-balance-c-library","title":"Partially refund a balance","content":"Implement the callback\nImplement the callback based on the signature in the\u00a0refund_extern.h\u00a0file and pass this as a parameter of the\u00a0refund\u00a0call. For more information on how to do this, see\u00a0Implement callbacks.\nAllocate the request struct\nAllocates, initializes and returns a refund_request struct. Populate the request by performing string duplication.\nIf you want the data for later use, retain it, or it will be released automatically.\nNameDescription\nrefund_allocate\n\nAllocates, initializes and returns a\u00a0refund_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 refund\u00a0function\nCall the\u00a0refund\u00a0function to initiate a cancel or refund on a transaction that has been processed by the\u00a0plataforma de pagamentos da Adyen. In the refund request, include a\u00a0modification_amount_currency and m``odification_amount_value that specifies the amount to be refunded.\nParameters\n\n\n\nValue\nDescription\n\n\n\n\nrefund_request\nPointer to the refund_request\u00a0struct, this struct contains all the input parameters for this call.\n\n\nrefund_response\nPointer to the callback function in the POS that will be called with the results of the 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\u00a0refund_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\nrefund_response\nPointer to the callback function in the POS that will be called with the results of the 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":"Partially refund a balance"},"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\/partially-refund-a-balance-c-library"},"levels":8,"category":"In-person payments","category_color":"green","tags":["Partially","refund","balance"]}}
