active_paypal_adaptive_payment 0.3.9 → 0.3.10

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0 0.3.10 (2012-03-30)
2
+
3
+ - Added referrerCode in SetPaymentOptions request (by njvitto)
4
+
1
5
  ## 0 0.3.3 (16/Nov/11)
2
6
 
3
7
  - add functionality to allow a user to redirect to the correct URL
data/README.md CHANGED
@@ -130,6 +130,7 @@ xml request, raw json response and the URL of the endpoint.
130
130
  * akichatov (<https://github.com/akichatov>)
131
131
  * Patrick Sinclair (<https://github.com/metade>)
132
132
  * Mike Pence (<https://github.com/mikepence>)
133
+ * Nicola Junior Vitto (<https://github.com/njvitto>)
133
134
 
134
135
  ## Other previous contributors where some code was taken from.
135
136
 
@@ -5,10 +5,10 @@ require File.dirname(__FILE__) + '/paypal_adaptive_payment_common'
5
5
  require File.dirname(__FILE__) + '/paypal_adaptive_payments/exceptions'
6
6
  require File.dirname(__FILE__) + '/paypal_adaptive_payments/adaptive_payment_response'
7
7
 
8
- module ActiveMerchant #:nodoc:
9
- module Billing #:nodoc:
8
+ module ActiveMerchant
9
+ module Billing
10
10
 
11
- class PaypalAdaptivePayment < Gateway # :nodoc
11
+ class PaypalAdaptivePayment < Gateway
12
12
  include PaypalAdaptivePaymentCommon
13
13
 
14
14
  TEST_URL = 'https://svcs.sandbox.paypal.com/AdaptivePayments/'
@@ -27,7 +27,7 @@ module ActiveMerchant #:nodoc:
27
27
  TYPES.each { |pt| const_set(pt, pt) }
28
28
  end
29
29
 
30
- self.test_redirect_url= "https://www.sandbox.paypal.com/webscr?cmd=_ap-payment&paykey="
30
+ self.test_redirect_url= "https://www.sandbox.paypal.com/webscr?cmd=_ap-payment&paykey="
31
31
  self.test_redirect_pre_approval_url= "https://www.sandbox.paypal.com/webscr?cmd=_ap-preapproval&preapprovalkey="
32
32
  self.supported_countries = ['US']
33
33
  self.homepage_url = 'http://x.com/'
@@ -192,7 +192,7 @@ module ActiveMerchant #:nodoc:
192
192
 
193
193
  def build_adaptive_set_payment_options_request(opts)
194
194
  opts[:sender] ||= {}
195
-
195
+
196
196
  @xml = ''
197
197
  xml = Builder::XmlMarkup.new :target => @xml, :indent => 2
198
198
  xml.instruct!
@@ -205,6 +205,7 @@ module ActiveMerchant #:nodoc:
205
205
  x.shareAddress opts[:sender][:share_address] if opts[:sender][:share_address]
206
206
  x.sharePhoneNumber opts[:sender][:share_phone_number] if opts[:sender][:share_phone_number]
207
207
  x.requireShippingAddressSelection opts[:sender][:require_shipping_address_selection] if opts[:sender][:require_shipping_address_selection]
208
+ x.referrerCode opts[:sender][:referrerCode] if opts[:sender][:referrerCode]
208
209
  end
209
210
  x.payKey opts[:pay_key]
210
211
  end
@@ -368,7 +369,6 @@ module ActiveMerchant #:nodoc:
368
369
  def action_url(action)
369
370
  @url = URI.parse(endpoint_url + action)
370
371
  end
371
-
372
372
  end
373
373
  end
374
374
  end
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
- module ActiveMerchant #:nodoc:
3
- module Billing #:nodoc:
4
- module Integrations #:nodoc:
2
+ module ActiveMerchant
3
+ module Billing
4
+ module Integrations
5
5
  class Notification
6
6
 
7
7
  private
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
- module ActiveMerchant #:nodoc:
3
- module Billing #:nodoc:
4
- module Integrations #:nodoc:
2
+ module ActiveMerchant
3
+ module Billing
4
+ module Integrations
5
5
  module PaypalAdaptivePayment
6
6
  autoload :Return, 'active_merchant/billing/integrations/paypal_adaptive_payment/return.rb'
7
7
  autoload :Helper, 'active_merchant/billing/integrations/paypal_adaptive_payment/helper.rb'
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
- module ActiveMerchant #:nodoc:
3
- module Billing #:nodoc:
4
- module Integrations #:nodoc:
2
+ module ActiveMerchant
3
+ module Billing
4
+ module Integrations
5
5
  module PaypalAdaptivePayment
6
6
  class Helper < ActiveMerchant::Billing::Integrations::Paypal::Helper
7
7
  end
@@ -1,9 +1,9 @@
1
1
  # encoding: utf-8
2
2
  require 'net/http'
3
3
 
4
- module ActiveMerchant #:nodoc:
5
- module Billing #:nodoc:
6
- module Integrations #:nodoc:
4
+ module ActiveMerchant
5
+ module Billing
6
+ module Integrations
7
7
  module PaypalAdaptivePayment
8
8
  # Parser and handler for incoming Instant payment notifications from paypal.
9
9
  # The Example shows a typical handler in a rails application. Note that this
@@ -115,9 +115,9 @@ module ActiveMerchant #:nodoc:
115
115
  payload = raw
116
116
 
117
117
  response = ssl_post(Paypal.service_url + '?cmd=_notify-validate', payload,
118
- 'Content-Length' => "#{payload.size}",
119
- 'User-Agent' => "Active Merchant -- http://activemerchant.org"
120
- )
118
+ 'Content-Length' => "#{payload.size}",
119
+ 'User-Agent' => "Active Merchant -- http://activemerchant.org"
120
+ )
121
121
 
122
122
  raise StandardError.new("Faulty paypal result: #{response}") unless ["VERIFIED", "INVALID"].include?(response)
123
123
 
@@ -1,9 +1,9 @@
1
- module ActiveMerchant #:nodoc:
2
- module Billing #:nodoc:
3
- module Integrations #:nodoc:
1
+ module ActiveMerchant
2
+ module Billing
3
+ module Integrations
4
4
  module PaypalAdaptivePayment
5
5
  class Return < ActiveMerchant::Billing::Integrations::Return
6
- end
6
+ end
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_paypal_adaptive_payment
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.9
4
+ version: 0.3.10
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-03-27 00:00:00.000000000 Z
12
+ date: 2012-03-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activemerchant
16
- requirement: &75097640 !ruby/object:Gem::Requirement
16
+ requirement: &79909610 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 1.5.1
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *75097640
24
+ version_requirements: *79909610
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: multi_json
27
- requirement: &75097400 !ruby/object:Gem::Requirement
27
+ requirement: &79909350 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 1.0.0
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *75097400
35
+ version_requirements: *79909350
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: hashie
38
- requirement: &75097160 !ruby/object:Gem::Requirement
38
+ requirement: &79909060 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 1.2.0
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *75097160
46
+ version_requirements: *79909060
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: money
49
- requirement: &75096920 !ruby/object:Gem::Requirement
49
+ requirement: &79908750 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 3.6.0
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *75096920
57
+ version_requirements: *79908750
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: mocha
60
- requirement: &75113080 !ruby/object:Gem::Requirement
60
+ requirement: &79908450 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,7 +65,7 @@ dependencies:
65
65
  version: 0.10.0
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *75113080
68
+ version_requirements: *79908450
69
69
  description: ! ' This library is meant to interface with PayPal''s Adaptive Payment
70
70
  Gateway.
71
71