{"section":"known-issues","requestedLocale":"en","requestedSlug":"transaction-settling-while-giftcard-payment-stuck-in-authorized-status-after-autosettle-error","locale":"en","slug":"transaction-settling-while-giftcard-payment-stuck-in-authorized-status-after-autosettle-error","path":"docs/en/known-issues/Payments/transaction-settling-while-giftcard-payment-stuck-in-authorized-status-after-autosettle-error.md","branch":"main","content":"## Summary\n\nGift card payments get stuck in `authorized` status after a settlement failure in GiftcardHub (HTTP 400 or other errors). Even after retries triggered by SOS, the payment status doesn't update, and the settlement never completes.\n\nThe message in the transaction interactions is:\n\n    Message: Unknown Error on AutoSettleA chamada a 'https://janus-payments-link.vtex.com.br//giftcardproviders//giftcards//transactions//settlements' retornou o status HTTP '()'.\n\n\nThe problem only happens in the **Total settlement mode (platform default):** When a transaction has multiple payment methods, if the Gift Card settlement fails on the first attempt, the other payment method may already be captured (auto-settled). On retries, the SOS sends the full invoice value, but the gateway now only covers the remaining Gift Card balance. The gateway logs `Transaction settlement started`.\n\nThis happens because the requested value exceeds the remaining capturable balance. The flow aborts before calling the Hub, no `PaymentWorkFlowChangeStatus`, no Hub call, and no `Transaction settlement finished` is logged.\n\n## Simulation\n\nPre-requisites:\n\n1. Be in Total capture mode\n2. No automatic or early capture configured\n\n\nSteps:\n\n1. Create an order/transaction with a gift card + another payment method\n2. Approve both payments\n3. Force the gift card payment capture to fail\n4. Successfully capture the other payment method\n5. Call the gateway capture with the total value and receive the error:\n6.\n\n    \\{ \"error\": \\{ \"code\": \"1402\", \"message\": \"Settlement requested value (xx.xx) should be less than or equal to remaining amount to pay (xx.xx), which must be different from 0.\", \"exception\": null \\}\\}\n\n## Workaround\n\nTo avoid this error entirely, the merchant can choose to change the capture type to Hold or Partial mode.\nPlease review each of these modes before enabling: https://help.vtex.com/docs/tutorials/payment-settlement-types\n\nAnother way to avoid the issue is to enable automatic or early capture on the connector.\nWe recommend a `delayToAutoSettle` or `delayToAutoSettleAfterAntifraud` of 3600 seconds (1h), but the important thing is that it is shorter than the typical order invoicing time:\nhttps://help.vtex.com/docs/tutorials/configuring-maximum-automatic-payment-settlement-time-frame\n\nObs: It is necessary that the merchant checks with the provider whether it is possible to set those fields.\n\nIf the merchant does not wish to implement any of the changes above, please open a ticket requesting a status update."}