Class: GenesisRuby::Api::Requests::Wpf::Create

Overview

Web-Payment Form Request

Constant Summary

Constants included from Mixins::Requests::Financial::Cards::AccountOwnerAttributes

Mixins::Requests::Financial::Cards::AccountOwnerAttributes::ACCOUNT_NAME_LENGTH

Constants inherited from GenesisRuby::Api::Request

GenesisRuby::Api::Request::AUTH_TYPE_BASIC, GenesisRuby::Api::Request::AUTH_TYPE_TOKEN, GenesisRuby::Api::Request::METHOD_GET, GenesisRuby::Api::Request::METHOD_PATCH, GenesisRuby::Api::Request::METHOD_POST, GenesisRuby::Api::Request::METHOD_PUT, GenesisRuby::Api::Request::PORT_HTTPS, GenesisRuby::Api::Request::PROTOCOL_HTTPS

Instance Attribute Summary collapse

Attributes included from Mixins::Requests::WpfRemindersAttributes

#reminder_language

Attributes included from Mixins::Requests::Financial::Threeds::Version2::CardHolderAccount

#threeds_v2_card_holder_account_password_change_indicator, #threeds_v2_card_holder_account_provision_attempts_last24_hours, #threeds_v2_card_holder_account_purchases_count_last6_months, #threeds_v2_card_holder_account_registration_indicator, #threeds_v2_card_holder_account_shipping_address_usage_indicator, #threeds_v2_card_holder_account_suspicious_activity_indicator, #threeds_v2_card_holder_account_transactions_activity_last24_hours, #threeds_v2_card_holder_account_transactions_activity_previous_year, #threeds_v2_card_holder_account_update_indicator

Attributes included from Mixins::Requests::Financial::Threeds::Version2::MerchantRisk

#threeds_v2_merchant_risk_delivery_timeframe, #threeds_v2_merchant_risk_gift_card, #threeds_v2_merchant_risk_gift_card_count, #threeds_v2_merchant_risk_pre_order_purchase_indicator, #threeds_v2_merchant_risk_reorder_items_indicator, #threeds_v2_merchant_risk_shipping_indicator

Attributes included from Mixins::Requests::Financial::Threeds::Version2::Recurring

#threeds_v2_recurring_frequency

Attributes included from Mixins::Requests::Financial::Threeds::Version2::Purchase

#threeds_v2_purchase_category

Attributes included from Mixins::Requests::Financial::Threeds::Version2::Control

#threeds_v2_control_challenge_indicator, #threeds_v2_control_challenge_window_size, #threeds_v2_control_device_type

Attributes included from Mixins::Requests::Financial::RiskAttributes

#risk_bin, #risk_bin_name, #risk_bin_phone, #risk_country, #risk_email, #risk_first_name, #risk_forwarded_ip, #risk_last_name, #risk_mac_address, #risk_pan, #risk_pan_tail, #risk_password, #risk_phone, #risk_remote_ip, #risk_serial_number, #risk_session_id, #risk_ssn, #risk_user_id, #risk_user_level, #risk_username

Attributes included from Mixins::Requests::Financial::PendingPaymentAttributes

#return_pending_url

Attributes included from Mixins::Requests::Financial::PaymentAttributes

#amount, #currency

Attributes included from Mixins::Requests::Financial::NotificationAttributes

#notification_url

Attributes included from Mixins::Requests::Financial::FundingAttributes

#funding_business_application_identifier, #funding_identifier_type, #funding_receiver_account_number, #funding_receiver_account_number_type, #funding_receiver_address, #funding_receiver_city, #funding_receiver_country, #funding_receiver_first_name, #funding_receiver_last_name, #funding_receiver_state, #funding_sender_address, #funding_sender_city, #funding_sender_country, #funding_sender_name, #funding_sender_reference_number, #funding_sender_state

Attributes included from Mixins::Requests::Financial::DynamicDescriptorAttributes

#dynamic_descriptor_merchant_address, #dynamic_descriptor_merchant_city, #dynamic_descriptor_merchant_country, #dynamic_descriptor_merchant_geo_coordinates, #dynamic_descriptor_merchant_name, #dynamic_descriptor_merchant_phone, #dynamic_descriptor_merchant_service_city, #dynamic_descriptor_merchant_service_country, #dynamic_descriptor_merchant_service_geo_coordinates, #dynamic_descriptor_merchant_service_phone, #dynamic_descriptor_merchant_service_state, #dynamic_descriptor_merchant_service_zip_code, #dynamic_descriptor_merchant_state, #dynamic_descriptor_merchant_url, #dynamic_descriptor_merchant_zip_code, #dynamic_descriptor_sub_merchant_id

