| 1 |
<?php |
| 2 |
/* |
| 3 |
* Transaction details page |
| 4 |
* All undefined vars comes from 'render_better_payment_admin_pages' method |
| 5 |
* $bp_admin_all_transactions : contains all values |
| 6 |
*/ |
| 7 |
|
| 8 |
use Better_Payment\Lite\Classes\Helper; |
| 9 |
|
| 10 |
?> |
| 11 |
|
| 12 |
<div class="better-payment"> |
| 13 |
|
| 14 |
<?php if (is_object($bp_admin_transaction)) : ?> |
| 15 |
<section class="transaction-details-wrapper content"> |
| 16 |
|
| 17 |
<!-- Hidden Fields Start --> |
| 18 |
<div class="hidden-fields"> |
| 19 |
<input type="hidden" name="transaction_details_id" value="<?php echo esc_attr($bp_admin_transaction->id); ?>"> |
| 20 |
</div> |
| 21 |
<!-- Hidden Fields End --> |
| 22 |
|
| 23 |
|
| 24 |
<div class="template__wrapper background__grey"> |
| 25 |
<header class="pb30"> |
| 26 |
<div class="bp-container"> |
| 27 |
<div class="bp-row"> |
| 28 |
<div class="bp-col"> |
| 29 |
<div class="logo"> |
| 30 |
<a href="javascript:void(0)"><img src="<?php echo esc_url(BETTER_PAYMENT_ASSETS . '/img/logo.svg'); ?>" alt="Better Payment logo"></a> |
| 31 |
</div> |
| 32 |
</div> |
| 33 |
</div> |
| 34 |
</div> |
| 35 |
</header> |
| 36 |
|
| 37 |
<div class="bp-container"> |
| 38 |
<div class="bp-row"> |
| 39 |
<div class="bp-col"> |
| 40 |
<div class="page__title mb30"> |
| 41 |
<span><a class="single-transaction-view-back-btn" href="<?php echo esc_url(admin_url("admin.php?page=better-payment-transactions")); ?>"><i class="bp-icon bp-left-arrow-lite single-transaction-view"></i></a> <?php esc_html_e('Back to Transactions', 'better-payment'); ?></span> |
| 42 |
</div> |
| 43 |
</div> |
| 44 |
</div> |
| 45 |
</div> |
| 46 |
|
| 47 |
<div class="bp-container"> |
| 48 |
<div class="bp-row"> |
| 49 |
<div class="bp-col-lg-8 bp-col md-mb30"> |
| 50 |
<div class="transaction__info__wrap"> |
| 51 |
<?php |
| 52 |
$form_fields_info = maybe_unserialize($bp_admin_transaction->form_fields_info); |
| 53 |
|
| 54 |
$td_first_name = (isset($form_fields_info['primary_first_name']) && $form_fields_info['primary_first_name']) ? $form_fields_info['primary_first_name'] : esc_html__('', 'better-payment'); |
| 55 |
$td_last_name = (isset($form_fields_info['primary_last_name']) && $form_fields_info['primary_last_name']) ? $form_fields_info['primary_last_name'] : esc_html__('', 'better-payment'); |
| 56 |
|
| 57 |
if(empty($td_first_name)){ |
| 58 |
$td_first_name = (isset($form_fields_info['first_name']) && $form_fields_info['first_name']) ? $form_fields_info['first_name'] : esc_html__('', 'better-payment'); |
| 59 |
} |
| 60 |
|
| 61 |
if(empty($td_last_name)){ |
| 62 |
$td_last_name = (isset($form_fields_info['last_name']) && $form_fields_info['last_name']) ? $form_fields_info['last_name'] : esc_html__('', 'better-payment'); |
| 63 |
} |
| 64 |
|
| 65 |
$td_email = (isset($form_fields_info['primary_email']) && $form_fields_info['primary_email']) ? $form_fields_info['primary_email'] : esc_html__('', 'better-payment'); |
| 66 |
if(empty($td_email)){ |
| 67 |
$td_email = (isset($form_fields_info['email']) && $form_fields_info['email']) ? $form_fields_info['email'] : esc_html__('', 'better-payment'); |
| 68 |
} |
| 69 |
$td_amount = $bp_admin_transaction->amount . ' ' . $bp_admin_transaction->currency; |
| 70 |
$allowed_sources = ['paypal', 'stripe', 'paystack']; |
| 71 |
$td_source_image_url = BETTER_PAYMENT_ASSETS . '/img/stripe.svg'; |
| 72 |
$td_source_image_alt = 'Stripe'; |
| 73 |
|
| 74 |
if( in_array( $bp_admin_transaction->source, $allowed_sources ) ){ |
| 75 |
$td_source_image_url = $bp_admin_transaction->source == 'paypal' ? BETTER_PAYMENT_ASSETS . '/img/paypal.png' : BETTER_PAYMENT_ASSETS . "/img/{$bp_admin_transaction->source}.svg"; |
| 76 |
$td_source_image_alt = $bp_admin_transaction->source == 'paypal' ? 'PayPal' : ucfirst( $bp_admin_transaction->source ); |
| 77 |
} |
| 78 |
|
| 79 |
$td_status = $bp_admin_transaction->status ? $bp_admin_transaction->status : esc_html__('N/A', 'better-payment'); |
| 80 |
|
| 81 |
$bp_transaction_status_for_color = $bp_admin_transaction->status ? sanitize_text_field($bp_admin_transaction->status) : ''; |
| 82 |
$bp_helper_obj = new Helper(); |
| 83 |
$td_status_btn_color = $bp_helper_obj->get_color_by_transaction_status($bp_transaction_status_for_color, 'v2'); |
| 84 |
$td_status_btn_text_v2 = $bp_helper_obj->get_type_by_transaction_status($bp_transaction_status_for_color, 'v2'); |
| 85 |
|
| 86 |
//Additional fields: |
| 87 |
$td_order_id = $bp_admin_transaction->order_id; |
| 88 |
$td_payment_date = wp_date(get_option('date_format').' '.get_option('time_format'), strtotime($bp_admin_transaction->payment_date)); |
| 89 |
$td_referer = $bp_admin_transaction->referer; |
| 90 |
$td_obj_id = $bp_admin_transaction->obj_id; |
| 91 |
|
| 92 |
//Show widget name and page url |
| 93 |
$referer_content_form_name = esc_html__('N/A', 'better-payment'); |
| 94 |
$referer_content_page_title = esc_html__('N/A', 'better-payment'); |
| 95 |
$referer_content_page_link = esc_html__('#', 'better-payment'); |
| 96 |
|
| 97 |
if(!empty($bp_transaction_referer_content)){ |
| 98 |
$referer_content_form_name = !empty($bp_transaction_referer_content['form_name']) ? $bp_transaction_referer_content['form_name'] : $referer_content_form_name; |
| 99 |
$referer_content_form_name = $td_referer != 'elementor-form' && !empty($bp_transaction_referer_content['better_payment_form_title']) ? $bp_transaction_referer_content['better_payment_form_title'] : $referer_content_form_name; |
| 100 |
|
| 101 |
$referer_content_page_title = !empty($referer_page_id) ? get_the_title( $referer_page_id ) : $referer_content_page_title; |
| 102 |
$referer_content_page_link = !empty($referer_page_id) ? get_permalink( $referer_page_id ) : $referer_content_page_link; |
| 103 |
} |
| 104 |
|
| 105 |
?> |
| 106 |
<div class="transaction__info"> |
| 107 |
<div class="info__header"> |
| 108 |
<h4 class="title"><i class="bp-icon bp-info"></i> <?php esc_html_e('Basic Information', 'better-payment'); ?></h4> |
| 109 |
</div> |
| 110 |
<ul class="informations"> |
| 111 |
<li><span><?php esc_html_e('Name:', 'better-payment'); ?></span> <?php echo esc_html($td_first_name) . ' ' . esc_html($td_last_name); ?> </li> |
| 112 |
<li><span><?php esc_html_e('Email Address:', 'better-payment'); ?></span> <?php echo esc_html($td_email) ?> </li> |
| 113 |
<li><span><?php esc_html_e('Amount:', 'better-payment'); ?></span> <?php echo esc_html($td_amount) ?> </li> |
| 114 |
<li> |
| 115 |
<?php |
| 116 |
$bp_transaction_id = sanitize_text_field($bp_admin_transaction->transaction_id); |
| 117 |
$bp_txn_counter = 1; |
| 118 |
?> |
| 119 |
<?php if( !empty($bp_transaction_id) ) : ?> |
| 120 |
<span><?php esc_html_e('Transaction ID:', 'better-payment'); ?></span> <span id="bp_copy_clipboard_input_<?php echo esc_attr($bp_txn_counter); ?>"><?php echo esc_html($bp_transaction_id); ?></span> <span id="bp_copy_clipboard_<?php echo esc_attr($bp_txn_counter); ?>" class="bp-icon bp-copy-square bp-copy-clipboard" title="<?php esc_html_e('Copy', 'better-payment'); ?>" data-bp_txn_counter="<?php echo esc_attr($bp_txn_counter); ?>" ></span> |
| 121 |
<?php endif; ?> |
| 122 |
</li> |
| 123 |
<li class="source"><span><?php esc_html_e('Source:', 'better-payment'); ?></span> <img src="<?php echo esc_url($td_source_image_url) ?>" alt="<?php echo esc_attr( $td_source_image_alt ); ?>"></li> |
| 124 |
<li><span><?php esc_html_e('Status:', 'better-payment'); ?></span> <span style="color:#fff; padding:5px 15px; border-radius: 20px;background: <?php echo esc_attr($td_status_btn_color); ?>"> <?php echo esc_html(ucwords($td_status_btn_text_v2)); //$td_status ?> </span></li> |
| 125 |
</ul> |
| 126 |
</div> |
| 127 |
<div class="transaction__info"> |
| 128 |
<div class="info__header"> |
| 129 |
<h4 class="title"><i class="bp-icon bp-info"></i> <?php esc_html_e('Additional Information', 'better-payment'); ?></h4> |
| 130 |
</div> |
| 131 |
<ul class="informations"> |
| 132 |
<li><span><?php esc_html_e('Order ID:', 'better-payment'); ?></span> <?php echo esc_html($td_order_id) ?></li> |
| 133 |
<li><span><?php esc_html_e('Payment Date:', 'better-payment'); ?></span> <?php echo esc_html($td_payment_date) ?></li> |
| 134 |
<li><span><?php esc_html_e('Referer Page:', 'better-payment'); ?></span> <a target="_blank" class="color__themeColor" href="<?php echo esc_url($referer_content_page_link) ?>"><?php echo esc_html($referer_content_page_title); ?></a> </li> |
| 135 |
<li class="is-hidden"><span><?php esc_html_e('Referer Widget:', 'better-payment'); ?></span> <?php echo esc_html($referer_content_form_name) ?></li> |
| 136 |
</ul> |
| 137 |
</div> |
| 138 |
</div> |
| 139 |
</div> |
| 140 |
<div class="bp-col-lg-4 bp-col"> |
| 141 |
<div class="payment__info"> |
| 142 |
<div class="payment__getway"> |
| 143 |
<h4 class="title"><i class="bp-icon bp-card"></i> <?php esc_html_e('Payment Gateway', 'better-payment'); ?></h4> |
| 144 |
<div class="pay__by"> |
| 145 |
<?php $paid_via_paypal_selected = $bp_admin_transaction->source == 'paypal' ? 'paid_via_selected' : ''; ?> |
| 146 |
<?php $paid_via_stripe_selected = $bp_admin_transaction->source == 'stripe' ? 'paid_via_selected' : ''; ?> |
| 147 |
<?php $paid_via_paystack_selected = $bp_admin_transaction->source == 'paystack' ? 'paid_via_selected' : ''; ?> |
| 148 |
|
| 149 |
<?php if($bp_admin_transaction->source == 'paypal'): ?> |
| 150 |
<label class="<?php echo esc_attr($paid_via_paypal_selected); ?>"> |
| 151 |
<?php esc_html_e('Payment Method:', 'better-payment'); ?> |
| 152 |
<input type="radio" name="payment__getway" <?php echo $bp_admin_transaction->source == 'paypal' ? 'checked' : ''; ?> > |
| 153 |
<span><img src="<?php echo esc_url(BETTER_PAYMENT_ASSETS . '/img/paypal.png'); ?>" alt="<?php echo esc_attr( $td_source_image_alt ); ?>"></span> |
| 154 |
</label> |
| 155 |
|
| 156 |
<?php elseif( $bp_admin_transaction->source == 'paystack' ): ?> |
| 157 |
<label class="<?php echo esc_attr($paid_via_paystack_selected); ?>"> |
| 158 |
<?php esc_html_e('Payment Method:', 'better-payment'); ?> |
| 159 |
<input type="radio" name="payment__getway" <?php echo $bp_admin_transaction->source == 'paystack' ? 'checked' : ''; ?> > |
| 160 |
<span><img src="<?php echo esc_url(BETTER_PAYMENT_ASSETS . '/img/paystack.svg'); ?>" alt=""></span> |
| 161 |
</label> |
| 162 |
|
| 163 |
<?php else : ?> |
| 164 |
<label class="<?php echo esc_attr($paid_via_stripe_selected) ?>"> |
| 165 |
<?php esc_html_e('Payment Method:', 'better-payment'); ?> |
| 166 |
<input type="radio" name="payment__getway" <?php echo $bp_admin_transaction->source == 'stripe' ? 'checked' : ''; ?>> |
| 167 |
<span><img src="<?php echo esc_url(BETTER_PAYMENT_ASSETS . '/img/stripe.svg'); ?>" alt="<?php echo esc_attr( $td_source_image_alt ); ?>"></span> |
| 168 |
</label> |
| 169 |
<?php endif; ?> |
| 170 |
</div> |
| 171 |
<?php $bp_txn_counter = 2; ?> |
| 172 |
<p class="single-transaction-id-copy-wrap"><?php esc_html_e('Transaction ID:', 'better-payment'); ?> <span id="bp_copy_clipboard_input_<?php echo esc_attr($bp_txn_counter); ?>" class="bp-text-black"><?php echo esc_html($bp_transaction_id); ?></span><span id="bp_copy_clipboard_<?php echo esc_attr($bp_txn_counter); ?>" class="bp-icon bp-copy-square bp-copy-clipboard has-text-black-fix" title="<?php esc_html_e('Copy', 'better-payment'); ?>" data-bp_txn_counter="<?php echo esc_attr($bp_txn_counter); ?>" ></span></p> |
| 173 |
</div> |
| 174 |
<div class="email__activity"> |
| 175 |
<h4 class="title"><i class="bp-icon bp-wave"></i> <?php esc_html_e('Email Activity', 'better-payment'); ?></h4> |
| 176 |
<ul class="activity__list"> |
| 177 |
<li> |
| 178 |
<div class="content"> |
| 179 |
<i class="bp-icon bp-mail"></i> |
| 180 |
<h5><?php esc_html_e('Email sent to', 'better-payment'); ?> <?php echo esc_html($td_email); ?></h5> |
| 181 |
<p><?php echo esc_html($td_payment_date) ?></p> |
| 182 |
</div> |
| 183 |
<div class="action"> |
| 184 |
</div> |
| 185 |
</li> |
| 186 |
</ul> |
| 187 |
</div> |
| 188 |
<?php if ( ! $this->pro_enabled ) : ?> |
| 189 |
<p class="p-4"><a class="width-100" target="_blank" href="//wpdeveloper.com/in/upgrade-better-payment-pro"><img width="100%" src="<?php echo esc_url(BETTER_PAYMENT_ASSETS . '/img/refund-banner.svg'); ?>" alt="refund-banner"></a></p> |
| 190 |
<p class="p-4"><a class="width-100" target="_blank" href="//wpdeveloper.com/in/upgrade-better-payment-pro"><img width="100%" src="<?php echo esc_url(BETTER_PAYMENT_ASSETS . '/img/receipt-banner.svg'); ?>" alt="receipt-banner"></a></p> |
| 191 |
<?php endif; ?> |
| 192 |
<?php do_action('better_payment/admin/transaction_refund_content', $bp_admin_transaction); ?> |
| 193 |
<?php do_action('better_payment/admin/transaction_receipt_content', $bp_admin_transaction); ?> |
| 194 |
</div> |
| 195 |
</div> |
| 196 |
</div> |
| 197 |
</div> |
| 198 |
</div> |
| 199 |
</section> |
| 200 |
|
| 201 |
<?php else : ?> |
| 202 |
<p><?php echo esc_html__('No records found!', 'better-payment'); ?></p> |
| 203 |
<?php endif; ?> |
| 204 |
|
| 205 |
</div> |