Can I use PayPal to charge a Credit Card automatically? - paypal

If I have a Visa card number saved in my database, is there a way I can charge that Visa automatically through the PayPal API without the user having to enter anything? We want to keep this site as easy and hassle-free to use as possible. It would be a variable amount, based on how they use the site.
(Don't worry, proper disclaimers will be in place, and the user will be notified)
What about these "recurring payments"? That way I don't have to store the CC info on my website, but do they allow variable amounts that I could periodically send to PayPal?

Yes, you can.
Look at Direct Payments:
1 On your website, the customer
chooses to pay with a credit card and
enters the credit card number and
other details.
2 The customer reviews the order.
3 When your customer clicks “Pay” to
place the order, you call a PayPal API
to request payment, and the payment
transaction is initiated. Note: The
customer does not see this step.
PayPal does not send your customer a
recipt for the payment.
4 You transfer your customer to your
order confirmation page.
The payment is performed without redirecting the customer to PP site, so it's up to you to request CC data from the customer and submit them to PP API.

Related

How to capture only one transaction from multiple authorized transactions?

I am building a payment system where a user can make a payment against an orderId
I want to make sure that only one payment gets through (gets captured)
The payment flow is like this:
1- User clicks on Paypal button
2- a Transaction PENDING_PAYMENT gets created for the user with orderId
3- User pays in Paypal
4- Paypal sends webhook and marks the payment as AUTHORIZED
5- The system CAPTURES the payment
as you see, the user can open multiple Paypal pages and pay all of them at the same time, there's no way for me to prevent this, but I want to be able to CAPTURE only one of these payments. (so I can automatically refund the rest of the payments)
I really appreciate any help, Thank you in advance.
When you set up the PayPal transaction for approval, pass a unique invoice_id to PayPal that has never before been used for a successful payment on that PayPal account. This could be your orderId, perhaps with some additional prefix added if desired. (For instance if you had multiple storefronts on the same PayPal account that might use the same order numbers, a prefix of 3 letters and a dash indicating the store name is a typical choice)
By default, PayPal accounts prevent (block) any subsequent payments for an invoice_id that was previously used for a successful payment on that account -- precisely to prevent accidental payments for the same thing, as is your use case.

How can I limit the set of fields Paypal shows on express checkout?

Whenever our service initiates an express checkout and redirects the user to PayPal page the user sees the cart on the left and the following on the right:
Note that even the address and the phone number are required while we're an online service and don't need shipping information - once PayPal confirms the payment we'll happily "ship" over the Internet, so all we really need is a PayPal payment confirmation and I guess that requires just a credit card number, expiration date and the CSC.
Yes, I know that users who have already registered with PayPal can switch to "my PayPal account" option but that doesn't help people who don't have a PayPal account and those are forced to see this page with 12 fields.
Wait, that was the form for people who have their "country" identified as the USA. Here's what people tracked to Colombia see:
Even more fields and we only need a payment confirmation.
Is it possible to make PayPal limit the set of fields on that page?
Looks like you can avoid user to enter Billing and Contact information on guest checkout only if you properly transmit REAL shipping/contact data by your own in your SetExpressCheckout call.
&METHOD=SetExpressCheckout
&RETURNURL=https://...
&CANCELURL=https://...
&PAYMENTREQUEST_0_AMT=10.00
&PAYMENTREQUEST_0_PAYMENTACTION=Sale
&PAYMENTREQUEST_0_SHIPTOSTREET=1 Main Street
&PAYMENTREQUEST_0_SHIPTOCITY=San Jose
&PAYMENTREQUEST_0_SHIPTOSTATE=CA
&PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE=US
&PAYMENTREQUEST_0_SHIPTOZIP=95131
&PAYMENTREQUEST_0_EMAIL=jsmith01#example.com
&PAYMENTREQUEST_0_SHIPTOPHONENUM=408-559-5948
If you set random data above with invalid city/state/zip PayPal will display Billing and Contact information inputs.

PP REST API charge tax and shipping without sending address?

Using the REST API, how can I charge tax or shipping if I send the user to PayPal to collect shipping information (and pay, of course)?
Doing some research it almost seems like that isn't possible, but I can't imagine that being the case. If I have to collect shipping information myself, the value prop for using PP is greatly reduced.
With the REST API, just like the Classic API, a PayPal payment is executed in three steps:
1) Send initial information to PayPal to get a token. Redirect customer to PayPal. Customer authorizes payment.
2) Get payment details (like the shipping address)
3) Confirm payment.
So, in this case, after getting the shipping address, you display an order review page to the customer where it will generate the shipping options and tax amount to the customer. They then have to select a "Confirm Order" button which will then finalize the charge to PayPal with the new tax/shipping and final amount.
In API terms, the final step is done with the /execute command. This accepts the payer_id you received in step 2, and a transactions array that supports a new amount object.
The amount object includes a details object that includes shipping, tax, handling fee, insurance, etc.
Include the details the customer decides on your review page and PayPal will charge the updated amount to the customer's funding source of choice.

Store a credit card with PayPal payment buttons

Is there a way to integrate /vault/credit-card call with PayPal payment buttons? I do not want to work with client credit card information but i can't find a way to redirect the client to paypal only to store his credit card information and for me to get his id on paypal to charge him than needed
You could use the PayPal/Payflow hosted checkout pages and process a 1.00 authorization. Then store the transaction id on your system. Then when you want to charge the buyer, you would just use the reference transaction API call to charge them. You only need to pass over the amount you want to charge along with the previous successful transaction id, and PayPal will use the same credit card information that was used in the last transaction.

Capture Card capabilities in PayPal Payments Pro

Capture Card as I understand it allows a seller to securely accept an online order with credit card name, number and code via a shopping cart. We can subsequently ship the order, add the freight to the invoice and submit the total amount to the credit card for payment. After the payment has been posted the credit card information is wiped from the order.
I was led to believe that I could do this with a PayPal Payments Pro account, so I created one and sent a test invoice through with my own credit card. The amount of the invoice with tax was immediately posted to my PayPal account without the opportunity to add freight.
Can anyone on this forum provide a solution or workaround?
Thanks!!
Are you processing this initially as a sale or an authorization. If you are wanting to use the DoDirectPayment API with Website Payments Pro, you could process a 1.00 authorization to validate the card. Then perform all of the calculations that you are needing to, and then process the payment using the DoReferenceTransaction API call where you send across the full amount you want to charge to the buyers card. You only have to reference the transaction id for the last successful 1.00 auth you did, and PayPal will use the same credit card information. Otherwise you could also process the DoDirectPayment API call with the full amount at the time of checkout, and just use the DoReferenceTransactions API call to charge any additional charges to where not initially charged such as tax and shipping.
Another option would be to use Express Checkout, and process the transaction as an order. This will allow you to make more then one authorization/capture against the order. You can also set a max amount in the Express Checkout API calls.