Paypal payments for digital goods - php

Hi I have some questions for paypal digital goods express checkout
I am following paypal tutorial on integrating payments for digital goods and using merchant sdk for same.But I want some suggestion and have some questions
Is there some other better alternative to integrate payment for digital goods ?
Should I configure IPN or can I rely on return url to save data on backend?
How can I make sure that data is from paypal both on return url and IPN .
As read I need to make request to https://www[.sandbox].paypal.com/cgi-bin/webscr/ with command cmd => _notify-validate [reference]
Is there any inbuilt function in sdk I am using or should I make manual call ?

re: #1, EC for Digital Goods is a solid choice for digital goods sales. If you don't need the digital-goods specific features you can also use PayPal's regular/plain EC or the newer RESTful products.
re: #2, EC doesn't do the payment until you make an API call (well, unless you explicitly ask it to with an added parameter). So you can use either the response from the DoEC API call or set up IPN. If you do choose to actually have the payment take place on PayPal's site you have some small chance of the user paying and not redirecting back successfully (e.g. they close the browser window, or the network hiccups). This should be very rare & you can probably handle it manually or with some other mechanism, but this is one reason people like IPNs: PayPal will try repeatedly to push you the info, so it requires more than a transient failure to not get the word (eventually).
re #3, it sounds like you know to validate the IPNs. And if you use GetExpressCheckout API calls you are hitting PP so again you can be certain of the source of the reply. This is one advantage the API integration model has over the redirection-based mechanisms in Website Payments Standard (although if you were using WPS you could use a feature called PDT to ask it to send you the same signature block as is used in IPN so you could post back to PP to validate the redirection contents).

Related

Accept PayPal payment using only credit card with Omnipay (PHP)

I integrated OmniPay in my project few days ago, and I wondered if there is any option coming with it to actually enable credit card payments.
https://github.com/thephpleague/omnipay
I want to understand how to enable the PayPal credit card payments (which do not require an paypal account) using it.
What PayPal API settings should I enable?
How can I code this?
Is there any option to do this using PayPal & PHP at all ?
I tried to document myself on this and I couldn't find any answer to this question. Neither on the https://github.com/thephpleague/omnipay nor on Stack.
The setting mentioned in comments, 'PayPal Account Optional' exists so you have the ability to only accept payments from people with an account (when set to 'No').
If set to 'Yes', payments without an account can be possible. But whether the option will be offered to a particular payer in a particular PayPal checkout attempt depends on very many factors, which you do not control.
The only way to have some guarantee of a guest method being offered is to show a credit card form on your own site, before the buyer reaches a PayPal.com page, using the black 'Debit or Credit Card' button that is part of the JS SDK. You can see an example demo here: https://developer.paypal.com/demo/checkout/#/pattern/server
That JS code used for payer approval can be paired with any backend to create and capture the order via API -- including Omnipay, which essentially acts as a proxy for the PayPal API. This JS replaces any redirect over to PayPal which you might be familiar with from oler legacy integrations; the JS SDK is a more modern way to get the payer's approval, via a small in-context window or open a credit card form iframe instead which is a better UX than redirecting away anyway.

How to charge your own fees alongside Paypal?

