catarse_paypal_express 2.1.2 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- catarse_paypal_express (2.1.1)
4
+ catarse_paypal_express (2.2.0)
5
5
  activemerchant (>= 1.34.0)
6
6
  rails (~> 4.0)
7
7
  slim-rails
@@ -8,7 +8,7 @@ App.addChild('PayPalForm', _.extend({
8
8
 
9
9
  activate: function() {
10
10
  this.loader = $('.loader');
11
- this.parent.backerId = $('input#backer_id').val();
11
+ this.parent.contributionId = $('input#contribution_id').val();
12
12
  this.parent.projectId = $('input#project_id').val();
13
13
  },
14
14
 
@@ -23,8 +23,8 @@ var PayPal = window.PayPal = { UserDocument: {
23
23
  if(resultCpf || resultCnpj) {
24
24
  $documentField.addClass('ok').removeClass('error');
25
25
 
26
- $.post('/projects/' + this.parent.projectId + '/backers/' + this.parent.backerId + '/update_info', {
27
- backer: { payer_document: documentNumber }
26
+ $.post('/projects/' + this.parent.projectId + '/contributions/' + this.parent.contributionId + '/update_info', {
27
+ contribution: { payer_document: documentNumber }
28
28
  });
29
29
 
30
30
  } else {
@@ -2,29 +2,29 @@ class CatarsePaypalExpress::PaypalExpressController < ApplicationController
2
2
  include ActiveMerchant::Billing::Integrations
3
3
 
4
4
  skip_before_filter :force_http
5
- SCOPE = "projects.backers.checkout"
5
+ SCOPE = "projects.contributions.checkout"
6
6
  layout :false
7
7
 
8
8
  def review
9
9
  end
10
10
 
11
11
  def refund
12
- refund_request = gateway.refund(nil, backer.payment_id)
12
+ refund_request = gateway.refund(nil, contribution.payment_id)
13
13
 
14
14
 
15
15
  if refund_request.success?
16
- flash[:notice] = I18n.t('projects.backers.refund.success')
16
+ flash[:notice] = I18n.t('projects.contributions.refund.success')
17
17
  else
18
- flash[:alert] = refund_request.try(:message) || I18n.t('projects.backers.refund.error')
18
+ flash[:alert] = refund_request.try(:message) || I18n.t('projects.contributions.refund.error')
19
19
  end
20
20
 
21
- redirect_to main_app.admin_backers_path
21
+ redirect_to main_app.admin_contributions_path
22
22
  end
23
23
 
24
24
  def ipn
25
- if backer && notification.acknowledge && (backer.payment_method == 'PayPal' || backer.payment_method.nil?)
25
+ if contribution && notification.acknowledge && (contribution.payment_method == 'PayPal' || contribution.payment_method.nil?)
26
26
  process_paypal_message params
27
- backer.update_attributes({
27
+ contribution.update_attributes({
28
28
  :payment_service_fee => params['mc_fee'],
29
29
  :payer_email => params['payer_email']
30
30
  })
@@ -38,54 +38,54 @@ class CatarsePaypalExpress::PaypalExpressController < ApplicationController
38
38
 
39
39
  def pay
40
40
  begin
41
- response = gateway.setup_purchase(backer.price_in_cents, {
41
+ response = gateway.setup_purchase(contribution.price_in_cents, {
42
42
  ip: request.remote_ip,
43
- return_url: success_paypal_express_url(id: backer.id),
44
- cancel_return_url: cancel_paypal_express_url(id: backer.id),
43
+ return_url: success_paypal_express_url(id: contribution.id),
44
+ cancel_return_url: cancel_paypal_express_url(id: contribution.id),
45
45
  currency_code: 'BRL',
46
- description: t('paypal_description', scope: SCOPE, :project_name => backer.project.name, :value => backer.display_value),
46
+ description: t('paypal_description', scope: SCOPE, :project_name => contribution.project.name, :value => contribution.display_value),
47
47
  notify_url: ipn_paypal_express_index_url
48
48
  })
49
49
 
50
50
  process_paypal_message response.params
51
- backer.update_attributes payment_method: 'PayPal', payment_token: response.token
51
+ contribution.update_attributes payment_method: 'PayPal', payment_token: response.token
52
52
 
53
53
  redirect_to gateway.redirect_url_for(response.token)
54
54
  rescue Exception => e
55
55
  Rails.logger.info "-----> #{e.inspect}"
56
56
  flash[:failure] = t('paypal_error', scope: SCOPE)
57
- return redirect_to main_app.new_project_backer_path(backer.project)
57
+ return redirect_to main_app.new_project_contribution_path(contribution.project)
58
58
  end
59
59
  end
60
60
 
61
61
  def success
62
62
  begin
63
- purchase = gateway.purchase(backer.price_in_cents, {
63
+ purchase = gateway.purchase(contribution.price_in_cents, {
64
64
  ip: request.remote_ip,
65
- token: backer.payment_token,
65
+ token: contribution.payment_token,
66
66
  payer_id: params[:PayerID]
67
67
  })
68
68
 
69
69
  # we must get the deatils after the purchase in order to get the transaction_id
70
70
  process_paypal_message purchase.params
71
- backer.update_attributes payment_id: purchase.params['transaction_id'] if purchase.params['transaction_id']
71
+ contribution.update_attributes payment_id: purchase.params['transaction_id'] if purchase.params['transaction_id']
72
72
 
73
73
  flash[:success] = t('success', scope: SCOPE)
74
- redirect_to main_app.project_backer_path(project_id: backer.project.id, id: backer.id)
74
+ redirect_to main_app.project_contribution_path(project_id: contribution.project.id, id: contribution.id)
75
75
  rescue Exception => e
76
76
  Rails.logger.info "-----> #{e.inspect}"
77
77
  flash[:failure] = t('paypal_error', scope: SCOPE)
78
- return redirect_to main_app.new_project_backer_path(backer.project)
78
+ return redirect_to main_app.new_project_contribution_path(contribution.project)
79
79
  end
80
80
  end
81
81
 
82
82
  def cancel
83
83
  flash[:failure] = t('paypal_cancel', scope: SCOPE)
84
- redirect_to main_app.new_project_backer_path(backer.project)
84
+ redirect_to main_app.new_project_contribution_path(contribution.project)
85
85
  end
86
86
 
87
- def backer
88
- @backer ||= if params['id']
87
+ def contribution
88
+ @contribution ||= if params['id']
89
89
  PaymentEngines.find_payment(id: params['id'])
90
90
  elsif params['txn_id']
91
91
  PaymentEngines.find_payment(payment_id: params['txn_id']) || (params['parent_txn_id'] && PaymentEngines.find_payment(payment_id: params['parent_txn_id']))
@@ -94,22 +94,22 @@ class CatarsePaypalExpress::PaypalExpressController < ApplicationController
94
94
 
95
95
  def process_paypal_message(data)
96
96
  extra_data = (data['charset'] ? JSON.parse(data.to_json.force_encoding(data['charset']).encode('utf-8')) : data)
97
- PaymentEngines.create_payment_notification backer_id: backer.id, extra_data: extra_data
97
+ PaymentEngines.create_payment_notification contribution_id: contribution.id, extra_data: extra_data
98
98
 
99
99
  if data["checkout_status"] == 'PaymentActionCompleted'
100
- backer.confirm!
100
+ contribution.confirm!
101
101
  elsif data["payment_status"]
102
102
  case data["payment_status"].downcase
103
103
  when 'completed'
104
- backer.confirm!
104
+ contribution.confirm!
105
105
  when 'refunded'
106
- backer.refund!
106
+ contribution.refund!
107
107
  when 'canceled_reversal'
108
- backer.cancel!
108
+ contribution.cancel!
109
109
  when 'expired', 'denied'
110
- backer.pendent!
110
+ contribution.pendent!
111
111
  else
112
- backer.waiting! if backer.pending?
112
+ contribution.waiting! if contribution.pending?
113
113
  end
114
114
  end
115
115
  end
@@ -1,13 +1,13 @@
1
1
  = javascript_include_tag 'catarse_paypal_express'
2
2
 
3
- h3= t('projects.backers.review.international.section_title')
3
+ h3= t('projects.contributions.review.international.section_title')
4
4
 
5
5
  #catarse_paypal_express_form
6
6
  = form_tag pay_paypal_express_path(params[:id]) do
7
7
  .clearfix
8
8
  .bootstrap-twitter
9
- = label_tag 'user_document', t('projects.backers.review.international.user_document_label')
9
+ = label_tag 'user_document', t('projects.contributions.review.international.user_document_label')
10
10
  .clearfix
11
11
  = text_field_tag 'user_document', nil, { autocomplete: 'off' }
12
12
  .loader.hide= image_tag 'loading.gif'
13
- = submit_tag t('projects.backers.review.international.button'), :class => 'btn btn-primary btn-large'
13
+ = submit_tag t('projects.contributions.review.international.button'), :class => 'btn btn-primary btn-large'
@@ -1,11 +1,11 @@
1
1
  begin
2
2
  PaymentEngines.register({
3
3
  name: 'paypal',
4
- review_path: ->(backer) {
5
- CatarsePaypalExpress::Engine.routes.url_helpers.review_paypal_express_path(backer)
4
+ review_path: ->(contribution) {
5
+ CatarsePaypalExpress::Engine.routes.url_helpers.review_paypal_express_path(contribution)
6
6
  },
7
- refund_path: ->(backer) {
8
- CatarsePaypalExpress::Engine.routes.url_helpers.refund_paypal_express_path(backer)
7
+ refund_path: ->(contribution) {
8
+ CatarsePaypalExpress::Engine.routes.url_helpers.refund_paypal_express_path(contribution)
9
9
  },
10
10
  locale: 'en'
11
11
  })
@@ -1,6 +1,6 @@
1
1
  en:
2
2
  projects:
3
- backers:
3
+ contributions:
4
4
  refund:
5
5
  success: 'Pedido de reembolso enviado com sucesso!'
6
6
  error: 'OPS! Ocorreu um erro ao tentar enviar o pedido de reembolso.'
@@ -1,6 +1,6 @@
1
1
  pt:
2
2
  projects:
3
- backers:
3
+ contributions:
4
4
  refund:
5
5
  success: 'Pedido de reembolso enviado com sucesso!'
6
6
  error: 'OPS! Ocorreu um erro ao tentar enviar o pedido de reembolso.'
@@ -1,3 +1,3 @@
1
1
  module CatarsePaypalExpress
2
- VERSION = "2.1.2"
2
+ VERSION = "2.2.0"
3
3
  end
@@ -5,7 +5,7 @@ require 'spec_helper'
5
5
  describe CatarsePaypalExpress::PaypalExpressController do
6
6
  SCOPE = CatarsePaypalExpress::PaypalExpressController::SCOPE
7
7
  before do
8
- PaymentEngines.stub(:find_payment).and_return(backer)
8
+ PaymentEngines.stub(:find_payment).and_return(contribution)
9
9
  PaymentEngines.stub(:create_payment_notification)
10
10
  controller.stub(:main_app).and_return(main_app)
11
11
  controller.stub(:current_user).and_return(current_user)
@@ -17,9 +17,9 @@ describe CatarsePaypalExpress::PaypalExpressController do
17
17
  let(:main_app){ double('main_app') }
18
18
  let(:current_user) { double('current_user') }
19
19
  let(:project){ double('project', id: 1, name: 'test project') }
20
- let(:backer){ double('backer', {
20
+ let(:contribution){ double('contribution', {
21
21
  id: 1,
22
- key: 'backer key',
22
+ key: 'contribution key',
23
23
  payment_id: 'payment id',
24
24
  project: project,
25
25
  pending?: true,
@@ -46,26 +46,26 @@ describe CatarsePaypalExpress::PaypalExpressController do
46
46
  success_refund = double
47
47
  success_refund.stub(:success?).and_return(true)
48
48
 
49
- main_app.should_receive(:admin_backers_path).and_return('admin_backers_path')
49
+ main_app.should_receive(:admin_contributions_path).and_return('admin_contributions_path')
50
50
 
51
- gateway.should_receive(:refund).with(nil, backer.payment_id).and_return(success_refund)
51
+ gateway.should_receive(:refund).with(nil, contribution.payment_id).and_return(success_refund)
52
52
 
53
- post :refund, id: backer.id, use_route: 'catarse_paypal_express'
53
+ post :refund, id: contribution.id, use_route: 'catarse_paypal_express'
54
54
  end
55
55
 
56
- it { should redirect_to('admin_backers_path') }
56
+ it { should redirect_to('admin_contributions_path') }
57
57
  end
58
58
 
59
59
  describe "GET review" do
60
60
  before do
61
- get :review, id: backer.id, use_route: 'catarse_paypal_express'
61
+ get :review, id: contribution.id, use_route: 'catarse_paypal_express'
62
62
  end
63
63
  it{ should render_template(:review) }
64
64
  end
65
65
 
66
66
  describe "POST ipn" do
67
67
  let(:ipn_data){ {"mc_gross"=>"50.00", "protection_eligibility"=>"Eligible", "address_status"=>"unconfirmed", "payer_id"=>"S7Q8X88KMGX5S", "tax"=>"0.00", "address_street"=>"Rua Tatui, 40 ap 81\r\nJardins", "payment_date"=>"09:03:01 Nov 05, 2012 PST", "payment_status"=>"Completed", "charset"=>"windows-1252", "address_zip"=>"01409-010", "first_name"=>"Paula", "mc_fee"=>"3.30", "address_country_code"=>"BR", "address_name"=>"Paula Rizzo", "notify_version"=>"3.7", "custom"=>"", "payer_status"=>"verified", "address_country"=>"Brazil", "address_city"=>"Sao Paulo", "quantity"=>"1", "verify_sign"=>"ALBe4QrXe2sJhpq1rIN8JxSbK4RZA.Kfc5JlI9Jk4N1VQVTH5hPYOi2S", "payer_email"=>"paula.rizzo@gmail.com", "txn_id"=>"3R811766V4891372K", "payment_type"=>"instant", "last_name"=>"Rizzo", "address_state"=>"SP", "receiver_email"=>"financeiro@catarse.me", "payment_fee"=>"", "receiver_id"=>"BVUB4EVC7YCWL", "txn_type"=>"express_checkout", "item_name"=>"Back project", "mc_currency"=>"BRL", "item_number"=>"", "residence_country"=>"BR", "handling_amount"=>"0.00", "transaction_subject"=>"Back project", "payment_gross"=>"", "shipping"=>"0.00", "ipn_track_id"=>"5865649c8c27"} }
68
- let(:backer){ double(:backer, :payment_id => ipn_data['txn_id'], :payment_method => 'PayPal' ) }
68
+ let(:contribution){ double(:contribution, :payment_id => ipn_data['txn_id'], :payment_method => 'PayPal' ) }
69
69
  let(:notification) { double }
70
70
 
71
71
  before do
@@ -77,9 +77,9 @@ describe CatarsePaypalExpress::PaypalExpressController do
77
77
  params = ipn_data.merge({ use_route: 'catarse_paypal_express' })
78
78
 
79
79
  notification.stub(:acknowledge).and_return(true)
80
- backer.stub(:payment_method).and_return('MoIP')
80
+ contribution.stub(:payment_method).and_return('MoIP')
81
81
 
82
- backer.should_not_receive(:update_attributes)
82
+ contribution.should_not_receive(:update_attributes)
83
83
  controller.should_not_receive(:process_paypal_message)
84
84
 
85
85
  notification.should_receive(:acknowledge)
@@ -97,7 +97,7 @@ describe CatarsePaypalExpress::PaypalExpressController do
97
97
 
98
98
  notification.stub(:acknowledge).and_return(true)
99
99
 
100
- backer.should_receive(:update_attributes).with({
100
+ contribution.should_receive(:update_attributes).with({
101
101
  payment_service_fee: ipn_data['mc_fee'],
102
102
  payer_email: ipn_data['payer_email']
103
103
  })
@@ -123,7 +123,7 @@ describe CatarsePaypalExpress::PaypalExpressController do
123
123
 
124
124
  notification.stub(:acknowledge).and_return(false)
125
125
 
126
- backer.should_receive(:update_attributes).with({
126
+ contribution.should_receive(:update_attributes).with({
127
127
  payment_service_fee: ipn_data['mc_fee'],
128
128
  payer_email: ipn_data['payer_email']
129
129
  }).never
@@ -146,13 +146,13 @@ describe CatarsePaypalExpress::PaypalExpressController do
146
146
  describe "POST pay" do
147
147
  before do
148
148
  set_paypal_response
149
- post :pay, { id: backer.id, locale: 'en', use_route: 'catarse_paypal_express' }
149
+ post :pay, { id: contribution.id, locale: 'en', use_route: 'catarse_paypal_express' }
150
150
  end
151
151
 
152
152
 
153
153
  context 'when response raises a exception' do
154
154
  let(:set_paypal_response) do
155
- main_app.should_receive(:new_project_backer_path).with(backer.project).and_return('error url')
155
+ main_app.should_receive(:new_project_contribution_path).with(contribution.project).and_return('error url')
156
156
  gateway.should_receive(:setup_purchase).and_raise(StandardError)
157
157
  end
158
158
  it 'should assign flash error' do
@@ -168,17 +168,17 @@ describe CatarsePaypalExpress::PaypalExpressController do
168
168
  params: { 'correlation_id' => '123' }
169
169
  })
170
170
  gateway.should_receive(:setup_purchase).with(
171
- backer.price_in_cents,
171
+ contribution.price_in_cents,
172
172
  {
173
173
  ip: request.remote_ip,
174
174
  return_url: 'http://test.host/catarse_paypal_express/payment/paypal_express/1/success',
175
175
  cancel_return_url: 'http://test.host/catarse_paypal_express/payment/paypal_express/1/cancel',
176
176
  currency_code: 'BRL',
177
- description: I18n.t('paypal_description', scope: SCOPE, :project_name => backer.project.name, :value => backer.display_value),
177
+ description: I18n.t('paypal_description', scope: SCOPE, :project_name => contribution.project.name, :value => contribution.display_value),
178
178
  notify_url: 'http://test.host/catarse_paypal_express/payment/paypal_express/ipn'
179
179
  }
180
180
  ).and_return(success_response)
181
- backer.should_receive(:update_attributes).with({
181
+ contribution.should_receive(:update_attributes).with({
182
182
  payment_method: "PayPal",
183
183
  payment_token: "ABCD"
184
184
  })
@@ -190,27 +190,27 @@ describe CatarsePaypalExpress::PaypalExpressController do
190
190
 
191
191
  describe "GET cancel" do
192
192
  before do
193
- main_app.should_receive(:new_project_backer_path).with(backer.project).and_return('new backer url')
194
- get :cancel, { id: backer.id, locale: 'en', use_route: 'catarse_paypal_express' }
193
+ main_app.should_receive(:new_project_contribution_path).with(contribution.project).and_return('new contribution url')
194
+ get :cancel, { id: contribution.id, locale: 'en', use_route: 'catarse_paypal_express' }
195
195
  end
196
196
  it 'should show for user the flash message' do
197
197
  controller.flash[:failure].should == I18n.t('paypal_cancel', scope: SCOPE)
198
198
  end
199
- it{ should redirect_to 'new backer url' }
199
+ it{ should redirect_to 'new contribution url' }
200
200
  end
201
201
 
202
202
  describe "GET success" do
203
203
  let(:success_details){ double('success_details', params: {'transaction_id' => '12345', "checkout_status" => "PaymentActionCompleted"}) }
204
- let(:params){{ id: backer.id, PayerID: '123', locale: 'en', use_route: 'catarse_paypal_express' }}
204
+ let(:params){{ id: contribution.id, PayerID: '123', locale: 'en', use_route: 'catarse_paypal_express' }}
205
205
 
206
206
  before do
207
- gateway.should_receive(:purchase).with(backer.price_in_cents, {
207
+ gateway.should_receive(:purchase).with(contribution.price_in_cents, {
208
208
  ip: request.remote_ip,
209
- token: backer.payment_token,
209
+ token: contribution.payment_token,
210
210
  payer_id: params[:PayerID]
211
211
  }).and_return(success_details)
212
212
  controller.should_receive(:process_paypal_message).with(success_details.params)
213
- backer.should_receive(:update_attributes).with(payment_id: '12345')
213
+ contribution.should_receive(:update_attributes).with(payment_id: '12345')
214
214
  set_redirect_expectations
215
215
  get :success, params
216
216
  end
@@ -218,8 +218,8 @@ describe CatarsePaypalExpress::PaypalExpressController do
218
218
  context "when purchase is successful" do
219
219
  let(:set_redirect_expectations) do
220
220
  main_app.
221
- should_receive(:project_backer_path).
222
- with(project_id: backer.project.id, id: backer.id).
221
+ should_receive(:project_contribution_path).
222
+ with(project_id: contribution.project.id, id: contribution.id).
223
223
  and_return('back url')
224
224
  end
225
225
  it{ should redirect_to 'back url' }
@@ -231,12 +231,12 @@ describe CatarsePaypalExpress::PaypalExpressController do
231
231
  context 'when paypal purchase raises some error' do
232
232
  let(:set_redirect_expectations) do
233
233
  main_app.
234
- should_receive(:project_backer_path).
235
- with(project_id: backer.project.id, id: backer.id).
234
+ should_receive(:project_contribution_path).
235
+ with(project_id: contribution.project.id, id: contribution.id).
236
236
  and_raise('error')
237
237
  main_app.
238
- should_receive(:new_project_backer_path).
239
- with(backer.project).
238
+ should_receive(:new_project_contribution_path).
239
+ with(contribution.project).
240
240
  and_return('new back url')
241
241
  end
242
242
  it 'should assign flash error' do
@@ -275,23 +275,23 @@ describe CatarsePaypalExpress::PaypalExpressController do
275
275
  end
276
276
  end
277
277
 
278
- describe "#backer" do
279
- subject{ controller.backer }
278
+ describe "#contribution" do
279
+ subject{ controller.contribution }
280
280
  context "when we have an id" do
281
281
  before do
282
282
  controller.stub(:params).and_return({'id' => '1'})
283
- PaymentEngines.should_receive(:find_payment).with(id: '1').and_return(backer)
283
+ PaymentEngines.should_receive(:find_payment).with(id: '1').and_return(contribution)
284
284
  end
285
- it{ should == backer }
285
+ it{ should == contribution }
286
286
  end
287
287
 
288
- context "when we have an txn_id that does not return backer but a parent_txn_id that does" do
288
+ context "when we have an txn_id that does not return contribution but a parent_txn_id that does" do
289
289
  before do
290
290
  controller.stub(:params).and_return({'txn_id' => '1', 'parent_txn_id' => '2'})
291
291
  PaymentEngines.should_receive(:find_payment).with(payment_id: '1').and_return(nil)
292
- PaymentEngines.should_receive(:find_payment).with(payment_id: '2').and_return(backer)
292
+ PaymentEngines.should_receive(:find_payment).with(payment_id: '2').and_return(contribution)
293
293
  end
294
- it{ should == backer }
294
+ it{ should == contribution }
295
295
  end
296
296
 
297
297
  context "when we do not have any id" do
@@ -305,9 +305,9 @@ describe CatarsePaypalExpress::PaypalExpressController do
305
305
  context "when we have an txn_id" do
306
306
  before do
307
307
  controller.stub(:params).and_return({'txn_id' => '1'})
308
- PaymentEngines.should_receive(:find_payment).with(payment_id: '1').and_return(backer)
308
+ PaymentEngines.should_receive(:find_payment).with(payment_id: '1').and_return(contribution)
309
309
  end
310
- it{ should == backer }
310
+ it{ should == contribution }
311
311
  end
312
312
  end
313
313
 
@@ -316,13 +316,13 @@ describe CatarsePaypalExpress::PaypalExpressController do
316
316
  let(:data){ {'test_data' => true} }
317
317
  before do
318
318
  controller.stub(:params).and_return({'id' => 1})
319
- PaymentEngines.should_receive(:create_payment_notification).with(backer_id: backer.id, extra_data: data)
319
+ PaymentEngines.should_receive(:create_payment_notification).with(contribution_id: contribution.id, extra_data: data)
320
320
  end
321
321
 
322
322
  context "when data['checkout_status'] == 'PaymentActionCompleted'" do
323
323
  let(:data){ {'checkout_status' => 'PaymentActionCompleted'} }
324
324
  before do
325
- backer.should_receive(:confirm!)
325
+ contribution.should_receive(:confirm!)
326
326
  end
327
327
  it("should call confirm"){ subject }
328
328
  end
@@ -330,7 +330,7 @@ describe CatarsePaypalExpress::PaypalExpressController do
330
330
  context "some real data with revert op" do
331
331
  let(:data){ { "mc_gross" => "-150.00","protection_eligibility" => "Eligible","payer_id" => "4DK6S6Q75Z5YS","address_street" => "AV. SAO CARLOS, 2205 - conj 501/502 Centro","payment_date" => "09:55:14 Jun 26, 2013 PDT","payment_status" => "Refunded","charset" => "utf-8","address_zip" => "13560-900","first_name" => "Marcius","mc_fee" => "-8.70","address_country_code" => "BR","address_name" => "Marcius Milori","notify_version" => "3.7","reason_code" => "refund","custom" => "","address_country" => "Brazil","address_city" => "São Carlos","verify_sign" => "AbedXpvDaliC7hltYoQrebkEQft7A.y6bRnDvjPIIB1Mct8-aDGcHkcV","payer_email" => "milorimarcius@gmail.com","parent_txn_id" => "78T862320S496750Y","txn_id" => "9RP43514H84299332","payment_type" => "instant","last_name" => "Milori","address_state" => "São Paulo","receiver_email" => "financeiro@catarse.me","payment_fee" => "","receiver_id" => "BVUB4EVC7YCWL","item_name" => "Apoio para o projeto A Caça (La Chasse) no valor de R$ 150","mc_currency" => "BRL","item_number" => "","residence_country" => "BR","handling_amount" => "0.00","transaction_subject" => "Apoio para o projeto A Caça (La Chasse) no valor de R$ 150","payment_gross" => "","shipping" => "0.00","ipn_track_id" => "18c487e6abca4" } }
332
332
  before do
333
- backer.should_receive(:refund!)
333
+ contribution.should_receive(:refund!)
334
334
  end
335
335
  it("should call refund"){ subject }
336
336
  end
@@ -338,7 +338,7 @@ describe CatarsePaypalExpress::PaypalExpressController do
338
338
  context "when it's a refund message" do
339
339
  let(:data){ {'payment_status' => 'refunded'} }
340
340
  before do
341
- backer.should_receive(:refund!)
341
+ contribution.should_receive(:refund!)
342
342
  end
343
343
  it("should call refund"){ subject }
344
344
  end
@@ -346,7 +346,7 @@ describe CatarsePaypalExpress::PaypalExpressController do
346
346
  context "when it's a completed message" do
347
347
  let(:data){ {'payment_status' => 'Completed'} }
348
348
  before do
349
- backer.should_receive(:confirm!)
349
+ contribution.should_receive(:confirm!)
350
350
  end
351
351
  it("should call confirm"){ subject }
352
352
  end
@@ -354,7 +354,7 @@ describe CatarsePaypalExpress::PaypalExpressController do
354
354
  context "when it's a cancelation message" do
355
355
  let(:data){ {'payment_status' => 'canceled_reversal'} }
356
356
  before do
357
- backer.should_receive(:cancel!)
357
+ contribution.should_receive(:cancel!)
358
358
  end
359
359
  it("should call cancel"){ subject }
360
360
  end
@@ -362,7 +362,7 @@ describe CatarsePaypalExpress::PaypalExpressController do
362
362
  context "when it's a payment expired message" do
363
363
  let(:data){ {'payment_status' => 'expired'} }
364
364
  before do
365
- backer.should_receive(:pendent!)
365
+ contribution.should_receive(:pendent!)
366
366
  end
367
367
  it("should call pendent"){ subject }
368
368
  end
@@ -370,7 +370,7 @@ describe CatarsePaypalExpress::PaypalExpressController do
370
370
  context "all other values of payment_status" do
371
371
  let(:data){ {'payment_status' => 'other'} }
372
372
  before do
373
- backer.should_receive(:waiting!)
373
+ contribution.should_receive(:waiting!)
374
374
  end
375
375
  it("should call waiting"){ subject }
376
376
  end
metadata CHANGED
@@ -1,7 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: catarse_paypal_express
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.2
4
+ version: 2.2.0
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Antônio Roberto Silva
@@ -10,11 +11,12 @@ authors:
10
11
  autorequire:
11
12
  bindir: bin
12
13
  cert_chain: []
13
- date: 2013-12-27 00:00:00.000000000 Z
14
+ date: 2014-01-23 00:00:00.000000000 Z
14
15
  dependencies:
15
16
  - !ruby/object:Gem::Dependency
16
17
  name: rails
17
18
  requirement: !ruby/object:Gem::Requirement
19
+ none: false
18
20
  requirements:
19
21
  - - ~>
20
22
  - !ruby/object:Gem::Version
@@ -22,6 +24,7 @@ dependencies:
22
24
  type: :runtime
23
25
  prerelease: false
24
26
  version_requirements: !ruby/object:Gem::Requirement
27
+ none: false
25
28
  requirements:
26
29
  - - ~>
27
30
  - !ruby/object:Gem::Version
@@ -29,34 +32,39 @@ dependencies:
29
32
  - !ruby/object:Gem::Dependency
30
33
  name: activemerchant
31
34
  requirement: !ruby/object:Gem::Requirement
35
+ none: false
32
36
  requirements:
33
- - - '>='
37
+ - - ! '>='
34
38
  - !ruby/object:Gem::Version
35
39
  version: 1.34.0
36
40
  type: :runtime
37
41
  prerelease: false
38
42
  version_requirements: !ruby/object:Gem::Requirement
43
+ none: false
39
44
  requirements:
40
- - - '>='
45
+ - - ! '>='
41
46
  - !ruby/object:Gem::Version
42
47
  version: 1.34.0
43
48
  - !ruby/object:Gem::Dependency
44
49
  name: slim-rails
45
50
  requirement: !ruby/object:Gem::Requirement
51
+ none: false
46
52
  requirements:
47
- - - '>='
53
+ - - ! '>='
48
54
  - !ruby/object:Gem::Version
49
55
  version: '0'
50
56
  type: :runtime
51
57
  prerelease: false
52
58
  version_requirements: !ruby/object:Gem::Requirement
59
+ none: false
53
60
  requirements:
54
- - - '>='
61
+ - - ! '>='
55
62
  - !ruby/object:Gem::Version
56
63
  version: '0'
57
64
  - !ruby/object:Gem::Dependency
58
65
  name: rspec-rails
59
66
  requirement: !ruby/object:Gem::Requirement
67
+ none: false
60
68
  requirements:
61
69
  - - ~>
62
70
  - !ruby/object:Gem::Version
@@ -64,6 +72,7 @@ dependencies:
64
72
  type: :development
65
73
  prerelease: false
66
74
  version_requirements: !ruby/object:Gem::Requirement
75
+ none: false
67
76
  requirements:
68
77
  - - ~>
69
78
  - !ruby/object:Gem::Version
@@ -71,29 +80,33 @@ dependencies:
71
80
  - !ruby/object:Gem::Dependency
72
81
  name: factory_girl_rails
73
82
  requirement: !ruby/object:Gem::Requirement
83
+ none: false
74
84
  requirements:
75
- - - '>='
85
+ - - ! '>='
76
86
  - !ruby/object:Gem::Version
77
87
  version: '0'
78
88
  type: :development
79
89
  prerelease: false
80
90
  version_requirements: !ruby/object:Gem::Requirement
91
+ none: false
81
92
  requirements:
82
- - - '>='
93
+ - - ! '>='
83
94
  - !ruby/object:Gem::Version
84
95
  version: '0'
85
96
  - !ruby/object:Gem::Dependency
86
97
  name: database_cleaner
87
98
  requirement: !ruby/object:Gem::Requirement
99
+ none: false
88
100
  requirements:
89
- - - '>='
101
+ - - ! '>='
90
102
  - !ruby/object:Gem::Version
91
103
  version: '0'
92
104
  type: :development
93
105
  prerelease: false
94
106
  version_requirements: !ruby/object:Gem::Requirement
107
+ none: false
95
108
  requirements:
96
- - - '>='
109
+ - - ! '>='
97
110
  - !ruby/object:Gem::Version
98
111
  version: '0'
99
112
  description: PaypalExpress integration with Catarse crowdfunding platform
@@ -169,26 +182,27 @@ files:
169
182
  - test/dummy/script/rails
170
183
  homepage: http://github.com/catarse/catarse_paypal_express
171
184
  licenses: []
172
- metadata: {}
173
185
  post_install_message:
174
186
  rdoc_options: []
175
187
  require_paths:
176
188
  - lib
177
189
  required_ruby_version: !ruby/object:Gem::Requirement
190
+ none: false
178
191
  requirements:
179
- - - '>='
192
+ - - ! '>='
180
193
  - !ruby/object:Gem::Version
181
194
  version: '0'
182
195
  required_rubygems_version: !ruby/object:Gem::Requirement
196
+ none: false
183
197
  requirements:
184
- - - '>='
198
+ - - ! '>='
185
199
  - !ruby/object:Gem::Version
186
200
  version: '0'
187
201
  requirements: []
188
202
  rubyforge_project:
189
- rubygems_version: 2.1.10
203
+ rubygems_version: 1.8.25
190
204
  signing_key:
191
- specification_version: 4
205
+ specification_version: 3
192
206
  summary: PaypalExpress integration with Catarse
193
207
  test_files:
194
208
  - spec/controllers/catarse_paypal_express/paypal_express_controller_spec.rb
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: f323901b060ab2f8cc2234ee11d938cb20c1eccb
4
- data.tar.gz: b1e65c23abcd20e393c6bdbd95d65af8b9b0f7b5
5
- SHA512:
6
- metadata.gz: 34668b07aff98ff93c42e412b0d960ca858a481c24e0c7d30d8b128d0eaf1ba1f18610987780fcab2307ccb9d8faf1753873b2a7e61290f36ce2f4a5853af3d1
7
- data.tar.gz: ef20fa639114faa6c3cecdc5e515f0e71522afaf82a5398afcab07f58c24973c0d69b9760eba3b5cf977cd81fedfefbd3f4a5bd3fd748eb6feef22141ae71d44