Class: BuckarooClient::Service::PayPerEmail

Inherits:
Object
  • Object
show all
Defined in:
lib/buckaroo_client/service/pay_per_email.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ PayPerEmail

Returns a new instance of PayPerEmail.



8
9
10
11
12
13
14
15
16
# File 'lib/buckaroo_client/service/pay_per_email.rb', line 8

def initialize(args = {})
  @customergender = args.fetch(:customergender, 0)
  @customeremail = args[:customeremail]
  @customerfirstname = args[:customerfirstname]
  @customerlastname = args[:customerlastname]
  @merchantsendsemail = args.fetch(:merchantsendsemail, false)
  @paymentmethodsallowed = args[:paymentmethodsallowed]
  @expirationdate = args[:expirationdate]
end

Instance Attribute Details

#customeremailObject

Returns the value of attribute customeremail.



5
6
7
# File 'lib/buckaroo_client/service/pay_per_email.rb', line 5

def customeremail
  @customeremail
end

#customerfirstnameObject

Returns the value of attribute customerfirstname.



5
6
7
# File 'lib/buckaroo_client/service/pay_per_email.rb', line 5

def customerfirstname
  @customerfirstname
end

#customergenderObject

Returns the value of attribute customergender.



5
6
7
# File 'lib/buckaroo_client/service/pay_per_email.rb', line 5

def customergender
  @customergender
end

#customerlastnameObject

Returns the value of attribute customerlastname.



5
6
7
# File 'lib/buckaroo_client/service/pay_per_email.rb', line 5

def customerlastname
  @customerlastname
end

#expirationdateObject

Returns the value of attribute expirationdate.



5
6
7
# File 'lib/buckaroo_client/service/pay_per_email.rb', line 5

def expirationdate
  @expirationdate
end

#merchantsendsemailObject

Returns the value of attribute merchantsendsemail.



5
6
7
# File 'lib/buckaroo_client/service/pay_per_email.rb', line 5

def merchantsendsemail
  @merchantsendsemail
end

#paymentmethodsallowedObject

Returns the value of attribute paymentmethodsallowed.



5
6
7
# File 'lib/buckaroo_client/service/pay_per_email.rb', line 5

def paymentmethodsallowed
  @paymentmethodsallowed
end

Instance Method Details

#actionObject



22
23
24
# File 'lib/buckaroo_client/service/pay_per_email.rb', line 22

def action
  'paymentinvitation'
end

#gateway_attributesObject



26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/buckaroo_client/service/pay_per_email.rb', line 26

def gateway_attributes
  {
    'service_payperemail_action' => action,
    'service_payperemail_customergender' => customergender.to_s,
    'service_payperemail_customeremail' => customeremail,
    'service_payperemail_customerfirstname' => customerfirstname,
    'service_payperemail_customerlastname' => customerlastname,
    'service_payperemail_merchantsendsemail' => merchantsendsemail.to_s.upcase,
    'service_payperemail_paymentmethodsallowed' => paymentmethodsallowed,
    'service_payperemail_expirationdate' => expirationdate,
  }.select { |_, value| !value.nil? }
end

#servicecodeObject



18
19
20
# File 'lib/buckaroo_client/service/pay_per_email.rb', line 18

def servicecode
  'payperemail'
end