simplepay 0.2.0 → 0.2.1

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.tar.gz.sig CHANGED
Binary file
@@ -1,3 +1,7 @@
1
+ == 0.2.1 2009-01-06
2
+
3
+ * Maintenance release for missing files.
4
+
1
5
  == 0.2.0 2009-01-03
2
6
 
3
7
  * Added Marketplace Service support [Nick Plante (zapnap)]
@@ -11,6 +11,8 @@ lib/simplepay/helpers/notification_helper.rb
11
11
  lib/simplepay/helpers/rails_helper.rb
12
12
  lib/simplepay/rails.rb
13
13
  lib/simplepay/service.rb
14
+ lib/simplepay/services/marketplace.rb
15
+ lib/simplepay/services/marketplace_policy.rb
14
16
  lib/simplepay/services/standard.rb
15
17
  lib/simplepay/services/subscription.rb
16
18
  lib/simplepay/support.rb
@@ -27,6 +29,8 @@ script/destroy
27
29
  script/generate
28
30
  simplepay.gemspec
29
31
  test/simplepay/helpers/test_notifier.rb
32
+ test/simplepay/services/test_marketplace.rb
33
+ test/simplepay/services/test_marketplace_policy.rb
30
34
  test/simplepay/services/test_standard.rb
31
35
  test/simplepay/services/test_subscription.rb
32
36
  test/simplepay/support/test_amount.rb
@@ -5,7 +5,7 @@ require 'active_support'
5
5
 
6
6
  module Simplepay
7
7
 
8
- VERSION = '0.2.0' unless const_defined?(:VERSION)
8
+ VERSION = '0.2.1' unless const_defined?(:VERSION)
9
9
 
10
10
  mattr_accessor :aws_access_key_id
11
11
  mattr_accessor :aws_secret_access_key
