Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Moved card prompts to settings
- Loading branch information
Showing
4 changed files
with
80 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,32 @@ | ||
<?php | ||
$api_key = PluginData::get('api_key'); | ||
$settings = PluginData::get('settings'); | ||
if(is_object($settings)) | ||
$settings = get_object_vars($settings); | ||
?> | ||
<div class="vbx-applet"> | ||
<?php if(!empty($api_key)): ?> | ||
<?php if(!empty($settings) && !empty($settings['api_key'])): ?> | ||
<div class="vbx-full-pane"> | ||
<h3>Amount</h3> | ||
<p>A positive integer in cents representing much to charge the card.</p> | ||
<fieldset class="vbx-input-container"> | ||
<input type="text" name="amount" class="medium" value="<?php echo AppletInstance::getValue('amount'); ?>" /> | ||
<input type="text" name="amount" class="medium" value="<?php echo AppletInstance::getValue('amount', 50); ?>" /> | ||
</fieldset> | ||
<h3>Description</h3> | ||
<fieldset class="vbx-input-container"> | ||
<input type="text" name="description" class="medium" value="<?php echo AppletInstance::getValue('description'); ?>" /> | ||
</fieldset> | ||
</div> | ||
<h2>Payment successful</h2> | ||
<h2>After the payment</h2> | ||
<div class="vbx-full-pane"> | ||
<?php echo AppletUI::DropZone('success'); ?> | ||
</div><!-- .vbx-full-pane --> | ||
<h2>Payment failed</h2> | ||
<h2>If the payment fails</h2> | ||
<div class="vbx-full-pane"> | ||
<?php echo AppletUI::DropZone('fail'); ?> | ||
</div><!-- .vbx-full-pane --> | ||
<?php else: ?> | ||
<div class="vbx-full-pane"> | ||
<h3>Please set your Stripe.com API key first.</h3> | ||
<h3>Please set your Stripe.com settings first.</h3> | ||
</div> | ||
<?php endif; ?> | ||
</div><!-- .vbx-applet --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
$(function() { | ||
$('.vbx-stripe :checkbox').click(function() { | ||
$('.vbx-stripe form p').eq(5).slideToggle(); | ||
}); | ||
if(!$('.vbx-stripe :checked').length) | ||
$('.vbx-stripe form p').eq(5).hide(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters