Manage Payment Flow Through Php Api - php

i had done simple payment and reccuring payment in paypal using php..but now i want do payment like ebay system..i want manage seller account,middle patry account,buyer account. when buyer order for any product that time money tranfer from buyer account to middle party account and when buyer got product at that time money tranfer from middle party to seller account..i want make this system using php..i tried for create customer and add charge in stripe..but i dont know how to deduct charge from middle party in stripe php api

You can check the whole Stripe API available for PHP at this link and check what meets your needs:
https://stripe.com/docs/api?lang=php#intro

Related

Stripe - Payout the sellers with custom amounts (On demand)

The situation
In my e-commerce project, I'm using stripe card element to catch payments from customers to the platform's Stripe account. After my Laravel application listens to the webbook of a successful payment that is fired by Stripe, the app then fires a job to add credit on the seller's platform account. This part works perfectly fine.
The question
Is there a way to add some sort of a button in the seller's profile on the platform that allows the seller to receive exactly the amount that is on their account on the platform?
Let's say he has $100 credit on the platform, after clicking 'pay me' button, the seller will get this $100 paid out from the platform's stripe account to his bank account.
I have accomplished until now:
1- A visitor can add item to cart and checkout.
2- Uses stripe card element to take the payment.
3- When payment is successful, the amount goes to the platform's stripe account.
4- The application listens to successful payment webhook and adds credit to the seller's account on the platform (As simple as having a column on the database for each seller with the default of 0 and it increases upon each successful customer payment).
Thoughts
What do you think about this? https://stripe.com/docs/connect/add-and-pay-out-guide
I'm thinking of using this technique since I'm doing everything manual. I believe I can skip the part where I top-up my Stripe account (Since it should be having credit by default from the successful payment).
So here is what I think:
0- A customer makes a successful payment towards some products and the application catches Stripe webhooks and fires a job to add credit to the seller's platform account.
1- The seller receives a notification that he has credit on the platform's account.
2-  The seller then can click on a button that takes him to a route where I redirect him to create (stripe express account)[https://stripe.com/docs/connect/add-and-pay-out-guide?integration=with-code#with-code-create-account-link]
3- After the seller gets redirected to the platform again and I catch the webhook that account has been created, The seller then will be redirected to receive the determined amount by my platform. https://stripe.com/docs/connect/add-and-pay-out-guide?integration=with-code#with-code-pay-out-to-user
You can ask your sellers to register an express account when they onboard your platform, so that your sellers can submit all necessary documentation for account verification and make their accounts payout enabled.
When your customer is about to make a payment, you should create a destination charge so that Stripe can automatically transfer the funds from platform to a connected account, you can also opt to charge an application fee from this transaction if you wish.
Stripe will automatically perform payouts based on the account's payout schedule , if you prefer to do it manually, change the schedule's interval to manual . Visit this page to learn more about manual payouts.

Marketplace using Paypal

Hi we are creating a mobile app for marketplace where we are hoping to get eBay model implemented. Where buyer will pay the seller and we will take our cut from the seller. We actually don't want to get payment ourself for the sale and handle the disputes for order shipping or chargebacks.
When a sale is done on our app, the buyer should send the payment to the sellers paypal and then Paypal will handle all the other stuff regarding that like disputes or chargebacks.
I want seller to link his paypal account to our app and we will take permissions for future payments and maintain a record where we can calculate his fee regarding sales made on our platform. Paypal Mobile SDK support this feature.
But my question here is how can we automate the original purchase process? One option is when a sale is done, we will send invoice from seller side to the buyer (possible using Paypal REST API) and open invoice pay link on the buyer side. Once the buyer pay the invoice and transfer the funds to the seller we will know that sale is approved successfully because as a Paypal facilitator we have access to that invoice (we actually sent that invoice to the buyer as we have permissions of invoicing of seller account).
But what if we don't want invoicing system? Can we implement anything where buyer will send the funds to the seller without generating an invoice from our app. Like when a sale initiated, we will present buyer a page where he will pay directly to the seller (without us involved) and we will track that transaction and make outstanding cut on that sale?
My Research so far
Payapl mobile SDK for iOS don't allow us to take permissions for invoicing, we can take single, future or profile sharing permissions in app
Paypal Rest API allow us to take permissions for invoicing but not for future payments (that is necessary to take our cut from the seller's account)
If we use Paypal Mobile SDK, we can take funds in our account but not directly to our sellers account
Adaptive payments is an option where can take funds from buyers and after deducting our cut send the rest to the buyer but in that case we will be primary recipient and seller will be secondary, being a primary recipient we are responsible for shipping the product which at this stage we don't want. Want want to be seller as primary recipient
Any help regarding our situation would be greatly appreciated. We just want to automate the system somehow with the APIs and SDKs without being the primary recipient. Please give us suggestion to make this a reality. Thanks
Using any other payment gateway like Stripe or Braintree will not help here because in that case we will be taking money as registered merchants. We would really like to work with Paypal for handling all order related stuff
The Express Checkout API supports Parallel Payments, in which case you specify the SELLERPAYPALACCOUNTID in the request. This is where the money for that particular payment would be sent.
You can use this functionality even with a single payment on the order, though. So you can just setup a single payment and include that SELLERPAYPALACCOUNTID parameter, and the money will go directly to that account.
When doing this you can use your own API credentials and no permissions or anything are required from the 3rd party account to send the funds directly to them.
This PayPal PHP SDK will make the Express Checkout API calls very quick and easy for you, so you could just setup some simple PHP services to hit from your mobile app(s).

PHP SDK Adaptative Payment How to set Quantity if not embed

We use Paypal PHP SDK adaptative payment service to process payments in our site as we receive the payment, take a commission and send the remaining to the listing owner.
We got the PayRequest and the SetPaymentOptions working. The problem is the ReceiverOptions InvoiceData accordingly with the documentation only work with embed pay flow.
So how am I supposed to pass quantity to be paid if I am not using embed pay flow but I need adaptative payment because of the commission we take?

How to make monthly subscription payments with paypal php rest api

I want to make monthly subscription payment with paypal php rest api. Is it possible with rest api. If yes then please describe how can I achieve that. Also after successful subscription how can I cancel the subscription via Api. Also how can update the DB if subscription payment is failed.
It's possible to create a subscription payment with the Paypal API.
First of all you need to create a product with the catalogue api:
https://developer.paypal.com/docs/api/catalog-products/v1/#products_create
You have to create a product regardless what you are selling (physical goods or services)
The you will use the subscriptions api to create plans that are linked to the created product:
https://developer.paypal.com/docs/api/subscriptions/v1/#plans_create
Obviously a product can have multiple plans with different pricing or billing cycle
Finally you can integrate the Smart Payment buttons to your checkout form to allow users to subscribe to a plan:
https://developer.paypal.com/docs/subscriptions/integrate/#4-create-a-subscription
You can read the currently complete guide of paypal subscription integration here:
https://developer.paypal.com/docs/subscriptions/integrate/
After a subscription is created it can be canceled via the subscription api:
https://developer.paypal.com/docs/api/subscriptions/v1/#subscriptions_cancel
I don't remember how to create the recurring payment with Paypal, but as far as I know, canceling it is not possible via their api.
On our website, we have to tell the users to cancel their subscription on paypal's website.

Subscription system with Paypal

I'm developing a restaurant catalog in which the restaurant owners pay a monthly fee for having their restaurant appear on the site. I was thinking in using Paypal recurring payments but I don't understand exactly how it works. Would Paypal automatically charge the fee each month? (Like auto-renew) or would the users be able to decide if they pay or not? I need that the users decide if they want to continue with the membership instead of being automatically charged. How can I achieve this with Paypal?
I'm using express checkout with instant payment notifications (IPN).
Recurring Payments would be a subscription that would be charged automatically unless the profile was in a canceled or suspended state. So if your customers signed up, they can indeed choose whether to pay or not if you give them a way to suspend their profile, which you can do via the ManageRecurringPaymentsProfileStatus API.
If you would rather setup a way where users have to click a button to approve the payment each month then you could go with a billing agreement and a reference transaction. In your SetExpressCheckout request you would make sure to include the billing agreement parameters to get a valid token, and then when the order is completed with that billing agreement you can use the transaction ID you get back from it in a DoReferenceTransaction request in the future to process any amount using the previous billing info that PayPal has saved, so no additional login auth would be necessary.

Categories