class Maxipago::XmlBuilder::BuilderApi

Private Instance Methods

add_card_onfile() click to toggle source
# File lib/maxipago/xml_builder/builder_api.rb, line 80
def add_card_onfile
  builder = Nokogiri::XML::Builder.new(encoding: 'UTF-8') do |xml|
    xml.send("api-request") {
      xml.verification {
        xml.merchantId self.maxipagoId
        xml.merchantKey self.apiKey
      }
      xml.command "add-card-onfile"
      xml.request {
        xml.customerId self.options[:customer_id]
        xml.creditCardNumber self.options[:credit_card_number]
        xml.expirationMonth self.options[:expiration_month]
        xml.expirationYear self.options[:expiration_year]
        xml.billingName self.options[:billing_name]
        xml.billingAddress1 self.options[:billing_address1]
        xml.billingAddress2 self.options[:billing_address2] unless self.options[:billing_address2].nil?
        xml.billingCity self.options[:billing_city]
        xml.billingState self.options[:billing_state]
        xml.billingZip self.options[:billing_zip]
        xml.billingCountry self.options[:billing_country]
        xml.billingPhone self.options[:billing_phone]
        xml.billingEmail self.options[:billing_email]
        xml.onFileEndDate self.options[:onfile_end_date] unless self.options[:onfile_end_date].nil?
        xml.onFilePermissions self.options[:onfile_permissions] unless self.options[:onfile_permissions].nil?
        xml.onFileComment self.options[:onfile_comment] unless self.options[:onfile_comment].nil?
        xml.onFileMaxChargeAmount self.options[:onfile_max_charge_amount] unless self.options[:onfile_max_charge_amount].nil?
      }
    }
  end
  builder.to_xml(indent: 2)
end
add_consumer() click to toggle source
# File lib/maxipago/xml_builder/builder_api.rb, line 7
def add_consumer
  builder = Nokogiri::XML::Builder.new(encoding: 'UTF-8') do |xml|
    xml.send("api-request") {
      xml.verification {
        xml.merchantId self.maxipagoId
        xml.merchantKey self.apiKey
      }
      xml.command "add-consumer"
      xml.request {
        xml.customerIdExt self.options[:customer_id_ext]
        xml.firstName self.options[:firstname]
        xml.lastName self.options[:lastname]
        xml.address1 self.options[:address1] unless self.options[:address1].nil?
        xml.address2 self.options[:address2] unless self.options[:address2].nil?
        xml.city self.options[:city] unless self.options[:city].nil?
        xml.state self.options[:state] unless self.options[:state].nil?
        xml.zip self.options[:zip] unless self.options[:zip].nil?
        xml.phone self.options[:phone] unless self.options[:phone].nil?
        xml.email self.options[:email] unless self.options[:email].nil?
        xml.dob self.options[:dob] unless self.options[:dob].nil?
        xml.ssn self.options[:ssn] unless self.options[:ssn].nil?
        xml.sex self.options[:sex] unless self.options[:sex].nil?
      }
    }
  end
  builder.to_xml(indent: 2)
end
cancel_recurring() click to toggle source
# File lib/maxipago/xml_builder/builder_api.rb, line 129
def cancel_recurring
  builder = Nokogiri::XML::Builder.new(encoding: 'UTF-8') do |xml|
    xml.send("api-request") {
      xml.verification {
        xml.merchantId self.maxipagoId
        xml.merchantKey self.apiKey
      }
      xml.command "cancel-recurring"
      xml.request {
        xml.orderID self.options[:order_id]
      }
    }
  end
  builder.to_xml(indent: 2)
end
delete_card_onfile() click to toggle source
# File lib/maxipago/xml_builder/builder_api.rb, line 112
def delete_card_onfile
  builder = Nokogiri::XML::Builder.new(encoding: 'UTF-8') do |xml|
    xml.send("api-request") {
      xml.verification {
        xml.merchantId self.maxipagoId
        xml.merchantKey self.apiKey
      }
      xml.command "delete-card-onfile"
      xml.request {
        xml.customerId self.options[:customer_id]
        xml.token self.options[:token]
      }
    }
  end
  builder.to_xml(indent: 2)
end
delete_consumer() click to toggle source
# File lib/maxipago/xml_builder/builder_api.rb, line 35
def delete_consumer
  builder = Nokogiri::XML::Builder.new(encoding: 'UTF-8') do |xml|
    xml.send("api-request") {
      xml.verification {
        xml.merchantId self.maxipagoId
        xml.merchantKey self.apiKey
      }
      xml.command "delete-consumer"
      xml.request {
        xml.customerId self.options[:customer_id]
      }
    }
  end
  builder.to_xml(indent: 2)
end
update_consumer() click to toggle source
# File lib/maxipago/xml_builder/builder_api.rb, line 51
def update_consumer
  builder = Nokogiri::XML::Builder.new(encoding: 'UTF-8') do |xml|
    xml.send("api-request") {
      xml.verification {
        xml.merchantId self.maxipagoId
        xml.merchantKey self.apiKey
      }
      xml.command "update-consumer"
      xml.request {
        xml.customerId self.options[:customer_id]
        xml.customerIdExt self.options[:customer_id_ext]
        xml.firstName self.options[:firstname] unless self.options[:firstname].nil?
        xml.lastName self.options[:lastname] unless self.options[:lastname].nil?
        xml.address1 self.options[:address1] unless self.options[:address1].nil?
        xml.address2 self.options[:address2] unless self.options[:address2].nil?
        xml.city self.options[:city] unless self.options[:city].nil?
        xml.state self.options[:state] unless self.options[:state].nil?
        xml.zip self.options[:zip] unless self.options[:zip].nil?
        xml.phone self.options[:phone] unless self.options[:phone].nil?
        xml.email self.options[:email] unless self.options[:email].nil?
        xml.dob self.options[:dob] unless self.options[:dob].nil?
        xml.ssn self.options[:ssn] unless self.options[:ssn].nil?
        xml.sex self.options[:sex] unless self.options[:sex].nil?
      }
    }
  end
  builder.to_xml(indent: 2)
end