Class: ApiBanking::FundsTransferByCustomerService

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

Defined Under Namespace

Modules: GetStatus, Transfer Classes: Configuration

Constant Summary collapse

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

Class Attribute Summary collapse

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from SoapClient

do_remote_call, last_response

Class Attribute Details

.configurationObject

Returns the value of attribute configuration.



26
27
28
# File 'lib/api_banking/soap/fundsTransferByCustomerService.rb', line 26

def configuration
  @configuration
end

Instance Attribute Details

#requestObject

Returns the value of attribute request.



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

def request
  @request
end

#resultObject

Returns the value of attribute result.



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

def result
  @result
end

Class Method Details

.configure {|configuration| ... } ⇒ Object

Yields:



29
30
31
32
# File 'lib/api_banking/soap/fundsTransferByCustomerService.rb', line 29

def self.configure
  self.configuration ||= Configuration.new
  yield(configuration)
end

.get_status(env, request) ⇒ Object



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

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

.transfer(env, request) ⇒ Object



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
78
# File 'lib/api_banking/soap/fundsTransferByCustomerService.rb', line 38

def self.transfer(env, request)
  reply = do_remote_call(env) 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'].customerID request.customerID
      xml['ns'].debitAccountNo request.debitAccountNo
      xml['ns'].beneficiary do  |xml|
        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
      xml.transferType request.transferType
      xml.transferCurrencyCode 'INR'
      xml.transferAmount request.transferAmount
      xml.remitterToBeneficiaryInfo request.remitterToBeneficiaryInfo
    end
  end
  
  parse_reply(:transferResponse, reply)
end