Class: Payflow::Providers::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/payflow/providers/base.rb

Direct Known Subclasses

Asaas::Provider, Stripe::Provider

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(provider_name:) ⇒ Base

Returns a new instance of Base.



8
9
10
# File 'lib/payflow/providers/base.rb', line 8

def initialize(provider_name:)
  @provider_name = provider_name.to_sym
end

Instance Attribute Details

#provider_nameObject (readonly)

Returns the value of attribute provider_name.



6
7
8
# File 'lib/payflow/providers/base.rb', line 6

def provider_name
  @provider_name
end

Instance Method Details

#cancel_subscription(provider_subscription_id) ⇒ Object

Raises:

  • (NotImplementedError)


24
25
26
# File 'lib/payflow/providers/base.rb', line 24

def cancel_subscription(provider_subscription_id)
  raise NotImplementedError, "#{self.class}##{__method__}"
end

#create_customer(attrs) ⇒ Object

Raises:

  • (NotImplementedError)


12
13
14
# File 'lib/payflow/providers/base.rb', line 12

def create_customer(attrs)
  raise NotImplementedError, "#{self.class}##{__method__}"
end

#create_subscription(customer_id:, plan_id:, **options) ⇒ Object

Raises:

  • (NotImplementedError)


20
21
22
# File 'lib/payflow/providers/base.rb', line 20

def create_subscription(customer_id:, plan_id:, **options)
  raise NotImplementedError, "#{self.class}##{__method__}"
end

#find_customer(provider_customer_id) ⇒ Object

Raises:

  • (NotImplementedError)


16
17
18
# File 'lib/payflow/providers/base.rb', line 16

def find_customer(provider_customer_id)
  raise NotImplementedError, "#{self.class}##{__method__}"
end

#find_subscription(provider_subscription_id) ⇒ Object

Raises:

  • (NotImplementedError)


28
29
30
# File 'lib/payflow/providers/base.rb', line 28

def find_subscription(provider_subscription_id)
  raise NotImplementedError, "#{self.class}##{__method__}"
end

#list_invoices(provider_subscription_id:) ⇒ Object

Raises:

  • (NotImplementedError)


32
33
34
# File 'lib/payflow/providers/base.rb', line 32

def list_invoices(provider_subscription_id:)
  raise NotImplementedError, "#{self.class}##{__method__}"
end

#parse_webhook(payload:, headers: {}) ⇒ Object

Raises:

  • (NotImplementedError)


40
41
42
# File 'lib/payflow/providers/base.rb', line 40

def parse_webhook(payload:, headers: {})
  raise NotImplementedError, "#{self.class}##{__method__}"
end

#verify_webhook_signature(payload:, headers:) ⇒ Object

Raises:

  • (NotImplementedError)


36
37
38
# File 'lib/payflow/providers/base.rb', line 36

def verify_webhook_signature(payload:, headers:)
  raise NotImplementedError, "#{self.class}##{__method__}"
end