Sha256: d6861f27af9a440ebce5d89c53347d802f2ddfc3056b2c1d9857cc588be8ac41

Contents?: true

Size: 1.02 KB

Versions: 9

Compression:

Stored size: 1.02 KB

Contents

module ActiveMerchant
  module Billing
    module StripeGatewayDecorator
      def verify(source, **options)
        customer = source.gateway_customer_profile_id
        bank_account_token = source.gateway_payment_profile_id

        commit(:post, "customers/#{CGI.escape(customer)}/sources/#{bank_account_token}/verify", amounts: options[:amounts])
      end

      def retrieve(source, **options)
        customer = source.gateway_customer_profile_id
        bank_account_token = source.gateway_payment_profile_id
        commit(:get, "customers/#{CGI.escape(customer)}/bank_accounts/#{bank_account_token}")
      end

      private

      def headers(options = {})
        headers = super
        headers['User-Agent'] = headers['X-Stripe-Client-User-Agent']
        headers
      end

      def add_customer_data(post, options)
        super
        post[:payment_user_agent] = "SpreeGateway/#{SpreeGateway.version}"
      end
    end
  end
end

ActiveMerchant::Billing::StripeGateway.prepend(ActiveMerchant::Billing::StripeGatewayDecorator)

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
spree_gateway-3.11.0 lib/active_merchant/billing/stripe_gateway_decorator.rb
spree_gateway-3.10.0 lib/active_merchant/billing/stripe_gateway_decorator.rb
archetype_spree_gateway-3.9.5.1 lib/active_merchant/billing/stripe_gateway_decorator.rb
archetype_spree_gateway-3.9.5 lib/active_merchant/billing/stripe_gateway_decorator.rb
spree_gateway-3.9.4 lib/active_merchant/billing/stripe_gateway_decorator.rb
spree_gateway-3.9.3 lib/active_merchant/billing/stripe_gateway_decorator.rb
spree_gateway-3.9.2 lib/active_merchant/billing/stripe_gateway_decorator.rb
spree_gateway-3.9.0 lib/active_merchant/billing/stripe_gateway_decorator.rb
spree_gateway-3.8.0 lib/active_merchant/billing/stripe_gateway_decorator.rb