I've searched everywhere in order to find an answer but have not found one. All i know is that in order to do it you need paypal adaptive payments i think (if you know another way let me know)
What im trying to do is make it so that when a user purchases a product 15% goes to one paypal account and the rest goes to the authors paypal account but have done loads of searching and have found nothing
PayPalAP::setAuth('my_api_username', 'my_api_password', 'my_api_signature');
// I'm not passing in an environment, which will default it to sandbox mode.
$options = array(
'cancelUrl' => 'http://my_cancel_url',
'returnUrl' => 'http://my_return_url',
'currencyCode' => 'USD',
'receiverEmailArray' => array('receiver_of_funds'),
'receiverAmountArray' => array('15'),
'ipnNotificationUrl' => 'http://my_ipn_listener_url'
);
$respo
Adaptive Payments would be the way with paypal ... But I would recommend using stripe for this kind of transaction. The API allows better control and was build for this kind of complexity. If you can replace paypal with stripe, do it. If not, you will need to contact paypal. They made this feature restricted.
Patrick Simard is correct that this feature is now restricted, but assuming you have received authorization from PayPal to use the adaptive API, then you have two option:
Chained Payments
Parallel Payments
Both will achieve the same end game, but which one you choose is ultimately up to you.
Chained Payments
With Chained Payments, you set up a payment option where the initial payment goes into one account, a portion is removed/left in that account, and then the rest is sent on to a second account.
Parallel Payments
Parallel Payments will produce a similar result, but rather than all of the funds being sent to one account first before being sent onwards, the money is instead sent to two different accounts immediately. (This option actually supports up to 6 accounts being paid at once.)
Examples of the HTTP I/O can be found on the linked documentation pages. You will simply need to set up cURL requests to create these. (Which should be a fairly straight forward process.)
To reiterate, though, heed the following notice from PayPal about using this API:
Important: Adaptive Payments is now a limited release product. It is restricted to select partners for approved use cases and should not be used for new integrations without guidance from PayPal.
This warning can be found at the top of documentation pages for Adaptive Pay.
Edit: In response to your comment, I have located a possible alternative that does not rely on the Adaptive Payments API, and seemingly does not require special permission from PayPal to use.
The option I found is to use Express Checkout with Parallel Payments. This utilizes the PayPal Name-Value Pair (NVP) and SOAP API. Some details on this option can found on this documentation page: https://developer.paypal.com/docs/classic/express-checkout/integration-guide/ECParallelPayments/
As a caution, though, that page seems to indicate that the NVP and SOAP API is deprecated. I am unsure what they are replacing it with, but at this time, it does still appear to be an opportunity, although you may have to update your code at some point when they release their replacement for NVP & SOAP and/or when they remove NVP & SOAP.
There is also a full list of SDKs, which includes an Express Checkout SDK written in PHP for the NVP & SOAP API: https://developer.paypal.com/docs/classic/api/nvpsoap-sdks/

Creating paypal checkout service for client

I want to create a paypal checkout enabled website for my client.
I tried searching for this but no luck ..
my actual plan is:
any visitor in the website asking for service service should be able to pay via paypal and the money should go to my client paypal account ..
I would recommend using the Express Checkout API for this. You can use the SELLERPAYPALACCOUNTID parameter to pass in a 3rd party PayPal account ID or email address and the money will go directly to that account without the need to mess with Permissions.
If you happen to be working with PHP I'd recommend taking a look at my class library for PayPal. It will make the Express Checkout Calls (SetExpressCheckout, GetExpressCheckoutDetails, and DoExpressCheckoutPayment) very quick and easy for you.

How to use Paypal Standard in a web application with PHP

I'm looking for a way to build a web application using paypal payments standard. I'd like the user to get redirected to paypal, then fill out their information, and upon completion, add a value in our database saying that they successfully paid. I haven't found a solution or answer to this.
I found this thread for RoR, but didn't find anything for PHP
Paypal Website Payments Standard with a Ruby/Rails application
You can see instructions for a Payment Data Transfer at PayPal's site. Basically, you post the transaction amount and an ID token to their site, the customer pays on paypal.com, and then they're sent back to a pre-defined URL on your site with the transaction details.
I used the NVP API to do that.

Taking payment on a website

Whats the recommended way to do this with Paypal (i've heard they're a nightmare to deal with).
Ideally the user would sign up with credit card details and then i'd process the payments through their banks? Is that how it works? With API's?
Ideally the user would sign up with
credit card details and then i'd
process the payments through their
banks? Is that how it works?
No. In a correctly designed system you never have access to your user's credit card number. It's your payment processor (eg PayPal, MoneyBookers, FastSpring, etc.) that takes care of processing your customer's credit card.
So your customer is taken to the payment processor's site (on a page which can be customized to use your company's logo etc.) and then your payment processor warns you when a purchase a made (for example by calling a specific URL).
With API's?
Yup, PayPal (and MoneyBookers and things like FastSpring) offer APIs for several languages (like Java APIs).
PayPal has a dev environment on which you can test these kind of functionalities, so does MoneyBookers if I recall correctly (also note that sometimes the dev environments are a bit buggy and/or down).
PayPal offers APIs for processing payments. Typically, the user is taken off your page to login into paypal and then paypal calls back to your site with approval/shipping info. The whole point is for the user to shield their credit card info from your site, making things safer.* You can use either the NVP (name-value pair) or SOAP protocol for development. There are also 3rd party libraries to simplify integration.
Check out the API reference here to get an idea:
https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/howto_api_reference
*PayPal does offer a Direct Payment API which allows your site to take credit cards directly and use PayPal as the gateway:
https://www.paypal.com/cgi-bin/webscr?cmd=_dcc_hub-outside

Categories