PayPal Advanced hosted page inconsistency - paypal

I am integrating Payflow Advanced into our site and am testing in Sandbox. I have a page with a Pay Now button. I have all the necessary accounts, hosted pages, etc. and I successfully get secure tokens I have tried two ways of accessing my hosted page with these tokens:
1) the Pay Now button opens another HTML page in which my hosted page is specified as the source of an iframe as in
<p>This is a test of hosted pages</p>
<iframe src="https://payflowlink.paypal.com?SECURETOKEN=73nQZctvqskKbJooHoBr9DQlB&SECURETOKENID=DTesting5991376569967&MODE=TEST& BILLTOSTREET=33 Ames Road&BILLTOCITY=Groton&BILLTOSTATE=MA&BILLTOZIP=01451&BILLTOPHONE=408-110-7975" name="test_iframe" scrolling="no" width="700px" height="700px"></iframe>
When this page opens, my hosted page is in the iframe and all info is correct. After a couple of seconds, something in the PayPal code redirects the browser to the full hosted page. Everything is correct on this full page as well.
2) In this method I bypass the intermediate HTML page and use an HTML form to access PayFlow directly. The form has the ACTION set to the exact same string as the src in method 1 and a button to submit the form. as in
<form id='payment' action="https://payflowlink.paypal.com?SECURETOKEN=73nQZctvqskKbJooHoBr9DQlB& SECURETOKENID=DTesting5991376569967&MODE=TEST&BILLTOSTREET=33 Ames Road&BILLTOCITY=Groton&BILLTOSTATE=MA&BILLTOZIP=01451&BILLTOPHONE=408-110-7975">
<input display="inline" type='button' id='paypalbutton' value="Pay with Credit Card or PayPal" class='buttons' onClick="buttonclick('ccpay');">
</form>
When the form is submitted an invalid merchant message is displayed and no hosted page is displayed.
I don't care which method I use if it would only work correctly. In method 1, how do I avoid the redirection?
In Method 2, why am I getting the invalid merchant error?
Thanks

You don't have a method="POST" in your <form> tag. This causes your browser to default to using the GET method to submit the form. This, in turn, causes the browser to strip off all the query parameters from the URL, resulting in an empty request.
So, the solution to this would be to add method="POST" to your <form> tag.

Related

PayPal Payment COMPLETE on a static HTML/JS website with no server backend. How to render a completed payment page?

I am building a static website using only JS HTML CSS and a touch of JQuery. I have a PayPal button that works in the PayPal sandbox and charges my mock user but I can't figure out how to change anything after payment is complete.
I would like the page to redirect to a payment complete page with the order details. Is it as simple as setting up the SANDBOX APP SETTINGS URL and custom building a page with that URL?
I'll assume you are using something like this client-side integration.
Inside the onApprove function, in the .then() of you actions.order.capture, you can use actions.redirect('otherPage.html')
Alternatively, rather than redirecting and for more of a single page application feel you can rewrite the DOM and replace the contents of <body> or your main container div using jQuery.
$('body').html('<h2>Thanks for your order!</h2>');

Netlify form - after submit it redirects to wrong page

I've got a Gatsby.js project that is ran from Netlify. For a contact form I'm using Netlify's api.
The content is multilingual so I've got a contact page on /contact/ and /en/contact/ These obviously share the same code for a form. I've created a successful form submit page on /form-succes/ and /en/form-succes/
But when I'm on the Dutch side and I submit the form I see the url go to /form-succes for a split second, and then it goes (redirects?) to /en/form-succes
It runs well on a local env but not after build on Netlify.
Is this a Netlify issue or did I do something wrong?
This is part of the form:
var pathPrefix is, depending on the language / or /en/
<form
name={"contact"}
method="post"
netlify-honeypot="bot-field"
data-netlify="true"
lassName="contact-forms"
action={`${pathPrefix}form-succes`} // "/form-succes" or "/en/form-succes"
>
// input stuff
</form>
I've ended up makeing two Netlify Forms. One for each language. The documentation as Netlify provides is does not work.
name={'${pathPrefix}-contact'} (use backticks)

Integrating FormSpree into GitHub Jekyll (Returns message: Form should post)

I am hoping to add a contact form to a GitHub Jekyll website. I have mostly been following advice from the most-liked answer here, from a YouTube tutorial here, and from the FormSpree site.
I created a FormSpree account, verified my e-mail address, and created a form (obtained an ID). Then, I tried to add a contact form into my GitHub Jekyll website, the code of which can be seen here. After that, I went to the corresponding site of that code (here) and sent a test form submission. In the e-mail address field, I tried both the e-mail address connected to FormSpree and an alternative email address.
Either way, upon submitting the "Send" button at the bottom of the page, the page refreshed with an error message: "Form should POST - Make sure your form has the method=POST attribute". I also did not receive the tested message in my email connected to FormSpree. I tried to research this error but see no solutions. As can be seen in the code (here), I believe I do set a method=POST attribute.
I am unsure how to proceed given my inability to effectively interpret the error message. Any advice on how to render this type of contact form successful, especially given this error message, would be very much appreciated!
There is an error in your HTML:
<form action="https://formspree.io/email#gmail.com method="POST" name="sentMessage" id="contactForm" novalidate>
Your action is missing a closing double-quote (") which leads to a false interpretation of your action attribute as "https://formspree.io/email#gmail.com method=" and your actual method as an invalid attribute post".
Should be fixed by replacing the above line with
<form action="https://formspree.io/email#gmail.com" method="POST" name="sentMessage" id="contactForm" novalidate>
Doing so in your pages source code, I was able to submit the form and landed on FormSpree landing page indicating, that your form needs to be activated.

Wordpress cp-appointment-calendar redirection to paypal issues

I'm using cp-appointment-calendar for booking system on http://studioglamour.co.uk, but the problem is that when you enter date/time and information, you need to be redirected to paypal. I know that PayPal doesn't let ifames.
The question would be: how to do that when I press continue it would close the fancybox iframe, and redirect to PayPal in the main page?
Use target="_top" in the appropriate form / link.
When used in a form, the form will submit into the whole window.
When used in a link, the link will open in the whole window.

Stop resubmit on form

I have a simple form on my site that allows users to add comments on photos. However, the form doenst use ajax (like facebook). Instead, it submits the form and refreshes the page. This is fine however, if a user reloads the page, there is an alert that he/she will resubmit the data resulting in two of the same comments. Id like to remove this resubmit without sending the user to a confirmation page. Thanks.
Here is my form:
<form name='form' action='index.php' method='POST'>
<input type='text' name='comment'>
<input type='submit' value='submit' name='submit'>
PHP:
if (isset($_POST['submit'])){
$comment=$_POST[comment];
$time=time();
$id=$_GET['id'];
$put=mysql_query("INSERT INTO comments VALUES ('','$user','$time','$comment','$id')");
Is your PHP script simply re-rendering the page in response to a form post? The standard way to get the behavior you describe is that it should either return a HTTP status of 204 (No content) or 303 (see other, with a redirect to the page you want to show).