Attributes included from Mixins::Requests::Financial::Cards::Recurring::RecurringCategoryAttributes

#recurring_category

Attributes included from Mixins::Requests::Financial::Cards::AccountOwnerAttributes

#account_first_name, #account_last_name, #account_middle_name

Attributes included from Mixins::Requests::Financial::Business::BusinessAttributes

#business_payment_type

Attributes included from Mixins::Requests::Financial::Business::TravelAgenciesAttributes

#business_atol_certificate, #business_carrier_code, #business_contractor_name, #business_destination_city, #business_flight_number, #business_origin_city, #business_ticket_number, #business_travel_agency

Attributes included from Mixins::Requests::Financial::Business::HotelsAndRealEstateRentalsAttributes

#business_travel_agency_name

Attributes included from Mixins::Requests::Financial::Business::FurnitureAttributes

#business_name_of_the_supplier

Attributes included from Mixins::Requests::Financial::Business::EventManagementAttributes

#business_event_id, #business_event_organizer_id

Attributes included from Mixins::Requests::Financial::Business::CarPlaneAndBoatRentalsAttributes

#business_supplier_name

Attributes included from Mixins::Requests::Financial::Business::AirlinesAirCarriersAttributes

#business_airline_code, #business_airline_flight_number, #business_airline_tour_operator_name, #business_flight_destination_city, #business_flight_origin_city, #business_flight_ticket_number

Attributes included from Mixins::Requests::Financial::AsyncAttributes

#return_failure_url, #return_success_url

Attributes included from Mixins::Requests::DigitalAssetTypeAttributes

#digital_asset_type

Attributes included from Mixins::Requests::CustomerAddress::CustomerInfoAttributes

#customer_email, #customer_phone

Attributes included from Mixins::Requests::CustomerAddress::ShippingInfoAttributes

#shipping_address1, #shipping_address2, #shipping_city, #shipping_country, #shipping_first_name, #shipping_last_name, #shipping_neighborhood, #shipping_state, #shipping_zip_code

Attributes included from Mixins::Requests::CustomerAddress::BillingInfoAttributes

#billing_address1, #billing_address2, #billing_city, #billing_country, #billing_first_name, #billing_last_name, #billing_neighborhood, #billing_state, #billing_zip_code

Attributes inherited from GenesisRuby::Api::Request

#api_config

Instance Method Summary collapse

Methods included from Mixins::Requests::WpfRemindersAttributes

#add_reminder

Methods included from Mixins::Requests::Financial::Threeds::Version2::WpfAttributes

#threeds_v2_control_device_type, #threeds_v2_control_device_type=

Methods included from Mixins::Requests::Financial::Threeds::Version2::CardHolderAccount

#threeds_v2_card_holder_account_creation_date, #threeds_v2_card_holder_account_creation_date=, #threeds_v2_card_holder_account_last_change_date, #threeds_v2_card_holder_account_last_change_date=, #threeds_v2_card_holder_account_password_change_date, #threeds_v2_card_holder_account_password_change_date=, #threeds_v2_card_holder_account_registration_date, #threeds_v2_card_holder_account_registration_date=, #threeds_v2_card_holder_account_shipping_address_date_first_used, #threeds_v2_card_holder_account_shipping_address_date_first_used=

Methods included from Mixins::Requests::Financial::Threeds::Version2::MerchantRisk

#threeds_v2_merchant_risk_pre_order_date, #threeds_v2_merchant_risk_pre_order_date=

Methods included from Mixins::Requests::Financial::Threeds::Version2::Recurring

#threeds_v2_recurring_expiration_date, #threeds_v2_recurring_expiration_date=

Methods included from Mixins::Requests::Financial::Business::TravelAgenciesAttributes

#business_arrival_date, #business_arrival_date=, #business_departure_date, #business_departure_date=, #business_pick_up_date, #business_pick_up_date=, #business_return_date, #business_return_date=

Methods included from Mixins::Requests::Financial::Business::HotelsAndRealEstateRentalsAttributes

#business_check_in_date, #business_check_in_date=, #business_check_out_date, #business_check_out_date=

Methods included from Mixins::Requests::Financial::Business::FurnitureAttributes

#business_date_of_order, #business_date_of_order=, #business_delivery_date, #business_delivery_date=

Methods included from Mixins::Requests::Financial::Business::EventManagementAttributes

#business_event_end_date, #business_event_end_date=, #business_event_start_date, #business_event_start_date=

Methods included from Mixins::Requests::Financial::Business::CruiseLinesAttributes

#business_cruise_end_date, #business_cruise_end_date=, #business_cruise_start_date, #business_cruise_start_date=

Methods included from Mixins::Requests::Financial::Business::CarPlaneAndBoatRentalsAttributes

