- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
C# add settingType to transactionRequest
We are trying to implement the new API in order to handle level II processing.
I need to pass the duplicateWindow parameter to my transaction. I can't seem to hold my mouth right to pass dup to the transactionRequest. Could some one please tell me how to add the setting to my transaction?
Thanks!
here is my setting:
var dup = new settingType
{
settingName = "duplicateWindow",
settingValue = "28800"
};
here is something else I'm passing to my transaction:
var shippingAddress = new customerAddressType
{
firstName = GridCheckout.GetRowValues(0, "ContactFirstName").ToString(),
lastName = GridCheckout.GetRowValues(0, "ContactLastName").ToString(),
address = GridCheckout.GetRowValues(0, "ShipAddress1").ToString(),
city = GridCheckout.GetRowValues(0, "ShipCity").ToString(),
state = GridCheckout.GetRowValues(0, "ShipStateOrProvince").ToString(),
zip = GridCheckout.GetRowValues(0, "ShipPostalCode").ToString(),
country = "USA"
};
I have
var transactionRequest = new transactionRequestType
{
transactionType = transactionTypeEnum.authCaptureTransaction.ToString(),
amount = rTotalOrder,
payment = paymentType,
order = order,
.
.
.
customer = new customerDataType
{
id = GridCheckout.GetRowValues(0, "CustomerID").ToString(),
},
billTo = billingAddress,
shipTo = shippingAddress,
taxExempt = false,
transactionSettings = dup //<<<<<<----- how do I pass dup to this transaction?
};
12-12-2018 11:09 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @MetraKay & @Proctor951
If you want to pass the duplicateWindow setting, its part of transactionSettings in the new APIs, thus you will need to create transactionSetting with the duplicateWindow first and then pass it in the CreateTransactionRequest, something like this code snippet.
var settings = new settingType[] {
new settingType { settingName = settingNameEnum.duplicateWindow.ToString(), settingValue = "0" }
}; var transactionRequest = new transactionRequestType { transactionType = transactionTypeEnum.authCaptureTransaction.ToString(), // charge the card amount = amount, payment = paymentType, billTo = billingAddress, lineItems = lineItems, transactionSettings=settings};
Hope this Helps!
Kaushik
12-26-2018 03:14 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@MetraKay wrote:We are trying to implement the new API in order to handle level II processing.
I need to pass the duplicateWindow parameter to my transaction. I can't seem to hold my mouth right to pass dup to the transactionRequest. Could some one please tell me how to add the setting to my transaction?
Thanks!
here is my setting:
var dup = new settingType
{
settingName = "duplicateWindow",
settingValue = "28800"
};
here is something else I'm passing to my transaction:
var shippingAddress = new customerAddressType
{
firstName = GridCheckout.GetRowValues(0, "ContactFirstName").ToString(),
lastName = GridCheckout.GetRowValues(0, "ContactLastName").ToString(),
address = GridCheckout.GetRowValues(0, "ShipAddress1").ToString(),
city = GridCheckout.GetRowValues(0, "ShipCity").ToString(),
state = GridCheckout.GetRowValues(0, "ShipStateOrProvince").ToString(),
zip = GridCheckout.GetRowValues(0, "ShipPostalCode").ToString(),
country = "USA"
};
I have
var transactionRequest = new transactionRequestType
{
transactionType = transactionTypeEnum.authCaptureTransaction.ToString(),
amount = rTotalOrder,
payment = paymentType,
order = order,
.
.
.
customer = new customerDataType
{
id = GridCheckout.GetRowValues(0, "CustomerID").ToString(),
},
billTo = billingAddress,
shipTo = shippingAddress,
taxExempt = false,
transactionSettings = dup //<<<<<<----- how do I pass dup to this transaction?
};
Also looking for a solution. Tried myself but failed.
01-11-2022 08:17 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, Is it still working in 2024?
03-06-2024 10:13 PM