Stripe Gateway Guide

close

Services and Compatibility

Payment Gateway Company Name:
Stripe
Services that work with Spreedly:
  • Stripe
Supported operations:
Purchase, Authorize, Capture, Refund, Void, Verify, Store
Supported payment types:
Credit Card, Apple Pay, Bank Account, Android Pay
Regions:
Asia Pacific, Europe, North America

Authentication and Security

Specific names for credentials:
Login

Onboarding Merchants in:

Adding a stripe gateway

To add a Stripe gateway you just need to supply a login, which is your api secret key at Stripe:


curl https://core.spreedly.com/v1/gateways.xml \
  -u 'Ll6fAtoVSTyVMlJEmtpoJV8S:RKOCG5D8D3fZxDSg504D0IxU2XD4Io5VXmyzdCtTivHFTTSy' \
  -H 'Content-Type: application/xml' \
  -d '<gateway>
        <gateway_type>stripe</gateway_type>
        <login>your api secret key</login>
      </gateway>'

<gateway>
  <token>6bzIND7rWCCGDutNx6ZWyXX2YYR</token>
  <gateway_type>stripe</gateway_type>
  <name>Stripe</name>
  <description nil="true"/>
  <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">false</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">true</supports_remove>
    <supports_fraud_review type="boolean">false</supports_fraud_review>
    <supports_disburse type="boolean">false</supports_disburse>
  </characteristics>
  <credentials>
  </credentials>
  <gateway_specific_fields>
    <gateway_specific_field>statement_description</gateway_specific_field>
    <gateway_specific_field>destination</gateway_specific_field>
    <gateway_specific_field>idempotency_key</gateway_specific_field>
    <gateway_specific_field>receipt_email</gateway_specific_field>
    <gateway_specific_field>application_fee</gateway_specific_field>
    <gateway_specific_field>stripe_account</gateway_specific_field>
    <gateway_specific_field>metadata</gateway_specific_field>
    <gateway_specific_field>refund_application_fee</gateway_specific_field>
    <gateway_specific_field>refund_fee_amount</gateway_specific_field>
    <gateway_specific_field>reverse_transfer</gateway_specific_field>
    <gateway_specific_field>account_id</gateway_specific_field>
    <gateway_specific_field>customer_id</gateway_specific_field>
    <gateway_specific_field>validate</gateway_specific_field>
    <gateway_specific_field>make_default</gateway_specific_field>
  </gateway_specific_fields>
  <payment_methods>
    <payment_method>credit_card</payment_method>
    <payment_method>third_party_token</payment_method>
    <payment_method>apple_pay</payment_method>
    <payment_method>android_pay</payment_method>
    <payment_method>bank_account</payment_method>
  </payment_methods>
  <state>retained</state>
  <redacted type="boolean">false</redacted>
  <created_at type="dateTime">2016-08-11T17:16:00Z</created_at>
  <updated_at type="dateTime">2016-08-11T17:16:00Z</updated_at>
</gateway>

Stripe Connect

Stripe Connect allows you to obtain permission from your customer to access their Stripe account. If you have a Stripe Connect standalone account you will go through the OAuth process, at the end of which you’ll have an access_token. Once you have that access_token, you can create a gateway in Core by passing it as the login parameter like so:


curl https://core.spreedly.com/v1/gateways.xml \
  -u 'Ll6fAtoVSTyVMlJEmtpoJV8S:RKOCG5D8D3fZxDSg504D0IxU2XD4Io5VXmyzdCtTivHFTTSy' \
  -H 'Content-Type: application/xml' \
  -d '<gateway>
        <gateway_type>stripe</gateway_type>
        <login>access_token you received</login>
      </gateway>'

<gateway>
  <token>Zgut6KJD17APDthzu7wzGgSSDwO</token>
  <gateway_type>stripe</gateway_type>
  <name>Stripe</name>
  <description nil="true"/>
  <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">false</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">true</supports_remove>
    <supports_fraud_review type="boolean">false</supports_fraud_review>
    <supports_disburse type="boolean">false</supports_disburse>
  </characteristics>
  <credentials>
  </credentials>
  <gateway_specific_fields>
    <gateway_specific_field>statement_description</gateway_specific_field>
    <gateway_specific_field>destination</gateway_specific_field>
    <gateway_specific_field>idempotency_key</gateway_specific_field>
    <gateway_specific_field>receipt_email</gateway_specific_field>
    <gateway_specific_field>application_fee</gateway_specific_field>
    <gateway_specific_field>stripe_account</gateway_specific_field>
    <gateway_specific_field>metadata</gateway_specific_field>
    <gateway_specific_field>refund_application_fee</gateway_specific_field>
    <gateway_specific_field>refund_fee_amount</gateway_specific_field>
    <gateway_specific_field>reverse_transfer</gateway_specific_field>
    <gateway_specific_field>account_id</gateway_specific_field>
    <gateway_specific_field>customer_id</gateway_specific_field>
    <gateway_specific_field>validate</gateway_specific_field>
    <gateway_specific_field>make_default</gateway_specific_field>
  </gateway_specific_fields>
  <payment_methods>
    <payment_method>credit_card</payment_method>
    <payment_method>third_party_token</payment_method>
    <payment_method>apple_pay</payment_method>
    <payment_method>bank_account</payment_method>
  </payment_methods>
  <state>retained</state>
  <redacted type="boolean">false</redacted>
  <created_at type="dateTime">2016-08-11T17:16:00Z</created_at>
  <updated_at type="dateTime">2016-08-11T17:16:00Z</updated_at>
</gateway>

If you’re using a Stripe Connect managed account, you can create a Stripe gateway normally without having to go through the OAuth process.

To use Stripe Connect (whether it be standalone or managed), your Stripe account will likely need a special one-time approval from Stripe. Stripe prefers you to log in and contact them directly via their support form so they can confirm you own the account.

Here’s an example message for Stripe Support:

We would love to use Stripe Connect. In the past, you’ve been able to remove a restriction such that others wouldn’t receive this error message: “OAuth based requests must use card tokens from Stripe.js, but card details were directly provided”.

We have a live publishable key of: “live publishable key” Can you remove the restriction for us as well?

ACH Transactions

Stripe supports ACH transactions but requires bank accounts be stored and verified before use. Stripe does not support making a purchase or refund with a bank account directly.

First, create the bank account payment method in Spreedly.

curl https://core.spreedly.com/v1/payment_methods.xml \
  -u 'Ll6fAtoVSTyVMlJEmtpoJV8S:RKOCG5D8D3fZxDSg504D0IxU2XD4Io5VXmyzdCtTivHFTTSy' \
  -H 'Content-Type: application/xml' \
  -d '<payment_method>
        <bank_account>
            <first_name>Jon</first_name>
            <last_name>Doe</last_name>
            <bank_routing_number>021000021</bank_routing_number>
            <bank_account_number>9876543210</bank_account_number>
            <bank_account_type>checking</bank_account_type>
            <bank_account_holder_type>personal</bank_account_holder_type>
        </bank_account>
        <email>jon.doe@example.com</email>
        <data>
            <my_payment_method_identifier>448</my_payment_method_identifier>
            <extra_stuff>
                <some_other_things>Can be anything really</some_other_things>
            </extra_stuff>
        </data>
      </payment_method>'

and get the output:

<transaction>
  <token>B3roXmGPfmu4eAP8K905jfELZgp</token>
  <created_at type="dateTime">2017-01-10T15:15:38Z</created_at>
  <updated_at type="dateTime">2017-01-10T15:15:38Z</updated_at>
  <succeeded type="boolean">true</succeeded>
  <transaction_type>AddPaymentMethod</transaction_type>
  <retained type="boolean">false</retained>
  <state>succeeded</state>
  <message key="messages.transaction_succeeded">Succeeded!</message>
  <payment_method>
    <token>Qos30e5vEcjPfRzrSxcTXxtK3jt</token>
    <created_at type="dateTime">2017-01-10T15:15:38Z</created_at>
    <updated_at type="dateTime">2017-01-10T15:15:38Z</updated_at>
    <email>jon.doe@example.com</email>
    <data>
      <my_payment_method_identifier>448</my_payment_method_identifier>
      <extra_stuff>
        <some_other_things>Can be anything really</some_other_things>
      </extra_stuff>
    </data>
    <storage_state>cached</storage_state>
    <test type="boolean">true</test>
    <full_name>Jon Doe</full_name>
    <bank_name nil="true"/>
    <account_type>checking</account_type>
    <account_holder_type>personal</account_holder_type>
    <routing_number_display_digits>021</routing_number_display_digits>
    <account_number_display_digits>3210</account_number_display_digits>
    <first_name>Jon</first_name>
    <last_name>Doe</last_name>
    <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"/>
    <payment_method_type>bank_account</payment_method_type>
    <errors>
    </errors>
    <routing_number>021*</routing_number>
    <account_number>*3210</account_number>
  </payment_method>
</transaction>

Second, use third party vaulting to store that payment method in Stripe.

curl https://core.spreedly.com/v1/gateways/LlkjmEk0xNkcWrNixXa1fvNoTP4/store.xml \
  -u 'Ll6fAtoVSTyVMlJEmtpoJV8S:RKOCG5D8D3fZxDSg504D0IxU2XD4Io5VXmyzdCtTivHFTTSy' \
  -H 'Content-Type: application/xml' \
  -d '<transaction>
        <payment_method_token>PsZvGrh0mIrmxzHQUNAscxyA7B1</payment_method_token>
      </transaction>'

and get the output:

<transaction>
  <created_at type="dateTime">2015-12-02T20:47:25Z</created_at>
  <updated_at type="dateTime">2015-12-02T20:47:25Z</updated_at>
  <succeeded type="boolean">true</succeeded>
  <token>LjrY8RmuVklBWtnGFskt9PMZdv6</token>
  <state>succeeded</state>
  <gateway_specific_fields nil="true"></gateway_specific_fields>
  <gateway_specific_response_fields>
    <stripe>
      <customer_id>cus_7s6levMt8IqhTR</customer_id>
      <bank_account_id>ba_17cMXgAWOtgoysog7UDWXbn4</bank_account_id>
    </stripe>
  </gateway_specific_response_fields>
  <transaction_type>Store</transaction_type>
  <third_party_token nil="true"></third_party_token>
  <gateway_transaction_id>cus_7s6levMt8IqhTR|ba_17cMXgAWOtgoysog7UDWXbn4</gateway_transaction_id>
  <message key="messages.transaction_succeeded">Succeeded!</message>
  <payment_method>
    <token>LgpTNGjsWQs9DwdxcbreUVz0R8p</token>
    <created_at type="dateTime">2015-12-02T20:47:25Z</created_at>
    <updated_at type="dateTime">2015-12-02T20:47:25Z</updated_at>
    <gateway_type>stripe</gateway_type>
    <storage_state>retained</storage_state>
    <third_party_token>cus_7s6levMt8IqhTR|ba_17cMXgAWOtgoysog7UDWXbn4</third_party_token>
    <payment_method_type>third_party_token</payment_method_type>
    <errors></errors>
  </payment_method>
  <basis_payment_method>
    <token>PsZvGrh0mIrmxzHQUNAscxyA7B1</token>
    <created_at type="dateTime">2015-12-02T20:47:13Z</created_at>
    <updated_at type="dateTime">2015-12-02T20:47:13Z</updated_at>
    <email>joey@example.com</email>
    <data>
      <my_payment_method_identifier>448</my_payment_method_identifier>
      <extra_stuff>
        <some_other_things>Can be anything really</some_other_things>
      </extra_stuff>
    </data>
    <storage_state>cached</storage_state>
    <test type="boolean">true</test>
    <full_name>Joey Jones</full_name>
    <bank_name nil="true"/>
    <account_type>checking</account_type>
    <account_holder_type>personal</account_holder_type>
    <routing_number_display_digits>021</routing_number_display_digits>
    <account_number_display_digits>3210</account_number_display_digits>
    <first_name>Joey</first_name>
    <last_name>Jones</last_name>
    <payment_method_type>bank_account</payment_method_type>
    <errors></errors>
    <routing_number>021*</routing_number>
    <account_number>*3210</account_number>
  </basis_payment_method>
  <response>
    <success type="boolean">true</success>
    <message>Transaction approved</message>
    <avs_code nil="true"></avs_code>
    <avs_message nil="true"></avs_message>
    <cvv_code nil="true"></cvv_code>
    <cvv_message nil="true"></cvv_message>
    <pending type="boolean">false</pending>
    <result_unknown type="boolean">false</result_unknown>
    <error_code nil="true"/>
    <error_detail nil="true"/>
    <cancelled type="boolean">false</cancelled>
    <fraud_review nil="true"/>
    <created_at type="dateTime">2015-12-02T20:47:25Z</created_at>
    <updated_at type="dateTime">2015-12-02T20:47:25Z</updated_at>
  </response>
</transaction>

Third, after the bank account has been stored it will need to be verified by Stripe before it can be used for transactions.

Stripe will make two small deposits into the stored bank account. You will need to verify the vaules with Stripe by using their API directly. For this verification you will need the Stripe customer_id and bank_account_id fields from Stripe included in the gateway_specific_response_fields from the third party vaulting response.

Finally, once the bank account has been verified the payment_method_token can be used for transactions.

Optional Gateway Specific Fields

Stripe Connect application_fee

When using Stripe Connect, Stripe allows you to specify an application_fee which is a number of cents to be charged on top of Stripe’s normal fees. When making a purchase, authorize, or capture call, you can specify the application_fee like so:


curl https://core.spreedly.com/v1/gateways/LlkjmEk0xNkcWrNixXa1fvNoTP4/purchase.xml \
  -u 'Ll6fAtoVSTyVMlJEmtpoJV8S:RKOCG5D8D3fZxDSg504D0IxU2XD4Io5VXmyzdCtTivHFTTSy' \
  -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>
          <stripe>
            <application_fee>103</application_fee>
          </stripe>
        </gateway_specific_fields>
      </transaction>'

<transaction>
  <on_test_gateway type="boolean">true</on_test_gateway>
  <created_at type="dateTime">2016-08-11T17:16:00Z</created_at>
  <updated_at type="dateTime">2016-08-11T17:16:00Z</updated_at>
  <succeeded type="boolean">true</succeeded>
  <state>succeeded</state>
  <token>A7zU6vSVk21ZTKFB6VNTGTXYyrR</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>
    <stripe>
      <application_fee>103</application_fee>
    </stripe>
  </gateway_specific_fields>
  <gateway_specific_response_fields>
  </gateway_specific_response_fields>
  <gateway_transaction_id>68</gateway_transaction_id>
  <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>8dvNMSuDr3kTlMIQxbkIaE5KNlX</gateway_token>
  <shipping_address>
    <name>Robert Lemke</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">2016-08-11T17:16:00Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:16:00Z</updated_at>
  </response>
  <api_urls>
  </api_urls>
  <payment_method>
    <token>UAwoPyWJhwZiYe2ZY1ri6ENAjLG</token>
    <created_at type="dateTime">2016-08-11T17:09:30Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:16:00Z</updated_at>
    <email nil="true"/>
    <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>Robert</first_name>
    <last_name>Lemke</last_name>
    <month type="integer">4</month>
    <year type="integer">2020</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>Robert Lemke</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>b0a45066121c1f1a49b3a6ffc26caf2995db</fingerprint>
  </payment_method>
</transaction>


env = Spreedly::Environment.new('Ll6fAtoVSTyMlJEm', 'RKcG5D8D3fZxDSg504U2XD4Io5VXz')
env.purchase_on_gateway("LlkjmEk0xNkcWrNixXa1fvNoTP4", "56wyNnSmuA6CWYP7w0MiYCVIbW6", 4432,
  gateway_specific_fields: {
    stripe: {
      application_fee: 233
    }
  }
)


#<Spreedly::Purchase:0x007faada019be0
 @amount="4432",
 @created_at="2016-08-11T17:16:01Z",
 @currency_code="USD",
 @description="",
 @email="",
 @gateway_specific_fields={:stripe=>{:application_fee=>"233"}},
 @gateway_token="8dvNMSuDr3kTlMIQxbkIaE5KNlX",
 @gateway_transaction_id="68",
 @ip="",
 @merchant_location_descriptor="",
 @merchant_name_descriptor="",
 @message="Succeeded!",
 @on_test_gateway="true",
 @order_id="",
 @payment_method=
  #<Spreedly::CreditCard:0x007faad92847a0
   @address1="",
   @address2="",
   @card_type="visa",
   @city="",
   @company="",
   @country="",
   @created_at="2016-08-11T17:09:30Z",
   @data="",
   @eligible_for_card_updater="",
   @email="",
   @errors=[],
   @fingerprint="b0a45066121c1f1a49b3a6ffc26caf2995db",
   @first_name="Robert",
   @first_six_digits="411111",
   @full_name="Robert Lemke",
   @last_four_digits="1111",
   @last_name="Lemke",
   @month="4",
   @number="XXXX-XXXX-XXXX-1111",
   @phone_number="",
   @state="",
   @storage_state="retained",
   @token="UAwoPyWJhwZiYe2ZY1ri6ENAjLG",
   @updated_at="2016-08-11T17:16:00Z",
   @verification_value="",
   @year="2020",
   @zip="">,
 @response=
  #<Spreedly::Response:0x007faada059718
   @avs_code="",
   @avs_message="",
   @cancelled="false",
   @created_at="2016-08-11T17:16:01Z",
   @cvv_code="",
   @cvv_message="",
   @error_code="",
   @error_detail="",
   @fraud_review="",
   @message="Successful purchase",
   @pending="false",
   @success="true",
   @updated_at="2016-08-11T17:16:01Z">,
 @shipping_address=
  #<Spreedly::ShippingAddress:0x007faad9287f40
   @address1="",
   @address2="",
   @city="",
   @country="",
   @name="Robert Lemke",
   @phone_number="",
   @state="",
   @zip="">,
 @state="succeeded",
 @succeeded="true",
 @token="KxiOBXsvAWv2nghWXH8QnRfBczi",
 @updated_at="2016-08-11T17:16:01Z">

Stripe refund_application_fee

This is an optional parameter you can specify when you run a refund on Stripe. It indicates whether the Stripe Connect application_fee should be refunded when refunding the charge.


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

