class PayCertify::ThreeDS
Attributes
api_key[RW]
api_secret[RW]
mode[RW]
amount[RW]
authentication[RW]
card_number[RW]
client[RW]
expiration_month[RW]
expiration_year[RW]
message_id[RW]
mode[RW]
return_url[RW]
settings[RW]
transaction_id[RW]
type[RW]
Public Class Methods
authenticate!(settings:, callback_params:)
click to toggle source
# File lib/paycertify/three_ds.rb, line 72 def authenticate!(settings:, callback_params:) raise NoCredentialsError, 'No api_key provided.' unless api_key.present? raise NoCredentialsError, 'No api_secret provided.' unless api_secret.present? client = PayCertify::ThreeDS::Client.new(api_key: api_key, api_secret: api_secret, mode: mode) PayCertify::ThreeDS::PaymentAuthentication.new(client, settings).authenticate!(callback_params) end
configure() { |self| ... }
click to toggle source
# File lib/paycertify/three_ds.rb, line 68 def configure(&block) yield self if block_given? end
new(options)
click to toggle source
# File lib/paycertify/three_ds.rb, line 20 def initialize(options) raise NoCredentialsError, 'No api_key provided.' unless api_key.present? raise NoCredentialsError, 'No api_secret provided.' unless api_secret.present? self.type = options[:type].to_sym.in?([:strict, :frictionless]) ? options[:type].to_sym : :strict self.card_number = options[:card_number] self.expiration_month = options[:expiration_month] self.expiration_year = options[:expiration_year] self.amount = options[:amount] self.transaction_id = options[:transaction_id] self.message_id = options[:message_id] self.return_url = options[:return_url] self.client = PayCertify::ThreeDS::Client.new(api_key: api_key, api_secret: api_secret, mode: mode) end
Public Instance Methods
card_enrolled?()
click to toggle source
# File lib/paycertify/three_ds.rb, line 53 def card_enrolled? @card_enrolled ||= payment_authentication.card_enrolled? end
payment_authentication()
click to toggle source
# File lib/paycertify/three_ds.rb, line 49 def payment_authentication @payment_authentication ||= PayCertify::ThreeDS::PaymentAuthentication.new(client, settings) end
render!()
click to toggle source
# File lib/paycertify/three_ds.rb, line 61 def render! PayCertify::ThreeDS::Form.new(authentication).render_html_for(settings, type) end
start!()
click to toggle source
# File lib/paycertify/three_ds.rb, line 57 def start! self.authentication = payment_authentication.prepare! end