WorldPay Gateway Guide

close

Services and Compatibility

Payment Gateway Company Name:
WorldPay
Services that work with Spreedly:
  • Corporate Gateway
  • Business Gateway
Services that do not work with Spreedly:
  • If recurring is important to you, avoid being set up with two MID’s. You should put all transactions (new and recurring) through just the one MID.
Supported operations:
Purchase, Authorize, Capture, Refund, Void, Verify, General Credit
Regions:
Asia Pacific, Europe, Middle East, North America

Authentication and Security

Specific names for credentials:
Login, Password
Additional steps needed to activate?
Turn off the capture delay setting. (See notes)

Onboarding Merchants in:

Additional Notes

For US based acquiring accounts, see WorldPay US.

There is a setting in your WorldPay Merchant Interface called Capture Delay which is set to on by default within Worldpay. You’ll need to login and turn that setting off.

In addition, if you tell WorldPay you are working with Spreedly you can usually bypass the need to do a full test transaction before being pushed into production. Lastly, you’ll want to be approved for the “XML Invisible” installation.

Adding a Worldpay gateway

To add a WorldPay gateway:


curl https://core.spreedly.com/v1/gateways.xml \
  -u 'Ll6fAtoVSTyVMlJEmtpoJV8S:RKOCG5D8D3fZxDSg504D0IxU2XD4Io5VXmyzdCtTivHFTTSy' \
  -H 'Content-Type: application/xml' \
  -d '<gateway>
        <gateway_type>worldpay</gateway_type>
        <login>Your Merchant Code (may be called Merchant ID)</login>
        <password>Your XML Password</password>
      </gateway>'

<gateway>
  <token>Ry9CrICd2TnlSgqRnOKC1ayA1KI</token>
  <gateway_type>worldpay</gateway_type>
  <name>WorldPay</name>
  <description nil="true"/>
  <login>Your Merchant Code (may be called Merchant ID)</login>
  <characteristics>
    <supports_purchase type="boolean">true</supports_purchase>
    <supports_authorize type="boolean">true</supports_authorize>
    <supports_capture type="boolean">true</supports_capture>
    <supports_credit type="boolean">true</supports_credit>
    <supports_general_credit type="boolean">true</supports_general_credit>
    <supports_void type="boolean">true</supports_void>
    <supports_verify type="boolean">true</supports_verify>
    <supports_reference_purchase type="boolean">true</supports_reference_purchase>
    <supports_purchase_via_preauthorization type="boolean">false</supports_purchase_via_preauthorization>
    <supports_offsite_purchase type="boolean">false</supports_offsite_purchase>
    <supports_offsite_authorize type="boolean">false</supports_offsite_authorize>
    <supports_3dsecure_purchase type="boolean">false</supports_3dsecure_purchase>
    <supports_3dsecure_authorize type="boolean">false</supports_3dsecure_authorize>
    <supports_store type="boolean">false</supports_store>
    <supports_remove type="boolean">false</supports_remove>
    <supports_fraud_review type="boolean">false</supports_fraud_review>
    <supports_disburse type="boolean">false</supports_disburse>
  </characteristics>
  <credentials>
    <credential>
      <name>login</name>
      <value>Your Merchant Code (may be called Merchant ID)</value>
    </credential>
  </credentials>
  <gateway_specific_fields>
    <gateway_specific_field>installation_id</gateway_specific_field>
    <gateway_specific_field>hcg_additional_data</gateway_specific_field>
    <gateway_specific_field>session_id</gateway_specific_field>
  </gateway_specific_fields>
  <payment_methods>
    <payment_method>credit_card</payment_method>
  </payment_methods>
  <state>retained</state>
  <redacted type="boolean">false</redacted>
  <created_at type="dateTime">2017-08-10T17:45:02Z</created_at>
  <updated_at type="dateTime">2017-08-10T17:45:02Z</updated_at>
</gateway>


env = Spreedly::Environment.new('Ll6fAtoVSTyMlJEm', 'RKcG5D8D3fZxDSg504U2XD4Io5VXz')
env.add_gateway(:worldpay, login: "Your login", password: "Your password")


#<Spreedly::Gateway:0x007ffde13027a8
 @created_at="2016-08-11T17:16:29Z",
 @credentials={"login"=>"Your login"},
 @gateway_type="worldpay",
 @name="WorldPay",
 @state="retained",
 @token="3EL4QCijoiPGxNFYJNVYHEM1kPT",
 @updated_at="2016-08-11T17:16:29Z">

Support for General Credit operation

In order to perform General Credit transactions with Worldpay, special setup is required. First, you must obtain a second Merchant ID (aka Merchant Code) from Worldpay, requesting with them that it be flagged for Credit Fund Transfers (CFT, aka Payouts). Then, you must create a second Worldpay gateway with Spreedly using that Merchant ID. This second gateway can, and should only be used for General Credit transactions; all other normal transactions, including normal credits/refunds, should be performed with your original Worldpay gateway instance that uses your normal “eCom” Merchant ID.

