<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="353599" data-post-id="353599">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="arrowsmith" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/arrowsmith/120/33338_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  arrowsmith
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Hi Hasimbola,</p>
<p>It’s hard to give advice without knowing more about what specifically you’re trying to do. Do you need people to make one-off payments, or subscriptions? Is there a range of products they can choose from? What happens after they pay - does it create a user account? Grant access to a specific part of the site? Send them an email with the product attached?</p>
<p>The simplest approach is to use a Stripe-hosted checkout page: <a href="https://docs.stripe.com/payments/accept-a-payment?platform=web&amp;ui=checkout" class="inline-onebox" rel="noopener nofollow ugc">Accept a payment | Stripe Documentation</a></p>
<p>The flow would work roughly like this:</p>
<ul>
<li>Users visit a path on your site e.g. <code>/checkout</code>.</li>
<li>On the backend you generate a Checkout object using the <code>stripity_stripe</code> package, which contains a URL. You redirect them to this URL.</li>
<li>They’ll see a Stripe-hosted page where they can enter their payment information etc.</li>
<li>On successful payment, they’ll be redirected back to a URL on your site e.g. <code>/checkout_complete</code> which will have a <code>session_id</code> param.</li>
<li>You use this <code>session_id</code> param to pull information from Stripe about the checkout session and what they purchased - you can use this this to update your site accordingly e.g. grant them access to the product.</li>
</ul>
<p>Remember that anyone can type <code>/checkout_complete</code> into their address bar so you can’t trust this URL blindly. You need to pull information from Stripe using your API keys to verify that people have actually paid.</p>
<p>You probably also want to set up a webhook endpoint so that Stripe can send you information about all activity on your account e.g. subscription cancellations and renewals. Again, you need to verify this endpoint so you can be sure that the requests are actually coming from Stripe and not from an attacker - Stripe’s docs have information about how to do this.</p>
<p>Other than that I can’t really give any more advice without knowing more about the details of what you want to do, but I hope that helps.</p>
<p>EDIT: wait, I only just noticed that this thread is from 2022. Oh well, I hope someone still finds the above helpful.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="353599" data-batch-url="/posts/batch_likers">
                        9
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/add-stripe-for-payment-in-phoenix-site/47677/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-353599" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="353599"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #12"></div>
  </section>
</div>
    <div class="postbit" id="365762" data-post-id="365762">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="alvinru" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  alvinru
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I find this very useful. Thanks, George!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="365762" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/add-stripe-for-payment-in-phoenix-site/47677/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-365762" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="365762"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-last-post cat-last-post" title="Last post!"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <span class="all-loaded">— All posts loaded —</span>
</div></template></turbo-stream>