I am using the sdk-node library.
I am attempting to use the authorize-credit-card.js sample and add track data to the process.
The class PaymentType in apicontracts.js shows setTrackData as an available method.
I've tried applying it to the payment class using:
12-22-2023 06:19 AM
use this code
const paymentSDK = require('sdk-node'); // Replace 'sdk-node' with the actual SDK module
// Initialize the SDK with your credentials or configuration
paymentSDK.initialize({
apiKey: 'your_api_key',
// other configuration parameters
});
// Create a transaction object with the required details
const cardPresentTransaction = {
amount: 1000, // Replace with your desired amount
trackData: 'your_encrypted_track_data', // Replace with the actual encrypted track data
// other transaction details
};
// Set the track data for the Card Present transaction
paymentSDK.setTrackData(cardPresentTransaction.trackData);
// Process the transaction
paymentSDK.processTransaction(cardPresentTransaction)
.then(result => {
// Handle the result of the transaction
console.log('Transaction result:', result);
})
.catch(error => {
// Handle errors
console.error('Transaction error:', error);
});
12-22-2023 12:44 PM
paymentSDK.initialize is not a function
I've searched all of the node-sdk files and cannot find any reference to the method "initialize" or "processTransaction." Are you just making up pseudocode?
Where is the documentation for your code, showing all the parameters, their formatting and required fields?
12-23-2023 08:02 AM
You're encountering an issue with the SDK while attempting to add track data to a credit card transaction. The error message suggests that the 'track data' element is not being recognized as a valid child element within the 'payment' element.
To troubleshoot, make sure you are using the correct structure and method for adding track data. Here's a revised version of your code with adjustments:
In this revised code, I added the setPaymentType method to set the payment type to 'CREDITCARD explicitly' and used setTrackData directly on the paymentType object. Ensure that the SDK documentation aligns with these modifications, and adjust accordingly based on your SDK version.
If the issue persists, consider checking the SDK documentation or contacting the SDK's support for specific guidance on handling track data in card-present transactions.
12-24-2023 11:28 PM
Thanks for the replies. Unfortunately, again, I'm getting advice for methods that do not exist in the sdk-node library. paymentType.setPaymentType is not a method that exists on the ApiContracts.PaymentType() class. Also ApiContracts does not have a property PaymentTypeEnum.
I've already searched the documentation, which is why I am posting here. There are no mentions of how to apply track data using the sdk-node library.
12-28-2023 11:24 AM
Use dataSource Property: If the documentation suggests using dataSource, modify your code as follows:
var paymentType = new ApiContracts.PaymentType();
paymentType.setCreditCard(creditCard);
paymentType.setDataSource(ApiContracts.PaymentType.DATA_SOURCE.TRACK_DATA);
Consult SDK Documentation: Refer to the sdk-node library's documentation for specific instructions on how to provide track data within the context of the chosen data source. There might be additional methods or properties involved. adobe flash player
12-29-2023 03:40 AM
What specific documentation exists for applying trackData? I've looked. I don't see any documentation, only the classes that exist in the apicontracts.js file, of which PaymentType.DATA_SOURCE.TRACK_DATA is not part of.
There is nothing within the sdk-node repository, the sdk-node issues, or the Authorize.net API Documentation, that shows how to apply track data using the sdk-node library.
12-29-2023 03:59 AM