Skip to content

Commit

Permalink
update settings and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
carlHandy committed Jul 19, 2024
1 parent d7715a4 commit ac7b37a
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 3 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ MMG Checkout Payment is a WordPress plugin that enables MMG Checkout Payment flo
- Client ID
- Merchant ID
- Secret Key
- RSA Public Key
- RSA Public Key (MMG)
- RSA Private Key (Merchant) // used to decrypt the response from MMG, do not share this key with anyone.
3. Save the settings

### WooCommerce Integration
Expand Down
35 changes: 33 additions & 2 deletions includes/class-mmg-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,43 @@ public function settings_page() {
<tr valign="top">
<th scope="row">Mode</th>
<td>
<select name="mmg_mode">
<select name="mmg_mode" id="mmg_mode">
<option value="live" <?php selected(get_option('mmg_mode'), 'live'); ?>>Live</option>
<option value="demo" <?php selected(get_option('mmg_mode'), 'demo'); ?>>Demo</option>
<option value="demo" <?php selected(get_option('mmg_mode'), 'demo'); ?>>Sandbox</option>
</select>
<span id="live-mode-indicator" style="display: none; margin-left: 10px;">
<span class="blinking-dot"></span> Live Mode
</span>
</td>
</tr>
<style>
.blinking-dot {
display: inline-block;
width: 10px;
height: 10px;
background-color: #00ff00;
border-radius: 50%;
animation: blink 1s infinite;
}
@keyframes blink {
0% { opacity: 0; }
50% { opacity: 1; }
100% { opacity: 0; }
}
</style>
<script>
jQuery(document).ready(function($) {
function toggleLiveModeIndicator() {
if ($('#mmg_mode').val() === 'live') {
$('#live-mode-indicator').show();
} else {
$('#live-mode-indicator').hide();
}
}
$('#mmg_mode').on('change', toggleLiveModeIndicator);
toggleLiveModeIndicator(); // Initial state
});
</script>
<tr valign="top">
<th scope="row">Checkout URL</th>
<td><?php echo esc_html($this->get_checkout_url()); ?></td>
Expand Down

0 comments on commit ac7b37a

Please sign in to comment.