paypal order summary empty on mobile - mobile

I couldn't find any similar questions (most dealt with broken form posts) but this is not the case.
I have a paypal form that works flawlessly on desktop/laptop. On mobile devices I successfully get to paypal but there is nothing in the order summary, as if nothing got posted to paypal. A variable dump shows all form variables are in place, so I'm quite confused.
Here is the form I submit:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" id="myRegister">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="service#obscured.com">
<input type="hidden" name="item_name" value="Some description.">
<input type="hidden" name="amount" value="5.00">
<input type="hidden" name="no_shipping" value="0">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="bn" value="PP-BuyNowBF">
<input type="hidden" name="item_number" value="1248" />
<input type="hidden" name="cbt" value="Click This Button To Register." />
<input type="hidden" name="return" value="http://mydomain/redirect.cfm" />
</form>
And that works on Desktop. I am just trying to get it work within a phone browser at the moment. I'll deal with the Paypal phone app at another time, if needed.
Any help appreciated.
Edit: This is also happening with PayPal hosted Buy It Now buttons as well.

Your code works fine for me on mobile, I can see the order details by tapping the "My total". The details are hidden at the first place though, I have to tap to make it show, seems it's designed this way

Within Android browser settings, clear setting for individual websites: Settings > Content Settings > Website Settings. Select paypal.com. Apparently there was a issue that was not resolved just by clearing the browser cache.

Related

Paypal notify url - how to receive data back from paypal after payment with nodejs / using a simple paypal html form and no sdk?

