Skip to content

Commit

Permalink
merge with master
Browse files Browse the repository at this point in the history
  • Loading branch information
tjsilver committed Oct 25, 2019
1 parent 8c73511 commit 2b5de61
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ const mapStateToProps = (state: State) => ({
country: state.common.internationalisation.countryId,
stripeV3HasLoaded: state.page.form.stripeV3HasLoaded,
stripeElementsRecurringTestVariant: state.common.abParticipations.stripeElementsRecurring,
stripePaymentRequestButtonMethod: state.page.form.stripePaymentRequestButtonData.paymentMethod,
paymentSecurityDesignTestVariant: state.common.abParticipations.paymentSecurityDesignTest,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,19 +111,21 @@ function withProps(props: PropTypes) {
const fullExistingPaymentMethods: RecentlySignedInExistingPaymentMethod[] =
((props.existingPaymentMethods || []).filter(isUsableExistingPaymentMethod): any);

const legend = (
const legendSimple = (
<legend className="form__legend">Payment method</legend>
);

const legendWithSecureTransaction = (
<div className="secure-transaction">
{legend} <SecureTransactionIndicator modifierClasses={['middle']} />
</div>
);
const legend = props.paymentSecurityDesignTestVariant === 'V2_securemiddle' ?
(
<div className="secure-transaction">
{legendSimple} <SecureTransactionIndicator modifierClasses={['middle']} />
</div>
) :
legendSimple;

return (
<fieldset className={classNameWithModifiers('form__radio-group', ['buttons', 'contribution-pay'])}>
{props.paymentSecurityDesignTestVariant === 'V2_securemiddle' ? legendWithSecureTransaction : legend}
{legend}
{ paymentMethods.length ?
<ul className="form__radio-group-list">
{contributionTypeIsRecurring(props.contributionType) && !props.existingPaymentMethods && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,13 @@ type PropTypes = {|
stripeKey: string,
setupIntentClientSecret: string | null,
setSetupIntentClientSecret: (setupIntentClientSecret: string) => Action,
paymentSecurityDesignTestVariant: PaymentSecurityDesignTestVariants,
|};

const mapStateToProps = (state: State) => ({
contributionType: state.page.form.contributionType,
checkoutFormHasBeenSubmitted: state.page.form.formData.checkoutFormHasBeenSubmitted,
setupIntentClientSecret: state.page.form.stripeCardFormData.setupIntentClientSecret,
paymentWaiting: state.page.form.isWaiting,
paymentSecurityDesignTestVariant: state.common.abParticipations.paymentSecurityDesign,
});

const mapDispatchToProps = (dispatch: Function) => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,6 @@ class StripeCardFormContainer extends React.Component<PropTypes, void> {
if (this.props.paymentMethod === Stripe &&
(this.props.contributionType === 'ONE_OFF' || this.props.stripeElementsRecurringTestVariant === 'stripeElements')
) {
const classNames = this.props.showSecureBackground ? 'stripe-card-element-container stripe-card-element-container-secure' : 'stripe-card-element-container';

if (this.props.contributionType === 'ONE_OFF' &&
this.props.paymentMethod === Stripe) {

if (this.props.stripeHasLoaded) {

const stripeAccount = stripeAccountForContributionType[this.props.contributionType];
Expand All @@ -55,6 +50,8 @@ class StripeCardFormContainer extends React.Component<PropTypes, void> {
this.props.isTestUser,
);

const classNames = this.props.showSecureBackground ? 'stripe-card-element-container stripe-card-element-container-secure' : 'stripe-card-element-container';

/**
* The `key` attribute is necessary here because you cannot modify the apiKey on StripeProvider.
* Instead, we must create separate instances for ONE_OFF and REGULAR.
Expand Down

0 comments on commit 2b5de61

Please sign in to comment.