paypkg 0.1.2 → 0.1.3
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/paypkg.rb +0 -1
- data/lib/paypkg/accept-pp-payment.rb +1 -2
- data/lib/paypkg/validate-credit-card.rb +2 -1
- data/lib/paypkg/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8af42bba52af920b74d5f2643e3f8689f5d893e0
|
4
|
+
data.tar.gz: 10e1c7dd26eb17d6d568c379ffe614190e13f278
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb1498285a83bde51951541cb1f7a005682ca8b88e7712bccb62a78782e4e72848a8df4b8d4a90564fcc9b0bbaf10c4b9a6f3f5b39b7d38eaf774782d4ae9ee8
|
7
|
+
data.tar.gz: b7b5d96cbaeb9dee35515acbf592b5496fa38270e3810c241618697a6d683fce5c1009b4d171b9e3fec220a51c1a0ea977aa493418a553012bedc4ff91a03a36
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
0.1.3
|
2
|
+
-----
|
3
|
+
* Removed unused parameter from accept_pp_payment.
|
4
|
+
* Added code to remove the uri_base from the link provided by PayPal
|
5
|
+
after an authorization in 'validate-credit-card.rb'. Without this change,
|
6
|
+
PayPal will now force close the connection resulting in a ECONNRESET error.
|
7
|
+
* Removed an unneeded debugging statement in 'lib/paypkg.rb'.
|
8
|
+
|
1
9
|
0.1.2
|
2
10
|
-----
|
3
11
|
* Exposed the json data (input) string as request, i.e.:
|
data/lib/paypkg.rb
CHANGED
@@ -87,7 +87,6 @@ private
|
|
87
87
|
@access_token = nil
|
88
88
|
raise Net::HTTPServerException.new("Unable to obtain access token from PayPal", response)
|
89
89
|
else
|
90
|
-
puts response.body.inspect
|
91
90
|
hash = JSON.parse(response.body, :symbolize_names=>true)
|
92
91
|
@session[:paypal_authorization][:expires_after] = Time.now+hash[:expires_in]
|
93
92
|
@session[:paypal_authorization][:access_token] = hash[:access_token]
|
@@ -16,8 +16,7 @@ class Paypkg
|
|
16
16
|
# @param desc
|
17
17
|
# @param approved_url
|
18
18
|
# @param cancelled_url
|
19
|
-
|
20
|
-
def accept_pp_payment(amount, desc, approved_url, cancelled_url, payer_id)
|
19
|
+
def accept_pp_payment(amount, desc, approved_url, cancelled_url)
|
21
20
|
set_access_token # we need this here to set the @website
|
22
21
|
formatted_amount = "%0.2f"%amount
|
23
22
|
json, status = call_paypal("/v1/payments/payment", "{
|
@@ -63,7 +63,8 @@ class Paypkg
|
|
63
63
|
call_paypal("/v1/payments/payment", data)
|
64
64
|
if (@status.last=='201') && (@hash.last[:state]=='approved')
|
65
65
|
link = @hash.last[:transactions][0][:related_resources][0][:authorization][:links].select{|link| link[:rel]=='void'}
|
66
|
-
|
66
|
+
endpoint = link[0][:href][@uri_base.length..-1] # remove the uri_base from the beginning of the link
|
67
|
+
call_paypal(endpoint, nil, :method => :post, :reset => :no)
|
67
68
|
return true if (@status.last=='200') && (@hash.last[:state]=='voided')
|
68
69
|
end
|
69
70
|
return false
|
data/lib/paypkg/version.rb
CHANGED