active_payment 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/active_payment/gateways/paypal_adaptive_payment.rb +1 -1
- data/lib/active_payment/gateways/paypal_express_checkout.rb +3 -3
- data/lib/active_payment/version.rb +1 -1
- data/lib/active_payment.rb +9 -1
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/test.log +4928 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0896a5bea7ca3f4ad64160c9a83d71c97da93f43
|
4
|
+
data.tar.gz: 4a1d6ce9a6d12ec602c220a1a28bfc98e5452a5c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9c87745a4e4ecdb7a1f42fa4968187e93366b680c55dd5da35b3ccfe9ac131949aedd4b8a647d5c78d249f2d1ae3a8e9d8fe3a41a8f16ab90f00c9cf373a872
|
7
|
+
data.tar.gz: c9342816bd91964f00a9c11b11c2e2b9208fbafe9e98ba597e760562c6794341282e75813977919fc07f057aa156c3cd9bbe09b4209228a21911506ede22422a
|
@@ -17,7 +17,7 @@ module ActivePayment
|
|
17
17
|
@sales = sales
|
18
18
|
|
19
19
|
response = @gateway.setup_purchase(purchase_data(sales))
|
20
|
-
raise ActivePayment::InvalidGatewayResponseError unless response.success?
|
20
|
+
raise ActivePayment::InvalidGatewayResponseError.new(response) unless response.success?
|
21
21
|
|
22
22
|
@purchase_token = response['payKey']
|
23
23
|
@gateway.set_payment_options(payment_options_data(@purchase_token, @sales))
|
@@ -20,7 +20,7 @@ module ActivePayment
|
|
20
20
|
amount = @sales.amount_in_cents.to_i
|
21
21
|
|
22
22
|
response = @gateway.setup_purchase(amount, paypal_data(payables))
|
23
|
-
raise ActivePayment::InvalidGatewayResponseError unless response.success?
|
23
|
+
raise ActivePayment::InvalidGatewayResponseError.new(response) unless response.success?
|
24
24
|
|
25
25
|
@purchase_token = response.token
|
26
26
|
@gateway.redirect_url_for(response.token)
|
@@ -32,11 +32,11 @@ module ActivePayment
|
|
32
32
|
|
33
33
|
begin
|
34
34
|
response = @gateway.details_for(token)
|
35
|
-
fail ActivePayment::InvalidGatewayResponseError unless response.success?
|
35
|
+
fail ActivePayment::InvalidGatewayResponseError.new(response) unless response.success?
|
36
36
|
|
37
37
|
amount = params[:amount]
|
38
38
|
purchase_response = @gateway.purchase(amount, params.merge(payer_id: response.payer_id))
|
39
|
-
fail ActivePayment::InvalidGatewayResponseError unless purchase_response.success?
|
39
|
+
fail ActivePayment::InvalidGatewayResponseError.new(purchase_response) unless purchase_response.success?
|
40
40
|
rescue ActivePayment::InvalidGatewayResponseError
|
41
41
|
return false
|
42
42
|
end
|
data/lib/active_payment.rb
CHANGED
@@ -18,7 +18,15 @@ require 'active_payment/models/payable'
|
|
18
18
|
module ActivePayment
|
19
19
|
attr_accessor :configuration
|
20
20
|
|
21
|
-
class
|
21
|
+
class StandardResponseError < StandardError
|
22
|
+
attr_accessor :response
|
23
|
+
|
24
|
+
def initialize(response = nil)
|
25
|
+
@response = response
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
class InvalidGatewayResponseError < StandardResponseError; end
|
22
30
|
class InvalidAmountError < StandardError; end
|
23
31
|
class InvalidItemsError < StandardError; end
|
24
32
|
class InvalidGatewayUserError < StandardError; end
|
data/spec/dummy/db/test.sqlite3
CHANGED
Binary file
|