Module: OffsitePayments::Integrations::MollieIdeal

Includes:
Mollie
Defined in:
lib/offsite_payments/integrations/mollie_ideal.rb

Defined Under Namespace

Classes: Helper, Notification, Return

Constant Summary collapse

RedirectError =
Class.new(ActiveUtils::ActiveUtilsError)
MOLLIE_API_V1_URI =
'https://api.mollie.nl/v1/'.freeze

Class Method Summary collapse

Class Method Details

.check_payment_status(token, payment_id) ⇒ Object



56
57
58
# File 'lib/offsite_payments/integrations/mollie_ideal.rb', line 56

def self.check_payment_status(token, payment_id)
  API.new(token).get_request("payments/#{payment_id}")
end

.create_payment(token, params) ⇒ Object



52
53
54
# File 'lib/offsite_payments/integrations/mollie_ideal.rb', line 52

def self.create_payment(token, params)
  API.new(token).post_request('payments', params)
end

.live?Boolean

Returns:

  • (Boolean)


48
49
50
# File 'lib/offsite_payments/integrations/mollie_ideal.rb', line 48

def self.live?
  OffsitePayments.mode == :production
end

.notification(post, options = {}) ⇒ Object



40
41
42
# File 'lib/offsite_payments/integrations/mollie_ideal.rb', line 40

def self.notification(post, options = {})
  Notification.new(post, options)
end

.redirect_param_labelObject



21
22
23
# File 'lib/offsite_payments/integrations/mollie_ideal.rb', line 21

def self.redirect_param_label
  "Select your bank"
end

.redirect_param_options(options = {}) ⇒ Object



25
26
27
# File 'lib/offsite_payments/integrations/mollie_ideal.rb', line 25

def self.redirect_param_options(options = {})
  live_issuers
end

.requires_redirect_param?Boolean

Returns:

  • (Boolean)


60
61
62
# File 'lib/offsite_payments/integrations/mollie_ideal.rb', line 60

def self.requires_redirect_param?
  true
end

.retrieve_issuers(token) ⇒ Object



29
30
31
32
33
34
# File 'lib/offsite_payments/integrations/mollie_ideal.rb', line 29

def self.retrieve_issuers(token)
  response = API.new(token).get_request("issuers")
  response['data']
    .select { |issuer| issuer['method'] == 'ideal' }
    .map { |issuer| [issuer['name'], issuer['id']] }
end

.return(post, options = {}) ⇒ Object



44
45
46
# File 'lib/offsite_payments/integrations/mollie_ideal.rb', line 44

def self.return(post, options = {})
  Return.new(post, options)
end