I am able to create sales invoice using web service method CreateSalesInvoice(). However, I see following error in the event log when I specify payment type as Card. It works when I give it as Cash.
Exception message:
Sql procedure error codes returned:
Error Number = 48 Stored Procedure= taCreateSopPaymentInsertRecord Error Description = Credit card name is invalid
Node Identifier Parameters: taCreateSopPaymentInsertRecord
SOPNUMBE = CINO06/May/09/55/29
SOPTYPE = 3
PYMTTYPE = 6
Related Error Code Parameters for Node : taCreateSopPaymentInsertRecord
CARDNAME = Note: This parameter was not passed in, no value for the parameter will be returned.
<taCreateSopPaymentInsertRecord>
<SOPTYPE>3</SOPTYPE>
<SOPNUMBE>CINO06/May/09/55/29</SOPNUMBE>
<CUSTNMBR>SAI15MAY0110593</CUSTNMBR>
<DOCAMNT>8.00</DOCAMNT>
<RCTNCCRD>xxxxxxxxxxxx8766</RCTNCCRD>
<PYMTTYPE>6</PYMTTYPE>
<Action>1</Action>
<MDFUSRID>WS_GPAPP</MDFUSRID>
</taCreateSopPaymentInsertRecord>
Stack Trace:
at Microsoft.Dynamics.GP.eConnect.EntityMessageProcessor.ExecuteSqlCommands(XElement transactionNode, EntityMessage message)
at Microsoft.Dynamics.GP.eConnect.eConnectMethods.ProcessMessageImport(EntityMessage message)
at Microsoft.Dynamics.GP.eConnect.eConnectMethods.EntityImportImplementation(String connectionString, String sXML, Boolean isTransaction)
at Microsoft.Dynamics.GP.eConnect.eConnectMethods.ProcessEntityImport(String connectionString, String sXML, Boolean isTransaction)
at Microsoft.Dynamics.GP.eConnect.eConnectMethods.CreateEntity(String connectionString, String sXML)
Exception type:
Microsoft.Dynamics.GP.eConnect.eConnectException
Exception message:
Error Number = 48 Stored Procedure taCreateSopPaymentInsertRecord Error Description = Credit card name is invalid
It says that credit card name is missing but I can't find a property in SalesPayment object to provide it. This is how I have provided other details.
SalesPayment payment = new SalesPayment();
payment.PaymentAmount = new MoneyAmount() { Currency = "AUD", DecimalDigits = 2, Value = (8.00m) };
payment.PaymentCardNumber = "xxxxxxxxxxxx8766";
payment.Type = SalesPaymentType.PaymentCardPayment;
salesInvoice.Payments = new SalesPayment[] { payment };