Skip to content

Commit

Permalink
fix: render hosted card field only if enabled in admin settings
Browse files Browse the repository at this point in the history
  • Loading branch information
ravinderk committed Aug 19, 2023
1 parent 36c8e68 commit 2932dd8
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,15 @@ import {CSSProperties, useEffect, useState} from 'react';
cardholderName = _cardholderName ?? cardholderDefault;
});

// Do not render hosted fields if disabled in admin settings.
if( -1 === payPalDonationsSettings.sdkOptions['components'].indexOf('hosted-fields') ){
return;
}

/**
* Hosted fields are not supported for subscriptions at this time.
*/
const supportsHostedFields = donationType !== 'subscription'
&& -1 !== payPalDonationsSettings.sdkOptions['components'].indexOf('hosted-fields');
const supportsHostedFields = donationType !== 'subscription';

return (

Expand Down

0 comments on commit 2932dd8

Please sign in to comment.