<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: mattling_dev</title>
    <description>The latest articles on DEV Community by mattling_dev (@mattling_dev).</description>
    <link>https://dev.to/mattling_dev</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F651592%2Fc358339a-69ad-4064-8f33-b912a61ef383.jpeg</url>
      <title>DEV Community: mattling_dev</title>
      <link>https://dev.to/mattling_dev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mattling_dev"/>
    <language>en</language>
    <item>
      <title>Localized Prices with Checkout</title>
      <dc:creator>mattling_dev</dc:creator>
      <pubDate>Wed, 02 Nov 2022 11:22:27 +0000</pubDate>
      <link>https://dev.to/4thzoa/localized-prices-with-checkout-4ngc</link>
      <guid>https://dev.to/4thzoa/localized-prices-with-checkout-4ngc</guid>
      <description>&lt;h2&gt;
  
  
  Intro
&lt;/h2&gt;

&lt;p&gt;When going through a checkout flow, prospective customers may abandon their cart or order when they see a currency different from their local currency. That can be for a number of reasons. It might be unclear to the customer about the exchange fee implications or whether they might incur extra bank fees when paying in different currencies.&lt;/p&gt;

&lt;p&gt;Now with &lt;a href="https://stripe.com/docs/payments/checkout/present-local-currencies" rel="noopener noreferrer"&gt;Checkout&lt;/a&gt; and Payment Links, you can use multi-currency Prices to present your customers’ local currency which can help to lower abandonment and increase conversion.&lt;/p&gt;

&lt;p&gt;Checkout automatically localizes prices if you’re using multi-currency Prices depending on your customers’ location. You can create multi-currency Prices via the Dashboard and the &lt;a href="https://stripe.com/docs/api/prices/create#create_price-currency_options" rel="noopener noreferrer"&gt;API&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What you’ll learn
&lt;/h2&gt;

&lt;p&gt;In this demo we’ll create a multi-currency Price in the Dashboard and then we’ll demonstrate how to create and test a  Checkout Session that will present a different currency to your customers, based on their location.&lt;/p&gt;

&lt;p&gt;If you’d like to learn more about Checkout, see &lt;a href="https://www.youtube.com/c/StripeDevelopers/search?query=checkout" rel="noopener noreferrer"&gt;the list of videos here&lt;/a&gt; on our StripeDevelopers YouTube channel.&lt;/p&gt;

&lt;h2&gt;
  
  
  Create a multi-currency Price
&lt;/h2&gt;

&lt;p&gt;We'll add a new Product in the &lt;a href="https://dashboard.stripe.com" rel="noopener noreferrer"&gt;Dashboard&lt;/a&gt;. Now in the Price Information section, there is an option to "+Add more currencies". &lt;/p&gt;

&lt;p&gt;The default price is 10 euros for customers in the EU, and we'll add a second price in USD. Stripe will make a suggestion of the USD price based on current exchange rates but you're free to choose your own amount.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fakh46r0omnk17q2jan93.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fakh46r0omnk17q2jan93.jpg" alt="Create a Product and multi-currency Price" width="800" height="457"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We’ll copy the Price ID for use later when creating the Checkout Session.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F808rsbzcgle3tv1sdvn7.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F808rsbzcgle3tv1sdvn7.jpg" alt="Copy the Price ID" width="800" height="457"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating a Checkout Session
&lt;/h2&gt;

&lt;p&gt;Next, we’ll create a Checkout Session with this Price ID, this example is written &lt;a href="https://stripe.com/docs/api/checkout/sessions/create?lang=ruby" rel="noopener noreferrer"&gt;in Ruby&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="n"&gt;session&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;Stripe&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Checkout&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="ss"&gt;payment_method_types: &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'card'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="ss"&gt;line_items: &lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;
    &lt;span class="ss"&gt;price: &lt;/span&gt;&lt;span class="s1"&gt;'price_1LzMQyJyGOmgcJwrvQy3bCLq'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="ss"&gt;quantity: &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;}],&lt;/span&gt;
  &lt;span class="ss"&gt;mode: &lt;/span&gt;&lt;span class="s1"&gt;'payment'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="ss"&gt;success_url: &lt;/span&gt;&lt;span class="s1"&gt;'https://example.com/success'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="ss"&gt;cancel_url: &lt;/span&gt;&lt;span class="s1"&gt;'https://example.com/cancel'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="ss"&gt;customer_email: &lt;/span&gt;&lt;span class="s1"&gt;'test+location_FR@example.com'&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;

&lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;url&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notice that we’ve provided a test email address of the form &lt;code&gt;test+location_FR.example.com&lt;/code&gt;. This is how we can simulate that customers are arriving at your checkout from different countries. If we change the &lt;code&gt;FR&lt;/code&gt; part to another &lt;a href="https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes" rel="noopener noreferrer"&gt;ISO country code&lt;/a&gt;, we can force Checkout to test the currency for that particular country if one is configured for the Price.&lt;/p&gt;

&lt;p&gt;We’ll run this code and grab the URL output to the console:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://checkout.stripe.com/c/pay/cs_test_a1U3DAWuKb0QgD33ObzV5riXIzrqzRqtcNLcqbtL3znXXLGU5DA5rA7Kwb#fidkdWxOYHwnPyd1blpxYHZxWjA0SW9vQW5PfEJKaGJmT3J3Q2ZSYjFuTGpsTHVxUUtKMG9cazNhalR2VnE0QzFkbzdWRmdDQDIyQHM0V1F9PWdnPENOd1FWfHV0XUpwPGByczdkVnQ9PWhLNTVuNzJXdEZoTCcpJ2N3amhWYHdzYHcnP3F3cGApJ2lkfGpwcVF8dWAnPyd2bGtiaWBabHFgaCcpJ2BrZGdpYFVpZGZgbWppYWB3dic%2FcXdwYHgl
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If we follow this URL, we can see that the currency in EUR is displayed for a french customer:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjbhkbqwi4ulghcpm0lmz.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjbhkbqwi4ulghcpm0lmz.jpg" alt="Currency localized to EU" width="800" height="457"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, let’s change our Checkout Session to simulate a customer arriving from the US:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="n"&gt;session&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;Stripe&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Checkout&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="ss"&gt;payment_method_types: &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'card'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="ss"&gt;line_items: &lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;
    &lt;span class="ss"&gt;price: &lt;/span&gt;&lt;span class="s1"&gt;'price_1LzMQyJyGOmgcJwrvQy3bCLq'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="ss"&gt;quantity: &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;}],&lt;/span&gt;
  &lt;span class="ss"&gt;mode: &lt;/span&gt;&lt;span class="s1"&gt;'payment'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="ss"&gt;success_url: &lt;/span&gt;&lt;span class="s1"&gt;'https://example.com/success'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="ss"&gt;cancel_url: &lt;/span&gt;&lt;span class="s1"&gt;'https://example.com/cancel'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="ss"&gt;customer_email: &lt;/span&gt;&lt;span class="s1"&gt;'test+location_US@example.com'&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;

&lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;url&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The only change that we’ve made is to change the ISO country code in the customer email address to US.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://checkout.stripe.com/c/pay/cs_test_a1vwLfWUcoaUrxJmWR1vimzsZw7D2cuqWhl1mcmPsb8Y2CXs8MvBDUVVaZ#fidkdWxOYHwnPyd1blpxYHZxWjA0SW9vQW5PfEJKaGJmT3J3Q2ZSYjFuTGpsTHVxUUtKMG9cazNhalR2VnE0QzFkbzdWRmdDQDIyQHM0V1F9PWdnPENOd1FWfHV0XUpwPGByczdkVnQ9PWhLNTVuNzJXdEZoTCcpJ2N3amhWYHdzYHcnP3F3cGApJ2lkfGpwcVF8dWAnPyd2bGtiaWBabHFgaCcpJ2BrZGdpYFVpZGZgbWppYWB3dic%2FcXdwYHgl
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If we follow this new session URL, we'll see that the local currency is presented in USD:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6mqfj5b8nrm9vtpnajfd.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6mqfj5b8nrm9vtpnajfd.jpg" alt="Currency localized to US" width="800" height="457"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Combining with Coupons, Stripe Tax and more
&lt;/h2&gt;

&lt;p&gt;Localized pricing works with Coupons, Stripe Tax, and Shipping Rates. Depending on the combination of features that you’re using, you’ll need to make sure that the according currency options are set on those features as well. You can see a list of rules &lt;a href="https://stripe.com/docs/payments/checkout/present-local-currencies#checkout-experience" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;Presenting your customers prices in their local currency will reduce cart abandonment and increase conversion rates. Now with Checkout and Payment Links you can easily support multi-currency Prices by creating them via the Dashboard or API to improve the user experience for your customers.&lt;/p&gt;

