is it possible to update paypal's adaptive payments lightbox display options? - paypal-adaptive-payments

we are using paypal adaptive payments embedded solution so our buyers can stay on the site during checkout. we want to change the lightbox CSS. how can we do it? after looking at the PP adaptive payments API documentation all we could find was headerImageUrl. how do we changed the header logo? can the background be changed?
<form action="https://www.sandbox.paypal.com/webapps/adaptivepayment/flow/pay" target="PPDGFrame">
<input id="type" type="hidden" name="expType" value="light">
<input type="hidden" name="business" value="seller_1328179547_biz#complexintegrations.com">
<input type="hidden" name="shipping" value="5.00">
<input type="hidden" name="amount" value="6">
<input type="hidden" name="headerImageUrl" value="https://domainname.com/images/LOGO%20%281%29.png">
<input id="paykey" type="hidden" name="paykey" value="AP-4N0030004W852052F">
<input id="GetShippingAddresses" type="hidden" name="GetShippingAddresses" value="1">
<input type="image" src="https://www.paypal.com/en_US/i/bnr/bnr_MSPFbanner_ec2_143x32.gif" id="submitBtn" value="Pay with PayPal" style="height:22px;position:relative;top:5px;">
</form>
<script type="text/javascript" language="javascript">
var dgFlow = new PAYPAL.apps.DGFlow({ trigger: "submitBtn" });
</script>

You can't do this on the Lightbox.
There's unfortunately no way to customize it, beyond changing the width of it (And you have to manually hack the JS for that.)

Related

Automated browser does not submit form

I'm currently making automated tests for Browserstack using Selenium and Nightwatch.js. I've encountered a problem where I'm unable to submit a login form. Either nothing happens or the page just reloads. All required login data are set using browser.setValue('{selector}', '{value}'). Tried this on Chrome and Firefox, but the result is the same. I am able to submit the form using JS in browser console, though.
I've tried the following methods to no avail.
browser.submitForm('#login-form');
browser.click('#send2');
browser.execute("document.getElementById('send2').click();");
browser.execute("document.getElementById('login-form').submit();");
Is there anything that I'm missing? If that makes a difference, I'm trying to automate a login form for Magento 1 site.
Much thanks.
Edit:
Added form HTML
<form action="https://{site}/en/customer/account/loginPost/" method="post" id="login-form">
<input name="form_key" type="hidden" value="1CdZGL4mwA0njx3U">
<div class="form-group">
<input type="text" class="input-text-custom required-entry validate-email form-control" id="email" name="login[username]" value="" title="Insert Email Address" placeholder="Insert Email Address">
</div>
<div class="form-group">
<input type="password" class="input-text-custom required-entry form-control" id="pass" name="login[password]" title="Password" placeholder="Password">
</div>
<div class="form-group">
<input type="checkbox" name="nl_subscribe" id="nl_subscribe_existing" value="subscribe" class="form-control checkbox">
<label for="nl_subscribe_existing" class="text-normal-checkout"><span></span>By the way, I also want to subscribe to your newsletter*</label>
</div>
<input type="hidden" name="nl_source" value="customer_login" class="form-control checkbox">
<div class="form-group"><div class="control remember-me-box">
<div class="input-box">
<input type="checkbox" name="persistent_remember_me" class="checkbox" id="remember_meL0h6snrk30" title="Remember Me">
<label for="remember_meL0h6snrk30" class="text-normal-checkout"><span></span>Remember Me</label>
</div>
</div>
</div>
<div class="forgot-password">Forgot password?</div>
<div align="center"><button type="submit" class="button-check" name="send" id="send2" title="log in"><span><span>log in</span></span></button></div>
</form>
Edit 2:
Is it possible that this is related to configuration? I launched this test on local browser and then stopped it, so I could fill and submit the form manually, but I was not able to submit it anyway.
It appears that the script was fine but there was a bug in the site. For some reason, script needs to refresh the browser to be able to submit the form successfully. So, until this is fixed, I've implemented browser.execute('location.reload();'); as a workaround.

Simple Button with ability for user to enter the amount on my site

I am new to payPal. I'd like to use a simple PayNow button on my site. The problem is that I would like my webUsers to enter any amount they want to pay on my site and have it transfer to payPal when the Pay button is clicked.
This option does not seem to be available in any of the button types. They require preset amounts or entering the amount on the PP site. Is my only option to dive into learning the API?
Thanks, Mike
This may be what you need:
<form name="input" target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="add" value="1">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="YOUR BUSINESS NAME">
<input type="hidden" name="item_name" value="ITEM NAME">
<input type="hidden" name="item_number" value="ITEM ID NUMBER">
Other amount: €<input type="text" maxlength="200" style="width:50px;" name="amount" value="5.00"> EUR<br />
<input type="hidden" name="currency_code" value="EUR">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_buynow_SM.gif" border="0" alt="PayPal - The safer, easier way to pay online!">
</form>
Change the value of the variable business to the receiver email, i.e.:
<input type="hidden" name="business" value="receiver#email.com">
You may want to read HTML Variables for PayPal Payments Standard - PayPal Developer

