cancel
Showing results for 
Search instead for 
Did you mean: 

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.

 

Thanks.

alambert
Member
1 REPLY 1

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)
}

alambert
Member