403, ) ); } /** * View donation details page * * @since 3.9.0 Add donor phone number to the view * @since 1.0 * @return void */ if ( ! isset( $_GET['id'] ) || ! is_numeric( $_GET['id'] ) ) { wp_die( __( 'Donation ID not supplied. Please try again.', 'give' ), __( 'Error', 'give' ), array( 'response' => 400 ) ); } // Setup the variables $payment_id = absint( $_GET['id'] ); $payment = new Give_Payment( $payment_id ); // Sanity check... fail if donation ID is invalid $payment_exists = $payment->ID; if ( empty( $payment_exists ) ) { wp_die( __( 'The specified ID does not belong to a donation. Please try again.', 'give' ), __( 'Error', 'give' ), array( 'response' => 400 ) ); } $number = $payment->number; $payment_meta = $payment->get_meta(); $company_name = ! empty( $payment_meta['_give_donation_company'] ) ? esc_html( $payment_meta['_give_donation_company'] ) : ''; $transaction_id = esc_attr( $payment->transaction_id ); $user_id = $payment->user_id; $donor_id = $payment->customer_id; $payment_date = strtotime( $payment->date ); $user_info = give_get_payment_meta_user_info( $payment_id ); $address = $payment->address; $currency_code = $payment->currency; $gateway = $payment->gateway; $currency_code = $payment->currency; $payment_mode = $payment->mode; $base_url = admin_url( 'edit.php?post_type=give_forms&page=give-payment-history' ); $donation_model = Donation::find( $payment_id ); $donor_model = Donor::find( $donor_id ); $donation_phone_number = $donation_model ? $donation_model->phone : ''; $donor_phone_number = $donor_model ? $donor_model->phone : ''; ?>

tooltips->render_span( array( 'label' => __( 'This donation was made in test mode.', 'give' ), 'tag_content' => __( 'Test Donation', 'give' ), 'position' => 'right', 'attributes' => array( 'id' => 'test-payment-label', 'class' => 'give-item-label give-item-label-orange', ), ) ); } ?>


', $payment_id, esc_url( wp_nonce_url( add_query_arg( array( 'give-action' => 'delete_payment', 'purchase_id' => $payment_id, ), $base_url ), 'give_donation_nonce' ) ), sprintf( __( 'Delete Donation %s', 'give' ), $payment_id ) ); } ?>

 

 

   : 

  currency ); ?>  

'email_links', 'purchase_id' => $payment_id, ), admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&view=view-payment-details&id=' . $payment_id ) ); echo sprintf( '%2$s', esc_url( $url ), esc_html__( 'Resend Receipt', 'give' ) ); } ?>

 

 

 

 


form_id ) : printf( '%2$s', admin_url( 'post.php?action=edit&post=' . $payment->form_id ), $payment->form_id ); endif; ?>


html->forms_dropdown( array( 'selected' => $payment->form_id, 'name' => 'give-payment-form-select', 'id' => 'give-payment-form-select', 'chosen' => true, 'placeholder' => '', ) ); ?>


ID); echo Give()->html->campaigns_dropdown( [ 'selected' => $donation->campaignId, 'name' => 'give-payment-campaign-select', 'id' => 'give-payment-campaign-select', 'chosen' => true, 'placeholder' => __('Select Campaign', 'give'), ] ); ?>



form_id ); if ( empty( $var_prices ) ) { _e( 'n/a', 'give' ); } else { $prices_atts = array(); if ( $variable_prices = give_get_variable_prices( $payment->form_id ) ) { foreach ( $variable_prices as $variable_price ) { $prices_atts[ $variable_price['_give_id']['level_id'] ] = give_format_amount( $variable_price['_give_amount'], array( 'sanitize' => false ) ); } } // Variable price dropdown options. $variable_price_dropdown_option = array( 'id' => $payment->form_id, 'name' => 'give-variable-price', 'chosen' => true, 'show_option_all' => '', 'show_option_none' => ( '' === $payment->price_id ? __( 'None', 'give' ) : '' ), 'select_atts' => 'data-prices=' . esc_attr( wp_json_encode( $prices_atts ) ), 'selected' => $payment->price_id, ); // Render variable prices select tag html. give_get_form_variable_price_dropdown( $variable_price_dropdown_option, true ); } ?>



id ) ) { printf( '%2$s', esc_url( admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $donor->id ) ), intval( $donor->id ) ); } ?> ()


date_created ) ); ?>


%3$s)', esc_html( $donor_billing_name ), esc_url( admin_url( "edit.php?post_type=give_forms&page=give-donors&view=overview&id={$donor_id}" ) ), esc_html( $donor_name ) ); } } else { echo esc_html( $donor_name ); } ?>


email ) || hash_equals( $donor->email, $payment->email ) ) ? esc_html( $payment->email ) : sprintf( '%1$s (%3$s)', esc_html( $payment->email ), esc_url( admin_url( "edit.php?post_type=give_forms&page=give-donors&view=overview&id={$donor_id}" ) ), esc_html( $donor->email ) ); ?>


%3$s)', esc_html($donation_phone_number), esc_url(admin_url("edit.php?post_type=give_forms&page=give-donors&view=overview&id={$donor_id}")), esc_html($donor_phone_number) ); } ?>


html->donor_dropdown( array( 'selected' => $donor->id, 'name' => 'donor-id', ) ); ?>


html->select( array( 'options' => give_get_country_list(), 'name' => 'give-payment-address[0][country]', 'selected' => $address['country'], 'show_option_all' => false, 'show_option_none' => false, 'chosen' => true, 'placeholder' => esc_attr__( 'Select a country', 'give' ), 'data' => array( 'search-type' => 'no_ajax' ), 'autocomplete' => 'country', ) ); ?>
html->select( array( 'options' => $states, 'name' => 'give-payment-address[0][state]', 'selected' => $address['state'], 'show_option_all' => false, 'show_option_none' => false, 'chosen' => true, 'placeholder' => esc_attr__( 'Select a state', 'give' ), 'data' => array( 'search-type' => 'no_ajax' ), 'autocomplete' => 'address-level1', ) ); } else { ?>

' . esc_html__( 'No donation notes.', 'give' ) . '

'; ?>

form_id ) ) : ?>

%s', __( 'Add a comment', 'give' ), $payment->get_meta(DonationMetaKeys::COMMENT) ?? '' ); ?>