How to save credit card and make re-bill based on varying amount and frequency (not recurring billing)) using paypal - paypal

I want to save credit card info of customers and later I want to bill them on different time period. Billing amount and frequency may change. Is this possible via paypal??

To do this you'll want to have Reference Transactions enabled on your PayPal account. This allows you to process future orders for existing customers who have 'stored' a Credit Card on a previous order. When processing new orders you/your customer will no longer need the originally used card, just select to 'Use Stored Card'.
However, you're cart/custom code will need to support Reference Transactions in order for this to work.

Related

PayPal Credit Card Payment Processing Workflow - authorize, update amount (add to), capture

We are working on a payment plugin for our e-commerce solution and having trouble with a workflow we wish to accomplish.
The workflow we want to provide would be as follows:
Customer adds items to cart.
Customer provides Credit Card information and submits order.
Store Owner calculates shipping and manually updates order total.
Order is processed and payment captured.
We seem to be running into an issue with 'authorize and capture' as credit cards are authorized for one amount and we cannot then 're-authorize' for the total (to include shipping fee).
Additionally we cannot do any kind of % over total to authorize, as the shipping fees can vary significantly.
Are we missing something in the API docs that will allow this workflow?

Booking system to take a deposit and then final amount at a later date

This is more of a question regarding flow than code.
I'm currently working on a booking website for a holiday home. I've implemented a booking system which currently takes full payment at the time of booking. This uses PayPal REST API. It works fine no problems code-wise.
However my client would like the system to take a deposit when booking (20%) of the total. Then take the remaining amount later on (through the site). This seems strange to me and I've never used a website which does this so I'm not sure what the flow should be.
The only way I can think of achieving this is that the user has to come to the website at some point in the future to pay the remaining amount. I could send them email reminders but it seems a bit awkward to do that.
Has anyone done anything like this in the past?
In order to take the money later, you need to store the credit card data in your system, which is not quite legal unless you are authorized payment service provider (and I'm almost sure you're not).
We have the same case in our reservation system. Generally, you'd allow credit card payment only for deposit, and later final amount is paid via bank transfer or cash, for example, and has to be settled manually by an operator.
Your idea is not bad, however. You could inform the user about the final amount and due date in the booking confirmation email and later on send them reminders.
You can utilize reference transactions to handle this without storing/saving any billing information on your server.
Reference transactions can be used in Express Checkout as well as with Payments Pro.
Basically, the way it'll work is that you can process the original 20% and then you'll save that transaction ID in your database. Once you're ready to process the remaining amount you just make a call to DoReferenceTransaction and supply the original transaction ID along with the new amount to charge. PayPal will then charge this new amount using the billing information that they have saved on their server.

Send part paid cart to PayPal

I need to send a cart to PayPal for payment using the FORM integration method where the cart value has already had a part payment made against it, usually by another means, like 'on account' or a gift card for example.
Is there an accepted way to do this?
The only thing I can find is sending the already paid amount as a discount amount but that's not 100% ideal as it isn't in reality a discount.
The other option I came up with was to just send a single line cart with an item of 'Balance of your order XXXX' but this is also not ideal as the customer wouldn't then see the actual items listed when on PayPal.
Many thank.
I can think of 3 PayPal features that you might possibly use to do this:
Authorization and Capture
Authorization & Capture, or Auth/Capture, allows you to authorize the availability of funds for a transaction but delay the capture of funds until a later time. This is often useful for merchants who have a delayed order fulfillment process. Authorize & Capture also enables merchants to modify the original authorization amount due to order changes occurring after the initial order is placed, such as taxes, shipping or gratuity.
Recurring Payments
PayPal Recurring Payments allows you to bill a buyer for a fixed amount of money on a fixed schedule.
Note You can also setup another form of recurring payments using reference transactions to handle payments for varying amounts of money on a varying schedule.
Reference Transactions
A reference transaction is a financial transaction from which subsequent transactions can be derived. For example, a buyer purchases an item on your site, and you use the PayPal transaction ID or reference transaction ID later to initiate another transaction. Reference transactions and billing agreements also enable you to handle recurring payments for varying amounts of money on a varying schedule.
You can read more about these features here: https://developer.paypal.com/docs/classic/admin/intro/

