moneytree-rails 0.1.10 → 0.1.11
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 +4 -4
- data/lib/moneytree/payment_provider/stripe.rb +4 -3
- data/lib/moneytree/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0a606a849682a4f6127da7dfbb4a9d0606f315c819207653084088a3b230c179
|
4
|
+
data.tar.gz: d682ed115c7159fbbb81276b63b5e9d94b8e43032a201cb088bb2cf1e8b495a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b9e27ae3746b2d400e3810ff71717e676d546aed60235fc3a1f0b0f81cce6b9fcaf70b5b3ccf0bdceb3f0b3070bfba018363a8b163ec2db311b687c4e259ed7
|
7
|
+
data.tar.gz: 9cd9a4892e98f7e6d4acad9fa9a026dda236215c3830576d3cd1ee3b779dfc4377c82226e333de0833272c962f39e8914b3aaa9f3789ce21945f5751d5e98a81
|
@@ -26,7 +26,7 @@ module Moneytree
|
|
26
26
|
PERMISSION.to_s
|
27
27
|
end
|
28
28
|
|
29
|
-
def charge(amount, details, app_fee_amount: 0, description: "Charge for #{account.name}"
|
29
|
+
def charge(amount, details, metadata:, app_fee_amount: 0, description: "Charge for #{account.name}")
|
30
30
|
# `source` is obtained with Stripe.js; see https://stripe.com/docs/payments/accept-a-payment-charges#web-create-token
|
31
31
|
response = ::Stripe::Charge.create(
|
32
32
|
{
|
@@ -45,7 +45,8 @@ module Moneytree
|
|
45
45
|
response[:failure_message],
|
46
46
|
{
|
47
47
|
charge_id: response[:id],
|
48
|
-
card: response[:payment_method_details][:card]
|
48
|
+
card: response[:payment_method_details][:card],
|
49
|
+
has_application_fee: !app_fee_amount.zero?
|
49
50
|
}
|
50
51
|
)
|
51
52
|
rescue ::Stripe::StripeError => e
|
@@ -58,7 +59,7 @@ module Moneytree
|
|
58
59
|
charge: details[:charge_id],
|
59
60
|
amount: (-amount * 100).to_i,
|
60
61
|
metadata: metadata,
|
61
|
-
refund_application_fee: Moneytree.refund_application_fee
|
62
|
+
refund_application_fee: details[:has_application_fee] && Moneytree.refund_application_fee
|
62
63
|
},
|
63
64
|
stripe_account: payment_gateway.psp_credentials[:stripe_user_id]
|
64
65
|
)
|
data/lib/moneytree/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: moneytree-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kieran Klaassen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-12-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|