Plugin - PayPal v2 (Create custom order forms)
The RSForm!Pro PayPal v2 Payment Integration Plugin allows you to add a new payment method to the existing Payment Package of RSForm!Pro.
Downloading and Installing the plugin
Download
You can download the plugin by logging with your purchase user, then head to Downloads > My Downloads > RSForm!Pro - view all plugins and modules > RSForm!Pro Files > Plugins > "PayPal v2 Plugin for Joomla!".
Install
In the backend of your Joomla! installation go to the Extensions > Install/Uninstall page, and install the plugin. Next thing is to publish the plugin, to do this go to Extensions > Plug-in Manager, search for the "RSForm!Pro - PayPal v2" plugin and publish it.
Configuring the plugin
Configuring the PayPal v2 payment gateway can be done from Components > RSForm!Pro > Configuration > PayPal v2 tab:
- Client ID : A client ID identifies an app. You only need a client ID to get a PayPal payment button and standard credit and debit card fields.
- Client Secret : A client secret authenticates a client ID. To call PayPal APIs, you'll exchange your client ID and client secret for an access token. Keep this secret safe.
- Return URL: Optional, provide an URL to which the users will be redirected after finalizing the payment
- Cancel URL: Optional, provide an URL to which the users will be redirected after cancelling the payment
- Mode: Sandbox (Test Payments) / Production (Live Payments)
- (optional) Tax Type: Percent (%) / Fixed Rate
- (optional) Tax Value: Amount of tax. Total amount of the transaction must include this amount.
- Language code: Provide a 2-character language code. Please consult the Countries and Regions Supported by PayPal list for more information
You can retrieve the Client ID and Client Secret from your PayPal account. After logging in, you'll need to create a new application from the 'App & Credentials' section. You'll be then prompted with these two keys.
How to use the PayPal v2 plugin
After configuring the PayPal v2 parameters from Components > RSForm!Pro > Configuration > PayPal v2 tab, all you need to do is to make sure that you're adding the dedicated payment fields in order to be properly redirected to the PayPal v2 payment processor.
Making sure the form is sent to the payment processor
The payment details will only be sent to the PayPal v2 payment processor if the user selects PayPal v2 from the "Choose Payment" field before submitting the form.
The "Choose Payment" field is used in order to allow the users to choose their payment method. It displays the payment methods added to the form in either a Dropdown or Radio Group. It can be shown on the form (allowing the user to select his preferred payment method) or not (forcing the user to pay using the default payment method).
If you are using a single payment method and you need to hide the Choose payment field, this can be achieved by editing the field and setting to "No" the "Show in front-end?" option within the "Attributes" tab.
For the PayPal v2 payment method to be available within the Choose payment field, the (Payment) PayPal v2 field needs to be added in the form.
Adding costs
In order to receive funds using RSForm!Pro and PayPal v2 payment plugin, your form needs to include a cost. In order to add costs to your form you can use any of the following fields:
- Single Product - Adds a single product to the form. For this type of field you can set up a caption, description and a price.
- Multiple Products - Adds the ability to display multiple products to be purchased either in a Dropdown or a Checkbox. Its items need to be specified in the following manner: price | label (ex: 15 | T-shirt)
- Donation - Allows the user to type in the amount to be paid inside a standard Textbox.
- Quantity - Allows the user to choose the amount of products (simple or multiple).
- Total - This field is used alongside the Donation, Single and Multiple Products fields. It calculates the total price to be paid.
Modifying PayPal vars through 'Scripts called after form has been processed'
This process is similar to the already existing example regarding the PayPal parameters control. First you will need to get a new instance of the PayPal v2 object, which is done with:
$paypal = RSFormProPayPalV2::getInstance();
Then you can override parameters as follows (this will change the Cancel URL brand name):
$paypal->args = ['payment_source' => ['paypal' => ['experience_context' => ['brand_name' => 'My Website']]]];
Version 1.0.2
- Updated - Payments are now sorted in the 'Choose Payment' field according to the same order in the form.
Version 1.0.1
- Added - Joomla! 5 native compatibility - no longer needs the 'Behaviour - Backward Compatibility' plugin.