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

Community site session details

Session Id :
Microsoft Dynamics RMS (Archived)

How to get the tender type of a transaction

(0) ShareShare
ReportReport
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

I have the same question (0)
  • Peter Matogo Profile Picture
    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.

     

  • Alia Profile Picture
    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

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics RMS (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans