Address line 2 in Stripe Checkout - stripe-payments

Using Stripes simple 'Checkout', is there a way to show a field for address_line2? When data-billingaddress="true" the popup form only shows one field for the customer's address.
<form action="charge.php" method="post">
<script src="https://checkout.stripe.com/checkout.js" class="stripe-button"
data-key="test-key-goes-here"
data-name="My Site Name"
data-description="my product description"
data-amount="5000"
data-image="https://stripe.com/img/documentation/checkout/marketplace.png"
data-locale="auto"
data-billingaddress="true"
data-shippingaddress="false"
data-currency="gbp">
</script>
</form>

There is not a way to accept address_line2 in Checkout.
If you'd like to collect this field, I'd recommend using Elements, which allows a param to be passed in as part of stripe.createToken
https://stripe.com/docs/stripe.js#stripe-create-token

Related

Netlify form submissions are blank

When I submit my Netlify form the server responds with a 200 status and I get the 'thank you' response page. However, when I check the form submission in the Netlify admin, they are all blank. I've inspected my xhr requests and the data shows in the 'params' section of the browser dev tools.
Disclaimer: I work for Netlify.
When our service stores blank submissions, it has not received any fields from the submission which were defined in the html version of the form with the same name parameter in its definition as the submission.
To start off with, it's useful to know that our service requires a plain html version of your form, with a name parameter as well as the netlify or data-netlify=true parameter; this is what prepares your site to accept form submissions at all, so you had that set up right already; if you didn't, you'd get a 404 when POSTing.
Once you have this in a deploy and we parse it correctly, you'll see the form name in your site settings dashboard on the 'Forms' tab. Note that we ALSO pull all the field names we'll save and show to you in notifications or the dashboard from this file and only this file, so make sure you give each form field all a name as well, in that html file.
If you see the form in your dashboard, yet get a blank submission when you are sure data was POSTed, this probably has one of three causes:
Netlify did not correctly process your field names from the html version of your form. The service will only properly handle the fields which we see in that html version at deploy time.
Netlify does matching by field name at submission time, so make sure that what your site sends to us then matches up between with your deployed html copy of the form. This happens automatically for pure html (no JS) forms since you are POSTing from the file which is the canonical "definition" of your form fields; however for javascript forms you need to take care that the names match up. Put another way, you cannot later add new fields dynamically in javascript and send them (Netlify will accept all fields, as you have seen; but will not store them or notify you about ones that were not processed at deploy time!)
One more quirk that could get in the way: having multiple copies of a form with the same name in your deploy. Only one will be processed, so if you happen to have an errant <form name=test netlify></form> in another html file (or even the same one!) - it could be the one that we process rather than the other form also named test. So, make sure that you only send a single html definition of your form. Note that some frameworks like gatsby render your jsx down into html before deploy, meaning that if you have a plain html file form definition in your deploy - it could be processed instead of the copy gatsby built.
This blog post describes a successful form built in a react app: https://www.netlify.com/blog/2017/07/20/how-to-integrate-netlifys-form-handling-in-a-react-app/
I missed the "name" attribute in input field.
Every input in the form must have a "name" attribute. Something like <input name="email" ...> or <textarea name="message" ...> is what you need.
Don't miss the "name" attribute for both parent and child layers
<form name="contact" method="POST" data-netlify="true">
<input type="text" placeholder="name" class="box" name="name">
<input type="email" placeholder="email" class="box" name="email">
<input type="text" placeholder="project" class="box" name="project">
<textarea name="message" id="" cols="30" rows="10" class="box message" placeholder="message"></textarea>
<div class="field">
<div data-netlify-recaptcha="true"></div>
</div>
<button type="submit" class="btn"> send <i class="fas fa-paper-plane"></i> </button>
</form>

Stripe embedded form not appearing

I have the below code. If I throw it onto one page, the button shows up and I can see it through developer tools. On another page, the button doesn't show up and dev tools shows the script tag missing in the form. What could be causing this?
<form action="" method="POST">
<script src="https://checkout.stripe.com/checkout.js" class="stripe-button"
data-key="sss"
data-amount="999"
data-name="sss"
data-description="Widget"
data-image="/img/documentation/checkout/marketplace.png"
data-locale="auto">
</script>
</form>

In Stripe Checkout, how do I set charge amount dynamically?

This is from Stipe documentation, it charges $20.00. My question is, if I have an item charging $20.00, but I may also have an $5.00 addon item that user can choose by clicking a checkbox. So the charge amount could be $20 or $25. How can I implement that?
<form action="/charge" method="POST">
<script
src="https://checkout.stripe.com/checkout.js" class="stripe-button"
data-key="pk_test_6pRNASCoBOKtIshFeQd4XMUh"
data-image="/img/documentation/checkout/marketplace.png"
data-name="Stripe.com"
data-description="2 widgets"
data-amount="2000">
</script>
</form>
You can use the custom method instead of simple method by following reference page
https://stripe.com/docs/checkout#integration-custom

Pre-populate a PowerForm Envelope field using form values

I'm following the PowerForm docs on the following guide
https://www.docusign.com/sites/default/files/PowerForms_User_Guide.pdf
I need to save custom metadata inside the envelope, such as the User ID, so I can later
process the envelope.
I want to be able to populate a custom envelope field, using a form submission like the following:
<form action="https://demo.docusign.net/MEMBER/PowerFormSigning.aspx?PowerFormId=<ID>" method="POST">
<label for="email">Email Address: </label><input type="text" name="Signer1_Email" id="email"/>
<label for="name">Name: </label><input type="text" name="Signer 1_UserName" id="name"/>
<label for="order">Order Number: </label><input type="text" name="OrderNumber" id="order"/>
<input class="form_submit" type="submit"/>
</form>
Is this possible?
From the heading inside the docs:
Populating custom envelope fields in a Web PowerForm
Example: EnvelopeField_Region=Northwest
I have tried the following:
<input type="hidden" name="EnvelopeField_orgid" value="xyz" id="EnvelopeField_orgid"/>
<input type="hidden" name="EnvelopeField_orgids" value="aaa" id="orgid"/>
Also, I have tried navigating the docusign command center and have not found any options to add custom envelope fields to a Template or PowerForm.
What if you post the data and redirect to a built link off of that data (I'm not sure what' youre using besides HTML). I don't believe you can POST directly from a form to a PowerForm link the way it needs to be formatted.
Here's a quick PHP/JS example of what I'm referring to:
<?
if($_POST){
$baseUrl = "https://demo.docusign.net/MEMBER/PowerFormSigning.aspx?PowerFormId=" . $_POST['PowerFormId'];
$EnvelopeField_orgid = $_POST['EnvelopeField_orgid'];
$EnvelopeField_orgids = $_POST['EnvelopeField_orgids'];
$link = $baseUrl . "&EnvelopeField_orgid=" . $EnvelopeField_orgid . "&EnvelopeField_orgids" . $EnvelopeField_orgids;
?>
<script type="text/javascript">window.top.location.href='<?echo $link;?>'</script>
<?
}
?>
We were able to pass parameters to a Powerform. Below is a sample syntax of how we did it.
https://demo.docusign.net/Member/PowerFormSigning.aspx?PowerFormId=50ac80ac-a63c-40c7-b2f4-25e93806b647&Signer1_Email=test#test.com&AccountName=Test&&Signer1_UserName=Test+User

Privacy prevent page from showing on back button

There will be a computer on display which users will write in their name, phone number, email and other information. We dont want users going back a page and grabbing ppls emails or other information.
How do i make it so when someone hits back the form no longer shows and a "sorry return to the first page" kind of thing. Theres a small chance there may be an agreement screen so hitting back and submitting another form and no seeing the screen may be trouble but i am not worried about that (or can say please put them on the same page).
I know its been asked but i havent seen any with this reason and the solutions i saw did not work (on firefox 3.6.10)
A little web searching found this page: Clear Web Forms After Submit
Basically calls the reset() function on all forms on the <body> tag's onload and unload events.
Code from the link:
<html>
<head>
<title>A Self-Clearing Form</title>
<script>
function clearForms()
{
var i;
for (i = 0; (i < document.forms.length); i++) {
document.forms[i].reset();
}
}
</script>
</head>
<body onLoad="clearForms()" onUnload="clearForms()">
<h1>A Self-Clearing Form</h1>
This form data will self-destruct when you leave the current web page.
<form method="post" action="page2.php" name="test">
<input name="field1"/> Field One
<p>
<input name="field2" type="radio" value="One"/>One
<input name="field2" type="radio" value="Two"/>Two
<input name="field2" type="radio" value="Three"/>Three
<input name="field2" type="radio" value="Four"/>Four
<p>
<input type="submit" value="Submit Form Data"/>
</form>
</body>
</html>
When the users enter information, save it and then send a redirect (through headers) to the page where users can enter their info.
Could have the form displayed as a result of a POST call, meaning the browser won't cache it. Then, if another user hits back, the browser will ask if they want to resend the request, but even if they do, you display them a blank page.

Resources