Sha256: e61efa33e41443f07497a4336744b30db1034f4ad5663edf1a7126fc7e0bab4f

Contents?: true

Size: 691 Bytes

Versions: 4

Compression:

Stored size: 691 Bytes

Contents

module Workarea
  decorate Checkout::CreditCardParams, with: :stripe do

    # HACK ALERT:
    # Stripe does not give enough data to persist a credit card
    # To get around this set fake data which is then updated
    # when the card is stored on the gateway
    def stripe_params
      {
       stripe_token: params["stripeToken"],
       number: '4111111111111111',
       display_number: '1111',
       year:  Time.current.year + 1,
       month:  Time.current.month,
       first_name: 'stub',
       last_name: 'stub',
       cvv: '000'

      }
    end

    def stripe_token
      params["stripeToken"]
    end

    def stripe?
      params["stripeToken"].present?
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
workarea-stripe-1.1.2 app/models/workarea/checkout/credit_card_params.decorator
workarea-stripe-1.1.1 app/models/workarea/checkout/credit_card_params.decorator
workarea-stripe-1.1.0 app/models/workarea/checkout/credit_card_params.decorator
workarea-stripe-1.0.0 app/models/workarea/checkout/credit_card_params.decorator