<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Stripe on Aditya Naik | Personal Website</title>
    <link>https://d6cbd428.hugo-blog-e6x.pages.dev/tags/stripe/</link>
    <description>Recent content in Stripe on Aditya Naik | Personal Website</description>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Wed, 27 May 2020 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://d6cbd428.hugo-blog-e6x.pages.dev/tags/stripe/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>How to easily test react stripe elements using cypress</title>
      <link>https://d6cbd428.hugo-blog-e6x.pages.dev/blog/2020/05/27/how-to-easily-test-react-stripe-elements-using-cypress/</link>
      <pubDate>Wed, 27 May 2020 00:00:00 +0000</pubDate>
      <guid>https://d6cbd428.hugo-blog-e6x.pages.dev/blog/2020/05/27/how-to-easily-test-react-stripe-elements-using-cypress/</guid>
      <description>&lt;h3 id=&#34;how-to-use-react-stripe-elements&#34;&gt;How to use react-stripe-elements&lt;/h3&gt;&#xA;&lt;p&gt;&#xA;&lt;a&#xA;  href=&#34;https://medium.com/craft-academy/get-paid-in-your-react-app-in-5-minutes-or-less&#34;&#xA;  &#xA;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xA;  &gt;I have already written&lt;/a&#xA;&gt;&#xA; about how to set up and use &#xA;&lt;a&#xA;  href=&#34;https://github.com/stripe/react-stripe-elements&#34;&#xA;  &#xA;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xA;  &gt;react-stripe-elements&lt;/a&#xA;&gt;&#xA;.&lt;/p&gt;&#xA;&lt;p&gt;However, there is another easier way to test stripe implementation than mentioned in the article.&lt;/p&gt;&#xA;&lt;h3 id=&#34;how-to-test-react-stripe-elements&#34;&gt;How to test react-stripe-elements&lt;/h3&gt;&#xA;&lt;p&gt;Just use following function to your cypress test&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure class=&#34;highlight&#34;&gt;&#xA;  &#xA;  &lt;pre class=&#34;language-js&#34; &gt;&lt;code&gt;function fillInStripeForm() {&#xA;  const input = [&#xA;    [&#34;cardnumber&#34;, &#34;4242424242424242&#34;],&#xA;    [&#34;exp-date&#34;, &#34;1220&#34;],&#xA;    [&#34;cvc&#34;, &#34;123&#34;],&#xA;  ];&#xA;  cy.wait(1000);&#xA;  cy.get(&#34;.__PrivateStripeElement &gt; iframe&#34;).each(($element, index, list) =&gt; {&#xA;    cy.get($element).then(($iframe) =&gt; {&#xA;      const body = $iframe.contents().find(&#34;body&#34;);&#xA;      cy.wrap(body)&#xA;        .find(`input[name=${input[index][0]}]`)&#xA;        .type(input[index][1], { delay: 10 });&#xA;    });&#xA;  });&#xA;}&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;and call it when tripe form needs to be filled.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
