I need to record some transaction information, so i need to had code after the :
/**
* At this point you can use the data to generate email notifications,
* update your local database, hit 3rd party web services, or anything
* else you might want to automate based on this type of IPN.
*/
in my “function.php” :
add_action('process_completed_payment_ipn', 'function_name', 10, 1);
function function_name($posted) {
// Parse data from IPN $posted array
$mc_gross = isset($posted['mc_gross']) ? $posted['mc_gross'] : '';
$protection_eligibility = isset($posted['protection_eligibility']) ? $posted['protection_eligibility'] : '';
$payer_id = isset($posted['payer_id']) ? $posted['payer_id'] : '';
$tax = isset($posted['tax']) ? $posted['tax'] : '';
$payment_date = isset($posted['payment_date']) ? $posted['payment_date'] : '';
$payment_status = isset($posted['payment_status']) ? $posted['payment_status'] : '';
$charset = isset($posted['charset']) ? $posted['charset'] : '';
$first_name = isset($posted['first_name']) ? $posted['first_name'] : '';
$mc_fee = isset($posted['mc_fee']) ? $posted['mc_fee'] : '';
$notify_version = isset($posted['notify_version']) ? $posted['notify_version'] : '';
$payer_status = isset($posted['payer_status']) ? $posted['payer_status'] : '';
$business = isset($posted['business']) ? $posted['business'] : '';
$quantity = isset($posted['quantity']) ? $posted['quantity'] : '';
$verify_sign = isset($posted['verify_sign']) ? $posted['verify_sign'] : '';
$payer_email = isset($posted['payer_email']) ? $posted['payer_email'] : '';
$txn_id = isset($posted['txn_id']) ? $posted['txn_id'] : '';
$payment_type = isset($posted['payment_type']) ? $posted['payment_type'] : '';
$btn_id = isset($posted['btn_id']) ? $posted['btn_id'] : '';
$last_name = isset($posted['last_name']) ? $posted['last_name'] : '';
$receiver_email = isset($posted['receiver_email']) ? $posted['receiver_email'] : '';
$shipping_discount = isset($posted['shipping_discount']) ? $posted['shipping_discount'] : '';
$insurance_amount = isset($posted['insurance_amount']) ? $posted['insurance_amount'] : '';
$receiver_id = isset($posted['receiver_id']) ? $posted['receiver_id'] : '';
$txn_type = isset($posted['txn_type']) ? $posted['txn_type'] : '';
$item_name = isset($posted['item_name']) ? $posted['item_name'] : '';
$discount = isset($posted['discount']) ? $posted['discount'] : '';
$mc_currency = isset($posted['mc_currency']) ? $posted['mc_currency'] : '';
$residence_country = isset($posted['residence_country']) ? $posted['residence_country'] : '';
$handling_amount = isset($posted['handling_amount']) ? $posted['handling_amount'] : '';
$shipping_method = isset($posted['shipping_method']) ? $posted['shipping_method'] : '';
$shipping = isset($posted['shipping']) ? $posted['shipping'] : '';
$ipn_track_id = isset($posted['ipn_track_id']) ? $posted['ipn_track_id'] : '';
$IPN_status = isset($posted['IPN_status']) ? $posted['IPN_status'] : '';
/**
* At this point you can use the data to generate email notifications,
* update your local database, hit 3rd party web services, or anything
* else you might want to automate based on this type of IPN.
*/
/*
HERE MY CODE ;
Tried auto-email
write in a file
and session variable at last just for a test
*/
}
I tried to write in a file, to send me a email, a session variable, but nothing appear.
I dont know if my function is called…
Thank