PayPalStandard.php
110 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Give\PaymentGateways\PayPalStandard; |
| 4 | |
| 5 | use Give\PaymentGateways\PaymentGateway; |
| 6 | |
| 7 | class PayPalStandard implements PaymentGateway { |
| 8 | /** |
| 9 | * @inheritDoc |
| 10 | */ |
| 11 | public function getId() { |
| 12 | return 'paypal'; |
| 13 | } |
| 14 | |
| 15 | /** |
| 16 | * @inheritDoc |
| 17 | */ |
| 18 | public function getName() { |
| 19 | return esc_html__( 'PayPal Standard', 'give' ); |
| 20 | } |
| 21 | |
| 22 | /** |
| 23 | * @inheritDoc |
| 24 | */ |
| 25 | public function getPaymentMethodLabel() { |
| 26 | return esc_html__( 'PayPal', 'give' ); |
| 27 | } |
| 28 | |
| 29 | /** |
| 30 | * @inheritDoc |
| 31 | */ |
| 32 | public function getOptions() { |
| 33 | return [ |
| 34 | // Section 2: PayPal Standard. |
| 35 | [ |
| 36 | 'type' => 'title', |
| 37 | 'id' => 'give_title_gateway_settings_2', |
| 38 | ], |
| 39 | [ |
| 40 | 'name' => esc_html__( 'PayPal Email', 'give' ), |
| 41 | 'desc' => esc_html__( 'Enter the email address associated with your PayPal account to connect with the gateway.', 'give' ), |
| 42 | 'id' => 'paypal_email', |
| 43 | 'type' => 'email', |
| 44 | ], |
| 45 | [ |
| 46 | 'name' => esc_html__( 'PayPal Page Style', 'give' ), |
| 47 | 'desc' => esc_html__( 'Enter the name of the PayPal page style to use, or leave blank to use the default.', 'give' ), |
| 48 | 'id' => 'paypal_page_style', |
| 49 | 'type' => 'text', |
| 50 | ], |
| 51 | [ |
| 52 | 'name' => esc_html__( 'PayPal Transaction Type', 'give' ), |
| 53 | 'desc' => esc_html__( 'Nonprofits must verify their status to withdraw donations they receive via PayPal. PayPal users that are not verified nonprofits must demonstrate how their donations will be used, once they raise more than $10,000. By default, GiveWP transactions are sent to PayPal as donations. You may change the transaction type using this option if you feel you may not meet PayPal\'s donation requirements.', 'give' ), |
| 54 | 'id' => 'paypal_button_type', |
| 55 | 'type' => 'radio_inline', |
| 56 | 'options' => [ |
| 57 | 'donation' => esc_html__( 'Donation', 'give' ), |
| 58 | 'standard' => esc_html__( 'Standard Transaction', 'give' ), |
| 59 | ], |
| 60 | 'default' => 'donation', |
| 61 | ], |
| 62 | [ |
| 63 | 'name' => esc_html__( 'Billing Details', 'give' ), |
| 64 | 'desc' => esc_html__( 'If enabled, required billing address fields are added to PayPal Standard forms. These fields are not required by PayPal to process the transaction, but you may have a need to collect the data. Billing address details are added to both the donation and donor record in GiveWP.', 'give' ), |
| 65 | 'id' => 'paypal_standard_billing_details', |
| 66 | 'type' => 'radio_inline', |
| 67 | 'default' => 'disabled', |
| 68 | 'options' => [ |
| 69 | 'enabled' => esc_html__( 'Enabled', 'give' ), |
| 70 | 'disabled' => esc_html__( 'Disabled', 'give' ), |
| 71 | ], |
| 72 | ], |
| 73 | [ |
| 74 | 'name' => esc_html__( 'PayPal IPN Verification', 'give' ), |
| 75 | 'desc' => esc_html__( 'If enabled, IPN (Instant Payment Notification) messages sent to your site from PayPal are verified with an extra (background) step. The IPN is what marks PayPal donations as complete on GiveWP\'s side. If donations are not getting marked as complete, disabling this extra verification step can resolve it. Only disable this setting to resolve the pending donation issue, since it is technically less secure.', 'give' ), |
| 76 | 'id' => 'paypal_verification', |
| 77 | 'type' => 'radio_inline', |
| 78 | 'default' => 'enabled', |
| 79 | 'options' => [ |
| 80 | 'enabled' => esc_html__( 'Enabled', 'give' ), |
| 81 | 'disabled' => esc_html__( 'Disabled', 'give' ), |
| 82 | ], |
| 83 | ], |
| 84 | [ |
| 85 | 'id' => 'paypal_invoice_prefix', |
| 86 | 'name' => esc_html__( 'Invoice ID Prefix', 'give' ), |
| 87 | 'desc' => esc_html__( 'Please enter a prefix for your invoice numbers. If you use your PayPal account for multiple fundraising platforms or ecommerce stores, ensure this prefix is unique. PayPal will not allow orders or donations with the same invoice number.', 'give' ), |
| 88 | 'type' => 'text', |
| 89 | 'default' => 'GIVE-', |
| 90 | ], |
| 91 | [ |
| 92 | 'name' => esc_html__( 'PayPal Standard Gateway Settings Docs Link', 'give' ), |
| 93 | 'id' => 'paypal_standard_gateway_settings_docs_link', |
| 94 | 'url' => esc_url( 'http://docs.givewp.com/settings-gateway-paypal-standard' ), |
| 95 | 'title' => esc_html__( 'PayPal Standard Gateway Settings', 'give' ), |
| 96 | 'type' => 'give_docs_link', |
| 97 | ], |
| 98 | [ |
| 99 | 'type' => 'sectionend', |
| 100 | 'id' => 'give_title_gateway_settings_2', |
| 101 | ], |
| 102 | ]; |
| 103 | } |
| 104 | |
| 105 | /** |
| 106 | * @inheritDoc |
| 107 | */ |
| 108 | public function boot(){} |
| 109 | } |
| 110 |