<transaction>
  <on_test_gateway type="boolean">true</on_test_gateway>
  <created_at type="dateTime">2016-08-11T17:16:08Z</created_at>
  <updated_at type="dateTime">2016-08-11T17:16:08Z</updated_at>
  <succeeded type="boolean">true</succeeded>
  <state>succeeded</state>
  <token>SFtQKffA5pArtgjfJWPotzbIJ4V</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>
    <stripe>
      <refund_application_fee>true</refund_application_fee>
    </stripe>
  </gateway_specific_fields>
  <gateway_specific_response_fields>
  </gateway_specific_response_fields>
  <gateway_transaction_id>48</gateway_transaction_id>
  <amount type="integer">100</amount>
  <currency_code>USD</currency_code>
  <message key="messages.transaction_succeeded">Succeeded!</message>
  <gateway_token>8dvNMSuDr3kTlMIQxbkIaE5KNlX</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-08-11T17:16:08Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:16:08Z</updated_at>
  </response>
  <api_urls>
  </api_urls>
  <reference_token>EiFydnhzoWaTCqw92JouEIAQlK5</reference_token>
</transaction>


env = Spreedly::Environment.new('Ll6fAtoVSTyMlJEm', 'RKcG5D8D3fZxDSg504U2XD4Io5VXz')
env.refund_transaction("7DShFlwqVtUvhyackYN2Jtw2UGn",
  gateway_specific_fields: {
    stripe: {
      refund_application_fee: true
    }
  }
)


#<Spreedly::Refund:0x007f886a3d2698
 @amount="100",
 @created_at="2016-08-11T17:16:09Z",
 @currency_code="USD",
 @description="",
 @email="",
 @gateway_specific_fields={:stripe=>{:refund_application_fee=>"true"}},
 @gateway_token="8dvNMSuDr3kTlMIQxbkIaE5KNlX",
 @gateway_transaction_id="68",
 @ip="",
 @merchant_location_descriptor="",
 @merchant_name_descriptor="",
 @message="Succeeded!",
 @on_test_gateway="true",
 @order_id="",
 @reference_token="UWxfc3FMzCWg2eVhRR3PCzBhvAP",
 @response=
  #<Spreedly::Response:0x007f8868b958a0
   @avs_code="",
   @avs_message="",
   @cancelled="false",
   @created_at="2016-08-11T17:16:09Z",
   @cvv_code="",
   @cvv_message="",
   @error_code="",
   @error_detail="",
   @fraud_review="",
   @message="Successful credit",
   @pending="false",
   @success="true",
   @updated_at="2016-08-11T17:16:09Z">,
 @shipping_address=
  #<Spreedly::ShippingAddress:0x007f8868bb4110
   @address1="",
   @address2="",
   @city="",
   @country="",
   @name="",
   @phone_number="",
   @state="",
   @zip="">,
 @state="succeeded",
 @succeeded="true",
 @token="CmsaOQ8PDd0BxecVsyIBHdR7fxO",
 @updated_at="2016-08-11T17:16:09Z">

Stripe refund_fee_amount

Specify a specific amount of the Stripe Connect application fee that should be refunded. If an amount is specified here, do not use the refund_application_fee field.


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

<transaction>
  <on_test_gateway type="boolean">true</on_test_gateway>
  <created_at type="dateTime">2016-08-11T17:16:09Z</created_at>
  <updated_at type="dateTime">2016-08-11T17:16:09Z</updated_at>
  <succeeded type="boolean">true</succeeded>
  <state>succeeded</state>
  <token>44aZe8Krr7osZUzx6vMqtTzYTJL</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>
    <stripe>
      <refund_fee_amount>95</refund_fee_amount>
    </stripe>
  </gateway_specific_fields>
  <gateway_specific_response_fields>
  </gateway_specific_response_fields>
  <gateway_transaction_id>65</gateway_transaction_id>
  <amount type="integer">100</amount>
  <currency_code>USD</currency_code>
  <message key="messages.transaction_succeeded">Succeeded!</message>
  <gateway_token>8dvNMSuDr3kTlMIQxbkIaE5KNlX</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-08-11T17:16:09Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:16:09Z</updated_at>
  </response>
  <api_urls>
  </api_urls>
  <reference_token>IGlutYU9I2ofZk75r3cguvHkrri</reference_token>
</transaction>


env = Spreedly::Environment.new('Ll6fAtoVSTyMlJEm', 'RKcG5D8D3fZxDSg504U2XD4Io5VXz')
env.refund_transaction("7DShFlwqVtUvhyackYN2Jtw2UGn",
  gateway_specific_fields: {
    stripe: {
      refund_fee_amount: 95
    }
  }
)


#<Spreedly::Refund:0x007fba62b3a5c8
 @amount="100",
 @created_at="2016-08-11T17:16:10Z",
 @currency_code="USD",
 @description="",
 @email="",
 @gateway_specific_fields={:stripe=>{:refund_fee_amount=>"95"}},
 @gateway_token="8dvNMSuDr3kTlMIQxbkIaE5KNlX",
 @gateway_transaction_id="44",
 @ip="",
 @merchant_location_descriptor="",
 @merchant_name_descriptor="",
 @message="Succeeded!",
 @on_test_gateway="true",
 @order_id="",
 @reference_token="CJVsEh5e4AO3ODD8bxbogetmOW8",
 @response=
  #<Spreedly::Response:0x007fba62b617e0
   @avs_code="",
   @avs_message="",
   @cancelled="false",
   @created_at="2016-08-11T17:16:10Z",
   @cvv_code="",
   @cvv_message="",
   @error_code="",
   @error_detail="",
   @fraud_review="",
   @message="Successful credit",
   @pending="false",
   @success="true",
   @updated_at="2016-08-11T17:16:10Z">,
 @shipping_address=
  #<Spreedly::ShippingAddress:0x007fba62b80050
   @address1="",
   @address2="",
   @city="",
   @country="",
   @name="",
   @phone_number="",
   @state="",
   @zip="">,
 @state="succeeded",
 @succeeded="true",
 @token="AwT7w9WYYqKmskwYIkbkPfbIhNn",
 @updated_at="2016-08-11T17:16:10Z">

Stripe reverse_transfer

This is an optional parameter you can specify when you run a refund:


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

<transaction>
  <on_test_gateway type="boolean">true</on_test_gateway>
  <created_at type="dateTime">2016-08-11T17:16:10Z</created_at>
  <updated_at type="dateTime">2016-08-11T17:16:10Z</updated_at>
  <succeeded type="boolean">true</succeeded>
  <state>succeeded</state>
  <token>EexJMwMEWB7rw8paxMWzC30YijB</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>
    <stripe>
      <reverse_transfer>true</reverse_transfer>
    </stripe>
  </gateway_specific_fields>
  <gateway_specific_response_fields>
  </gateway_specific_response_fields>
  <gateway_transaction_id>54</gateway_transaction_id>
  <amount type="integer">100</amount>
  <currency_code>USD</currency_code>
  <message key="messages.transaction_succeeded">Succeeded!</message>
  <gateway_token>8dvNMSuDr3kTlMIQxbkIaE5KNlX</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-08-11T17:16:10Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:16:10Z</updated_at>
  </response>
  <api_urls>
  </api_urls>
  <reference_token>3jVZfzNVTaDzyQsaCbt1HJkisIv</reference_token>
</transaction>


env = Spreedly::Environment.new('Ll6fAtoVSTyMlJEm', 'RKcG5D8D3fZxDSg504U2XD4Io5VXz')
env.refund_transaction("7DShFlwqVtUvhyackYN2Jtw2UGn",
  gateway_specific_fields: {
    stripe: {
      reverse_transfer: true
    }
  }
)


#<Spreedly::Refund:0x007fb3c264e7e0
 @amount="100",
 @created_at="2016-08-11T17:16:11Z",
 @currency_code="USD",
 @description="",
 @email="",
 @gateway_specific_fields={:stripe=>{:reverse_transfer=>"true"}},
 @gateway_token="8dvNMSuDr3kTlMIQxbkIaE5KNlX",
 @gateway_transaction_id="66",
 @ip="",
 @merchant_location_descriptor="",
 @merchant_name_descriptor="",
 @message="Succeeded!",
 @on_test_gateway="true",
 @order_id="",
 @reference_token="NYFWDLdpqGm45NQsvdPdjlXHpjT",
 @response=
  #<Spreedly::Response:0x007fb3c2969a10
   @avs_code="",
   @avs_message="",
   @cancelled="false",
   @created_at="2016-08-11T17:16:11Z",
   @cvv_code="",
   @cvv_message="",
   @error_code="",
   @error_detail="",
   @fraud_review="",
   @message="Successful credit",
   @pending="false",
   @success="true",
   @updated_at="2016-08-11T17:16:11Z">,
 @shipping_address=
  #<Spreedly::ShippingAddress:0x007fb3c2984298
   @address1="",
   @address2="",
   @city="",
   @country="",
   @name="",
   @phone_number="",
   @state="",
   @zip="">,
 @state="succeeded",
 @succeeded="true",
 @token="Yz1NMefUxfZrsAJSJdtO2DWDD5H",
 @updated_at="2016-08-11T17:16:11Z">

Stripe statement_description

An arbitrary string to be displayed on your customer’s credit card statement. You can specify it like so:


curl https://core.spreedly.com/v1/gateways/LlkjmEk0xNkcWrNixXa1fvNoTP4/purchase.xml \
  -u 'Ll6fAtoVSTyVMlJEmtpoJV8S:RKOCG5D8D3fZxDSg504D0IxU2XD4Io5VXmyzdCtTivHFTTSy' \
  -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>
          <stripe>
            <statement_description>5K Race Ticket</statement_description>
          </stripe>
        </gateway_specific_fields>
      </transaction>'

<transaction>
  <on_test_gateway type="boolean">true</on_test_gateway>
  <created_at type="dateTime">2016-08-11T17:16:12Z</created_at>
  <updated_at type="dateTime">2016-08-11T17:16:12Z</updated_at>
  <succeeded type="boolean">true</succeeded>
  <state>succeeded</state>
  <token>DHSXLLcZRasSluGJI5hhbcb5qfN</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>
    <stripe>
      <statement_description>5K Race Ticket</statement_description>
    </stripe>
  </gateway_specific_fields>
  <gateway_specific_response_fields>
  </gateway_specific_response_fields>
  <gateway_transaction_id>56</gateway_transaction_id>
  <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>8dvNMSuDr3kTlMIQxbkIaE5KNlX</gateway_token>
  <shipping_address>
    <name>Robert Lemke</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">2016-08-11T17:16:12Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:16:12Z</updated_at>
  </response>
  <api_urls>
  </api_urls>
  <payment_method>
    <token>UAwoPyWJhwZiYe2ZY1ri6ENAjLG</token>
    <created_at type="dateTime">2016-08-11T17:09:30Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:16:11Z</updated_at>
    <email nil="true"/>
    <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>Robert</first_name>
    <last_name>Lemke</last_name>
    <month type="integer">4</month>
    <year type="integer">2020</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>Robert Lemke</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>b0a45066121c1f1a49b3a6ffc26caf2995db</fingerprint>
  </payment_method>
</transaction>


env = Spreedly::Environment.new('Ll6fAtoVSTyMlJEm', 'RKcG5D8D3fZxDSg504U2XD4Io5VXz')
env.purchase_on_gateway("LlkjmEk0xNkcWrNixXa1fvNoTP4", "56wyNnSmuA6CWYP7w0MiYCVIbW6", 4432,
  gateway_specific_fields: {
    stripe: {
      statement_description: "5K Race Ticket"
    }
  }
)


#<Spreedly::Purchase:0x007fc2da079dc0
 @amount="4432",
 @created_at="2016-08-11T17:16:12Z",
 @currency_code="USD",
 @description="",
 @email="",
 @gateway_specific_fields=
  {:stripe=>{:statement_description=>"5K Race Ticket"}},
 @gateway_token="8dvNMSuDr3kTlMIQxbkIaE5KNlX",
 @gateway_transaction_id="50",
 @ip="",
 @merchant_location_descriptor="",
 @merchant_name_descriptor="",
 @message="Succeeded!",
 @on_test_gateway="true",
 @order_id="",
 @payment_method=
  #<Spreedly::CreditCard:0x007fc2da0cc980
   @address1="",
   @address2="",
   @card_type="visa",
   @city="",
   @company="",
   @country="",
   @created_at="2016-08-11T17:09:30Z",
   @data="",
   @eligible_for_card_updater="",
   @email="",
   @errors=[],
   @fingerprint="b0a45066121c1f1a49b3a6ffc26caf2995db",
   @first_name="Robert",
   @first_six_digits="411111",
   @full_name="Robert Lemke",
   @last_four_digits="1111",
   @last_name="Lemke",
   @month="4",
   @number="XXXX-XXXX-XXXX-1111",
   @phone_number="",
   @state="",
   @storage_state="retained",
   @token="UAwoPyWJhwZiYe2ZY1ri6ENAjLG",
   @updated_at="2016-08-11T17:16:12Z",
   @verification_value="",
   @year="2020",
   @zip="">,
 @response=
  #<Spreedly::Response:0x007fc2da09d900
   @avs_code="",
   @avs_message="",
   @cancelled="false",
   @created_at="2016-08-11T17:16:13Z",
   @cvv_code="",
   @cvv_message="",
   @error_code="",
   @error_detail="",
   @fraud_review="",
   @message="Successful purchase",
   @pending="false",
   @success="true",
   @updated_at="2016-08-11T17:16:13Z">,
 @shipping_address=
  #<Spreedly::ShippingAddress:0x007fc2da0bc170
   @address1="",
   @address2="",
   @city="",
   @country="",
   @name="Robert Lemke",
   @phone_number="",
   @state="",
   @zip="">,
 @state="succeeded",
 @succeeded="true",
 @token="A8Ure9B47ddgm1CLlTwdnk8k2iW",
 @updated_at="2016-08-11T17:16:13Z">

Stripe destination

Setting a destination parameter identifies the Stripe account that should receive the funds from the payment. When making a purchase call, you can specify the destination like so:


curl https://core.spreedly.com/v1/gateways/LlkjmEk0xNkcWrNixXa1fvNoTP4/purchase.xml \
  -u 'Ll6fAtoVSTyVMlJEmtpoJV8S:RKOCG5D8D3fZxDSg504D0IxU2XD4Io5VXmyzdCtTivHFTTSy' \
  -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>
          <stripe>
            <destination>123456789</destination>
          </stripe>
        </gateway_specific_fields>
      </transaction>'

<transaction>
  <on_test_gateway type="boolean">true</on_test_gateway>
  <created_at type="dateTime">2016-08-11T17:16:04Z</created_at>
  <updated_at type="dateTime">2016-08-11T17:16:04Z</updated_at>
  <succeeded type="boolean">true</succeeded>
  <state>succeeded</state>
  <token>VuGq9gWinQURkIpqWbvm16TAHX1</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>
    <stripe>
      <destination>123456789</destination>
    </stripe>
  </gateway_specific_fields>
  <gateway_specific_response_fields>
  </gateway_specific_response_fields>
  <gateway_transaction_id>67</gateway_transaction_id>
  <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>8dvNMSuDr3kTlMIQxbkIaE5KNlX</gateway_token>
  <shipping_address>
    <name>Robert Lemke</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">2016-08-11T17:16:04Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:16:04Z</updated_at>
  </response>
  <api_urls>
  </api_urls>
  <payment_method>
    <token>UAwoPyWJhwZiYe2ZY1ri6ENAjLG</token>
    <created_at type="dateTime">2016-08-11T17:09:30Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:16:02Z</updated_at>
    <email nil="true"/>
    <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>Robert</first_name>
    <last_name>Lemke</last_name>
    <month type="integer">4</month>
    <year type="integer">2020</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>Robert Lemke</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>b0a45066121c1f1a49b3a6ffc26caf2995db</fingerprint>
  </payment_method>
</transaction>


env = Spreedly::Environment.new('Ll6fAtoVSTyMlJEm', 'RKcG5D8D3fZxDSg504U2XD4Io5VXz')
env.refund_transaction("7DShFlwqVtUvhyackYN2Jtw2UGn",
  gateway_specific_fields: {
    stripe: {
      destination: 123456789
    }
  }
)


#<Spreedly::Refund:0x007f9c33472710
 @amount="100",
 @created_at="2016-08-11T17:16:05Z",
 @currency_code="USD",
 @description="",
 @email="",
 @gateway_specific_fields={:stripe=>{:destination=>"123456789"}},
 @gateway_token="8dvNMSuDr3kTlMIQxbkIaE5KNlX",
 @gateway_transaction_id="47",
 @ip="",
 @merchant_location_descriptor="",
 @merchant_name_descriptor="",
 @message="Succeeded!",
 @on_test_gateway="true",
 @order_id="",
 @reference_token="P4EEioKL793iFpHyQebHc8NO1Wr",
 @response=
  #<Spreedly::Response:0x007f9c3402d938
   @avs_code="",
   @avs_message="",
   @cancelled="false",
   @created_at="2016-08-11T17:16:05Z",
   @cvv_code="",
   @cvv_message="",
   @error_code="",
   @error_detail="",
   @fraud_review="",
   @message="Successful credit",
   @pending="false",
   @success="true",
   @updated_at="2016-08-11T17:16:05Z">,
 @shipping_address=
  #<Spreedly::ShippingAddress:0x007f9c32a841b8
   @address1="",
   @address2="",
   @city="",
   @country="",
   @name="",
   @phone_number="",
   @state="",
   @zip="">,
 @state="succeeded",
 @succeeded="true",
 @token="BX9YuEQbXhScuil1G29qzIBBuMl",
 @updated_at="2016-08-11T17:16:05Z">

Stripe customer_id

When storing a credit card in the Stripe vault using third party vaulting, you can specify a customer_id if you’d like to add the card onto an existing customer in your Stripe account:


curl https://core.spreedly.com/v1/gateways/LlkjmEk0xNkcWrNixXa1fvNoTP4/store.xml \
  -u 'Ll6fAtoVSTyVMlJEmtpoJV8S:RKOCG5D8D3fZxDSg504D0IxU2XD4Io5VXmyzdCtTivHFTTSy' \
  -H 'Content-Type: application/xml' \
  -d '<transaction>
        <payment_method_token>56wyNnSmuA6CWYP7w0MiYCVIbW6</payment_method_token>
        <gateway_specific_fields>
          <stripe>
            <customer_id>cus_3sgheFxeBgTQ8m</customer_id>
          </stripe>
        </gateway_specific_fields>
      </transaction>'

