Barclaycard Smartpay Gateway Guide

Adding

To add a Barclaycard Smartpay gateway:


curl https://core.spreedly.com/v1/gateways.xml \
  -u 'C7cRfNJGODKh4Iu5Ox3PToKjniY:4UIuWybmdythfNGPqAqyQnYha6s451ri0fYAo4p3drZUi7q2Jf4b7HKg8etDtoKJ' \
  -H 'Content-Type: application/xml' \
  -d '<gateway>
        <gateway_type>barclaycard_smartpay</gateway_type>
        <company>Your company</company>
        <merchant>Your merchant name</merchant>
        <password>Your password</password>
      </gateway>'

<gateway>
  <token>8SgPuGcRVXRn5ppQSOiEsixKiOK</token>
  <gateway_type>barclaycard_smartpay</gateway_type>
  <name>Barclaycard Smartpay</name>
  <description nil="true"/>
  <company>Your company</company>
  <merchant>Your merchant name</merchant>
  <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">false</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">true</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>company</name>
      <value>Your company</value>
    </credential>
    <credential>
      <name>merchant</name>
      <value>Your merchant name</value>
    </credential>
  </credentials>
  <gateway_specific_fields>
  </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-07-27T17:47:48Z</created_at>
  <updated_at type="dateTime">2017-07-27T17:47:48Z</updated_at>
</gateway>


env = Spreedly::Environment.new('C7cRfNJGODKh4Iu5Ox3PToKjniY', '4UIuWybmdythfNGPqAqyQnYha6s451ri0fYAo4p3drZUi7q2Jf4b7HKg8etDtoKJ', base_url: 'https://core.spreedly.com')
env.add_gateway(:barclaycard_smartpay, company: "Your company", merchant: "Your merchant name", password: "Your password")


#<Spreedly::Gateway:0x007fe333aa7d28
@token="IzLVrcp5UQ6KNwXIe4StfXbgIbc",
@created_at="2017-07-27T17:47:48Z",
@updated_at="2017-07-27T17:47:48Z",
@gateway_type="barclaycard_smartpay",
@state="retained",
@name="Barclaycard Smartpay",
@credentials={"company"=>"Your company", "merchant"=>"Your merchant name"}>

Gateway specific response fields

A response from Barclaycard Smartpay gateway may contain an auth_code field which you can find in the gateway_specific_response_fields. For example, a transaction could have something like this:

<transaction>
  <token>LgpTNGjsWQs9DwdxcbreUVz0R8p</token>
  <transaction_type>Purchase</transaction_type>
  <gateway_specific_response_fields>
     <barclaycard_smartpay>
       <auth_code>IJK2DZ</auth_code>
       <refusal_reason>Declined</refusal_reason>
       <refusal_reason_raw>Raw reason</refusal_reason_raw>
     </barclaycard_smartpay>
  </gateway_specific_response_fields>
</transaction>

Gateway specific request fields

When interacting with a Barclaycard Smartpay gateway to run transactions, there are gateway specific fields you can specify.

  • customer
  • house_number
  • street
  • shipping_house_number
  • shipping_street
  • date_of_birth
  • entity_type
  • nationality
  • shopper_name

You can specify customer which is a value used to uniquely identify a customer. If supplied it can be also be used in fraud checking.

Greater address accuracy can be achieved when specifying house_number and street, and / or shipping_house_number and shipping_street, in addition to the standard address fields.

When issuing general credits (also known as payouts), the fields date_of_birth, entity_type, nationality, and shopper_name will be required after October 29th, 2017. They are not required for any other action.


curl https://core.spreedly.com/v1/gateways/LlkjmEk0xNkcWrNixXa1fvNoTP4/purchase.xml \
  -u 'C7cRfNJGODKh4Iu5Ox3PToKjniY:4UIuWybmdythfNGPqAqyQnYha6s451ri0fYAo4p3drZUi7q2Jf4b7HKg8etDtoKJ' \
  -H 'Content-Type: application/xml' \
  -d '<transaction>
        <payment_method_token>56wyNnSmuA6CWYP7w0MiYCVIbW6</payment_method_token>
        <amount>100</amount>
        <currency_code>USD</currency_code>
        <gateway_specific_fields>
          <barclaycard_smartpay>
            <customer>3341</customer>
            <house_number>321</house_number>
            <street>Billing Rd.</street>
            <shipping_house_number>789</shipping_house_number>
            <shipping_street>Shipping Rd.</shipping_street>
            <date_of_birth>1990-10-11</date_of_birth>
            <entity_type>NaturalPerson</entity_type>
            <nationality>US</nationality>
            <shopper_name>
              <firstName>Bob</firstName>
              <lastName>Jones</lastName>
              <gender>UNKNOWN</gender>
            </shopper_name>
          </barclaycard_smartpay>
        </gateway_specific_fields>
      </transaction>'

<transaction>
  <on_test_gateway type="boolean">true</on_test_gateway>
  <created_at type="dateTime">2017-10-26T20:09:46Z</created_at>
  <updated_at type="dateTime">2017-10-26T20:09:46Z</updated_at>
  <succeeded type="boolean">true</succeeded>
  <state>succeeded</state>
  <token>7QcEdRxXkoRmaqqqWamnBdNkS70</token>
  <transaction_type>Purchase</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>
    <barclaycard_smartpay>
      <customer>3341</customer>
      <house_number>321</house_number>
      <street>Billing Rd.</street>
      <shipping_house_number>789</shipping_house_number>
      <shipping_street>Shipping Rd.</shipping_street>
      <date_of_birth>1990-10-11</date_of_birth>
      <entity_type>NaturalPerson</entity_type>
      <nationality>US</nationality>
      <shopper_name>
        <firstName>Bob</firstName>
        <lastName>Jones</lastName>
        <gender>UNKNOWN</gender>
      </shopper_name>
    </barclaycard_smartpay>
  </gateway_specific_fields>
  <gateway_specific_response_fields>
  </gateway_specific_response_fields>
  <gateway_transaction_id>51</gateway_transaction_id>
  <gateway_latency_ms type="integer">24</gateway_latency_ms>
  <amount type="integer">100</amount>
  <currency_code>USD</currency_code>
  <retain_on_success type="boolean">false</retain_on_success>
  <payment_method_added type="boolean">false</payment_method_added>
  <message key="messages.transaction_succeeded">Succeeded!</message>
  <gateway_token>T11bJAANtTWnxl36GYjKWvbNK0g</gateway_token>
  <shipping_address>
    <name>Newfirst Newlast</name>
    <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 purchase</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-10-26T20:09:46Z</created_at>
    <updated_at type="dateTime">2017-10-26T20:09:46Z</updated_at>
  </response>
  <api_urls>
  </api_urls>
  <payment_method>
    <token>1rpKvP8zOUhj4Y9EDrIoIYQzzD5</token>
    <created_at type="dateTime">2017-06-26T17:04:38Z</created_at>
    <updated_at type="dateTime">2017-10-26T20:08:05Z</updated_at>
    <email>joey@example.com</email>
    <data nil="true"/>
    <storage_state>retained</storage_state>
    <test type="boolean">true</test>
    <last_four_digits>1111</last_four_digits>
    <first_six_digits>411111</first_six_digits>
    <card_type>visa</card_type>
    <first_name>Newfirst</first_name>
    <last_name>Newlast</last_name>
    <month type="integer">3</month>
    <year type="integer">2032</year>
    <address1 nil="true"/>
    <address2 nil="true"/>
    <city nil="true"/>
    <state nil="true"/>
    <zip nil="true"/>
    <country nil="true"/>
    <phone_number nil="true"/>
    <company nil="true"/>
    <full_name>Newfirst Newlast</full_name>
    <eligible_for_card_updater nil="true"/>
    <shipping_address1 nil="true"/>
    <shipping_address2 nil="true"/>
    <shipping_city nil="true"/>
    <shipping_state nil="true"/>
    <shipping_zip nil="true"/>
    <shipping_country nil="true"/>
    <shipping_phone_number nil="true"/>
    <payment_method_type>credit_card</payment_method_type>
    <errors>
    </errors>
    <verification_value></verification_value>
    <number>XXXX-XXXX-XXXX-1111</number>
    <fingerprint nil="true"/>
  </payment_method>
</transaction>


env = Spreedly::Environment.new('C7cRfNJGODKh4Iu5Ox3PToKjniY', '4UIuWybmdythfNGPqAqyQnYha6s451ri0fYAo4p3drZUi7q2Jf4b7HKg8etDtoKJ', base_url: 'https://core.spreedly.com')
env.purchase_on_gateway("LlkjmEk0xNkcWrNixXa1fvNoTP4", "56wyNnSmuA6CWYP7w0MiYCVIbW6", 4432,
  gateway_specific_fields: {
    barclaycard_smartpay: {
      customer: "19311"
    }
  }
)


#<Spreedly::Purchase:0x007fcffdc841f8
 @amount="4432",
 @created_at="2017-10-02T11:28:02Z",
 @currency_code="USD",
 @description="",
 @email="",
 @gateway_specific_fields={:barclaycard_smartpay=>{:customer=>"19311"}},
 @gateway_token="6BFNYDngHrv4RKitiOtzMaKhOJ0",
 @gateway_transaction_id="59",
 @ip="",
 @merchant_location_descriptor="",
 @merchant_name_descriptor="",
 @message="Succeeded!",
 @on_test_gateway="true",
 @order_id="",
 @payment_method=
  #<Spreedly::CreditCard:0x007fcfff96fd08
   @address1="",
   @address2="",
   @card_type="visa",
   @city="",
   @company="",
   @country="",
   @created_at="2017-09-13T08:30:12Z",
   @data="",
   @eligible_for_card_updater="",
   @email="hello@example.com",
   @errors=[],
   @fingerprint="",
   @first_name="Homer",
   @first_six_digits="411111",
   @full_name="Homer Simpson",
   @last_four_digits="1111",
   @last_name="Simpson",
   @month="3",
   @number="XXXX-XXXX-XXXX-1111",
   @phone_number="",
   @state="",
   @storage_state="retained",
   @token="FUk3o2H9KlIxHoYJ85lVrgtOk6T",
   @updated_at="2017-10-02T11:24:37Z",
   @verification_value="",
   @year="2032",
   @zip="">,
 @response=
  #<Spreedly::Response:0x007fcfff8f85a0
   @avs_code="",
   @avs_message="",
   @cancelled="false",
   @created_at="2017-10-02T11:28:02Z",
   @cvv_code="",
   @cvv_message="",
   @error_code="",
   @error_detail="",
   @fraud_review="",
   @message="Successful purchase",
   @pending="false",
   @success="true",
   @updated_at="2017-10-02T11:28:02Z">,
 @shipping_address=
  #<Spreedly::ShippingAddress:0x007fcfff93f298
   @address1="",
   @address2="",
   @city="",
   @country="",
   @name="Homer Simpson",
   @phone_number="",
   @state="",
   @zip="">,
 @state="succeeded",
 @succeeded="true",
 @token="7sRajZPiFTXczICRygp5G9iBkbt",
 @updated_at="2017-10-02T11:28:02Z">

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.