コード例 #1
0
ファイル: cpt-donations.php プロジェクト: johnmanlove/NoOn1
 public function show_donation_detail($donation_id)
 {
     $html = "";
     $html .= "<table class='widefat'><tbody>\n";
     $year = get_post_meta($donation_id, '_dgx_donate_year', true);
     $month = get_post_meta($donation_id, '_dgx_donate_month', true);
     $day = get_post_meta($donation_id, '_dgx_donate_day', true);
     $time = get_post_meta($donation_id, '_dgx_donate_time', true);
     $html .= "<tr>";
     $html .= "<th>" . esc_html__('Date', 'seamless-donations') . "</th>";
     $html .= "<td>" . esc_html($month . "/" . $day . "/" . $year . " " . $time) . "</td></tr>\n";
     $amount = get_post_meta($donation_id, '_dgx_donate_amount', true);
     $currency_code = dgx_donate_get_donation_currency_code($donation_id);
     $formatted_amount = dgx_donate_get_escaped_formatted_amount($amount, 2, $currency_code);
     $html .= "<tr>";
     $html .= "<th>" . esc_html__('Amount', 'seamless-donations') . "</th>";
     $html .= "<td>" . $formatted_amount . "</td></tr>\n";
     $add_to_mailing_list = get_post_meta($donation_id, '_dgx_donate_add_to_mailing_list', true);
     if (!empty($add_to_mailing_list)) {
         $add_to_mailing_list = __('Yes', 'seamless-donations');
     } else {
         $add_to_mailing_list = __('No', 'seamless-donations');
     }
     $html .= "<tr><th>" . esc_html__('Add to Mailing List?', 'seamless-donations') . "</th>";
     $html .= "<td>" . esc_html($add_to_mailing_list) . "</td></tr>\n";
     $anonymous = get_post_meta($donation_id, '_dgx_donate_anonymous', true);
     if (empty($anonymous)) {
         $anonymous = __('No', 'seamless-donations');
     } else {
         $anonymous = __('Yes', 'seamless-donations');
     }
     $html .= "<tr><th>" . esc_html__('Would like to remain anonymous?', 'seamless-donations') . "</th>";
     $html .= "<td>" . esc_html($anonymous) . "</td></tr>\n";
     $fund_name = __('Undesignated', 'seamless-donations');
     $designated = get_post_meta($donation_id, '_dgx_donate_designated', true);
     if (!empty($designated)) {
         $fund_name = get_post_meta($donation_id, '_dgx_donate_designated_fund', true);
     }
     $html .= "<tr><th>" . esc_html__('Designated Fund', 'seamless-donations') . "</th>";
     $html .= "<td>" . esc_html($fund_name) . "</td></tr>\n";
     $employer_match = get_post_meta($donation_id, '_dgx_donate_employer_match', true);
     if (empty($employer_match)) {
         $employer_match_message = __('No', 'seamless-donations');
     } else {
         $employer_match_message = __('Yes', 'seamless-donations');
     }
     $html .= "<tr><th>" . esc_html__('Employer Match', 'seamless-donations') . "</th>";
     $html .= "<td>" . esc_html($employer_match_message) . "</td></tr>\n";
     $employer_name = get_post_meta($donation_id, '_dgx_donate_employer_name', true);
     if (empty($employer_name)) {
         $employer_name_message = '-';
     } else {
         $employer_name_message = $employer_name;
     }
     $html .= "<tr><th>" . esc_html__('Employer', 'seamless-donations') . "</th>";
     $html .= "<td>" . esc_html($employer_name_message) . "</td></tr>\n";
     $occupation = get_post_meta($donation_id, '_dgx_donate_occupation', true);
     if (empty($occupation)) {
         $occupation_message = '-';
     } else {
         $occupation_message = $occupation;
     }
     $html .= "<tr><th>" . esc_html__('Occupation', 'seamless-donations') . "</th>";
     $html .= "<td>" . esc_html($occupation_message) . "</td></tr>\n";
     $donor_country = get_post_meta($donation_id, '_dgx_donate_donor_country', true);
     if ('GB' == $donor_country) {
         $uk_gift_aid = get_post_meta($donation_id, '_dgx_donate_uk_gift_aid', true);
         if (empty($uk_gift_aid)) {
             $uk_gift_aid_message = __('No', 'seamless-donations');
         } else {
             $uk_gift_aid_message = __('Yes', 'seamless-donations');
         }
         $html .= "<tr><th>" . esc_html__('UK Gift Aid', 'seamless-donations') . "</th>";
         $html .= "<td>" . esc_html($uk_gift_aid_message) . "</td></tr>\n";
     }
     $tribute_gift_message = __('No', 'seamless-donations');
     $tribute_gift = get_post_meta($donation_id, '_dgx_donate_tribute_gift', true);
     if (!empty($tribute_gift)) {
         $tribute_gift_message = __('Yes', 'seamless-donations') . " - ";
         $honoree_name = get_post_meta($donation_id, '_dgx_donate_honoree_name', true);
         $honor_by_email = get_post_meta($donation_id, '_dgx_donate_honor_by_email', true);
         $honoree_email_name = get_post_meta($donation_id, '_dgx_donate_honoree_email_name', true);
         $honoree_post_name = get_post_meta($donation_id, '_dgx_donate_honoree_post_name', true);
         $honoree_email = get_post_meta($donation_id, '_dgx_donate_honoree_email', true);
         $honoree_address = get_post_meta($donation_id, '_dgx_donate_honoree_address', true);
         $honoree_city = get_post_meta($donation_id, '_dgx_donate_honoree_city', true);
         $honoree_state = get_post_meta($donation_id, '_dgx_donate_honoree_state', true);
         $honoree_province = get_post_meta($donation_id, '_dgx_donate_honoree_province', true);
         $honoree_zip = get_post_meta($donation_id, '_dgx_donate_honoree_zip', true);
         $honoree_country = get_post_meta($donation_id, '_dgx_donate_honoree_country', true);
         $memorial_gift = get_post_meta($donation_id, '_dgx_donate_memorial_gift', true);
         if (empty($memorial_gift)) {
             $tribute_gift_message .= __('in honor of', 'seamless-donations') . ' ';
         } else {
             $tribute_gift_message .= __('in memory of', 'seamless-donations') . ' ';
         }
         $tribute_gift_message .= $honoree_name . "<br/><br/>";
         if ('TRUE' == $honor_by_email) {
             $tribute_gift_message .= __('Send acknowledgement via email to', 'seamless-donations') . '<br/>';
             $tribute_gift_message .= esc_html($honoree_email_name) . "<br/>";
             $tribute_gift_message .= esc_html($honoree_email) . "<br/>";
         } else {
             $tribute_gift_message .= __('Send acknowledgement via postal mail to', 'seamless-donations') . '<br/>';
             $tribute_gift_message .= esc_html($honoree_post_name) . "<br/>";
             $tribute_gift_message .= esc_html($honoree_address) . "<br/>";
             if (!empty($honoree_city)) {
                 $tribute_gift_message .= esc_html($honoree_city . " ");
             }
             if ('US' == $honoree_country) {
                 $tribute_gift_message .= esc_html($honoree_state . " ");
             } else {
                 if ('CA' == $honoree_country) {
                     $tribute_gift_message .= esc_html($honoree_province . " ");
                 }
             }
             if (dgx_donate_country_requires_postal_code($honoree_country)) {
                 $tribute_gift_message .= esc_html(" " . $honoree_zip);
             }
             $tribute_gift_message .= "<br/>";
             $countries = dgx_donate_get_countries();
             $honoree_country_name = $countries[$honoree_country];
             $tribute_gift_message .= esc_html($honoree_country_name) . "<br/><br/>";
         }
     }
     $html .= "<tr>";
     $html .= "<th>" . esc_html__('Tribute Gift', 'seamless-donations') . "</th>";
     $html .= "<td>" . $tribute_gift_message . "</td></tr>\n";
     $payment_method = get_post_meta($donation_id, '_dgx_donate_payment_method', true);
     $html .= "<tr><th>" . esc_html__('Payment Method', 'seamless-donations') . "</th>";
     $html .= "<td>" . esc_html($payment_method) . "</td></tr>\n";
     $repeating = get_post_meta($donation_id, '_dgx_donate_repeating', true);
     $is_repeating_donation = !empty($repeating);
     if ($is_repeating_donation) {
         $repeatingText = __('Yes', 'seamless-donations');
     } else {
         $repeatingText = __('No', 'seamless-donations');
     }
     $html .= "<tr><th>" . esc_html__('Repeating', 'seamless-donations') . "</th>";
     $html .= "<td>" . esc_html($repeatingText) . "</td></tr>\n";
     $session_id = get_post_meta($donation_id, '_dgx_donate_session_id', true);
     $html .= "<tr><th>" . esc_html__('Session ID', 'seamless-donations') . "</th>";
     $html .= "<td>" . esc_html($session_id) . "</td></tr>\n";
     $transaction_id = get_post_meta($donation_id, '_dgx_donate_transaction_id', true);
     $html .= "<tr><th>" . esc_html__('Transaction ID', 'seamless-donations') . "</th>";
     $html .= "<td>" . esc_html($transaction_id) . "</td></tr>\n";
     $html .= "</tbody></table>\n";
     if ($is_repeating_donation) {
         // Display links to related (same session ID) donations
         $related_donation_ids = get_donations_by_meta('_dgx_donate_session_id', $session_id, -1);
         // Unset this donation if present (it probably will be)
         if (($index = array_search($donation_id, $related_donation_ids)) !== false) {
             unset($related_donation_ids[$index]);
         }
         $html .= "<h3>" . esc_html__('Related Donations', 'seamless-donations') . "</h3>\n";
         $html .= "<p class='description'>";
         $html .= esc_html__('For repeating donations, displays a list of other donations in the series (subscription)', 'seamless-donations');
         $html .= "</p>\n";
         // Show the array
         $html .= "<table class='widefat'><tbody>\n";
         if (count($related_donation_ids)) {
             $html .= "<tr>";
             $html .= "<th>" . esc_html__('Date', 'seamless-donations') . "</th>";
             $html .= "<th>" . esc_html__('Transaction ID', 'seamless-donations') . "</th></tr>";
             foreach ((array) $related_donation_ids as $related_donation_id) {
                 $year = get_post_meta($related_donation_id, '_dgx_donate_year', true);
                 $month = get_post_meta($related_donation_id, '_dgx_donate_month', true);
                 $day = get_post_meta($related_donation_id, '_dgx_donate_day', true);
                 $time = get_post_meta($related_donation_id, '_dgx_donate_time', true);
                 $donation_date = $month . "/" . $day . "/" . $year;
                 $transaction_id = get_post_meta($related_donation_id, '_dgx_donate_transaction_id', true);
                 $donation_detail = seamless_donations_get_donation_detail_link($related_donation_id);
                 $html .= "<tr>";
                 $html .= "<td><a href='" . esc_url($donation_detail) . "'>" . esc_html($donation_date . " " . $time) . "</a></td>";
                 $html .= "<td>" . esc_html($transaction_id) . "</td></tr>\n";
             }
         } else {
             $html .= "<tr>";
             $html .= "<th>" . esc_html__('No related donations found', 'seamless-donations') . "</th>";
             $html .= "</tr>\n";
         }
         $html .= "</tbody></table>\n";
     }
     return $html;
 }
