Mock payments for student projects - php

I need to create as my first year project a php application that requires to handle payments. The business model I would like to implement requires that I have to both receive and make payments to the customers (basically I need to handle transactions between 2 customers, and I get a small fee of the transaction value).
I have never used any payment API, but that's not the point. The problem is that I would like something that has a sandbox mode where I can experiment and does not require business/premium accounts or to make bank requests. I was thinking about PayPal, but it seems it requires a business account.
Is there such an API?

You can use Stripe, which has a great API and a testing mode: https://stripe.com/docs/testing
It's free and there is no "premium account".

Look at PayPal Adaptive Payments. You can get up and running in the sandbox very easily.
Specifically, you'll want to look at the Pay API.

but it seems it requires a business account.
Business account is only for production API. For development you use sandbox and there's no such requirement.

Related

Can one Create Auto Orders using PayPal payments api - where tokenised payments are initiated from website not using paypal repeat purchases?

We currently have a website that uses eWay token payments and setup Auto Order for customers. They can manage what items are in the auto orders and at what frequency the orders will be placed.
After the first order we can save the users 'Token' with eWay and charge their card at each instance.
We would like to add in the ability to pay with PayPal, but cannot see a similar feature where future orders can be placed without the user interacting.
The issue is that the price may differ from original payment, as discounts for the item may change or the user could add in other products to the auto order. So we don't want to have a repeat purchase setup in PayPal, rather automatically charge the users account when needed.
Been looking through paypal API docs and nothing is jumping out as the correct way to proceed.
We have tried payments through eWay to PayPal however they are not supporting paypal through their gateway anymore so are not much help.
Our website is PHP, Mysql driven and we currently use PayPalExpress checkout API for single orders.
For PayPal, the receiving account needs a feature called "reference transactions". This is not enabled by default in the live environment (though it is in sandbox). It requires business approval, so the PayPal account owner should contact PayPal's general customer support or an account manager (note: not technical support) to discuss the business need for the feature.
Once approved for the "reference transactions" feature on a live business account, PayPal can guide you on which API to best integrate to make use of this. Something like v2 or v3 vault and that API's payment tokens are a possibility that sounds exactly what you are describing, though there are other (older/legacy) APIs that use something called a "billing agreement" as what's effectively a token as well.

Paypal Webhook upon using Paypal Debit Card

I have been looking everywhere for a solution. Hoping someone else has a solution.
Here is the scenario, I use ClearCheckbook.com to keep track of the inflow/out flow of my accounts. I use their API to add transactions when I get a Paypal IPN I have a script that creates the transaction in clearcheckbook.com. It works great from when I receive money. However if I pay with my paypal account or more commonly when I use my paypal debit card, it doesn't notify me. I would like to be able to do the same, where I have some sort of webhook/notification that. Any Ideas?
At this time, our Webhook and IPN systems do not support notifications for purchases (send money or debit card purchases). Both of these systems only support notifications for payments being received into your PayPal account. The only exception to that is the Payouts API, which is technically considered sending money to other accounts. The Payouts API is supported by our Webhooks system but no other purchase (send money) transactions are supported by our Webhook or IPN systems as of now.
An alternative option would be to use our Sync API to get your account reporting data. You could then implement a solution to parse that data and use the ClearCheckbook.com API to add the purchase transaction data into their system.
Here is a link to our Sync API for further information on how to use that API.
https://developer.paypal.com/docs/integration/direct/sync/

Paypal sandbox tests for third party payments using PayPal-PHP-SDK

The app needs to implement buyer-to-seller payments without involving marketplace account, meaning direct payments beetween buyer and seller. I've created two sandbox accounts to test how it may work and created Third Party Payment. It worked and said that the payment finished successfuly. But when I go to sandbox account page I can see NO activity, no money were paid and no operations in history. Why it happens and how can I test that this is a proper way for app needs? Thanks
While waiting for answers, it's now resolved. Obviously, given sample for Third Party Payment is only about creating the payment without execution. So execution is the answer.

