Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added ability to override config values when instantiating the Config class, used for testing. The Config class now sets the value of ssl_cert_file and/or ssl_cert_path for use with SSL certificate verification. The Request and IpnNotification classes now verify SSL certificates when making their HTTPS calls. Included tests and supporting file.
- Loading branch information
Showing
5 changed files
with
46 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
require 'helper' | ||
require '../lib/request' | ||
|
||
class ConfigTest < Test::Unit::TestCase | ||
def test_ssl_cert_logic | ||
@config = PaypalAdaptive::Config.new("test", { "ssl_cert_file" => "" }) | ||
assert @config.ssl_cert_file == "../cacert.pem" | ||
end | ||
|
||
def test_ssl_cert_file | ||
@config = PaypalAdaptive::Config.new("test", { "ssl_cert_file" => "data/dummy_cacert.pem" }) | ||
assert @config.ssl_cert_file == "data/dummy_cacert.pem" | ||
assert @config.ssl_cert_path == nil | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Dummy file for testing. |