od-payments 0.1.0 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/od/payments/resources/charge.rb +12 -1
- data/lib/od/payments/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2c97a2fc529188e87cc41af4be4f41547f0f66584774aad0e01eac9485300804
|
4
|
+
data.tar.gz: '0879c121643700cda7bbf423ad66e843075da715eac21867188c80ae58425cbc'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72ec12809a1b1bc60e3e3a6b9655aa5d86226a6229652b4e76bfedbd3f13055805bc81158b70a99cce877bf992cfca91e729360cb4453fd3bae323d1305cfcae
|
7
|
+
data.tar.gz: a98cd3d3f11ebcd69e8d20a7c93055e749bf5379752264d6d3e8fafefcc376fa8b1b98d4e1d39df0d84bdd9b152baca00734a3db6a5c4726de1c20b005b2d623
|
data/Gemfile.lock
CHANGED
@@ -5,7 +5,7 @@ module Od
|
|
5
5
|
case Od::Payments.adapter
|
6
6
|
when :stripe
|
7
7
|
Stripe::PaymentIntent.create({
|
8
|
-
amount: amount,
|
8
|
+
amount: (amount * 100).to_i,
|
9
9
|
currency: 'usd',
|
10
10
|
customer: option[:customer_id],
|
11
11
|
payment_method: option[:token_payment],
|
@@ -61,6 +61,17 @@ module Od
|
|
61
61
|
raise Od::Payments::OdPaymentsError, e.error.message
|
62
62
|
end
|
63
63
|
|
64
|
+
def self.show(payment_intent_id)
|
65
|
+
case Od::Payments.adapter
|
66
|
+
when :stripe
|
67
|
+
Stripe::PaymentIntent.retrieve payment_intent_id
|
68
|
+
end
|
69
|
+
rescue Stripe::CardError => e
|
70
|
+
raise Od::Payments::CardError.new(e.error.message, {})
|
71
|
+
rescue Stripe::StripeError => e
|
72
|
+
raise Od::Payments::OdPaymentsError, e.error.message
|
73
|
+
end
|
74
|
+
|
64
75
|
def self.confirm(payment_intent_id, payment_method_id)
|
65
76
|
case Od::Payments.adapter
|
66
77
|
when :stripe
|
data/lib/od/payments/version.rb
CHANGED