Giter Club home page Giter Club logo

nfg-client's People

Contributors

aruanoc avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

nfg-client's Issues

Text is not being properly encoded

When a string entered by the user to be sent to NFG, such as first name, last name, etc., includes certain characters (<>&), the soap message will fail. These characters should be encoded while the xml is built.

Looking at the code, it appears that the only change would be in the hash_to_xml method, by adding an encoding step (CGI.escapeHTML(v)):

    def hash_to_xml(hash)
      hash.map do |k, v|
        text = (v.is_a? Hash) ? hash_to_xml(v) : CGI.escapeHTML(v)
        # It removes the digits at the end of each "DonationItem" hash key
        xml_elem = (v.is_a? Hash) ? k.to_s.gsub(/(\d)/, "") : k
        "<%s>%s</%s>" % [xml_elem, text, xml_elem]
      end.join
    end

If you think this is the correct solution, let me know and I will issue a pull request.

On get_fee call, should the response's TotalDeductFee be set to TotalDeductFee

Currently, the response object returns a TotalDeductFee that has been set to the TotalChargeAmount. Should it be set to the TotalDeductFee amount?

        'TotalAddFee' => response.elements['TotalAddFee'].get_text.to_s,
        'TotalDeductFee' => response.elements['TotalChargeAmount'].get_text.to_s,
        'TipAmount' => response.elements['TotalAddFee'].get_text.to_s

And should the TipAmount be set to the TotalAddFee? I thought they were different?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.