PayPal embedded flow: Payment can't be completed. This feature is currently unavailable - paypal

I'm trying to get the example shown here to work:
https://developer.paypal.com/webapps/developer/docs/classic/adaptive-payments/ht_ap-embeddedPayment-curl-etc/
However, I always get the error Payment can't be completed. This feature is currently unavailable.
This is the code, taken directly from PayPal's documentation (where {{PAY-KEY}} is a pay key you obtain from PayPal):
<html>
<head>
<script src="https://www.paypalobjects.com/js/external/apdg.js" type="text/javascript"></script>
</head>
<body>
<form action="https://www.sandbox.paypal.com/webapps/adaptivepayment/flow/pay" target="PPDGFrame" class="standard">
<label for="buy">Buy Now:</label>
<input type="image" id="submitBtn" value="Pay with PayPal" src="https://www.paypalobjects.com/en_US/i/btn/btn_paynowCC_LG.gif">
<input id="type" type="hidden" name="expType" value="mini">
<input id="paykey" type="hidden" name="paykey" value="{{PAY-KEY}}">
</form>
<script type="text/javascript" charset="utf-8">
var dgFlowMini = new PAYPAL.apps.DGFlowMini({trigger: 'submitBtn'});
</script>
</body>
</html>
The same error occurs when you try to use this for Preapproval ([...]/flow/preapproval, request variable preapprovalKey), and also with the LightBox code sample.
What am I missing here ?

Contacted PayPal support and they apparently fixed it (again...).

Related

AMP email with form and server protect of action-xhr

I'm planning to use an AMP email with an embedded form to collect some data using an action-xhr action, I will develop a new service in my back end to collect this information, but I have a trivial question about how I can protect my service to avoid bot and more in general malicious calls.
In my original idea, I planned to use the reCAPTCHA v3 AMP component, but this is available only for the AMP websites, so I can't use it in the AMP email.
So, if I understand correctly, there isn't a way to protect my service from the bot, and the idea of exposing a service without any form of protection doesn't like me.
Another option is to avoid a multi-call from the same IP, but this is not a real solution.
Let for examle the AMP email:
<!doctype html>
<html ⚡4email data-css-strict>
<head>
<meta charset="utf-8">
<script async src="https://cdn.ampproject.org/v0.js"></script>
<script async custom-element="amp-form" src="https://cdn.ampproject.org/v0/amp-form-0.1.js"></script>
</head>
<body>
<form method="POST" action-xhr="https://rest.service.com">
<fieldset>
<label>
<span>Phone number:</span>
<input type="text" name="phoneNumber" required>
</label>
<input type="submit" value="Subscribe">
</fieldset>
<div submit-success><template type="amp-mustache">Subscription successful!</template></div>
<div submit-error><template type="amp-mustache">Subscription failed!</template></div>
</form>
</body>
</html>
How can I protect the https://rest.service.com REST service, I don't find any specific response to this need, do you have suggestions or best practices?
Thanks

Cannot complete authorization

I've got LinkedIn API app created and I'm able to get to the 'Allow' screen. That redirects to a form on my site which is submitted to linkedin.com to complete the authorization.
Instead of redirecting to my redirect url I'm getting an error saying:
"You must be authenticated to access this page".
Below is the form I'm submitting except that I've replaced the form field values with fakes.
I've made sure the real redirect URL is authenticated in my LinkedIn application.
What am I doing wrong?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>SoftLink Systems LinkedIn Auth Completion</title>
</head>
<body>
<form id="frmLNAuthComplete" action="https://www.linkedin.com" enctype="application/x-www-form-urlencoded" method="post" >
<input type="hidden" name="grant_type" value="authorization_code" />
<input type="hidden" name="code" value="FAKE_CODE_Gdy1R3cW2hFACX2dV39QwfofGVXg6v1nPH0O_Em4UnzEaR06ZXDGO57HU0DukpehS-EGu-AzF3L8SG8XfrB6oYRkpPtY3cLc" />
<input type="hidden" name="redirect_uri" value="http://linkedin.fake-domain.com/index.php" />
<input type="hidden" name="client_id" value="fake-id-k66l" />
<input type="hidden" name="client_secret" value="fake-secret-rI2mxlqb" />
</form>
<script type="application/javascript">
var frm = document.querySelector("#frmLNAuthComplete");
frm.submit();
</script>
</body>
</html>

