FormerMember

Creating Sales Order with Payment/Transaction data

Posted By FormerMember

I'm trying to create Sales Orders within Sage 100 via C#, but I've been having trouble including payment information. I wonder if anyone could please help get me on the right track.

I've been able to set a Freight Amount, but I've not be able to set any more fields relating to payment.

I'm either getting "The column is not in the IOList.", when I try to set the PaymentType.

I've also received the error "You must enter credit card information in the following fields to accept the transaction.ŠŠPayment TypeŠExpiration Date YearŠExpiration Date MonthŠLast 4 Unencrypted Credit Card NumbersŠCredit Card Authorization Number", but attempts to set any of the above values results in the above error.

Am I incorrectly trying to set these values on SO_SalesOrder_bus, when I should be using another class?

The payments are made via Sage Payments and where there is one, we have access to the token used. Is it possible to include this data? Is it possible to fetch the transaction data from Sage Payments (date, transaction id, etc.) instead?

This is the my current attempt to set PaymentType, the GetPaymentType() method returns a String with a value matching a Payment Type's (I've tried using a few values that match existing Payment Types)

If I remove the setValue for PaymentType, I successfully create a Sales Order.

using (DispatchObject so_salesorder_bus = new DispatchObject(pvx.InvokeMethod("NewObject", "SO_SalesOrder_bus", oSS.GetObject())))

{

// code setting key and other values omitted for brevity

String PaymentType = "";

PaymentType = so_salesorder_bus.InvokeMethod("nSetValue", "PaymentType$", GetPaymentType(salesOrder.payments[0].cc_type)).ToString();

if (Int32.Parse(PaymentType) < 1)

{

return MagentoBridge.Bridge.GetBOIError(so_salesorder_bus);

}

String writeSalesOrder = "";

writeSalesOrder = so_salesorder_bus.InvokeMethod("nWrite").ToString();

if (Int32.Parse(writeSalesOrder) < 1)

{

return MagentoBridge.Bridge.GetBOIError(so_salesorder_bus);

}

else

{

OrderSuccessResponseWrapper responseWrapper = new OrderSuccessResponseWrapper(sageCustomerNumber, nextOrderNo);

return JsonConvert.SerializeObject(responseWrapper);

}

}