Class: ActiveMerchant::Billing::OrbitalSoftDescriptors
- Inherits:
-
Object
- Object
- ActiveMerchant::Billing::OrbitalSoftDescriptors
- Includes:
- Validateable
- Defined in:
- lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb
Constant Summary collapse
- PHONE_FORMAT_1 =
/\A\d{3}-\d{3}-\d{4}\z/
- PHONE_FORMAT_2 =
/\A\d{3}-\w{7}\z/
Instance Attribute Summary collapse
-
#merchant_city ⇒ Object
Unlike Salem, the only value that gets passed on the cardholder statement is the Merchant Name field.
-
#merchant_email ⇒ Object
Unlike Salem, the only value that gets passed on the cardholder statement is the Merchant Name field.
-
#merchant_name ⇒ Object
Unlike Salem, the only value that gets passed on the cardholder statement is the Merchant Name field.
-
#merchant_phone ⇒ Object
Unlike Salem, the only value that gets passed on the cardholder statement is the Merchant Name field.
-
#merchant_url ⇒ Object
Unlike Salem, the only value that gets passed on the cardholder statement is the Merchant Name field.
-
#product_description ⇒ Object
Unlike Salem, the only value that gets passed on the cardholder statement is the Merchant Name field.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ OrbitalSoftDescriptors
constructor
A new instance of OrbitalSoftDescriptors.
- #validate ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ OrbitalSoftDescriptors
Returns a new instance of OrbitalSoftDescriptors.
21 22 23 24 25 26 27 |
# File 'lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb', line 21 def initialize( = {}) self.merchant_name = [:merchant_name] self.merchant_city = [:merchant_city] self.merchant_phone = [:merchant_phone] self.merchant_url = [:merchant_url] self.merchant_email = [:merchant_email] end |
Instance Attribute Details
#merchant_city ⇒ Object
Unlike Salem, the only value that gets passed on the cardholder statement is the Merchant Name field.
And for these customers, it is a maximum of 25 bytes of data.
All other Soft Descriptor fields can optionally be sent, but will not be submitted to the settlement host and will not display on the cardholder statement.
19 20 21 |
# File 'lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb', line 19 def merchant_city @merchant_city end |
#merchant_email ⇒ Object
Unlike Salem, the only value that gets passed on the cardholder statement is the Merchant Name field.
And for these customers, it is a maximum of 25 bytes of data.
All other Soft Descriptor fields can optionally be sent, but will not be submitted to the settlement host and will not display on the cardholder statement.
19 20 21 |
# File 'lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb', line 19 def merchant_email @merchant_email end |
#merchant_name ⇒ Object
Unlike Salem, the only value that gets passed on the cardholder statement is the Merchant Name field.
And for these customers, it is a maximum of 25 bytes of data.
All other Soft Descriptor fields can optionally be sent, but will not be submitted to the settlement host and will not display on the cardholder statement.
19 20 21 |
# File 'lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb', line 19 def merchant_name @merchant_name end |
#merchant_phone ⇒ Object
Unlike Salem, the only value that gets passed on the cardholder statement is the Merchant Name field.
And for these customers, it is a maximum of 25 bytes of data.
All other Soft Descriptor fields can optionally be sent, but will not be submitted to the settlement host and will not display on the cardholder statement.
19 20 21 |
# File 'lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb', line 19 def merchant_phone @merchant_phone end |
#merchant_url ⇒ Object
Unlike Salem, the only value that gets passed on the cardholder statement is the Merchant Name field.
And for these customers, it is a maximum of 25 bytes of data.
All other Soft Descriptor fields can optionally be sent, but will not be submitted to the settlement host and will not display on the cardholder statement.
19 20 21 |
# File 'lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb', line 19 def merchant_url @merchant_url end |
#product_description ⇒ Object
Unlike Salem, the only value that gets passed on the cardholder statement is the Merchant Name field.
And for these customers, it is a maximum of 25 bytes of data.
All other Soft Descriptor fields can optionally be sent, but will not be submitted to the settlement host and will not display on the cardholder statement.
19 20 21 |
# File 'lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb', line 19 def product_description @product_description end |
Instance Method Details
#validate ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb', line 29 def validate errors.add(:merchant_name, "is required") if self.merchant_name.blank? errors.add(:merchant_name, "is required to be 25 bytes or less") if self.merchant_name.bytesize > 25 unless self.merchant_phone.blank? || self.merchant_phone.match(PHONE_FORMAT_1) || self.merchant_phone.match(PHONE_FORMAT_2) errors.add(:merchant_phone, "is required to follow \"NNN-NNN-NNNN\" or \"NNN-AAAAAAA\" format") end [:merchant_email, :merchant_url].each do |attr| unless self.send(attr).blank? errors.add(attr, "is required to be 13 bytes or less") if self.send(attr).bytesize > 13 end end end |