コード例 #2
0
 function handle_verified_ipn()
 {
     $sd4_mode = get_option('dgx_donate_start_in_sd4_mode');
     $payment_status = $this->post_data["payment_status"];
     dgx_donate_debug_log("IPN VERIFIED for session ID {$this->session_id}");
     dgx_donate_debug_log("PayPal reports payment status: {$payment_status}");
     if ("Completed" == $payment_status) {
         // Check if we've already logged a transaction with this same transaction id
         $donation_id = get_donations_by_meta('_dgx_donate_transaction_id', $this->transaction_id, 1);
         if (0 == count($donation_id)) {
             // We haven't seen this transaction ID already
             // See if a donation for this session ID already exists
             $donation_id = get_donations_by_meta('_dgx_donate_session_id', $this->session_id, 1);
             if (0 == count($donation_id)) {
                 // We haven't seen this session ID already
                 // Retrieve the data
                 if ($sd4_mode == false) {
                     // retrieve from transient
                     $donation_form_data = get_transient($this->session_id);
                 } else {
                     // retrieve from audit db table
                     $donation_form_data = seamless_donations_get_audit_option($this->session_id);
                 }
                 if (!empty($donation_form_data)) {
                     // Create a donation record
                     if ($sd4_mode == false) {
                         dgx_donate_debug_log("Creating donation from transient data in pre-4.x mode.");
                         $donation_id = dgx_donate_create_donation_from_transient_data($donation_form_data);
                     } else {
                         dgx_donate_debug_log("Creating donation from transaction audit data in 4.x mode.");
                         $donation_id = seamless_donations_create_donation_from_transient_data($donation_form_data);
                     }
                     dgx_donate_debug_log("Created donation {$donation_id} for session ID {$this->session_id}");
                     if ($sd4_mode == false) {
                         // Clear the transient
                         delete_transient($this->session_id);
                     }
                 } else {
                     // We have a session_id but no transient (the admin might have
                     // deleted all previous donations in a recurring donation for
                     // some reason) - so we will have to create a donation record
                     // from the data supplied by PayPal
                     if ($sd4_mode == false) {
                         $donation_id = dgx_donate_create_donation_from_paypal_data($this->post_data);
                         dgx_donate_debug_log("Created donation {$donation_id} " . "from PayPal data (no transient data found) in pre-4.x mode.");
                     } else {
                         $donation_id = seamless_donations_create_donation_from_paypal_data($this->post_data);
                         dgx_donate_debug_log("Created donation {$donation_id} " . "from PayPal data (no audit db data found) in 4.x mode.");
                     }
                 }
             } else {
                 // We have seen this session ID already, create a new donation record for this new transaction
                 // But first, flatten the array returned by get_donations_by_meta for _dgx_donate_session_id
                 $donation_id = $donation_id[0];
                 $old_donation_id = $donation_id;
                 if ($sd4_mode == false) {
                     $donation_id = dgx_donate_create_donation_from_donation($old_donation_id);
                 } else {
                     $donation_id = seamless_donations_create_donation_from_donation($old_donation_id);
                 }
                 dgx_donate_debug_log("Created donation {$donation_id} (recurring donation, donor data copied from donation {$old_donation_id}");
             }
         } else {
             // We've seen this transaction ID already - ignore it
             $donation_id = '';
             dgx_donate_debug_log("Transaction ID {$this->transaction_id} already handled - ignoring");
         }
         if (!empty($donation_id)) {
             // Update the raw paypal data
             update_post_meta($donation_id, '_dgx_donate_transaction_id', $this->transaction_id);
             update_post_meta($donation_id, '_dgx_donate_payment_processor', 'PAYPALSTD');
             update_post_meta($donation_id, '_dgx_donate_payment_processor_data', $this->post_data);
             // save the currency of the transaction
             $currency_code = $this->post_data['mc_currency'];
             dgx_donate_debug_log("Payment currency = {$currency_code}");
             update_post_meta($donation_id, '_dgx_donate_donation_currency', $currency_code);
         }
         // @todo - send different notification for recurring?
         // Send admin notification
         dgx_donate_send_donation_notification($donation_id);
         // Send donor notification
         dgx_donate_send_thank_you_email($donation_id);
     }
 }