What PayPal PHP-API functions to use as replacement for subscription-buttons?

I have a website coded in PHP that uses paypal buttons/IPN for subscriptions.
The method is limited and I need to replace it with the REST-API.
What the system needs to do:
Accept new user recurring-payment subscriptions
Be able to change plan pricing for new users
Be able to change plan pricing for existing users
Change subscription plans mid-subscription(If a user upgrades from pro to master the price goes up, and the opposite way it goes down).
The price difference between packages is 5$
Give periodic discounts for a limited amount of months.
The questions:
1.) What is the equivalent of recurring-payments in the PHP-API or REST-API? (I'd rather it auto-charges and notifies my IPN if possible)
2.) How can I automatically refund/charge an additional amount when the user upgrades/downgrades in the middle of a month?
3.) Is there a standalone PHP control-panel that can connect to the paypal API to manage the subscription packages + sales?
Thanks in advance!
If you are looking to use REST APIs, the best place to start is going to be at the REST API docs. For your situation, you can use the vault to set up a recurring payment system. You could also use the future payments API, but you will need to make sure you buy DPRP for your account. Contact PayPal Customer Support to enable DPRP.
With the Vault API, you can just create one time payments over and over with the token you get when storing a credit card.
There is an in-depth walkthrough using the SDK on the PayPal PHP SDK Wiki.
To do refunds, you can use the Refund REST API. All this assuming that you would be writing scripts to detect your user downgrading/upgrading. You would just need to store the amount they are paying each month in your DB.
There are some shopping carts out there that are implementing REST APIs. You might need to google search for something like that.
Hope that helps and gets you started in the right direction!

How do large merchant resellers process payments and payouts?

I am looking for information on how large resellers collect payments and pay the people who sell on their site. (e.g. Redbubble.com, a company that pays artists a commission for their work)
Specifically, I am looking for different solutions that cover a few key functions at minimal cost (like Paypal fees)
Ability to take payment from credit cards and paypal (others a benefit)
Track sales for each merchant as payments are processing
Collect payments in central account
Payout all processed payments on a monthly basis
P.S. I imagine there are a few ways to do this, I am hoping to gain some insight on what solutions have been proven.
P.P.S. This is not a technology specific question. Whatever APIs or third party solutions you know of are fair game.
Thanks for your knowledge!
Try PayPal adaptive payments.
Paypal Adaptive payments
You can also try Stripe to collect funds to one account and to trasfer them to third party acccounts but this only works in the US.
Stripe Payments
You could use the Adaptive Payments API and that would allow you to split the payments up among multiple receivers in a single transaction in real-time. If you go that route the API calls that you'd be interested in are...
Pay - This setups the actual payment and the receivers on the payment.
SetPaymentOptions - This allows you to provide more details like items, shipping, etc.
ExecutePayment - This actually processes the payment in the system after it's been setup with the previous calls.
PaymentDetails - This obtains details about a completed transaction.
Preapproval (possibly) - This allows you to get a Preapproval key for a user that will allow you to trigger payments on that users behalf at any time in the future with the use of the preapproval key.
PreapprovalDetails (if you use preapprovals) - This obtains details about an active preapproval profile.
To get all of that working in the live environment you'll need to submit an application through your PayPal developer account to obtain a Classic API App ID. For development on the sandbox there is a global App ID that can be used.
Another option would be to take payments on your site using any PayPal product like Payments Standard, Express Checkout, Payments Pro, etc. and have all the money come to your account, and then use the Pay API to distribute those funds out to people accordingly. This could be automated with an IPN solution and possibly the use of a CRON job on your server.
This is the method I like to use, and I typically go with a full Payments Pro / Express Checkout integration for payments on my site and then I distribute via the Pay API within an IPN solution or CRON job like I mentioned.

Categories