od-payments 0.1.0 → 0.1.5

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 784fc7fa0cb56d8e29ce155e9944b6a53bda3b78c914193e2b0fb1265518aeda
4
- data.tar.gz: 8d20dd3433c2386f29ee326eea35c041743417210b0d17b26e604a4f20b92fbe
3
+ metadata.gz: 2c97a2fc529188e87cc41af4be4f41547f0f66584774aad0e01eac9485300804
4
+ data.tar.gz: '0879c121643700cda7bbf423ad66e843075da715eac21867188c80ae58425cbc'
5
5
  SHA512:
6
- metadata.gz: '092ad61edd7dc5dc0f627d757c0ac3f67da8fd48cd68934caba96618fb3021062ea84deab33cc85c4fb220c772754ec39cb6e83dbcce0f4077e2bce7c1589ff7'
7
- data.tar.gz: baccd488c9e6aecd5e7dcce531e45f7ad6c0b022514a878ccd38026d6b745ef2cee5e5aeac9bb2db1fbef0ca4e9a867d58660b3548dba739deaadd2514395a10
6
+ metadata.gz: 72ec12809a1b1bc60e3e3a6b9655aa5d86226a6229652b4e76bfedbd3f13055805bc81158b70a99cce877bf992cfca91e729360cb4453fd3bae323d1305cfcae
7
+ data.tar.gz: a98cd3d3f11ebcd69e8d20a7c93055e749bf5379752264d6d3e8fafefcc376fa8b1b98d4e1d39df0d84bdd9b152baca00734a3db6a5c4726de1c20b005b2d623
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- od-payments (0.1.0)
4
+ od-payments (0.1.5)
5
5
  stripe (~> 5.22.0)
6
6
 
7
7
  GEM
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Od
2
2
  module Payments
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.5"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: od-payments
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Onward Web Development