stbaldricks 4.4.2 → 4.5.0.alpha.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/stbaldricks/endpoints/lib/entity.rb +0 -0
- data/lib/stbaldricks/endpoints/user.rb +4 -2
- data/lib/stbaldricks/entities/donation/payment_gateway.rb +14 -0
- data/lib/stbaldricks/entities/lib/payment.rb +13 -4
- data/lib/stbaldricks/version.rb +1 -1
- metadata +6 -7
- data/lib/stbaldricks/endpoints/facebook/user.rb +0 -37
- data/lib/stbaldricks/entities/facebook/user.rb +0 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6d8205ff505775ac1db42b429e6406f8f262dd62a5d25e22d622ac81e76518ba
|
4
|
+
data.tar.gz: 2fb089caaffb89e3412cc11ecdf4a0347e2693c26f39b8c0139395e6c63e6798
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4fc7b70f613646f4963b135968d1d2c602d5483ba3123d8091ded002c46a0d2ce511afa5183190d07e3d2883265fc3d4387ce1428a29e2bc33fe789dda31b60b
|
7
|
+
data.tar.gz: 578429336a5f4649c54dd848fba571def90989d61bce5e9690d592c307b9b022b8415884bdfd722380688f9ac9eea7987fd623bc6e7c434bf62a4a6352e99745
|
File without changes
|
@@ -67,11 +67,13 @@ module SBF
|
|
67
67
|
password: password
|
68
68
|
)
|
69
69
|
|
70
|
-
|
70
|
+
if ok?(response)
|
71
|
+
SBF::Client::Configuration.user_token = nil
|
72
|
+
else
|
73
|
+
SBF::Client::Configuration.user_token = nil
|
71
74
|
parsed_response = JSON.parse(response.body).symbolize!
|
72
75
|
error = SBF::Client::ErrorEntity.new(parsed_response)
|
73
76
|
end
|
74
|
-
SBF::Client::Configuration.user_token = nil
|
75
77
|
|
76
78
|
SBF::Client::LOG.info { "SB::Client - Change Password for user with profile_id: #{profile_id}" }
|
77
79
|
SBF::Client::Api::Response.new(http_code: response.code, data: nil, error: error)
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'stbaldricks/entities/lib/top_level'
|
2
|
+
|
3
|
+
module SBF
|
4
|
+
module Client
|
5
|
+
class Donation < SBF::Client::TopLevelEntity
|
6
|
+
module PaymentGateway
|
7
|
+
NONE = 'none'
|
8
|
+
UNKNOWN = 'unknown'
|
9
|
+
BRAINTREE = 'braintree'
|
10
|
+
PAYMENTSPRING = 'paymentspring'
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -16,6 +16,13 @@ module SBF
|
|
16
16
|
PAYPAL = 'paypal'
|
17
17
|
end
|
18
18
|
|
19
|
+
module Gateway
|
20
|
+
NONE = 'none'
|
21
|
+
UNKNOWN = 'unknown'
|
22
|
+
BRAINTREE = 'braintree'
|
23
|
+
PAYMENTSPRING = 'paymentspring'
|
24
|
+
end
|
25
|
+
|
19
26
|
class Details < SBF::Client::BaseEntity
|
20
27
|
include TypeConcern
|
21
28
|
attr_reader :type
|
@@ -26,7 +33,7 @@ module SBF
|
|
26
33
|
end
|
27
34
|
|
28
35
|
class CreditCardDetails < SBF::Client::Payment::Details
|
29
|
-
attr_accessor :authorization_id, :cardholder_name, :card_type, :expiration_date, :card_number
|
36
|
+
attr_accessor :gateway, :authorization_id, :cardholder_name, :card_type, :expiration_date, :card_number
|
30
37
|
|
31
38
|
def type
|
32
39
|
SBF::Client::Payment::Type::CREDIT_CARD
|
@@ -34,7 +41,7 @@ module SBF
|
|
34
41
|
end
|
35
42
|
|
36
43
|
class BraintreeSubscriptionDetails < SBF::Client::Payment::Details
|
37
|
-
attr_accessor :subscription_id, :customer_id, :cardholder_name, :card_type, :expiration_date, :card_number
|
44
|
+
attr_accessor :gateway, :subscription_id, :customer_id, :cardholder_name, :card_type, :expiration_date, :card_number
|
38
45
|
|
39
46
|
def type
|
40
47
|
SBF::Client::Payment::Type::RECURRING_GIFTS
|
@@ -42,7 +49,7 @@ module SBF
|
|
42
49
|
end
|
43
50
|
|
44
51
|
class CheckDetails < SBF::Client::Payment::Details
|
45
|
-
attr_accessor :number
|
52
|
+
attr_accessor :gateway, :number
|
46
53
|
|
47
54
|
def type
|
48
55
|
SBF::Client::Payment::Type::CHECK
|
@@ -78,7 +85,7 @@ module SBF
|
|
78
85
|
end
|
79
86
|
|
80
87
|
class NonceDetails < SBF::Client::Payment::Details
|
81
|
-
attr_accessor :nonce, :device_data
|
88
|
+
attr_accessor :gateway, :nonce, :device_data
|
82
89
|
|
83
90
|
def type
|
84
91
|
SBF::Client::Payment::Type::NONCE
|
@@ -86,6 +93,8 @@ module SBF
|
|
86
93
|
end
|
87
94
|
|
88
95
|
class PaypalDetails < SBF::Client::Payment::Details
|
96
|
+
attr_accessor :gateway
|
97
|
+
|
89
98
|
def type
|
90
99
|
SBF::Client::Payment::Type::PAYPAL
|
91
100
|
end
|
data/lib/stbaldricks/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stbaldricks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.5.0.alpha.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Firespring
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-02-
|
11
|
+
date: 2018-02-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -85,7 +85,6 @@ files:
|
|
85
85
|
- lib/stbaldricks/endpoints/contact.rb
|
86
86
|
- lib/stbaldricks/endpoints/event.rb
|
87
87
|
- lib/stbaldricks/endpoints/event_application.rb
|
88
|
-
- lib/stbaldricks/endpoints/facebook/user.rb
|
89
88
|
- lib/stbaldricks/endpoints/fund.rb
|
90
89
|
- lib/stbaldricks/endpoints/kid.rb
|
91
90
|
- lib/stbaldricks/endpoints/kid_honor.rb
|
@@ -119,6 +118,7 @@ files:
|
|
119
118
|
- lib/stbaldricks/entities/donation.rb
|
120
119
|
- lib/stbaldricks/entities/donation/donor_type.rb
|
121
120
|
- lib/stbaldricks/entities/donation/how_created.rb
|
121
|
+
- lib/stbaldricks/entities/donation/payment_gateway.rb
|
122
122
|
- lib/stbaldricks/entities/donation/payment_type.rb
|
123
123
|
- lib/stbaldricks/entities/donation/promo_code.rb
|
124
124
|
- lib/stbaldricks/entities/donation/recipient_type.rb
|
@@ -139,7 +139,6 @@ files:
|
|
139
139
|
- lib/stbaldricks/entities/event_donation_summary.rb
|
140
140
|
- lib/stbaldricks/entities/event_participant_summary.rb
|
141
141
|
- lib/stbaldricks/entities/event_supporter.rb
|
142
|
-
- lib/stbaldricks/entities/facebook/user.rb
|
143
142
|
- lib/stbaldricks/entities/fund.rb
|
144
143
|
- lib/stbaldricks/entities/fundraiser.rb
|
145
144
|
- lib/stbaldricks/entities/grant.rb
|
@@ -218,12 +217,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
218
217
|
version: '0'
|
219
218
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
220
219
|
requirements:
|
221
|
-
- - "
|
220
|
+
- - ">"
|
222
221
|
- !ruby/object:Gem::Version
|
223
|
-
version:
|
222
|
+
version: 1.3.1
|
224
223
|
requirements: []
|
225
224
|
rubyforge_project:
|
226
|
-
rubygems_version: 2.7.
|
225
|
+
rubygems_version: 2.7.5
|
227
226
|
signing_key:
|
228
227
|
specification_version: 4
|
229
228
|
summary: St. Baldrick's Foundation Ruby Client Library
|
@@ -1,37 +0,0 @@
|
|
1
|
-
require 'stbaldricks/endpoints/user'
|
2
|
-
|
3
|
-
module SBF
|
4
|
-
module Client
|
5
|
-
module Facebook
|
6
|
-
class UserEndpoint < SBF::Client::UserEndpoint
|
7
|
-
# Logs in a user, using a Facebook Oauth authorization code & redirect uri.
|
8
|
-
# Configures the client library to use user credentials for subsequent requests.
|
9
|
-
# Returns the SBF access token for the user that should be held onto to configure the client library in
|
10
|
-
# future requests that are outside of this scope.
|
11
|
-
#
|
12
|
-
# @param authorization_code [string]
|
13
|
-
# @param redirect_uri [string]
|
14
|
-
# @return [string]
|
15
|
-
def login!(authorization_code, redirect_uri)
|
16
|
-
response = SBF::Client::Api::Request.post_request(
|
17
|
-
"/#{SBF::Client::Api::VERSION}/security/facebook/login",
|
18
|
-
authorization_code: authorization_code,
|
19
|
-
redirect_uri: redirect_uri
|
20
|
-
)
|
21
|
-
parsed_response = JSON.parse(response.body).symbolize!
|
22
|
-
|
23
|
-
if ok?(response)
|
24
|
-
SBF::Client::Configuration.user_token = parsed_response[:token]
|
25
|
-
data = parsed_response.merge(user: target_class.new(parsed_response[:user]))
|
26
|
-
SBF::Client::LOG.info { "SBF::Client - Facebook User Login with Identifier: #{parsed_response[:user][:identifier]}" }
|
27
|
-
else
|
28
|
-
SBF::Client::Configuration.user_token = nil
|
29
|
-
error = SBF::Client::ErrorEntity.new(parsed_response)
|
30
|
-
end
|
31
|
-
|
32
|
-
SBF::Client::Api::Response.new(http_code: response.code, data: data, error: error)
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|