Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsStoreStoreHow to deal with a redirect during the payment process?How to deal with a redirect during the payment process?
Previous
 
Next
New Post
1/10/2013 10:30 PM
 

Gday,

I have written a gateway provider that sends the user to a 3rd party website for payment and after a successful payment it redirects them back to the checkout page, but it displays the Contact page/usercontrol and not the payment usercontrol.

I know that I can use invokePaymentSucceeded() and its kin to progress to the last checkout stage but I need show the response from the server and I cant seem to do that on the last stage.

Could someone please explain how to display the payment usercontrol after being redirected back to the checkout page?

Thanks

 
New Post
1/12/2013 1:37 PM
 

Hi,

Please provide me more informations especially when it's about dev!

1) Which Store version do you use?
2) What's the provider name?
3) Do you have a link to their dev documentation?

Your provider seems to works like the PayPal provider, then I will use this provider to explain how it works in the code and I suppose you use the last Store version (03.01.07). PayPal have 3 URL parameters: ReturnURL, CancelURL and NotifyURL. If you look at the code of this provider, you can see that a ReturnURL, CancelURL and NotifyURL are computed (PayPalPayment.ascx.cs, method ConfirmOrder) and added as parameters (form fields) to the form submited to the provider address (this is done inside provider.ProcessTransaction(...) and return an instance of DotNetNuke.Store.Cart.RemoteForm). ReturnURL and CancelURL uses a PayPalNavigation object to create both URLs, the resulting URL is the current URL with two query string parameters added at the end: http://www.domainname.tld/pagename/default.aspx?GatewayExit=[return/cancel]&OrderID=[order number]. Those query string parameters are required, we will see later how to use it. NotifyURL is build by string concatenation because this is a different URL used by PayPal to inform your website of the transaction result (accepted, rejected, ...) in the background (IPN process).

When the visitor return from the provider page, your payment control (PROVIDERNAMEPayment.ascx.cs) is reloaded by the Checkout control. You have to test the query string parameters to decide what to do in your control! The PayPal provider (PayPalPayment.ascx.cs) check the order status in the Page_Load event. If the query string contains a parameter GatewayExit with the value equal to RETURN, the order status is checked (PayPalIPNParameters object) and depending of the result, InvokePaymentSucceeded() or InvokePaymentRequiresConfirmation() is called. Those events callback are used to display the correct message (thank you..., awaiting payment...) to the user. Finally, the payment control is hidden (CheckoutControl.Hide()) and the wrapper panel is hidden (this is not really required, it's just a double security!). If you want to display something else than the order number and confirmation message, DON'T call CheckoutControl.Hide()! Instead, you should have two panels in your control. The first one with message and button to build the form and redirect to the provider website, and a second one to display a specific message when you return from the provider website. This way, by default you will have to hide the second panel in the Page_Load event and depending of the query string parameters hide the first one and display the second one!

Gilles


We (team members) are Humans offering their knowledge, their work and their spare time FOR FREE to benefit the community. It would be so particularly appreciated that your messages begin with "Hello" and end with "Thank you" or any other form of politeness. Ask yourself what your reaction would be, if you were approached by me (a total stranger) on the street to ask you something without saying "Hello" nor "Thank you"? After several years of services dedicated to the community, I begin to be tired to read requests without any form of politeness.
 
New Post
1/13/2013 7:12 PM
 
Hi Gilles,

Thanks for your response, I am using version 03.01.07 and I have access to the dev documentation.

Long story short I was deleting the order and the cart too early causing a null exception error when setting the order status, which lead to CheckoutControl.Hide() being called.

Thanks for your time.
 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsStoreStoreHow to deal with a redirect during the payment process?How to deal with a redirect during the payment process?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out