Paypal Express checkout refund - php

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.

Related

Paypal notify_url in invoice PayPal-PHP-SDK

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.

How can I use Paypal for future payments without redirects?

In my web app (PHP) the user should be able to connect his paypal account and every time he sold a product from our catalog we will charge him the price.
Since the user might sell lot of products I want to make the payment part automatically so he won't have to approve every transaction.
Unfortunately I don't find a way to do this with Paypal SDK.
Currently the app is using the OAuth flow so the user is redirected to Paypal from where I get the access_token for him.
Question: Having the access_token for an user how can I create a (background) payment without the Paypal redirect?
Thank you
Answering to my question here since I think I found a solution.
It looks like this can be done using Payment Preapproval Api

How can I make an automatic PayPal buy button?

I want my PHP web application to have the ability to save the user's PayPal details in their user account.
When they go to purchase items, rather than going through the standard PayPal form, it will automatically grab the user's PayPal details from their user account, and make the payment directly from my website. There is definitely a way to do this, as I have seen this feature on sites such as Freelancer.com
Thanks for the help! :)
No, you don't need Payments Pro for that. That would only be if you want to do it with direct credit cards. What you're after in general is called Reference Transactions, and when done with PayPal Express Checkout it uses Billing Agreements.
You'll use Express Checkout and/or Payments Pro (optional) to process an original authorization or sale transaction. Then, you can send that ID you get back in that original transaction along with a new amount in the DoReferenceTransaction API and that new amount will be instantly processed without any redirection or further authorization required.

approve a payment in PayPal via php

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).

how can i use Paypal for premium section of my site and deal with premium vs normal users?

I want to achieve something like this
http://depositfiles.com/en/gold/payment.php
I have normal users signed up. I want them to upgrade to premium user. Once a person pays, how do I know which user he was signed in ? How do i force the user to login first before being able to click the paypal button and make payment ? Otherwise, I would receive money, but wouldn't know which user to mark as "PAID" in my database.
when you click on the paypal button, it redirects you to the paypal page where you can login and pay.
I also want to accept Visa and Mastercards, is it doable through paypal using the same method ?
Paypal's information can be found here:
Part 1
You can create a subscribe button for each type of subscription you want and use the HTML variables in Part 2 to enable you to know what type of product and what user is included in the invoice.
This needs a lot more details than you currently provide. What language have you written your website in? Static HTML? Ruby? PHP? How does PayPal's payment system work?
normally the way it will work is that your site will pass information to paypal (http://paypal.sourceforge.net/ is one toolkit that seems to be made for php, thought I've never used it so I can't really promise its not abandonware).
once the paypal transaction is completed successfully, control is passed back to your site. you can then set the user's flag in your database as a premium user.
as far as I can tell, you tell paypal to handle payments for you, and the user picks a funding source in paypal. if you want to have visa/mastercard separately handled from paypal you'll need another payment gateway to handle it, like mirapay or something else.

Categories