$ppParams = array(
'METHOD' => 'doDirectPayment',
'PAYMENTACTION' => 'Sale',
'IPADDRESS' => '123.123.123.123',
'AMT' => '222.22',
'DESC' => 'some product',
'CREDITCARDTYPE' => 'VISA',
'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:';
var_dump( $data );
echo '
';
}
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:';
var_dump( $data );
echo '
';
}
= 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' );
== Changelog ==
= 1.0.12 =
* Add httpversion 1.1 to wp_remote_get(). Now required by PayPal Sandbox to support TLS 1.2. - props @cferdinandi
= 1.0.11 =
* Don't verify SSL on validation calls - too many people with out of date CAs
= 1.0.10 =
* Replace instance of _() with __() - Props Ken Bass
= 1.0.9 =
* Use admin-ajax for listener
* Add sslverify filter - props @evansolomon
= 1.0.8 =
* Fix missing quotes
= 1.0.7 =
* Lots of code cleanup, some requiring WordPress 2.8+
* Better help
* Make translatable
= 1.0.6 =
* Fixed a bug that throws a warning for certain requests when in debugging mode. Props Ken Bass