api_banking 0.1.15 → 0.1.16

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 525abb46b6d0244aeeb3e440edcf096828a2bef8
4
- data.tar.gz: 2efbdf3c8c1f6f2e12c548ad26211280f2b6abc4
3
+ metadata.gz: c83e47e6463b29c28934902a6b8bcd61178aa63a
4
+ data.tar.gz: f79b7a0f823d76521670e2034b5f6b5bf34bcfc4
5
5
  SHA512:
6
- metadata.gz: 5848740742c3e82995ae7871c58616c7bdd7206205cd749de3460c80e377fe7b69d279cf871d9fe87453a78ca28e5a2935baec2673567fb06328f83a2130a405
7
- data.tar.gz: 403aa875aa4fb02760c3dec1a8374af85944ca06262858250dccb492447cada4a854b7edd8f4e36f05e3b03dc7f1988f05585ce001c6a3e0297c53fbe2336a70
6
+ metadata.gz: a45123d1ed2c5a65771ae5210becca4faa0b37245afb58f2058d2606fc7c71295aeed8a0247b63d177cf98147e30f4579cf0e38f09057e3c19f27403df606e4a
7
+ data.tar.gz: c3201582e3e549ea80b371c835583a76bbd6c35a728023881e15b6bf197a077da0c9bdbfdfed4338474ebe26eb15056f93e798f9fd6f3c18994e11f655e1d7f0
@@ -7,13 +7,13 @@ module ApiBanking
7
7
  self.endpoints = {
8
8
  FundsTransferByCustomerService: 'https://uatsky.yesbank.in/app/uat/fundsTransferByCustomerServiceHttpService',
9
9
  FundsTransferByCustomerService2: 'https://uatsky.yesbank.in/app/uat/ssl/fundsTransferByCustomerSevice2',
10
- InstantMoneyTransferService: 'https://uatsky.yesbank.in:7081/IMTService',
10
+ InstantMoneyTransferService: 'https://uatsky.yesbank.in/app/uat/IMTService',
11
11
  InstantCreditService: 'https://uatsky.yesbank.in/app/uat/ssl/InstantCreditService',
12
- PrepaidCardManagementService: 'https://uatsky.yesbank.in:7081/PrepaidCardManagementService',
13
- PrepaidCardService: 'https://uatsky.yesbank.in:7081/PrepaidCardService',
12
+ PrepaidCardManagementService: 'https://uatsky.yesbank.in/app/uat/PrepaidCardManagementService',
13
+ PrepaidCardService: 'https://uatsky.yesbank.in/app/uat/PrepaidCardService',
14
14
  SocialBankingService: 'https://uatsky.yesbank.in/app/uat/SocialBankingServiceHttpService',
15
15
  VirtualCardManagementService: 'https://uatsky.yesbank.in/app/uat/VirtualCardManagementService',
16
- InwardRemittanceByPartnerService: 'https://uatsky.yesbank.in:7081/InwardRemittanceByPartnerService',
16
+ InwardRemittanceByPartnerService: 'https://uatsky.yesbank.in/app/uat/InwardRemittanceByPartnerService',
17
17
  AadhaarVerificationService: 'https://uatsky.yesbank.in/app/uat/ssl/eKYC'
18
18
  }
19
19
  end
@@ -37,8 +37,8 @@ module ApiBanking
37
37
  attr_accessor :environment, :proxy, :timeout
38
38
  end
39
39
 
40
- def self.getDemoAuthData(request)
41
- reply = do_remote_call("http://xmlns.yesbank.com/WS/EKYCService/GetDemoAuthData") do |xml|
40
+ def self.getDemoAuthData(env, request)
41
+ reply = do_remote_call(env, "http://xmlns.yesbank.com/WS/EKYCService/GetDemoAuthData") do |xml|
42
42
  xml.GetDemoAuthDataReq("xmlns:eky" => SERVICE_NAMESPACE ) do
43
43
  xml.parent.namespace = xml.parent.namespace_definitions.first
44
44
  xml['eky'].ReqHdr do |header|
@@ -61,8 +61,8 @@ module ApiBanking
61
61
  attr_accessor :environment, :proxy, :timeout
62
62
  end
63
63
 
64
- def self.remit(request)
65
- reply = do_remote_call do |xml|
64
+ def self.remit(env, request)
65
+ reply = do_remote_call(env) do |xml|
66
66
  xml.remit("xmlns:ns" => SERVICE_NAMESPACE ) do
67
67
  xml.parent.namespace = xml.parent.namespace_definitions.first
68
68
  xml['ns'].version SERVICE_VERSION
@@ -119,8 +119,8 @@ module ApiBanking
119
119
  parse_reply(:remit, reply)
120
120
  end
121
121
 
122
- def self.get_status(request)
123
- reply = do_remote_call do |xml|
122
+ def self.get_status(env, request)
123
+ reply = do_remote_call(env) do |xml|
124
124
  xml.getRemittanceStatus("xmlns:ns" => SERVICE_NAMESPACE ) do