res.forbidden error on file upload into sails

I'm having an odd issue in node/sails and difficultly troubleshooting. I can upload small xls files via a upload form but larger ones do not process/upload, here is a simple test, when passed a small file (500-1000 rows) it processes fine and I get console logs. A large (20,000 row) file just spins on uploading.
My form looks like this:
<div class="row col-xs-12">
<form id="uploadForm"
enctype="multipart/form-data"
action="/utility/test_req"
method="post">
<label for="Parse Through Row" class="control-label">Parse</label>
<input type="text" name="num_rows" />
<input type="file" name="csv_file" />
<input type="hidden" name="_csrf" value="<%= _csrf %>" />
<input type="submit" class="btn btn-default" value="Upload CSV"/>
</form>
</div>
And my Controller looks like this:
test_req: function (req, res, next){
console.log("here");
console.log(req.params.all());
res.redirect('/utility/migration')
},
Move the _crsf token to the top of the form, i believe input fields are sent in order by the browser, and hence, parsed in the same order by sails. csrf tokens are time constrained so you get a short window of usage before they get invalidated, then if you have a big file, first your file gets processed(or files) and when sails is done with that it will parse your token, but then is too late.
<form>
<input type="hidden" name="_csrf" value="<%= _csrf %>" />
// The rest of the inputs here, including the file input.
<input type="submit" class="btn btn-default" value="Upload CSV"/>
</form>
It should work now :)
This was a csrf issue. Disabling csrf globally allows the controller action to be reached with larger files. I'm not sure if this is a configuration issue (likely) or a bug with csrf or sails (unlikely).

PayPal Website Payments for Services

I'm trying to setup PayPal's Website Payments system on my website, where I'm selling services with no shipping!
I'd like to specify for PayPal Checkout to send the payment for me as not for Good, but for Services, so I won't get bound to ship something physical!
My code now: (It's sandbox now)
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="lc" value="en">
<input type="hidden" name="page_style" value="primary">
<input type="hidden" name="business" value="pp_1350857585_biz#zgmail.us">
<!-- <input type="hidden" name="notify_url" value=""> -->
<input type="hidden" name="item_name" value="TEST">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="amount" value="100">
<input type="hidden" name="no_note" value="0">
<input type="hidden" name="no_shipping" value="1">
<!-- <input type="hidden" name="return" value=""> -->
<!-- <input type="hidden" name="cancel_return" value=""> -->
<!-- <input type="hidden" name="custom" value=""> -->
<input type="image" style="width: 144px;" src="https://www.paypalobjects.com/en_US/i/btn/btn_paynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
What should I change?
Thanks in advance!
you need to add this setting L_PAYMENTREQUEST_n_ITEMCATEGORYm
From Paypal Docs:
Indicates whether an item is digital or physical. For digital goods, this field is required and must be set to Digital. You can specify up to 10 payments, where n is a digit between 0 and 9, inclusive, and m specifies the list item within the payment; except for digital goods, which only supports single payments. These parameters must be ordered sequentially beginning with 0 (for example L_PAYMENTREQUEST_n_ITEMCATEGORY0, L_PAYMENTREQUEST_n_ITEMCATEGORY1). It is one of the following values:
Digital
Physical
This field is available since version 65.1.
According to PayPal, it's not possible to mark item as service (or digital) in PayPal Website Standard API. That's possible in Paypal Express Checkout though, as Scott mentioned above.
Here is the quote of a PayPal representative's comment on this matter:
Unfortunately, PayPal Website Standard does not support Digital Goods.
You will have to use the Express Checkout in order to use the
L_PAYMENTREQUEST_n_ITEMCATEGORY='Digital' to set it as Digital Goods.

Search box like w3schools.com

I want to make a simple searchbox in my website. I think for my situation, the best way is to use something like w3schools.com did. When user types smth and press enter it redirects to google.com/search and it will search from only w3schools.com in google because there is site:www.w3schools.com is given in url. how can i do that?
A simple solution would be something like this:
<html>
<head></head>
<body>
<form method="get" name="searchform" action="http://www.google.com/search" target="_blank">
<input type="hidden" name="sitesearch" value="stackoverflow.com">
<input type="text" name="as_q" size="20" value="Search stackoverflow.com">
<input type="submit" value="Search" title="Search">
</form>
</body>
</html>
But you should also check this out:
http://www.google.com/cse/
Just browse source code and take everything you need, that trick will often do in case of HTML how-to's:
<form method="get" name="searchform" action="http://www.google.com/search" target="_blank">
<input type="hidden" name="sitesearch" value="www.yoursite.com">
<input type="text" name="as_q" size="20" value="Search yoursite.com">
<input type="submit" value="Search" title="Search">
</form>
Well. Actually it seems this is quite easy job. I have found the solution At:
http://www.askdavetaylor.com/how_can_i_add_a_google_search_box_to_my_web_site.html/
I think what you are looking for is Google Custom Search Engine. Start here: http://www.google.com/cse/docs/ , http://www.google.com/cse/manage/all

Resources