<transaction>
  <created_at type="dateTime">2016-08-11T17:16:01Z</created_at>
  <updated_at type="dateTime">2016-08-11T17:16:02Z</updated_at>
  <succeeded type="boolean">true</succeeded>
  <token>Q9BsnwDTf6uAhacFqbitpPBHQ37</token>
  <state>succeeded</state>
  <gateway_specific_fields>
    <stripe>
      <customer_id>cus_3sgheFxeBgTQ8m</customer_id>
    </stripe>
  </gateway_specific_fields>
  <gateway_specific_response_fields>
  </gateway_specific_response_fields>
  <transaction_type>Store</transaction_type>
  <third_party_token nil="true"/>
  <gateway_transaction_id>65</gateway_transaction_id>
  <message key="messages.transaction_succeeded">Succeeded!</message>
  <gateway_token>8dvNMSuDr3kTlMIQxbkIaE5KNlX</gateway_token>
  <payment_method>
    <token>HJWo2taZrt8nsdNItCWEtt21nfG</token>
    <created_at type="dateTime">2016-08-11T17:16:01Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:16:01Z</updated_at>
    <gateway_type>test</gateway_type>
    <storage_state>retained</storage_state>
    <third_party_token>test_vault:4111111111111111</third_party_token>
    <payment_method_type>third_party_token</payment_method_type>
    <errors>
    </errors>
  </payment_method>
  <basis_payment_method>
    <token>UAwoPyWJhwZiYe2ZY1ri6ENAjLG</token>
    <created_at type="dateTime">2016-08-11T17:09:30Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:16:01Z</updated_at>
    <email nil="true"/>
    <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>Robert</first_name>
    <last_name>Lemke</last_name>
    <month type="integer">4</month>
    <year type="integer">2020</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>Robert Lemke</full_name>
    <eligible_for_card_updater type="boolean">true</eligible_for_card_updater>
    <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>b0a45066121c1f1a49b3a6ffc26caf2995db</fingerprint>
  </basis_payment_method>
  <response>
    <success type="boolean">true</success>
    <message>Successful store</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-08-11T17:16:01Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:16:02Z</updated_at>
  </response>
</transaction>


env = Spreedly::Environment.new('Ll6fAtoVSTyMlJEm', 'RKcG5D8D3fZxDSg504U2XD4Io5VXz')
env.purchase_on_gateway("LlkjmEk0xNkcWrNixXa1fvNoTP4", "56wyNnSmuA6CWYP7w0MiYCVIbW6", 4432,
  gateway_specific_fields: {
    stripe: {
      customer_id: "cus_3sgheFxeBgTQ8m"
    }
  }
)


#<Spreedly::Purchase:0x007fab51819cb0
 @amount="4432",
 @created_at="2016-08-11T17:16:02Z",
 @currency_code="USD",
 @description="",
 @email="",
 @gateway_specific_fields={:stripe=>{:customer_id=>"cus_3sgheFxeBgTQ8m"}},
 @gateway_token="8dvNMSuDr3kTlMIQxbkIaE5KNlX",
 @gateway_transaction_id="50",
 @ip="",
 @merchant_location_descriptor="",
 @merchant_name_descriptor="",
 @message="Succeeded!",
 @on_test_gateway="true",
 @order_id="",
 @payment_method=
  #<Spreedly::CreditCard:0x007fab52514898
   @address1="",
   @address2="",
   @card_type="visa",
   @city="",
   @company="",
   @country="",
   @created_at="2016-08-11T17:09:30Z",
   @data="",
   @eligible_for_card_updater="",
   @email="",
   @errors=[],
   @fingerprint="b0a45066121c1f1a49b3a6ffc26caf2995db",
   @first_name="Robert",
   @first_six_digits="411111",
   @full_name="Robert Lemke",
   @last_four_digits="1111",
   @last_name="Lemke",
   @month="4",
   @number="XXXX-XXXX-XXXX-1111",
   @phone_number="",
   @state="",
   @storage_state="retained",
   @token="UAwoPyWJhwZiYe2ZY1ri6ENAjLG",
   @updated_at="2016-08-11T17:16:01Z",
   @verification_value="",
   @year="2020",
   @zip="">,
 @response=
  #<Spreedly::Response:0x007fab525057f8
   @avs_code="",
   @avs_message="",
   @cancelled="false",
   @created_at="2016-08-11T17:16:02Z",
   @cvv_code="",
   @cvv_message="",
   @error_code="",
   @error_detail="",
   @fraud_review="",
   @message="Successful purchase",
   @pending="false",
   @success="true",
   @updated_at="2016-08-11T17:16:02Z">,
 @shipping_address=
  #<Spreedly::ShippingAddress:0x007fab5250c080
   @address1="",
   @address2="",
   @city="",
   @country="",
   @name="Robert Lemke",
   @phone_number="",
   @state="",
   @zip="">,
 @state="succeeded",
 @succeeded="true",
 @token="7kfteERdfu5dG42VrsZFBhRZLj3",
 @updated_at="2016-08-11T17:16:02Z">

Stripe account_id

When storing a credit card in the Stripe vault using third party vaulting, you can specify an account_id if you’d like to add the card onto an existing managed account within your Stripe account:


curl https://core.spreedly.com/v1/gateways/LlkjmEk0xNkcWrNixXa1fvNoTP4/store.xml \
  -u 'Ll6fAtoVSTyVMlJEmtpoJV8S:RKOCG5D8D3fZxDSg504D0IxU2XD4Io5VXmyzdCtTivHFTTSy' \
  -H 'Content-Type: application/xml' \
  -d '<transaction>
        <payment_method_token>56wyNnSmuA6CWYP7w0MiYCVIbW6</payment_method_token>
        <gateway_specific_fields>
          <stripe>
            <account_id>acct_3sgheFxeBgTQ8m</account_id>
          </stripe>
        </gateway_specific_fields>
      </transaction>'

<transaction>
  <created_at type="dateTime">2016-08-11T17:15:59Z</created_at>
  <updated_at type="dateTime">2016-08-11T17:15:59Z</updated_at>
  <succeeded type="boolean">true</succeeded>
  <token>FfqkpvzYgTmq3d91q2K5wYkGrUv</token>
  <state>succeeded</state>
  <gateway_specific_fields>
    <stripe>
      <account_id>acct_3sgheFxeBgTQ8m</account_id>
    </stripe>
  </gateway_specific_fields>
  <gateway_specific_response_fields>
  </gateway_specific_response_fields>
  <transaction_type>Store</transaction_type>
  <third_party_token nil="true"/>
  <gateway_transaction_id>48</gateway_transaction_id>
  <message key="messages.transaction_succeeded">Succeeded!</message>
  <gateway_token>8dvNMSuDr3kTlMIQxbkIaE5KNlX</gateway_token>
  <payment_method>
    <token>KjPb2Xj802Ne05EPexV6vvi7mX6</token>
    <created_at type="dateTime">2016-08-11T17:15:59Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:15:59Z</updated_at>
    <gateway_type>test</gateway_type>
    <storage_state>retained</storage_state>
    <third_party_token>test_vault:4111111111111111</third_party_token>
    <payment_method_type>third_party_token</payment_method_type>
    <errors>
    </errors>
  </payment_method>
  <basis_payment_method>
    <token>UAwoPyWJhwZiYe2ZY1ri6ENAjLG</token>
    <created_at type="dateTime">2016-08-11T17:09:30Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:15:59Z</updated_at>
    <email nil="true"/>
    <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>Robert</first_name>
    <last_name>Lemke</last_name>
    <month type="integer">4</month>
    <year type="integer">2020</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>Robert Lemke</full_name>
    <eligible_for_card_updater type="boolean">true</eligible_for_card_updater>
    <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>b0a45066121c1f1a49b3a6ffc26caf2995db</fingerprint>
  </basis_payment_method>
  <response>
    <success type="boolean">true</success>
    <message>Successful store</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-08-11T17:15:59Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:15:59Z</updated_at>
  </response>
</transaction>


env = Spreedly::Environment.new('Ll6fAtoVSTyMlJEm', 'RKcG5D8D3fZxDSg504U2XD4Io5VXz')
env.purchase_on_gateway("LlkjmEk0xNkcWrNixXa1fvNoTP4", "56wyNnSmuA6CWYP7w0MiYCVIbW6", 4432,
  gateway_specific_fields: {
    stripe: {
      account_id: "acct_3sgheFxeBgTQ8m"
    }
  }
)


