Class: ActiveMerchant::Billing::OrbitalSoftDescriptors
- 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
Methods included from Compatibility::Model
Constructor Details
#initialize(options = {}) ⇒ OrbitalSoftDescriptors
Returns a new instance of OrbitalSoftDescriptors.
19 20 21 22 23 24 25 |
# File 'lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb', line 19 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.
17 18 19 |
# File 'lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb', line 17 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.
17 18 19 |
# File 'lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb', line 17 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.
17 18 19 |
# File 'lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb', line 17 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.
17 18 19 |
# File 'lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb', line 17 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.
17 18 19 |
# File 'lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb', line 17 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.
17 18 19 |
# File 'lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb', line 17 def product_description @product_description end |
Instance Method Details
#validate ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb', line 27 def validate errors = [] errors << [:merchant_name, 'is required'] if self.merchant_name.blank? errors << [:merchant_name, 'is required to be 25 bytes or less'] if self.merchant_name.bytesize > 25 if(!empty?(self.merchant_phone) && !self.merchant_phone.match(PHONE_FORMAT_1) && !self.merchant_phone.match(PHONE_FORMAT_2)) errors << [: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 << [attr, 'is required to be 13 bytes or less'] if(self.send(attr).bytesize > 13) end end errors_hash(errors) end |