Stripe is designed to simplify your security requirements so that your customers remain on your site to complete a payment. This is accomplished through a combination of client-side and server-side steps:
- From your website running in the customer’s browser, the customer’s payment details are securely collected by Stripe
- Stripe responds with a representative token
- The token, along with any other form data, is submitted by the browser to your server
- Your server-side code uses that token in an API request (e.g., creating a charge)
This approach streamlines your website’s checkout flow, while sensitive payment information never touches your server. This makes it easy for you to operate in a PCI-compliant way, which can provide a significant time and financial benefit over your current setup.
Compared to other payment processors, a Stripe integration can differ in the following ways:
- Your customer never leaves your website
- Token creation isn’t tied to a specific product or amount
- There’s no need to create a client-side key on-demand (you use a set, publishable API key instead)
Preparing your integration
We recommend that you implement the following as you create tokens and charge all new customers:
With this approach, you can accept payments on Stripe without impacting your current customers.
Before you ask your payment processor to transfer data to Stripe, you should be prepared to:
- Remap customer records.
- Handle updates to payment information during the migration.
Remapping customer records
Customer records will need to be remapped on your end after the migration. For example, a customer with an email address of firstname.lastname@example.org has an ID of 42 in your database. This corresponds to a customer ID of 1893 in your previous processor’s system.
After the migration, this same customer has an ID of cus_12345 in your Stripe account. Stripe provides an import mapping file so you can update your database with the new references.
Handling updates to payment information during the migration process
Customers might need to update their payment information after you ask your previous processor to transfer your data but before it is received and imported by Stripe. During this window, payment method changes submitted to your previous processor will be lost as they aren’t included in the transferred data. Furthermore, these changes also cannot be made on Stripe as the data hasn’t been imported yet and the customer’s new Stripe customer ID isn’t yet known.
To best handle this, you should make changes to your site’s process for handling updates to saved payment information. This includes preparations to perform a self-migration for any customer without a stored Stripe customer ID:
- Create a new Customer object in Stripe for your customer
- Attach the payment method to the
- Recreate the subscription, if necessary
Updating your integration to handle these possibilities can prevent your customers from seeing errors or experiencing billing issues.