Sha256: 64b0b529c19a1096b1dbd5e7fa7a00daed43c02ef4814c0dfe582729ba9214bd

Contents?: true

Size: 1.11 KB

Versions: 6

Compression:

Stored size: 1.11 KB

Contents

module StarkitBanking
  module YBL
    module Payment
      class GetStatus
        include ApiClient
      
        private 
        
        def service_name
          'STATUS ENQUIRY'
        end
      
        def invoke(env, req)
          ApiBanking::FundsTransferByCustomerService2.get_status(env, req)          
        end
        
        def response(res)
          Transfer::Status.new(res.transactionStatus.statusCode, res.transactionStatus.bankReferenceNo, res.transferType)
        end
      
        def credentials(payment)
          payment.payment_account.credentials
        end
      
        def request(subscription, payment)
        
          request = ApiBanking::FundsTransferByCustomerService2::GetStatus::Request.new()

          request.appID = subscription.app_id
          request.customerID = payment.payment_account.customer_id
          request.requestReferenceNo = payment.id
        
          request       
        end
      
        def subscription(payment)
          payment.payment_account.service_subscriptions.find_by(service_name: service_name)
        end
  
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
starkit_banking-0.1.9 lib/starkit_banking/api/ybl/payment/get_status.rb
starkit_banking-0.1.8 lib/starkit_banking/api/ybl/payment/get_status.rb
starkit_banking-0.1.7 lib/starkit_banking/api/ybl/payment/get_status.rb
starkit_banking-0.1.6 lib/starkit_banking/api/ybl/payment/get_status.rb
starkit_banking-0.1.5 lib/starkit_banking/api/ybl/payment/get_status.rb
starkit_banking-0.1.4 lib/starkit_banking/api/ybl/payment/get_status.rb