Module: OffsitePayments::Integrations::MollieIdeal

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

Defined Under Namespace

Classes: API, Helper, Notification, Return

Constant Summary collapse

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

Class Method Summary collapse

Class Method Details

.check_payment_status(token, payment_id) ⇒ Object


87
88
89
# File 'lib/offsite_payments/integrations/mollie_ideal.rb', line 87

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

.create_payment(token, params) ⇒ Object


83
84
85
# File 'lib/offsite_payments/integrations/mollie_ideal.rb', line 83

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

.live?Boolean


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

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

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


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

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

.redirect_param_labelObject


67
68
69
# File 'lib/offsite_payments/integrations/mollie_ideal.rb', line 67

def self.redirect_param_label
  "Select your bank"
end

.redirect_param_options(options = {}) ⇒ Object


71
72
73
74
# File 'lib/offsite_payments/integrations/mollie_ideal.rb', line 71

def self.redirect_param_options(options = {})
  return test_issuers if options[:credential1].blank?
  options[:credential1].start_with?('live_') ? live_issuers : test_issuers
end

.requires_redirect_param?Boolean


63
64
65
# File 'lib/offsite_payments/integrations/mollie_ideal.rb', line 63

def self.requires_redirect_param?
  true
end

.retrieve_issuers(token) ⇒ Object


76
77
78
79
80
81
# File 'lib/offsite_payments/integrations/mollie_ideal.rb', line 76

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


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

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