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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fc336f11aa6bdd63887622dd48fbec5a3f52b440b41a73d63478a0239d4c787a
4
- data.tar.gz: 31e98a7bbe5a0c9ba92201964aab99b3a3743cc42f15eac275f6032a9f52293f
3
+ metadata.gz: 3f565cd95a7795ae5d3666bed4b3d324329180147fef4c686f60b63d3ff202f0
4
+ data.tar.gz: 90a369059fcf3e20e02d0c9898c8d6e7907602572581d6a37d1573708375f31a
5
5
  SHA512:
6
- metadata.gz: 194be2c0276670440ff121b00048eedba5f91f1a85b53be9bd0145f5147f78d14ab739e57ae90590f6a751c5b3f2013e139650201bfe2b19d455b28c40c896dc
7
- data.tar.gz: 9cc1c6d63c0360ccd54b2ee0143b933b292279016618e7e3130b97c150c64350756d7663682f1235f86d7a4983c971def19a7fef13d8148124040b1fccf39c63
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 #{class_name} with ID = #{id}"
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
- result = gateway.customer.create(email: email, first_name: try(:first_name), last_name: try(:last_name), payment_method_nonce: payment_method_token)
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,
@@ -19,6 +19,10 @@ module Pay
19
19
  pay_customer
20
20
  end
21
21
 
22
+ def update_customer!
23
+ # pass
24
+ end
25
+
22
26
  def charge(amount, options = {})
23
27
  # Make to generate a processor_id
24
28
  customer
@@ -18,6 +18,10 @@ module Pay
18
18
  # pass
19
19
  end
20
20
 
21
+ def update_customer!
22
+ # pass
23
+ end
24
+
21
25
  def charge(amount, options = {})
22
26
  subscription = pay_customer.subscription
23
27
  return unless subscription.processor_id
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Pay
2
- VERSION = "3.0.20"
2
+ VERSION = "3.0.21"
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.20
4
+ version: 3.0.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Charnes