Identifying and Resolving Timeouts

This page provides technical background information to help Marqeta customers identify and resolve time-out issues related to their JIT Funding gateway. This is one of the tasks involved in implementing Gateway JIT Funding. See JIT Funding Overview for an overview of the entire procedure.

Note: This page pertains only to Gateway JIT Funding and does not pertain to Managed JIT Funding.

When a transaction requires Gateway JIT Funding (other than by way of a force capture), Marqeta first places the response to the card network on hold and then calls out to the JIT Funding gateway. Because the card network requires a timely response from Marqeta, Marqeta enforces a timeout limit on the response from the gateway. If the gateway doesn't respond to the JIT Funding request within that timeout limit (< 3 seconds), Marqeta breaks the socket connection to the gateway and declines the transaction back to the card network. Whenever a timeout occurs, the potential arises for an accounting error in the customer system. For example, consider the following scenario:

  1. Marqeta calls the gateway for a $100 authorization.
  2. After 3 seconds without receiving a response, Marqeta times out the connection to the gateway.
  3. Marqeta declines the transaction back to the card network.
  4. A few seconds later, the customer system finishes processing the authorization and attempts to respond with an authorization for $100.
  5. Unless the customer system identifies the timeout and reverses the authorization for $100, the customer system may become out of sync in regards to the actual state of the transaction and account balance.

Marqeta webhooks provide a solution for identifying these timeouts so you can resolve out-of-sync issues in whatever way your business model requires. Webhooks are push-style event notifications that Marqeta sends to a pre-configured endpoint in the customer environment (not the same as the JIT Funding gateway). Webhook notifications are sent asynchronously less than a second after each transaction completes and provide information to identify JIT Funding requests that timed out.

The following sample notification shows that a GPA funding order was declined as a result of a timed out JIT Funding request. Take note of the gateway_log.timed_out field. Its value of "true" indicates that the associated JIT Funding request timed out.

{
"token" : "45",
"type" : "gpa.credit.authorization",
"state" : "ERROR",
"duration" : 3090,
"amount" : 10.22,
"response" : {
"code" : "1842",
"memo" : "Account load failed"
},
"network" : "MARQETA",
"user_token" : "cbd5375a-ce6d-436b-83a7-11b86327b932",
"acting_user_token" : "cbd5375a-ce6d-436b-83a7-11b86327b932",
"card_token" : "50b178a6-6b6f-4d03-be8f-2664ca472a0b",
"created_time" : "2016-10-07T01:25:29Z",
"user_transaction_time" : "2016-10-07T01:25:29Z",
"preceding_related_transaction_token" : "43",
"gpa" : {
"ledger_balance" : 0.00,
"available_balance" : 0.00,
"credit_balance" : 0.00,
"pending_credits" : 0.00
},
"gpa_order" : {
"token" : "de8d8245-2b77-4725-9eb5-c2024bb0b8dd",
"amount" : 10.22,
"funding" : {
"amount" : 10.22,
"source" : {
"type" : "programgateway",
"token" : "**********57ec",
"active" : true,
"name" : "Marqeta QA PGFS 1",
"is_default_account" : false,
"created_time" : "2016-10-07T00:48:02Z",
"last_modified_time" : "2016-10-07T00:48:02Z"
},
"gateway_log" : {
"message" : "Operation timeout",
"duration" : 3002,
"order_number" : "43",
"timed_out" : true, // Indicates JIT Funding request timed out.
"response" : {
"code" : "97"
}
}
},
"state" : "ERROR",
"tags" : "TIMEOUT",
"transaction_token" : "45",
"jit_funding" : {
"token" : "785c1afb-e742-4d2e-84d7-d381d480c0ae",
"method" : "pgfs.authorization",
"amount" : 10.22,
"user_token" : "cbd5375a-ce6d-436b-83a7-11b86327b932"
},
"response" : {
"code" : "1842",
"memo" : "Account load failed"
},
"created_time" : "2016-10-07T01:25:29Z",
"last_modified_time" : "2016-10-07T01:25:29Z",
"user_token" : "cbd5375a-ce6d-436b-83a7-11b86327b932",
"currency_code" : "USD",
"funding_source_token" : "**********57ec"
},
"subnetwork" : "GATEWAY_JIT"
}

Other important information contained in these webhook notifications includes:

  • Transaction token
  • Transaction type
  • Transaction state
  • Amounts and funding source
  • Token of the preceding related transaction