pay 3.0.13 → 3.0.14

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of pay might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6f7c93c9c0a537a5afd2174c46197296cec0d6f89fecc726640406d7f1c97469
4
- data.tar.gz: b8c026b26f70a85c56adcbc680c1bfec034a1c9e036d22ebf4e939e1be7c0328
3
+ metadata.gz: 775a299c417f1325003083f1a919358c46169daa859454e987adbb7eeab1393e
4
+ data.tar.gz: 7315d0e4ea8905ceb3f90b4edc3882f122934423f1a3d591e930a0c3f7c68195
5
5
  SHA512:
6
- metadata.gz: d3279bf171188b4e9ed298e6aa75cf7419620410cafe396b356c48f19e8d4761ffbf6886a1069625329b2483d957ca7cf88bcaf63d1f217b8f011784c24cf352
7
- data.tar.gz: c7da5e0cd1b194b5f126c5b22f67064847ba59f5a396f8e592f7f8329075ecff0624278f64ae0c1a0d65c394fb7ba425aba418b5679c1cad0e81282045b2992e
6
+ metadata.gz: 336cba7171af162ec7f7bc3251bda72f94c4ae36bd5795cb7b0f0930da13de06a0d8f1cf0746d22199de513cbc59d753f70b704748dc2d531e581b5f5b697f00
7
+ data.tar.gz: 5e21ad2c19091786ec6d8fb35a261b644dc6142d3452fdec2681543824e3f81fbe45c37f7f15463565036801a3f3253c4ce2e589920d11df05b596f32b12ad8e
@@ -72,11 +72,11 @@ module Pay
72
72
  end
73
73
 
74
74
  def amount_with_currency
75
- Pay::Currency.format(amount.to_i, currency: currency)
75
+ Pay::Currency.format(amount, currency: currency)
76
76
  end
77
77
 
78
78
  def amount_refunded_with_currency
79
- Pay::Currency.format(amount_refunded.to_i, currency: currency)
79
+ Pay::Currency.format(amount_refunded, currency: currency)
80
80
  end
81
81
 
82
82
  def charged_to
data/lib/pay/currency.rb CHANGED
@@ -23,7 +23,7 @@ module Pay
23
23
 
24
24
  def format_amount(amount, **options)
25
25
  number_to_currency(
26
- amount / subunit_to_unit.to_f,
26
+ amount.to_i / subunit_to_unit.to_f,
27
27
  {
28
28
  precision: precision,
29
29
  unit: unit,
data/lib/pay/payment.rb CHANGED
@@ -2,7 +2,7 @@ module Pay
2
2
  class Payment
3
3
  attr_reader :intent
4
4
 
5
- delegate :id, :amount, :client_secret, :customer, :status, :confirm, to: :intent
5
+ delegate :id, :amount, :client_secret, :currency, :customer, :status, :confirm, to: :intent
6
6
 
7
7
  def self.from_id(id)
8
8
  intent = id.start_with?("seti_") ? ::Stripe::SetupIntent.retrieve(id) : ::Stripe::PaymentIntent.retrieve(id)
@@ -41,6 +41,10 @@ module Pay
41
41
  intent.is_a?(::Stripe::SetupIntent)
42
42
  end
43
43
 
44
+ def amount_with_currency
45
+ Pay::Currency.format(amount, currency: currency)
46
+ end
47
+
44
48
  def validate
45
49
  if requires_payment_method?
46
50
  raise Pay::InvalidPaymentMethod.new(self)
data/lib/pay/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Pay
2
- VERSION = "3.0.13"
2
+ VERSION = "3.0.14"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pay
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.13
4
+ version: 3.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Charnes