cancel
Showing results for 
Search instead for 
Did you mean: 

Who Me Too'd this topic

.Net SDK PaymentsApi is not returning tokenInformation

We are using the .Net Cybersource SDK to manage tokens and run payments, but when trying to do a request and generate a token the tokenInformation.shippingAddress, tokenInformation.paymentInstrument and tokenInformation.customer fields on the response are always null, even that doing the same request on the sandbox APIs return the correct values.

Here is our code:
 

var requestObj = new CreatePaymentRequest
{
  ClientReferenceInformation = new Ptsv2paymentsClientReferenceInformation
  {
    Code = account.AccountId.ToString()
  },
    ProcessingInformation = new Ptsv2paymentsProcessingInformation
  {
    CommerceIndicator = "internet",
    Capture = false,
    ActionList = new List<string> { "DECISION_SKIP", "TOKEN_CREATE" }
  },
  OrderInformation = new Ptsv2paymentsOrderInformation
  {
  AmountDetails = new Ptsv2paymentsOrderInformationAmountDetails
  {
    TotalAmount = "0.01",
    Currency = facilitySettings.CurrencySymbol,
  },

  BillTo = new Ptsv2paymentsOrderInformationBillTo
  {
    Country = model.Country,
    AdministrativeArea = model.State,
    PostalCode = model.Zip,
    Email = account.Email,
    Locality = model.City,
    FirstName = model.FirstName,
    LastName = model.LastName,
    Address1 = model.Address
  }
 },
  TokenInformation = new Ptsv2paymentsTokenInformation
  {
    TransientTokenJwt = model.Jwt
  }
};

try
{

  var clientConfig = GetClientConfiguration(settings);

  var apiInstance = new PaymentsApi(clientConfig);
  PtsV2PaymentsPost201Response result = await apiInstance.CreatePaymentAsync(requestObj);
  Console.WriteLine(result);
  return result;
}
catch (Exception e)
{
  Console.WriteLine("Exception on calling the API : " + e.Message);
  return null;
}

felipemk
Member
Who Me Too'd this topic