125
125
  xml.parent.namespace = xml.parent.namespace_definitions.first
126
126
  xml['ns'].version SERVICE_VERSION
@@ -131,8 +131,8 @@ module ApiBanking
131
131
  parse_reply(:getRemittanceStatus, reply)
132
132
  end
133
133
 
134
- def self.get_balance(request)
135
- reply = do_remote_call do |xml|
134
+ def self.get_balance(env, request)
135
+ reply = do_remote_call(env) do |xml|
136
136
  xml.getBalance("xmlns:ns" => SERVICE_NAMESPACE ) do
137
137
  xml.parent.namespace = xml.parent.namespace_definitions.first
138
138
  xml['ns'].version SERVICE_VERSION
@@ -144,8 +144,8 @@ module ApiBanking
144
144
  parse_reply(:getBalance, reply)
145
145
  end
146
146
 
147
- def self.get_transactions(request)
148
- reply = do_remote_call do |xml|
147
+ def self.get_transactions(env, request)
148
+ reply = do_remote_call(env) do |xml|
149
149
  xml.getTransactions("xmlns:ns" => SERVICE_NAMESPACE ) do
150
150
  xml.parent.namespace = xml.parent.namespace_definitions.first
151
151
  xml['ns'].version SERVICE_VERSION
@@ -35,8 +35,8 @@ module ApiBanking
35
35
  attr_accessor :environment, :proxy, :timeout
36
36
  end
37
37
 
38
- def self.transfer(request)
39
- reply = do_remote_call do |xml|
38
+ def self.transfer(env, request)
39
+ reply = do_remote_call(env) do |xml|
40
40
  xml.transfer("xmlns:ns" => SERVICE_NAMESPACE ) do
41
41
  xml.parent.namespace = xml.parent.namespace_definitions.first
42
42
  xml['ns'].version SERVICE_VERSION
@@ -77,8 +77,8 @@ module ApiBanking
77
77
  parse_reply(:transferResponse, reply)
78
78
  end
79
79
 
80
- def self.get_status(request)
81
- reply = do_remote_call do |xml|
80
+ def self.get_status(env, request)
81
+ reply = do_remote_call(env) do |xml|
82
82
  xml.getStatus("xmlns:ns" => SERVICE_NAMESPACE ) do
83
83
  xml.parent.namespace = xml.parent.namespace_definitions.first
84
84
  xml['ns'].version SERVICE_VERSION
@@ -28,22 +28,9 @@ module ApiBanking
28
28
  Request = Struct.new(:version, :appID, :customerID, :AccountNumber)
29
29
  Result = Struct.new(:Version, :accountCurrencyCode, :accountBalanceAmount, :lowBalanceAlert)
30
30
  end
31
-
32
- class << self
33
- attr_accessor :configuration
34
- end
35
-
36
- def self.configure
37
- self.configuration ||= Configuration.new
38
- yield(configuration)
39
- end
40
-
41
- class Configuration
42
- attr_accessor :environment, :proxy, :timeout
43
- end
44
31
 
45
- def self.transfer(request)
46
- reply = do_remote_call do |xml|
32
+ def self.transfer(env, request)
33
+ reply = do_remote_call(env) do |xml|
47
34
  xml.transfer("xmlns:ns" => SERVICE_NAMESPACE ) do
48
35
  xml.parent.namespace = xml.parent.namespace_definitions.first
49
36
  xml['ns'].version SERVICE_VERSION
@@ -90,8 +77,8 @@ module ApiBanking
90
77
  end
91
78
 
92
79
 
93
- def self.get_status(request)
94
- reply = do_remote_call do |xml|
80
+ def self.get_status(env, request)
81
+ reply = do_remote_call(env) do |xml|
95
82
  xml.getStatus("xmlns:ns" => SERVICE_NAMESPACE ) do
96
83
  xml.parent.namespace = xml.parent.namespace_definitions.first
97
84
  xml['ns'].version SERVICE_VERSION
@@ -103,8 +90,8 @@ module ApiBanking
103
90
  parse_reply(:getStatus, reply)
104
91
  end
105
92
 
106
- def self.get_balance(request)
107
- reply = do_remote_call do |xml|
93
+ def self.get_balance(env, request)
94
+ reply = do_remote_call(env) do |xml|
108
95
  xml.getBalance("xmlns:ns" => SERVICE_NAMESPACE ) do
109
96
  xml.parent.namespace = xml.parent.namespace_definitions.first
110
97
  xml['ns'].version SERVICE_VERSION
@@ -33,8 +33,8 @@ module ApiBanking
33
33
  attr_accessor :environment, :proxy, :timeout
34
34
  end
35
35
 
