Posts: 2
Registered: ‎01-14-2021

How do I set the invoiceNumber in the .NET SDK using VB.nET

I have been trying to wrap my brain around the invoiceNumber field.  It's blank in my transaction e-mail and I want to be able to set the invoice number in the VB.NET SDK.


What I have found so far is that invoiceNumber is a part of the transaction request under the order property.  However when I try to set it I get errors.  I tried this first:


Dim transactionRequest As New transactionRequestType With
.transactionType = transactionTypeEnum.authCaptureTransaction.ToString(),
.amount = adprice,
.payment = paymentType,
.billTo = billingAddress,
.lineItems = adlineItems,
.order.invoiceNumber = adnumber


That gave me an error that invoiceNumber is not a part of transactionRequestType


I tried this method as well

transactionRequest.order.invoiceNumber = adnumber and that gives me a null refrence object error.


What am I supposed to do to send the invoiceNumber.


Everything else in my code works just fine.



Posts: 2
Registered: ‎01-14-2021

Re: How do I set the invoiceNumber in the .NET SDK using VB.nET

Ok I figured it out.  This has to be done with the orderType class.  This goes BEFORE the transactionRequest class.


'Set the invoice number and description
Dim orderType As New orderType With {
.invoiceNumber = adnumber.ToString(),
.description = Left(txtAdDescription.Text, 255)