&lt;h3&gt;
  
  
  About the author
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc8rpgkqr91ivs8sxr73g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc8rpgkqr91ivs8sxr73g.png" alt="Matthew Ling" width="400" height="400"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Matthew Ling (&lt;a href="https://dev.to@mattling_dev"&gt;@mattling_dev&lt;/a&gt;) is a Developer Advocate at Stripe. Matt loves to tinker with new technology, adores Ruby and coffee and also moonlighted as a pro music photographer. His photo site is at &lt;a href="https://matthewling.com" rel="noopener noreferrer"&gt;matthewling.com&lt;/a&gt; and developer site is at &lt;a href="https://mattling.dev" rel="noopener noreferrer"&gt;mattling.dev&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Stay connected
&lt;/h3&gt;

&lt;p&gt;In addition, you can stay up to date with Stripe in a few ways:&lt;/p&gt;

&lt;p&gt;📣 Follow us on &lt;a href="https://twitter.com/StripeDev" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt;&lt;br&gt;
💬 Join the official &lt;a href="https://stripe.com/go/developer-chat" rel="noopener noreferrer"&gt;Discord server&lt;/a&gt;&lt;br&gt;
📺 Subscribe to our &lt;a href="https://www.youtube.com/StripeDevelopers" rel="noopener noreferrer"&gt;Youtube channel&lt;/a&gt;&lt;br&gt;
📧 Sign up for the &lt;a href="https://go.stripe.global/dev-digest" rel="noopener noreferrer"&gt;Dev Digest&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>stripe</category>
      <category>payments</category>
      <category>checkout</category>
    </item>
    <item>
      <title>Faster checkout with Link and the Payment Request Button</title>
      <dc:creator>mattling_dev</dc:creator>
      <pubDate>Wed, 19 Oct 2022 13:49:09 +0000</pubDate>
      <link>https://dev.to/4thzoa/faster-checkout-with-link-and-the-payment-request-button-j0c</link>
      <guid>https://dev.to/4thzoa/faster-checkout-with-link-and-the-payment-request-button-j0c</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;Offering one-click checkout in your app can dramatically improve the user experience for your customers and increase conversion for your business, as it removes lots of unnecessary friction like inputting card numbers and other billing details.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://stripe.com/docs/stripe-js/elements/payment-request-button" rel="noopener noreferrer"&gt;Payment Request Button&lt;/a&gt; already gave access to popular wallets like Apple Pay and Google Pay and now it supports &lt;a href="https://app.link.co/" rel="noopener noreferrer"&gt;Link&lt;/a&gt;, Stripe’s one-click payment method that gives your customers the opportunity to use one-click checkout on hundreds of thousands of businesses.&lt;/p&gt;

&lt;p&gt;And the great news is, if you are already using the Payment Request Button or intend to integrate using it, you get Link without any integration changes whatsoever! You can simply turn it on via the Dashboard. This feature is currently in a public beta, which you can sign up for &lt;a href="https://stripe.com/docs/stripe-js/elements/payment-request-button?html-or-react=html#managing-link-for-payment-request-button" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you'd like to see a step-by-step integration demo for Apple Pay or Google Pay, both of those have been &lt;a href="https://www.youtube.com/watch?v=5KcdQboA7Gc" rel="noopener noreferrer"&gt;covered by CJ&lt;/a&gt; &lt;a href="https://www.youtube.com/watch?v=GERlC3PxKgY" rel="noopener noreferrer"&gt;and Dawn&lt;/a&gt;. The Payment Request Button dynamically displays wallet options to optimize the checkout experience for your customers. In this article we'll see how and when Link will be offered and how it will improve your customer's payment experience.&lt;/p&gt;

&lt;h2&gt;
  
  
  When will Link be offered
&lt;/h2&gt;

&lt;p&gt;Link will be offered as a payment method when certain browser and wallet configurations are met, you can see those combinations in the table in the docs &lt;a href="https://stripe.com/docs/stripe-js/elements/payment-request-button" rel="noopener noreferrer"&gt;linked here&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What we’ll be testing
&lt;/h2&gt;

&lt;p&gt;In this example, we’ll be testing purchasing with Link using Safari with no card configured in our wallet, therefore Link will be offered as an alternative payment method.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffzp0smrto6td17t4ru9c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffzp0smrto6td17t4ru9c.png" alt="Link" width="800" height="469"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Signing up
&lt;/h2&gt;

