[cross post with the R shiny Google group - I waited 24 hours]
The following code will render the checkout
button from Stripe normally if I simply save it as a .html
and open it with Firefox:
<h1> this is a test </h1>
<form action="" method="POST">
<script
src="https://checkout.stripe.com/checkout.js" class="stripe-button"
data-key="pk_test_qdunoptxl9KNXR5qk7WdtkVg"
data-amount="2000"
data-name="Demo Site"
data-description="2 widgets ($20.00)"
data-image="/128x128.png">
</script>
</form>
but placing it in a R Shiny app like so:
output$StripeCheckOut <- renderUI({
div(class="span6",
div(HTML('
<h1> this is a test </h1>
<form action="" method="POST">
<script
src="https://checkout.stripe.com/checkout.js" class="stripe-button"
data-key="pk_test_qdunoptxl9KNXR5qk7WdtkVg"
data-amount="2000"
data-name="Demo Site"
data-description="2 widgets ($20.00)"
data-image="/128x128.png">
</script>
</form>
')))
will result in a blank field under the This is a Test
text.
It seems that R Shiny is not allowing the Javascript to dynamically load the button after the page has been rendered by the dom.
How can I include the basic Stripe Checkout button in an R Shiny App?
ui.r
didn't change anything. For various reasons I can't switch this project to a pureindex.html
base!script
element)