paypal-scaffold 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +2 -0
- data/README.md +181 -0
- data/VERSION +1 -1
- data/lib/generators/paypal/scaffold/scaffold_generator.rb +28 -13
- data/lib/generators/paypal/scaffold/templates/app/models/paypal_api.rb +97 -24
- data/lib/generators/paypal/scaffold/templates/config/initializers/constants.rb +13 -0
- data/lib/generators/paypal/scaffold/templates/config/initializers/local_setting.rb +3 -7
- data/paypal-scaffold.gemspec +8 -6
- metadata +22 -7
- data/LICENSE.txt +0 -20
- data/README.rdoc +0 -19
data/Gemfile
CHANGED
data/README.md
ADDED
@@ -0,0 +1,181 @@
|
|
1
|
+
# PayPal Scaffold
|
2
|
+
|
3
|
+
Scaffold for PayPal API.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Edit: Gemfile
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'paypal-scaffold'
|
11
|
+
```
|
12
|
+
|
13
|
+
Execute:
|
14
|
+
|
15
|
+
bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
gem install paypal-scaffold
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
Generate paypal scaffold:
|
24
|
+
|
25
|
+
rails g paypal:scaffold
|
26
|
+
|
27
|
+
PayPal Setting
|
28
|
+
|
29
|
+
[ Common ]
|
30
|
+
|
31
|
+
Edit: config/initializers/constants.rb
|
32
|
+
|
33
|
+
```ruby
|
34
|
+
# PayPal
|
35
|
+
if Rails.env.production?
|
36
|
+
PAYPAL_SANDBOX = "OFF"
|
37
|
+
else
|
38
|
+
PAYPAL_SANDBOX = "ON"
|
39
|
+
end
|
40
|
+
|
41
|
+
# PayPal Recurring
|
42
|
+
PAYPAL_RECURRING_PERIOD = :Month # 周期 ie.) :Month, :Week, :Day
|
43
|
+
PAYPAL_RECURRING_FREQUENCY = 1 # 回数
|
44
|
+
PAYPAL_RECURRING_AMOUNT = 150 # 金額
|
45
|
+
```
|
46
|
+
|
47
|
+
[ Development ]
|
48
|
+
|
49
|
+
<a href="https://developer.paypal.com/cgi-bin/devscr?cmd=_certs-session" target="_blank">API Credentials</a>
|
50
|
+
|
51
|
+
Edit: config/initializers/local_setting.rb
|
52
|
+
|
53
|
+
```ruby
|
54
|
+
# PayPal
|
55
|
+
ENV['PAYPAL_USER_NAME'] = "YOUR API Username"
|
56
|
+
ENV['PAYPAL_PASSWORD'] = "YOUR API Password"
|
57
|
+
ENV['PAYPAL_SIGNATURE'] = "YOUR Signature"
|
58
|
+
```
|
59
|
+
|
60
|
+
[ Production ]
|
61
|
+
|
62
|
+
<a href="https://www.paypal.com/jp/cgi-bin/webscr?cmd=_profile-api-signature" target="_blank">API署名の表示または削除</a>
|
63
|
+
|
64
|
+
Heroku: config:add
|
65
|
+
|
66
|
+
heroku config:add PAYPAL_USER_NAME=YOUR_API_USERNAME
|
67
|
+
heroku config:add PAYPAL_PASSWORD=YOUR_API_PASSWORD
|
68
|
+
heroku config:add PAYPAL_SIGNATURE=YOUR_SIGNATURE
|
69
|
+
|
70
|
+
## Method Call Sample
|
71
|
+
|
72
|
+
#### PaypalApi.set_express_checkout
|
73
|
+
|
74
|
+
```ruby
|
75
|
+
success_calback_url = request.url
|
76
|
+
cancel_calback_url = url_for( controller: "top", action: "index", id: params[:id] )
|
77
|
+
description = "定期購読支払い"
|
78
|
+
|
79
|
+
# PayPal取引開始
|
80
|
+
redirect_uri = PaypalApi.set_express_checkout( success_calback_url, cancel_calback_url, description )
|
81
|
+
|
82
|
+
redirect_to redirect_uri and return
|
83
|
+
```
|
84
|
+
|
85
|
+
#### PaypalApi.create_recurring
|
86
|
+
|
87
|
+
```ruby
|
88
|
+
token = params[:token]
|
89
|
+
|
90
|
+
# PayPal定期支払作成
|
91
|
+
profile_id = PaypalApi.create_recurring( token )
|
92
|
+
|
93
|
+
if profile_id.blank?
|
94
|
+
redirect_to( { action: "index" }, alert: "ERROR!!" )
|
95
|
+
end
|
96
|
+
```
|
97
|
+
|
98
|
+
#### PaypalApi.get_recurring_profile
|
99
|
+
|
100
|
+
```ruby
|
101
|
+
@recurring = PaypalApi.get_recurring_profile( profile_id )
|
102
|
+
|
103
|
+
unless @recurring.try(:status) == "Active"
|
104
|
+
flash.now[:alert] = "PayPalステータスが有効ではありません。"
|
105
|
+
end
|
106
|
+
```
|
107
|
+
|
108
|
+
```erb
|
109
|
+
<b>PayPalステータス:</b><br />
|
110
|
+
status:<%= @recurring.status %><br />
|
111
|
+
start_date:<%= Time.parse( @recurring.start_date ).strftime("%Y/%m/%d %H:%M:%S") rescue "" %><br />
|
112
|
+
description:<%= @recurring.description %><br />
|
113
|
+
name:<%= @recurring.name %><br />
|
114
|
+
billing - amount total:<%= @recurring.billing.amount.total %>/period:<%= @recurring.billing.period %>/frequency:<%= @recurring.billing.frequency %>/currency_code:<%= @recurring.billing.currency_code %><br />
|
115
|
+
regular_billing - amount total:<%= @recurring.regular_billing.amount.total %>/period:<%= @recurring.regular_billing.period %>/frequency:<%= @recurring.regular_billing.frequency %>/currency_code:<%= @recurring.regular_billing.currency_code %><br />
|
116
|
+
summary - next_billing_date:<%= Time.parse( @recurring.summary.next_billing_date ).strftime("%Y/%m/%d %H:%M:%S") rescue "" %>/cycles_completed:<%= @recurring.summary.cycles_completed %>/cycles_remaining:<%= @recurring.summary.cycles_remaining %>/outstanding_balance:<%= @recurring.summary.outstanding_balance %>/failed_count:<%= @recurring.summary.failed_count %>/last_payment_date:<%= @recurring.summary.last_payment_date %>/last_payment_amount:<%= @recurring.summary.last_payment_amount %><br />
|
117
|
+
```
|
118
|
+
|
119
|
+
#### PaypalApi.cancel_recurring
|
120
|
+
|
121
|
+
```ruby
|
122
|
+
response = PaypalApi.cancel_recurring( profile_id )
|
123
|
+
|
124
|
+
if response == "Success"
|
125
|
+
notice = "PayPalのキャンセルが完了しました。"
|
126
|
+
else
|
127
|
+
alert = "PayPalのキャンセルに失敗しました。"
|
128
|
+
end
|
129
|
+
|
130
|
+
redirect_to( { action: "index" }, notice: notice, alert: alert )
|
131
|
+
```
|
132
|
+
|
133
|
+
#### PaypalApi.adaptive_payment
|
134
|
+
|
135
|
+
```ruby
|
136
|
+
return_url = url_for( controller: "top", action: "index", result: "Success" )
|
137
|
+
cancel_url = url_for( controller: "top", action: "index", result: "Cancel" )
|
138
|
+
|
139
|
+
receiver_list =[
|
140
|
+
{ "email" => "email01@email.com", "amount" => 100 },
|
141
|
+
{ "email" => "email02@email.com", "amount" => 200 },
|
142
|
+
]
|
143
|
+
|
144
|
+
result, response = PaypalApi.adaptive_payment( return_url, cancel_url, receiver_list )
|
145
|
+
|
146
|
+
if result == "Success"
|
147
|
+
redirect_to response and return
|
148
|
+
else
|
149
|
+
flash.now[:alert] = "PayPal接続に失敗しました。\n#{response}"
|
150
|
+
end
|
151
|
+
```
|
152
|
+
|
153
|
+
#### PaypalApi.mass_pay
|
154
|
+
|
155
|
+
```ruby
|
156
|
+
receive_list = [
|
157
|
+
{ email: "email01@email.com", amount: 100 },
|
158
|
+
{ email: "email02@email.com", amount: 200 },
|
159
|
+
{ email: "email03@email.com", amount: 300 },
|
160
|
+
]
|
161
|
+
|
162
|
+
result_hash = PaypalApi.mass_pay( receive_list )
|
163
|
+
|
164
|
+
if result_hash["ACK"] == "Success"
|
165
|
+
flash.now[:notice] = "支払いが完了しました。"
|
166
|
+
else
|
167
|
+
flash.now[:alert] = "支払いに失敗しました。"
|
168
|
+
end
|
169
|
+
```
|
170
|
+
|
171
|
+
## Contributing
|
172
|
+
|
173
|
+
1. Fork it
|
174
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
175
|
+
3. Commit your changes (`git commit -am 'Added some feature'`)
|
176
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
177
|
+
5. Create new Pull Request
|
178
|
+
|
179
|
+
## Copyright
|
180
|
+
|
181
|
+
Copyright (c) 2012 Shun Matsumoto. <a href="http://creativecommons.org/licenses/by-nc-sa/2.1/jp/" target="_blank">CC BY-NC-SA 2.1</a>
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.2
|
@@ -5,27 +5,42 @@ module Paypal
|
|
5
5
|
module Generators
|
6
6
|
class ScaffoldGenerator < ::Rails::Generators::Base
|
7
7
|
|
8
|
-
source_root File.expand_path("../templates", __FILE__)
|
8
|
+
source_root File.expand_path( "../templates", __FILE__ )
|
9
9
|
desc "This generator scaffold for PayPal"
|
10
10
|
|
11
11
|
def generate_scaffold
|
12
|
-
# App
|
12
|
+
# ----- App ----- #
|
13
13
|
copy_file "app/models/paypal_api.rb", "app/models/paypal_api.rb"
|
14
14
|
|
15
|
-
# Config
|
16
|
-
|
15
|
+
# ----- Config ----- #
|
16
|
+
# initializers/local_setting.rb
|
17
|
+
if File.exist?( 'config/initializers/local_setting.rb' )
|
17
18
|
content = "\n# PayPal\n"
|
18
|
-
content += "ENV['
|
19
|
-
content += "ENV['
|
20
|
-
content += "ENV['
|
21
|
-
content += "ENV['PAYPAL_SIGNATURE'] = \"AiPC9BjkCyDFQXbSkoZcgqH3hpacAzpTbNTAkYEP8T8QC6kv0aF-gRj-\"\n"
|
22
|
-
content += "ENV['PAYPAL_PERIOD'] = \"Month\" # 周期 ie.) :Month, :Week, :Day\n"
|
23
|
-
content += "ENV['PAYPAL_FREQUENCY'] = \"1\" # 回数\n"
|
24
|
-
content += "ENV['PAYPAL_AMOUNT'] = \"150\" # 金額\n"
|
19
|
+
content += "ENV['PAYPAL_USER_NAME'] = \"YOUR API Username\"\n"
|
20
|
+
content += "ENV['PAYPAL_PASSWORD'] = \"YOUR API Password\"\n"
|
21
|
+
content += "ENV['PAYPAL_SIGNATURE'] = \"YOUR Signature\"\n"
|
25
22
|
|
26
|
-
append_file "config/initializers/local_setting.rb", content.force_encoding('ASCII-8BIT')
|
23
|
+
append_file( "config/initializers/local_setting.rb", content.force_encoding('ASCII-8BIT') )
|
27
24
|
else
|
28
|
-
copy_file "config/initializers/local_setting.rb", "config/initializers/local_setting.rb"
|
25
|
+
copy_file( "config/initializers/local_setting.rb", "config/initializers/local_setting.rb" )
|
26
|
+
end
|
27
|
+
|
28
|
+
# initializers/constants.rb
|
29
|
+
if File.exist?( 'config/initializers/constants.rb' )
|
30
|
+
content = "\n# PayPal\n"
|
31
|
+
content += "if Rails.env.production?\n"
|
32
|
+
content += " PAYPAL_SANDBOX = \"OFF\"\n"
|
33
|
+
content += "else\n"
|
34
|
+
content += " PAYPAL_SANDBOX = \"ON\"\n"
|
35
|
+
content += "end\n"
|
36
|
+
content += "\n# PayPal Recurring\n"
|
37
|
+
content += "PAYPAL_RECURRING_PERIOD = :Month # 周期 ie.) :Month, :Week, :Day\n"
|
38
|
+
content += "PAYPAL_RECURRING_FREQUENCY = 1 # 回数\n"
|
39
|
+
content += "PAYPAL_RECURRING_AMOUNT = 150 # 金額\n"
|
40
|
+
|
41
|
+
append_file( "config/initializers/constants.rb", content.force_encoding('ASCII-8BIT') )
|
42
|
+
else
|
43
|
+
copy_file( "config/initializers/constants.rb", "config/initializers/constants.rb" )
|
29
44
|
end
|
30
45
|
end
|
31
46
|
end
|
@@ -4,18 +4,20 @@ class PaypalApi
|
|
4
4
|
private
|
5
5
|
|
6
6
|
# PayPal Setting
|
7
|
-
Paypal.sandbox =
|
7
|
+
Paypal.sandbox = PAYPAL_SANDBOX == "ON" ? true : false
|
8
8
|
PAYPAL_USER_NAME = ENV['PAYPAL_USER_NAME']
|
9
9
|
PAYPAL_PASSWORD = ENV['PAYPAL_PASSWORD']
|
10
10
|
PAYPAL_SIGNATURE = ENV['PAYPAL_SIGNATURE']
|
11
|
-
PAYPAL_PERIOD = ENV['PAYPAL_PERIOD'].to_sym # 周期
|
12
|
-
PAYPAL_FREQUENCY = ENV['PAYPAL_FREQUENCY'].to_i # 回数
|
13
|
-
PAYPAL_AMOUNT = ENV['PAYPAL_AMOUNT'].to_i # 金額
|
14
11
|
|
12
|
+
# MassPay Setting
|
13
|
+
MASS_PAY_ENDPOINT = PAYPAL_SANDBOX == "ON" ? "https://api-3t.sandbox.paypal.com" : "https://api-3t.paypal.com" # 接続先
|
14
|
+
|
15
|
+
# ----- Recurring Payments API ----- #
|
15
16
|
#------------------#
|
16
17
|
# self.get_request #
|
17
18
|
#------------------#
|
18
19
|
# リクエスト生成
|
20
|
+
# OUT : request - PayPalリクエスト
|
19
21
|
def self.get_request
|
20
22
|
request = Paypal::Express::Request.new(
|
21
23
|
username: PAYPAL_USER_NAME,
|
@@ -30,16 +32,11 @@ class PaypalApi
|
|
30
32
|
# self.set_express_checkout #
|
31
33
|
#---------------------------#
|
32
34
|
# チェックアウト開始
|
33
|
-
# IN : success_calback
|
34
|
-
# : cancel_calback
|
35
|
-
# : description
|
35
|
+
# IN : success_calback - 成功時のリダイレクト先URL
|
36
|
+
# : cancel_calback - キャンセル時のリダイレクト先URL
|
37
|
+
# : description - チェックアウトの説明(create_recurringのdescriptionと同じでなければならない)
|
36
38
|
# OUT : response.redirect_uri - チェックアウト開始用PayPal側URL
|
37
|
-
|
38
|
-
def self.set_express_checkout( args )
|
39
|
-
success_calback = args[:success_calback]
|
40
|
-
cancel_calback = args[:cancel_calback]
|
41
|
-
description = args[:description]
|
42
|
-
|
39
|
+
def self.set_express_checkout( success_calback, cancel_calback, description )
|
43
40
|
request = self.get_request
|
44
41
|
|
45
42
|
payment_request = Paypal::Payment::Request.new(
|
@@ -60,9 +57,10 @@ class PaypalApi
|
|
60
57
|
#-----------------------#
|
61
58
|
# self.create_recurring #
|
62
59
|
#-----------------------#
|
63
|
-
#
|
64
|
-
# IN : token
|
65
|
-
#
|
60
|
+
# 定期購読プロフィール作成
|
61
|
+
# IN : token - PayPalからリダイレクトで帰って来た時のparams[:token]から取得
|
62
|
+
# : description - チェックアウトの説明(set_express_checkoutのdescriptionと同じでなければならない)
|
63
|
+
# OUT : response.recurring.identifier - profile_id
|
66
64
|
def self.create_recurring( token, description )
|
67
65
|
request = self.get_request
|
68
66
|
|
@@ -70,9 +68,9 @@ class PaypalApi
|
|
70
68
|
start_date: Time.now,
|
71
69
|
description: description,
|
72
70
|
billing: {
|
73
|
-
period:
|
74
|
-
frequency:
|
75
|
-
amount:
|
71
|
+
period: PAYPAL_RECURRING_PERIOD,
|
72
|
+
frequency: PAYPAL_RECURRING_FREQUENCY,
|
73
|
+
amount: PAYPAL_RECURRING_AMOUNT,
|
76
74
|
currency_code: :JPY, # if nil, PayPal use USD as default
|
77
75
|
}
|
78
76
|
)
|
@@ -86,9 +84,9 @@ class PaypalApi
|
|
86
84
|
#----------------------------#
|
87
85
|
# self.get_recurring_profile #
|
88
86
|
#----------------------------#
|
89
|
-
#
|
90
|
-
# IN : profile_id
|
91
|
-
# OUT : response.recurring
|
87
|
+
# 定期購読プロフィール取得
|
88
|
+
# IN : profile_id - create_recurringの戻り値
|
89
|
+
# OUT : response.recurring - 定期購読の状態
|
92
90
|
def self.get_recurring_profile( profile_id )
|
93
91
|
request = self.get_request
|
94
92
|
response = request.subscription(profile_id)
|
@@ -99,8 +97,8 @@ class PaypalApi
|
|
99
97
|
#-----------------------#
|
100
98
|
# self.cancel_recurring #
|
101
99
|
#-----------------------#
|
102
|
-
#
|
103
|
-
# IN : profile_id
|
100
|
+
# 定期購読キャンセル
|
101
|
+
# IN : profile_id - create_recurringの戻り値
|
104
102
|
# OUT : response.ack - "Success" OR Others
|
105
103
|
def self.cancel_recurring( profile_id )
|
106
104
|
request = self.get_request
|
@@ -108,5 +106,80 @@ class PaypalApi
|
|
108
106
|
|
109
107
|
return response.ack
|
110
108
|
end
|
109
|
+
# ----- / Recurring Payments API ----- #
|
110
|
+
|
111
|
+
# ----- Adaptive Payments API ----- #
|
112
|
+
#-----------------------#
|
113
|
+
# self.adaptive_payment #
|
114
|
+
#-----------------------#
|
115
|
+
# IN : return_url - 成功時のリダイレクト先URL
|
116
|
+
# : cancel_url - キャンセル時のリダイレクト先URL
|
117
|
+
# : receive_list - 支払い先email/amountリスト
|
118
|
+
# OUT : Result(One) - "Success" OR "Error"
|
119
|
+
# : Response(Two) - 決済用PayPal URL OR エラーメッセージ
|
120
|
+
def self.adaptive_payment( return_url, cancel_url, receiver_list )
|
121
|
+
pay_request = PaypalAdaptive::Request.new
|
122
|
+
|
123
|
+
data = {
|
124
|
+
"returnUrl" => return_url,
|
125
|
+
"requestEnvelope" => { "errorLanguage" => "ja_JP" },
|
126
|
+
"currencyCode" => "JPY",
|
127
|
+
"receiverList" => { "receiver" => receiver_list },
|
128
|
+
"cancelUrl" => cancel_url,
|
129
|
+
"actionType" => "PAY",
|
130
|
+
}
|
131
|
+
|
132
|
+
pay_response = pay_request.pay( data )
|
133
|
+
|
134
|
+
if pay_response.success?
|
135
|
+
return "Success", pay_response.approve_paypal_payment_url
|
136
|
+
else
|
137
|
+
return "Error", pay_response.errors.first['message']
|
138
|
+
end
|
139
|
+
end
|
140
|
+
# ----- / Adaptive Payments API ----- #
|
141
|
+
|
142
|
+
# ----- MassPay API ----- #
|
143
|
+
#---------------#
|
144
|
+
# self.mass_pay #
|
145
|
+
#---------------#
|
146
|
+
# 一括支払い
|
147
|
+
# IN : receive_list - 支払い先email/amountリスト
|
148
|
+
# OUT : decode_hash - API結果ハッシュ
|
149
|
+
def self.mass_pay( receive_list )
|
150
|
+
# リクエストパラメータ設定
|
151
|
+
request_param = {
|
152
|
+
"USER" => PAYPAL_USER_NAME,
|
153
|
+
"PWD" => PAYPAL_PASSWORD,
|
154
|
+
"SIGNATURE" => PAYPAL_SIGNATURE,
|
155
|
+
"METHOD" => "MassPay",
|
156
|
+
"CURRENCYCODE" => "JPY",
|
157
|
+
"RECEIVERTYPE" => "EmailAddress",
|
158
|
+
"VERSION" => "89.0",
|
159
|
+
}
|
160
|
+
|
161
|
+
# 支払い先リスト
|
162
|
+
receive_list.each.with_index{ |receive, index|
|
163
|
+
request_param["L_EMAIL#{index}"] = receive[:email].to_s
|
164
|
+
request_param["L_AMT#{index}"] = receive[:amount].to_s
|
165
|
+
}
|
166
|
+
|
167
|
+
url = URI.parse( MASS_PAY_ENDPOINT )
|
168
|
+
http = Net::HTTP.new( url.host, url.port )
|
169
|
+
http.use_ssl = true
|
170
|
+
|
171
|
+
# パラメータ文字列化
|
172
|
+
string_field_params = request_param.map{ |p| "#{p.first}=#{CGI.escape(p.last)}" }.join("&")
|
173
|
+
|
174
|
+
# POST実行
|
175
|
+
response = http.post( "/nvp", string_field_params )
|
176
|
+
|
177
|
+
# レスポンスハッシュ化
|
178
|
+
decode_hash = Hash[ URI.decode_www_form( response.body ) ]
|
179
|
+
|
180
|
+
# 結果ハッシュを返す
|
181
|
+
return decode_hash
|
182
|
+
end
|
183
|
+
# ----- / MassPay API ----- #
|
111
184
|
|
112
185
|
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
# PayPal
|
4
|
+
if Rails.env.production?
|
5
|
+
PAYPAL_SANDBOX = "OFF"
|
6
|
+
else
|
7
|
+
PAYPAL_SANDBOX = "ON"
|
8
|
+
end
|
9
|
+
|
10
|
+
# PayPal Recurring
|
11
|
+
PAYPAL_RECURRING_PERIOD = :Month # 周期 ie.) :Month, :Week, :Day
|
12
|
+
PAYPAL_RECURRING_FREQUENCY = 1 # 回数
|
13
|
+
PAYPAL_RECURRING_AMOUNT = 150 # 金額
|
@@ -1,10 +1,6 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
3
|
# PayPal
|
4
|
-
ENV['
|
5
|
-
ENV['
|
6
|
-
ENV['
|
7
|
-
ENV['PAYPAL_SIGNATURE'] = "AiPC9BjkCyDFQXbSkoZcgqH3hpacAzpTbNTAkYEP8T8QC6kv0aF-gRj-"
|
8
|
-
ENV['PAYPAL_PERIOD'] = "Month" # 周期 ie.) :Month, :Week, :Day
|
9
|
-
ENV['PAYPAL_FREQUENCY'] = "1" # 回数
|
10
|
-
ENV['PAYPAL_AMOUNT'] = "150" # 金額
|
4
|
+
ENV['PAYPAL_USER_NAME'] = "YOUR API Username"
|
5
|
+
ENV['PAYPAL_PASSWORD'] = "YOUR API Password"
|
6
|
+
ENV['PAYPAL_SIGNATURE'] = "YOUR Signature"
|
data/paypal-scaffold.gemspec
CHANGED
@@ -5,27 +5,26 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "paypal-scaffold"
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["shu_0115"]
|
12
|
-
s.date = "2012-05-
|
12
|
+
s.date = "2012-05-24"
|
13
13
|
s.description = "Scaffold for PayPal."
|
14
14
|
s.email = "raisondetre0115@gmail.com"
|
15
15
|
s.extra_rdoc_files = [
|
16
|
-
"
|
17
|
-
"README.rdoc"
|
16
|
+
"README.md"
|
18
17
|
]
|
19
18
|
s.files = [
|
20
19
|
".document",
|
21
20
|
".rspec",
|
22
21
|
"Gemfile",
|
23
|
-
"
|
24
|
-
"README.rdoc",
|
22
|
+
"README.md",
|
25
23
|
"Rakefile",
|
26
24
|
"VERSION",
|
27
25
|
"lib/generators/paypal/scaffold/scaffold_generator.rb",
|
28
26
|
"lib/generators/paypal/scaffold/templates/app/models/paypal_api.rb",
|
27
|
+
"lib/generators/paypal/scaffold/templates/config/initializers/constants.rb",
|
29
28
|
"lib/generators/paypal/scaffold/templates/config/initializers/local_setting.rb",
|
30
29
|
"paypal-scaffold.gemspec",
|
31
30
|
"spec/paypal-scaffold_spec.rb",
|
@@ -42,17 +41,20 @@ Gem::Specification.new do |s|
|
|
42
41
|
|
43
42
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
44
43
|
s.add_runtime_dependency(%q<paypal-express>, [">= 0"])
|
44
|
+
s.add_runtime_dependency(%q<paypal_adaptive>, [">= 0"])
|
45
45
|
s.add_development_dependency(%q<rspec>, ["~> 2.8.0"])
|
46
46
|
s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
|
47
47
|
s.add_development_dependency(%q<jeweler>, ["~> 1.8.3"])
|
48
48
|
else
|
49
49
|
s.add_dependency(%q<paypal-express>, [">= 0"])
|
50
|
+
s.add_dependency(%q<paypal_adaptive>, [">= 0"])
|
50
51
|
s.add_dependency(%q<rspec>, ["~> 2.8.0"])
|
51
52
|
s.add_dependency(%q<rdoc>, ["~> 3.12"])
|
52
53
|
s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
|
53
54
|
end
|
54
55
|
else
|
55
56
|
s.add_dependency(%q<paypal-express>, [">= 0"])
|
57
|
+
s.add_dependency(%q<paypal_adaptive>, [">= 0"])
|
56
58
|
s.add_dependency(%q<rspec>, ["~> 2.8.0"])
|
57
59
|
s.add_dependency(%q<rdoc>, ["~> 3.12"])
|
58
60
|
s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paypal-scaffold
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-05-
|
12
|
+
date: 2012-05-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: paypal-express
|
@@ -27,6 +27,22 @@ dependencies:
|
|
27
27
|
- - ! '>='
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: paypal_adaptive
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
30
46
|
- !ruby/object:Gem::Dependency
|
31
47
|
name: rspec
|
32
48
|
requirement: !ruby/object:Gem::Requirement
|
@@ -80,18 +96,17 @@ email: raisondetre0115@gmail.com
|
|
80
96
|
executables: []
|
81
97
|
extensions: []
|
82
98
|
extra_rdoc_files:
|
83
|
-
-
|
84
|
-
- README.rdoc
|
99
|
+
- README.md
|
85
100
|
files:
|
86
101
|
- .document
|
87
102
|
- .rspec
|
88
103
|
- Gemfile
|
89
|
-
-
|
90
|
-
- README.rdoc
|
104
|
+
- README.md
|
91
105
|
- Rakefile
|
92
106
|
- VERSION
|
93
107
|
- lib/generators/paypal/scaffold/scaffold_generator.rb
|
94
108
|
- lib/generators/paypal/scaffold/templates/app/models/paypal_api.rb
|
109
|
+
- lib/generators/paypal/scaffold/templates/config/initializers/constants.rb
|
95
110
|
- lib/generators/paypal/scaffold/templates/config/initializers/local_setting.rb
|
96
111
|
- paypal-scaffold.gemspec
|
97
112
|
- spec/paypal-scaffold_spec.rb
|
@@ -111,7 +126,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
111
126
|
version: '0'
|
112
127
|
segments:
|
113
128
|
- 0
|
114
|
-
hash:
|
129
|
+
hash: 3060105379047577036
|
115
130
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
116
131
|
none: false
|
117
132
|
requirements:
|
data/LICENSE.txt
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
Copyright (c) 2012 shu_0115
|
2
|
-
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
-
a copy of this software and associated documentation files (the
|
5
|
-
"Software"), to deal in the Software without restriction, including
|
6
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
-
permit persons to whom the Software is furnished to do so, subject to
|
9
|
-
the following conditions:
|
10
|
-
|
11
|
-
The above copyright notice and this permission notice shall be
|
12
|
-
included in all copies or substantial portions of the Software.
|
13
|
-
|
14
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
= paypal-scaffold
|
2
|
-
|
3
|
-
Description goes here.
|
4
|
-
|
5
|
-
== Contributing to paypal-scaffold
|
6
|
-
|
7
|
-
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
|
8
|
-
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
|
9
|
-
* Fork the project.
|
10
|
-
* Start a feature/bugfix branch.
|
11
|
-
* Commit and push until you are happy with your contribution.
|
12
|
-
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
13
|
-
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
14
|
-
|
15
|
-
== Copyright
|
16
|
-
|
17
|
-
Copyright (c) 2012 shu_0115. See LICENSE.txt for
|
18
|
-
further details.
|
19
|
-
|