aruanoc / nfg-client Goto Github PK
View Code? Open in Web Editor NEWA ruby client for the Network For Good API.
License: MIT License
A ruby client for the Network For Good API.
License: MIT License
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.
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.