Optional Gateway Specific Fields

Spreedly supports the following gateway specific fields when transacting with Worldpay:

  • hcg_additional_data

curl https://core.spreedly.com/v1/transactions/7DShFlwqVtUvhyackYN2Jtw2UGn/credit.xml \
  -u 'Ll6fAtoVSTyVMlJEmtpoJV8S:RKOCG5D8D3fZxDSg504D0IxU2XD4Io5VXmyzdCtTivHFTTSy' \
  -H 'Content-Type: application/xml' \
  -d '<transaction>
        <gateway_specific_fields>
          <worldpay>
            <hcg_additional_fields>
              <key1>value1</key1>
              <key2>value2</key2>
              <key3>value3</key3>
            </hcg_additional_fields>
          </worldpay>
        </gateway_specific_fields>
      </transaction>'

<transaction>
  <on_test_gateway type="boolean">true</on_test_gateway>
  <created_at type="dateTime">2016-10-07T19:23:38Z</created_at>
  <updated_at type="dateTime">2016-10-07T19:23:38Z</updated_at>
  <succeeded type="boolean">true</succeeded>
  <state>succeeded</state>
  <token>LZhOVhcXOdd7rmHNfaaWAy1JpTr</token>
  <transaction_type>Credit</transaction_type>
  <order_id nil="true"/>
  <ip nil="true"/>
  <description nil="true"/>
  <email nil="true"/>
  <merchant_name_descriptor nil="true"/>
  <merchant_location_descriptor nil="true"/>
  <gateway_specific_fields>
    <worldpay>
      <hcg_additional_fields>
        <key1>value1</key1>
        <key2>value2</key2>
        <key3>value3</key3>
      </hcg_additional_fields>
    </worldpay>
  </gateway_specific_fields>
  <gateway_specific_response_fields>
  </gateway_specific_response_fields>
  <gateway_transaction_id>61</gateway_transaction_id>
  <amount type="integer">100</amount>
  <currency_code>USD</currency_code>
  <message key="messages.transaction_succeeded">Succeeded!</message>
  <gateway_token>aWLT8lNbXNamp29L7xxtJkJbnTJ</gateway_token>
  <shipping_address>
    <name nil="true"/>
    <address1 nil="true"/>
    <address2 nil="true"/>
    <city nil="true"/>
    <state nil="true"/>
    <zip nil="true"/>
    <country nil="true"/>
    <phone_number nil="true"/>
  </shipping_address>
  <response>
    <success type="boolean">true</success>
    <message>Successful credit</message>
    <avs_code nil="true"/>
    <avs_message nil="true"/>
    <cvv_code nil="true"/>
    <cvv_message nil="true"/>
    <pending type="boolean">false</pending>
    <result_unknown type="boolean">false</result_unknown>
    <error_code></error_code>
    <error_detail nil="true"/>
    <cancelled type="boolean">false</cancelled>
    <fraud_review nil="true"/>
    <created_at type="dateTime">2016-10-07T19:23:38Z</created_at>
    <updated_at type="dateTime">2016-10-07T19:23:38Z</updated_at>
  </response>
  <api_urls>
  </api_urls>
  <reference_token>5znjDZD8lzhJGWhVLS8Kx7xGHRQ</reference_token>
</transaction>

  • installation_id

curl https://core.spreedly.com/v1/transactions/7DShFlwqVtUvhyackYN2Jtw2UGn/credit.xml \
  -u 'Ll6fAtoVSTyVMlJEmtpoJV8S:RKOCG5D8D3fZxDSg504D0IxU2XD4Io5VXmyzdCtTivHFTTSy' \
  -H 'Content-Type: application/xml' \
  -d '<transaction>
        <gateway_specific_fields>
          <worldpay>
            <installation_id>abc1234</installation_id>
          </worldpay>
        </gateway_specific_fields>
      </transaction>'

