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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bcdfc3694731fcc63076418e59a20a550e820f8e
4
- data.tar.gz: d8230d7f5f3273ea7883f8f4896e5baca0f8f0a3
3
+ metadata.gz: 8af42bba52af920b74d5f2643e3f8689f5d893e0
4
+ data.tar.gz: 10e1c7dd26eb17d6d568c379ffe614190e13f278
5
5
  SHA512:
6
- metadata.gz: 0c70b9309385a07da1f8e228d1239f78bcf4e689c6c51f7597c18e3744116f4d7aba35150a0812a733badc103bb270c2bc503cd3bf11d753bed26cc550e94ce5
7
- data.tar.gz: f4b6fb5c8285e62e3b4852a38999b2b0cd6ae0c8a0df63c833e3ebce74815a9fa2964960b4c88d2ee7924929a1c9b69eb47517536c9e21db46426a6135393710
6
+ metadata.gz: eb1498285a83bde51951541cb1f7a005682ca8b88e7712bccb62a78782e4e72848a8df4b8d4a90564fcc9b0bbaf10c4b9a6f3f5b39b7d38eaf774782d4ae9ee8
7
+ data.tar.gz: b7b5d96cbaeb9dee35515acbf592b5496fa38270e3810c241618697a6d683fce5c1009b4d171b9e3fec220a51c1a0ea977aa493418a553012bedc4ff91a03a36
@@ -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.:
@@ -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
- # @param payer_id
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
- call_paypal(link[0][:href], nil, :method => :post, :reset => :no)
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
@@ -1,3 +1,3 @@
1
1
  module Version
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paypkg
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael J. Welch, Ph.D.