#<Spreedly::Purchase:0x007fd5f0d35d10
 @amount="4432",
 @created_at="2016-08-11T17:16:00Z",
 @currency_code="USD",
 @description="",
 @email="",
 @gateway_specific_fields={:stripe=>{:account_id=>"acct_3sgheFxeBgTQ8m"}},
 @gateway_token="8dvNMSuDr3kTlMIQxbkIaE5KNlX",
 @gateway_transaction_id="49",
 @ip="",
 @merchant_location_descriptor="",
 @merchant_name_descriptor="",
 @message="Succeeded!",
 @on_test_gateway="true",
 @order_id="",
 @payment_method=
  #<Spreedly::CreditCard:0x007fd5f19688f8
   @address1="",
   @address2="",
   @card_type="visa",
   @city="",
   @company="",
   @country="",
   @created_at="2016-08-11T17:09:30Z",
   @data="",
   @eligible_for_card_updater="",
   @email="",
   @errors=[],
   @fingerprint="b0a45066121c1f1a49b3a6ffc26caf2995db",
   @first_name="Robert",
   @first_six_digits="411111",
   @full_name="Robert Lemke",
   @last_four_digits="1111",
   @last_name="Lemke",
   @month="4",
   @number="XXXX-XXXX-XXXX-1111",
   @phone_number="",
   @state="",
   @storage_state="retained",
   @token="UAwoPyWJhwZiYe2ZY1ri6ENAjLG",
   @updated_at="2016-08-11T17:15:59Z",
   @verification_value="",
   @year="2020",
   @zip="">,
 @response=
  #<Spreedly::Response:0x007fd5f1925850
   @avs_code="",
   @avs_message="",
   @cancelled="false",
   @created_at="2016-08-11T17:16:00Z",
   @cvv_code="",
   @cvv_message="",
   @error_code="",
   @error_detail="",
   @fraud_review="",
   @message="Successful purchase",
   @pending="false",
   @success="true",
   @updated_at="2016-08-11T17:16:00Z">,
 @shipping_address=
  #<Spreedly::ShippingAddress:0x007fd5f19480d0
   @address1="",
   @address2="",
   @city="",
   @country="",
   @name="Robert Lemke",
   @phone_number="",
   @state="",
   @zip="">,
 @state="succeeded",
 @succeeded="true",
 @token="82UVIKKefEM8B4UgK0r69u2PgEl",
 @updated_at="2016-08-11T17:16:00Z">

Stripe validate

When storing a credit card in the Stripe vault using third party vaulting, you can specify a validate option and set it to false if you would like Stripe to skip their card validations:


curl https://core.spreedly.com/v1/gateways/LlkjmEk0xNkcWrNixXa1fvNoTP4/store.xml \
  -u 'Ll6fAtoVSTyVMlJEmtpoJV8S:RKOCG5D8D3fZxDSg504D0IxU2XD4Io5VXmyzdCtTivHFTTSy' \
  -H 'Content-Type: application/xml' \
  -d '<transaction>
        <payment_method_token>TtSvidJm3e4Lmza4l8Je5Bwuqmf</payment_method_token>
        <gateway_specific_fields>
          <stripe>
            <validate>false</validate>
          </stripe>
        </gateway_specific_fields>
      </transaction>'

<transaction>
  <created_at type="dateTime">2016-08-11T17:16:14Z</created_at>
  <updated_at type="dateTime">2016-08-11T17:16:14Z</updated_at>
  <succeeded type="boolean">true</succeeded>
  <token>A9FIDqm9yDtbY6jUMqhWXsCos1U</token>
  <state>succeeded</state>
  <gateway_specific_fields>
    <stripe>
      <validate>false</validate>
    </stripe>
  </gateway_specific_fields>
  <gateway_specific_response_fields>
  </gateway_specific_response_fields>
  <transaction_type>Store</transaction_type>
  <third_party_token nil="true"/>
  <gateway_transaction_id>54</gateway_transaction_id>
  <message key="messages.transaction_succeeded">Succeeded!</message>
  <gateway_token>8dvNMSuDr3kTlMIQxbkIaE5KNlX</gateway_token>
  <payment_method>
    <token>2mi6S1UL8SupGFEBkJbBss3fhIa</token>
    <created_at type="dateTime">2016-08-11T17:16:14Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:16:14Z</updated_at>
    <gateway_type>test</gateway_type>
    <storage_state>retained</storage_state>
    <third_party_token>test_vault:4012888888881881</third_party_token>
    <payment_method_type>third_party_token</payment_method_type>
    <errors>
    </errors>
  </payment_method>
  <basis_payment_method>
    <token>ZnprV9wH3cMlHiOTbMUfrJeRYY1</token>
    <created_at type="dateTime">2016-08-11T17:09:30Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:16:14Z</updated_at>
    <email nil="true"/>
    <data nil="true"/>
    <storage_state>retained</storage_state>
    <test type="boolean">true</test>
    <last_four_digits>1881</last_four_digits>
    <first_six_digits>401288</first_six_digits>
    <card_type>visa</card_type>
    <first_name>Mark</first_name>
    <last_name>Buckridge</last_name>
    <month type="integer">4</month>
    <year type="integer">2020</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>Mark Buckridge</full_name>
    <eligible_for_card_updater type="boolean">true</eligible_for_card_updater>
    <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-1881</number>
    <fingerprint>20dfe7eff8b1c51b5a8274bd0afdba9833ec</fingerprint>
  </basis_payment_method>
  <response>
    <success type="boolean">true</success>
    <message>Successful store</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-08-11T17:16:14Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:16:14Z</updated_at>
  </response>
</transaction>


env = Spreedly::Environment.new('Ll6fAtoVSTyMlJEm', 'RKcG5D8D3fZxDSg504U2XD4Io5VXz')
env.purchase_on_gateway("LlkjmEk0xNkcWrNixXa1fvNoTP4", "TtSvidJm3e4Lmza4l8Je5Bwuqmf", 4432,
  gateway_specific_fields: {
    stripe: {
      validate: false
    }
  }
)


#<Spreedly::Purchase:0x007fb81926dd28
 @amount="4432",
 @created_at="2016-08-11T17:16:15Z",
 @currency_code="USD",
 @description="",
 @email="",
 @gateway_specific_fields={:stripe=>{:validate=>"false"}},
 @gateway_token="8dvNMSuDr3kTlMIQxbkIaE5KNlX",
 @gateway_transaction_id="",
 @ip="",
 @merchant_location_descriptor="",
 @merchant_name_descriptor="",
 @message="Unable to process the purchase transaction.",
 @on_test_gateway="true",
 @order_id="",
 @payment_method=
  #<Spreedly::CreditCard:0x007fb8192f8bf8
   @address1="",
   @address2="",
   @card_type="visa",
   @city="",
   @company="",
   @country="",
   @created_at="2016-08-11T17:09:30Z",
   @data="",
   @eligible_for_card_updater="",
   @email="",
   @errors=[],
   @fingerprint="20dfe7eff8b1c51b5a8274bd0afdba9833ec",
   @first_name="Mark",
   @first_six_digits="401288",
   @full_name="Mark Buckridge",
   @last_four_digits="1881",
   @last_name="Buckridge",
   @month="4",
   @number="XXXX-XXXX-XXXX-1881",
   @phone_number="",
   @state="",
   @storage_state="retained",
   @token="ZnprV9wH3cMlHiOTbMUfrJeRYY1",
   @updated_at="2016-08-11T17:16:14Z",
   @verification_value="",
   @year="2020",
   @zip="">,
 @response=
  #<Spreedly::Response:0x007fb8192b1bb8
   @avs_code="",
   @avs_message="",
   @cancelled="false",
   @created_at="2016-08-11T17:16:15Z",
   @cvv_code="",
   @cvv_message="",
   @error_code="",
   @error_detail="",
   @fraud_review="",
   @message="Unable to process the purchase transaction.",
   @pending="false",
   @success="false",
   @updated_at="2016-08-11T17:16:15Z">,
 @shipping_address=
  #<Spreedly::ShippingAddress:0x007fb8192d43e8
   @address1="",
   @address2="",
   @city="",
   @country="",
   @name="Mark Buckridge",
   @phone_number="",
   @state="",
   @zip="">,
 @state="gateway_processing_failed",
 @succeeded="false",
 @token="7WOMyLofLqgNg4G75awSUyUGnjH",
 @updated_at="2016-08-11T17:16:15Z">

Stripe make_default

When storing a credit card in the Stripe vault using third party vaulting, you can specify that you’d like the card you’re storing to be the default card for that customer:


curl https://core.spreedly.com/v1/gateways/LlkjmEk0xNkcWrNixXa1fvNoTP4/store.xml \
  -u 'Ll6fAtoVSTyVMlJEmtpoJV8S:RKOCG5D8D3fZxDSg504D0IxU2XD4Io5VXmyzdCtTivHFTTSy' \
  -H 'Content-Type: application/xml' \
  -d '<transaction>
        <payment_method_token>TtSvidJm3e4Lmza4l8Je5Bwuqmf</payment_method_token>
        <gateway_specific_fields>
          <stripe>
            <customer_id>cus_3sgheFxeBgTQ8m</customer_id>
            <make_default>true</make_default>
          </stripe>
        </gateway_specific_fields>
      </transaction>'

<transaction>
  <created_at type="dateTime">2016-08-11T17:16:03Z</created_at>
  <updated_at type="dateTime">2016-08-11T17:16:03Z</updated_at>
  <succeeded type="boolean">true</succeeded>
  <token>9y9syXQAKci8348x0Cqyw1RxEJw</token>
  <state>succeeded</state>
  <gateway_specific_fields>
    <stripe>
      <customer_id>cus_3sgheFxeBgTQ8m</customer_id>
      <make_default>true</make_default>
    </stripe>
  </gateway_specific_fields>
  <gateway_specific_response_fields>
  </gateway_specific_response_fields>
  <transaction_type>Store</transaction_type>
  <third_party_token nil="true"/>
  <gateway_transaction_id>62</gateway_transaction_id>
  <message key="messages.transaction_succeeded">Succeeded!</message>
  <gateway_token>8dvNMSuDr3kTlMIQxbkIaE5KNlX</gateway_token>
  <payment_method>
    <token>GCLmqEa9SbFmdlnGe8TgpmA4gmr</token>
    <created_at type="dateTime">2016-08-11T17:16:03Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:16:03Z</updated_at>
    <gateway_type>test</gateway_type>
    <storage_state>retained</storage_state>
    <third_party_token>test_vault:4012888888881881</third_party_token>
    <payment_method_type>third_party_token</payment_method_type>
    <errors>
    </errors>
  </payment_method>
  <basis_payment_method>
    <token>ZnprV9wH3cMlHiOTbMUfrJeRYY1</token>
    <created_at type="dateTime">2016-08-11T17:09:30Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:16:03Z</updated_at>
    <email nil="true"/>
    <data nil="true"/>
    <storage_state>retained</storage_state>
    <test type="boolean">true</test>
    <last_four_digits>1881</last_four_digits>
    <first_six_digits>401288</first_six_digits>
    <card_type>visa</card_type>
    <first_name>Mark</first_name>
    <last_name>Buckridge</last_name>
    <month type="integer">4</month>
    <year type="integer">2020</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>Mark Buckridge</full_name>
    <eligible_for_card_updater type="boolean">true</eligible_for_card_updater>
    <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-1881</number>
    <fingerprint>20dfe7eff8b1c51b5a8274bd0afdba9833ec</fingerprint>
  </basis_payment_method>
  <response>
    <success type="boolean">true</success>
    <message>Successful store</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-08-11T17:16:03Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:16:03Z</updated_at>
  </response>
