OK, your reasoning seems sound, we'll just wait and see. No need to go
there yet.

On Monday, May 26, 2014, Justin Plouffe <notifications@github.com> wrote:

> In lib/active_merchant/billing/gateways/adyen.rb:
>
> > +        commit('Payment.refund', post)
> > +      end
> > +
> > +      def void(identification, options = {})
> > +        requires!(options, :merchant, :order_id)
> > +
> > +        post = {}
> > +        post[:modificationRequest] = modification_request(identification, options)
> > +
> > +        commit('Payment.cancel', post)
> > +      end
> > +
> > +      private
> > +
> > +      def commit(action, post)
> > +        request = post_data(flatten_hash(post.merge(:action => action)))
>
> @ntalbott <https://github.com/ntalbott> An Adyen REST request is
> basically just a flattened and properly encoded hash :
>
> action=Payment.authorise&paymentRequest.merchantAccount=SupportAdyenTest&paymentRequest.amount.value=1234&action=Payment.authorise&paymentRequest.card.expiryYear=2016&paymentRequest.amount.currency=EUR&paymentRequest.card.cvc=737&paymentRequest.card.number=5555444433331111&paymentRequest.card.holderName=Test%2BTester&paymentRequest.card.expiryMonth=06&paymentRequest.reference=testReference1234
>
> I tried to be fancy and assemble the requests using small methods that
> convert ActiveRecord data structures to Adyen ones instead of using the
> typical add_something(post, options) pattern used in most gateways. These
> requests would then be made into a proper http post request before being
> sent. It seemed like a way to create smaller and more testable methods but
> I might just revert to the regular pattern if it ends up making everything
> simpler.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/Shopify/active_merchant/pull/1218/files#r13058018>
> .
>


-- 
--
Nathaniel