Plugin Directory

Test out the new Plugin Directory and let us know what you think.

PayPal Framework

PayPal integration framework and admin interface as well as IPN listener.

How do I send a request to PayPal?

To send a request to PayPal, simply build the request as an associative array and pass it to the hashCall helper function like this:

$ppParams = array(
    'METHOD'         => 'doDirectPayment',
    'PAYMENTACTION'  => 'Sale',
    'IPADDRESS'      => '',
    'AMT'            => '222.22',
    'DESC'           => 'some product',
    'ACCT'           => '4111111111111111',
    'EXPDATE'        => '112011',
    'CVV2'           => '123',
    'FIRSTNAME'      => 'Aaron',
    'LASTNAME'       => 'Campbell',
    'EMAIL'          => 'pptest@xavisys.com',
    'STREET'         => '123 some pl',
    'STREET2'        => '',
    'CITY'           => 'San Diego',
    'STATE'          => 'CA',
    'ZIP'            => '92101',
    'COUNTRYCODE'    => 'US',
    'INVNUM'         => '12345',

$response = hashCall($ppParams);

How do I use the Listener to process PayPal messages?

First you have to tell PayPal to send message to the correct URL. Go to the PayPal Framework settings page and click the "PayPal IPN Listener URL" link to see instructions on how to use the URL that's listed there. Once your PayPal account has been set up the listener will automatically process all IPN messages and turn them into WordPress actions that you can hook into. You can use the 'paypal-ipn' action to look at every message you ever get, or hook directly into a 'paypal-{transaction-type}' hook to process a specific type of message:

add_action('paypal-ipn', 'my_process_ipn');
function my_process_ipn( $data ) {
    echo 'Processing IPN Message:<pre>';
    var_dump( $data );
    echo '</pre>';

add_action('paypal-recurring_payment_failed', 'my_process_ipn_recurring_payment_failed');
function my_process_ipn_recurring_payment_failed( $data ) {
    echo 'A recurring payment has failed. Here is the data I have to process this:<pre>';
    var_dump( $data );
    echo '</pre>';

Why do you set sslverify to false?

Many servers have out of date certificate lists, so this is necessary to be as portable as possible. However, if your server is set up right you can force sslverify like this:

add_filter( 'paypal_framework_sslverify', '__return_true' );

Requires: 2.8 or higher
Compatible up to: 4.5.5
Last Updated: 9 months ago
Active Installs: 1,000+


5 out of 5 stars


Got something to say? Need help?


Not enough data

0 people say it works.
0 people say it's broken.

100,2,2 0,1,0