#business_vehicle_pick_up_date, #business_vehicle_pick_up_date=, #business_vehicle_return_date, #business_vehicle_return_date=

Methods included from Mixins::Requests::Financial::Business::AirlinesAirCarriersAttributes

#business_flight_arrival_date, #business_flight_arrival_date=, #business_flight_departure_date, #business_flight_departure_date=

Methods inherited from GenesisRuby::Api::Request

#build_document, #initialize

Constructor Details

This class inherits a constructor from GenesisRuby::Api::Request

Instance Attribute Details

#consumer_idObject

Returns the value of attribute consumer_id.



31
32
33
# File 'lib/genesis_ruby/api/requests/wpf/create.rb', line 31

def consumer_id
  @consumer_id
end

#descriptionObject

Returns the value of attribute description.



31
32
33
# File 'lib/genesis_ruby/api/requests/wpf/create.rb', line 31

def description
  @description
end

#localeObject

Returns the value of attribute locale.



30
31
32
# File 'lib/genesis_ruby/api/requests/wpf/create.rb', line 30

def locale
  @locale
end

#remember_cardObject

Returns the value of attribute remember_card.



31
32
33
# File 'lib/genesis_ruby/api/requests/wpf/create.rb', line 31

def remember_card
  @remember_card
end

#return_cancel_urlObject

Returns the value of attribute return_cancel_url.



31
32
33
# File 'lib/genesis_ruby/api/requests/wpf/create.rb', line 31

def return_cancel_url
  @return_cancel_url
end

#sca_exemptionObject

Returns the value of attribute sca_exemption.



30
31
32
# File 'lib/genesis_ruby/api/requests/wpf/create.rb', line 30

def sca_exemption
  @sca_exemption
end

#sca_preferenceObject

Returns the value of attribute sca_preference.



30
31
32
# File 'lib/genesis_ruby/api/requests/wpf/create.rb', line 30

def sca_preference
  @sca_preference
end

#transaction_idObject

Returns the value of attribute transaction_id.



31
32
33
# File 'lib/genesis_ruby/api/requests/wpf/create.rb', line 31

def transaction_id
  @transaction_id
end

#usageObject

Returns the value of attribute usage.



31
32
33
# File 'lib/genesis_ruby/api/requests/wpf/create.rb', line 31

def usage
  @usage
end

#web_payment_form_idObject

Returns the value of attribute web_payment_form_id.



31
32
33
# File 'lib/genesis_ruby/api/requests/wpf/create.rb', line 31

def web_payment_form_id
  @web_payment_form_id
end

Instance Method Details

#add_transaction_type(name, custom_attributes = {}) ⇒ Object

The transaction types that the merchant is willing to accept payments for



41
42
43
44
45
46
47
48
49
# File 'lib/genesis_ruby/api/requests/wpf/create.rb', line 41

def add_transaction_type(name, custom_attributes = {})
  unless GenesisRuby::Utils::Transactions::WpfTypes.valid? name
    raise ParameterError, 'Invalid Transaction Type given.'
  end

  self.transaction_types = { transaction_type: {
    '@attributes': { name: name.to_s.downcase }, **custom_attributes
  } }
end

#lifetimeObject

A number of minutes determining how long the WPF will be valid. Will be set to 30 minutes by default.



99
100
101
# File 'lib/genesis_ruby/api/requests/wpf/create.rb', line 99

def lifetime
  @lifetime ||= DEFAULT_LIFETIME
end

#lifetime=(value) ⇒ Object

A number of minutes determining how long the WPF will be valid. Will be set to 30 minutes by default.



104
105
106
107
108
109
110
111
112
113
# File 'lib/genesis_ruby/api/requests/wpf/create.rb', line 104

def lifetime=(value)
  lifetime = value.to_i

  if lifetime < 1 || lifetime > MAX_LIFETIME
    raise InvalidArgumentError,
          "Valid value ranges between 1 minute and 3 months (#{MAX_LIFETIME} minutes) given in minutes"
  end

  @lifetime = lifetime
end

#pay_laterObject

Signifies whether the ’Pay Later’ feature would be enabled on the WPF



81
82
83
84
85
86
87
# File 'lib/genesis_ruby/api/requests/wpf/create.rb', line 81

def pay_later
  @pay_later ||= false

  return nil unless @pay_later

  @pay_later
end

#pay_later=(value) ⇒ Object

Signifies whether the ’Pay Later’ feature would be enabled on the WPF



90
91
92
93
94
95
96
# File 'lib/genesis_ruby/api/requests/wpf/create.rb', line 90

def pay_later=(value)
  allowed_options attribute: __method__,
                  allowed: [true, false],
                  value: value,
                  allow_empty: true,
                  error_message: 'Accepts only boolean values'
end