cancel
Showing results for 
Search instead for 
Did you mean: 

A message element required as defined in Table A.1 is missing from the message. deviceChannel

Hello, 

I am implementing 3DS on REST API, I have been doing some tests and I was able to get the authentication window for 3DS just fine, a few days ago, I started getting error: A message element required as defined in Table A.1 is missing from the message. deviceChannel.

I don't find any instructions on adding this to the REST API code. I have also tried the live test platform on Cybersource that is found here but still getting the same error.

Has anyone faced this and how can I resolve it? Thank you

mateo
Member
4 REPLIES 4

I have the same problem in my test flow, but I cannot identify the problem because I have not made any changes.

Maybe someone knows what change

joselu
Member

Hi @joselu 

I am facing the same issue did you got the solution for it

Thanks in Advance

I also faced a similar issue, but I was able to resolve it by passing the reference id gotten from :

 

authenticationSetupsPostResponse.getConsumerAuthenticationInformation().getReferenceId()

 

to :

 

consumerAuthenticationInformation.setReferenceId(referenceId);

 

 

etherofgodd
Member

Hi @etherofgodd , thanks for the reply. I can’t seem to find the mentioned ID. Where can I get this method?  I am using Riskv1

authenticationSetupsPostResponse.getConsumerAuthenticationInformation().getReferenceId()

And this method  setReferenceID, is not found on consumerAuthenticationInformation

consumerAuthenticationInformation.setReferenceId(referenceId);



Here is my code from Cybersource REST documentation 

 

 

const cybersourceRestApi = require('cybersource-rest-client');
const configuration = require('../config/Configuration');
const generateRandomString = require('../utils/index');

class PayerAuthenticationController {
  constructor() {
    this.configObject = new configuration();
    this.apiClient = new cybersourceRestApi.ApiClient();
    this.payerAuthenticationApiInstance = new cybersourceRestApi.PayerAuthenticationApi(this.configObject, this.apiClient);
  }

  enrollWithPendingAuthentication(payload) {
    return new Promise((resolve, reject) => {
      try {
        const requestObj = new cybersourceRestApi.CheckPayerAuthEnrollmentRequest();
        const md_data = generateRandomString(50);
        const clientReferenceInformation = new cybersourceRestApi.Riskv1decisionsClientReferenceInformation();
        clientReferenceInformation.code = generateRandomString(20);
        requestObj.clientReferenceInformation = clientReferenceInformation;

        const orderInformation = new cybersourceRestApi.Riskv1authenticationsOrderInformation();
        const orderInformationAmountDetails = new cybersourceRestApi.Riskv1authenticationsOrderInformationAmountDetails();
        orderInformationAmountDetails.currency = payload.currency;
        orderInformationAmountDetails.totalAmount = payload.totalAmount;
        orderInformation.amountDetails = orderInformationAmountDetails;

        const orderInformationBillTo = new cybersourceRestApi.Riskv1authenticationsOrderInformationBillTo();
        orderInformationBillTo.address1 = payload.address1;
        orderInformationBillTo.address2 = payload.address2;
        orderInformationBillTo.administrativeArea = payload.administrativeArea;
        orderInformationBillTo.country = payload.country;
        orderInformationBillTo.locality = payload.locality;
        orderInformationBillTo.firstName = payload.firstName;
        orderInformationBillTo.lastName = payload.lastName;
        orderInformationBillTo.phoneNumber = payload.phoneNumber;
        orderInformationBillTo.email = payload.email;
        orderInformationBillTo.postalCode = payload.postalCode;
        orderInformation.billTo = orderInformationBillTo;

        requestObj.orderInformation = orderInformation;

        const paymentInformation = new cybersourceRestApi.Riskv1authenticationsPaymentInformation();
        const paymentInformationCard = new cybersourceRestApi.Riskv1authenticationsPaymentInformationCard();
        paymentInformationCard.expirationMonth = payload.expirationMonth;
        paymentInformationCard.expirationYear = payload.expirationYear;
        paymentInformationCard.number = payload.cardNumber;
        paymentInformation.card = paymentInformationCard;

        requestObj.paymentInformation = paymentInformation;

        const buyerInformation = new cybersourceRestApi.Riskv1authenticationsBuyerInformation();
        buyerInformation.mobilePhone = payload.mobilePhone;
        requestObj.buyerInformation = buyerInformation;
        

        const consumerAuthenticationInformation = new cybersourceRestApi.Riskv1decisionsConsumerAuthenticationInformation();
        consumerAuthenticationInformation.transactionMode = 'MOTO';
        consumerAuthenticationInformation.md = md_data
        consumerAuthenticationInformation.termUrl = 'https:///24472dc65fd9.ngrok.io/notifications/cybersource';
        requestObj.consumerAuthenticationInformation = consumerAuthenticationInformation;

        this.payerAuthenticationApiInstance.checkPayerAuthEnrollment(requestObj, (error, data, response) => {
          
          
          if (error) {
            console.log('\nError : ' + JSON.stringify(error));
            reject(error);
          } else if (data) {
            console.log('\nData : ' + JSON.stringify(data));
            data['md_data'] = md_data
            resolve(data);
          }
          response['md_data'] = md_data
          resolve(response);
        });
      } catch (error) {
        console.log('\nException on calling the API : ' + error);
        reject(error);
      }
    });
  }
}

module.exports = PayerAuthenticationController;