Is there example of ruby on rails project for taking a Card Payment with Web Payments SDK

I did read following article,
https://developer.squareup.com/docs/web-payments/take-card-payment”.
And I create rails project based on “GitHub - square/web-payments-quickstart: Quickstart for using Square's Web Payments SDK

In Production mode on heroku,
I’ve got missing-credentials error, on this line:
“payments = window.Square.payments(appId, locationId);”
error on console.log:
ApplicationIdEnvironmentMismatchError : Web Payments SDK was initialized with an application ID created in production however you are currently using sandbox

appID, locationId are collectly outputed on console log.
Yes, production values of them.

Please give me a hint.

I Solved!!

Add following source on top line of html.erb for web_payment_page.
<%case Rails.env%>
<%when ‘production’%>
<%= javascript_include_tag “https://web.squarecdn.com/v1/square.js” , ‘data-turbolinks-track’: ‘reload’ %>
<%when ‘development’%>
<%= javascript_include_tag “https://sandbox.web.squarecdn.com/v1/square.js” , ‘data-turbolinks-track’: ‘reload’ %>
<%end%>

I made a example for taking a card payment with Square Payment SDK on Rials iin my Github public repositories.

https://github.com/yasunao/sq_rails_web_payment_example

I look forward to helping this community.

:wave: @yasunao_izawa, thanks you so much for sharing with the community! :slightly_smiling_face: