$value) { $value = urlencode(stripslashes($value)); $content .= "&$key=$value"; } $response = 'ERROR'; if (in_array('curl', get_loaded_extensions())) { // try using custom CA information -- included with the plugin $response = awpcp_paypal_verify_recevied_data_with_curl($content, true, $errors); // try using default CA information -- installed in the server if (strcmp($response, 'ERROR') === 0) $response = awpcp_paypal_verify_recevied_data_with_curl($content, false, $errors); } if (strcmp($response, 'ERROR') === 0) $response = awpcp_paypal_verify_received_data_with_fsockopen($content, $errors); return $response; } /** * email the administrator and the user to notify that the payment process was failed * @since 2.1.4 */ function awpcp_payment_failed_email($transaction, $message='') { $user = get_userdata($transaction->user_id); // user email $mail = new AWPCP_Email; $mail->to[] = "{$user->display_name} <{$user->user_email}>"; $mail->subject = get_awpcp_option('paymentabortedsubjectline'); $template = AWPCP_DIR . '/frontend/templates/email-abort-payment-user.tpl.php'; $mail->prepare($template, compact('message', 'user', 'transaction')); $mail->send(); // admin email $mail = new AWPCP_Email; $mail->to[] = awpcp_admin_email_to(); $mail->subject = __("Customer attempt to pay has failed", "AWPCP"); $template = AWPCP_DIR . '/frontend/templates/email-abort-payment-admin.tpl.php'; $mail->prepare($template, compact('message', 'user', 'transaction')); $mail->send(); }