function stripe_admin(){
if(is_user_logged_in()){
$user_id = get_current_user_id();
if ($user_id == 1){
global $stripe_options;
// load the stripe libraries
if ( !class_exists( 'Stripe' ) )
require(dirname(__DIR__).'/libraries/stripe-php/init.php');
// check if we are using test mode
if ( isset( $stripe_options['test_mode'] ) && $stripe_options['test_mode'] ) {
$secret_key = trim( $stripe_options['test_secret_key'] );
} else {
$secret_key = trim( $stripe_options['live_secret_key'] );
}
\Stripe\Stripe::setApiKey( $secret_key );
$customers = \Stripe\Customer::all();
/*
?>
<h2>Payers</h2>
<table class="stripe-admin-table" id="payerTable">
<thead>
<tr>
<th>Name</th>
<th>Email</th>
<th>Phone</th>
</tr>
</thead>
<tbody>
<?php foreach($payers as $payer){ ?>
<tr>
<td><?php echo $payer->name; ?></td>
<td><?php echo $payer->email; ?></td>
<td><?php echo $payer->phone; ?></td>
</tr>
<?php } ?>
</tbody>
</table>
*/ ?>
<h2>Stripe Customers</h2>
<table class="stripe-admin-table" id="myTable">
<thead>
<tr>
<th>Name</th>
<th>Email</th>
<th>Plan</th>
<th>Payer</th>
<th>Premium</th>
<th>Delinquent</th>
<th>Customer Created</th>
</tr>
</thead>
<tbody>
<?php foreach($customers->data as $cus){ ?>
<tr>
<td><a href="https://dashboard.stripe.com/test/customers/<?php echo $cus->id; ?>" target="_BLANK"><?php echo $cus->metadata->name; ?></a></td>
<td><?php echo $cus->email; ?></td>
<td><?php echo $cus->subscriptions->data[0]['plan']['name']; ?></td>
<td><?php echo $cus->metadata->payer; ?></td>
<td><?php echo $cus->metadata->premium; ?></td>
<td <?php if($cus->delinquent){ echo 'style="color:red;"'; }?>><?php if($cus->delinquent){echo 'YES';}else{echo 'NO';} ?></td>
<td><?php echo date_i18n('m-d-y',$cus->created); ?></td>
</tr>
<?php } ?>
</tbody>
</table>
<?php
}else{
wp_redirect('http://gacdev.amsvps12.com/new-subscriber'); exit;
}
}else{
wp_redirect('http://gacdev.amsvps12.com/new-subscriber'); exit;
}
}
add_shortcode('stripe-admin', 'stripe_admin');
Can we remove this post? I am going another direction with the project instead.
It looks like the original issue was that you had 2 plugins trying to load the Stripe library. If you deactivate one then it should go away. We make a check in out plugin for this but can’t guarantee other developers do the same thing.
Can we remove this post? I am going another direction with the project instead.
I don’t think we can remove posts completely, but I will mark it resolved.
Thanks!