</transaction>


env = Spreedly::Environment.new('Ll6fAtoVSTyMlJEm', 'RKcG5D8D3fZxDSg504U2XD4Io5VXz')
env.purchase_on_gateway("LlkjmEk0xNkcWrNixXa1fvNoTP4", "TtSvidJm3e4Lmza4l8Je5Bwuqmf", 4432,
  gateway_specific_fields: {
    stripe: {
      customer_id: "cus_3sgheFxeBgTQ8m",
      make_default: true
    }
  }
)


#<Spreedly::Purchase:0x007f823b835b70
 @amount="4432",
 @created_at="2016-08-11T17:16:03Z",
 @currency_code="USD",
 @description="",
 @email="",
 @gateway_specific_fields=
  {:stripe=>{:customer_id=>"cus_3sgheFxeBgTQ8m", :make_default=>"true"}},
 @gateway_token="8dvNMSuDr3kTlMIQxbkIaE5KNlX",
 @gateway_transaction_id="",
 @ip="",
 @merchant_location_descriptor="",
 @merchant_name_descriptor="",
 @message="Unable to process the purchase transaction.",
 @on_test_gateway="true",
 @order_id="",
 @payment_method=
  #<Spreedly::CreditCard:0x007f8239b389c8
   @address1="",
   @address2="",
   @card_type="visa",
   @city="",
   @company="",
   @country="",
   @created_at="2016-08-11T17:09:30Z",
   @data="",
   @eligible_for_card_updater="",
   @email="",
   @errors=[],
   @fingerprint="20dfe7eff8b1c51b5a8274bd0afdba9833ec",
   @first_name="Mark",
   @first_six_digits="401288",
   @full_name="Mark Buckridge",
   @last_four_digits="1881",
   @last_name="Buckridge",
   @month="4",
   @number="XXXX-XXXX-XXXX-1881",
   @phone_number="",
   @state="",
   @storage_state="retained",
   @token="ZnprV9wH3cMlHiOTbMUfrJeRYY1",
   @updated_at="2016-08-11T17:16:03Z",
   @verification_value="",
   @year="2020",
   @zip="">,
 @response=
  #<Spreedly::Response:0x007f8239af99d0
   @avs_code="",
   @avs_message="",
   @cancelled="false",
   @created_at="2016-08-11T17:16:03Z",
   @cvv_code="",
   @cvv_message="",
   @error_code="",
   @error_detail="",
   @fraud_review="",
   @message="Unable to process the purchase transaction.",
   @pending="false",
   @success="false",
   @updated_at="2016-08-11T17:16:03Z">,
 @shipping_address=
  #<Spreedly::ShippingAddress:0x007f8239b18218
   @address1="",
   @address2="",
   @city="",
   @country="",
   @name="Mark Buckridge",
   @phone_number="",
   @state="",
   @zip="">,
 @state="gateway_processing_failed",
 @succeeded="false",
 @token="F3VPYXT2zjF1ZK46p8LvwePu2Mz",
 @updated_at="2016-08-11T17:16:03Z">

Stripe idempotency_key

The idempotency_key is for safely retrying requests without accidentally performing the same operation twice.


curl https://core.spreedly.com/v1/gateways/LlkjmEk0xNkcWrNixXa1fvNoTP4/purchase.xml \
  -u 'Ll6fAtoVSTyVMlJEmtpoJV8S:RKOCG5D8D3fZxDSg504D0IxU2XD4Io5VXmyzdCtTivHFTTSy' \
  -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>
          <stripe>
            <idempotency_key>idempotency_key</idempotency_key>
          </stripe>
        </gateway_specific_fields>
      </transaction>'

<transaction>
  <on_test_gateway type="boolean">true</on_test_gateway>
  <created_at type="dateTime">2016-08-11T17:16:05Z</created_at>
  <updated_at type="dateTime">2016-08-11T17:16:05Z</updated_at>
  <succeeded type="boolean">true</succeeded>
  <state>succeeded</state>
  <token>BpJKCWk7EdSQNiHeu6XRdHzoNre</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>
    <stripe>
      <idempotency_key>idempotency_key</idempotency_key>
    </stripe>
  </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>
  <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>8dvNMSuDr3kTlMIQxbkIaE5KNlX</gateway_token>
  <shipping_address>
    <name>Robert Lemke</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">2016-08-11T17:16:05Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:16:05Z</updated_at>
  </response>
  <api_urls>
  </api_urls>
  <payment_method>
    <token>UAwoPyWJhwZiYe2ZY1ri6ENAjLG</token>
    <created_at type="dateTime">2016-08-11T17:09:30Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:16:04Z</updated_at>
    <email nil="true"/>
    <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>Robert</first_name>
    <last_name>Lemke</last_name>
    <month type="integer">4</month>
    <year type="integer">2020</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>Robert Lemke</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>b0a45066121c1f1a49b3a6ffc26caf2995db</fingerprint>
  </payment_method>
</transaction>


env = Spreedly::Environment.new('Ll6fAtoVSTyMlJEm', 'RKcG5D8D3fZxDSg504U2XD4Io5VXz')
env.refund_transaction("7DShFlwqVtUvhyackYN2Jtw2UGn",
  gateway_specific_fields: {
    stripe: {
      idempotency_key: "idempotency_key"
    }
  }
)


#<Spreedly::Refund:0x007fc898c22730
 @amount="100",
 @created_at="2016-08-11T17:16:06Z",
 @currency_code="USD",
 @description="",
 @email="",
 @gateway_specific_fields={:stripe=>{:idempotency_key=>"idempotency_key"}},
 @gateway_token="8dvNMSuDr3kTlMIQxbkIaE5KNlX",
 @gateway_transaction_id="47",
 @ip="",
 @merchant_location_descriptor="",
 @merchant_name_descriptor="",
 @message="Succeeded!",
 @on_test_gateway="true",
 @order_id="",
 @reference_token="ENLnwSzB6qXr65eXP9BYqNXn576",
 @response=
  #<Spreedly::Response:0x007fc898c45960
   @avs_code="",
   @avs_message="",
   @cancelled="false",
   @created_at="2016-08-11T17:16:06Z",
   @cvv_code="",
   @cvv_message="",
   @error_code="",
   @error_detail="",
   @fraud_review="",
   @message="Successful credit",
   @pending="false",
   @success="true",
   @updated_at="2016-08-11T17:16:06Z">,
 @shipping_address=
  #<Spreedly::ShippingAddress:0x007fc898c601e8
   @address1="",
   @address2="",
   @city="",
   @country="",
   @name="",
   @phone_number="",
   @state="",
   @zip="">,
 @state="succeeded",
 @succeeded="true",
 @token="6Q05giUrUPirZAJnX65cOxh3E6Q",
 @updated_at="2016-08-11T17:16:06Z">

Stripe metadata

The metadata array is for attaching custom key-value data to Stripe transactions.


curl https://core.spreedly.com/v1/gateways/LlkjmEk0xNkcWrNixXa1fvNoTP4/purchase.xml \
  -u 'Ll6fAtoVSTyVMlJEmtpoJV8S:RKOCG5D8D3fZxDSg504D0IxU2XD4Io5VXmyzdCtTivHFTTSy' \
  -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>
          <stripe>
          <metadata>
            <hat_type>Fedora</hat_type>
            <cat_name>Waffles</cat_name>
          </metadata>
          </stripe>
        </gateway_specific_fields>
      </transaction>'

<transaction>
  <on_test_gateway type="boolean">true</on_test_gateway>
  <created_at type="dateTime">2016-08-11T17:16:06Z</created_at>
  <updated_at type="dateTime">2016-08-11T17:16:06Z</updated_at>
  <succeeded type="boolean">true</succeeded>
  <state>succeeded</state>
  <token>ToVJbWy2OPnjxIviUX2HZNJGHlV</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>
    <stripe>
      <metadata>
        <hat_type>Fedora</hat_type>
        <cat_name>Waffles</cat_name>
      </metadata>
    </stripe>
  </gateway_specific_fields>
  <gateway_specific_response_fields>
  </gateway_specific_response_fields>
  <gateway_transaction_id>65</gateway_transaction_id>
  <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>8dvNMSuDr3kTlMIQxbkIaE5KNlX</gateway_token>
  <shipping_address>
    <name>Robert Lemke</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">2016-08-11T17:16:06Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:16:06Z</updated_at>
  </response>
  <api_urls>
  </api_urls>
  <payment_method>
    <token>UAwoPyWJhwZiYe2ZY1ri6ENAjLG</token>
    <created_at type="dateTime">2016-08-11T17:09:30Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:16:05Z</updated_at>
    <email nil="true"/>
    <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>Robert</first_name>
    <last_name>Lemke</last_name>
    <month type="integer">4</month>
    <year type="integer">2020</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>Robert Lemke</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>b0a45066121c1f1a49b3a6ffc26caf2995db</fingerprint>
  </payment_method>
