{"title":"Use case: Automatic recovery","category":"default","creationDate":1776961627,"content":"<p>This scenario occurs when the cash register looses connection with the Payment terminal, and does not receive the final result for a transaction.<\/p>\n<p><img alt=\"\" src=\"\/user\/pages\/docs\/03.point-of-sale\/68.classic-library-deprecation\/59.classic-library-integrations\/10.use-cases-and-process-flows\/10.use-case-automatic-recovery\/noText_automatic-recovery-test.png\" \/><\/p>\n<h2 id=\"start-transaction\">Start transaction<\/h2>\n<ol>\n<li>The cash register starts a transaction.<\/li>\n<li>The create tender callback is returned and\u00a0 provides the tender reference.<\/li>\n<li>If the connection with the payment terminal is lost, the library fires the PED Exception callback with tender state: <span translate=\"no\"><strong>Unknown<\/strong><\/span>.<\/li>\n<\/ol>\n<h2 id=\"refresh-terminal\">Refresh terminal<\/h2>\n<ol>\n<li>The cash register queries the payment terminal for its state.<\/li>\n<li>\n<p>The terminal returns the\u00a0<code>PedStateChange<\/code> callback to provide its latest state.<\/p>\n<ol>\n<li>If the payment terminal returns <span translate=\"no\"><strong>ped_state_undetected<\/strong><\/span>\u00a0 or <span translate=\"no\"><strong>ped_state_not_ready<\/strong><\/span> , a message \"Check the payment terminal \" should be presented on the Cash register. The payment terminal may be busy with: rebooting, downloading a config, operating in the Admin menu, etc. The cashier can decide to retry to get the final state or to cancel the transaction.<\/li>\n<li>If the payment terminal sends back <span translate=\"no\"><strong>ped_state_ready_for_transaction<\/strong><\/span>;\u00a0 the cash register checks the final result of the transaction in the TxStore report.<\/li>\n<\/ol>\n<!-- list separator -->\n<\/li>\n<\/ol>\n<h2 id=\"query-the-txstore-report\">Query the TxStore report<\/h2>\n<ol>\n<li>The Cash register calls the method <code>GetTxStoreReport<\/code>\u00a0with <code>providedtenderReference<\/code>.<\/li>\n<li>A <code>TxStoreReport<\/code> callback\u00a0 is returned with the TxStore object which contains the final state of the referenced transaction.<\/li>\n<\/ol>\n<h2 id=\"cancel-or-refund\">Cancel or refund<\/h2>\n<p>\u00a0If the cash register fails to get final state after these steps:<\/p>\n<ol>\n<li>Initiate a <code>CancelOrRefund<\/code>\u00a0call to the Adyen backend.<\/li>\n<li>The final status of this request for a refund will be reported by Adyen's notifications directly to the Merchant's backend.<\/li>\n<\/ol>","url":"https:\/\/docs.adyen.com\/pt\/point-of-sale\/classic-library-deprecation\/classic-library-integrations\/use-cases-and-process-flows\/use-case-automatic-recovery","articleFields":{"id":"39946462","type":"page","_expandable":{"operations":""},"status":"current"},"algolia":{"url":"https:\/\/docs.adyen.com\/pt\/point-of-sale\/classic-library-deprecation\/classic-library-integrations\/use-cases-and-process-flows\/use-case-automatic-recovery","title":"Use case: Automatic recovery","content":"This scenario occurs when the cash register looses connection with the Payment terminal, and does not receive the final result for a transaction.\n\nStart transaction\n\nThe cash register starts a transaction.\nThe create tender callback is returned and\u00a0 provides the tender reference.\nIf the connection with the payment terminal is lost, the library fires the PED Exception callback with tender state: Unknown.\n\nRefresh terminal\n\nThe cash register queries the payment terminal for its state.\n\nThe terminal returns the\u00a0PedStateChange callback to provide its latest state.\n\nIf the payment terminal returns ped_state_undetected\u00a0 or ped_state_not_ready , a message \"Check the payment terminal \" should be presented on the Cash register. The payment terminal may be busy with: rebooting, downloading a config, operating in the Admin menu, etc. The cashier can decide to retry to get the final state or to cancel the transaction.\nIf the payment terminal sends back ped_state_ready_for_transaction;\u00a0 the cash register checks the final result of the transaction in the TxStore report.\n\n\n\n\nQuery the TxStore report\n\nThe Cash register calls the method GetTxStoreReport\u00a0with providedtenderReference.\nA TxStoreReport callback\u00a0 is returned with the TxStore object which contains the final state of the referenced transaction.\n\nCancel or refund\n\u00a0If the cash register fails to get final state after these steps:\n\nInitiate a CancelOrRefund\u00a0call to the Adyen backend.\nThe final status of this request for a refund will be reported by Adyen's notifications directly to the Merchant's backend.\n","type":"page","locale":"pt","boost":15,"hierarchy":{"lvl0":"Home","lvl1":"Terminais","lvl2":"Deprecation of classic libraries","lvl3":"Library integrations","lvl4":"Use cases and process flows","lvl5":"Use case: Automatic recovery"},"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\/use-cases-and-process-flows","lvl5":"\/pt\/point-of-sale\/classic-library-deprecation\/classic-library-integrations\/use-cases-and-process-flows\/use-case-automatic-recovery"},"levels":6,"category":"In-person payments","category_color":"green","tags":["case:","Automatic","recovery"]},"articleFiles":{"noText_automatic-recovery-test.png":"<img alt=\"\" src=\"https:\/\/docs.adyen.com\/user\/pages\/docs\/03.point-of-sale\/68.classic-library-deprecation\/59.classic-library-integrations\/10.use-cases-and-process-flows\/10.use-case-automatic-recovery\/noText_automatic-recovery-test.png\" \/>"}}
