node.jspayment-gatewayauthorize.net

Authorize a Credit Card returns empty refTransId on Sandbox environment


I use the NodeJS SDK to authorize the credit card for later capturing and get successful response but with empty refTransId, so I can't capture the transaction.

I wonder why and if the Sandbox environment should return the refTransId?

The request is as follow:

CreateTransactionRequest {
  merchantAuthentication: MerchantAuthenticationType {
    name: 'xxxxx',
    transactionKey: 'xxxxxxxx',
    sessionToken: null,
    password: null,
    impersonationAuthentication: null,
    fingerPrint: null,
    clientKey: null,
    accessToken: null,
    mobileDeviceId: null
  },
  clientId: null,
  refId: '2MFSJPT0XC0KJ60NS1P1',
  transactionRequest: TransactionRequestType {
    transactionType: 'authOnlyTransaction',
    amount: 100,
    currencyCode: 'USD',
    payment: PaymentType {
      creditCard: null,
      bankAccount: null,
      trackData: null,
      encryptedTrackData: null,
      payPal: null,
      opaqueData: [OpaqueDataType],
      emv: null,
      dataSource: null
    },
    profile: null,
    solution: null,
    callId: null,
    terminalNumber: null,
    authCode: null,
    refTransId: null,
    splitTenderId: null,
    order: OrderType {
          invoiceNumber: '82',
          description: 'Authorize Client CC',
          discountAmount: null,
          taxIsAfterDiscount: null,
          totalTaxTypeCode: null,
          purchaserVATRegistrationNumber: null,
          merchantVATRegistrationNumber: null,
          vatInvoiceReferenceNumber: null,
          purchaserCode: null,
          summaryCommodityCode: null,
          purchaseOrderDateUTC: null,
          supplierOrderReference: null,
          authorizedContactName: null,
          cardAcceptorRefNumber: null,
          amexDataTAA1: null,
          amexDataTAA2: null,
          amexDataTAA3: null,
          amexDataTAA4: null
    },
    lineItems: ArrayOfLineItem { lineItem: [Array] },
    tax: null,
    duty: null,
    shipping: null,
    taxExempt: null,
    poNumber: null,
    customer: CustomerType {
          type: 'individual',
          id: '627d08cfc5c631872d9',
          email: 'shayzalm234an@gmail.com',
          phoneNumber: null,
          faxNumber: null,
          driversLicense: null,
          taxId: null
    },
    billTo: CustomerAddressType {
          firstName: 'adas',
          lastName: '',
          company: '',
          address: 'Southwest 1st Avenue 3298',
          city: 'Miami-Dade County',
          state: 'Florida',
          zip: undefined,
          country: 'USA',
          phoneNumber: null,
          faxNumber: null,
          email: null
    },
    shipTo: null,
    customerIP: null,
    cardholderAuthentication: null,
    retail: null,
    employeeId: null,
    transactionSettings: null,
    userFields: null,
    surcharge: null,
    merchantDescriptor: null,
    subMerchant: null,
    tip: null,
    processingOptions: null,
    subsequentAuthInformation: null,
    otherTax: null,
    shipFrom: null,
    authorizationIndicatorType: null
  }
}

The response is as follow:

{
"messages": {
  "resultCode": "Ok",
  "message": [
    {
      "code": "I00001",
      "text": "Successful."
    }
  ]
},
"transactionResponse": {
  "responseCode": "1",
  "authCode": "000000",
  "avsResultCode": "P",
  "cvvResultCode": "",
  "cavvResultCode": "",
  "transId": "0",
  "refTransID": "",
  "transHash": "",
  "testRequest": "1",
  "accountNumber": "XXXX0000",
  "accountType": "Visa",
  "messages": {
    "message": [
      {
        "code": "1",
        "description": "This transaction has been approved."
      }
    ]
  },
  "transHashSha2": ""
}

This is the documentation reference I use: https://developer.authorize.net/api/reference/index.html#payment-transactions-authorize-a-credit-card.


Solution

  • I found out that my test account was on test mode and had to be switched to "live" in order to simulate transactions.