I write a PHP script with cURL that should approve a payment in PayPal.
It work like this:
I got this link from website:
https://www.paypal.com/cgi-bin/webscr?VERSION=3.2&cmd=_express-checkout&token=EC-7ND07251WN147471E&useraction=commit
the token is a temporary uniq id of payment.
on this page I insert credit card/PayPal account.
then, I redirect again to the website of the seller for final confirm.
I need to write a script that will approve payment by his token.
the script will take the token from given link, and will approve the payment.
I searched a lot in google for solution and I find some PayPal API's.
When I started to dig the API's I find out that those API's are only for sellers.
Those API's let the seller integrate PayPal checkout to their website, but there isn't any function that can help me do what I want.
Anybody know about any solution?
Thanks!
PayPal offers some SDK's here http://paypal.github.io/
You would want the Merchant SDK. There is a PHP one in there you can use to help build your DoExpressCheckoutPayment call. I don't know if anyone would provide you with a custom cURL script to submit the payment - I would be interested in seeing it if one is provided.
DoExpressCheckoutPayment is also function for the seller. after the buyer pay, he redirected back to the site of the seller, and then the php code in the site execute the DoExpressCheckoutPayment function. I look for the function that will approve the payment instead of the buyer(me).
Related
i'm using CreateInvoice.php this code for creating paypal invoices. But problem is just like express checkout and formal paypal checkout i can't figure out how to add notify_url , cancel_url, return_url while creating invoices.
And in samples i can't find how to accomplish this job.
The parameters you are asking about are not relevant to the invoicing API.
notify_url is to specify an IPN URL. The REST API does not use IPN, though. Instead, it uses Webhooks. You can register those manually within your REST App in your PayPal developer account, or you can set them up with the API.
cancel_url and return_url are used with things like the checkout APIs so that PayPal knows where to send the user when they make those actions. The CreateInvoice invoice API would not need this, though, because there is no redirect to PayPal / login happening with the user.
Instead, it's simply using your API credentials to create the invoice and give you a success or fail result. Based on that result you can redirect wherever you want. Again, you're never leaving your app in this case, so you don't need to specify where to be sent back.
Hope that helps.
I have a system that simply registers a user. I need to intergrate this with PayPal so that only IF a user has paid can they have access their account. Paying involves confirming to a monthly payment, with the first month free. I need to use some PayPal API that will inform the user of the monthly fee, let's them subscribe, and then if it was a successful returns True to my PHP system so It can then activate the account.
So what do I need to do to get this process running? What will I need to do?
https://developer.paypal.com/ is a great place to start.
They offer guides and code libraries and examples there.
And as far your rest of the requirement, you can handle that in callback from paypal. according to payment status and update your record and notify the user.
You need a Form from Where you post information to Paypal (which you can find in paypal SDK
Paypal Will process the payment once form correctly posted.
Paypal will send you response on your callback.php file of which file link you post in Form.
Handle all your conditions in that callback file.
I am trying to allow my website users to click a refund button which will take them to paypal, get them to login, then confirm refund, which then redirects them back to my site. So what i am looking for is the opposite of express checkout. I have looked everywhere but cannot find anything on this.
Does this facility exist or is there a workaround to get the same result?
Thanks
PayPal doesn't offer a web flow for this; a merchant can simply call the RefundTransaction API call to immediately process a refund.
If you do want some kind of web flow, you'll want to build this yourself.
i have a client that provide a service on his website.he wants to automate the service orders.
the service has these steps:
1- user submit a form with request.
2- my client review the request, validate it and use the info in this request to :
3- login to another website
4- buy a product from this website using his paypal account.
5- downlad and send the product in email to the user.
i was able to automate all of this using curl.the only problem i have is the purchase process using papal.i didn't deal with paypal before.so i want to know if i can just submit the papal form on the purchase website using curl.or this will not work?
while searching i found something about papal IPN.but i don't know if my client have this IPN in his papal account or not? also, he does not want to give me his papal info. is there is anyway i can do this with fake paypal account to try it?
thank you so much.
First of all, sign up for a PayPal sandbox account: https://developer.paypal.com/devscr?cmd=_signup-run
It's a really slick system PayPal put together for developers to test out stuff.
Secondly, review the PayPal API's at:
https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/library_download_sdks
I believe all you need is the PHP Name-Value pair or Website Payments Standard interfaces.
IPN stands for Instant Payment Notification, it's a way for PayPal to tell you that a payment was made.
What you are looking for is either the PayPal NVP or SOAP interfaces.
I need to setup a payment method on my website that allows a certain user to pay another via two email address'. So essentially, user1 comes to a page, downloads an invoice and has the option to pay that invoice using a link which redirects to paypal with the prefilled details i.e. payeremail, receiveremail, amt, currencycode. Does anyone know which API call I need to make to do this? All I can really see in the API is for other users to pay my account which I already have setup for another function. Thanks in advance.
You need PayPal IPN, after the payment goes through you will receive following information https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_html_IPNandPDTVariables
Here is PHP handler for the IPN, http://www.boolcast.com/development/joomla-custom-paypal-ipn
You can also look at other sample code example on PayPal site.