<commit_before>module ApiBanking
  class FundsTransferByCustomerService2 < SoapClient
    
    SERVICE_NAMESPACE = 'http://www.quantiguous.com/services'
    SERVICE_VERSION = 1
    
    attr_accessor :request, :result

    #transfer
    module Transfer
      Address = Struct.new(:address1, :address2, :address3, :postalCode, :city, :stateOrProvince, :country)
      Beneficiary = Struct.new(:fullName, :address, :accountNo, :accountIFSC, :mobileNo, :mmid)
      Request = Struct.new(:uniqueRequestNo, :appID, :customerID, :debitAccountNo, :beneficiary, :transferAmount, :transferType, :purposeCode, :remitterToBeneficiaryInfo)
    
      TransactionStatus = Struct.new(:statusCode, :subStatusCode, :bankReferenceNo, :beneficiaryReferenceNo)
      Result = Struct.new(:version, :uniqueResponseNo, :attemptNo, :transferType, :lowBalanceAlert, :transactionStatus)
    end
    
    #getStatus
    module GetStatus
      Request = Struct.new(:version, :appID, :customerID, :requestReferenceNo)
      TransactionStatus = Struct.new(:statusCode, :subStatusCode, :bankReferenceNo, :beneficiaryReferenceNo)
      Result = Struct.new(:version, :transferType, :reqTransferType, :transactionDate, :transferAmount, :transferCurrencyCode, :transactionStatus)
    end
    
    #getBalance
    module GetBalance
      Request = Struct.new(:version, :appID, :customerID, :AccountNumber)
      Result = Struct.new(:Version, :accountCurrencyCode, :accountBalanceAmount, :lowBalanceAlert)
    end
    
    class << self
      attr_accessor :configuration
    end
        
    def self.configure
      self.configuration ||= Configuration.new
      yield(configuration)
    end
    
    class Configuration
      attr_accessor :environment, :proxy, :timeout
    end
        
    def self.transfer(request)
      reply = do_remote_call 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'].appID request.appID
          xml['ns'].purposeCode request.purposeCode
          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(:transfer, reply)
    end<commit_msg>fixes in FT2 request building<commit_after>module ApiBanking
  class FundsTransferByCustomerService2 < SoapClient
    
    SERVICE_NAMESPACE = 'http://www.quantiguous.com/services'
    SERVICE_VERSION = 1
    
    attr_accessor :request, :result

    #transfer
    module Transfer
      Address = Struct.new(:address1, :address2, :address3, :postalCode, :city, :stateOrProvince, :country)
      Beneficiary = Struct.new(:fullName, :address, :accountNo, :accountIFSC, :mobileNo, :mmid, :beneCode)
      Request = Struct.new(:uniqueRequestNo, :appID, :customerID, :debitAccountNo, :beneficiary, :transferAmount, :transferType, :purposeCode, :remitterToBeneficiaryInfo)
    
      TransactionStatus = Struct.new(:statusCode, :subStatusCode, :bankReferenceNo, :beneficiaryReferenceNo)
      Result = Struct.new(:version, :uniqueResponseNo, :attemptNo, :transferType, :lowBalanceAlert, :transactionStatus)
    end
    
    #getStatus
    module GetStatus
      Request = Struct.new(:version, :appID, :customerID, :requestReferenceNo)
      TransactionStatus = Struct.new(:statusCode, :subStatusCode, :bankReferenceNo, :beneficiaryReferenceNo)
      Result = Struct.new(:version, :transferType, :reqTransferType, :transactionDate, :transferAmount, :transferCurrencyCode, :transactionStatus)
    end
    
    #getBalance
    module GetBalance
      Request = Struct.new(:version, :appID, :customerID, :AccountNumber)
      Result = Struct.new(:Version, :accountCurrencyCode, :accountBalanceAmount, :lowBalanceAlert)
    end
    
    class << self
      attr_accessor :configuration
    end
        
    def self.configure
      self.configuration ||= Configuration.new
      yield(configuration)
    end
    
    class Configuration
      attr_accessor :environment, :proxy, :timeout
    end
        
    def self.transfer(request)
      reply = do_remote_call 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'].appID request.appID
          xml['ns'].purposeCode request.purposeCode unless request.purposeCode.nil?
          xml['ns'].customerID request.customerID
          xml['ns'].debitAccountNo request.debitAccountNo
          xml['ns'].beneficiary do  |xml|
            xml.beneficiaryCode request.beneficiary.beneCode unless request.beneficiary.beneCode.nil?
            unless request.beneficiary.fullName.nil?
              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
          end
          xml.transferType request.transferType
          xml.transferCurrencyCode 'INR'
          xml.transferAmount request.transferAmount
          xml.remitterToBeneficiaryInfo request.remitterToBeneficiaryInfo
        end
      end
      
      parse_reply(:transfer, reply)
    end
{'fraction_non_alphanumeric': 0.08365477338476374, 'fraction_numerical': 0.0034956605593056897, 'mean_word_length': 2.6875555555555555, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 73}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '673515', 'n_tokens_mistral': 2316, 'n_tokens_neox': 2166, 'n_words': 417}