PayPal is a leading payment processing option that has gained tremendous popularity over the internet marketplace. Dynamic Forms with PayPal Integration allows customers to offer their users more flexibility in the way they pay for their transactions. To find out more about PayPal, please visit http://www.paypal.com.
A term that is often used here is Instant Payment Notification (IPN). This is the definition obtained from PayPal's website:
Instant Payment Notification (IPN) is PayPal's interface for handling real-time purchase confirmation and server-to-server communications. IPN delivers immediate notification and confirmation of PayPal payments you receive and provides status and additional data on pending, cancelled, or failed transactions.
In all demonstrations related to PayPal integration, the focus would be in 2 general areas:
1. The parameters used to pass transaction details to PayPal.
2. The creation of completion events that are tied to different IPN’s.
You will need to have a PayPal seller account to process payments this way. We recommend obtaining a PayPal Sandbox account while you are in test mode.
Setting Payment Gateway to PayPal
1. Go to Module Configuration, Payment Gateway. Set Enable Payment Gateway to Yes and select PayPal as the gateway.
2. Further down, click on PayPal Gateway and observe the following:
a. Enter the email you set for your PayPal seller account.
b. Select "Purchase" as the PayPal Payment Type.
c. PayPal URL is either Sandbox.Paypal.com (test) or PayPal.com (production).
Parameters are the way we pass transaction details to PayPal. It is advisable that you review the description of various PayPal variables (also referred to as tokens). For now, go to Module Configuration, PayPal Gateway and find this section.
In this demonstration, we used Data Springs Modules as the general description for the variable &item_name. This was done because multiple items may be ordered in this scenario. If the form only asked for a single selection, we could have used &item_name=$(Products_Text) for a more specific description displayed on the Paypal Page.
To indicate US Dollars, we used the parameter ¤cy_code=USD. Please check with PayPal for codes referring to other currencies.
Please note that there are a number of ways to obtain your totals aside from setting a fixed value like we did here or using a client-side event to get the value for $(YourTotal). Other possibilities are:
* Allow users to enter the total amount.
* Question Events: Use the property to ‘Set default value of another field based on the response of a field.
* Use the $(Calc_Total) parameter in the Payment Gateway (not PayPal Gateway) to total fields.
* Use client side events to obtain totals. Please see Demo 20 for tips and examples.
Use the tokens to define parameters as shown in the example. Except in the ItemName, absolutely no spaces are allowed with the parameters. Even one space will cause your PayPal link to error out.
Four completion events were created for this demo. After a completion event is created, it needs to be ‘tied’ to a PayPal IPN. In this manner, an IPN received will trigger the completion event to fire. Go to Module Configuration, Payment Gateway to view this section.
Notice that the event, 'Thank you Email,' is tied to 'Completed (Standard) in the PayPal Gateway. This means that the email will go out only after PayPal sends the Completed IPN.
The payment status called 'Redirect Successfully' is tied to the event Success Redirect. This page redirection event will fire when a user clicks on 'Return to Merchant.' from the PayPal page after the transaction. In this example, it is set to go back to this page. You may choose to redirect to a different page that contains a 'Thank you.' message.
Cancel Redirect will will fire when a user clicks on 'Cancel' during order processing. In this example, it is set to go back to this page. Again, you may choose to create a page to alert users that the order was not completed. This event is tied to 'Redirect after Cancel.’
Lastly, an email event called ‘Pending Email’ is tied to Pending and is intended to notify customers of their order status should there be any delay. If your customer used an e-check the process may take several days to complete.
Remember to click Save Completion Event / PayPal Status Setting each time you link an event to an IPN.
This is a basic example but there are many variations that may be more appropriate for your implementation. Demos 15-18 show you a variety of applications but note that your own specifications may require a combination of the showcased features. Please Contact Us if you need assistance in designing your solution.