Class: ApiBanking::SinglePayment

Inherits:
JsonClient show all
Defined in:
lib/api_banking/json/singlePayment.rb

Defined Under Namespace

Classes: Beneficiary, Configuration, Remitter, Request, Result

Constant Summary collapse

SERVICE_VERSION =
1

Class Attribute Summary collapse

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from JsonClient

do_remote_call

Class Attribute Details

.configurationObject

Returns the value of attribute configuration.



16
17
18
# File 'lib/api_banking/json/singlePayment.rb', line 16

def configuration
  @configuration
end

Instance Attribute Details

#requestObject

Returns the value of attribute request.



6
7
8
# File 'lib/api_banking/json/singlePayment.rb', line 6

def request
  @request
end

#resultObject

Returns the value of attribute result.



6
7
8
# File 'lib/api_banking/json/singlePayment.rb', line 6

def result
  @result
end

Class Method Details

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

Yields:



19
20
21
22
# File 'lib/api_banking/json/singlePayment.rb', line 19

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

.transfer(request) ⇒ Object



28
29
30
31
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
# File 'lib/api_banking/json/singlePayment.rb', line 28

def self.transfer(request)
  dataHash = {}
  dataHash[:Single_Payment_Corp_Req] = {}
  dataHash[:Single_Payment_Corp_Req][:Header] = {}
  dataHash[:Single_Payment_Corp_Req][:Body] = {}
  
  dataHash[:Single_Payment_Corp_Req][:Header][:TranID] = request.uniqueRequestNo
  dataHash[:Single_Payment_Corp_Req][:Header][:Corp_ID] = request.corpID
  dataHash[:Single_Payment_Corp_Req][:Header][:Maker_ID] = request.makerID
  dataHash[:Single_Payment_Corp_Req][:Header][:Checker_ID] = request.checkerID
  dataHash[:Single_Payment_Corp_Req][:Header][:Approver_ID] = request.approverID
  
  dataHash[:Single_Payment_Corp_Req][:Body][:Amount] = request.amount
  dataHash[:Single_Payment_Corp_Req][:Body][:Debit_Acct_No] = request.remitter.accountNo
  dataHash[:Single_Payment_Corp_Req][:Body][:Debit_Acct_Name] = request.remitter.accountName
  dataHash[:Single_Payment_Corp_Req][:Body][:Debit_IFSC] = request.remitter.accountIFSC
  dataHash[:Single_Payment_Corp_Req][:Body][:Debit_Mobile] = request.remitter.mobileNo
  dataHash[:Single_Payment_Corp_Req][:Body][:Debit_TrnParticulars] = request.remitter.tranParticulars
  dataHash[:Single_Payment_Corp_Req][:Body][:Debit_PartTrnRmks] = request.remitter.partTranRemarks
  
  dataHash[:Single_Payment_Corp_Req][:Body][:Ben_IFSC] = request.beneficiary.accountIFSC
  dataHash[:Single_Payment_Corp_Req][:Body][:Ben_Acct_No] = request.beneficiary.accountNo
  dataHash[:Single_Payment_Corp_Req][:Body][:Ben_Name] = request.beneficiary.fullName
  dataHash[:Single_Payment_Corp_Req][:Body][:Ben_Address] = request.beneficiary.address
  dataHash[:Single_Payment_Corp_Req][:Body][:Ben_BankName] = request.beneficiary.bankName
  dataHash[:Single_Payment_Corp_Req][:Body][:Ben_BankCd] = request.beneficiary.bankCode
  dataHash[:Single_Payment_Corp_Req][:Body][:Ben_BranchCd] = request.beneficiary.branchCode
  dataHash[:Single_Payment_Corp_Req][:Body][:Ben_Email] = request.beneficiary.email
  dataHash[:Single_Payment_Corp_Req][:Body][:Ben_Mobile] = request.beneficiary.mobileNo
  dataHash[:Single_Payment_Corp_Req][:Body][:Ben_TrnParticulars] = request.beneficiary.tranParticulars
  dataHash[:Single_Payment_Corp_Req][:Body][:Ben_PartTrnRmks] = request.beneficiary.partTranRemarks
  dataHash[:Single_Payment_Corp_Req][:Body][:Issue_BranchCd] = request.issueBranchCode
  dataHash[:Single_Payment_Corp_Req][:Body][:Mode_of_Pay] = request.modeOfPay
  dataHash[:Single_Payment_Corp_Req][:Body][:Remarks] = request.remarks
  dataHash[:Single_Payment_Corp_Req][:Body][:RptCode] = request.rptCode

        
  reply = do_remote_call(dataHash)
  
  parse_reply(:transferResponse, reply)
end