<commit_before>// @flow
import React, { Component } from 'react';
import { connect } from 'react-redux';
import $ from '../../util/PubSub';
import { FormattedMessage } from 'react-intl';

import Checkbox from '../Checkbox/Checkbox';
import DonateButton from '../DonateButton';
import PaymentMethodWrapper from './PaymentMethodWrapper';
import PaymentMethodItem from './PaymentMethod';
import { setRecurring } from '../../state/fundraiser/actions';

import type { Dispatch } from 'redux';
import type {
  AppState,
  PaymentMethod,
  FundraiserState
} from '../../state/index';

import './ExpressDonation.scss';

type OwnProps = {
  hidden: boolean;
  fundraiser: FundraiserState;
  paymentMethods: PaymentMethod[];
  formData: { member: any; storeInVault: boolean; };
  setRecurring: (value: boolean) => void;
  onHide: () => void;
};

type OwnState = {
  currentPaymentMethod: ?PaymentMethod;
  submitting: boolean;
};

export class ExpressDonation extends Component {
  props: OwnProps;
  state: OwnState;

  constructor(props: OwnProps) {
    super(props);

    this.state = {
      currentPaymentMethod: props.paymentMethods ? props.paymentMethods[0] : null,
      submitting: false,
    };
  }

  // Payment methods don't really change after we've loaded them from
  // Champaign so in theory we don't need this, however, should the `parse_champaign_data`
  // action get dispatched after we've rendered, this would update us.
  componentWillReceiveProps(newProps: OwnProps) {
    this.setState({ currentPaymentMethod: newProps.paymentMethods[0] });
  }

  oneClickData() {
    if (!this.state.currentPaymentMethod) return null;
<commit_msg>remove unused code that was causing a bug in payment method selection<commit_after>// @flow
import React, { Component } from 'react';
import { connect } from 'react-redux';
import $ from '../../util/PubSub';
import { FormattedMessage } from 'react-intl';

import Checkbox from '../Checkbox/Checkbox';
import DonateButton from '../DonateButton';
import PaymentMethodWrapper from './PaymentMethodWrapper';
import PaymentMethodItem from './PaymentMethod';
import { setRecurring } from '../../state/fundraiser/actions';

import type { Dispatch } from 'redux';
import type {
  AppState,
  PaymentMethod,
  FundraiserState
} from '../../state/index';

import './ExpressDonation.scss';

type OwnProps = {
  hidden: boolean;
  fundraiser: FundraiserState;
  paymentMethods: PaymentMethod[];
  formData: { member: any; storeInVault: boolean; };
  setRecurring: (value: boolean) => void;
  onHide: () => void;
};

type OwnState = {
  currentPaymentMethod: ?PaymentMethod;
  submitting: boolean;
};

export class ExpressDonation extends Component {
  props: OwnProps;
  state: OwnState;

  constructor(props: OwnProps) {
    super(props);

    this.state = {
      currentPaymentMethod: props.paymentMethods ? props.paymentMethods[0] : null,
      submitting: false,
    };
  }

  oneClickData() {
    if (!this.state.currentPaymentMethod) return null;

{'fraction_non_alphanumeric': 0.12751004016064257, 'fraction_numerical': 0.001004016064257028, 'mean_word_length': 4.1982608695652175, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6199865', 'n_tokens_mistral': 879, 'n_tokens_neox': 864, 'n_words': 250}