lib/active_merchant/billing/gateways/wirecard.rb in activemerchant-1.103.0 vs lib/active_merchant/billing/gateways/wirecard.rb in activemerchant-1.104.0

- old
+ new

@@ -11,24 +11,24 @@ ENVELOPE_NAMESPACES = { 'xmlns:xsi' => 'http://www.w3.org/1999/XMLSchema-instance', 'xsi:noNamespaceSchemaLocation' => 'wirecard.xsd' } - PERMITTED_TRANSACTIONS = %w[ PREAUTHORIZATION CAPTURE PURCHASE ] + PERMITTED_TRANSACTIONS = %w[PREAUTHORIZATION CAPTURE PURCHASE] - RETURN_CODES = %w[ ACK NOK ] + RETURN_CODES = %w[ACK NOK] # Wirecard only allows phone numbers with a format like this: +xxx(yyy)zzz-zzzz-ppp, where: # xxx = Country code # yyy = Area or city code # zzz-zzzz = Local number # ppp = PBX extension # For example, a typical U.S. or Canadian number would be "+1(202)555-1234-739" indicating PBX extension 739 at phone # number 5551234 within area code 202 (country code 1). VALID_PHONE_FORMAT = /\+\d{1,3}(\(?\d{3}\)?)?\d{3}-\d{4}-\d{3}/ - self.supported_cardtypes = [ :visa, :master, :american_express, :diners_club, :jcb ] + self.supported_cardtypes = [:visa, :master, :american_express, :diners_club, :jcb] self.supported_countries = %w(AD CY GI IM MT RO CH AT DK GR IT MC SM TR BE EE HU LV NL SK GB BG FI IS LI NO SI VA FR IL LT PL ES CZ DE IE LU PT SE) self.homepage_url = 'http://www.wirecard.com' self.display_name = 'Wirecard' self.default_currency = 'EUR' self.money_format = :cents @@ -261,10 +261,11 @@ end # Includes the credit-card data to the transaction-xml def add_creditcard(xml, creditcard) raise 'Creditcard must be supplied!' if creditcard.nil? + xml.tag! 'CREDIT_CARD_DATA' do xml.tag! 'CreditCardNumber', creditcard.number xml.tag! 'CVC2', creditcard.verification_value xml.tag! 'ExpirationYear', creditcard.year xml.tag! 'ExpirationMonth', format(creditcard.month, :two_digits) @@ -273,17 +274,19 @@ end # Includes the IP address of the customer to the transaction-xml def add_customer_data(xml, options) return unless options[:ip] + xml.tag! 'CONTACT_DATA' do xml.tag! 'IPAddress', options[:ip] end end # Includes the address to the transaction-xml def add_address(xml, address) return if address.nil? + xml.tag! 'CORPTRUSTCENTER_DATA' do xml.tag! 'ADDRESS' do xml.tag! 'Address1', address[:address1] xml.tag! 'Address2', address[:address2] if address[:address2] xml.tag! 'City', address[:city]