1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* Displays the gateways table. |
4
|
|
|
* |
5
|
|
|
*/ |
6
|
|
|
|
7
|
|
|
defined( 'ABSPATH' ) || exit; |
8
|
|
|
|
9
|
|
|
$gateways = wpinv_get_payment_gateways(); |
10
|
|
|
ksort( $gateways ); |
11
|
|
|
|
12
|
|
|
?> |
13
|
|
|
<div class="table-responsive"> |
14
|
|
|
<table id="wpinv_gateways_select" class="table border bg-white form-table"> |
15
|
|
|
<caption><?php echo esc_html_e( 'This table displays installed payment methods.', 'invoicing' ); ?></caption> |
|
|
|
|
16
|
|
|
|
17
|
|
|
<thead> |
18
|
|
|
<tr class="table-light"> |
19
|
|
|
|
20
|
|
|
<th scope="col" class="border-bottom border-top text-left"> |
21
|
|
|
<?php esc_html_e( 'Payment Method', 'invoicing' ); ?> |
22
|
|
|
</th> |
23
|
|
|
|
24
|
|
|
<th scope="col" class="border-bottom border-top text-center"> |
25
|
|
|
<?php esc_html_e( 'Enabled', 'invoicing' ); ?> |
26
|
|
|
</th> |
27
|
|
|
|
28
|
|
|
<th scope="col" class="border-bottom border-top text-center"> |
29
|
|
|
<?php esc_html_e( 'Supports Subscriptions', 'invoicing' ); ?> |
30
|
|
|
</th> |
31
|
|
|
|
32
|
|
|
<th scope="col" class="border-bottom border-top text-right" style="width:32px"> </th> |
33
|
|
|
|
34
|
|
|
</tr> |
35
|
|
|
</thead> |
36
|
|
|
|
37
|
|
|
<tbody> |
38
|
|
|
<?php foreach ( $gateways as $id => $gateway ) : ?> |
39
|
|
|
<tr> |
40
|
|
|
<td class="getpaid-payment-method text-left"> |
41
|
|
|
<a style="color: #0073aa;" href="<?php echo esc_url( add_query_arg( 'section', $id ) ); ?>" class="font-weight-bold"><?php echo esc_html( $gateway['admin_label'] ); ?></a> |
42
|
|
|
</td> |
43
|
|
|
<td class="getpaid-payment-method-enabled text-center"> |
44
|
|
|
<?php |
45
|
|
|
|
46
|
|
|
if ( wpinv_is_gateway_active( $id ) ) { |
47
|
|
|
echo "<i class='text-success fa fa-check'></i>"; |
48
|
|
|
} else { |
49
|
|
|
echo "<i class='text-dark fa fa-times'></i>"; |
50
|
|
|
} |
51
|
|
|
|
52
|
|
|
?> |
53
|
|
|
</td> |
54
|
|
|
<td class="getpaid-payment-method-subscription text-center"> |
55
|
|
|
<?php |
56
|
|
|
|
57
|
|
|
$supports = apply_filters( "wpinv_{$id}_support_subscription", false ); |
58
|
|
|
$supports = apply_filters( 'getapid_gateway_supports_subscription', $supports, $id ); |
59
|
|
|
|
60
|
|
|
if ( $supports ) { |
61
|
|
|
echo "<i class='text-success fa fa-check'></i>"; |
62
|
|
|
} else { |
63
|
|
|
echo "<i class='text-dark fa fa-times'></i>"; |
64
|
|
|
} |
65
|
|
|
|
66
|
|
|
?> |
67
|
|
|
</td> |
68
|
|
|
|
69
|
|
|
<td class="getpaid-payment-method-action text-right"> |
70
|
|
|
<a class="button button-secondary" href="<?php echo esc_url( add_query_arg( 'section', $id ) ); ?>"><?php esc_html_e( 'Manage', 'invoicing' ); ?></a> |
71
|
|
|
</td> |
72
|
|
|
|
73
|
|
|
</tr> |
74
|
|
|
<?php endforeach; ?> |
75
|
|
|
</tbody> |
76
|
|
|
|
77
|
|
|
<tfoot> |
78
|
|
|
<tr class="table-light"> |
79
|
|
|
<td colspan="4" class="border-top"> |
80
|
|
|
<a class="button button-secondary getpaid-install-gateways" href="<?php echo esc_url( admin_url( 'admin.php?page=wpi-addons&tab=gateways' ) ); ?>"> |
81
|
|
|
<span><?php esc_html_e( 'Add Payment Methods', 'invoicing' ); ?></span> |
82
|
|
|
</a> |
83
|
|
|
</td> |
84
|
|
|
</tr> |
85
|
|
|
</tfoot> |
86
|
|
|
|
87
|
|
|
</table> |
88
|
|
|
</div> |
89
|
|
|
|
This check looks for function or method calls that always return null and whose return value is used.
The method
getObject()
can return nothing but null, so it makes no sense to use the return value.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.