Class: ApiBanking::FundsTransferByCustomerService2

Inherits:
Soap12Client show all
Defined in:
lib/api_banking/soap/fundsTransferByCustomerService2.rb

Defined Under Namespace

Modules: GetBalance, GetStatus, Transfer

Constant Summary collapse

SERVICE_NAMESPACE =
'http://www.quantiguous.com/services'
SERVICE_VERSION =
1

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from SoapClient

do_remote_call, last_response

Instance Attribute Details

#requestObject

Returns the value of attribute request.



7
8
9
# File 'lib/api_banking/soap/fundsTransferByCustomerService2.rb', line 7

def request
  @request
end

#resultObject

Returns the value of attribute result.



7
8
9
# File 'lib/api_banking/soap/fundsTransferByCustomerService2.rb', line 7

def result
  @result
end

Class Method Details

.get_balance(env, request, callbacks = nil) ⇒ Object



93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/api_banking/soap/fundsTransferByCustomerService2.rb', line 93

def self.get_balance(env, request, callbacks = nil)
  reply = do_remote_call(env, callbacks) do |xml|
    xml.getBalance("xmlns:ns" => SERVICE_NAMESPACE ) do
      xml.parent.namespace = xml.parent.namespace_definitions.first
      xml['ns'].version SERVICE_VERSION
      xml['ns'].appID request.appID
      xml['ns'].customerID request.customerID
      xml['ns'].AccountNumber request.AccountNumber
    end
  end
  parse_reply(:getBalance, reply)
end

.get_status(env, request, callbacks = nil) ⇒ Object



80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/api_banking/soap/fundsTransferByCustomerService2.rb', line 80

def self.get_status(env, request, callbacks = nil)
  reply = do_remote_call(env, callbacks) do |xml|
    xml.getStatus("xmlns:ns" => SERVICE_NAMESPACE ) do
      xml.parent.namespace = xml.parent.namespace_definitions.first
      xml['ns'].version SERVICE_VERSION
      xml['ns'].appID request.appID
      xml['ns'].customerID request.customerID
      xml['ns'].requestReferenceNo request.requestReferenceNo
    end
  end
  parse_reply(:getStatus, reply)
end

.transfer(env, request, callbacks = nil) ⇒ Object



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/api_banking/soap/fundsTransferByCustomerService2.rb', line 32

def self.transfer(env, request, callbacks = nil)
  reply = do_remote_call(env, callbacks) do |xml|
    xml.transfer("xmlns:ns" => SERVICE_NAMESPACE ) do
      xml.parent.namespace = xml.parent.namespace_definitions.first
      xml['ns'].version SERVICE_VERSION
      xml['ns'].uniqueRequestNo request.uniqueRequestNo
      xml['ns'].appID request.appID
      xml['ns'].purposeCode request.purposeCode unless request.purposeCode.nil?
      xml['ns'].customerID request.customerID
      xml['ns'].debitAccountNo request.debitAccountNo
      xml['ns'].beneficiary do  |xml|
        xml.beneficiaryCode request.beneficiary.beneCode unless request.beneficiary.beneCode.nil?
        unless request.beneficiary.fullName.nil?
          xml.beneficiaryDetail do |xml|
            xml.beneficiaryName do |xml|
              xml.fullName request.beneficiary.fullName
            end
            xml.beneficiaryAddress do |xml|
              if request.beneficiary.address.kind_of? Transfer::Address
                xml.address1 request.beneficiary.address.address1
                xml.address2 request.beneficiary.address.address2 unless request.beneficiary.address.address2.nil?
                xml.address3 request.beneficiary.address.address3 unless request.beneficiary.address.address3.nil?
                xml.postalCode request.beneficiary.address.postalCode unless request.beneficiary.address.postalCode.nil?
                xml.city request.beneficiary.address.city unless request.beneficiary.address.city.nil?
                xml.stateOrProvince request.beneficiary.address.stateOrProvince unless request.beneficiary.address.stateOrProvince.nil?
                xml.country request.beneficiary.address.country unless request.beneficiary.address.country.nil?
              else
                xml.address1 request.beneficiary.address
              end
            end
            xml.beneficiaryContact do |xml|
            end
            xml.beneficiaryAccountNo request.beneficiary.accountNo
            xml.beneficiaryIFSC request.beneficiary.accountIFSC
          end
        end
      end
      xml.transferType request.transferType
      xml.transferCurrencyCode 'INR'
      xml.transferAmount request.transferAmount
      xml.remitterToBeneficiaryInfo request.remitterToBeneficiaryInfo
    end
  end

  parse_reply(:transfer, reply)
end