web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

Specifying Credit Card name while creating a sales invoice using CreateSalesInvoice() web service method

(0) ShareShare
ReportReport
Posted on by

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

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at

    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

    SalesInvoiceCC.jpg

  • Community Member Profile Picture
    on at

    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

  • Community Member Profile Picture
    on at

    Sai,

    The error message was from "taCreateSopPaymentInsertRecord" it has got that field, try passing the node. It may solve your problem.

  • Community Member Profile Picture
    on at

    Hi Shan,

    I don't know how to pass that node. I am using proxy classes, not XML.

    Thanks,

    Sai

  • Suggested answer
    Community Member Profile Picture
    on at

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

  • Ratnadeep Dasgupta Profile Picture
    5 on at

    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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

#1
Dan Liebl Profile Picture

Dan Liebl 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans