Description
Action hook fires upon a successful IPN transaction.
Parameters
$user_id
(integer) The user’s primary key ID.
$details
(array) An array of transaction values from PayPal, keyed as follows:
- payment_date
- receiver_email
- item_name
- item_number
- payment_status
- pending_reason
- mc_gross
- mc_fee
- tax
- mc_currency
- txn_id
- txn_type
- transaction_subject
- first_name
- last_name
- address_name
- address_street
- address_city
- address_state
- address_zip
- address_country
- address_country_code
- residence_country
- address_status
- payer_email
- payer_status
- payment_type
- payment_gross
- payment_fee
- notify_version
- verify_sign
- referrer_id
- business
- ipn_track_id
$success
(string) Always “success” (makes it possible for a single function to manage wpmem_ipn_success, wpmem_ipn_failed, and wpmem_ipn_invalid).
Usage
This example saves a user meta key “my_custom_key” with the PayPal transaction ID (“txn_id”)
add_action( 'wpmem_ipn_success', 'my_ipn_success', 10, 3 ); function my_ipn_success( $user_id, $details, $success ) { // Example updates a user meta key "my_custom_key" with // the PayPal transaction ID. update_user_meta( $user_id, 'my_custom_key', $details['txn_id'] ); }
Changelog
Introduced in version 0.6.0
Source
wpmem_ipn_success is located in includes/class-wp-members-ipn-listener.php.