<transaction>
  <on_test_gateway type="boolean">true</on_test_gateway>
  <created_at type="dateTime">2016-10-07T19:23:39Z</created_at>
  <updated_at type="dateTime">2016-10-07T19:23:39Z</updated_at>
  <succeeded type="boolean">true</succeeded>
  <state>succeeded</state>
  <token>DUrPP05ZobYo0RVhgTnQMGoLhw7</token>
  <transaction_type>Credit</transaction_type>
  <order_id nil="true"/>
  <ip nil="true"/>
  <description nil="true"/>
  <email nil="true"/>
  <merchant_name_descriptor nil="true"/>
  <merchant_location_descriptor nil="true"/>
  <gateway_specific_fields>
    <worldpay>
      <installation_id>abc1234</installation_id>
    </worldpay>
  </gateway_specific_fields>
  <gateway_specific_response_fields>
  </gateway_specific_response_fields>
  <gateway_transaction_id>62</gateway_transaction_id>
  <amount type="integer">100</amount>
  <currency_code>USD</currency_code>
  <message key="messages.transaction_succeeded">Succeeded!</message>
  <gateway_token>aWLT8lNbXNamp29L7xxtJkJbnTJ</gateway_token>
  <shipping_address>
    <name nil="true"/>
    <address1 nil="true"/>
    <address2 nil="true"/>
    <city nil="true"/>
    <state nil="true"/>
    <zip nil="true"/>
    <country nil="true"/>
    <phone_number nil="true"/>
  </shipping_address>
  <response>
    <success type="boolean">true</success>
    <message>Successful credit</message>
    <avs_code nil="true"/>
    <avs_message nil="true"/>
    <cvv_code nil="true"/>
    <cvv_message nil="true"/>
    <pending type="boolean">false</pending>
    <result_unknown type="boolean">false</result_unknown>
    <error_code></error_code>
    <error_detail nil="true"/>
    <cancelled type="boolean">false</cancelled>
    <fraud_review nil="true"/>
    <created_at type="dateTime">2016-10-07T19:23:39Z</created_at>
    <updated_at type="dateTime">2016-10-07T19:23:39Z</updated_at>
  </response>
  <api_urls>
  </api_urls>
  <reference_token>8rbh2XOb5k2v7VNFoKvnvACdHCS</reference_token>
</transaction>

  • session_id (typically passed along with IP address of end-user customer)

curl https://core.spreedly.com/v1/transactions/7DShFlwqVtUvhyackYN2Jtw2UGn/credit.xml \
  -u 'Ll6fAtoVSTyVMlJEmtpoJV8S:RKOCG5D8D3fZxDSg504D0IxU2XD4Io5VXmyzdCtTivHFTTSy' \
  -H 'Content-Type: application/xml' \
  -d '<transaction>
        <ip>127.0.0.1</ip>
        <gateway_specific_fields>
          <worldpay>
            <session_id>0215ui8ib1</session_id>
          </worldpay>
        </gateway_specific_fields>
      </transaction>'

<transaction>
  <on_test_gateway type="boolean">true</on_test_gateway>
  <created_at type="dateTime">2017-01-12T15:43:26Z</created_at>
  <updated_at type="dateTime">2017-01-12T15:43:26Z</updated_at>
  <succeeded type="boolean">true</succeeded>
  <state>succeeded</state>
  <token>XDrTSKFkYnP500Qd4QKWSyvpoYR</token>
  <transaction_type>Credit</transaction_type>
  <order_id nil="true"/>
  <ip>127.0.0.1</ip>
  <description nil="true"/>
  <email nil="true"/>
  <merchant_name_descriptor nil="true"/>
  <merchant_location_descriptor nil="true"/>
  <gateway_specific_fields>
    <worldpay>
      <session_id>0215ui8ib1</session_id>
    </worldpay>
  </gateway_specific_fields>
  <gateway_specific_response_fields>
  </gateway_specific_response_fields>
  <gateway_transaction_id>61</gateway_transaction_id>
  <amount type="integer">100</amount>
  <currency_code>USD</currency_code>
  <message key="messages.transaction_succeeded">Succeeded!</message>
  <gateway_token>QozJVf3SHEucJn0U1PipLsgkXDa</gateway_token>
  <shipping_address>
    <name nil="true"/>
    <address1 nil="true"/>
    <address2 nil="true"/>
    <city nil="true"/>
    <state nil="true"/>
    <zip nil="true"/>
    <country nil="true"/>
    <phone_number nil="true"/>
  </shipping_address>
  <response>
    <success type="boolean">true</success>
    <message>Successful credit</message>
    <avs_code nil="true"/>
    <avs_message nil="true"/>
    <cvv_code nil="true"/>
    <cvv_message nil="true"/>
    <pending type="boolean">false</pending>
    <result_unknown type="boolean">false</result_unknown>
    <error_code></error_code>
    <error_detail nil="true"/>
    <cancelled type="boolean">false</cancelled>
    <fraud_review nil="true"/>
    <created_at type="dateTime">2017-01-12T15:43:26Z</created_at>
    <updated_at type="dateTime">2017-01-12T15:43:26Z</updated_at>
  </response>
  <api_urls>
  </api_urls>
  <reference_token>L1TEUG6q2JkrTNvrIm9l4tPjASJ</reference_token>
</transaction>

If you’d like to request any gateway_specific_fields or gateway_specific_response_fields, please email support@spreedly.com with your request and the gateway documentation for the fields of interest.