Class: Ecko::Plugins::Sponsor::Parser::Stripe
- Inherits:
-
Object
- Object
- Ecko::Plugins::Sponsor::Parser::Stripe
- Defined in:
- lib/ecko/plugins/sponsor/parser/stripe.rb
Instance Attribute Summary collapse
-
#account ⇒ Object
readonly
Returns the value of attribute account.
-
#package ⇒ Object
readonly
Returns the value of attribute package.
Class Method Summary collapse
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(package, account) ⇒ Stripe
constructor
A new instance of Stripe.
Constructor Details
#initialize(package, account) ⇒ Stripe
Returns a new instance of Stripe.
10 11 12 13 |
# File 'lib/ecko/plugins/sponsor/parser/stripe.rb', line 10 def initialize(package, account) @package = package @account = account end |
Instance Attribute Details
#account ⇒ Object (readonly)
Returns the value of attribute account.
8 9 10 |
# File 'lib/ecko/plugins/sponsor/parser/stripe.rb', line 8 def account @account end |
#package ⇒ Object (readonly)
Returns the value of attribute package.
8 9 10 |
# File 'lib/ecko/plugins/sponsor/parser/stripe.rb', line 8 def package @package end |
Class Method Details
.build(package, account) ⇒ Object
35 36 37 |
# File 'lib/ecko/plugins/sponsor/parser/stripe.rb', line 35 def build(package, account) new(package, account).build end |
Instance Method Details
#build ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/ecko/plugins/sponsor/parser/stripe.rb', line 15 def build { submit_type: 'donate', success_message: 'Thanks for being part of our community, Your donation was well received', # Need to add translation options, callback: 'Ecko::Plugins::Sponsor::Donated', package_id: package.id, payable_type: account.class.name, payable_id: account.id, line_items: [ { quantity: 1, amount: package.amount, name: "#{package.title} Donation", description: 'Donation for the instance', } ] } end |