So here your talking about the fact that builder is created in each request
yes?  Nice example you game me I'll go for that change.


On Thu, May 22, 2014 at 1:36 PM, Nathaniel Talbott <notifications@github.com
> wrote:

> In lib/active_merchant/billing/gateways/authorizenet.rb:
>
> > +      self.live_url = 'https://api.authorize.net/xml/v1/request.api'
> > +
> > +      self.supported_countries = ['US']
> > +      self.default_currency = 'USD'
> > +      self.supported_cardtypes = [:visa, :master, :american_express, :discover]
> > +
> > +      self.homepage_url = 'http://www.authorize.net/'
> > +      self.display_name = 'AuthorizeNet Gateway'
> > +
> > +      def initialize(options={})
> > +        requires!(options, :login, :password)
> > +        super
> > +      end
> > +
> > +      def purchase(money, payment_source, options = {})
> > +        payload = Nokogiri::XML::Builder.new do |xml|
>
> Rather than have all this boilerplate in each file, see the approach I
> took in hps.rb to share the boilerplate:
>
>
> https://github.com/Shopify/active_merchant/blob/master/lib/active_merchant/billing/gateways/hps.rb#L40-L48
>
> You'll need to adapt it, but it should reduce a lot of duplication.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/Shopify/active_merchant/pull/1219/files#r12969694>
> .
>