Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Payment Gateway in CRM Portals

Posted on by 480

Hi There,

What is the best way to integrate/facilitate payment from CRM Portals ?

I am not able to get the Guid of record which is created through Web From (having 4 steps) . Please suggest If you've already done. 

*This post is locked for comments

  • Rizwan Aarif Profile Picture
    Rizwan Aarif 480 on at
    RE: Payment Gateway in CRM Portals

    Hi Dmytro,

    I tried using the approach you suggested and it worked. The only change I made is that I didn't rely on Top="1" on fetch instead I added the session id in condition to make sure I get the id of record which was created using this session only.

    My First Fetch:-

    <fetch mapping="logical" distinct="true" >
        <entity name="adx_webformsession" >
            <attribute name="adx_primaryrecordid" />
            <attribute name="adx_primaryrecordentitylogicalname" />
            <filter type="and" >
                <condition attribute="adx_webform" operator="eq" value="6FEE49B1-445A-E811-A83E-000D3AE0A6QF" />
                <condition attribute="adx_webformsessionid" operator="eq" value="5a0d68bf-cb67-e811-a839-000d3ae0c885" />
            </filter>
            <order attribute="createdon" descending="true" />
        </entity>
    </fetch>


    And, I knew that this will be "Account" so I, next pulled the invoice which was created against this Account moments ago (using a bg workflow in CRM) using a fetch like below:-

    <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
      <entity name="invoice">
        <attribute name="name" />
        <attribute name="customerid" />
        <attribute name="statuscode" />
        <attribute name="totalamount" />
        <attribute name="invoiceid" />
        <attribute name="createdon" />
        <order attribute="createdon" descending="true" />
        <filter type="and">
          <condition attribute="customerid" operator="eq" uitype="account" value="{92D75DBF-CB67-E811-BD6D-00155D69B551}" />
        </filter>
      </entity>
    </fetch>


    This way I was able to get Ids of records. I used the Invoice details to process payment against it. Thanks once again for pointing me to the right direction. :)

  • Rizwan Aarif Profile Picture
    Rizwan Aarif 480 on at
    RE: Payment Gateway in CRM Portals

    Hi Dmytro,

    Thanks for your suggestion. I believe this will help me get the id of recently created record's id which I need to pass further to payment system I have (a custom azure app).

    Let me try it and will update you. Thanks a lot :)

  • Verified answer
    Dmytro Rutkovskyi Profile Picture
    Dmytro Rutkovskyi 1,835 on at
    RE: Payment Gateway in CRM Portals

    Hi Rizvan,

    I strongly believe that I have over-complicated the things, but you can follow next pattern.
    Every webform has associated sessions (adx_webformsession) which hold list of all submitted and in-process web-form-steps.

    So you can configure the form to allow only auth users to use it.

    Than for the form page you can use Page template with webtemplate type.
    I put here liquid with many "debug" information:

    {% extends 'Layout 1 COlumn' %}
    
    {% block main %}
    {% webform id: page.adx_webform.id %}
    <hr>
    webformid:: {{ page.adx_webform.id }}
    <hr>
    userid {{ user.id }}
    <hr>
    {% fetchxml sesres %}
    <fetch mapping="logical" top="1" returntotalrecordcount="true">
      <entity name="adx_webformsession" >
        <attribute name="adx_primaryrecordid" />
        <attribute name="adx_primaryrecordentitylogicalname" />
            <filter type="and" >
          <condition attribute="adx_webform" operator="eq" value="{{ page.adx_webform.id }}" />
          <condition attribute="adx_contact" operator="eq" value="{{ user.id }}" />
        </filter>
        <order attribute="createdon" descending="true" />
      </entity>
    </fetch>
    {% endfetchxml %}
    <pre>
    {{ sesres.xml | escape }}
    </pre>
    <hr>
    Sessions ({{sesres.results.total_record_count}}) :
    <br>
    {% for s1 in sesres.results.entities %}
     {{ s1.adx_primaryrecordentitylogicalname }}::{{ s1.adx_primaryrecordid }}<br>
     <br>
    {% endfor %}
    
    {% endblock %}
    


    As well you need add entitiypermission for Global scope Read right for auth users for adx_webformsession entity.

    My test page gives me desired result:

    testf.JPG

    As you can see I created web form for account entity and there its resulting id.

    Hope  it helps.

  • Justinjose Profile Picture
    Justinjose 2,707 on at
    RE: Payment Gateway in CRM Portals

    Hi Rizwan,

    Have a look Adoxio Connect 365 Payment Module

    www.adoxio.com/Connect-365

    Can please you explain in detail the question

    Thanks

    Justin Jose

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,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans