Skip to content

Commit 329459c

Browse files
committed
Add a notice indicating that GoCardless is connected in sandbox mode.
1 parent 3323da6 commit 329459c

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

assets/css/admin.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,14 @@
3939
color: #d63638;
4040
margin-top: 6px;
4141
}
42+
43+
.wcgc-sandbox-mode-notice {
44+
margin-top: 12px;
45+
align-items: center;
46+
background-color: #fff2d7;
47+
color: #4d3716;
48+
display: flex;
49+
font-size: 13px;
50+
padding: 12px;
51+
width: max-content;
52+
}

includes/class-wc-gocardless-gateway.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,20 @@ public function generate_connection_html( $key, $data ) {
230230

231231
<?php if ( ! empty( $access_token ) ) : ?>
232232
<span class="gocardless-connected"><span style="color: #00a32a">&#9679;</span>&nbsp;<?php esc_html_e( 'Connected', 'woocommerce-gateway-gocardless' ); ?></span>
233+
234+
<?php if ( $this->testmode ) : ?>
235+
<div class="wcgc-sandbox-mode-notice">
236+
<span>
237+
<?php
238+
printf(
239+
'<strong>%1$s</strong> %2$s',
240+
esc_html__( 'GoCardless is connected in sandbox mode.', 'woocommerce-gateway-gocardless' ),
241+
esc_html__( 'You need to connect a live GoCardless account before you can accept real bank payments.', 'woocommerce-gateway-gocardless' )
242+
);
243+
?>
244+
</span>
245+
</div>
246+
<?php endif; ?>
233247
<?php endif; ?>
234248

235249
<?php if ( empty( $access_token ) ) : ?>

0 commit comments

Comments
 (0)