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 };
*This post is locked for comments
Hi shan M
How can insert multiple payment type in orders of GP using econnect?
I am able to insert one record but I am not able to find solution on adding others.
I have the fixed the issue by setting PaymentCardTypeKey property as below.
SalesPayment payment = new SalesPayment();
payment.PaymentAmount = new MoneyAmount() { Currency = "AUD", DecimalDigits = 2, Value = (8.00m) };
payment.PaymentCardNumber = "xxxxxxxxxxxx1111";
payment.Type = SalesPaymentType.PaymentCardPayment;
payment.PaymentCardTypeKey = new PaymentCardTypeKey() { Id = "AMEX" };
payment.AuthorizationCode = "76765";
salesInvoice.Payments = new SalesPayment[] { payment };
Hi Shan,
I don't know how to pass that node. I am using proxy classes, not XML.
Thanks,
Sai
Sai,
The error message was from "taCreateSopPaymentInsertRecord" it has got that field, try passing the node. It may solve your problem.
Hi Shan,
As you see, I am not using XML to pass values. I am using C# objects and methods generated by Service Reference proxy. Here is my code.
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 };
Please let me know how to pass required parameters.
Thanks,
Sai
Hi Sai,
I believe from the above, you were not passing the required parameters for the Credit Card type(e.g Credit Card Name) for this schema taCreateSopPaymentInsertRecord. For the Payment using Credit Card type, in addition you should be passing the CARDNAME,RCTNCCRD,AUTHCODE &EXPNDATE. Try passing all the given parameters with values and let us know if this solves your problem.
Refer the link for schema reference:
https://msdn.microsoft.com/en-us/library/jj193347.aspx
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156