&lt;p&gt;The first step is to provide an email address, this will be used to determine whether a customer has signed up for Link before. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One thing to note is that when testing Link in test mode, don’t use real world data, rather use dummy email addresses, &lt;a href="https://stripe.com/docs/testing#use-test-cards" rel="noopener noreferrer"&gt;test card numbers&lt;/a&gt; and non real world user data&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fefjljzevmc9r1do0frr6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fefjljzevmc9r1do0frr6.png" alt="Sign up or log in to Link" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If a customer has not used Link before, they’ll be prompted to enter their phone number. This number will be used to authenticate the customer in the future using one-time passcodes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgqysoxjz8mv7dnsid54e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgqysoxjz8mv7dnsid54e.png" alt="Provide a phone number" width="800" height="449"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7jfl59u5w4w3feypcgji.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7jfl59u5w4w3feypcgji.png" alt="Using the phone number placeholder" width="800" height="449"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On signing up, the customer will be prompted to provide familiar billing information like a debit or credit card, and their billing address.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0a74p96nqc1mzfhxua77.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0a74p96nqc1mzfhxua77.png" alt="Provide billing details" width="800" height="447"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once this is completed, the payment will be made.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4gytm24lespx3ihyn92m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4gytm24lespx3ihyn92m.png" alt="Payment completed" width="800" height="449"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Authenticating
&lt;/h2&gt;

&lt;p&gt;The next time the customer uses Link to pay, they provide their email address and they’ll be sent a one-time passcode to their phone which they can use to authenticate. In test mode, we can use any 6 digit number that isn’t  &lt;code&gt;000001&lt;/code&gt;, &lt;code&gt;000002&lt;/code&gt;, or &lt;code&gt;000003&lt;/code&gt;. These 3 test codes are reserved for simulating certain errors which you can read more about &lt;a href="https://stripe.com/docs/payments/link/accept-a-payment?platform=web#web-test-the-integration" rel="noopener noreferrer"&gt;in the docs&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;So we’ll key in &lt;code&gt;111111&lt;/code&gt; to authenticate.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpenub824ixz9jvi15ffq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpenub824ixz9jvi15ffq.png" alt="One-time passcode verification" width="800" height="449"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now the customer is fully authenticated and can make use of one-click checkout with Link on many businesses that have enabled it. Let’s complete this payment and see what happens when we try to make one last purchase.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foiip903wmkwk35j4xi2j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foiip903wmkwk35j4xi2j.png" alt="One-click checkout with Link" width="800" height="449"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Since the customer is authenticated, they can now checkout with one-click.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3cp73an4xql9htykefbh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3cp73an4xql9htykefbh.png" alt="Payment complete" width="800" height="449"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;Making the checkout process as smooth and fast as possible is essential to your customer’s experience and will lead to increased conversion and revenue for your business.&lt;/p&gt;

&lt;p&gt;Stripe created Link to make online checkouts faster and easier. With Link, you can save your payment information to be used at hundreds of thousands businesses. The next time you’re making an online purchase at a business that supports Link, you can simply check out in one-click.&lt;/p&gt;

&lt;h3&gt;
  
  
  About the author
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc8rpgkqr91ivs8sxr73g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc8rpgkqr91ivs8sxr73g.png" alt="Matthew Ling" width="400" height="400"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Matthew Ling (&lt;a href="https://dev.to@mattling_dev"&gt;@mattling_dev&lt;/a&gt;) is a Developer Advocate at Stripe. Matt loves to tinker with new technology, adores Ruby and coffee and also moonlighted as a pro music photographer. His photo site is at &lt;a href="https://matthewling.com" rel="noopener noreferrer"&gt;matthewling.com&lt;/a&gt; and developer site is at &lt;a href="https://mattling.dev" rel="noopener noreferrer"&gt;mattling.dev&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Stay connected
&lt;/h3&gt;

&lt;p&gt;In addition, you can stay up to date with Stripe in a few ways:&lt;/p&gt;

&lt;p&gt;📣 Follow us on &lt;a href="https://twitter.com/StripeDev" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt;&lt;br&gt;
💬 Join the official &lt;a href="https://stripe.com/go/developer-chat" rel="noopener noreferrer"&gt;Discord server&lt;/a&gt;&lt;br&gt;
📺 Subscribe to our &lt;a href="https://www.youtube.com/StripeDevelopers" rel="noopener noreferrer"&gt;Youtube channel&lt;/a&gt;&lt;br&gt;
📧 Sign up for the &lt;a href="https://go.stripe.global/dev-digest" rel="noopener noreferrer"&gt;Dev Digest&lt;/a&gt;&lt;/p&gt;

</description>
      <category>stripe</category>
      <category>link</category>
      <category>webdev</category>
      <category>payments</category>
    </item>
    <item>
      <title>React Stripe.js and the Payment Element</title>
      <dc:creator>mattling_dev</dc:creator>
      <pubDate>Mon, 03 Oct 2022 14:49:51 +0000</pubDate>
      <link>https://dev.to/4thzoa/react-stripejs-and-the-payment-element-34d0</link>
      <guid>https://dev.to/4thzoa/react-stripejs-and-the-payment-element-34d0</guid>
      <description>&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/e-whXipfRvg"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  What you’ll learn
