Welcome to Mediachase Community Sign in | Join | Help    
in Search   

Payment Gateway Implementation

Last post Thu, Feb 11 2010, 11:34 AM by truthbrother. 7 replies.
Sort Posts: Previous Next
  •  Fri, Oct 06 2006, 12:21 PM 3859

    Payment Gateway Implementation

    Hello,
     
    I'm implementing a new payment gateway option for the ECF (that our actual webstore application uses). This payment gateway takes control and performs the autorization on several pages on their own app space and then returns to the webstore where we make some verifications steps and finalize the purchase process. This return point must be an URL that we give to them.
     
    For what I've read on the ECF's code documentation the most similar scenario for this is the PayPal implementation. On this implementation I've noticed that:
     
       a. PreProcess and PostProcess on IPaymentOption implementation take all the "burden". I Can't seem to find the .Charge method implemented on a class implementing IPaymentGateway which has a lot of resposibility on other payments options (RPS for example). This confuses me.
     
       b. PostProcess seems to make the HTTP request to the external app (PayPal on this case) and "release" the control flow of the purchase process for authorization.
     
    Please, correct me if I'm wrong on these observations.
     
    On the other hand, I cant seem to discover the "returning" mechanisim for the PayPal implementation, which I'm using as a "guide" for my own payment gateway option. On PublicStore's webconfig I can see some parameters on this such as :PayPal.ProcessUrl, PayPal.ConfirmUrl, PayPalExpress.ReturnURL but don't see them used anywhere I've looked at. Am I missing something? I've also seen on the PublicStore some PayPal CheckOut related modules but seem to be partially implemented.
     
    Please, Where I can find information for getting depth knowledge about this returning steps?.
     
    I must be able to:
     
    1. Provide the guys at the payment gateway a Returning URL. This logically will be a page I can add to the PublicStore and perform the validation steps and then redirecting to ... something....(2.)
     
    2. "Hook up" onto the final step on CheckOutWizard (or similar), maybe and standard URL for doing this?!
     
    Thanks a lot

    Thanks a lot,
    Rolando.-
    -------------------------------------
    ECF Version: 4.1.2
    Full Source Code License
    Windows 2003 Server
    SQL Server 2005 Standard
    Visual Studio 2005 SP1
    -------------------------------------
  •  Thu, Oct 12 2006, 3:12 PM 3906 in reply to 3859

    Re: Payment Gateway Implementation

    Answer provided in email correspondance:

    PayPal works the following way:
        During the checkout process, the customer is redirected to PayPal site. While redirecting to PayPal site, ReturnURL is passed to the gateway in query string (PayPal) or as a function parameter - we use PayPal API here (PayPalExpress). CancelURL is passed the same way. This can be seen, for example, in WebUtility\Plugins\PaymentGateways\PayPalExpress\PayPalExpressGateway.cs file.

    On the site the customer enters payment info (does not actually pay, only establishes something like "session" with paypal). After clicking on "continue" button on that site he goes back to the store. Here paypal returns special token that will be used later to perform transaction. When customer clicks "Place order", CreateOrder method in WebServices is called and that's where Charge method for the payment gateway is executed and payment transaction is processed (Token returned by the paypal is used here).

        For PayPal Express we use special checkout controls, including CheckoutWizardModule (see folder  PublicStore\MasterTemplates\Default\Modules\Checkout\PayPalExpress\).
        How to get redirected to exact wizard step after entering payment info, you can see InitializeData() method in PublicStore\MasterTemplates\Default\Modules\Checkout\PayPalExpress\CheckoutPayPalExpressWizardModule.ascx file.
        The idea is very simple: during wizard initialization, data returned from paypal get checked and depending on what is returned (whether customer cancelled or confirmed payment) the corresponding step is loaded. That's why CancelURL and ReturnURL are the same and point to CheckoutWizard.

    PayPal site contains document describing the whole checkout process. Here's the link: https://www.paypal.com/en_US/pdf/PayflowPro_Guide.pdf
    Diagram showing checkout process is on page 70.

  •  Fri, Aug 28 2009, 8:54 AM 11116 in reply to 3906

    Re: Payment Gateway Implementation

    Could you please be more detail?
    I have the same problem in ECF G5, I can't return to the correct step. how can I do that?
    Another question, where should I bring the customer to PayPal web site? (call SetExpressCheckout method) in which method/event?

    Thanks in advance.

    Allan
  •  Mon, Aug 31 2009, 10:01 AM 11120 in reply to 11116

    Re: Payment Gateway Implementation

    Hi Alan,

    This forum is for ECF 4.x.  For ECF G5 questions, please email ecf50@mediachase.com.

    Mediachase Software

  •  Wed, Feb 03 2010, 2:04 AM 11237 in reply to 11120

    Re: Payment Gateway Implementation


    My paypal express checkout works until I click [Process Payment]

    I get the error
    Failed to process payment for payment option "PayPal Express"

    The error is occuring somewhere in ClientCart.PlaceOrder but I am unable to debug it due to not having the backend code and PayPalExpress not working at all when I try to run it locally.

    Any idea what is going on?

    In Mediachase.eCF.Web.Plugins.PaymentGateways.PayPalExpress the comment mentions "ECF Web Service will be the one that actually initiates the final order submission to the PayPal service." What webservice is that exactly. Also is there any way to get a more detailed error then mentioned above.

    Please help, this is doing my head in.

    Cheers
    Tim
  •  Thu, Feb 04 2010, 11:10 AM 11239 in reply to 11237

    Re: Payment Gateway Implementation

    Hi Tim,

    It is difficult for us to help troubleshoot payment gateway issues if you do not have the full source code.

    Here is some documentation in case you haven't seen them already --

    http://docs.mediachase.com/doku.php?id=ecf:41:tutorials:paypal
    http://docs.mediachase.com/doku.php?id=ecf:41:tutorials:payment

    Hope this helps.

    Mediachase Software
  •  Wed, Feb 10 2010, 3:42 AM 11244 in reply to 11239

    Re: Payment Gateway Implementation

    Thanks TB...

    I have read both of those articles and they didn't really help much unfortunately..

    Here is an extact of my log file. See if you can work out what is going on. Usually I dont even get the Paypal: Transaction failed message. I never see the DoExpressCheckoutPayment in the log call so I assume the error is before it is sent?!?
    2010-02-10 11:48:58,810 [2920] INFO  com.paypal.sdk.core.APICaller [(null)] - SetExpressCheckout sent
    2010-02-10 11:49:00,310 [2920] INFO  com.paypal.sdk.core.APICaller [(null)] - SetExpressCheckout Ack : Success Elapsed Time : 500 ms
    2010-02-10 11:50:10,735 [2920] INFO  com.paypal.sdk.core.APICaller [(null)] - GetExpressCheckoutDetails sent
    2010-02-10 11:50:12,251 [2920] INFO  com.paypal.sdk.core.APICaller [(null)] - GetExpressCheckoutDetails Ack : Success Elapsed Time : 515 ms
    2010-02-10 11:50:12,251 [2920] INFO  com.paypal.sdk.core.APICaller [(null)] - GetExpressCheckoutDetails sent
    2010-02-10 11:50:13,891 [2920] INFO  com.paypal.sdk.core.APICaller [(null)] - GetExpressCheckoutDetails Ack : Success Elapsed Time : 640 ms
    2010-02-10 11:50:21,735 [5044] INFO  com.paypal.sdk.core.APICaller [(null)] - GetExpressCheckoutDetails sent
    2010-02-10 11:50:23,314 [5044] INFO  com.paypal.sdk.core.APICaller [(null)] - GetExpressCheckoutDetails Ack : Success Elapsed Time : 578 ms
    2010-02-10 12:04:39,409 [180] ERROR Mediachase.eCF.BusLayer.Audit.Log [(null)] - PayPal: Transaction Failed
    System.Net.WebException: The request was aborted: The request was canceled. ---> System.IO.IOException: Cannot close stream until all bytes are written.
       at System.Net.ConnectStream.CloseInternal(Boolean internalCall, Boolean aborting)
       --- End of inner exception stack trace ---
       at System.Net.ConnectStream.CloseInternal(Boolean internalCall, Boolean aborting)
       at System.Net.ConnectStream.System.Net.ICloseEx.CloseEx(CloseExState closeState)
       at System.Net.ConnectStream.Dispose(Boolean disposing)
       at System.IO.Stream.Close()
       at System.IO.StreamWriter.Dispose(Boolean disposing)
       at System.IO.StreamWriter.Close()
       at Mediachase.eCF.PaymentGateways.Paypal.PayPalResponsePage.Page_Load(Object sender, EventArgs e)
    2010-02-10 12:05:28,130 [5648] ERROR Mediachase.eCF.BusLayer.Audit.Log [(null)] - Paypal: Transaction failed, response INVALID


    Cheers
    Tim
  •  Thu, Feb 11 2010, 11:34 AM 11246 in reply to 11244

    Re: Payment Gateway Implementation

    Hi Tim,

    Unfortunately, this log does not provide enough details. 

    What version of the ECF are you running? 

    Have you looked on the paypal site?  As with all payment gateways, Paypal has been known to change their process/parameters in the past so you have to understand that your custom code will have to be adjusted to align with paypal.

    Here is one link that may be helpful -- https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_nvp_errorcodes

    I would double check your payment and your shipping gateway settings.

    This may be a long shot, but for example, if you are using UPS rates along with warehouses, it's necessary for every SKU to define a warehouse which contains the address of the sender. If the warehouse for the SKU is not set in the UPS XML in the section <Shipper> disappears that results at the following error "The XML document is well formed but the document is not valid".  Also SKUs should be determined by package and weight.

    If you cannot get past this hurdle, upgrading to full source may be one option.  The latest is ECF 4.1.2. 

    Hope this helps.

    Mediachase Software

View as RSS news feed in XML
Site Terms | Privacy Policy | About Us | Contact Us
Running on Mediachase eCommerce Framework 4.0.
  Copyright © Mediachase, LTD. 1997-2006. All Rights Reserved

E-commerce, HelpDesk, Service Desk & Project Management Software, alternatives to Microsoft Project Server & Sharepoint Collaboration Server
project management software | microsoft project server | sharepoint collaboration server | issues management, helpdesk & service desk
Powered by Community Server, by Telligent Systems