Class: Ecko::Plugins::Sponsor::Parser::Stripe

Inherits:
Object
  • Object
show all
Defined in:
lib/ecko/plugins/sponsor/parser/stripe.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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, )
  @package = package
  @account = 
end

Instance Attribute Details

#accountObject (readonly)

Returns the value of attribute account.



8
9
10
# File 'lib/ecko/plugins/sponsor/parser/stripe.rb', line 8

def 
  @account
end

#packageObject (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, )
  new(package, ).build
end

Instance Method Details

#buildObject



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: .class.name,
    payable_id: .id,
    line_items: [
      {
        quantity: 1,
        amount: package.amount,
        name: "#{package.title} Donation",
        description: 'Donation for the instance',
      }
    ]
  }
end