tessitura_rest 1.2.7 → 1.2.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +2 -2
- data/bin/console +3 -3
- data/lib/tessitura_rest/custom/email.rb +2 -2
- data/lib/tessitura_rest/payment_gateway/payment_component.rb +12 -0
- data/lib/tessitura_rest/payment_gateway/payment_gateway.rb +28 -0
- data/lib/tessitura_rest/txn/payments.rb +11 -2
- data/lib/tessitura_rest/version.rb +1 -1
- data/lib/tessitura_rest/web/cart.rb +18 -1
- data/lib/tessitura_rest.rb +3 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1901164dcd7995a8ba886876dc5b7fa980735d1bd2905086eb2c4df41eabb80d
|
4
|
+
data.tar.gz: 8864e13f29025d57be84ccb3591e7c01e93fba6d6e70f4e4b8a17ac9e6d11455
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 49f93e54b7c81a31c2a2ad5bab97f30ebf2568cb8f2d84ead203f7a7fa8148cc6098131e729d418dfc82f6d10c0251bfc4fff51053caa24a2e51a3431de06925
|
7
|
+
data.tar.gz: 51fab65616d9ae1066eb23fa6e91acf51a67f574620f729d8738bfd7dc20b97714fa58e7f860aad2d5f479a686a929a2632aad12522c0072ba09f8cec41349c4
|
data/Rakefile
CHANGED
data/bin/console
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
3
|
+
require 'bundler/setup'
|
4
|
+
require 'tessitura'
|
5
5
|
|
6
6
|
# You can add fixtures and/or initialization code here to make experimenting
|
7
7
|
# with your gem easier. You can also use a different console, if you like.
|
@@ -10,5 +10,5 @@ require "tessitura"
|
|
10
10
|
# require "pry"
|
11
11
|
# Pry.start
|
12
12
|
|
13
|
-
require
|
13
|
+
require 'irb'
|
14
14
|
IRB.start
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module Email
|
2
|
-
def send_login_credentials(template_id, email, profile_id,
|
2
|
+
def send_login_credentials(template_id, email, profile_id, _params = '', options = {})
|
3
3
|
login_id = get_web_login(email, 1)
|
4
4
|
return false if login_id.empty?
|
5
5
|
|
@@ -15,7 +15,7 @@ module Email
|
|
15
15
|
post.success?
|
16
16
|
end
|
17
17
|
|
18
|
-
def send_order_confirmation(template_id, email, profile_id, order_id,
|
18
|
+
def send_order_confirmation(template_id, email, profile_id, order_id, _params = '', options = {})
|
19
19
|
parameters =
|
20
20
|
{
|
21
21
|
'TemplateId': template_id,
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module PaymentComponent
|
2
|
+
def fetch_payment_component(amount, constituent = 0, options = {})
|
3
|
+
parameters =
|
4
|
+
{
|
5
|
+
'Amount': amount,
|
6
|
+
'ConstituentId': constituent,
|
7
|
+
}
|
8
|
+
options.merge!(basic_auth: @auth, headers: @headers)
|
9
|
+
options.merge!(:body => parameters)
|
10
|
+
self.class.post(base_api_endpoint('PaymentGateway/PaymentComponent'), options)
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module PaymentGateway
|
2
|
+
def authorize_payment(amount, payload, payment_id, return_url, options = {})
|
3
|
+
parameters = {
|
4
|
+
'Amount': amount,
|
5
|
+
'Card': {
|
6
|
+
'TessituraMerchantServicesData': payload,
|
7
|
+
},
|
8
|
+
'PaymentId': payment_id,
|
9
|
+
'ConstituentId': 0, # TODO
|
10
|
+
'TransactionOrigin': 'webapi',
|
11
|
+
'PaymentMethodId': 606,
|
12
|
+
'ReturnUrl': return_url,
|
13
|
+
}
|
14
|
+
options.merge!(basic_auth: @auth, headers: @headers)
|
15
|
+
options.merge!(:body => parameters)
|
16
|
+
self.class.post(base_api_endpoint('PaymentGateway/Authorization/Authorize'), options)
|
17
|
+
end
|
18
|
+
|
19
|
+
def finalize_payment(payload, payment_id, options = {})
|
20
|
+
parameters = {
|
21
|
+
'PaymentId': payment_id,
|
22
|
+
'RedirectResult': payload,
|
23
|
+
}
|
24
|
+
options.merge!(basic_auth: @auth, headers: @headers)
|
25
|
+
options.merge!(:body => parameters)
|
26
|
+
self.class.post(base_api_endpoint('PaymentGateway/Authorization/Finalize'), options)
|
27
|
+
end
|
28
|
+
end
|
@@ -1,7 +1,16 @@
|
|
1
1
|
module Payments
|
2
|
-
def get_on_account_balance(
|
2
|
+
def get_on_account_balance(_current_user, _payment_method_id, options = {})
|
3
3
|
options.merge!(basic_auth: @auth, headers: @headers)
|
4
|
-
response = self.class.get(base_api_endpoint("TXN/Payments/OnAccount?constituentId=#{
|
4
|
+
response = self.class.get(base_api_endpoint("TXN/Payments/OnAccount?constituentId=#{_current_user}&paymentMethodId=#{_payment_method_id}"), options)
|
5
5
|
JSON.parse(response.body)
|
6
6
|
end
|
7
|
+
|
8
|
+
def reserve_payment_id(options = {})
|
9
|
+
parameters = {
|
10
|
+
'Increment': 1,
|
11
|
+
}
|
12
|
+
options.merge!(basic_auth: @auth, headers: @headers)
|
13
|
+
options.merge!(:body => parameters)
|
14
|
+
self.class.post(base_api_endpoint('TXN/Payments/ReserveIds'), options)
|
15
|
+
end
|
7
16
|
end
|
@@ -297,7 +297,24 @@ module Cart
|
|
297
297
|
self.class.post(base_api_endpoint("Web/Cart/#{session_key}/Checkout"), options)
|
298
298
|
end
|
299
299
|
|
300
|
-
def
|
300
|
+
def checkout_with_tms(session_key, order_authorization_code, order_amount, allow_under_payment, payment_method_id, payment_reference, options = {})
|
301
|
+
parameters =
|
302
|
+
{
|
303
|
+
'CreditCardType': payment_method_id,
|
304
|
+
'Amount': order_amount,
|
305
|
+
'AllowUnderPayment': allow_under_payment,
|
306
|
+
'Authorize': false,
|
307
|
+
'ECommerce': true,
|
308
|
+
'AuthorizationCode': order_authorization_code,
|
309
|
+
'PaymentReference': payment_reference,
|
310
|
+
}
|
311
|
+
options.merge!(basic_auth: @auth, headers: @headers)
|
312
|
+
options.merge!(:body => parameters.to_json, :headers => { 'Content-Type' => 'application/json' })
|
313
|
+
self.class.post(base_api_endpoint("Web/Cart/#{session_key}/Checkout"), options)
|
314
|
+
end
|
315
|
+
|
316
|
+
def checkout_with_zip(session_key, name_on_card, credit_card_number, cvv_number, credit_card_type, expiration_month, expiration_year, zip_code, is_order_authorized, order_authorization_code, order_amount, allow_under_payment,
|
317
|
+
options = {})
|
301
318
|
parameters =
|
302
319
|
{
|
303
320
|
'CreditCardOwner': name_on_card,
|
data/lib/tessitura_rest.rb
CHANGED
@@ -24,6 +24,8 @@ class TessituraRest
|
|
24
24
|
include Orders
|
25
25
|
include Package
|
26
26
|
include Payments
|
27
|
+
include PaymentComponent
|
28
|
+
include PaymentGateway
|
27
29
|
include PaymentPlanExtension
|
28
30
|
include PerformanceExtension
|
29
31
|
include PerformancePackageModeOfSales
|
@@ -41,7 +43,7 @@ class TessituraRest
|
|
41
43
|
include WebContents
|
42
44
|
include WebLogins
|
43
45
|
|
44
|
-
def initialize(
|
46
|
+
def initialize(_options = {})
|
45
47
|
@auth = { username: ENV.fetch('TESSITURA_USERNAME'),
|
46
48
|
password: ENV.fetch('TESSITURA_PASSWORD') }
|
47
49
|
@headers = { 'Accept': 'application/json' }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tessitura_rest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brittany Martin, Danielle Greaves, Craig Donavin, Patrick FitzGerald
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-04-
|
11
|
+
date: 2023-04-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -144,6 +144,8 @@ files:
|
|
144
144
|
- lib/tessitura_rest/diagnostics/diagnostics.rb
|
145
145
|
- lib/tessitura_rest/finance/appeals.rb
|
146
146
|
- lib/tessitura_rest/finance/gift_certificates.rb
|
147
|
+
- lib/tessitura_rest/payment_gateway/payment_component.rb
|
148
|
+
- lib/tessitura_rest/payment_gateway/payment_gateway.rb
|
147
149
|
- lib/tessitura_rest/reference_data/billing_schedules.rb
|
148
150
|
- lib/tessitura_rest/reference_data/countries.rb
|
149
151
|
- lib/tessitura_rest/reference_data/sections.rb
|