PayPal Standard is a basic way to add PayPal payments to your website. It consists of a small snippet of HTML code dropped into your site code where you would like the button to be displayed.
In the video we review a complaint from a user in /r/paypal. I guess you could say I disagree with their opinions.
Below the video is a quick, step-by-step guide showing you how to adjust your PayPal Standard HTML code to accept Authorizations.
1. Find Your PayPal Standard Button Code
Your PayPal Standard button code will look similar to this.
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" name="paypal_form" id="paypal_form">
<input type="hidden" name="cmd" value="_cart" />
<input type="hidden" name="business" value="firstname.lastname@example.org" />
<input type="hidden" name="upload" value="1" />
<input type="hidden" name="item_name_1" value="Woo Ninja" />
<input type="hidden" name="amount_1" value="35.00" />
<input type="hidden" name="quantity_1" value="1" />
<input type="hidden" name="shipping_1" value="0" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="lc" value="US" />
<input type="hidden" name="bn" value="PP-BuyNowBF" />
<input type="image" style="border: 0; margin-bottom: 3px;" src="https://www.paypalobjects.com/webstatic/en_US/i/buttons/checkout-logo-medium.png" width="170" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!" />
2. Add or Update the “paymentaction” Parameter
<input type="hidden" name="paymentaction" value="authorization">
Firstly great video and information that you have provided.
We are looking to try to authorize a PayPal payment and then capture it at a later date, using the WP-Ecommerce Plugin, using PayPal Standard Payments.
Below is a link to the PayPal file, but we’re unsure of how to tweak the code to be able to achieve the authorize and capture feature.
Any ideas / suggestions would be very much appreciated!
Link below to the file:
It looks like they are setting the PayPal Standard parameters at L120-L129 (https://github.com/wp-e-commerce/WP-e-Commerce/blob/branch-3.15.1/wpsc-merchants/paypal-standard.merchant.php#L120-L129). In order to make payments run as Authorizations you would just need to add ‘payment_action’ => ‘authorization’ to $paypal_vars.
To capture within the WP-Ecommerce order you would have to extend their plugin to add a button for that, and hook it up to a DoCapture API call with PayPal.
If you need help with that you can submit a ticket to our Help Desk and we can get you a bid on doing that work for you.
Firstly many thanks for such a quick reply and for also taking the time to provide such detailed information. This is very much appreciated.
I added ‘payment_action’ => ‘authorization’ to $paypal_vars at line 129.
When I went to try out some test transactions with our PayPal sandbox account, all the test payments were coming through as completed payments, instead of authorizations.
Would you have an idea or know of a possible reason of why the payments are coming through as authorizations with this code implemented?
Would you have an idea or know of a possible reason of why the payments aren’t coming through as authorizations with this code implemented?
Just a courtesy e-mail to say that I’ve got this working.
I needed to change: payment_action’ => ‘authorization’ to paymentaction (no underscore) and it’s working now! Thanks again for all your help!