VivaPayments / API

Index of Viva Wallet open source projects on GitHub.
138 stars 163 forks source link

Explain EventId 1006: Transaction declined by server #2370

Open fmarchalemisys opened 1 year ago

fmarchalemisys commented 1 year ago

Hi,

Yesterday, a couple of calls to retrieve session by id in prod returned EventId 1006 which is explained here as meaning "Transaction declined by server".

Can you explain what it means?

If possible, I would like to show a message to explain, to the operator and the customer, why the payment failed.

Here is the first full response:

{
  "sessionId": "PP3280784-31a023ea1a",
  "terminalId": "16253546",
  "cashRegisterId": "POS005",
  "amount": 1100,
  "currencyCode": "978",
  "merchantReference": "614/11950295/9T",
  "customerTrns": null,
  "tipAmount": 0,
  "success": false,
  "eventId": 1006,
  "authorizationId": null,
  "transactionId": null,
  "transactionTypeId": null,
  "retrievalReferenceNumber": null,
  "panEntryMode": "05",
  "applicationLabel": null,
  "primaryAccountNumberMasked": null,
  "transactionDateTime": null,
  "abortOperation": false,
  "abortAckTime": null,
  "abortSuccess": false,
  "loyaltyInfo": null,
  "verificationMethod": null,
  "tid": "16253546",
  "shortOrderCode": "0",
  "installments": 0,
  "message": "Transaction declined by server",
  "preauth": false,
  "referenceNumber": 0,
  "orderCode": "0"
}

And the second full response (I removed the primaryAccountNumberMasked):

{
  "sessionId": "PP3280742-51c73d3f0b",
  "terminalId": "16253898",
  "cashRegisterId": "POS001",
  "amount": 1800,
  "currencyCode": "978",
  "merchantReference": "614/11949827/8N",
  "customerTrns": null,
  "tipAmount": 0,
  "success": false,
  "eventId": 1006,
  "authorizationId": "000000",
  "transactionId": "db1507f1-52aa-4577-b141-bc7220c5564a",
  "transactionTypeId": null,
  "retrievalReferenceNumber": 310419407060,
  "panEntryMode": "07",
  "applicationLabel": "Bancontact",
  "primaryAccountNumberMasked": "4******",
  "transactionDateTime": "2023-04-14T19:12:25.724000+00:00",
  "abortOperation": false,
  "abortAckTime": null,
  "abortSuccess": false,
  "loyaltyInfo": null,
  "verificationMethod": "CONTACTLESS - NO CVM",
  "tid": "16253898",
  "shortOrderCode": "3104214394",
  "installments": 0,
  "message": "Transaction declined by server",
  "preauth": false,
  "referenceNumber": 407060,
  "orderCode": "3104214394253898"
}
fmarchalemisys commented 1 year ago

Hi,

By now, I have seen EventId 1099 "Generic transaction error" in addition to 1006:

{
    "sessionId": "PP3284360-7b2ae7da2c",
    "terminalId": "16253546",
    "cashRegisterId": "POS005",
    "amount": 2400,
    "currencyCode": "978",
    "merchantReference": "614/11961536/1K",
    "customerTrns": null,
    "tipAmount": 0,
    "success": false,
    "eventId": 1099,
    "authorizationId": "000000",
    "transactionId": "7beac9a8-4aa5-49b6-88a2-e41b82341988",
    "transactionTypeId": null,
    "retrievalReferenceNumber": 310520351937,
    "panEntryMode": "07",
    "applicationLabel": "Bancontact",
    "primaryAccountNumberMasked": "6******",
    "transactionDateTime": "2023-04-15T20:40:34.515000+00:00",
    "abortOperation": false,
    "abortAckTime": null,
    "abortSuccess": false,
    "loyaltyInfo": null,
    "verificationMethod": "CONTACTLESS - NO CVM",
    "tid": "16253546",
    "shortOrderCode": "3105222632",
    "installments": 0,
    "message": "Generic transaction error",
    "preauth": false,
    "referenceNumber": 351937,
    "orderCode": "3105222632253546"
}

How can I explain those two error codes to the operator and the customer?

Those two error messages make it looks like our solution is unreliable :unamused:

VivaWalletCustomerSupport commented 1 year ago

Hello @fmarchalemisys,

Thank you for your message. We are currently investigating your issue. We will inform you as soon as we have any updates.

Kind regards, Viva Wallet E-commerce Support Team

VivaWalletCustomerSupport commented 1 year ago

Hello @fmarchalemisys,

Thank you for waiting. I would like to inform you that the transactions that are failing with eventid 1006,1099 have been rejected by the issuing banks. We provide those generic IDs when a transaction is rejected by the issuing bank.

Kind regards, Viva Wallet E-commerce Support Team

fmarchalemisys commented 1 year ago

Hi @VivaWalletCustomerSupport ,

Thank you for your answer.

So, eventid 1006 "Transaction declined by server" means the customer's bank rejected the payment (stolen card, insufficient amount,...). There is no point in trying again.

And eventid 1099 "Generic transaction error" means the customer's bank failed to respond to the transaction request. Trying again may solve the issue.

Is it correct?

VivaWalletCustomerSupport commented 1 year ago

Hello @fmarchalemisys,

We will investigate further your enquiry and we will inform you as soon as we have any updates.

Kind regards, Viva Wallet E-commerce Support Team

fmarchalemisys commented 1 year ago

Hi @VivaWalletCustomerSupport ,

I just got eventId 1099 on a demo payment initiated on a demo soft pos.

Here is the response from calling the url /ecr/isv/v1/sessions/PP3251007-b14f35e5d3 to get the payment status based on the session ID.

{
  "sessionId": "PP3251007-b14f35e5d3",
  "terminalId": "16001369",
  "cashRegisterId": "POS001",
  "amount": 6000,
  "currencyCode": "978",
  "merchantReference": "[PP3251007-b14f35e5d3]4/11846921/7H …",
  "customerTrns": "Votre commande #11846921 pour …",
  "tipAmount": 0,
  "success": false,
  "eventId": 1099,
  "authorizationId": null,
  "transactionId": null,
  "transactionTypeId": null,
  "retrievalReferenceNumber": null,
  "panEntryMode": "00",
  "applicationLabel": null,
  "primaryAccountNumberMasked": null,
  "transactionDateTime": null,
  "abortOperation": false,
  "abortAckTime": null,
  "abortSuccess": false,
  "loyaltyInfo": null,
  "verificationMethod": null,
  "tid": "16001369",
  "shortOrderCode": "0",
  "installments": 0,
  "message": "Generic transaction error",
  "preauth": false,
  "referenceNumber": 0,
  "orderCode": "0",
  "isvDetails": {
    "amount": 58,
    "merchantId": null,
    "sourceCode": "7951",
    "merchantSourceCode": "7889"
  }
}

So, unless your demo server is supposed to generate random errors appearing to come from the bank, there may be more to eventId 1099 :thinking:

VivaWalletCustomerSupport commented 1 year ago

Hello @fmarchalemisys,

Thank you for the additional information. We will investigate your query further and let you know as soon as we have any updates.

Kind regards, Viva Wallet E-commerce Support Team