Shopify/active_merchant — pull request #609 by jhecking (2013-03-04 03:44:00+00:00)
Title: 3D Secure transaction support for WorldPay gateway

To support the 3D Secure payer authentication protocol a number of new
options have been implemented for the worldpay gateway plugin:

* Add basic cookie handling support as the Worldpay gateway sends a
session cookie in the first order message response and expects that
cookie to be returned in the second order message (after completing 3D
Secure authentication).
* Add support for passing session information (client IP and session ID)
in the authorize method. Mandatory for 3D Secure transactions.
* Add support for passing information about the shopper's browser
(accept header and user agent) into the autorize method so that the
gateway can determine the correct issuer redirect URL.
* Add support for passing the Payment Authentication response from the
3D Secure authentication as well as the "echo data" from the Worldpay
gateway in the second authorize method call.

The initial gateway response will have the `request3_d_secure` flag set to true
in the response's `params` hash if 3D Secure payer authentication is reuqired.
Additionally the hash will contain the `echo_data` and optionally a session
cookie which must be passed back to the gateway in subsequent request for the
same transaction. `params` also contains the `issuer_url` to which the shopper
must be redirected to complete 3D Secure authentication and the `pa_request`
data which needs to be passed to the issuer site.

Added unit and remote tests to cover 3D Secure authentication. (As well
as a missing unit test for localized_currency support.)

References:
- Worldpay documentation: http://www.worldpay.com/support/bg/xml/kb/3dsecure/dxml.html