36
- def self.pay_now(request)
37
- reply = do_remote_call do |xml|
36
+ def self.pay_now(env, request)
37
+ reply = do_remote_call(env) do |xml|
38
38
  xml.payNow("xmlns:ns" => SERVICE_NAMESPACE ) do
39
39
  xml.parent.namespace = xml.parent.namespace_definitions.first
40
40
  xml['ns'].version SERVICE_VERSION
@@ -56,8 +56,8 @@ module ApiBanking
56
56
  end
57
57
 
58
58
 
59
- def self.get_status(request)
60
- reply = do_remote_call do |xml|
59
+ def self.get_status(env, request)
60
+ reply = do_remote_call(env) do |xml|
61
61
  xml.getStatus("xmlns:ns" => SERVICE_NAMESPACE ) do
62
62
  xml.parent.namespace = xml.parent.namespace_definitions.first
63
63
  xml['ns'].version SERVICE_VERSION
@@ -29,8 +29,8 @@ module ApiBanking
29
29
  Request = Struct.new(:uniqueRequestNo, :appID, :customerID, :dateRange, :numBeneficiaries)
30
30
 
31
31
  DateRange = Struct.new(:fromDate, :toDate)
32
- BeneficiariesArray = Struct.new(:beneficiary)
33
32
  Beneficiary = Struct.new(:beneficiaryName, :beneficiaryMobileNo, :registrationDate, :addressLine, :postalCode)
33
+ BeneficiariesArray = Struct.new(:beneficiary)
34
34
 
35
35
  Result = Struct.new(:numBeneficiaries, :beneficiariesArray)
36
36
  end
@@ -55,8 +55,8 @@ module ApiBanking
55
55
  attr_accessor :environment, :proxy, :timeout
56
56
  end
57
57
 
58
- def self.transfer(request)
59
- reply = do_remote_call do |xml|
58
+ def self.transfer(env, request)
59
+ reply = do_remote_call(env) do |xml|
60
60
  xml.initiateTransfer("xmlns:ns" => SERVICE_NAMESPACE ) do
61
61
  xml.parent.namespace = xml.parent.namespace_definitions.first
62
62
  xml['ns'].version SERVICE_VERSION
@@ -73,8 +73,8 @@ module ApiBanking
73
73
  parse_reply(:initiateTransfer, reply)
74
74
  end
75
75
 
76
- def self.add_beneficiary(request)
77
- reply = do_remote_call do |xml|
76
+ def self.add_beneficiary(env, request)
77
+ reply = do_remote_call(env) do |xml|
78
78
  xml.addBeneficiary("xmlns:ns" => SERVICE_NAMESPACE ) do
79
79
  xml.parent.namespace = xml.parent.namespace_definitions.first
80
80
  xml['ns'].version SERVICE_VERSION
@@ -98,8 +98,8 @@ module ApiBanking
98
98
  parse_reply(:addBeneficiary, reply)
99
99
  end
100
100
 
101
- def self.delete_beneficiary(request)
102
- reply = do_remote_call do |xml|
101
+ def self.delete_beneficiary(env, request)
102
+ reply = do_remote_call(env) do |xml|
103
103
  xml.deleteBeneficiary("xmlns:ns" => SERVICE_NAMESPACE ) do
104
104
  xml.parent.namespace = xml.parent.namespace_definitions.first
105
105
  xml['ns'].version SERVICE_VERSION
@@ -113,12 +113,11 @@ module ApiBanking
113
113
  parse_reply(:deleteBeneficiary, reply)
114
114
  end
115
115
 
116
- def self.get_beneficiaries(request)
117
- reply = do_remote_call do |xml|
116
+ def self.get_beneficiaries(env, request)
117
+ reply = do_remote_call(env) do |xml|
118
118
  xml.getBeneficiaries("xmlns:ns" => SERVICE_NAMESPACE ) do
119
119
  xml.parent.namespace = xml.parent.namespace_definitions.first
120
120
  xml['ns'].version SERVICE_VERSION
121
- xml['ns'].uniqueRequestNo request.uniqueRequestNo
122
121
  xml['ns'].appID request.appID
123
122
  xml['ns'].customerID request.customerID
124
123
  xml.dateRange do |xml|
@@ -131,8 +130,8 @@ module ApiBanking
131
130
  parse_reply(:getBeneficiaries, reply)
132
131
  end
133
132
 
134
- def self.cancel_transfer(request)
135
- reply = do_remote_call do |xml|
133
+ def self.cancel_transfer(env, request)
134
+ reply = do_remote_call(env) do |xml|
136
135
  xml.cancelTransfer("xmlns:ns" => SERVICE_NAMESPACE ) do
137
136
  xml.parent.namespace = xml.parent.namespace_definitions.first
138
137
  xml['ns'].version SERVICE_VERSION
@@ -153,7 +152,6 @@ module ApiBanking
153
152
  if reply.kind_of?Fault
154
153
  return reply
155
154
  else
