jonathantron-paypal 3.0.0pre2 → 3.0.0pre3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/paypal/helpers/common.rb +1 -1
- data/lib/paypal/version.rb +1 -1
- data/spec/helpers/common_spec.rb +1 -0
- metadata +2 -2
@@ -150,7 +150,7 @@ module Paypal
|
|
150
150
|
# Sign the data with our key/certificate pair
|
151
151
|
signed = OpenSSL::PKCS7::sign(business_cert, business_key, data, [], OpenSSL::PKCS7::BINARY)
|
152
152
|
# Encrypt the signed data with Paypal's public certificate.
|
153
|
-
encrypted = OpenSSL::PKCS7::encrypt([paypal_cert], signed.to_der, OpenSSL::Cipher::Cipher::new("DES3"), OpenSSL::PKCS7::BINARY)
|
153
|
+
encrypted = OpenSSL::PKCS7::encrypt([paypal_cert], signed.to_der, OpenSSL::Cipher::Cipher::new("DES3"), OpenSSL::PKCS7::BINARY).to_s.gsub("\n", "")
|
154
154
|
|
155
155
|
# The command for encrypted forms is always '_s-xclick'; the real command is in the encrypted data.
|
156
156
|
buttons << %Q{<input type="hidden" name="cmd" value="_s-xclick" />}
|
data/lib/paypal/version.rb
CHANGED
data/spec/helpers/common_spec.rb
CHANGED
@@ -42,6 +42,7 @@ describe Paypal::Helpers::Common do
|
|
42
42
|
end
|
43
43
|
it "should include cmd with encrypted datas" do
|
44
44
|
@result.should have_css("input[type=hidden][name=encrypted][value*=PKCS7]")
|
45
|
+
@result.should_not have_css("input[type=hidden][name=encrypted][value*='\n']")
|
45
46
|
end
|
46
47
|
end
|
47
48
|
|