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
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
33 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Give\PaymentGateways\PayPalCommerce; |
| 4 | |
| 5 | use Give\PaymentGateways\PayPalCommerce\Models\MerchantDetail; |
| 6 | |
| 7 | class AdvancedCardFields { |
| 8 | /** |
| 9 | * PayPal commerce uses smart buttons to accept payment. |
| 10 | * |
| 11 | * @since 2.9.0 |
| 12 | * |
| 13 | * @param int $formId Donation Form ID. |
| 14 | * |
| 15 | * @access public |
| 16 | * @return string $form |
| 17 | * |
| 18 | */ |
| 19 | public function addCreditCardForm( $formId ) { |
| 20 | $this->removeBillingField(); |
| 21 | give_get_cc_form( $formId ); |
| 22 | } |
| 23 | |
| 24 | /** |
| 25 | * Remove Address Fields if user has option enabled. |
| 26 | * |
| 27 | * @since 2.9.0 |
| 28 | */ |
| 29 | private function removeBillingField() { |
| 30 | remove_action( 'give_after_cc_fields', 'give_default_cc_address_fields' ); |
| 31 | } |
| 32 | } |
| 33 |