Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


These support forums are now closed for new topics and comments.
Please head on over to http://eureka.ucommerce.net/ for support.

  • Avi 4 posts 34 karma points
    May 26, 2013 @ 14:25
    Avi
    0

    Payment Providers Code Samples

     

    Hi all,

    i'm working currently on creating an external payment window for a local credit card provider, and i'm wondering if someone can share any code examples of something similar they have done.

    basically what i'm trying to do is implement another page that will appear after the user clicks on "complete order" this page will still be part of the website, and will have an iframe directed to my service provider in which the user will be asked to enter his credit card data, click "enter" and when the billing will be done, it will redirect the user to a callback page in my website in which the server will be notified whether the billing process was successful or not, in case of a good result i will transfer the user to the conformation page and mail him a receipt, in case of failure i will show a message regarding the error...

    have anyone done something like that? Currently I'm trying to implement an external payment method using this guide, but I'm wondering if it's the right solution for me, and also can't understand where I get the user information entered in the beginning of the process (such as email, billing address etc…)

    thanks,

    avi

     

  • Lars Horne-Mortensen 40 posts 184 karma points
    May 27, 2013 @ 10:28
    Lars Horne-Mortensen
    0

    Hi Avi,

    The payment gateway should only handle the credit card data, uCommerce handles billing information, shipping information, etc. before the payment step.

    In order to create a new payment provider, you have to create two new classes, one that inherits ExternalPaymentMethodService for handling the callback, and one that inherits AbstractPageBuilder for creating the page which redirects the user to the payment window. Remember to call your AbstractPageBuilder build method from RenderPage in the class that inherits ExternalPaymentMethodService.

    If you wan't to have a closer look at how it works, you can look at the UCommerce.Transactions.Payments.dll with dotPeek.

    Hope that answers your question,

    Lars.

  • Avi 4 posts 34 karma points
    May 27, 2013 @ 10:45
    Avi
    0

    Hi Lars, thank you for your answer.

    by now i did manage to do all of this, but I still can't figure out how to make the AbstractPageBuilder to render the form in the website's template.

    the idea is that I don't want the user to be redirected totally to a different website, but to keep him in the site and use an iframe in which I load my provider's form.

    thank you,

    Avi

  • Lars Horne-Mortensen 40 posts 184 karma points
    May 31, 2013 @ 14:42
    Lars Horne-Mortensen
    0

    Hi,

    You need an iframe pointing to the correct PaymentRequest.axd URL.

    The format for the PaymentRequest.axd handler, is /<pms>/<pid>/PaymentRequest.axd.

    <pms> is the PaymentMethodService id, which you can find ind the database.

    <pid> is the current Payment id.

    PaymentRequest.axd is responsible for redirecting to the corrent payment gateway, which will then happen inside the iframe, when pointed to the URL.

    /Lars

Please Sign in or register to post replies

Write your reply to:

Draft