Skip to content

Commit

Permalink
Fix minor CC form render issue
Browse files Browse the repository at this point in the history
  • Loading branch information
nirmalrdesai committed Jan 24, 2024
1 parent bebb707 commit fa0e112
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions assets/js/angelleye-braintree-ach-cc.js
Original file line number Diff line number Diff line change
Expand Up @@ -527,11 +527,11 @@ function loadBraintreeDropIn( form_id, args = [] ) {
if( undefined !== dropInContainer ) {
currentForm = dropInContainer[0]?.form;
if( typeof currentForm == 'undefined' ) {
currentForm = dropInContainer[0]?.offsetParent;
currentForm = document.getElementById('gform_'+args.form_id);
}
}

var paymentMethodOptions = ( undefined !== currentForm && '' !== currentForm ) ? currentForm.querySelectorAll('.gform_payment_method_toggle_options input[type=radio]') : [];
var paymentMethodOptions = ( undefined !== currentForm && '' !== currentForm && null !== currentForm ) ? currentForm?.querySelectorAll('.gform_payment_method_toggle_options input[type=radio]') : [];

braintree.dropin.create({
authorization: args.client_token,
Expand Down
4 changes: 3 additions & 1 deletion includes/class-angelleye-gravity-braintree-creditcard.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@ public function get_field_input( $form, $value = '', $entry = null ) {
<input type="hidden" id="payment_card_details_<?php echo $form_id; ?>" name="input_<?php echo $input_field_id; ?>"/>
</div>
<script type="text/javascript">
initBraintreeDropIn('<?php echo $form_id; ?>', <?php echo json_encode($gfb_obj); ?>);
jQuery( document ).ready(function() {
initBraintreeDropIn('<?php echo $form_id; ?>', <?php echo json_encode($gfb_obj); ?>);
});
</script>
<?php
$html = ob_get_contents();
Expand Down
2 changes: 1 addition & 1 deletion includes/class-angelleye-gravity-braintree-reports.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static function get_instance() {
/**
* Class constructor for manage hooks and filter.
*/
protected function __construct() {
public function __construct() {
parent::__construct();

$this->_url = GRAVITY_FORMS_BRAINTREE_ASSET_URL;
Expand Down

0 comments on commit fa0e112

Please sign in to comment.