</transaction>

Stripe Account

The stripe_account field is for processing a charge directly on a connected account.


curl https://core.spreedly.com/v1/gateways/LlkjmEk0xNkcWrNixXa1fvNoTP4/purchase.xml \
  -u 'Ll6fAtoVSTyVMlJEmtpoJV8S:RKOCG5D8D3fZxDSg504D0IxU2XD4Io5VXmyzdCtTivHFTTSy' \
  -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>
          <stripe>
            <stripe_account>123456789</stripe_account>
          </stripe>
        </gateway_specific_fields>
      </transaction>'

<transaction>
  <on_test_gateway type="boolean">true</on_test_gateway>
  <created_at type="dateTime">2016-08-11T17:16:13Z</created_at>
  <updated_at type="dateTime">2016-08-11T17:16:13Z</updated_at>
  <succeeded type="boolean">true</succeeded>
  <state>succeeded</state>
  <token>3mXwhC8eSK03xXqMcFL0bM3NECS</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>
    <stripe>
      <stripe_account>123456789</stripe_account>
    </stripe>
  </gateway_specific_fields>
  <gateway_specific_response_fields>
  </gateway_specific_response_fields>
  <gateway_transaction_id>47</gateway_transaction_id>
  <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>8dvNMSuDr3kTlMIQxbkIaE5KNlX</gateway_token>
  <shipping_address>
    <name>Robert Lemke</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">2016-08-11T17:16:13Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:16:13Z</updated_at>
  </response>
  <api_urls>
  </api_urls>
  <payment_method>
    <token>UAwoPyWJhwZiYe2ZY1ri6ENAjLG</token>
    <created_at type="dateTime">2016-08-11T17:09:30Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:16:13Z</updated_at>
    <email nil="true"/>
    <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>Robert</first_name>
    <last_name>Lemke</last_name>
    <month type="integer">4</month>
    <year type="integer">2020</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>Robert Lemke</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>b0a45066121c1f1a49b3a6ffc26caf2995db</fingerprint>
  </payment_method>
</transaction>


env = Spreedly::Environment.new('Ll6fAtoVSTyMlJEm', 'RKcG5D8D3fZxDSg504U2XD4Io5VXz')
env.refund_transaction("7DShFlwqVtUvhyackYN2Jtw2UGn",
  gateway_specific_fields: {
    stripe: {
      stripe_account: "123456789"
    }
  }
)


#<Spreedly::Refund:0x007fe66125e758
 @amount="100",
 @created_at="2016-08-11T17:16:14Z",
 @currency_code="USD",
 @description="",
 @email="",
 @gateway_specific_fields={:stripe=>{:stripe_account=>"123456789"}},
 @gateway_token="8dvNMSuDr3kTlMIQxbkIaE5KNlX",
 @gateway_transaction_id="45",
 @ip="",
 @merchant_location_descriptor="",
 @merchant_name_descriptor="",
 @message="Succeeded!",
 @on_test_gateway="true",
 @order_id="",
 @reference_token="YcpNqB5cniuV5bGl9D60IbeE6Yu",
 @response=
  #<Spreedly::Response:0x007fe662125980
   @avs_code="",
   @avs_message="",
   @cancelled="false",
   @created_at="2016-08-11T17:16:14Z",
   @cvv_code="",
   @cvv_message="",
   @error_code="",
   @error_detail="",
   @fraud_review="",
   @message="Successful credit",
   @pending="false",
   @success="true",
   @updated_at="2016-08-11T17:16:14Z">,
 @shipping_address=
  #<Spreedly::ShippingAddress:0x007fe662140208
   @address1="",
   @address2="",
   @city="",
   @country="",
   @name="",
   @phone_number="",
   @state="",
   @zip="">,
 @state="succeeded",
 @succeeded="true",
 @token="RgYoxDjrQHfRcdpCGVl7e0Vaz2b",
 @updated_at="2016-08-11T17:16:14Z">

Stripe receipt_email

The receipt_email field is for specifying an email address to receive the payment receipt.


curl https://core.spreedly.com/v1/gateways/LlkjmEk0xNkcWrNixXa1fvNoTP4/purchase.xml \
  -u 'Ll6fAtoVSTyVMlJEmtpoJV8S:RKOCG5D8D3fZxDSg504D0IxU2XD4Io5VXmyzdCtTivHFTTSy' \
  -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>
          <stripe>
            <receipt_email>email@example.com</receipt_email>
          </stripe>
        </gateway_specific_fields>
      </transaction>'

<transaction>
  <on_test_gateway type="boolean">true</on_test_gateway>
  <created_at type="dateTime">2016-08-11T17:16:06Z</created_at>
  <updated_at type="dateTime">2016-08-11T17:16:06Z</updated_at>
  <succeeded type="boolean">true</succeeded>
  <state>succeeded</state>
  <token>Q0DL03DbwTkvN9ZWnCOX6aSxbxM</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>
    <stripe>
      <receipt_email>email@example.com</receipt_email>
    </stripe>
  </gateway_specific_fields>
  <gateway_specific_response_fields>
  </gateway_specific_response_fields>
  <gateway_transaction_id>45</gateway_transaction_id>
  <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>8dvNMSuDr3kTlMIQxbkIaE5KNlX</gateway_token>
  <shipping_address>
    <name>Robert Lemke</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">2016-08-11T17:16:06Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:16:06Z</updated_at>
  </response>
  <api_urls>
  </api_urls>
  <payment_method>
    <token>UAwoPyWJhwZiYe2ZY1ri6ENAjLG</token>
    <created_at type="dateTime">2016-08-11T17:09:30Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:16:06Z</updated_at>
    <email nil="true"/>
    <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>Robert</first_name>
    <last_name>Lemke</last_name>
    <month type="integer">4</month>
    <year type="integer">2020</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>Robert Lemke</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>b0a45066121c1f1a49b3a6ffc26caf2995db</fingerprint>
  </payment_method>
</transaction>


env = Spreedly::Environment.new('Ll6fAtoVSTyMlJEm', 'RKcG5D8D3fZxDSg504U2XD4Io5VXz')
env.refund_transaction("7DShFlwqVtUvhyackYN2Jtw2UGn",
  gateway_specific_fields: {
    stripe: {
      receipt_email: "email@example.com"
    }
  }
)


#<Spreedly::Refund:0x007f993d82a6a8
 @amount="100",
 @created_at="2016-08-11T17:16:07Z",
 @currency_code="USD",
 @description="",
 @email="",
 @gateway_specific_fields={:stripe=>{:receipt_email=>"email@example.com"}},
 @gateway_token="8dvNMSuDr3kTlMIQxbkIaE5KNlX",
 @gateway_transaction_id="52",
 @ip="",
 @merchant_location_descriptor="",
 @merchant_name_descriptor="",
 @message="Succeeded!",
 @on_test_gateway="true",
 @order_id="",
 @reference_token="YivOuiiekkYr8C9p4IC8cc5Pbsa",
 @response=
  #<Spreedly::Response:0x007f993d2558b8
   @avs_code="",
   @avs_message="",
   @cancelled="false",
   @created_at="2016-08-11T17:16:07Z",
   @cvv_code="",
   @cvv_message="",
   @error_code="",
   @error_detail="",
   @fraud_review="",
   @message="Successful credit",
   @pending="false",
   @success="true",
   @updated_at="2016-08-11T17:16:07Z">,
 @shipping_address=
  #<Spreedly::ShippingAddress:0x007f993d278138
   @address1="",
   @address2="",
   @city="",
   @country="",
   @name="",
   @phone_number="",
   @state="",
   @zip="">,
 @state="succeeded",
 @succeeded="true",
 @token="4GtE98j7tAiAVIqnFq0hWhxCmVD",
 @updated_at="2016-08-11T17:16:07Z">

Gateway specific response fields

Stripe card_funding

A response from Stripe may include a card_funding response field that indicates what type of funding source was used to complete the transaction, such as credit or debit.

You can find this information in 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>
     <stripe>
       <card_funding>debit</card_funding>
     </stripe>
  </gateway_specific_response_fields>
</transaction>

Stripe customer_id and and bank_account_id

A response from storing a bank account payment method in Stripe will include customer_id and bank_account_id in the gateway_specific_response_fields. You will need these IDs in order to manually verify the bank account with Stripe.

<transaction>
  <token>LgpTNGjsWQs9DwdxcbreUVz0R8p</token>
  <transaction_type>Purchase</transaction_type>
  <gateway_specific_response_fields>
    <stripe>
      <customer_id>cus_7s6levMt8IqhTR</customer_id>
      <bank_account_id>ba_17cMXgAWOtgoysog7UDWXbn4</bank_account_id>
    </stripe>
  </gateway_specific_response_fields>
</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.