Class: DragonPay::Client
- Inherits:
-
Object
- Object
- DragonPay::Client
- Defined in:
- lib/dragon_pay/client.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
writeonly
attributes that are required.
-
#currency ⇒ Object
attributes that can be given default value.
-
#customer_email_address ⇒ Object
attributes that are required.
-
#digest ⇒ Object
writeonly
attributes that can be given default value.
-
#merchant_id ⇒ Object
attributes that can be given default value.
-
#param1 ⇒ Object
attributes that can be given default value.
-
#param2 ⇒ Object
attributes that can be given default value.
-
#payment_description ⇒ Object
attributes that can be generated from other attributes.
-
#secret_key ⇒ Object
attributes that can be given default value.
-
#transaction_id ⇒ Object
attributes that are required.
Instance Method Summary collapse
- #generate_request_url ⇒ Object
-
#initialize(options) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(options) ⇒ Client
Returns a new instance of Client.
14 15 16 17 18 19 |
# File 'lib/dragon_pay/client.rb', line 14 def initialize() self.transaction_id = [:transaction_id] self.amount = [:amount] self.customer_email_address = [:customer_email_address] fill_in_defaults() end |
Instance Attribute Details
#amount=(value) ⇒ Object
attributes that are required
12 13 14 |
# File 'lib/dragon_pay/client.rb', line 12 def amount=(value) @amount = value end |
#currency ⇒ Object
attributes that can be given default value
6 7 8 |
# File 'lib/dragon_pay/client.rb', line 6 def currency @currency end |
#customer_email_address ⇒ Object
attributes that are required
12 13 14 |
# File 'lib/dragon_pay/client.rb', line 12 def customer_email_address @customer_email_address end |
#digest=(value) ⇒ Object
attributes that can be given default value
6 7 8 |
# File 'lib/dragon_pay/client.rb', line 6 def digest=(value) @digest = value end |
#merchant_id ⇒ Object
attributes that can be given default value
6 7 8 |
# File 'lib/dragon_pay/client.rb', line 6 def merchant_id @merchant_id end |
#param1 ⇒ Object
attributes that can be given default value
6 7 8 |
# File 'lib/dragon_pay/client.rb', line 6 def param1 @param1 end |
#param2 ⇒ Object
attributes that can be given default value
6 7 8 |
# File 'lib/dragon_pay/client.rb', line 6 def param2 @param2 end |
#payment_description ⇒ Object
attributes that can be generated from other attributes
9 10 11 |
# File 'lib/dragon_pay/client.rb', line 9 def payment_description @payment_description end |
#secret_key ⇒ Object
attributes that can be given default value
6 7 8 |
# File 'lib/dragon_pay/client.rb', line 6 def secret_key @secret_key end |
#transaction_id ⇒ Object
attributes that are required
12 13 14 |
# File 'lib/dragon_pay/client.rb', line 12 def transaction_id @transaction_id end |
Instance Method Details
#generate_request_url ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/dragon_pay/client.rb', line 21 def generate_request_url %Q{ #{payment_switch_url}? merchantid = #{merchant_id}& txnid = #{transaction_id}& amount = #{amount}& ccy = #{currency}& description = #{uri_encode(payment_description)}& email = #{uri_encode(customer_email_address)}& digest = #{digest}& param1 = #{param1}& param2 = #{param2} }.split.join end |