express checkout integration step 3 - http redirect - php

here's my question.
I've made a request to the PayPal server to obtain a token but now i don't know how to use it to pass it to the url in which i have to be redirected, and i don't understood in the documentation how this process works.
<form method="post" action="https://api-3t.sandbox.paypal.com/nvp">
<input type="hidden" name="USER" value="user"/>
<input type="hidden" name="PWD" value="pass"/>
<input type="hidden" name="SIGNATURE" value="signature"/>
<input type="hidden" name="VERSION" value="72.0"/>
<input type="hidden" name="PAYMENTACTION" value="Sale"/>
<input name="AMT" value="19.95"/>
<input type="hidden" name="RETURNURL" value="http://www.example.it"/>
<input type="hidden" name="CANCELURL" value="http://www.example.it"/><br/><br/>
<button style="background:#FFF; border:0px;" type="submit" name="METHOD" value="SetExpressCheckout"><img src="https://www.paypal.com/en_GB/GB/i/btn/btn_xpressCheckout.gif" value="SexExpressCheckout"></button>
</form>
In this case i send the data to the PayPal Sandbox server, i'm redirected there and there is the string in output with the token and the "Success" state.
Now i don't understand:
How can i be redirected to the login payment page (with the token inside the querystring) without landing on the Sandbox server url page?
I've watched the PHP SDK example about it but i possibly wanted to use a simple solution like described in the documentation.
Any tips to follow?
Thanks a lot

Related

Form that logs in to a website?

If there is a website and I want to write a form that logs me in, how can I do it?
This form logs me to stack overflow
<form method="post" action="https://stackoverflow.com/users/login">
<input type="hidden" name="email" value="myemail">
<input type="hidden" name="password" value="mypassword">
<input type="submit">
</form>
I want to do so on this website, but the script doesn't work for some reason.
<form method="post" action="http://forums.heroesofnewerth.com/login.php?do=login/">
<input type="hidden" name="vb_login_username" value="myusr">
<input type="hidden" name="vb_login_password" value="mypass">
<input type="submit">
</form>
Any idea why?
Ok, it worked I had to send more data.
<form method="post" action="http://forums.heroesofnewerth.com/login.php" onsubmit="md5hash(vb_login_password, vb_login_md5password, vb_login_md5password_utf, 0)">
<input type="hidden" name="vb_login_username" value="usr">
<input type="hidden" name="vb_login_password" value="pwd">
<input type="hidden" name="do" value="login">
<input type="hidden" name="vb_login_md5password" value="">
<input type="hidden" name="vb_login_md5password_utf" value="">
<input type="hidden" name="s" value="">
<input type="hidden" name="securitytoken" value="guest">
<input type="hidden" name="url" value="http://forums.heroesofnewerth.com/index.php">
<input type="submit">
</form>
A lot of websites on the internet (not nearly enough though) have protection in place that prevents sites other then their own to post forms (log in for example) to their site. A site that does not have this protection is vulnerable to:
Cross Site Request Forgery (CSRF): http://en.wikipedia.org/wiki/Cross-site_request_forgery
This is a major security risk that allows phishing sites to log you in to the actual website while catching your login details and a whole lot of other nasty stuff.
There could also be other protection in place to prevent you from sending a request.
Try to see if there are any API's available instead for what you are trying to achieve.

How to transform PayPal Classic Payment form into PayPal REST API PHP Application?

The following is the simplest PayPal interface form:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" />
<input type="hidden" name="cmd" value="_xclick" />
<input type="hidden" name="business" value="JohnDoe2#example.com" />
<input type="hidden" name="item_name" value="Purchase at the Virtual Store" />
<input type="hidden" name="item_number" value="Organic-001" />
<input type="hidden" name="amount" value="17.4" />
<input type="hidden" name="currency_code" value="EUR" />
<input type="hidden" name="notify_url" value="http://www.example.com/paypalnotify.php" />
<input type="submit" name="submit" value="Pay now By PayPal" />
</form>
This form is specific to a PayPal premier business account and a given amount to pay, with following key parameters:
business=JohnDoe2#example.com.
amount=17.4EUR.
currency_code=EUR or USD.
notify_url as the callback for PayPal.com as it ends.
By clicking on the [submit] button, it perfoms this:
It redirects the customer to the paypal.com site.
The user will login into her/his PayPal account, and validate the payment.
The PayPal site will call the paypalnotify.php like a callback, passes information indicating if the payment has suceeded, cancelled, or not valid...
Now in the new interface using PalPal REST API, using PHP development kit, how one has to proceed to accomplish the payment ?
There are a few options. Start by looking at the code in these files:
https://github.com/paypal/rest-api-sdk-php/blob/master/sample/payments/CreatePayment.php
https://github.com/paypal/rest-api-sdk-php/blob/master/sample/payments/CreatePaymentUsingPayPal.php
Obviously they don't have any interactive forms, but they show the general process. Dig in and work through creating your code. Then when you hit problems, open a new question with the specific issues. StackOverflow is not for "how do I" type questions. https://stackoverflow.com/help/on-topic

PayPal _cart Upload to Sandbox never allows login

