pay 3.0.20 → 3.0.21
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 +4 -4
- data/app/jobs/pay/customer_sync_job.rb +1 -1
- data/lib/pay/braintree/billable.rb +9 -1
- data/lib/pay/fake_processor/billable.rb +4 -0
- data/lib/pay/paddle/billable.rb +4 -0
- data/lib/pay/stripe/billable.rb +6 -0
- data/lib/pay/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: 3f565cd95a7795ae5d3666bed4b3d324329180147fef4c686f60b63d3ff202f0
|
4
|
+
data.tar.gz: 90a369059fcf3e20e02d0c9898c8d6e7907602572581d6a37d1573708375f31a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d0cb9a5e808faeaf61bf4c07862ecca4cfb059f3f00c783e9a7012a38dba101ac4118370f522de3151cc48252f932bd2a75c2a62ed1193ada6b1e3724525c00
|
7
|
+
data.tar.gz: 8269a1307c8bc25d4782e1827cb2b5cab1d4a210a8ae48935c74b3b82e967076d97445260c078ab450502ced88a24948f08c0da93596ca90c7986036cb02aa7d
|
@@ -5,7 +5,7 @@ module Pay
|
|
5
5
|
def perform(pay_customer_id)
|
6
6
|
Pay::Customer.find(pay_customer_id).update_customer!
|
7
7
|
rescue ActiveRecord::RecordNotFound
|
8
|
-
Rails.logger.info "Couldn't find a
|
8
|
+
Rails.logger.info "Couldn't find a Pay::Customer with ID = #{id}"
|
9
9
|
end
|
10
10
|
end
|
11
11
|
end
|
@@ -30,7 +30,8 @@ module Pay
|
|
30
30
|
|
31
31
|
customer
|
32
32
|
else
|
33
|
-
|
33
|
+
first_name, last_name = customer_name.split(" ", 2)
|
34
|
+
result = gateway.customer.create(email: email, first_name: first_name, last_name: last_name, payment_method_nonce: payment_method_token)
|
34
35
|
raise Pay::Braintree::Error, result unless result.success?
|
35
36
|
pay_customer.update!(processor_id: result.customer.id)
|
36
37
|
|
@@ -47,6 +48,13 @@ module Pay
|
|
47
48
|
raise Pay::Braintree::Error, e
|
48
49
|
end
|
49
50
|
|
51
|
+
# Syncs name and email to Braintree::Customer
|
52
|
+
def update_customer!
|
53
|
+
return unless processor_id?
|
54
|
+
first_name, last_name = customer_name.split(" ", 2)
|
55
|
+
gateway.customer.update(processor_id, first_name: first_name, last_name: last_name, email: email)
|
56
|
+
end
|
57
|
+
|
50
58
|
def charge(amount, options = {})
|
51
59
|
args = {
|
52
60
|
amount: amount.to_i / 100.0,
|
data/lib/pay/paddle/billable.rb
CHANGED
data/lib/pay/stripe/billable.rb
CHANGED
@@ -44,6 +44,12 @@ module Pay
|
|
44
44
|
raise Pay::Stripe::Error, e
|
45
45
|
end
|
46
46
|
|
47
|
+
# Syncs name and email to Stripe::Customer
|
48
|
+
def update_customer!
|
49
|
+
return unless processor_id?
|
50
|
+
::Stripe::Customer.update(processor_id, {name: customer_name, email: email}, stripe_options)
|
51
|
+
end
|
52
|
+
|
47
53
|
def charge(amount, options = {})
|
48
54
|
add_payment_method(payment_method_token, default: true) if payment_method_token?
|
49
55
|
|
data/lib/pay/version.rb
CHANGED