Skip to main content

Notifications

Microsoft Dynamics GP (Archived)

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

Posted on by Microsoft Employee

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

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

    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.

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Specifying Credit Card name while creating a sales invoice using CreateSalesInvoice() web service method

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

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Specifying Credit Card name while creating a sales invoice using CreateSalesInvoice() web service method

    Hi Shan,

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

    Thanks,

    Sai

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Specifying Credit Card name while creating a sales invoice using CreateSalesInvoice() web service method

    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
    Community Member Microsoft Employee on at
    RE: Specifying Credit Card name while creating a sales invoice using CreateSalesInvoice() web service method

    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

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Specifying Credit Card name while creating a sales invoice using CreateSalesInvoice() web service method

    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

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans