Skip to content
This repository has been archived by the owner on Jul 20, 2020. It is now read-only.

Commit

Permalink
Update example_usage_advanced.php
Browse files Browse the repository at this point in the history
  • Loading branch information
BigRedBot authored Jan 8, 2018
1 parent 3bb2b99 commit ffa4a00
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions php/example_usage_advanced.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,22 @@
$timestamp = $date . " " . $hour . ":" . $minute . ":" . $second . " " . $timezone;
$dated_log_file_dir = $log_file_dir . "/" . $test_text . $year . "/" . $test_text . $month;

$process_ipn = false;
$paypal_ipn_status = "VERIFICATION FAILED";
if ($verified) {
$paypal_ipn_status = "RECEIVER EMAIL MISMATCH";
if ($receiver_email_found) {
$process_ipn = true;
$paypal_ipn_status = "Completed Successfully";
}
} elseif ($enable_sandbox) {
if ($DATA["test_ipn"] != 1) {
$paypal_ipn_status = "RECEIVED FROM LIVE WHILE SANDBOXED";
}
} elseif ($DATA["test_ipn"] == 1) {
$paypal_ipn_status = "RECEIVED FROM SANDBOX WHILE LIVE";
}

function send_email($name = "", $address = "", $subject = "", $body = "", $from_name = null, $from_address = null, $html = true) {
if (is_null($from_name)) { $from_name = $GLOBALS["from_email_name"]; }
if (is_null($from_address)) { $from_address = $GLOBALS["from_email_address"]; }
Expand All @@ -101,22 +117,6 @@ function send_plain_email($name = "", $address = "", $subject = "", $body = "",
return send_email($name, $address, $subject, $body, $from_name, $from_address, $html);
}

$process_ipn = false;
$paypal_ipn_status = "VERIFICATION FAILED";
if ($verified) {
$paypal_ipn_status = "RECEIVER EMAIL MISMATCH";
if ($receiver_email_found) {
$process_ipn = true;
$paypal_ipn_status = "Completed Successfully";
}
} elseif ($enable_sandbox) {
if ($DATA["test_ipn"] != 1) {
$paypal_ipn_status = "RECEIVED FROM LIVE WHILE SANDBOXED";
}
} elseif ($DATA["test_ipn"] == 1) {
$paypal_ipn_status = "RECEIVED FROM SANDBOX WHILE LIVE";
}

if ($process_ipn) {

// Process IPN
Expand Down

0 comments on commit ffa4a00

Please sign in to comment.