How to specify which credit card to charge using Balanced API

I am following the documentation in
https://docs.balancedpayments.com/1.0/overview/getting-started/#charge-a-credit-card
I have created the customer and I have tokenized two cards and added them to the customer.
Now I have only recoded the customer URI, as I have associated the cards with the customer I did not think I needed to record the card URIs and keep a record of which customer they were associated with. I assumed that this is what balanced does.
However when I come to charge a card I have the following code
Balanced\Settings::$api_key = "ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD";
$customer = \Balanced\Customer::get("/v1/customers/CU6vs1tjxBtifgTuzKjCGtVS");
$customer->debit('5000');
(1) How do I tell balanced which card to charge?
(2) Assuming I can do this, how do I retrieve the card information from the customer's balanced account so they can choose which card?
The example you gave uses the default funding instrument. If you want to charge a specific card, specify the URI of the funding instrument you wish to debit as the source parameter. https://github.com/balanced/balanced-php/blob/master/src/Balanced/Customer.php#L146
You don't need to store in your database the URIs for the funding instruments, but you can if you wish. If you want to build out a view where users can pick the funding source, just get all the Customer's cards with something like $customer->cards and loop through that to display each card's information as desired.
NOTE: In the new v1.1 API debits and credits are performed directly on funding instruments (Card and BankAccount resources) and not via Customer.
I also invite you to swing by #balanced in Freenode IRC where you can get integration help directly from Balanced developers.

Recurring payments with arbitrary amounts and at arbitrary times?

We'd like to find a payment provider that lets us do something similar to Hailo, ie:
Users sign up and give us their credit card details/authorise us to charge their account. They only need to do this once.
In Hailo's case, users might take a cab journey at any time and be billed any amount (within reason). In our case, users might need a job done at any time, again with an invoice for an arbitrary amount.
So ideally we'd be able to charge users accounts at any time, for any amount, without further authorisation. This is possible because Hailo (and I believe Uber) have it implemented. However, I don't know if they use a third-party payment provider or rolled their own.
Something like BrainTree's recurring payments is close to what we want, but not exactly. We want to be able to bill at arbitrary times, not on a fixed schedule.
The best option we currently have is to use recurring billing, ie save invoices and then charge them all at once at the end of the month. This isn't ideal from a cashflow -perspective, though. Another option is to use GoCardless' variable billing, (you ask customers permission to bill up to £X per month), though from speaking to people it seems they'd be leary of that as it seems like an upfront commitment.
Can we do it our way? How do companies like Hailo and Uber do it?
We're in the UK, by the way.
In PayPal world - we call this kind of functionality as Reference Transactions - here are the 2 how-tos that would give you more info on how to implement reference transactions with PayPal accounts and direct credit cards:
Reference Transactions for PayPal users
Reference Transactions for Credit/Debit cards
You can also use our Preapproval functionality - which would give you delegated access to a PayPal account to make payments on behalf of them. Here is it's how-to.
Full disclosure, I work as a developer for Braintree.
Using Braintree you can create transactions at any time, not just on a recurring basis. In fact Uber is a Braintree customer. You would store the card in the Braintree vault and create a new transaction when you are ready to bill the customers credit card.
Braintree has recently announced an international expansion that will support merchants in the UK and other countries in the next few months.
From your description Authorize.net CIM will do the job - http://www.authorize.net/solutions/merchantsolutions/merchantservices/cim/
It's PCI compliant and let you store your customer credit card details with them and return a token for the customer. Then you can use this token to charge customer credit card whenever you need. Also their recurring billing facility would let you charge a fixed recurring charge if needed - http://www.authorize.net/solutions/merchantsolutions/merchantservices/automatedrecurringbilling/
DataCash will let you do this, amongst many, many other things. You just provide their 16-digit reference number in the XML rather than a card number.
(Note: I'm an ex-DataCash employee, and we use DataCash as a payment gateway at my current work.)