156
- puts reply
157
155
  case operationName
158
156
  when :initiateTransfer
159
157
  transferResult = InitiateTransfer::TransferResult.new(
@@ -177,18 +175,17 @@ module ApiBanking
177
175
  i = 1
178
176
  numBeneficiaries = content_at(reply.at_xpath('//ns:getBeneficiariesResponse/ns:numBeneficiaries', 'ns' => SERVICE_NAMESPACE)).to_i
179
177
  until i > numBeneficiaries
180
- BeneficiariesArray << getBeneficiaries::Beneficiary.new(
181
- content_at(reply.at_xpath("//ns:getBeneficiariesResponse/ns:BeneficiariesArray/ns:beneficiary[#{i}]/ns:beneficiaryName", 'ns' => SERVICE_NAMESPACE)),
182
- content_at(reply.at_xpath("//ns:getBeneficiariesResponse/ns:BeneficiariesArray/ns:beneficiary[#{i}]/ns:beneficiaryMobileNo", 'ns' => SERVICE_NAMESPACE)),
183
- content_at(reply.at_xpath("//ns:getBeneficiariesResponse/ns:BeneficiariesArray/ns:beneficiary[#{i}]/ns:registrationDate", 'ns' => SERVICE_NAMESPACE)),
184
- content_at(reply.at_xpath("//ns:getBeneficiariesResponse/ns:BeneficiariesArray/ns:beneficiary[#{i}]/ns:addressLine", 'ns' => SERVICE_NAMESPACE)),
185
- content_at(reply.at_xpath("//ns:getBeneficiariesResponse/ns:BeneficiariesArray/ns:beneficiary[#{i}]/ns:postalCode", 'ns' => SERVICE_NAMESPACE))
178
+ beneficiariesArray << GetBeneficiaries::Beneficiary.new(
179
+ content_at(reply.at_xpath("//ns:getBeneficiariesResponse/ns:beneficiariesArray/ns:beneficiary[#{i}]/ns:beneficiaryName", 'ns' => SERVICE_NAMESPACE)),
180
+ content_at(reply.at_xpath("//ns:getBeneficiariesResponse/ns:beneficiariesArray/ns:beneficiary[#{i}]/ns:beneficiaryMobileNo", 'ns' => SERVICE_NAMESPACE)),
181
+ content_at(reply.at_xpath("//ns:getBeneficiariesResponse/ns:beneficiariesArray/ns:beneficiary[#{i}]/ns:registrationDate", 'ns' => SERVICE_NAMESPACE)),
182
+ content_at(reply.at_xpath("//ns:getBeneficiariesResponse/ns:beneficiariesArray/ns:beneficiary[#{i}]/ns:addressLine", 'ns' => SERVICE_NAMESPACE)),
183
+ content_at(reply.at_xpath("//ns:getBeneficiariesResponse/ns:beneficiariesArray/ns:beneficiary[#{i}]/ns:postalCode", 'ns' => SERVICE_NAMESPACE))
186
184
  )
187
185
  i = i + 1;
188
186
  end;
189
- beneArray = getBeneficiaries::BeneficiariesArray.new(beneficiariesArray)
190
- return getBeneficiaries::Result.new(
191
- content_at(reply.at_xpath('//ns:getBeneficiariesResponse/ns:version', 'ns' => SERVICE_NAMESPACE)),
187
+ beneArray = GetBeneficiaries::BeneficiariesArray.new(beneficiariesArray)
188
+ return GetBeneficiaries::Result.new(
192
189
  content_at(reply.at_xpath('//ns:getBeneficiariesResponse/ns:numBeneficiaries', 'ns' => SERVICE_NAMESPACE)),
193
190
  beneArray
194
191
  )
@@ -36,8 +36,8 @@ module ApiBanking
36
36
  attr_accessor :environment, :proxy, :timeout
37
37
  end
38
38
 
39
- def self.remit(request)
40
- reply = do_remote_call do |xml|
39
+ def self.remit(env, request)
40
+ reply = do_remote_call(env) do |xml|
41
41
  xml.remit("xmlns:ns" => SERVICE_NAMESPACE ) do
42
42
  xml.parent.namespace = xml.parent.namespace_definitions.first
43
43
  xml['ns'].version SERVICE_VERSION
@@ -87,8 +87,8 @@ module ApiBanking
87
87
  attr_accessor :environment, :proxy, :timeout
88
88
  end
89
89
 
90
- def self.getTopics(request)
91
- reply = do_remote_call do |xml|
90
+ def self.getTopics(env, request)
91
+ reply = do_remote_call(env) do |xml|
92
92
  xml.getTopics("xmlns:ns" => SERVICE_NAMESPACE ) do
93
93
  xml.parent.namespace = xml.parent.namespace_definitions.first
94
94
  xml['ns'].version SERVICE_VERSION
@@ -110,8 +110,8 @@ module ApiBanking
110
110
  parse_reply(:getTopics, reply)
111
111
  end
112
112
 
113
- def self.setSubscription(request)
114
- reply = do_remote_call do |xml|
113
+ def self.setSubscription(env, request)
114
+ reply = do_remote_call(env) do |xml|
115
115
  xml.setSubscription("xmlns:ns" => SERVICE_NAMESPACE ) do
116
116
  xml.parent.namespace = xml.parent.namespace_definitions.first
117
117
  xml['ns'].version SERVICE_VERSION
@@ -148,8 +148,8 @@ module ApiBanking
148
148
  parse_reply(:setSubscription, reply)
149
149
  end
150
150
 
151
- def self.deleteSubscription(request)
152
- reply = do_remote_call do |xml|
151
+ def self.deleteSubscription(env, request)
152
+ reply = do_remote_call(env) do |xml|
153
153
  xml.deleteSubscription("xmlns:ns" => SERVICE_NAMESPACE ) do
154
154
  xml.parent.namespace = xml.parent.namespace_definitions.first
155
155
  xml['ns'].version SERVICE_VERSION
@@ -166,8 +166,8 @@ module ApiBanking
166
166
  parse_reply(:deleteSubscription, reply)
167
167
  end
168
168
 
169
- def self.sendMessage(request)
170
- reply = do_remote_call do |xml|
169
+ def self.sendMessage(env, request)
170
+ reply = do_remote_call(env) do |xml|
171
171
  xml.sendMessage("xmlns:ns" => SERVICE_NAMESPACE ) do
172
172
  xml.parent.namespace = xml.parent.namespace_definitions.first
173
173
  xml['ns'].version SERVICE_VERSION
@@ -229,8 +229,8 @@ module ApiBanking
229
229
  parse_reply(:sendMessage, reply)
230
230
  end
231
231
 
232
- def self.dispatchMessage(request)
233
- reply = do_remote_call do |xml|
232
+ def self.dispatchMessage(env, request)
233
+ reply = do_remote_call(env) do |xml|
234
234
  xml.dispatchMessage("xmlns:ns" => SERVICE_NAMESPACE ) do
235
235
  xml.parent.namespace = xml.parent.namespace_definitions.first
236
236
  xml['ns'].version SERVICE_VERSION
@@ -42,8 +42,8 @@ module ApiBanking
42
42
  attr_accessor :environment, :proxy, :timeout
43
43
  end
44
44
 
45
- def self.registerCard(request)
46
- reply = do_remote_call do |xml|
45
+ def self.registerCard(env, request)
46
+ reply = do_remote_call(env) do |xml|
47
47
  xml.registerCard("xmlns:ns" => SERVICE_NAMESPACE ) do
48
48
  xml.parent.namespace = xml.parent.namespace_definitions.first
49
49
  xml['ns'].version SERVICE_VERSION
@@ -83,8 +83,8 @@ module ApiBanking
83
83
  end
84
84
 
85
85
 
86
- def self.loadCard(request)
87
- reply = do_remote_call do |xml|
86
+ def self.loadCard(env, request)
87
+ reply = do_remote_call(env) do |xml|
88
88
  xml.loadCard("xmlns:ns" => SERVICE_NAMESPACE ) do
89
89
  xml.parent.namespace = xml.parent.namespace_definitions.first
90
90
  xml['ns'].version SERVICE_VERSION
@@ -99,8 +99,8 @@ module ApiBanking
99
99
  parse_reply(:loadCard, reply)
100
100
  end
101
101
 
102
- def self.blockCard(request)
103
- reply = do_remote_call do |xml|
102
+ def self.blockCard(env, request)
103
+ reply = do_remote_call(env) do |xml|
104
104
  xml.blockCard("xmlns:ns" => SERVICE_NAMESPACE ) do
105
105
  xml.parent.namespace = xml.parent.namespace_definitions.first
106
106
  xml['ns'].version SERVICE_VERSION
@@ -86,8 +86,8 @@ module ApiBanking
86
86
  attr_accessor :environment, :proxy, :timeout
87
87
  end
88
88
 
89
- def self.addBeneficiary(request)
90
- reply = do_remote_call do |xml|
89
+ def self.addBeneficiary(env, request)
90
+ reply = do_remote_call(env) do |xml|
91
91
  xml.addBeneficiary("xmlns:ns" => SERVICE_NAMESPACE ) do
92
92
  xml.parent.namespace = xml.parent.namespace_definitions.first
93
93
  xml['ns'].version SERVICE_VERSION
@@ -102,8 +102,8 @@ module ApiBanking
102
102
  parse_reply(:addBeneficiary, reply)
103
103
  end
104
104
 
105
- def self.getBalance(request)
106
- reply = do_remote_call do |xml|
105
+ def self.getBalance(env, request)
106
+ reply = do_remote_call(env) do |xml|
107
107
  xml.getBalance("xmlns:ns" => SERVICE_NAMESPACE ) do
108
108
  xml.parent.namespace = xml.parent.namespace_definitions.first
109
109
  xml['ns'].version SERVICE_VERSION
@@ -114,8 +114,8 @@ module ApiBanking
114
114
  parse_reply(:getBalance, reply)
115
115
  end
116
116
 
117
- def self.getBeneficiaries(request)
118
- reply = do_remote_call do |xml|
117
+ def self.getBeneficiaries(env, request)
118
+ reply = do_remote_call(env) do |xml|
119
119
  xml.getBeneficiaries("xmlns:ns" => SERVICE_NAMESPACE ) do
120
120
  xml.parent.namespace = xml.parent.namespace_definitions.first
121
121
  xml['ns'].version SERVICE_VERSION
@@ -127,8 +127,8 @@ module ApiBanking
127
127
  parse_reply(:getBeneficiaries, reply)
128
128
  end
129
129
 
130
- def self.getCustomerDetail(request)
131
- reply = do_remote_call do |xml|
130
+ def self.getCustomerDetail(env, request)
131
+ reply = do_remote_call(env) do |xml|
132
132
  xml.getCustomerDetail("xmlns:ns" => SERVICE_NAMESPACE ) do
133
133
  xml.parent.namespace = xml.parent.namespace_definitions.first
134
134
  xml['ns'].version SERVICE_VERSION
@@ -139,8 +139,8 @@ module ApiBanking
139
139
  parse_reply(:getCustomerDetail, reply)
140
140
  end
141
141
 
142
- def self.getTransactions(request)
143
- reply = do_remote_call do |xml|
142
+ def self.getTransactions(env, request)
143
+ reply = do_remote_call(env) do |xml|
144
144
  xml.getTransactions("xmlns:ns" => SERVICE_NAMESPACE ) do
145
145
  xml.parent.namespace = xml.parent.namespace_definitions.first
146
146
  xml['ns'].version SERVICE_VERSION
@@ -152,8 +152,8 @@ module ApiBanking
152
152
  parse_reply(:getTransactions, reply)
153
153
  end
154
154
 
155
- def self.payToAccount(request)
156
- reply = do_remote_call do |xml|
155
+ def self.payToAccount(env, request)
156
+ reply = do_remote_call(env) do |xml|
157
157
  xml.payToAccount("xmlns:ns" => SERVICE_NAMESPACE ) do
158
158
  xml.parent.namespace = xml.parent.namespace_definitions.first
159
159
  xml['ns'].version SERVICE_VERSION
@@ -172,8 +172,8 @@ module ApiBanking
172
172
  parse_reply(:payToAccount, reply)
173
173
  end
174
174
 
175
- def self.payToContact(request)
176
- reply = do_remote_call do |xml|
175
+ def self.payToContact(env, request)
176
+ reply = do_remote_call(env) do |xml|
177
177
  xml.payToContact("xmlns:ns" => SERVICE_NAMESPACE ) do
178
178
  xml.parent.namespace = xml.parent.namespace_definitions.first
179
179
  xml['ns'].version SERVICE_VERSION
@@ -189,8 +189,8 @@ module ApiBanking
189
189
  parse_reply(:payToContact, reply)
190
190
  end
191
191
 
192
- def self.topUp(request)
193
- reply = do_remote_call do |xml|
192
+ def self.topUp(env, request)
193
+ reply = do_remote_call(env) do |xml|
194
194
  xml.topUp("xmlns:ns" => SERVICE_NAMESPACE ) do
195
195
  xml.parent.namespace = xml.parent.namespace_definitions.first
196
196
  xml['ns'].version SERVICE_VERSION
@@ -206,8 +206,8 @@ module ApiBanking
206
206
  parse_reply(:topUp, reply)
207
207
  end
208
208
 
209
- def self.verifyPIN(request)
210
- reply = do_remote_call do |xml|
209
+ def self.verifyPIN(env, request)
210
+ reply = do_remote_call(env) do |xml|
211
211
  xml.verifyPIN("xmlns:ns" => SERVICE_NAMESPACE ) do
212
212
  xml.parent.namespace = xml.parent.namespace_definitions.first
213
213
  xml['ns'].version SERVICE_VERSION
@@ -1,13 +1,12 @@
1
1
  module ApiBanking
2
2
 
3
3
  class SoapClient
4
- @@last_response = nil
5
-
4
+
6
5
  def self.last_response
7
- @@last_response
6
+ Thread.current[:last_response]
8
7
  end
9
8
 
10
- def self.do_remote_call(soapAction = nil, &block)
9
+ def self.do_remote_call(env, soapAction = nil, &block)
11
10
  data = construct_envelope(&block)
12
11
  options = {}
13
12
  options[:method] = :post
@@ -16,17 +15,19 @@ module ApiBanking
16
15
  # add soap11/12 specific headers
17
16
  add_soap_headers(options, soapAction)
18
17
 
19
- options[:proxy] = self.configuration.proxy
20
- options[:timeout] = self.configuration.timeout
18
+ # TODO: configuration removed for thread-safety, the assumption that one app at one time will connect to one environment
19
+ # isn't valid anymore (starkit)
20
+ # options[:proxy] = self.configuration.proxy
21
+ # options[:timeout] = self.configuration.timeout
21
22
 
22
- set_options_for_environment(options)
23
+ set_options_for_environment(env, options)
23
24
 
24
25
  options[:headers]['User-Agent'] = "Quantiguous; API Banking, Ruby Gem #{ApiBanking::VERSION}"
25
26
 
26
- request = Typhoeus::Request.new(self.configuration.environment.endpoints[self.name.split('::').last.to_sym], options)
27
+ request = Typhoeus::Request.new(env.endpoints[self.name.split('::').last.to_sym], options)
27
28
  response = request.run
28
29
 
29
- @@last_response = response
30
+ Thread.current[:last_response] = response
30
31
 
31
32
  parse_response(response)
32
33
  end
@@ -34,22 +35,25 @@ module ApiBanking
34
35
 
35
36
  private
36
37
 
37
- def self.set_options_for_environment(options)
38
- if self.configuration.environment.kind_of?ApiBanking::Environment::YBL::PRD
39
- options[:userpwd] = "#{self.configuration.environment.user}:#{self.configuration.environment.password}"
40
- options[:headers]["X-IBM-Client-Id"] = self.configuration.environment.client_id
41
- options[:headers]["X-IBM-Client-Secret"] = self.configuration.environment.client_secret
42
- options[:cainfo] = self.configuration.environment.ssl_ca_file
43
- options[:sslkey] = self.configuration.environment.ssl_client_key
44
- options[:keypasswd] = self.configuration.environment.ssl_client_key_pass
45
- options[:sslcert] = self.configuration.environment.ssl_client_cert
38
+ def self.set_options_for_environment(env, options)
39
+ if env.kind_of?ApiBanking::Environment::YBL::PRD
40
+ options[:username] = env.user
41
+ options[:password] = env.password
42
+ options[:headers]["X-IBM-Client-Id"] = env.client_id
43
+ options[:headers]["X-IBM-Client-Secret"] = env.client_secret
44
+ options[:cainfo] = env.ssl_ca_file
45
+ options[:sslkey] = env.ssl_client_key
46
+ options[:keypasswd] = env.ssl_client_key_pass
47
+ options[:sslcert] = env.ssl_client_cert
46
48
  options[:ssl_verifypeer] = true
47
- elsif self.configuration.environment.kind_of?ApiBanking::Environment::YBL::UAT
48
- options[:userpwd] = "#{self.configuration.environment.user}:#{self.configuration.environment.password}"
49
- options[:headers]["X-IBM-Client-Id"] = self.configuration.environment.client_id
50
- options[:headers]["X-IBM-Client-Secret"] = self.configuration.environment.client_secret
51
- elsif self.configuration.environment.kind_of?ApiBanking::Environment::QG::DEMO
52
- options[:userpwd] = "#{self.configuration.environment.user}:#{self.configuration.environment.password}"
49
+ elsif env.kind_of?ApiBanking::Environment::YBL::UAT
50
+ options[:username] = env.user
51
+ options[:password] = env.password
52
+ options[:headers]["X-IBM-Client-Id"] = env.client_id
53
+ options[:headers]["X-IBM-Client-Secret"] = env.client_secret
54
+ elsif env.kind_of?ApiBanking::Environment::QG::DEMO
55
+ options[:username] = env.user
56
+ options[:password] = env.password
53
57
  end
54
58
  end
55
59
 
@@ -14,7 +14,6 @@ module ApiBanking
14
14
  GenericID = Struct.new(:idType, :idValue)
15
15
  AccountIdentity = Struct.new(:accountNo, :registeredAccount)
16
16
 
17
- TransactionsArray = Struct.new(:transaction)
18
17
  Transaction = Struct.new(:transactionID, :recordDate, :transactionType, :currencyCode, :amount, :narrative)
19
18
  Result = Struct.new(:version, :customerID, :accountNo, :numTransactions, :transactionsArray)
20
19
  end
@@ -32,8 +31,8 @@ module ApiBanking
32
31
  attr_accessor :environment, :proxy, :timeout
33
32
  end
34
33
 
35
- def self.getTransactions(request)
36
- reply = do_remote_call do |xml|
34
+ def self.getTransactions(env, request)
35
+ reply = do_remote_call(env) do |xml|
37
36
  xml.getTransactions("xmlns:ns" => SERVICE_NAMESPACE ) do
38
37
  xml.parent.namespace = xml.parent.namespace_definitions.first
39
38
  xml['ns'].version SERVICE_VERSION
@@ -83,21 +82,21 @@ module ApiBanking
83
82
  until i > numTxns
84
83
  txnArray << GetTransactions::Transaction.new(
85
84
  content_at(reply.at_xpath("//ns:getTransactionsResponse/ns:transactionsArray/ns:transaction[#{i}]/ns:transactionID", 'ns' => SERVICE_NAMESPACE)),
86
- content_at(reply.at_xpath("//ns:getTransactionsResponse/ns:transactionsArray/ns:transaction[#{i}]/ns:recordDate", 'ns' => SERVICE_NAMESPACE)),
85
+ Date.strptime(content_at(reply.at_xpath("//ns:getTransactionsResponse/ns:transactionsArray/ns:transaction[#{i}]/ns:recordDate", 'ns' => SERVICE_NAMESPACE)),"%Y-%m-%d"),
87
86
  content_at(reply.at_xpath("//ns:getTransactionsResponse/ns:transactionsArray/ns:transaction[#{i}]/ns:transactionType", 'ns' => SERVICE_NAMESPACE)),
88
87
  content_at(reply.at_xpath("//ns:getTransactionsResponse/ns:transactionsArray/ns:transaction[#{i}]/ns:currencyCode", 'ns' => SERVICE_NAMESPACE)),
89
- content_at(reply.at_xpath("//ns:getTransactionsResponse/ns:transactionsArray/ns:transaction[#{i}]/ns:amount", 'ns' => SERVICE_NAMESPACE)),
88
+ BigDecimal.new(content_at(reply.at_xpath("//ns:getTransactionsResponse/ns:transactionsArray/ns:transaction[#{i}]/ns:amount", 'ns' => SERVICE_NAMESPACE))),
90
89
  content_at(reply.at_xpath("//ns:getTransactionsResponse/ns:transactionsArray/ns:transaction[#{i}]/ns:narrative", 'ns' => SERVICE_NAMESPACE))
91
90
  )
92
91
  i = i + 1;
93
92
  end
94
- transactionsArray = GetTransactions::TransactionsArray.new(txnArray)
93
+
95
94
  return GetTransactions::Result.new(
96
95
  content_at(reply.at_xpath('//ns:getTransactionsResponse/ns:version', 'ns' => SERVICE_NAMESPACE)),
97
96
  content_at(reply.at_xpath('//ns:getTransactionsResponse/ns:customerID', 'ns' => SERVICE_NAMESPACE)),
98
97
  content_at(reply.at_xpath('//ns:getTransactionsResponse/ns:accountNo', 'ns' => SERVICE_NAMESPACE)),
99
- content_at(reply.at_xpath('//ns:getTransactionsResponse/ns:numTransactions', 'ns' => SERVICE_NAMESPACE)),
100
- transactionsArray
98
+ txnArray.size,
99
+ txnArray
101
100
  )
102
101
  end
103
102
  end
@@ -41,8 +41,8 @@ module ApiBanking
41
41
  attr_accessor :environment, :proxy, :timeout
42
42
  end
43
43
 
44
- def self.registerCard(request)
45
- reply = do_remote_call do |xml|
44
+ def self.registerCard(env, request)
45
+ reply = do_remote_call(env) do |xml|
46
46
  xml.registerCard("xmlns:ns" => SERVICE_NAMESPACE ) do
47
47
  xml.parent.namespace = xml.parent.namespace_definitions.first
48
48
  xml['ns'].version SERVICE_VERSION
@@ -76,8 +76,8 @@ module ApiBanking
76
76
  parse_reply(:registerCard, reply)
77
77
  end
78
78
 
79
- def self.blockCard(request)
80
- reply = do_remote_call do |xml|
79
+ def self.blockCard(env, request)
80
+ reply = do_remote_call(env) do |xml|
81
81
  xml.blockCard("xmlns:ns" => SERVICE_NAMESPACE ) do
82
82
  xml.parent.namespace = xml.parent.namespace_definitions.first
83
83
  xml['ns'].version SERVICE_VERSION
@@ -91,8 +91,8 @@ module ApiBanking
91
91
  parse_reply(:blockCard, reply)
92
92
  end
93
93
 
94
- def self.getCardDetail(request)
95
- reply = do_remote_call do |xml|
94
+ def self.getCardDetail(env, request)
95
+ reply = do_remote_call(env) do |xml|
96
96
  xml.getCardDetail("xmlns:ns" => SERVICE_NAMESPACE ) do
97
97
  xml.parent.namespace = xml.parent.namespace_definitions.first
98
98
  xml['ns'].version SERVICE_VERSION
@@ -1,3 +1,3 @@
1
1
  module ApiBanking
2
- VERSION = "0.1.15"
2
+ VERSION = "0.1.16"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: api_banking
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.15
4
+ version: 0.1.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - akil
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-11-18 00:00:00.000000000 Z
11
+ date: 2016-11-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler