Class: Vpago::AcledaMobile::TransactionStatus

Inherits:
Base
  • Object
show all
Defined in:
lib/vpago/acleda_mobile/transaction_status.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#encryption_key, #initialize, #partner_id, #payment_number, #return_to_app_url

Methods included from PaymentAmountCalculator

#amount, #amount_with_fee, #transaction_fee, #transaction_fee_fix, #transaction_fee_percentage

Constructor Details

This class inherits a constructor from Vpago::AcledaMobile::Base

Instance Attribute Details

#error_messageObject

Returns the value of attribute error_message.



6
7
8
# File 'lib/vpago/acleda_mobile/transaction_status.rb', line 6

def error_message
  @error_message
end

#resultObject

Returns the value of attribute result.



6
7
8
# File 'lib/vpago/acleda_mobile/transaction_status.rb', line 6

def result
  @result
end

Instance Method Details

#call(payment_token_id = nil) ⇒ Object

#TO DO: remove payment_token_id when check transaction status api ready



9
10
11
12
# File 'lib/vpago/acleda_mobile/transaction_status.rb', line 9

def call(payment_token_id = nil)
  prepare
  process(payment_token_id)
end

#prepareObject



14
15
16
17
# File 'lib/vpago/acleda_mobile/transaction_status.rb', line 14

def prepare
  @error_message = nil
  @result = nil
end

#process(payment_token_id) ⇒ Object



19
20
21
22
23
24
25
26
27
28
# File 'lib/vpago/acleda_mobile/transaction_status.rb', line 19

def process(payment_token_id)
  @result = {
    ErrorCode: '200',
    ErrorDescription: 'Success',
    TransactionId: payment_number,
    PaymentTokenId: payment_token_id,
    Amount: '',
    Currency: 'USD'
  }
end

#success?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/vpago/acleda_mobile/transaction_status.rb', line 30

def success?
  @error_message.nil?
end