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
Related
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.
I just implemented this: PHP PayPalCheckoutSdk:
https://github.com/paypal/Checkout-PHP-SDK
It redirects visitor to PayPal login and then he pays.
But my customer wants clients to pay using credit card and only optionally use PayPal login.
I've read there's another API that uses Javascript called Smart Payments (or Express Checkout, i have no clue...):
https://developer.paypal.com/docs/checkout/integrate/
https://developer.paypal.com/demo/checkout/#/pattern/server
Visitor can choose to pay using Credit Card, and this works as expected, but this is done using Javascript and so customer inputs the Credit Card information inside the actual eshop website!
Is it possible to redirect the customer to PayPal, so that he inputs the CC information there?
For Credit Card payments PayPal suggests using braintreegateway.com, which seems like a separate company. It has a separate API keys and administration (transaction list) meaning the transactions are separate from PayPal account!
A lot to unpack here.
The simplest way to accept credit cards is Set up standard payments -- which can be implemented with or without a server-side SDK to create and capture the order. Creating and capturing the order on a server is much more robust for order management.
The client-side JS portion of it provides a black "Debit or Credit Card" button, which can typically be used without any login.
Other, different services for processing credit cards that are also offered by PayPal are Advanced Credit and Debit Card Payments, and the Braintree Direct Gateway. These require more work to integrate, and the business account needs to be approved for the service to be set up and available to it.
I've puzzled by this question for quite a while, but never had the need for it. Now I do.
What I currently need is a Credit Card payment option for my website that does not rely on services such as Paypal. I want something like Name.com or Hostmonster.com have. You simply enter you credit card number, expiration date and the three little numbers at the back of the card. How can I achieve the same effect on my website?
I'll be programming the website in PHP.
Answers would be appreciated.
You need to signup to a payment gateway. It's a service that allows you to process credit card payments. I know you don't want to use PayPAL to accept payments, but PayPAL offer two solutions:
PayPAL Payments - That is the button and people pay through PayPAL
PayPAL Payments Pro (Payment Gateway). That is when you use PHP or anything else to connect to PayPAL with the credit card information. The customer never knows you used PayPAL, and they never leave your site.
When choosing a payment gateway these are the four most important things you should consider:
How easy is it to implement (PayPAL has a lot of documentation)
How much is the monthly fee.
How much do they charge per transaction.
How much do they charge to setup an account.
There are other options, and one of the most common is Authorize.net, but the is more setting up and a larger deposit to open an account.
Most accounts will require a background and credit check.
Well, you'll still need to rely on a Merchant Services company for card processing. There are many companies that boast an API that can then be accessed with PHP. One that I have recently learned of is Stripe. However, there are many competitors and you can research other companies further, but companies like Stripe will allow you to generate payments programmatically without having to leave your site to visit the black-box that is PayPal.
Let's say, for the sake of discussion, my client does not want to use the Paypal api for transactions. I have already made a shopping cart. The user submits the items on the shopping cart and their credit card number.
Assuming I'm not using any api, how would I then charge the user's credit card for the items on the shopping cart? I understand that it is complex, just wondering what the general process is like and how to get started.
You're going to need to trigger a bank transaction, so obviously you're going to need to use an API at some level. I think the way to go would be to first learn in some detail how at least one of the popular commercial (by definition?) payment card processing services works, e.g.:
https://paymentvision.com/Payment-Gateway/Payment-Gateway-API.aspx
http://aws.amazon.com/fps/
https://www.firstdata.com/en_us/customer-center/merchants/support/first-data-global-gateway-api-software-landing.html
http://www.authorize.net/
The next step would be to design the "payment processing" subsystem of your PHP application/library around the "backend workflow" (perhaps using a 3rd party PHP library, if one is available), and do some testing.
Then I would plan for a security audit of your code & systems before you actually use it to handle payment card information on behalf of a customer/3rd party.
You can also capture all the card information and use an external payment processor. The problem is that you will be hit with major fees since it will be considered a keyed in and not swiped transaction.
If you don't want/like paypal, don want to use a payment processor like authorize.net, you could look at other options like stripe.com.
Find an payment gateway, such as authorize.net. With payment gateways such as this, your client will need to sign up for a merchant account with a credit card processing agency. You payment gateway can help you with this.
Then, you'll usually get a token or api key that you will use to connect to the payment gateways services. From php, you'll use cURL or fsockopen to connect to them. Securely send your api key, get a response, then send some other required message, get another response, and then send in credit card information and credit card holder information.
There are lots of PHP Libraries to choose from out there for different payment gateways. I'm not suggesting authorize.net, it was just an example. But when you find one you are happy with, and happy with the fees that are associated with processing credit cards, you can either use a prewritten library, or they payment gateway will provide you with and API that will tell you how to integrate with their system.
Payum efficiency proved by 1k+ stars on a GitHub, great comments and a million of downloads. Supports 50+ different payment gateways so you surely find what you need.
I am developing an Ecommerce website and I would like to implement Credit/Debit card processing within the site.
I would like to know if there are any good PHP scripts which fully implement this and the payment gateways that provide this service.
Also the website will have a Money Back guarantee feature in the event of cancelling of orders and so on. So how can this also be implemented using Credit/Debit cards i.e. I want to be able to refund the customers in the event of a cancelled order.
The site/service will be offered in Africa and Paypal isnt present.
Thanks
You need to find someone to process your credit card payments first. eg Paypal or SagePay.
They will provide you with all the documentation on integrating with the payment gateway, and all the ones I have used in the past have included PHP sample code.
Here are some handy links for you...
Paypal Developer Docs
Google Checkout
SagePay (UK credit card
processing)
Update: Since you are trying to offer this service in Africa, I would recommend contacting your local big bank to see what services they offer. All the major banks in the UK and the US offer their own gateways (or point you in the direction of their preferred partner), and I would imagine that would be true everywhere.
http://pear.php.net/package/Validate_Finance_CreditCard