So I have been doing a lot of Googling on PayPal's _cart Upload ability and so far, this is what I have managed to put together. And this seems to be working just fine; I am taken to a PayPal page with the purchase info and it asks me to login. But when I login with a Sandbox buyer account, it simply shows that it's logging me in but it never logs me in nor does it allow me to complete the purchase. The merchant sandbox account is working fine as it displays the Example store name on the PayPal page.
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="upload" value="1">
<input type="hidden" name="business" value="xxx#xxx.xxx">
<input type="hidden" name="item_number_1" value="3">
<input type="hidden" name="item_name_1" value="Foo">
<input type="hidden" name="amount_1" value="22.97">
<input type="hidden" name="shipping_1" value="0">
<input type="hidden" name="shipping2_1" value="0">
<input type="hidden" name="quantity_1" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="amount" value="22.97">
<input type="hidden" name="notify_url" value="http://******/order.php">
<input type="hidden" name="no_shipping" value="2">
<input class="paypal_button" type="image" src="http://www.paypal.com/en_US/i/btn/x-click-but03.gif" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
</form>
Am I doing something wrong when I'm logging in to PayPal or is the _cart upload ability deprecated after PayPal moved to a new a developer site and API? Any and all help would be appreciated it, I have been banging my head against the wall for hours trying to figure out what I'm doing wrong.
I don't think it'd make a difference but I am using PHP to generate the checkout information.
Thank you very much for your help.
I just submitted a payment using your code and my own sandbox account. It worked fine for me.
PayPal's servers can sometimes be pretty finicky with cookies in browsers. Close your browser (all instances of it so it's completely closed) and then reopen it and try again. Make sure you're signed in at developer.paypal.com before you try it and you should be just fine.

Paypal Sandbox Testing - Change of URL Endpoint?

It seems there are a lot of changes with Paypal Sandbox lately and I am stuck with my testing. Before, we only point to https://www.sandbox.paypal.com/cgi-bin/webscr for Sandbox testing as seen in the code below:
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" style="padding: 0; margin: 0;">
<input type="hidden" name="cmd" value="_xclick" />
<input type="hidden" name="business" value="your bussiness id" />
<input type="hidden" name="quantity" value="1" />
<input type="hidden" name="item_name" value="your item" />
<input type="hidden" name="item_number" value="1" />
<input type="hidden" name="amount" value="item price" />
<input type="hidden" name="shipping" value="0" />
<input type="hidden" name="no_note" value="1" />
<input type="hidden" name="notify_url" value="Your notify url">
<input type="hidden" name="currency_code" value="GBP" />
<input type="hidden" name="rm" value="2" >
<input type="hidden" name="return" value="your return url">
<input type="image" border="0" name="paypal" src="images/btn_paypal_nl.gif" onClick=""/>
</form>
But now, Sandbox keeps asking me to "Please login to use the PayPal Sandbox features." which I assume means I am using the wrong endpoint given the latest Paypal Sandbox changes.
My questions now are:
Does this still work?
If yes, "https://www.sandbox.paypal.com/cgi-bin/webscr" is replaced with what?
As of now, I'm assuming that the URL I mentioned above is the only change I need to do. However, I can't find new documentation on what the new URL to submit the form to is. And Paypal doesn't have updated docs about this.
Please help.
Thanks.
Yes, the link "https://www.sandbox.paypal.com/cgi-bin/webscr" still work. But, now you have to use your paypal account credential to login to your paypal.developer acount. If you don't have this then just create one here https://developer.paypal.com/webapps/developer/applications/accounts. Your old sandbox login credentials will not work here. But after logging through your paypal account you can import your old sandbox's personal and business account to here.
Create session in new tab by logging using https://developer.paypal.com/webapps/developer/applications/accounts
and if still see sandbox blank page with just sandbox.com name then just clear your cookies and cache an try again.
Hope this will work for you.
Please change your cmd value _xclick/ -> _xclick
When using features of the paypal sandbox, you must first log in to the developer area at https://developer.paypal.com/ to establish a session there. I usually leave it open in a different tab.
edit
If you had a developer account prior to the recent updates to the developer area, you might have to go in and set up a new sandbox account. I lost access to the sandbox accounts that I had set up, but the API calls still worked.
Check https://developer.paypal.com/webapps/developer/applications/accounts. If you see your old account listed there with a disabled checkbox, or don't see it listed at all, create a new one.

How to integrate FirstData as payment gateway?

I want to integrate FirstData as my payment gateway.
How to start with this?
I am using php.
Thanks
Code which i have used
<? include("ipg-util.php"); ?>
<form method="post" action="https://test.ipg-online.com/connect/gateway/processing">
<input type="hidden" name="txntype" value="sale">
<input type="hidden" name="timezone" value="GMT"/>
<input type="hidden" name="txndatetime" value="<?php echo getDateTime() ?>"/>
<input type="hidden" name="hash" value="<?php echo createHash(13.00,978) ?>"/>
<input type="hidden" name="storename" value="1909354791"/>
<input type="hidden" name="mode" value="payonly"/>
<input type="text" name="chargetotal" value="13.00"/>
<input type="hidden" name="currency" value="978"/>
<input type="submit" value="Submit">
</form>
Quite old post, but might be useful for others.
The documentation of First Data Payment Gateway is available here.
Once your form is set up with your store name and other required information, don't forget to set up the connection settings in your Global Gateway Virtual Terminal account:
Production link: https://www.linkpointcentral.com
Test link: https://www.staging.linkpointcentral.com
To do so, go to Administration > Connect Settings, then insert in Submission Form URL the URL of the page from which you call the payment service, and the response URLs...
Hope it helps.
Yes Guillaume.M you are right.
Actually had a problem while integrating the connect, then i contacted support then they told me that the Submission Form URLs are required to do the payment successfully!..
Submission URL are basically the success or thank you page and failure page url.
In the manual avaiable on the telecash documentcenter, they did not added the URL settings step in mandatory..
Then i emailed them, they accepted the suggtion..
Thank you

Categories