Class: ApiBanking::InstantMoneyTransferService

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

Defined Under Namespace

Modules: AddBeneficiary, CancelTransfer, DeleteBeneficiary, GetBeneficiaries, InitiateTransfer 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.



46
47
48
# File 'lib/api_banking/soap/instantMoneyTransferService.rb', line 46

def configuration
  @configuration
end

Instance Attribute Details

#requestObject

Returns the value of attribute request.



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

def request
  @request
end

#resultObject

Returns the value of attribute result.



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

def result
  @result
end

Class Method Details

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



76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/api_banking/soap/instantMoneyTransferService.rb', line 76

def self.add_beneficiary(env, request, callbacks = nil)
  reply = do_remote_call(env, callbacks) do |xml|
    xml.addBeneficiary("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'].customerID request.customerID
      xml['ns'].beneficiaryMobileNo request.beneficiaryMobileNo
      xml['ns'].beneficiaryName request.beneficiaryName
      xml['ns'].beneficiaryAddress do  |xml|
        if request.beneficiaryAddress.kind_of? AddBeneficiary::Address
          xml.addressLine request.beneficiaryAddress.addressLine
          xml.cityName request.beneficiaryAddress.cityName unless request.beneficiaryAddress.cityName.nil?
          xml.postalCode request.beneficiaryAddress.postalCode unless request.beneficiaryAddress.postalCode.nil?
        else
          xml.addressLine request.beneficiaryAddress
        end
      end
    end
  end

  parse_reply(:addBeneficiary, reply)
end

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



133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# File 'lib/api_banking/soap/instantMoneyTransferService.rb', line 133

def self.cancel_transfer(env, request, callbacks = nil)
  reply = do_remote_call(env, callbacks) do |xml|
    xml.cancelTransfer("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'].customerID request.customerID
      xml['ns'].initiateTransferRequestNo request.initiateTransferRequestNo
      xml['ns'].reasonToCancel request.reasonToCancel
    end
  end

  parse_reply(:cancelTransfer, reply)
end

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

Yields:



49
50
51
52
# File 'lib/api_banking/soap/instantMoneyTransferService.rb', line 49

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

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



101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/api_banking/soap/instantMoneyTransferService.rb', line 101

def self.delete_beneficiary(env, request, callbacks = nil)
  reply = do_remote_call(env, callbacks) do |xml|
    xml.deleteBeneficiary("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'].customerID request.customerID
      xml['ns'].beneficiaryMobileNo request.beneficiaryMobileNo
    end
  end

  parse_reply(:deleteBeneficiary, reply)
end

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



116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# File 'lib/api_banking/soap/instantMoneyTransferService.rb', line 116

def self.get_beneficiaries(env, request, callbacks = nil)
  reply = do_remote_call(env, callbacks) do |xml|
    xml.getBeneficiaries("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.dateRange do |xml|
        xml.fromDate request.dateRange.fromDate unless request.dateRange.fromDate.nil?
        xml.toDate request.dateRange.toDate unless request.dateRange.toDate.nil?
      end
      xml['ns'].numBeneficiaries request.numBeneficiaries
    end
  end
  parse_reply(:getBeneficiaries, reply)
end

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



58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/api_banking/soap/instantMoneyTransferService.rb', line 58

def self.transfer(env, request, callbacks = nil)
  reply = do_remote_call(env, callbacks) do |xml|
    xml.initiateTransfer("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'].customerID request.customerID
      xml['ns'].beneficiaryMobileNo request.beneficiaryMobileNo
      xml['ns'].transferAmount request.transferAmount
      xml['ns'].passCode request.passCode
      xml['ns'].remitterToBeneficiaryInfo request.remitterToBeneficiaryInfo
    end
  end

  parse_reply(:initiateTransfer, reply)
end