Class: EwayRapid::DirectPaymentRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/eway_rapid/entities/direct_payment_request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#customerObject

Returns the value of attribute customer.



3
4
5
# File 'lib/eway_rapid/entities/direct_payment_request.rb', line 3

def customer
  @customer
end

#customer_ipObject

Returns the value of attribute customer_ip.



10
11
12
# File 'lib/eway_rapid/entities/direct_payment_request.rb', line 10

def customer_ip
  @customer_ip
end

#device_idObject

Returns the value of attribute device_id.



11
12
13
# File 'lib/eway_rapid/entities/direct_payment_request.rb', line 11

def device_id
  @device_id
end

#itemsObject

Returns the value of attribute items.



5
6
7
# File 'lib/eway_rapid/entities/direct_payment_request.rb', line 5

def items
  @items
end

#methodObject

Returns the value of attribute method.



8
9
10
# File 'lib/eway_rapid/entities/direct_payment_request.rb', line 8

def method
  @method
end

#optionsObject

Returns the value of attribute options.



6
7
8
# File 'lib/eway_rapid/entities/direct_payment_request.rb', line 6

def options
  @options
end

#partner_idObject

Returns the value of attribute partner_id.



12
13
14
# File 'lib/eway_rapid/entities/direct_payment_request.rb', line 12

def partner_id
  @partner_id
end

#paymentObject

Returns the value of attribute payment.



7
8
9
# File 'lib/eway_rapid/entities/direct_payment_request.rb', line 7

def payment
  @payment
end

#redirect_urlObject

Returns the value of attribute redirect_url.



13
14
15
# File 'lib/eway_rapid/entities/direct_payment_request.rb', line 13

def redirect_url
  @redirect_url
end

#shipping_addressObject

Returns the value of attribute shipping_address.



4
5
6
# File 'lib/eway_rapid/entities/direct_payment_request.rb', line 4

def shipping_address
  @shipping_address
end

#transaction_typeObject

Returns the value of attribute transaction_type.



9
10
11
# File 'lib/eway_rapid/entities/direct_payment_request.rb', line 9

def transaction_type
  @transaction_type
end

Instance Method Details

#to_json(opts = {}) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/eway_rapid/entities/direct_payment_request.rb', line 15

def to_json(opts={})
  {Constants::CUSTOMER           => InternalModels::Customer.to_hash(customer),
   Constants::SHIPPING_ADDRESS   => InternalModels::ShippingAddress.to_hash(shipping_address),
   Constants::ITEMS              => Models::LineItem.to_array(items),
   Constants::OPTIONS            => InternalModels::Option.to_array(options),
   Constants::PAYMENT            => InternalModels::Payment.to_hash(payment),
   Constants::METHOD             => method,
   Constants::TRANSACTION_TYPE   => transaction_type,
   Constants::CUSTOMER_DEVICE_IP => customer_ip,
   Constants::DEVICE_ID          => device_id,
   Constants::PARTNER_ID         => partner_id,
   Constants::REDIRECT_URL       => redirect_url}.to_json
end