rails-paypal-gem 0.1 → 0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MzUzODUzODRiNmIzYmNhZWE2NmZhZWE4ODZmZTY3NjNlMzA0NTg2YQ==
4
+ MWVmMzJlOWQzZDc2ZDA3MDdhZTE2OTU3YjNiOWRkMjljMjY3YTBkYw==
5
5
  data.tar.gz: !binary |-
6
- ODZhZjY2YmMzZGRkNTVlZTIxYzg5ZDRiYjNkNjRkMTMxMTRlMDUwZA==
7
- !binary "U0hBNTEy":
6
+ MThjNjJhNDEyYjBjYjBiN2JhZjc0MzdlMjM5NGNkMWY4MDRlNTIwNw==
7
+ SHA512:
8
8
  metadata.gz: !binary |-
9
- YTQzODYzM2JkYzY0ZjgzZWI1M2UwMTYxZDZkOGY0YzI4Y2E5ZTllYmIyMzlj
10
- NGFhYTczMWRkNWQ1ZWUxODIyZmVmMTc4MmJmNDQzYWZmOWMyM2VkNTIyNTc1
11
- NGU3ZDk3YmYxMmRlMGY2YTAzZDFlOGYzYjUxNzJjYmIxMzM0MDc=
9
+ MTcxOTdiNGI1M2I1Zjc4Y2NkNzM1Y2JjMWE0NzBjY2E5ZWQ4NWFhNzljN2I0
10
+ OWM5NTQ5Njc5NmM1OWM3OWEwMWMyOTdjNmFiMTMxYzJmNzQ3YTJhZWI2ZDll
11
+ ODg2MDBjNzdkOTc1NTVkZmI2MjFkYWFmYzM0Y2ZlOTk0ZTU2NzI=
12
12
  data.tar.gz: !binary |-
13
- YTE3NzRhNzUwNzliYWJlYTY5OWRjMzczODMzZDFlNTg2NzI2YmQ2NGNkZTYw
14
- YzNmYWFjZGVjZThlODNjNTlkMjJiZGM1ODQ1NmVjYTVhNWFmOTZkYzRiMDc3
15
- Y2I4ZjQ5ZWUwMjkwMmIxMGM1M2RhNzFjNDU0MTJlOTYwNmYwMjE=
13
+ ZTAwNjIzN2JiNzk4OGZkNzI4MDNlNGM3NDBmNmZiMzhiMDQ0MDM1NTlhZjhi
14
+ NWVjZjU5NDc1ODI2NGNlYmM1OGQ2NGRkODY3NWIyNmUyNWNhM2JkOGU2YTcz
15
+ YjFiOGFjNmI1NWUwYzBkMTVmNTY1OTM2ZGIyNTQ3ZTNlY2RlYjg=
@@ -1,6 +1,6 @@
1
1
  require 'httparty'
2
- require 'rails-paypal/nvp-parser'
3
- class RailsPaypal
2
+ require 'rails-paypal-gem/nvp-parser'
3
+ class RailsPaypalGem
4
4
  include HTTParty
5
5
  if Rails.env == "development"
6
6
  base_uri "https://api-3t.sandbox.paypal.com/nvp"
@@ -11,8 +11,8 @@ class RailsPaypal
11
11
  parser NvpParsingIncluded
12
12
  # the response format
13
13
  format :nvp
14
- # debug_output # turn on httparty debuy
15
- # default_timeout 100
14
+ # debug_output # turn on httparty debuy
15
+ # default_timeout 100
16
16
 
17
17
  def self.call(data)
18
18
  ret = post('/', :body => PARAMS.merge(data))
@@ -0,0 +1,3 @@
1
+ module RailsPaypalGem
2
+ VERSION = '0.5'
3
+ end
@@ -1,4 +1,4 @@
1
- class RailsPaypal::ExpressCheckout < RailsPaypal
1
+ class RailsPaypalGem::ExpressCheckout < RailsPaypalGem
2
2
  attr_accessor :params
3
3
  attr_accessor :token
4
4
  attr_accessor :line_items
@@ -17,8 +17,8 @@ class RailsPaypal::ExpressCheckout < RailsPaypal
17
17
  params["PAYMENTREQUEST_0_AMT"] = total.to_s
18
18
  end
19
19
 
20
- def set(action = 'Sale')
21
- self.params["PAYMENTREQUEST_0_CURRENCYCODE"] = "EUR"
20
+ def set(action = 'Sale', currency = 'USD')
21
+ self.params["PAYMENTREQUEST_0_CURRENCYCODE"] = currency
22
22
  self.params["PAYMENTREQUEST_0_PAYMENTACTION"] = action
23
23
  self.params["METHOD"] = 'SetExpressCheckout'
24
24
  response = self.class.call(self.params)
@@ -47,4 +47,19 @@ class RailsPaypal::ExpressCheckout < RailsPaypal
47
47
  call({"TOKEN" => token, "METHOD" => "GetExpressCheckoutDetails"})
48
48
  end
49
49
 
50
+ def self.do(token, payer_id, amount, currency)
51
+ ret = call({
52
+ "TOKEN"=>token,
53
+ "PAYERID"=>payer_id,
54
+ "AMT" =>amount,
55
+ "CURRENCY" => currency,
56
+ "PAYMENTACTION"=>'Sale',
57
+ "METHOD"=>"DoExpressCheckoutPayment" })
58
+ if ret["PAYMENTSTATUS"] == 'Completed'
59
+ ret["TRANSACTIONID"]
60
+ else
61
+ puts "#{ret.inspect}"
62
+ end
63
+ end
64
+
50
65
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-paypal-gem
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.1'
4
+ version: '0.5'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Jezek
@@ -24,19 +24,20 @@ dependencies:
24
24
  - - ! '>='
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
- description: A simple paypal client for rails lovers and paypal haters!
27
+ description: A simple paypal client for rails lovers and paypal haters! (forked from
28
+ Alicia Tang
28
29
  email: mail@mediatainment-productions.com
29
30
  executables: []
30
31
  extensions: []
31
32
  extra_rdoc_files:
32
33
  - README.md
33
34
  files:
34
- - lib/rails-paypal/nvp-parser.rb
35
- - lib/rails-paypal/version.rb
36
- - lib/rails-paypal.rb
35
+ - lib/rails-paypal-gem/nvp-parser.rb
36
+ - lib/rails-paypal-gem/version.rb
37
+ - lib/rails-paypal-gem.rb
37
38
  - lib/services/express_checkout.rb
38
39
  - README.md
39
- homepage: https://github.com/mediatainment/rails-paypal
40
+ homepage: https://github.com/mediatainment/rails-paypal-gem
40
41
  licenses:
41
42
  - MIT
42
43
  metadata: {}
@@ -56,7 +57,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
56
57
  version: '0'
57
58
  requirements: []
58
59
  rubyforge_project:
59
- rubygems_version: 2.0.3
60
+ rubygems_version: 2.1.11
60
61
  signing_key:
61
62
  specification_version: 4
62
63
  summary: Paypal for rails
@@ -1,3 +0,0 @@
1
- module RailsPaypal
2
- VERSION = '0.1'
3
- end