Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics RMS (Archived)

How to get the tender type of a transaction

Posted on by 70

Hi,

 I am builiding an add-on that is being invoked on TenderEndHook. I need to know the tender type of the current transaction so that i may check if the customer is paying through his/her account or cash or any other way so apply subsequient custom logic. e.g when customer is using his/her account for payment, i want to get this tender type, similarly if customer is paying cash, i want to capture this in my add-on, same is the case with other tender types. I get the tender collection via Transaction class but not the current tender type that is asscicated with the current trasaction. Hopefully i have explained adequatly. Is there any solution???

 Thanks in advance

Alia 

*This post is locked for comments

  • Alia Profile Picture
    Alia 70 on at
    Re: Re: How to get the tender type of a transaction

    Peter,

    Thanks for your reply. It solved my problem. I did it as under:

    Tenders TendersTypes = mySession.Transaction.Tenders;

    decimal dmlCurrentCreditAmount = 0;

    foreach (Tender Tendertype in TendersTypes)

    {

    TenderDescriptor Tendscripter = Tendertype.Descriptor;if (Tendscripter.TenderType.ToString()=="TenderAccount")

    {

    dmlCurrentCreditAmount += Tendertype.AmountIn;

    }

    Thanks once again.

    }Thanks
  • Peter Matogo Profile Picture
    Peter Matogo 475 on at
    Re: How to get the tender type of a transaction

    Hi Alia,

    I can think of one possible way of doing this:
    My idea is that you can iterate through all the TenderTypes of the current transaction. Any tender type that has an amount greater than zero, can be assumed to be involved in paying for the total amount of the current transaction.

    The Tenders object in the current transaction is simply a collection of all currently defined tender types. Each Tender will have an "AmountIn" property which retrieves the total amount of the tender taken in. If this amount is greater than zero, then that specific tender was used in the payment. Keep in mind that the customer can pay for the current transasction using more than one tender type (for example, using a cash and gift voucher or cash plus credit card) which is why I am suggesting evaluating the amount taken in for each tender type to determine which tender types were used in the payment.

    I hope I have been helpful. If not please let me know. we could even share some code snippets!

    kind regards,
    Peter.

     

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!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans