BECSMandateForm.php
4 years ago
CanSetupStripeApp.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
97 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Give\PaymentGateways\Gateways\Stripe\Traits; |
| 4 | |
| 5 | trait SEPAMandateForm |
| 6 | { |
| 7 | use FormFieldMarkup; |
| 8 | |
| 9 | public function getMandateFormHTML(int $form_id, array $args): string |
| 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( |
| 39 | 'The (typically) 16 digits on the front of your credit card.', |
| 40 | 'give' |
| 41 | ); ?>"></span> |
| 42 | </label> |
| 43 | <div |
| 44 | id="give-stripe-sepa-fields-<?php echo $id_prefix; ?>" |
| 45 | class="give-stripe-sepa-iban-field give-stripe-cc-field" |
| 46 | data-hide_icon="<?php echo give_stripe_hide_iban_icon($form_id); ?>" |
| 47 | data-icon_style="<?php echo give_stripe_get_iban_icon_style($form_id); ?>" |
| 48 | data-placeholder_country="<?php echo give_stripe_get_iban_placeholder_country(); ?>" |
| 49 | ></div> |
| 50 | </div> |
| 51 | <div class="form-row form-row-responsive give-stripe-sepa-mandate-acceptance-text"> |
| 52 | <?php |
| 53 | if (give_is_setting_enabled(give_get_option('stripe_mandate_acceptance_option', 'enabled'))) { |
| 54 | echo give_stripe_get_mandate_acceptance_text(); |
| 55 | } |
| 56 | ?> |
| 57 | </div> |
| 58 | <?php |
| 59 | /** |
| 60 | * This action hook is used to display content after the Credit Card expiration field. |
| 61 | * |
| 62 | * Note: Kept this hook as it is. |
| 63 | * |
| 64 | * @since 2.5.0 |
| 65 | * |
| 66 | * @param array $args List of additional arguments. |
| 67 | * |
| 68 | * @param int $form_id Donation Form ID. |
| 69 | */ |
| 70 | do_action('give_after_cc_expiration', $form_id, $args); |
| 71 | |
| 72 | /** |
| 73 | * This action hook is used to display content after the Credit Card expiration field. |
| 74 | * |
| 75 | * @since 2.5.0 |
| 76 | * |
| 77 | * @param array $args List of additional arguments. |
| 78 | * |
| 79 | * @param int $form_id Donation Form ID. |
| 80 | */ |
| 81 | do_action('give_stripe_after_cc_expiration', $form_id, $args); |
| 82 | } |
| 83 | ?> |
| 84 | </fieldset> |
| 85 | <?php |
| 86 | // Remove Address Fields if user has option enabled. |
| 87 | $billing_fields_enabled = give_get_option('stripe_collect_billing'); |
| 88 | if (!$billing_fields_enabled) { |
| 89 | remove_action('give_after_cc_fields', 'give_default_cc_address_fields'); |
| 90 | } |
| 91 | |
| 92 | do_action('give_after_cc_fields', $form_id, $args); |
| 93 | |
| 94 | return ob_get_clean(); |
| 95 | } |
| 96 | } |
| 97 |