PluginProbe
Better Payment – Instant Payments, Donations, Fundraising with Subscriptions & More / 0.0.1
Better Payment – Instant Payments, Donations, Fundraising with Subscriptions & More v0.0.1
2.4.1 2.4.0 2.3.4 2.3.3 2.3.2 2.3.1 2.3.0 2.2.2 2.2.1 2.2.0 2.1.2 2.1.1 trunk 0.0.1 0.0.2 0.0.3 0.0.4 0.0.5 0.0.6 0.0.7 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 All 68 releases
better-payment / admin / views / betterpayment-transaction-view.php

betterpayment-transaction-view.php in Better Payment – Instant Payments, Donations, Fundraising with Subscriptions & More 0.0.1, at admin/views/betterpayment-transaction-view.php

165 lines 11.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /*
3 * Transaction details page
4 * All undefined vars comes from 'render_betterpayment_admin_pages' method
5 * $bp_admin_all_transactions : contains all values
6 */
7 ?>
8
9 <div class="betterpayment">
10
11 <?php if (is_object($bp_admin_transaction)) : ?>
12 <section class="transaction-details-wrapper content">
13
14 <!-- Hidden Fields Start -->
15 <div class="hidden-fields">
16 <input type="hidden" name="transaction_details_id" value="<?php echo esc_attr($bp_admin_transaction->id); ?>">
17 </div>
18 <!-- Hidden Fields End -->
19
20
21 <div class="template__wrapper background__grey">
22 <header class="pb30">
23 <div class="bp-container">
24 <div class="bp-row">
25 <div class="bp-col">
26 <div class="logo">
27 <a href="#"><img src="<?php echo esc_url(WPBP_ADMIN_ASSET_URL . 'img/logo.svg'); ?>" alt=""></a>
28 </div>
29 </div>
30 </div>
31 </div>
32 </header>
33
34 <div class="bp-container">
35 <div class="bp-row">
36 <div class="bp-col">
37 <div class="page__title mb30">
38 <span><a href="<?php echo esc_url(admin_url("admin.php?page=betterpayment-transactions")); ?>"><i class="bp-icon bp-caret-left"></i></a> <?php _e('Back to Transactions', 'better-payment'); ?></span>
39 </div>
40 </div>
41 </div>
42 </div>
43
44 <div class="bp-container">
45 <div class="bp-row">
46 <div class="bp-col-lg-8 bp-col md-mb30">
47 <div class="transaction__info__wrap">
48 <?php
49 $form_fields_info = maybe_unserialize($bp_admin_transaction->form_fields_info);
50
51 $td_first_name = (isset($form_fields_info['first_name']) && $form_fields_info['first_name']) ? $form_fields_info['first_name'] : __('N/A', 'better-payment');
52 $td_last_name = (isset($form_fields_info['last_name']) && $form_fields_info['last_name']) ? $form_fields_info['last_name'] : __('N/A', 'better-payment');
53 $td_email = $bp_admin_transaction->email;
54 $td_amount = $bp_admin_transaction->amount . ' ' . $bp_admin_transaction->currency;
55 $td_source_image_url = $bp_admin_transaction->source == 'paypal' ? WPBP_ADMIN_ASSET_URL . 'img/paypal.png' : WPBP_ADMIN_ASSET_URL . 'img/stripe.svg';
56 $td_status = $bp_admin_transaction->status ? $bp_admin_transaction->status : __('N/A', 'better-payment');
57 $td_status_btn_color = $td_status == 'paid' ? 'label__primary' : 'label__warning';
58 $td_status_btn_color = $td_status == 'unpaid' ? 'label__danger' : $td_status_btn_color;
59
60 //Additional fields:
61 $td_order_id = $bp_admin_transaction->order_id;
62 $td_payment_date = wp_date(get_option('date_format'), strtotime($bp_admin_transaction->payment_date));
63 $td_referer = $bp_admin_transaction->referer;
64 $td_obj_id = $bp_admin_transaction->obj_id;
65
66 //Show widget name and page url
67 $referer_content_form_name = __('N/A', 'better-payment');
68 $referer_content_page_title = __('N/A', 'better-payment');
69 $referer_content_page_link = __('#', 'better-payment');
70
71 if(!empty($bp_transaction_referer_content)){
72 $referer_content_form_name = !empty($bp_transaction_referer_content['form_name']) ? $bp_transaction_referer_content['form_name'] : $referer_content_form_name;
73 $referer_content_form_name = $td_referer != 'elementor-form' && !empty($bp_transaction_referer_content['betterpayment_form_title']) ? $bp_transaction_referer_content['betterpayment_form_title'] : $referer_content_form_name;
74
75 $referer_content_page_title = !empty($referer_page_id) ? get_the_title( $referer_page_id ) : $referer_content_page_title;
76 $referer_content_page_link = !empty($referer_page_id) ? get_permalink( $referer_page_id ) : $referer_content_page_link;
77 }
78
79 ?>
80 <div class="transaction__info">
81 <div class="info__header">
82 <h4 class="title"><i class="bp-icon bp-info"></i> <?php _e('Basic Information', 'better-payment'); ?></h4>
83 </div>
84 <ul class="informations">
85 <li><span><?php _e('First Name:', 'better-payment'); ?></span> <?php echo esc_html($td_first_name) ?> </li>
86 <li><span><?php _e('Last Name:', 'better-payment'); ?></span> <?php echo esc_html($td_last_name) ?> </li>
87 <li><span><?php _e('Email Address:', 'better-payment'); ?></span> <?php echo esc_html($td_email) ?> </li>
88 <li><span><?php _e('Amount:', 'better-payment'); ?></span> <?php echo esc_html($td_amount) ?> </li>
89 <li>
90 <?php
91 $bp_transaction_id = sanitize_text_field($bp_admin_transaction->transaction_id);
92 $bp_txn_counter = 1;
93 ?>
94 <?php if( !empty($bp_transaction_id) ) : ?>
95 <span><?php _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 _e('Copy', 'better-payment'); ?>" data-bp_txn_counter="<?php echo esc_attr($bp_txn_counter); ?>" ></span>
96 <?php endif; ?>
97 </li>
98 <li><span><?php _e('Source:', 'better-payment'); ?></span> <img src="<?php echo esc_url($td_source_image_url) ?>" alt=""></li>
99 <li><span><?php _e('Status:', 'better-payment'); ?></span> <span class="text__label <?php echo esc_attr($td_status_btn_color); ?>"> <?php echo esc_html(ucwords($td_status)); ?> </span></li>
100 </ul>
101 </div>
102 <div class="transaction__info">
103 <div class="info__header">
104 <h4 class="title"><i class="bp-icon bp-info"></i> <?php _e('Additional Information', 'better-payment'); ?></h4>
105 </div>
106 <ul class="informations">
107 <li><span><?php _e('Order ID:', 'better-payment'); ?></span> <?php echo esc_html($td_order_id) ?></li>
108 <li><span><?php _e('Payment Date:', 'better-payment'); ?></span> <?php echo esc_html($td_payment_date) ?></li>
109 <li><span><?php _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>
110 <li><span><?php _e('Referer Widget:', 'better-payment'); ?></span> <?php echo esc_html($referer_content_form_name) ?></li>
111 </ul>
112 </div>
113 </div>
114 </div>
115 <div class="bp-col-lg-4 bp-col">
116 <div class="payment__info">
117 <div class="payment__getway">
118 <h4 class="title"><i class="bp-icon bp-card"></i> <?php _e('Payment Gateway', 'better-payment'); ?></h4>
119 <div class="pay__by">
120 <?php $paid_via_paypal_selected = $bp_admin_transaction->source == 'paypal' ? 'paid_via_selected' : ''; ?>
121 <?php $paid_via_stripe_selected = $bp_admin_transaction->source == 'stripe' ? 'paid_via_selected' : ''; ?>
122
123 <?php if($bp_admin_transaction->source == 'paypal'): ?>
124 <label class="<?php echo esc_attr($paid_via_paypal_selected); ?>">
125 <?php _e('Paid via:', 'better-payment'); ?>
126 <input type="radio" name="payment__getway" <?php echo $bp_admin_transaction->source == 'paypal' ? 'checked' : ''; ?> >
127 <span><img src="<?php echo esc_url(WPBP_ADMIN_ASSET_URL . 'img/paypal.png'); ?>" alt=""></span>
128 </label>
129
130 <?php else : ?>
131 <label class="<?php echo esc_attr($paid_via_stripe_selected) ?>">
132 <?php _e('Paid via:', 'better-payment'); ?>
133 <input type="radio" name="payment__getway" <?php echo $bp_admin_transaction->source == 'stripe' ? 'checked' : ''; ?>>
134 <span><img src="<?php echo esc_url(WPBP_ADMIN_ASSET_URL . 'img/stripe.svg'); ?>" alt=""></span>
135 </label>
136 <?php endif; ?>
137 </div>
138 <p><?php _e('Transaction ID:', 'better-payment'); ?> <span><?php echo esc_html($bp_transaction_id); ?></span></p>
139 </div>
140 <div class="email__activity">
141 <h4 class="title"><i class="bp-icon bp-wave"></i> <?php _e('Email Activity', 'better-payment'); ?></h4>
142 <ul class="activity__list">
143 <li>
144 <div class="content">
145 <i class="bp-icon bp-mail"></i>
146 <h5><?php _e('Email sent to', 'better-payment'); ?> <?php echo esc_html($td_email); ?></h5>
147 <p><?php echo esc_html($td_payment_date) ?></p>
148 </div>
149 <div class="action">
150 </div>
151 </li>
152 </ul>
153 </div>
154 </div>
155 </div>
156 </div>
157 </div>
158 </div>
159 </section>
160
161 <?php else : ?>
162 <p><?php echo __('No records found!', 'better-payment'); ?></p>
163 <?php endif; ?>
164
165 </div>