PluginProbe
seQura / 3.0.2
seQura v3.0.2
4.3.4 4.3.3 4.3.2 4.3.1 trunk 2.0.0 2.0.10 2.0.11 2.0.12 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 3.0.0 3.0.2 3.0.5 3.0.6 3.0.7 3.1.0 3.1.1 3.2.0 3.2.1 3.2.2 4.0.0 All 30 releases
sequra / templates / front / payment_fields.php

payment_fields.php in seQura 3.0.2, at templates/front/payment_fields.php

50 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Payment fields for seQura payment gateway.
4 *
5 * @package SeQura/WC
6 * @var string $args The arguments. Must contain:
7 * - description: string
8 * - payment_methods: array<string, mixed>
9 */
10
11 use SeQura\WC\Dto\Payment_Method_Data;
12
13 defined( 'WPINC' ) || die;
14 if ( ! isset( $args['description'], $args['payment_methods'] ) ) {
15 return;
16 }
17 ?>
18
19 <span class="sequra-block__description"><?php echo wp_kses_post( wpautop( wptexturize( $args['description'] ) ) ); ?></span>
20 <?php
21 foreach ( (array) $args['payment_methods'] as $key => $pm ) :
22 /**
23 * Dto
24 *
25 * @var Payment_Method_Data $dto
26 */
27 $dto = Payment_Method_Data::from_array( $pm );
28 if ( ! $dto || ! $dto->is_valid() ) {
29 continue;
30 }
31
32 $input_id = "sequra_payment_method_{$key}";
33 ?>
34 <div class="sequra-payment-method">
35 <input type="radio" name="sequra_payment_method_data" value="<?php echo esc_attr( $dto->encode() ); ?>" id="<?php echo esc_attr( $input_id ); ?>" class="sequra-payment-method__input wc-block-components-radio-control__input" />
36 <label for="<?php echo esc_attr( $input_id ); ?>">
37 <div class="sequra-payment-method__description">
38 <span class="sequra-payment-method__name" style="width:100%"><?php echo esc_html( $pm['title'] ); ?></span>
39 <span class="sequra-payment-method__claim" style="width:100%"><?php echo esc_html( $pm['claim'] ); ?></span>
40 <?php if ( ! empty( $pm['costDescription'] ) ) : ?>
41 <span class="sequra-payment-method__cost-desc" style="width:100%"><?php echo esc_html( $pm['costDescription'] ); ?></span>
42 <?php endif; ?>
43 </div>
44 <?php if ( ! empty( $pm['icon'] ) ) : ?>
45 <img src="data:image/svg+xml;base64,<?php echo esc_attr( base64_encode( $pm['icon'] ) ); ?>" height="40px" loading="lazy" alt="<?php echo esc_attr( $pm['title'] ); ?>" class="sequra-payment-method__icon" />
46 <?php endif; ?>
47 </label>
48 </div>
49 <?php endforeach; ?>
50