Class: DkPaymentGateway::TransactionStatus

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ TransactionStatus

Returns a new instance of TransactionStatus.



7
8
9
# File 'lib/dk_payment_gateway/transaction_status.rb', line 7

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



5
6
7
# File 'lib/dk_payment_gateway/transaction_status.rb', line 5

def client
  @client
end

Instance Method Details

#check_current_day(params) ⇒ Hash Also known as: check_status

Payment Status Verification - For current date Checks the status of a payment transaction for the current day

Parameters:

  • params (Hash)

    Status check parameters

Options Hash (params):

  • :request_id (String)

    Unique identifier for the request

  • :transaction_id (String)

    Transaction ID returned during payment

  • :bene_account_number (String)

    Beneficiary account number

Returns:

  • (Hash)

    Response containing transaction status details



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/dk_payment_gateway/transaction_status.rb', line 20

def check_current_day(params)
  validate_current_day_params!(params)

  request_body = build_current_day_body(params)
  signature_headers = generate_signature_headers(request_body)

  response = client.post(
    '/v1/transaction/status',
    body: request_body,
    headers: signature_headers
  )

  validate_response!(response, 'Transaction Status Check')
  response['response_data']
end

#check_previous_days(params) ⇒ Hash Also known as: check_historical_status

Payment Status Verification - Subsequent Business Days Checks the status of a payment transaction for previous business days

Parameters:

  • params (Hash)

    Status check parameters

Options Hash (params):

  • :request_id (String)

    Unique identifier for the request

  • :transaction_id (String)

    Transaction ID returned during payment

  • :transaction_date (String)

    Date when transaction was initiated (YYYY-MM-DD)

  • :bene_account_number (String)

    Beneficiary account number

Returns:

  • (Hash)

    Response containing transaction status details



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/dk_payment_gateway/transaction_status.rb', line 46

def check_previous_days(params)
  validate_previous_days_params!(params)

  request_body = build_previous_days_body(params)
  signature_headers = generate_signature_headers(request_body)

  response = client.post(
    '/v1/transactions/status',
    body: request_body,
    headers: signature_headers
  )

  validate_response!(response, 'Transaction Status Check')
  response['response_data']
end