&lt;/h2&gt;

&lt;p&gt;With &lt;a href="https://stripe.com/docs/stripe-js/react" rel="noopener noreferrer"&gt;React Stripe.js&lt;/a&gt; and the &lt;a href="https://stripe.com/docs/payments/payment-element" rel="noopener noreferrer"&gt;Payment Element&lt;/a&gt; you can create a custom payment integration on your site that can offer more than 18 global payment methods with a single integration depending on your location and their availability. In this demo you’ll learn how to integrate the Payment Element with your React app, and how to turn on new payment methods via the dashboard without having to change, test or re-deploy your code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;If you’d like to follow along, you’ll need a Stripe account which you can &lt;a href="https://dashboard.stripe.com/register" rel="noopener noreferrer"&gt;sign up for here&lt;/a&gt; and you can clone the getting started branch of the &lt;a href="https://github.com/matthewling-stripe/react-stripe-payment-element" rel="noopener noreferrer"&gt;repo here&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Table of contents
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;00:00 &lt;a href="https://www.youtube.com/watch?v=e-whXipfRvg" rel="noopener noreferrer"&gt;Introduction&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;01:07 &lt;a href="https://www.youtube.com/watch?v=e-whXipfRvg&amp;amp;t=67s" rel="noopener noreferrer"&gt;Cloning the repo and getting started&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;02:12 &lt;a href="https://www.youtube.com/watch?v=e-whXipfRvg&amp;amp;t=132s" rel="noopener noreferrer"&gt;npm installs and starting the app&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;03:50 &lt;a href="https://www.youtube.com/watch?v=e-whXipfRvg&amp;amp;t=230s" rel="noopener noreferrer"&gt;Building out payment.js&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;05:18 &lt;a href="https://www.youtube.com/watch?v=e-whXipfRvg&amp;amp;t=318s" rel="noopener noreferrer"&gt;Creating a payment intent on the back end&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;06:27 &lt;a href="https://www.youtube.com/watch?v=e-whXipfRvg&amp;amp;t=387s" rel="noopener noreferrer"&gt;Fetching and saving the client secret&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;07:28 &lt;a href="https://www.youtube.com/watch?v=e-whXipfRvg&amp;amp;t=448s" rel="noopener noreferrer"&gt;Using the elements provider&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;08:36 &lt;a href="https://www.youtube.com/watch?v=e-whXipfRvg&amp;amp;t=516s" rel="noopener noreferrer"&gt;Creating the checkout form&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What to watch next
&lt;/h2&gt;

&lt;p&gt;You can watch more videos on automatic payment methods &lt;a href="https://www.youtube.com/c/StripeDevelopers/search?query=automatic%20payment%20methods" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  About the author
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc8rpgkqr91ivs8sxr73g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc8rpgkqr91ivs8sxr73g.png" alt="Matthew Ling" width="400" height="400"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Matthew Ling (&lt;a href="https://dev.to@mattling_dev"&gt;@mattling_dev&lt;/a&gt;) is a Developer Advocate at Stripe. Matt loves to tinker with new technology, adores Ruby and coffee and also moonlighted as a pro music photographer. His photo site is at &lt;a href="https://matthewling.com" rel="noopener noreferrer"&gt;matthewling.com&lt;/a&gt; and developer site is at &lt;a href="https://mattling.dev" rel="noopener noreferrer"&gt;mattling.dev&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Stay connected
&lt;/h3&gt;

&lt;p&gt;In addition, you can stay up to date with Stripe in a few ways:&lt;/p&gt;

&lt;p&gt;📣 Follow us on &lt;a href="https://twitter.com/StripeDev" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt;&lt;br&gt;
💬 Join the official &lt;a href="https://stripe.com/go/developer-chat" rel="noopener noreferrer"&gt;Discord server&lt;/a&gt;&lt;br&gt;
📺 Subscribe to our &lt;a href="https://www.youtube.com/StripeDevelopers" rel="noopener noreferrer"&gt;Youtube channel&lt;/a&gt;&lt;br&gt;
📧 Sign up for the &lt;a href="https://go.stripe.global/dev-digest" rel="noopener noreferrer"&gt;Dev Digest&lt;/a&gt;&lt;/p&gt;

</description>
      <category>stripe</category>
      <category>tutorial</category>
      <category>payments</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
