| 1 |
<div class="better-payment"> |
| 2 |
<div class="better-payment--wrapper"> |
| 3 |
<div class="better-payment--container"> |
| 4 |
<?php |
| 5 |
use Better_Payment\Lite\Classes\Helper; |
| 6 |
|
| 7 |
$better_payment_helper_obj = new Helper(); |
| 8 |
|
| 9 |
include BETTER_PAYMENT_ADMIN_VIEWS_PATH . "/partials/layout-vars.php"; |
| 10 |
|
| 11 |
$render_attribute_default_text = $this->render_attribute_default_text( $settings ); |
| 12 |
?> |
| 13 |
|
| 14 |
<form name="better-payment-form-<?php echo esc_attr( $widgetObj->get_id() ); ?>" data-better-payment="<?php echo esc_attr($layout_setting_meta); ?>" class="better-payment-form" id="better-payment-form-<?php echo esc_attr($widgetObj->get_id()); ?>" action="<?php echo esc_url($layout_action); ?>" method="post"> |
| 15 |
<input type="hidden" name="better_payment_page_id" value="<?php echo esc_attr( get_the_ID() ); ?>"> |
| 16 |
<input type="hidden" name="better_payment_widget_id" value="<?php echo esc_attr( $widgetObj->get_id() ); ?>"> |
| 17 |
<?php |
| 18 |
if ( method_exists( $widgetObj, 'render_campaign_id_hidden_field' ) ) { |
| 19 |
echo $widgetObj->render_campaign_id_hidden_field( $settings ); |
| 20 |
} |
| 21 |
?> |
| 22 |
|
| 23 |
<div class="payment-form-layout-2 payment-form-layout"> |
| 24 |
<div class="columns"> |
| 25 |
|
| 26 |
<div class="column <?php echo ( intval( $sidebar_show ) ? esc_attr('is-8') : esc_attr('is-12') ); ?> <?php esc_attr_e($layout_form_content_offset_class, 'better-payment'); ?>"> |
| 27 |
<div class="has-background-white-fix form-content-section"> |
| 28 |
<div class="form-content-section-inner p-6"> |
| 29 |
<div class="pt-3 pb-3"> |
| 30 |
<div class="form-content-section-fields"> |
| 31 |
<?php |
| 32 |
$bp_paypal_button_enable = !empty( $settings[ 'better_payment_form_paypal_enable' ] ) && 'yes' === $settings[ 'better_payment_form_paypal_enable' ]; |
| 33 |
$bp_stripe_button_enable = !empty( $settings[ 'better_payment_form_stripe_enable' ] ) && 'yes' === $settings[ 'better_payment_form_stripe_enable' ]; |
| 34 |
$bp_paystack_button_enable = !empty( $settings[ 'better_payment_form_paystack_enable' ] ) && 'yes' === $settings[ 'better_payment_form_paystack_enable' ]; |
| 35 |
$bp_number_of_items_enable_class = $bp_paypal_button_enable && $bp_stripe_button_enable && $bp_paystack_button_enable ? 'bp-three-items-enabled' : ''; |
| 36 |
?> |
| 37 |
<div class="field-payment_method <?php echo esc_attr( $bp_number_of_items_enable_class . '-wrap' ); ?>"> |
| 38 |
<div class="control bp-radio-box"> |
| 39 |
<?php if( true === $bp_paypal_button_enable ) : ?> |
| 40 |
<?php if(true == $bp_stripe_button_enable || true == $bp_paystack_button_enable): ?> |
| 41 |
<label class="radio pr-6 payment-method-checkbox payment-method-checkbox-paypal <?php echo esc_attr( $bp_number_of_items_enable_class ); ?>"> |
| 42 |
<input type="radio" name="payment_method" class="layout-payment-method-paypal" checked> |
| 43 |
<?php esc_html_e('PayPal', 'better-payment'); ?> |
| 44 |
</label> |
| 45 |
<?php else: ?> |
| 46 |
<label class="radio pr-6 mb-5 payment-method-checkbox payment-method-checkbox-paypal single-item active column has-text-centered <?php echo esc_attr( $bp_number_of_items_enable_class ); ?>"> |
| 47 |
<input type="radio" name="payment_method" class="layout-payment-method-paypal" checked> |
| 48 |
<img src="<?php echo esc_url(BETTER_PAYMENT_ASSETS . '/img/paypal.png'); ?>" alt="PayPal"> |
| 49 |
</label> |
| 50 |
<?php endif; ?> |
| 51 |
<?php endif; ?> |
| 52 |
|
| 53 |
<?php if( true === $bp_stripe_button_enable ) : ?> |
| 54 |
<?php if( true === $bp_paypal_button_enable || true === $bp_paystack_button_enable ) : ?> |
| 55 |
<label class="radio pr-6 payment-method-checkbox payment-method-checkbox-stripe <?php echo esc_attr( $bp_number_of_items_enable_class ); ?>"> |
| 56 |
<input type="radio" name="payment_method" class="layout-payment-method-stripe" <?php echo empty($settings['better_payment_form_paypal_enable']) ? 'checked' : '' ?>> |
| 57 |
<?php esc_html_e('Stripe', 'better-payment'); ?> |
| 58 |
</label> |
| 59 |
<?php else: ?> |
| 60 |
<label class="radio pr-6 mb-5 payment-method-checkbox payment-method-checkbox-stripe single-item <?php echo esc_attr('active'); ?> column has-text-centered <?php echo esc_attr( $bp_number_of_items_enable_class ); ?>"> |
| 61 |
<input type="radio" name="payment_method" class="layout-payment-method-stripe" <?php echo 'checked'; ?>> |
| 62 |
<img style="margin-left: -35px" src="<?php echo esc_url(BETTER_PAYMENT_ASSETS . '/img/stripe.svg'); ?>" alt="Stripe"> |
| 63 |
</label> |
| 64 |
<?php endif; ?> |
| 65 |
<?php endif; ?> |
| 66 |
|
| 67 |
<?php if( true === $bp_paystack_button_enable ) : ?> |
| 68 |
<?php if( true === $bp_paypal_button_enable || true === $bp_stripe_button_enable ) : ?> |
| 69 |
<label class="radio payment-method-checkbox payment-method-checkbox-paystack <?php echo esc_attr( $bp_number_of_items_enable_class ); ?>"> |
| 70 |
<input type="radio" name="payment_method" class="layout-payment-method-paystack"> |
| 71 |
<?php esc_html_e('Paystack', 'better-payment'); ?> |
| 72 |
</label> |
| 73 |
<?php else: ?> |
| 74 |
<label class="radio mb-5 payment-method-checkbox payment-method-checkbox-paystack single-item <?php echo esc_attr('active'); ?> column has-text-centered <?php echo esc_attr( $bp_number_of_items_enable_class ); ?>"> |
| 75 |
<input type="radio" name="payment_method" class="layout-payment-method-paystack" <?php echo 'checked'; ?>> |
| 76 |
<img style="margin-left: -35px" src="<?php echo esc_url(BETTER_PAYMENT_ASSETS . '/img/paystack.svg'); ?>" alt=""> |
| 77 |
</label> |
| 78 |
<?php endif; ?> |
| 79 |
<?php endif; ?> |
| 80 |
</div> |
| 81 |
</div> |
| 82 |
|
| 83 |
<?php |
| 84 |
if ( !empty( $settings['better_payment_form_fields'] ) ) : |
| 85 |
foreach ( $settings['better_payment_form_fields'] as $item ) : |
| 86 |
include BETTER_PAYMENT_ADMIN_VIEWS_PATH . "/partials/layout-repeater-vars.php"; |
| 87 |
|
| 88 |
if ($is_payment_amount_field) : ?> |
| 89 |
<div class="bp-payment-amount-wrap <?php esc_attr_e($layout_put_amount_field_hide_show, 'better-payment'); ?>"> |
| 90 |
<?php |
| 91 |
if (!empty($settings['better_payment_show_amount_list']) && 'yes' === $settings['better_payment_show_amount_list']) { |
| 92 |
$this->render_amount_element($settings); |
| 93 |
} |
| 94 |
?> |
| 95 |
</div> |
| 96 |
<?php endif; ?> |
| 97 |
|
| 98 |
<div class="better-payment-field-advanced-layout field-<?php echo esc_attr($render_attribute_name); ?> pt-5 elementor-repeater-item-<?php echo esc_attr($item['_id']); ?> <?php echo esc_attr( $payment_amount_field_class ); ?> <?php echo esc_attr( $item_visible_class ); ?>"> |
| 99 |
<div class="control has-icons-left"> |
| 100 |
<input class="input is-medium |
| 101 |
<?php echo esc_attr($render_attribute_class); ?>" type="<?php echo esc_attr($render_attribute_type); ?>" placeholder="<?php echo esc_attr($render_attribute_placeholder); ?>" name="<?php echo esc_attr($render_attribute_name); ?>" <?php if ($render_attribute_required) : ?> required="<?php echo esc_attr($render_attribute_required); ?>" <?php endif; ?> <?php if ($is_payment_amount_field) : ?> step="any" min="<?php echo esc_attr( $render_attribute_min ); ?>" max="<?php echo esc_attr( $render_attribute_max ); ?>" value="<?php echo $is_payment_type_woocommerce || $is_payment_type_fluentcart || $is_payment_type_stripe ? floatval($product_price) : esc_attr( $render_attribute_default ); ?>" <?php echo esc_attr( $render_attribute_default_fixed ); ?> <?php endif; ?>> |
| 102 |
<span class="icon is-medium is-left"> |
| 103 |
<?php |
| 104 |
$show_payment_default_symbol = 0; |
| 105 |
if ( $is_payment_amount_field ) { |
| 106 |
$show_payment_default_symbol = 'bp-icon bp-envelope' === $render_attribute_icon || 'bp-icon bp-user' === $render_attribute_icon; |
| 107 |
|
| 108 |
if( $show_payment_default_symbol ){ |
| 109 |
?> |
| 110 |
<span class="icon is-medium is-left"> |
| 111 |
<?php printf('<span class="bp-currency-symbol">%s</span>', esc_html( $layout_form_currency_symbol ) ); ?> |
| 112 |
</span> |
| 113 |
<?php |
| 114 |
} |
| 115 |
} ?> |
| 116 |
|
| 117 |
<?php if ($layout_show_image) : ?> |
| 118 |
<img src="<?php echo esc_url($render_attribute_icon); ?>" alt="Icon" width="20"> |
| 119 |
<?php elseif( ! $show_payment_default_symbol ) : ?> |
| 120 |
<?php |
| 121 |
// Use Elementor's Icons_Manager to properly render icons with FontAwesome support |
| 122 |
if (!empty($item['better_payment_field_icon']['value'])) { |
| 123 |
\Elementor\Icons_Manager::render_icon($item['better_payment_field_icon'], ['aria-hidden' => 'true']); |
| 124 |
} else { |
| 125 |
// Fallback to default icons |
| 126 |
echo '<i class="' . esc_attr($render_attribute_icon) . '"></i>'; |
| 127 |
} |
| 128 |
?> |
| 129 |
<?php endif; ?> |
| 130 |
</span> |
| 131 |
</div> |
| 132 |
</div> |
| 133 |
|
| 134 |
<?php |
| 135 |
endforeach; |
| 136 |
endif; |
| 137 |
?> |
| 138 |
|
| 139 |
<div class="pb-5"></div> |
| 140 |
|
| 141 |
<div class="field-process_payment_button pt-3"> |
| 142 |
<div class="control"> |
| 143 |
<div class="payment__option"> |
| 144 |
<?php |
| 145 |
if ( !empty( $settings['better_payment_form_paypal_enable'] ) && 'yes' === $settings['better_payment_form_paypal_enable'] ) { |
| 146 |
echo Better_Payment\Lite\Classes\Handler::paypal_button(esc_attr($widgetObj->get_id()), $settings); |
| 147 |
} |
| 148 |
|
| 149 |
if ( !empty($settings['better_payment_form_stripe_enable'] ) && 'yes' === $settings['better_payment_form_stripe_enable'] ) { |
| 150 |
echo Better_Payment\Lite\Classes\Handler::stripe_button(esc_attr($widgetObj->get_id()), $settings); |
| 151 |
} |
| 152 |
|
| 153 |
if ( !empty($settings['better_payment_form_paystack_enable'] ) && 'yes' === $settings['better_payment_form_paystack_enable'] ) { |
| 154 |
echo Better_Payment\Lite\Classes\Handler::paystack_button(esc_attr($widgetObj->get_id()), $settings); |
| 155 |
} |
| 156 |
?> |
| 157 |
</div> |
| 158 |
</div> |
| 159 |
</div> |
| 160 |
</div> |
| 161 |
</div> |
| 162 |
</div> |
| 163 |
</div> |
| 164 |
</div> |
| 165 |
|
| 166 |
<div class="column"> |
| 167 |
<?php if ( $sidebar_show ) : ?> |
| 168 |
<div class="dynamic-amount-section"> |
| 169 |
<div class="dynamic-amount-section-inner has-text-white p-6"> |
| 170 |
<div class="pt-3 pb-3"> |
| 171 |
<p class="bp-dynamic-amount-section-icon-wrap"><i class="bp-icon bp-swap is-size-1-fix bp-dynamic-amount-section-icon"></i></p> |
| 172 |
<h4 class="is-size-5-fix pt-5 bp-dynamic-amount-section-title"><?php echo esc_html_e($layout_form_transaction_details_heading, 'better-payment'); ?></h4> |
| 173 |
<p class="is-size-6-fix pt-3 dynamic-amount-section-subtitle bp-dynamic-amount-section-sub-title"><?php esc_html_e($layout_form_transaction_details_sub_heading, 'better-payment'); ?></p> |
| 174 |
<p class="is-size-6-fix pt-2 bp-dynamic-amount-section-amount"> |
| 175 |
<?php echo wp_kses( __(sprintf("%s <a class='has-text-white %s ' href='%s'>%s</a>", $layout_form_transaction_details_product_title, $layout_dynamic_payment_hide_show, $product_permalink, $product_name), 'better-payment'), $valid_html_tags ); ?><br> |
| 176 |
<?php echo wp_kses( __(sprintf("%s <span class='bp-transaction-details-amount-text'>%s</span>", $layout_form_transaction_details_amount_text, '' !== $product_price ? floatval($product_price) : $render_attribute_default_text), 'better-payment'), $valid_html_tags ); ?> |
| 177 |
</p> |
| 178 |
<h4 class="is-size-2-fix pt-5 bp-dynamic-amount-section-amount-summary"> |
| 179 |
<?php |
| 180 |
echo wp_kses( |
| 181 |
__( |
| 182 |
sprintf('%s<span class="bp-transaction-details-amount-text">%s</span>%s', |
| 183 |
wp_kses( $layout_form_currency_left, $valid_html_tags ), |
| 184 |
'' !== $product_price ? floatval($product_price) : $render_attribute_default_text, |
| 185 |
wp_kses( $layout_form_currency_right, $valid_html_tags ) |
| 186 |
), |
| 187 |
'better-payment' |
| 188 |
), |
| 189 |
$valid_html_tags |
| 190 |
); |
| 191 |
?> |
| 192 |
</h4> |
| 193 |
</div> |
| 194 |
</div> |
| 195 |
</div> |
| 196 |
<?php endif; ?> |
| 197 |
</div> |
| 198 |
|
| 199 |
</div> |
| 200 |
|
| 201 |
</div> |
| 202 |
|
| 203 |
</form> |
| 204 |
</div> |
| 205 |
</div> |
| 206 |
</div> |