Module: Mpp::Methods::Stripe
- Defined in:
- lib/mpp/methods/stripe.rb,
lib/mpp/methods/stripe/defaults.rb,
lib/mpp/methods/stripe/charge_intent.rb,
lib/mpp/methods/stripe/client_method.rb,
lib/mpp/methods/stripe/stripe_method.rb
Defined Under Namespace
Modules: Defaults Classes: ChargeIntent, ClientMethod, StripeMethod
Class Method Summary collapse
-
.stripe(secret_key:, network_id:, payment_methods: nil, metadata: nil, currency: Defaults::DEFAULT_CURRENCY, decimals: Defaults::DEFAULT_DECIMALS, external_id: nil, api_base: Defaults::STRIPE_API_BASE) ⇒ Object
Factory function to create a configured StripeMethod with ChargeIntent.
Class Method Details
.stripe(secret_key:, network_id:, payment_methods: nil, metadata: nil, currency: Defaults::DEFAULT_CURRENCY, decimals: Defaults::DEFAULT_DECIMALS, external_id: nil, api_base: Defaults::STRIPE_API_BASE) ⇒ Object
Factory function to create a configured StripeMethod with ChargeIntent.
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/mpp/methods/stripe/stripe_method.rb', line 52 def self.stripe(secret_key:, network_id:, payment_methods: nil, metadata: nil, currency: Defaults::DEFAULT_CURRENCY, decimals: Defaults::DEFAULT_DECIMALS, external_id: nil, api_base: Defaults::STRIPE_API_BASE) charge_intent = ChargeIntent.new(secret_key: secret_key, api_base: api_base) method = StripeMethod.new( secret_key: secret_key, network_id: network_id, payment_methods: payment_methods, metadata: , currency: currency, decimals: decimals, external_id: external_id ) method.intents = {"charge" => charge_intent} method end |