Form remain the same after submiting using jquery mobile

After Im using jquery mobile to submit a form,
but after submition, and going back to form, all fields are not in default value any more. they showing data previously submitted.
(if I press f5, form will reset and works fine for another round only)
Im guessing something remain in browser cache.
Any Idea?
<!DOCTYPE html>
<html>
<head>
<script src="scripts/jquery-1.9.1.min.js"></script>
<script src="./scripts/jquery.mobile-1.3.0.js"></script>
<link rel="stylesheet" href="./style/jquery.mobile-1.3.0.min.css" />
</head>
<body>
<?php if(!(isset($_GET["submit"]))){ ?>
<form action="thisPage.PHP?submit=yes" method="get" >
<input type="text" value="0" />
<input type="submit" value="Submit" />
</form>
<?php }else{ ?>
<a href="thisPage.PHP" > FINISHED</a>
<?php } ?>
</body>
</html>
Finally I found the simple and easy answer:
add following line into form tag:
data-ajax="false"
so it should be like this:
<form action="thisPage.PHP?submit=yes" method="get" data-ajax="false" >

fb friend selector & php POST formular not working properly

Hey guys,
I've used the search as well so I am confident in asking the question here without doing anything wrong :P
Recently I was developing for fun and learning purposes another Facebook application! Basically what I want it to do is:
1.) You choose something to click on
2.) You choose from the fb friend selector formular one friend
and then the app does a wall posting with the item chosen at point 1 on the wall of the friend chosen from point 2!
The thing is, i created a php post formular and had the fb friend selector in it like that:
<form action="send.php" id="testForm" method="post">
[blah blah the items to choose]
<fb:serverfbml style="width: 240px; height: 700px;">
<script type="text/fbml">
<fb:fbml>
<fb:friend-selector uid="$user" name="uid" idname="uid2"/>
</fb:fbml>
</script>
</fb:serverfbml>
<input class="inputbutton" style="cursor: pointer;" name="do_it" value="submit" type="submit">
</form>
So the thing is, when my send.php file only contains for example:
<?php
[facebook api shit]
if($_POST[do_it]=="submit"){
echo $_POST[$user];
}
or i replaced it with echo $_POST['uid'] or $_POST['uid2']
and none of them showed me a value at all
so where is the bug??
fb:serverfbml creates an iframe, so because your form is outside, it won't send anything inside the fb:serverfbml tag.
You need to do something like this:
<fb:serverfbml width="615">
<script type="text/fbml">
<form name="form" action="http://www.remy-mellet.com/remote/fb/reverse/temp.php" id="form">
<fb:friend-selector uid="797350112" name="uid" idname="friend"/>
<INPUT type="submit" value="test">
</form>
</script>
</fb:serverfbml>
Parameters received:
<?php
print_r($_POST);
print_r($_GET);
?>

I need help with forms submit, please read for details

I would like to create a form where the user can put a number in like "12345" and when the submit button is clicked have the result be http://www.URL.com/12345
Do you need that data to be posted somewhere, or do you just want to jump to that location?
You could try without a form:
<label for="number">Number: </label>
<input type="text" id="number" /><br />
<input type="button"
onclick="window.location='http://www.URL.com/'+document.getElementById('number').value;" />
Here's the jQuery version separating the events from the markup. Demo can be seen here
<html>
<head>
<script type="text/javascript" src="jquery-1.4.2.js"></script>
<script>
var url="http://www.url.com/";
$(document).ready(function(){$("#go").click(function(){
url+=$("#parameter").val()
window.location=url;
});
});
</script>
</head>
<body>
<input type="text" id="parameter"/>
<button id="go">Go</button>
</body>