Module: Vantiv
- Defined in:
- lib/vantiv.rb,
lib/vantiv/paypage.rb,
lib/vantiv/version.rb,
lib/vantiv/test_card.rb,
lib/vantiv/api/request.rb,
lib/vantiv/environment.rb,
lib/vantiv/api/response.rb,
lib/vantiv/api/endpoints.rb,
lib/vantiv/mocked_sandbox.rb,
lib/vantiv/api/request_body.rb,
lib/vantiv/api/capture_response.rb,
lib/vantiv/api/tokenization_response.rb,
lib/vantiv/api/request_body_generator.rb,
lib/vantiv/mocked_sandbox/api_request.rb,
lib/vantiv/certification/paypage_driver.rb,
lib/vantiv/certification/paypage_server.rb,
lib/vantiv/certification/response_cache.rb,
lib/vantiv/api/live_transaction_response.rb,
lib/vantiv/api/tied_transaction_response.rb,
lib/vantiv/mocked_sandbox/fixture_generator.rb,
lib/vantiv/certification/validation_test_runner.rb,
lib/vantiv/certification/cert_request_body_compiler.rb
Defined Under Namespace
Modules: Api, Certification, Environment, MockedSandbox, Paypage
Classes: TestCard
Constant Summary
collapse
- VERSION =
"0.1.0"
Class Method Summary
collapse
-
.auth(amount:, payment_account_id:, customer_id:, order_id:) ⇒ Object
-
.auth_capture(amount:, payment_account_id:, customer_id:, order_id:) ⇒ Object
-
.auth_reversal(transaction_id:, amount: nil) ⇒ Object
-
.capture(transaction_id:, amount: nil) ⇒ Object
-
.configure {|_self| ... } ⇒ Object
-
.credit(transaction_id:, amount:) ⇒ Object
NOTE: ActiveMerchant’s #refund…
-
.refund(amount:, payment_account_id:, customer_id:, order_id:) ⇒ Object
-
.root ⇒ Object
-
.tokenize(temporary_token:) ⇒ Object
-
.tokenize_by_direct_post(card_number:, expiry_month:, expiry_year:, cvv:) ⇒ Object
-
.void(transaction_id:) ⇒ Object
Class Method Details
.auth(amount:, payment_account_id:, customer_id:, order_id:) ⇒ Object
.auth_capture(amount:, payment_account_id:, customer_id:, order_id:) ⇒ Object
80
81
82
83
84
85
86
87
88
89
90
91
92
|
# File 'lib/vantiv.rb', line 80
def self.auth_capture(amount:, payment_account_id:, customer_id:, order_id:)
body = Api::RequestBody.for_auth_or_sale(
amount: amount,
order_id: order_id,
customer_id: customer_id,
payment_account_id: payment_account_id
)
Api::Request.new(
endpoint: Api::Endpoints::SALE,
body: body,
response_object: Api::LiveTransactionResponse.new(:sale)
).run
end
|
.auth_reversal(transaction_id:, amount: nil) ⇒ Object
.capture(transaction_id:, amount: nil) ⇒ Object
131
132
133
|
# File 'lib/vantiv.rb', line 131
def self.configure
yield self
end
|
.credit(transaction_id:, amount:) ⇒ Object
NOTE: ActiveMerchant’s #refund… only for use on a capture or sale it seems
-> 'returns' are refunds too, credits are tied to a sale/capture, returns can be willy nilly
.refund(amount:, payment_account_id:, customer_id:, order_id:) ⇒ Object
108
109
110
111
112
113
114
115
116
117
118
119
120
|
# File 'lib/vantiv.rb', line 108
def self.refund(amount:, payment_account_id:, customer_id:, order_id:)
body = Api::RequestBody.for_return(
amount: amount,
customer_id: customer_id,
order_id: order_id,
payment_account_id: payment_account_id
)
Api::Request.new(
endpoint: Api::Endpoints::RETURN,
body: body,
response_object: Api::TiedTransactionResponse.new(:return)
).run
end
|
.root ⇒ Object
149
150
151
|
# File 'lib/vantiv.rb', line 149
def self.root
File.dirname __dir__
end
|
.tokenize(temporary_token:) ⇒ Object
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/vantiv.rb', line 10
def self.tokenize(temporary_token:)
if temporary_token == "" or temporary_token == nil
raise ArgumentError.new("Blank temporary token (PaypageRegistrationID): \n
Check that paypage error handling is implemented correctly.")
end
body = Api::RequestBody.for_tokenization(
paypage_registration_id: temporary_token
)
Api::Request.new(
endpoint: Api::Endpoints::TOKENIZATION,
body: body,
response_object: Api::TokenizationResponse.new
).run
end
|
.tokenize_by_direct_post(card_number:, expiry_month:, expiry_year:, cvv:) ⇒ Object
.void(transaction_id:) ⇒ Object