PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.17.0
GiveWP – Donation Plugin and Fundraising Platform v4.17.0
4.17.0 4.16.9 4.16.8.1 4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 All 256 releases
give / src / PaymentGateways / Gateways / PayPalStandard / Views / PayPalStandardBillingFields.php

PayPalStandardBillingFields.php in GiveWP – Donation Plugin and Fundraising Platform 4.17.0, at src/PaymentGateways/Gateways/PayPalStandard/Views/PayPalStandardBillingFields.php

68 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Give\PaymentGateways\Gateways\PayPalStandard\Views;
4
5 use Give\Helpers\Form\Utils;
6
7 /**
8 * This class handle donation form billing field markup for PayPal Standard.
9 *
10 * @since 2.22.2
11 */
12 class PayPalStandardBillingFields
13 {
14 /**
15 * @since 2.22.2
16 *
17 * @param int $formId
18 *
19 * @return string
20 */
21 public function __invoke(int $formId): string
22 {
23 ob_start();
24
25 if (give_is_setting_enabled(give_get_option('paypal_standard_billing_details'))) {
26 give_default_cc_address_fields($formId);
27 } elseif (Utils::isLegacyForm($formId)) {
28 echo '';
29 } else {
30 printf(
31 '
32 <fieldset class="no-fields">
33 <div style="display: flex; justify-content: center; margin-top: 20px;">
34 %4$s
35 </div>
36 <p style="text-align: center;"><b>%1$s</b></p>
37 <p style="text-align: center;"><b>%2$s</b> %3$s</p>
38 </fieldset>
39 ',
40 esc_html__('Make your donation quickly and securely with PayPal', 'give'),
41 esc_html__('How it works:', 'give'),
42 esc_html__(
43 'You will be redirected to PayPal to complete your donation with your debit card, credit card, or with your PayPal account. Once complete, you will be redirected back to this site to view your receipt.',
44 'give'
45 ),
46 $this->getLogo()
47 );
48 }
49
50 return ob_get_clean();
51 }
52
53 /**
54 * Return paypal logo.
55 *
56 * @since 2.19.0
57 * @since 2.19.4 Use correct logo path.
58 *
59 * @return string
60 */
61 private function getLogo(): string
62 {
63 return file_get_contents(
64 GIVE_PLUGIN_DIR . 'src/PaymentGateways/Gateways/PayPalStandard/resources/templates/paypal-standard-logo.svg'
65 );
66 }
67 }
68