Class: LazerPay
- Inherits:
-
Object
- Object
- LazerPay
- Defined in:
- lib/lazerpay.rb
Instance Attribute Summary collapse
-
#crypto_deposit ⇒ Object
Returns the value of attribute crypto_deposit.
-
#crypto_swap ⇒ Object
Returns the value of attribute crypto_swap.
-
#fiat_deposit ⇒ Object
Returns the value of attribute fiat_deposit.
-
#payment ⇒ Object
Returns the value of attribute payment.
-
#payout ⇒ Object
Returns the value of attribute payout.
-
#public_key ⇒ Object
Returns the value of attribute public_key.
-
#secret_key ⇒ Object
Returns the value of attribute secret_key.
-
#transaction ⇒ Object
Returns the value of attribute transaction.
Instance Method Summary collapse
-
#initialize(public_key = nil, secret_key = nil) ⇒ LazerPay
constructor
A new instance of LazerPay.
Constructor Details
#initialize(public_key = nil, secret_key = nil) ⇒ LazerPay
Returns a new instance of LazerPay.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/lazerpay.rb', line 6 def initialize public_key = nil, secret_key = nil @secret_key = secret_key; @public_key = public_key; # Error Handling raise "Public key cannot be undefined" if @public_key.nil? raise "Secret key cannot be undefined" if @secret_key.nil? raise "Invalid format for Public key, it must start with 'pk'" unless @public_key.start_with?("pk_") raise "Invalid format for Secret key, it must start with 'sk'" unless @secret_key.start_with?("sk_") # Loads public and private key in to sub-classes LazerPayModule::Wrapper.new( @public_key, @secret_key ) @payment = LazerPayModule::Payment.new; @payout = LazerPayModule::Payout.new; @fiat_deposit = LazerPayModule::Top_up::FIAT.new; @crypto_deposit = LazerPayModule::Top_up::CRYPTO.new; @crypto_swap = LazerPayModule::Swap.new; @transaction = LazerPayModule::Transaction.new; end |
Instance Attribute Details
#crypto_deposit ⇒ Object
Returns the value of attribute crypto_deposit.
4 5 6 |
# File 'lib/lazerpay.rb', line 4 def crypto_deposit @crypto_deposit end |
#crypto_swap ⇒ Object
Returns the value of attribute crypto_swap.
4 5 6 |
# File 'lib/lazerpay.rb', line 4 def crypto_swap @crypto_swap end |
#fiat_deposit ⇒ Object
Returns the value of attribute fiat_deposit.
4 5 6 |
# File 'lib/lazerpay.rb', line 4 def fiat_deposit @fiat_deposit end |
#payment ⇒ Object
Returns the value of attribute payment.
4 5 6 |
# File 'lib/lazerpay.rb', line 4 def payment @payment end |
#payout ⇒ Object
Returns the value of attribute payout.
4 5 6 |
# File 'lib/lazerpay.rb', line 4 def payout @payout end |
#public_key ⇒ Object
Returns the value of attribute public_key.
4 5 6 |
# File 'lib/lazerpay.rb', line 4 def public_key @public_key end |
#secret_key ⇒ Object
Returns the value of attribute secret_key.
4 5 6 |
# File 'lib/lazerpay.rb', line 4 def secret_key @secret_key end |
#transaction ⇒ Object
Returns the value of attribute transaction.
4 5 6 |
# File 'lib/lazerpay.rb', line 4 def transaction @transaction end |