Class: LazerPay

Inherits:
Object
  • Object
show all
Defined in:
lib/lazerpay.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_depositObject

Returns the value of attribute crypto_deposit.



4
5
6
# File 'lib/lazerpay.rb', line 4

def crypto_deposit
  @crypto_deposit
end

#crypto_swapObject

Returns the value of attribute crypto_swap.



4
5
6
# File 'lib/lazerpay.rb', line 4

def crypto_swap
  @crypto_swap
end

#fiat_depositObject

Returns the value of attribute fiat_deposit.



4
5
6
# File 'lib/lazerpay.rb', line 4

def fiat_deposit
  @fiat_deposit
end

#paymentObject

Returns the value of attribute payment.



4
5
6
# File 'lib/lazerpay.rb', line 4

def payment
  @payment
end

#payoutObject

Returns the value of attribute payout.



4
5
6
# File 'lib/lazerpay.rb', line 4

def payout
  @payout
end

#public_keyObject

Returns the value of attribute public_key.



4
5
6
# File 'lib/lazerpay.rb', line 4

def public_key
  @public_key
end

#secret_keyObject

Returns the value of attribute secret_key.



4
5
6
# File 'lib/lazerpay.rb', line 4

def secret_key
  @secret_key
end

#transactionObject

Returns the value of attribute transaction.



4
5
6
# File 'lib/lazerpay.rb', line 4

def transaction
  @transaction
end