class-evf-field-address.php
1 week ago
class-evf-field-ai.php
1 year ago
class-evf-field-captcha.php
1 month ago
class-evf-field-checkbox.php
3 months ago
class-evf-field-color.php
1 month ago
class-evf-field-country.php
3 months ago
class-evf-field-credit-card.php
1 month ago
class-evf-field-date-time.php
1 month ago
class-evf-field-divider.php
2 years ago
class-evf-field-email.php
1 year ago
class-evf-field-file-upload.php
1 year ago
class-evf-field-first-name.php
1 year ago
class-evf-field-hcaptcha.php
5 months ago
class-evf-field-hidden.php
1 year ago
class-evf-field-html.php
10 months ago
class-evf-field-image-upload.php
1 year ago
class-evf-field-last-name.php
1 year ago
class-evf-field-likert.php
1 year ago
class-evf-field-lookup.php
1 month ago
class-evf-field-number.php
1 year ago
class-evf-field-password.php
1 month ago
class-evf-field-payment-authorize-net.php
1 month ago
class-evf-field-payment-checkbox.php
1 month ago
class-evf-field-payment-coupon.php
1 month ago
class-evf-field-payment-gateway-selector.php
1 month ago
class-evf-field-payment-quantity.php
1 month ago
class-evf-field-payment-radio.php
1 month ago
class-evf-field-payment-single.php
1 month ago
class-evf-field-payment-square.php
2 years ago
class-evf-field-payment-subscription-plan.php
1 month ago
class-evf-field-payment-subtotal.php
1 month ago
class-evf-field-payment-total.php
1 month ago
class-evf-field-phone.php
1 year ago
class-evf-field-privacy-policy.php
3 months ago
class-evf-field-private-note.php
1 year ago
class-evf-field-progress.php
1 month ago
class-evf-field-radio.php
3 months ago
class-evf-field-range-slider.php
1 month ago
class-evf-field-rating.php
3 months ago
class-evf-field-recaptcha.php
5 months ago
class-evf-field-repeater.php
1 month ago
class-evf-field-reset.php
1 month ago
class-evf-field-scale-rating.php
1 year ago
class-evf-field-select.php
1 year ago
class-evf-field-signature.php
1 month ago
class-evf-field-text.php
1 year ago
class-evf-field-textarea.php
1 year ago
class-evf-field-title.php
2 years ago
class-evf-field-turnstile.php
5 months ago
class-evf-field-url.php
1 year ago
class-evf-field-wysiwyg.php
3 months ago
class-evf-field-yes-no.php
1 year ago
payment-amount-helpers.php
1 month ago
class-evf-field-credit-card.php
87 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Credit Card field |
| 4 | * |
| 5 | * @package EverestForms\Fields |
| 6 | * @since 1.4.9 |
| 7 | */ |
| 8 | |
| 9 | defined( 'ABSPATH' ) || exit; |
| 10 | |
| 11 | /** |
| 12 | * EVF_Field_Credit_Card Class. |
| 13 | * |
| 14 | * Builder-scope (read-only) version shipped in the free plugin so the field can |
| 15 | * be shown LOCKED — with its real preview and readable settings — for the AI |
| 16 | * upsell. The full functional implementation (front-end display, Stripe |
| 17 | * gateways, processing) lives in Everest Forms Pro, whose class loads in place |
| 18 | * of this one when the plugin is active (this file is only autoloaded when that |
| 19 | * class is not already defined). Keep `is_pro = true` so the field stays locked. |
| 20 | */ |
| 21 | class EVF_Field_Credit_Card extends EVF_Form_Fields { |
| 22 | |
| 23 | /** |
| 24 | * Constructor. |
| 25 | */ |
| 26 | public function __construct() { |
| 27 | $this->name = esc_html__( 'Credit Card', 'everest-forms' ); |
| 28 | $this->type = 'credit-card'; |
| 29 | $this->icon = 'evf-icon evf-icon-payment'; |
| 30 | $this->order = 50; |
| 31 | $this->group = 'payment'; |
| 32 | $this->is_pro = true; |
| 33 | $this->plan = 'personal agency themegrill-agency'; |
| 34 | $this->links = array( |
| 35 | 'image_id' => '', |
| 36 | 'vedio_id' => 'ermR7iHtWEc', |
| 37 | ); |
| 38 | $this->settings = array( |
| 39 | 'basic-options' => array( |
| 40 | 'field_options' => array( |
| 41 | 'label', |
| 42 | 'description', |
| 43 | ), |
| 44 | ), |
| 45 | 'advanced-options' => array( |
| 46 | 'field_options' => array( |
| 47 | 'meta', |
| 48 | 'label_hide', |
| 49 | 'css', |
| 50 | ), |
| 51 | ), |
| 52 | ); |
| 53 | |
| 54 | // The required Stripe add-on supplies this field. Mark it so the locked |
| 55 | // settings panel shows an "Activate Stripe" CTA when already licensed. |
| 56 | $this->addon = 'everest-forms-stripe'; |
| 57 | |
| 58 | parent::__construct(); |
| 59 | } |
| 60 | |
| 61 | /** |
| 62 | * Field preview inside the builder. |
| 63 | * |
| 64 | * Renders the same card layout the real (Stripe-active) field shows in the |
| 65 | * builder, so the locked Pro showcase is pixel-identical to the actual field |
| 66 | * — just non-interactive. The "Activate Stripe" CTA lives in the locked |
| 67 | * settings panel, not on the canvas. |
| 68 | * |
| 69 | * @param array $field Field data and settings. |
| 70 | */ |
| 71 | public function field_preview( $field ) { |
| 72 | $this->field_preview_option( 'label', $field ); |
| 73 | ?> |
| 74 | <div class="everest-forms-credit-card-cardnumber"> |
| 75 | <div class="everest-forms-card-icon"> |
| 76 | <svg focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 21"><g fill="none" fill-rule="evenodd"><g id="unknown" class="Icon-fill"><g id="card" transform="translate(0 2)"><path id="shape" d="M26.58 19H2.42A2.4 2.4 0 0 1 0 16.62V2.38A2.4 2.4 0 0 1 2.42 0h24.16A2.4 2.4 0 0 1 29 2.38v14.25A2.4 2.4 0 0 1 26.58 19zM10 5.83c0-.46-.35-.83-.78-.83H3.78c-.43 0-.78.37-.78.83v3.34c0 .46.35.83.78.83h5.44c.43 0 .78-.37.78-.83V5.83z" opacity=".2"></path><path id="shape" d="M25 15h-3c-.65 0-1-.3-1-1s.35-1 1-1h3c.65 0 1 .3 1 1s-.35 1-1 1zm-6 0h-3c-.65 0-1-.3-1-1s.35-1 1-1h3c.65 0 1 .3 1 1s-.35 1-1 1zm-6 0h-3c-.65 0-1-.3-1-1s.35-1 1-1h3c.65 0 1 .3 1 1s-.35 1-1 1zm-6 0H4c-.65 0-1-.3-1-1s.35-1 1-1h3c.65 0 1 .3 1 1s-.35 1-1 1z" opacity=".3"></path></g></g></g></svg> |
| 77 | </div> |
| 78 | <input class="card-number" type="text" placeholder="Card Number" disabled> |
| 79 | <input class="card-expiration" type="text" placeholder="MM / YY" disabled> |
| 80 | <input class="card-cvc" type="text" placeholder="CVC" disabled> |
| 81 | </div> |
| 82 | <?php |
| 83 | // Description. |
| 84 | $this->field_preview_option( 'description', $field ); |
| 85 | } |
| 86 | } |
| 87 |