api_banking 0.1.23 → 0.1.24

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: 008e520dcf8a6f37585f543609e410aa969b0b5b
4
- data.tar.gz: 510c82969d8e455d81973756efce038b0613a08b
3
+ metadata.gz: 33dc926a549996c98287b0b11a178135aac9f574
4
+ data.tar.gz: b04f18b0e3c3d09cc9eb0c90c67d866d6676d622
5
5
  SHA512:
6
- metadata.gz: 974c5e61f8cf40555fd1eebcdc44ab9c388ce05a37b291452a749cc152c2b7ee2c648188e6eb39faaa60f3accffd91b3aa92a439a890733fa8556242cebbf676
7
- data.tar.gz: ef04cadba56654372809bcd7d422e0bd53b934204439247960f0b4f7a371b965693e7a0f45551ca61f9a743bd7e6f7f0e724a3852a9aa12083b6d476cea9ec8d
6
+ metadata.gz: 344f7a5c359dcde366e9f6b75629aafe54f2581b22ad7aea10d2ab9258eef935e8fbac6ceac81842f73939f494b4c8ee0975361a3b36209c72b9b7c8e017cd92
7
+ data.tar.gz: b61a4bc8737d5eee16244f329957be2300f892d827e72e3fc87e3000d3d8f2ff44d5ce40125e9b301c521d2469c275a6cb146224151f57b8c8e59604fc6410e0
@@ -5,12 +5,13 @@ module ApiBanking
5
5
 
6
6
  attr_accessor :request, :result
7
7
 
8
- #transfer
9
- Remitter = Struct.new(:accountNo, :accountName, :accountIFSC, :mobileNo, :tranParticulars, :partTranRemarks)
10
- Beneficiary = Struct.new(:fullName, :address, :accountNo, :accountIFSC, :bankName, :bankCode, :branchCode, :email, :mobileNo, :mmid, :tranParticulars, :partTranRemarks)
11
- Request = Struct.new(:uniqueRequestNo, :corpID, :makerID, :checkerID, :approverID, :remitter, :beneficiary, :amount, :issueBranchCode, :modeOfPay, :remarks, :rptCode)
8
+ ReqHeader = Struct.new(:tranID, :corpID, :approverID)
9
+ Remitter = Struct.new(:accountNo, :accountName)
10
+ Beneficiary = Struct.new(:accountIFSC, :accountNo, :fullName, :address, :email, :mobileNo)
11
+ ReqBody = Struct.new(:amount, :remitter, :beneficiary, :modeOfPay, :remarks)
12
+ Request = Struct.new(:header, :body)
12
13
 
13
- Result = Struct.new(:status, :errorCode, :errorDescription)
14
+ Result = Struct.new(:statusCode, :bankReferenceNo, :transferType)
14
15
 
15
16
  class << self
16
17
  attr_accessor :configuration
@@ -31,53 +32,44 @@ module ApiBanking
31
32
  dataHash[:Single_Payment_Corp_Req][:Header] = {}
32
33
  dataHash[:Single_Payment_Corp_Req][:Body] = {}
33
34
 
