I have a VB ASP.NET web application and I'm trying to utilize Dwolla. Dwolla helpfully does not have any VB code to share on how to accomplish this, so I've done the best I can to make this work. I have a test HTML page with a script tag in it that works fine, and I can copy and paste it into my application, and it works, but I need to change some of the elements dynamically using variables.
I'm not accomplished with JS, so any help is appreciated here. In my code behind, I've written the following code:
Dim ScriptTxt As String
ScriptTxt = "src = 'https://www.dwolla.com/scripts/button.min.js' class='dwolla_button' type='text/javascript' "
ScriptTxt = ScriptTxt & "Data -key = 'REMOVED FOR PRIVACY' "
ScriptTxt = ScriptTxt & "Data -redirect = 'REMOVED FOR PRIVACY' "
ScriptTxt = ScriptTxt & "Data -Label = 'Pay This Invoice' "
ScriptTxt = ScriptTxt & "Data -name = 'Invoice' "
ScriptTxt = ScriptTxt & "Data -description = '" & SessItemDescr & "Invoice' "
ScriptTxt = ScriptTxt & "Data -amount = '" & SessInvoiceAmt & "' "
ScriptTxt = ScriptTxt & "Data -shipping = '0.00' "
ScriptTxt = ScriptTxt & "Data -tax = '0.00' "
ScriptTxt = ScriptTxt & "Data -guest - checkout = 'true' "
ScriptTxt = ScriptTxt & "Data -Type = 'simple'"
Dim cs As ClientScriptManager = Page.ClientScript
cs.RegisterClientScriptBlock(Me.GetType, "Dwolla", ScriptTxt, True)
When the app runs, the button that is supposed to be generated by this script doesn't appear. There's no error displayed, and none of the code shows the squiggly line.
This is the static HTML code that works (although all the values, in the end, need to be dynamic):
<script
src="https://www.dwolla.com/scripts/button.min.js" class="dwolla_button" type="text/javascript"
data-key="ReH8AkxCe/Ca//AoR+840H39WZnhLbiOUNw/pitA5DN1xLKbxZ"
data-redirect="http://www.connectedperformancepc.com/pay_status.aspx"
data-label="Pay This Invoice Now"
data-name="INVOICE PAYMENT"
data-description="Invoice Payment - Includes all taxes and fees"
data-amount="1"
data-shipping="0"
data-tax="0"
data-guest-checkout="true"
data-type="simple"
>
</script>
The Dwolla button is supposed to appear at the bottom of the page, on top of the footer (coded in the master page file). What am I doing wrong, and how can I fix it? I really need this done soon, as I'm switching from PayPal and currently can't take payments online (unless I want to pay out the nose for PayPal - Dwolla is only 25 cents for transactions over $10).
Thanks!