DataTransferObjects
5 years ago
Models
5 years ago
Repositories
5 years ago
Webhooks
5 years ago
AccountAdminNotices.php
5 years ago
AdminSettingFields.php
5 years ago
AdvancedCardFields.php
5 years ago
AjaxRequestHandler.php
5 years ago
DonationDetailsPage.php
5 years ago
DonationFormPaymentMethod.php
5 years ago
DonationProcessor.php
5 years ago
PayPalClient.php
5 years ago
PayPalCommerce.php
5 years ago
RefreshToken.php
5 years ago
RefundPaymentHandler.php
5 years ago
ScriptLoader.php
5 years ago
Utils.php
5 years ago
onBoardingRedirectHandler.php
5 years ago
AdvancedCardFields.php
36 lines
| 1 | <?php |
| 2 | namespace Give\PaymentGateways\PayPalCommerce; |
| 3 | |
| 4 | /** |
| 5 | * Class AdvancedCardFields |
| 6 | * @package Give\PaymentGateways\PayPalCommerce |
| 7 | * |
| 8 | * @since 2.9.0 |
| 9 | */ |
| 10 | class AdvancedCardFields { |
| 11 | /** |
| 12 | * PayPal commerce uses smart buttons to accept payment. |
| 13 | * |
| 14 | * @since 2.9.0 |
| 15 | * |
| 16 | * @param int $formId Donation Form ID. |
| 17 | * |
| 18 | * @access public |
| 19 | * @return string $form |
| 20 | * |
| 21 | */ |
| 22 | public function addCreditCardForm( $formId ) { |
| 23 | $this->removeBillingField(); |
| 24 | give_get_cc_form( $formId ); |
| 25 | } |
| 26 | |
| 27 | /** |
| 28 | * Remove Address Fields if user has option enabled. |
| 29 | * |
| 30 | * @since 2.9.0 |
| 31 | */ |
| 32 | private function removeBillingField() { |
| 33 | remove_action( 'give_after_cc_fields', 'give_default_cc_address_fields' ); |
| 34 | } |
| 35 | } |
| 36 |