I am trying to integrate paypal as a payment option. As I have done it (which works) is not using any paypal snd but just the simple html form. Ive been looking at it for a while and perhaps my question is stupid, but I don't understand what the difference is to just using the html form or (at paypal developer provided sdk)? Could someone explain please?
Also, I am trying to write a backend route with nodes/express. I set up the notify url for paypal which - as I understand- will return to me an object containing data (what was paid, the users paypal id etc.).
so what I did was:
1. set up notify url which goes to the (angular state) /summary. - Im not sure if it perhaps should be the backend url and not the state.
2. then I have the fronted http call (as I also want to display a purchase summary to customer after he paid at paypal).
3. route in the backend to post to db.
I have been looking a lot a different documentation and tutorials but don't quite understand it and if anyone would have a few min explaining it to me, that would be amazing!! Thank you!
app.controller('summaryCtrl', function($scope, $http){
return $http.post('api/order/summary', {???})
.then(function(paypalObj){
$scope.paypalObj=payppalObj;
})
// here I am not sure what Im sending/how do I know what the object Im getting back from paypal named)
})
router.post('/summary', function(req, res, next){
console.log(req.body,res, 'paypal')
User.findById(req.user.id)
....
Order.create
...
})
html form:
<form method="POST" accept-charset="utf-8" action="https://www.sandbox.paypal.com/xxx/xxx" name="pp" id="pp">
<input type="hidden" name="cmd" value="_xclick" class="validate">
<input type="hidden" name="business" value="name#yahoo.com" required="required">
<input type="hidden" name="currency_code" value="USD" required="required">
<input type="hidden" name="quantity" value="{{quantity}}" required="required">
<input type="hidden" name="amount" value="{{price}}" required="required">
<input type="hidden" name="return" value="http://localhost:1337" required="required">
<input type="hidden" name="cancel_return" value="http://localhost:1337/about" required="required">
<input type="hidden" name="notify_url" value="http://localhost:1337/api/order/summary" required="required">
</form>
insight my angular controller (as Im using angular:
$scope.paypalPay=function(){
$('#pp').get(0).submit()
};

Hidden Inputs in AngularJS Form

I have a form where I want to submit a hidden value that is not seen (or editable) by the user.
Originally I was attempting to do it with something like:
<input type="hidden" data-ng-model="data.selfscan" value="true">
But looking into the issue and at previously asked/answered questions here, I learned that hidden input type doesn't work with AngularJS. So instead I needed to do something like this:
<input type="text" data-ng-model="data.selfscan" value="true" data-ng-value="true" data-ng-show="false" />
Unfortunately, that did not work either.
I saw another post about how I should initialize it, so I had
<input type="text" data-ng-model="data.selfscan" data-ng-init="data.selfscan='true'" data-ng-show="false" />
That seemed to do the trick in getting the value to appear in the form (at least when I viewed it by making the box visible), but unfortunately the init seemed to break another part of the form making the entire thing unsubmittable.
I've spent way too much time on what should be a simple thing, so I'm looking towards all of your expertise for help or suggestions of what else to try or what could be going wrong.
Just handle the form submit action in the controller.. like this.
Html:
<form novalidate class="simple-form">
<input type="text" ng-model="user.name" /><br />
<input type="submit" ng-click="updateUser('hidden data')" value="Save" />
</form>
Controller:
$scope.updateUser = function(hidden){
if(hidden){
$scope.user.other = hidden;
}
};
Your first attempt is almost right:
<input type="hidden" data-ng-value="data.selfscan" value="true">
As input hidden is not editable by user it does not implement two-way binding, so you need to do one way value binding.

Access to form data that submitted by an unknown source

Scenario:
Another web application get a link from my web app and then POST some data to the link, like this:
<form action="http://www.example.com/mylink">
<input type="hidden" name="data1" value="1" />
<input type="hidden" name="data2" value="2" />
<input type='submit' value="submit" />
</form>
I know there are two parameters data1 and data2 in POST data and nothing else.
Question:
How can I access to this data in Controller?
Because this form submitted in another web application so there is not ng-model directive and or ng-click="submit(customerForm)". I don't know even what is form's name.

Angularjs Open Window With Post Params

I have a two forms in my application.
In the first one the user sets his data. When submitted the form data gets checked and an entry is made into a database with $http.
The second one is hidden and contains the payment parameters for either paypal or amazon payments.
I need one of two solutions (I can do A but my gut feeling is that B is better):
A)
Trigger the submit function of form B when the promise of form A's http is resolved.
This would be one solution which is not very good I guess:
HTML
<form method="POST" action="{{spendenController.paypal.actionUrl}}" target="_top" id="paypalForm">
<input type="hidden" name="cmd" value="_donations">
<input type="hidden" name="business" value="{{spendenController.paypal.accountEmail}}">
<input type="hidden" name="currency_code" value="EUR">
<input type="hidden" name="lc" value="DE">
<input type="hidden" name="amount" value="{{spendenController.spenden.amount}}">
<input type="hidden" name="item_name" value="Spende">
<input type="hidden" name="notify_url" value="{{spendenController.paypal.notifyUrl}}">
<input type="hidden" name="return" value="{{spendenController.paypal.successRedirectUrl}}" />
<input type="image" src="https://www.paypalobjects.com/de_DE/DE/i/btn/btn_donateCC_LG.gif" border="0" name="btnSubmit" alt="Jetzt einfach, schnell und sicher online bezahlen – mit PayPal.">
<img alt="" border="0" src="https://www.paypalobjects.com/de_DE/i/scr/pixel.gif" width="1" height="1">
</form>
Controller
document.getElementById('paypalForm').submit()
B)
Or load a page with POST params directly from the controller/a service when the promise is resolved. In that case I wouldn't even need the second form.
Question: How to open a page with POST from the controller?
I do not just want to send POST data with $http.post I need the user to see the paypal checkout window in order to fulfill the payment.

roundcubelogin with window.open function

I have already done autologin to roundcube via the following script
<form name="webmail" action="http://localhost/roundcube_mail/" method="post">
<div class="info" style="color:#f00;display:none"></div>
<input name="_action" id="_action"value="login" type="hidden" />
<input name="_timezone" id="_timezone" value="_default_" type="hidden" />
<input name="ajax" id="ajax" value="1" type="hidden" />
User <input name="_user" id="_user" type="text" value="anupam#excoflare.com"/><br>
Pass <input name="_pass" id="_pass"type="password" value="anupam123"/><br>
<input type="submit" >
</form>
it will work correctly.But i want to auto login roundcubemail via java script with window.open method for my p
The problem is that you want do do a POST request instead of a GET request. This might help you:
JavaScript post request like a form submit

Resources