コード例 #3
0
 static function show($donation_id)
 {
     // Validate User
     if (!current_user_can('manage_options')) {
         wp_die(__('You do not have sufficient permissions to access this page.', 'seamless-donations'));
     }
     // Get form arguments
     $delete_donation = "";
     if (isset($_POST['delete_donation'])) {
         $delete_donation = $_POST['delete_donation'];
     }
     // If we have form arguments, we must validate the nonce
     if (count($_POST)) {
         $nonce = $_POST['dgx_donate_donation_detail_nonce'];
         if (!wp_verify_nonce($nonce, 'dgx_donate_donation_detail_nonce')) {
             wp_die(__('You do not have sufficient permissions to access this page.', 'seamless-donations'));
         }
     }
     echo "<div class='wrap'>\n";
     echo "<div id='icon-edit-pages' class='icon32'></div>\n";
     echo "<h2>" . esc_html__('Donation Detail', 'seamless-donations') . "</h2>\n";
     $donation_deleted = false;
     if ("true" == $delete_donation) {
         dgx_donate_debug_log("Donation (ID: {$donation_id}) deleted");
         wp_delete_post($donation_id, true);
         /* true = force delete / bypass trash */
         $donation_deleted = true;
         $message = __('Donation deleted', 'seamless-donations');
     }
     // Display any message
     if (!empty($message)) {
         echo "<div id='message' class='updated below-h2'>\n";
         echo "<p>" . esc_html($message) . "</p>\n";
         echo "</div>\n";
     }
     if (!$donation_deleted) {
         echo "<div id='col-container'>\n";
         echo "<div id='col-right'>\n";
         echo "<div class='col-wrap'>\n";
         echo "<h3>" . esc_html__('Donation Details', 'seamless-donations') . "</h3>\n";
         echo "<table class='widefat'><tbody>\n";
         $year = get_post_meta($donation_id, '_dgx_donate_year', true);
         $month = get_post_meta($donation_id, '_dgx_donate_month', true);
         $day = get_post_meta($donation_id, '_dgx_donate_day', true);
         $time = get_post_meta($donation_id, '_dgx_donate_time', true);
         echo "<tr>";
         echo "<th>" . esc_html__('Date', 'seamless-donations') . "</th>";
         echo "<td>" . esc_html($month . "/" . $day . "/" . $year . " " . $time) . "</td></tr>\n";
         $amount = get_post_meta($donation_id, '_dgx_donate_amount', true);
         $currency_code = dgx_donate_get_donation_currency_code($donation_id);
         $formatted_amount = dgx_donate_get_escaped_formatted_amount($amount, 2, $currency_code);
         echo "<tr>";
         echo "<th>" . esc_html__('Amount', 'seamless-donations') . "</th>";
         echo "<td>" . $formatted_amount . "</td></tr>\n";
         $add_to_mailing_list = get_post_meta($donation_id, '_dgx_donate_add_to_mailing_list', true);
         if (!empty($add_to_mailing_list)) {
             $add_to_mailing_list = __('Yes', 'seamless-donations');
         } else {
             $add_to_mailing_list = __('No', 'seamless-donations');
         }
         echo "<tr><th>" . esc_html__('Add to Mailing List?', 'seamless-donations') . "</th>";
         echo "<td>" . esc_html($add_to_mailing_list) . "</td></tr>\n";
         $anonymous = get_post_meta($donation_id, '_dgx_donate_anonymous', true);
         if (empty($anonymous)) {
             $anonymous = __('No', 'seamless-donations');
         } else {
             $anonymous = __('Yes', 'seamless-donations');
         }
         echo "<tr><th>" . esc_html__('Would like to remain anonymous?', 'seamless-donations') . "</th>";
         echo "<td>" . esc_html($anonymous) . "</td></tr>\n";
         $fund_name = __('Undesignated', 'seamless-donations');
         $designated = get_post_meta($donation_id, '_dgx_donate_designated', true);
         if (!empty($designated)) {
             $fund_name = get_post_meta($donation_id, '_dgx_donate_designated_fund', true);
         }
         echo "<tr><th>" . esc_html__('Designated Fund', 'seamless-donations') . "</th>";
         echo "<td>" . esc_html($fund_name) . "</td></tr>\n";
         $employer_match = get_post_meta($donation_id, '_dgx_donate_employer_match', true);
         if (empty($employer_match)) {
             $employer_match_message = __('No', 'seamless-donations');
         } else {
             $employer_match_message = __('Yes', 'seamless-donations');
         }
         echo "<tr><th>" . esc_html__('Employer Match', 'seamless-donations') . "</th>";
         echo "<td>" . esc_html($employer_match_message) . "</td></tr>\n";
         $employer_name = get_post_meta($donation_id, '_dgx_donate_employer_name', true);
         if (empty($employer_name)) {
             $employer_name_message = '-';
         } else {
             $employer_name_message = $employer_name;
         }
         echo "<tr><th>" . esc_html__('Employer', 'seamless-donations') . "</th>";
         echo "<td>" . esc_html($employer_name_message) . "</td></tr>\n";
         $occupation = get_post_meta($donation_id, '_dgx_donate_occupation', true);
         if (empty($occupation)) {
             $occupation_message = '-';
         } else {
             $occupation_message = $occupation;
         }
         echo "<tr><th>" . esc_html__('Occupation', 'seamless-donations') . "</th>";
         echo "<td>" . esc_html($occupation_message) . "</td></tr>\n";
         $donor_country = get_post_meta($donation_id, '_dgx_donate_donor_country', true);
         if ('GB' == $donor_country) {
             $uk_gift_aid = get_post_meta($donation_id, '_dgx_donate_uk_gift_aid', true);
             if (empty($uk_gift_aid)) {
                 $uk_gift_aid_message = __('No', 'seamless-donations');
             } else {
                 $uk_gift_aid_message = __('Yes', 'seamless-donations');
             }
             echo "<tr><th>" . esc_html__('UK Gift Aid', 'seamless-donations') . "</th>";
             echo "<td>" . esc_html($uk_gift_aid_message) . "</td></tr>\n";
         }
         $tribute_gift_message = __('No', 'seamless-donations');
         $tribute_gift = get_post_meta($donation_id, '_dgx_donate_tribute_gift', true);
         if (!empty($tribute_gift)) {
             $tribute_gift_message = __('Yes', 'seamless-donations') . " - ";
             $honoree_name = get_post_meta($donation_id, '_dgx_donate_honoree_name', true);
             $honor_by_email = get_post_meta($donation_id, '_dgx_donate_honor_by_email', true);
             $honoree_email_name = get_post_meta($donation_id, '_dgx_donate_honoree_email_name', true);
             $honoree_post_name = get_post_meta($donation_id, '_dgx_donate_honoree_post_name', true);
             $honoree_email = get_post_meta($donation_id, '_dgx_donate_honoree_email', true);
             $honoree_address = get_post_meta($donation_id, '_dgx_donate_honoree_address', true);
             $honoree_city = get_post_meta($donation_id, '_dgx_donate_honoree_city', true);
             $honoree_state = get_post_meta($donation_id, '_dgx_donate_honoree_state', true);
             $honoree_province = get_post_meta($donation_id, '_dgx_donate_honoree_province', true);
             $honoree_zip = get_post_meta($donation_id, '_dgx_donate_honoree_zip', true);
             $honoree_country = get_post_meta($donation_id, '_dgx_donate_honoree_country', true);
             $memorial_gift = get_post_meta($donation_id, '_dgx_donate_memorial_gift', true);
             if (empty($memorial_gift)) {
                 $tribute_gift_message .= __('in honor of', 'seamless-donations') . ' ';
             } else {
                 $tribute_gift_message .= __('in memory of', 'seamless-donations') . ' ';
             }
             $tribute_gift_message .= $honoree_name . "<br/><br/>";
             if ('TRUE' == $honor_by_email) {
                 $tribute_gift_message .= __('Send acknowledgement via email to', 'seamless-donations') . '<br/>';
                 $tribute_gift_message .= esc_html($honoree_email_name) . "<br/>";
                 $tribute_gift_message .= esc_html($honoree_email) . "<br/>";
             } else {
                 $tribute_gift_message .= __('Send acknowledgement via postal mail to', 'seamless-donations') . '<br/>';
                 $tribute_gift_message .= esc_html($honoree_post_name) . "<br/>";
                 $tribute_gift_message .= esc_html($honoree_address) . "<br/>";
                 if (!empty($honoree_city)) {
                     $tribute_gift_message .= esc_html($honoree_city . " ");
                 }
                 if ('US' == $honoree_country) {
                     $tribute_gift_message .= esc_html($honoree_state . " ");
                 } else {
                     if ('CA' == $honoree_country) {
                         $tribute_gift_message .= esc_html($honoree_province . " ");
                     }
                 }
                 if (dgx_donate_country_requires_postal_code($honoree_country)) {
                     $tribute_gift_message .= esc_html(" " . $honoree_zip);
                 }
                 $tribute_gift_message .= "<br/>";
                 $countries = dgx_donate_get_countries();
                 $honoree_country_name = $countries[$honoree_country];
                 $tribute_gift_message .= esc_html($honoree_country_name) . "<br/><br/>";
             }
         }
         echo "<tr>";
         echo "<th>" . esc_html__('Tribute Gift', 'seamless-donations') . "</th>";
         echo "<td>" . $tribute_gift_message . "</td></tr>\n";
         $payment_method = get_post_meta($donation_id, '_dgx_donate_payment_method', true);
         echo "<tr><th>" . esc_html__('Payment Method', 'seamless-donations') . "</th>";
         echo "<td>" . esc_html($payment_method) . "</td></tr>\n";
         $repeating = get_post_meta($donation_id, '_dgx_donate_repeating', true);
         $is_repeating_donation = !empty($repeating);
         if ($is_repeating_donation) {
             $repeatingText = __('Yes', 'seamless-donations');
         } else {
             $repeatingText = __('No', 'seamless-donations');
         }
         echo "<tr><th>" . esc_html__('Repeating', 'seamless-donations') . "</th>";
         echo "<td>" . esc_html($repeatingText) . "</td></tr>\n";
         $session_id = get_post_meta($donation_id, '_dgx_donate_session_id', true);
         echo "<tr><th>" . esc_html__('Session ID', 'seamless-donations') . "</th>";
         echo "<td>" . esc_html($session_id) . "</td></tr>\n";
         $transaction_id = get_post_meta($donation_id, '_dgx_donate_transaction_id', true);
         echo "<tr><th>" . esc_html__('Transaction ID', 'seamless-donations') . "</th>";
         echo "<td>" . esc_html($transaction_id) . "</td></tr>\n";
         echo "</tbody></table>\n";
         if ($is_repeating_donation) {
             // Display links to related (same session ID) donations
             $related_donation_ids = get_donations_by_meta('_dgx_donate_session_id', $session_id, -1);
             // Unset this donation if present (it probably will be)
             if (($index = array_search($donation_id, $related_donation_ids)) !== false) {
                 unset($related_donation_ids[$index]);
             }
             echo "<h3>" . esc_html__('Related Donations', 'seamless-donations') . "</h3>\n";
             echo "<p class='description'>";
             echo esc_html__('For repeating donations, displays a list of other donations in the series (subscription)', 'seamless-donations');
             echo "</p>\n";
             // Show the array
             echo "<table class='widefat'><tbody>\n";
             if (count($related_donation_ids)) {
                 echo "<tr>";
                 echo "<th>" . esc_html__('Date', 'seamless-donations') . "</th>";
                 echo "<th>" . esc_html__('Transaction ID', 'seamless-donations') . "</th></tr>";
                 foreach ((array) $related_donation_ids as $related_donation_id) {
                     $year = get_post_meta($related_donation_id, '_dgx_donate_year', true);
                     $month = get_post_meta($related_donation_id, '_dgx_donate_month', true);
                     $day = get_post_meta($related_donation_id, '_dgx_donate_day', true);
                     $time = get_post_meta($related_donation_id, '_dgx_donate_time', true);
                     $donation_date = $month . "/" . $day . "/" . $year;
                     $transaction_id = get_post_meta($related_donation_id, '_dgx_donate_transaction_id', true);
                     $donation_detail = dgx_donate_get_donation_detail_link($related_donation_id);
                     echo "<tr>";
                     echo "<td><a href='" . esc_url($donation_detail) . "'>" . esc_html($donation_date . " " . $time) . "</a></td>";
                     echo "<td>" . esc_html($transaction_id) . "</td></tr>\n";
                 }
             } else {
                 echo "<tr>";
                 echo "<th>" . esc_html__('No related donations found', 'seamless-donations') . "</th>";
                 echo "</tr>\n";
             }
             echo "</tbody></table>\n";
         }
         do_action('dgx_donate_donation_detail_right', $donation_id);
         do_action('dgx_donate_admin_footer');
         echo "</div> <!-- col-wrap -->\n";
         echo "</div> <!-- col-right -->\n";
         echo "<div id=\"col-left\">\n";
         echo "<div class=\"col-wrap\">\n";
         Dgx_Donate_Admin_Donor_Detail_View::echo_donor_information($donation_id);
         echo "<h3>" . esc_html__('Delete this Donation', 'seamless-donations') . "</h3>";
         echo "<p>" . esc_html__('Click the following button to delete this donation.  This will also remove this donation from all reports.  This operation cannot be undone.', 'seamless-donations') . "</p>";
         if ($is_repeating_donation) {
             echo "<p><strong>" . esc_html__('This is a repeating donation (subscription).  Deleting this donation does NOT end the subscription.  The donor will need to log into PayPal to end the subscription.', 'seamless-donations') . "</strong></p>";
         }
         echo "<form method='POST' action=''>\n";
         $nonce = wp_create_nonce('dgx_donate_donation_detail_nonce');
         echo "<input type='hidden' name='dgx_donate_donation_detail_nonce' value='" . esc_attr($nonce) . "' />\n";
         echo "<input type='hidden' name='delete_donation' value='true' />";
         echo "<p><input class='button' type='submit' value='" . esc_attr__('Delete Donation', 'seamless-donations') . "'";
         echo " onclick=\"return confirm('" . esc_attr('Are you sure you want to delete this donation?', 'seamless-donations') . "');\"></p>\n";
         echo "</form>";
         do_action('dgx_donate_donation_detail_left', $donation_id);
         echo "</div> <!-- col-wrap -->\n";
         echo "</div> <!-- col-left -->\n";
         echo "</div> <!-- col-container -->\n";
     }
     echo "</div> <!-- wrap -->\n";
 }