@@ -0,0 +1,86 @@
1
+ module Simplepay
2
+ module Services
3
+
4
+ ##
5
+ # The Amazon Simple Pay Marketplace service is used to facilitate payments for others.
6
+ # Use it to charge a commission fee for brokering the exchange between buyers and sellers.
7
+ #
8
+ # Note that sellers must accept your marketplace fee policy before the payment buttons
9
+ # for their products can be generated. This can be accomplished using the +MarketplacePolicy+
10
+ # service with the form helper (see examples).
11
+ #
12
+ # === Simple Pay Marketplace Fields
13
+ #
14
+ # ==== Required Fields
15
+ #
16
+ # The following attributes are required when creating a Simple Pay
17
+ # Marketplace form (in addition to those listed in +Simplepay::Service+):
18
+ #
19
+ # amount:: The dollar value you'd like to collect.
20
+ # description:: A summary of the reason for the payment, this is displayed to your customer during checkout.
21
+ # recipient_email:: The e-mail address of the seller (important and must be correct).
22
+ # fixed_marketplace_fee:: The fixed marketplace fee to add to each transaction.
23
+ # variable_marketplace_fee:: The variable percentage fee to add to each transaction.
24
+ #
25
+ # ==== Optional Fields
26
+ #
27
+ # abandon_url:: The fully-qualified URL to send your custom if they cancel during payment.
28
+ # cobranding_style:: Defines the type of cobranding to use during the checkout process.
29
+ # collect_shipping_address:: Tells Amazon whether or not to ask for shipping address and contact information.
30
+ # immediate_return:: Immediately returns the customer to your +return_url+ directly after payment.
31
+ # ipn_url:: Fully-qualified URL to which Amazon will POST instant payment notifications.
32
+ # process_immediately:: Instructs Amazon to immediately process the payment.
33
+ # reference_id:: A custom string your can set to identify this transaction, it will be returned with the IPNs and other returned data.
34
+ # return_url:: Fully-qualified URL for where to send your customer following payment.
35
+ #
36
+ # === Example
37
+ #
38
+ # (in your view, sellers need to accept the marketplace fee policy using the form helper)
39
+ #
40
+ # <%= simplepay_form_for(:marketplace_policy, {
41
+ # :max_fixed_fee => 10.00,
42
+ # :max_variable_fee => 5,
43
+ # :return_url => 'http://yourservice.com'
44
+ # }) %>
45
+ #
46
+ # (in your view, payment form generated for end users using the form helper)
47
+ #
48
+ # <%= simplepay_form_for(:standard, {
49
+ # :amount => 34.95,
50
+ # :description => "Mutual profit!",
51
+ # :recipient_email => 'seller@gmail.com',
52
+ # :fixed_marketplace_fee => 10.00,
53
+ # :variable_marketplace_fee => 5
54
+ # }) %>
55
+ #
56
+ class Marketplace < Service
57
+
58
+ required_field :access_key
59
+ required_field :signature
60
+ required_field :account_id, :as => :amazon_payments_account_id
61
+
62
+ required_field :description
63
+ required_field :amount, :class => Support::Amount
64
+ required_field :fixed_marketplace_fee, :class => Support::Amount
65
+ required_field :variable_marketplace_fee
66
+ required_field :cobranding_style, :value => 'logo'
67
+ required_field :recipient_email
68
+
69
+ field :reference_id
70
+ field :immediate_return, :class => Support::Boolean
71
+ field :collect_shipping_address, :class => Support::Boolean
72
+ field :process_immediately, :class => Support::Boolean,
73
+ :as => :process_immediate
74
+
75
+ field :return_url
76
+ field :ipn_url
77
+ field :abandon_url
78
+
79
+ # These fields are not currently utilized by the service
80
+ field :donation_widget, :as => :is_donation_widget,
81
+ :value => '0'
82
+
83
+ end
84
+
85
+ end
86
+ end
@@ -0,0 +1,57 @@
1
+ module Simplepay
2
+ module Services
3
+
4
+ ##
5
+ # The Amazon Simple Pay Marketplace Policy service is used to allow sellers to acknowledge marketplace policy fees.
6
+ # Only once a set policy has been agreed to will marketplace transactions be able to proceed.
7
+ #
8
+ # === Simple Pay Marketplace Policy Fields
9
+ #
10
+ # ==== Required Fields
11
+ #
12
+ # The following attributes are required when creating a Simple Pay Marketplace policy fee acceptance form
13
+ # (in addition to those listed in +Simplepay::Service+):
14
+ #
15
+ # max_fixed_fee:: The maximum fixed fee that will be appended to transactions.
16
+ # max_variable_fee:: The maximum variable fee (%) that will be calculated and added to transactions.
17
+ # return_url:: Fully-qualified URL for where to send they buyer following payment.
18
+ # reference_id:: A custom string used to identify this transaction, it will be returned with return data.
19
+ #
20
+ # === Example
21
+ #
22
+ # (in your view, using the form helper)
23
+ #
24
+ # <%= simplepay_form_for(:marketplace_policy, {
25
+ # :max_fixed_fee => 10.00,
26
+ # :max_variable_fee => 5,
27
+ # :return_url => 'http://yourservice.com',
28
+ # :reference_id => '123456789'
29
+ # }) %>
30
+ #
31
+ class MarketplacePolicy < Service
32
+
33
+ # Fully-qualified URL for the production endpoint for the service.
34
+ ENDPOINT_URL = 'https://authorize.payments.amazon.com/cobranded-ui/actions/start'
35
+
36
+ # Fully-qualified URL for the sandbox (test) endpoint for the service.
37
+ SANDBOX_URL = 'https://authorize.payments-sandbox.amazon.com/cobranded-ui/actions/start'
38
+
39
+ required_field :access_key, :as => :caller_key
40
+ required_field :signature, :as => :aws_signature
41
+ required_field :account_id, :as => :caller_account_id
42
+
43
+ required_field :max_fixed_fee
44
+ required_field :max_variable_fee
45
+ required_field :return_url
46
+
47
+ required_field :reference_id, :as => :caller_reference
48
+ required_field :collect_email_address, :value => 'True'
49
+ required_field :pipeline_name, :value => 'Recipient'
50
+
51
+ # These fields are not currently utilized by the service
52
+ required_field :recipient_pays_fee, :value => 'True'
53
+
54
+ end
55
+
56
+ end
57
+ end
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{simplepay}
5
- s.version = "0.2.0"
5
+ s.version = "0.2.1"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Nathaniel E. Bibler"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simplepay
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathaniel E. Bibler
@@ -30,7 +30,7 @@ cert_chain:
30
30
  DXxToz6dXyCgpN1XYMMB+A==
31
31
  -----END CERTIFICATE-----
32
32
 
33
- date: 2009-01-03 00:00:00 -05:00
33
+ date: 2009-01-06 00:00:00 -05:00
34
34
  default_executable:
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
@@ -88,6 +88,8 @@ files:
88
88
  - lib/simplepay/helpers/rails_helper.rb
89
89
  - lib/simplepay/rails.rb
90
90
  - lib/simplepay/service.rb
91
+ - lib/simplepay/services/marketplace.rb
92
+ - lib/simplepay/services/marketplace_policy.rb
91
93
  - lib/simplepay/services/standard.rb
92
94
  - lib/simplepay/services/subscription.rb
93
95
  - lib/simplepay/support.rb
@@ -104,6 +106,8 @@ files:
104
106
  - script/generate
105
107
  - simplepay.gemspec
106
108
  - test/simplepay/helpers/test_notifier.rb
109
+ - test/simplepay/services/test_marketplace.rb
110
+ - test/simplepay/services/test_marketplace_policy.rb
107
111
  - test/simplepay/services/test_standard.rb
108
112
  - test/simplepay/services/test_subscription.rb
109
113
  - test/simplepay/support/test_amount.rb
metadata.gz.sig CHANGED
Binary file