BECSMandateForm.php
4 years ago
CheckoutInstructions.php
4 years ago
CheckoutModal.php
4 years ago
CheckoutRedirect.php
4 years ago
CreditCardForm.php
4 years ago
FormFieldMarkup.php
4 years ago
HandlePaymentIntentStatus.php
4 years ago
SEPAMandateForm.php
4 years ago
SEPAMandateForm.php
92 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Give\PaymentGateways\Gateways\Stripe\Traits; |
| 4 | |
| 5 | trait SEPAMandateForm |
| 6 | { |
| 7 | use FormFieldMarkup; |
| 8 | |
| 9 | public function getMandateFormHTML( $form_id, $args ) |
| 10 | { |
| 11 | ob_start(); |
| 12 | |
| 13 | $id_prefix = ! empty( $args['id_prefix'] ) ? $args['id_prefix'] : ''; |
| 14 | |
| 15 | do_action( 'give_before_cc_fields', $form_id ); ?> |
| 16 | |
| 17 | <fieldset id="give_cc_fields" class="give-do-validate"> |
| 18 | <legend> |
| 19 | <?php esc_attr_e( 'IBAN Info', 'give' ); ?> |
| 20 | </legend> |
| 21 | |
| 22 | <?php |
| 23 | if ( is_ssl() ) { |
| 24 | ?> |
| 25 | <div id="give_secure_site_wrapper"> |
| 26 | <span class="give-icon padlock"></span> |
| 27 | <span><?php esc_attr_e( 'This is a secure SSL encrypted payment.', 'give' ); ?></span> |
| 28 | </div> |
| 29 | <?php |
| 30 | } |
| 31 | |
| 32 | if ( $this->canShowFields() ) { |
| 33 | ?> |
| 34 | <div id="give-iban-number-wrap" class="form-row form-row-responsive give-stripe-cc-field-wrap"> |
| 35 | <label for="give-iban-number-field-<?php echo $id_prefix; ?>" class="give-label"> |
| 36 | <?php echo __( 'IBAN', 'give' ); ?> |
| 37 | <span class="give-required-indicator">*</span> |
| 38 | <span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php esc_attr_e( 'The (typically) 16 digits on the front of your credit card.', 'give' ); ?>"></span> |
| 39 | </label> |
| 40 | <div |
| 41 | id="give-stripe-sepa-fields-<?php echo $id_prefix; ?>" |
| 42 | class="give-stripe-sepa-iban-field give-stripe-cc-field" |
| 43 | data-hide_icon="<?php echo give_stripe_hide_iban_icon( $form_id ); ?>" |
| 44 | data-icon_style="<?php echo give_stripe_get_iban_icon_style( $form_id ); ?>" |
| 45 | data-placeholder_country="<?php echo give_stripe_get_iban_placeholder_country(); ?>" |
| 46 | ></div> |
| 47 | </div> |
| 48 | <div class="form-row form-row-responsive give-stripe-sepa-mandate-acceptance-text"> |
| 49 | <?php |
| 50 | if ( give_is_setting_enabled( give_get_option( 'stripe_mandate_acceptance_option', 'enabled' ) ) ) { |
| 51 | echo give_stripe_get_mandate_acceptance_text(); |
| 52 | } |
| 53 | ?> |
| 54 | </div> |
| 55 | <?php |
| 56 | /** |
| 57 | * This action hook is used to display content after the Credit Card expiration field. |
| 58 | * |
| 59 | * Note: Kept this hook as it is. |
| 60 | * |
| 61 | * @param int $form_id Donation Form ID. |
| 62 | * @param array $args List of additional arguments. |
| 63 | * |
| 64 | * @since 2.5.0 |
| 65 | */ |
| 66 | do_action( 'give_after_cc_expiration', $form_id, $args ); |
| 67 | |
| 68 | /** |
| 69 | * This action hook is used to display content after the Credit Card expiration field. |
| 70 | * |
| 71 | * @param int $form_id Donation Form ID. |
| 72 | * @param array $args List of additional arguments. |
| 73 | * |
| 74 | * @since 2.5.0 |
| 75 | */ |
| 76 | do_action( 'give_stripe_after_cc_expiration', $form_id, $args ); |
| 77 | } |
| 78 | ?> |
| 79 | </fieldset> |
| 80 | <?php |
| 81 | // Remove Address Fields if user has option enabled. |
| 82 | $billing_fields_enabled = give_get_option( 'stripe_collect_billing' ); |
| 83 | if ( ! $billing_fields_enabled ) { |
| 84 | remove_action( 'give_after_cc_fields', 'give_default_cc_address_fields' ); |
| 85 | } |
| 86 | |
| 87 | do_action( 'give_after_cc_fields', $form_id, $args ); |
| 88 | |
| 89 | return ob_get_clean(); |
| 90 | } |
| 91 | } |
| 92 |