34
- dataHash[:Single_Payment_Corp_Req][:Header][:TranID] = request.uniqueRequestNo
35
- dataHash[:Single_Payment_Corp_Req][:Header][:Corp_ID] = request.corpID
36
- dataHash[:Single_Payment_Corp_Req][:Header][:Maker_ID] = request.makerID
37
- dataHash[:Single_Payment_Corp_Req][:Header][:Checker_ID] = request.checkerID
38
- dataHash[:Single_Payment_Corp_Req][:Header][:Approver_ID] = request.approverID
39
-
40
- dataHash[:Single_Payment_Corp_Req][:Body][:Amount] = request.amount
41
- dataHash[:Single_Payment_Corp_Req][:Body][:Debit_Acct_No] = request.remitter.accountNo
42
- dataHash[:Single_Payment_Corp_Req][:Body][:Debit_Acct_Name] = request.remitter.accountName
43
- dataHash[:Single_Payment_Corp_Req][:Body][:Debit_IFSC] = request.remitter.accountIFSC unless request.remitter.accountIFSC.nil?
44
- dataHash[:Single_Payment_Corp_Req][:Body][:Debit_Mobile] = request.remitter.mobileNo unless request.remitter.mobileNo.nil?
45
- dataHash[:Single_Payment_Corp_Req][:Body][:Debit_TrnParticulars] = request.remitter.tranParticulars unless request.remitter.tranParticulars.nil?
46
- dataHash[:Single_Payment_Corp_Req][:Body][:Debit_PartTrnRmks] = request.remitter.partTranRemarks unless request.remitter.partTranRemarks.nil?
47
-
48
- dataHash[:Single_Payment_Corp_Req][:Body][:Ben_IFSC] = request.beneficiary.accountIFSC
49
- dataHash[:Single_Payment_Corp_Req][:Body][:Ben_Acct_No] = request.beneficiary.accountNo
50
- dataHash[:Single_Payment_Corp_Req][:Body][:Ben_Name] = request.beneficiary.fullName
51
- dataHash[:Single_Payment_Corp_Req][:Body][:Ben_Address] = request.beneficiary.address
52
- dataHash[:Single_Payment_Corp_Req][:Body][:Ben_BankName] = request.beneficiary.bankName
53
- dataHash[:Single_Payment_Corp_Req][:Body][:Ben_BankCd] = request.beneficiary.bankCode
54
- dataHash[:Single_Payment_Corp_Req][:Body][:Ben_BranchCd] = request.beneficiary.branchCode
55
- dataHash[:Single_Payment_Corp_Req][:Body][:Ben_Email] = request.beneficiary.email
56
- dataHash[:Single_Payment_Corp_Req][:Body][:Ben_Mobile] = request.beneficiary.mobileNo
57
- dataHash[:Single_Payment_Corp_Req][:Body][:Ben_TrnParticulars] = request.beneficiary.tranParticulars
58
- dataHash[:Single_Payment_Corp_Req][:Body][:Ben_PartTrnRmks] = request.beneficiary.partTranRemarks
59
- dataHash[:Single_Payment_Corp_Req][:Body][:Issue_BranchCd] = request.issueBranchCode
60
- dataHash[:Single_Payment_Corp_Req][:Body][:Mode_of_Pay] = request.modeOfPay
61
- dataHash[:Single_Payment_Corp_Req][:Body][:Remarks] = request.remarks
62
- dataHash[:Single_Payment_Corp_Req][:Body][:RptCode] = request.rptCode
63
-
35
+ dataHash[:Single_Payment_Corp_Req][:Header][:TranID] = request.header.tranID
36
+ dataHash[:Single_Payment_Corp_Req][:Header][:Corp_ID] = request.header.corpID
37
+ dataHash[:Single_Payment_Corp_Req][:Header][:Maker_ID] = ''
38
+ dataHash[:Single_Payment_Corp_Req][:Header][:Checker_ID] = ''
39
+ dataHash[:Single_Payment_Corp_Req][:Header][:Approver_ID] = ''
40
+
41
+ dataHash[:Single_Payment_Corp_Req][:Body][:Amount] = request.body.amount
42
+ dataHash[:Single_Payment_Corp_Req][:Body][:Debit_Acct_No] = request.body.remitter.accountNo
43
+ dataHash[:Single_Payment_Corp_Req][:Body][:Debit_Acct_Name] = request.body.remitter.accountName
44
+
45
+ dataHash[:Single_Payment_Corp_Req][:Body][:Ben_IFSC] = request.body.beneficiary.accountIFSC
46
+ dataHash[:Single_Payment_Corp_Req][:Body][:Ben_Acct_No] = request.body.beneficiary.accountNo
47
+ dataHash[:Single_Payment_Corp_Req][:Body][:Ben_Name] = request.body.beneficiary.fullName
48
+ dataHash[:Single_Payment_Corp_Req][:Body][:Ben_Address] = request.body.beneficiary.address
49
+ dataHash[:Single_Payment_Corp_Req][:Body][:Ben_Email] = request.body.beneficiary.email
50
+ dataHash[:Single_Payment_Corp_Req][:Body][:Ben_Mobile] = request.body.beneficiary.mobileNo
51
+ dataHash[:Single_Payment_Corp_Req][:Body][:Mode_of_Pay] = request.body.modeOfPay
52
+ dataHash[:Single_Payment_Corp_Req][:Body][:Remarks] = request.body.remarks
53
+
54
+ puts dataHash
64
55
 
65
56
  reply = do_remote_call(env, dataHash, callbacks)
66
57
 
67
- parse_reply(:transferResponse, reply)
58
+ parse_reply(reply, request.body.modeOfPay)
68
59
  end
69
60
 
70
61
 
71
62
  private
72
63
 
73
- def self.parse_reply(operationName, reply)
64
+ def self.parse_reply(reply, transferType)
74
65
  if reply.kind_of?Fault
75
- return reply
66
+ reply
76
67
  else
77
- puts reply
78
- case operationName
79
- when :transferResponse
80
- end
68
+ SinglePayment::Result.new(
69
+ reply['Single_Payment_Corp_Resp']['Header']['Status'],
70
+ reply['Single_Payment_Corp_Resp']['Body']['UTRNo'],
71
+ transferType
72
+ )
81
73
  end
82
74
  end
83
75
 
@@ -1,3 +1,3 @@
1
1
  module ApiBanking
2
- VERSION = "0.1.23"
2
+ VERSION = "0.1.24"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: api_banking
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.23
4
+ version: 0.1.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - akil