May 5, 2014 at 1:00 PM
Edited May 5, 2014 at 1:02 PM
We are realy sorry for the delay but the whole team has been busy lately on third release of Magelia WebStore and the extension store.
As agreed, here is a sample Paypal implementation using Magelia WebStore module for Orchard.
The following code sample that you can download from here
is composed of two parts :
=> A view that you have to copy in your Orchard current theme folder according to the following path : "[YOUR_THEME_FOLER]/Views/DisplayTemplates/Checkout/ProceedToPayment.cshtml".
You will see in this view that you have few things to specify :
var business = "[mail_address]@[provider].[ext]"; // Your Paypal business ID
var returnPath = this.Url.Content("~/"); // Relative path of the payment confirmation page.
var cancelPath = this.Url.Content("~/"); // Relative path of the cancellation page.
var publicUrl = "http://www.[your_public_domain].[ext]"; // Public domain of your application, which will be used to generate public URL reachable by Paypal IPN services and to redirect the customer.
Once this view is configured and placed at the right place within the current theme folder it will be automatically used as the last step of the checkout process to automatically redirect customers on the Paypal platform, which will allow them to pay their
Please note that in the sample view the Paypal sandbox is used. Once you are ready to go live you will just have to remove the sandbox prefix of the url referenced in the action attribute of the form tag :
<form method="post" action="https://www.paypal.com/cgi-bin/webscr" class="mag-proceedToPayment">
=> The second part of this code sample is an Orchard module project that relies on Magelia WebStore module in order to handle Paypal IPN.
Once installed and activated this module will automatically track Paypal payments, update order status and trigger the sending of the appropriate emails to customers regarding the state of the payment reported by Paypal.
This module is simple as it contains only one controller. Its aim is to handle and verify Paypal IPN in order to register payments that you will be able to see the in the Magelia WebStore Administration console in the payments tab of the order detail screen.
If the payment is declared as completed by Payal and if it corresponds to the correct order amount then the order status will be updated to "approved" otherwise if the customer has cancelled is payment the order status "cancelled" will
Please note that the Paypal sandbox URL is also referenced in this controller so to go live you will have to removed the sandbox prefix :
private const String VerificationUrl = "https://www.paypal.com/cgi-bin/webscr?cmd=_notify-validate";
We hope that this code sample will be helpful and do not hesitate if you have any further questions.