| 1 |
<div class="better-payment <?php echo esc_attr( ! empty( $extraDatas['block_id'] ) ? 'bp-' . $extraDatas['block_id'] : '' ); ?>"> |
| 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 |
// Block only: treat 'stripe' product source the same as woocommerce/fluentcart — |
| 12 |
// hide the manual amount field and show the product price section. |
| 13 |
if ( ! empty( $settings['better_payment_form_payment_source'] ) && 'stripe' === $settings['better_payment_form_payment_source'] ) { |
| 14 |
$layout_put_amount_field_hide_show = 'is-hidden'; |
| 15 |
$layout_dynamic_payment_hide_show = ''; |
| 16 |
} |
| 17 |
|
| 18 |
$render_attribute_default_text = $this->render_attribute_default_text( $settings ); |
| 19 |
?> |
| 20 |
|
| 21 |
<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"> |
| 22 |
<input type="hidden" name="better_payment_page_id" value="<?php echo esc_attr( get_the_ID() ); ?>"> |
| 23 |
<input type="hidden" name="better_payment_widget_id" value="<?php echo esc_attr( $widgetObj->get_id() ); ?>"> |
| 24 |
<input type="hidden" name="better_payment_source" value="gutenberg"> |
| 25 |
<?php |
| 26 |
if ( method_exists( $widgetObj, 'render_campaign_id_hidden_field' ) ) { |
| 27 |
echo $widgetObj->render_campaign_id_hidden_field( $settings ); |
| 28 |
} |
| 29 |
?> |
| 30 |
|
| 31 |
<div class="payment-form-layout-3 payment-form-layout"> |
| 32 |
<div class="tile is-ancestor m-0"> |
| 33 |
<?php if ( $sidebar_show ) : ?> |
| 34 |
<div class="tile is-parent dynamic-amount-section "> |
| 35 |
<div class="tile is-child"> |
| 36 |
<div class="dynamic-amount-section-inner has-text-white p-6"> |
| 37 |
<div class="pt-3 pb-3"> |
| 38 |
<p class="bp-dynamic-amount-section-icon-wrap"><i class="bp-icon bp-logo-2 is-size-1-fix dynamic-amount-section-icon bp-dynamic-amount-section-icon"></i></p> |
| 39 |
<h4 class="is-size-5-fix pt-5 dynamic-amount-section-title bp-dynamic-amount-section-title"><?php esc_html_e($layout_form_transaction_details_heading, 'better-payment'); ?></h4> |
| 40 |
<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> |
| 41 |
<p class="is-size-6-fix pt-2 dynamic-amount-section-subtitle bp-dynamic-amount-section-amount"> |
| 42 |
<?php if ( $is_payment_type_woocommerce || $is_payment_type_fluentcart ) : ?> |
| 43 |
<?php printf( wp_kses( __( '%1$s <a href="%2$s">%3$s</a>', 'better-payment' ), $valid_html_tags ), esc_html( $layout_form_transaction_details_product_title ), esc_url( $product_permalink ), esc_html( $product_name ) ); ?><br> |
| 44 |
<?php endif; ?> |
| 45 |
<?php printf( wp_kses( __( '%1$s <span class="bp-transaction-details-amount-text">%2$s</span>', 'better-payment' ), $valid_html_tags ), esc_html( $layout_form_transaction_details_amount_text ), '' !== $product_price ? floatval( $product_price ) : esc_html( $render_attribute_default_text ) ); ?> |
| 46 |
</p> |
| 47 |
<h4 class="is-size-2-fix pt-5 dynamic-amount-section-amount bp-dynamic-amount-section-amount-summary"><?php printf( wp_kses( __( '%1$s<span class="bp-transaction-details-amount-text">%2$s</span>%3$s', 'better-payment' ), $valid_html_tags ), wp_kses( $layout_form_currency_left, $valid_html_tags ), '' !== $product_price ? floatval( $product_price ) : esc_html( $render_attribute_default_text ), wp_kses( $layout_form_currency_right, $valid_html_tags ) ); ?></h4> |
| 48 |
</div> |
| 49 |
</div> |
| 50 |
</div> |
| 51 |
</div> |
| 52 |
<?php endif; ?> |
| 53 |
|
| 54 |
<div class="tile is-parent has-background-white-fix form-content-section <?php echo ( intval( $sidebar_show ) ? esc_attr('is-8') : esc_attr('is-12') ); ?> <?php esc_attr_e($layout_form_content_offset_class, 'better-payment'); ?>"> |
| 55 |
<div class="tile is-child"> |
| 56 |
<div class="form-content-section-inner p-6"> |
| 57 |
<div class="pt-3 pb-3"> |
| 58 |
<div class="form-content-section-fields"> |
| 59 |
<div class="field-payment_method"> |
| 60 |
<div class="control bp-radio-box columns"> |
| 61 |
<?php |
| 62 |
$bp_paypal_button_enable = !empty( $settings[ 'better_payment_form_paypal_enable' ] ) && 'yes' === $settings[ 'better_payment_form_paypal_enable' ]; |
| 63 |
$bp_stripe_button_enable = !empty( $settings[ 'better_payment_form_stripe_enable' ] ) && 'yes' === $settings[ 'better_payment_form_stripe_enable' ]; |
| 64 |
$bp_paystack_button_enable = !empty( $settings[ 'better_payment_form_paystack_enable' ] ) && 'yes' === $settings[ 'better_payment_form_paystack_enable' ]; |
| 65 |
?> |
| 66 |
|
| 67 |
<?php if( true === $bp_paypal_button_enable ) : ?> |
| 68 |
<label class="radio mb-5 payment-method-checkbox active column has-text-centered payment-method-checkbox-paypal"> |
| 69 |
<input type="radio" name="payment_method" class="layout-payment-method-input layout-payment-method-paypal" checked> |
| 70 |
<img src="<?php echo esc_url(BETTER_PAYMENT_ASSETS . '/img/paypal.png'); ?>" alt="PayPal"> |
| 71 |
</label> |
| 72 |
<?php endif; ?> |
| 73 |
|
| 74 |
<?php if( true === $bp_stripe_button_enable ) : ?> |
| 75 |
<label class="radio mb-5 payment-method-checkbox payment-method-checkbox-stripe <?php echo empty($settings['better_payment_form_paypal_enable']) ? esc_attr('active') : ''; ?> column has-text-centered"> |
| 76 |
<input type="radio" name="payment_method" class="layout-payment-method-input layout-payment-method-stripe" <?php echo empty($settings['better_payment_form_paypal_enable']) ? 'checked' : '' ?>> |
| 77 |
<img src="<?php echo esc_url(BETTER_PAYMENT_ASSETS . '/img/stripe.svg'); ?>" alt="Stripe"> |
| 78 |
</label> |
| 79 |
<?php endif; ?> |
| 80 |
|
| 81 |
<?php if( true === $bp_paystack_button_enable ) : ?> |
| 82 |
<label class="radio mb-5 payment-method-checkbox payment-method-checkbox-paystack <?php echo empty($settings['better_payment_form_paypal_enable']) && empty($settings['better_payment_form_stripe_enable']) ? esc_attr('active') : ''; ?> column has-text-centered"> |
| 83 |
<input type="radio" name="payment_method" class="layout-payment-method-input layout-payment-method-paystack" <?php echo empty($settings['better_payment_form_paypal_enable']) && empty($settings['better_payment_form_stripe_enable']) ? 'checked' : '' ?>> |
| 84 |
<img src="<?php echo esc_url(BETTER_PAYMENT_ASSETS . '/img/paystack.svg'); ?>" alt="Paystack"> |
| 85 |
</label> |
| 86 |
<?php endif; ?> |
| 87 |
</div> |
| 88 |
</div> |
| 89 |
|
| 90 |
<?php |
| 91 |
if ( !empty( $settings['better_payment_form_fields'] ) ) : |
| 92 |
foreach ( $settings['better_payment_form_fields'] as $item ) : |
| 93 |
include BETTER_PAYMENT_ADMIN_VIEWS_PATH . "/partials/layout-repeater-vars.php"; |
| 94 |
|
| 95 |
if ($is_payment_amount_field) : ?> |
| 96 |
<div class="bp-payment-amount-wrap <?php esc_attr_e($layout_put_amount_field_hide_show, 'better-payment'); ?>"> |
| 97 |
<?php |
| 98 |
if (!empty($settings['better_payment_show_amount_list']) && 'yes' === $settings['better_payment_show_amount_list']) { |
| 99 |
$this->render_amount_element($settings); |
| 100 |
} |
| 101 |
?> |
| 102 |
</div> |
| 103 |
<?php endif; ?> |
| 104 |
|
| 105 |
<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 ); ?>"> |
| 106 |
<div class="control has-icons-left"> |
| 107 |
<input class="input is-medium |
| 108 |
<?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; ?>> |
| 109 |
<span class="icon is-medium is-left"> |
| 110 |
<?php if ( $is_payment_amount_field ) : ?> |
| 111 |
<?php printf( '<span class="bp-currency-symbol">%s</span>', esc_html( $layout_form_currency_symbol ) ); ?> |
| 112 |
<?php elseif ($layout_show_image) : ?> |
| 113 |
<img src="<?php echo esc_url($render_attribute_icon); ?>" alt="Icon" width="20"> |
| 114 |
<?php else : ?> |
| 115 |
<i class="<?php echo esc_attr($render_attribute_icon); ?>"></i> |
| 116 |
<?php endif; ?> |
| 117 |
</span> |
| 118 |
</div> |
| 119 |
</div> |
| 120 |
<?php |
| 121 |
endforeach; |
| 122 |
endif; |
| 123 |
?> |
| 124 |
|
| 125 |
<div class="pb-5"></div> |
| 126 |
|
| 127 |
<div class="field-process_payment_button pt-3"> |
| 128 |
<div class="control"> |
| 129 |
<div class="payment__option"> |
| 130 |
<?php |
| 131 |
if ( !empty($settings['better_payment_form_paypal_enable']) && 'yes' === $settings['better_payment_form_paypal_enable'] ) { |
| 132 |
echo Better_Payment\Lite\Classes\Handler::paypal_button(esc_attr($widgetObj->get_id()), $settings); |
| 133 |
} |
| 134 |
|
| 135 |
if ( !empty($settings['better_payment_form_stripe_enable']) && 'yes' === $settings['better_payment_form_stripe_enable'] ) { |
| 136 |
echo Better_Payment\Lite\Classes\Handler::stripe_button(esc_attr($widgetObj->get_id()), $settings); |
| 137 |
} |
| 138 |
|
| 139 |
if ( !empty($settings['better_payment_form_paystack_enable']) && 'yes' === $settings['better_payment_form_paystack_enable'] ) { |
| 140 |
echo Better_Payment\Lite\Classes\Handler::paystack_button(esc_attr($widgetObj->get_id()), $settings); |
| 141 |
} |
| 142 |
?> |
| 143 |
</div> |
| 144 |
</div> |
| 145 |
</div> |
| 146 |
</div> |
| 147 |
</div> |
| 148 |
</div> |
| 149 |
</div> |
| 150 |
</div> |
| 151 |
</div> |
| 152 |
</div> |
| 153 |
</form> |
| 154 |
|
| 155 |
</div> |
| 156 |
</div> |
| 157 |
</div> |
| 158 |
|