PayPal Parellel payments and refunds - php

I have a question regarding Parallel payments and refunds. We are developing an application that sets up a Parallel payment, with ourselves as the My Store receiver and the provider of the service as the seller receiver. We provide a mechanism for the secondary receiver to refund the complete payment.
(source: ohozaa.com)
What we want to know is what happens when the seller receiver has no funds in their paypal account? From testing this in the sandbox and from what we've read, it seems that the seller receiver component of the refund becomes pending (we assume, as funds are pulled down from an associated bank account). Three things:
Has the My Store receiver paid the refund in full and is now waiting to get the payment from the seller receiver. Implying that, at this point in time, the My Store receiver is out of pocket?
What happens if funds cannot be pulled down from the seller receivers associated bank account?
What happens if we attempt a refund from an unverified user with no funds in their paypal account? Once again, does the My Store receiver pay the refund in full and hope to collect the seller receivers portion when they do have funds?

Unless I am misunderstanding the situation there are three possible questions/outcomes.
You submit a payment to pay mystore#test.com 10 dollars and seller1#test.com 90 dollars for a total of 100 dollars:
https://svcs.sandbox.paypal.com/AdaptivePayments/Pay
'currencyCode' => 'USD',
'actionType' => 'PAY',
'receiverList.receiver(0).email' => 'mystore#test.com',
'receiverList.receiver(0).amount' => '10',
'receiverList.receiver(1).email' => 'seller1#test.com',
'receiverList.receiver(1).amount' => '90',
'requestEnvelope.errorLanguage' => 'en-US',
buyer#test.com wants a refund:
1) If you have API permission to submit refunds for seller1#test.com you can refund his part of the transaction as well as yours. You do this by passing the receiverList variables:
https://svcs.sandbox.paypal.com/AdaptivePayments/Refund
'payKey' => $thepaykey,
'receiverList.receiver(0).email' => 'mystore#test.com',
'receiverList.receiver(0).amount' => '10',
'receiverList.receiver(1).email' => 'seller1#test.com',
'receiverList.receiver(1).amount' => '90',
'requestEnvelope.errorLanguage' => 'en_US',
'currencyCode' => 'USD',
1.1) mystore#test.com and seller1#test.com both have the funds, they are refunded immediately.
1.2) mystore#test.com has the funds, but seller1#test.com does not. An eCheck is submitted from seller1#test.com's bank account to pay for the refund, and the status will be PENDING until it clears from the bank. mystore#test.com has only paid buyer#test.com 10USD. buyer#test.com will have two transactions, one for 10USD that is completed, and one for 90USD that is pending. If the 90USD transaction fails, PayPal will try a second time to represent to the bank. If it fails again, seller1#test.com's transaction should go into a FAILED status and may not be refunded via the transaction. The only way to refund this transaction would be to do a send money.
2) If you do not have API permission to submit the refunds for seller1#test.com you will not be able to pass his receiver in the request. If you do, the whole refund will fail. You cannot exceed the amount you were originally paid (10USD)
3) If the seller1#test.com is not confirmed, or does not have an account created in paypal/sandbox, the transaction will be PENDING , and while it is pending the buyer can click cancel next to the transaction. You may also cancel the transaction before it shows COMPLETED by submitting a refund for their amount.
If this was a chained payment it may have a different outcome.

Related

Stripe connect subscription split fees

Hi i'm using the stripe PHP API to build a platform for a client, the platform is selling monthly subscription to author content on a monthly basis I have a deal with my client to share 50% of the fees we taking on each subscriptions.
I used this snippet to make the subscription:
$stripe->subscriptions->create([
'customer' => '{{CUSTOMER}}',
'items' => [['price' => '{{PRICE}}']],
'expand' => ['latest_invoice.payment_intent'],
'application_fee_percent' => 10,
'transfer_data' => ['destination' => '{{CONNECTED_STRIPE_ACCOUNT_ID}}'],
]);
I was wondering if how i can transfer my half of the 10% automatactly and monthly to an other connected acconunt (mine)... Can someone help me with that?
Given the subscription is on the platform, you can transfer funds to multiple connected accounts after the charge.
Alternatively, you can keep the same code you shared here and then transfer the 5% from the application fee to the other connected account separately. You’d listen to invoice.paid Event and when creating the transfer, pass the source_transaction parameter which transfers funds from a charge. These funds will not become available until the original charge is settled.

PayPal sandbox accounts don't show transactions

I'm trying to test my PayPal-Express checkout and it looks like it works fine, but after the redirects there are no transactions in both of the accounts.
I know there is a similar question, but my config has the right credentials.
What I have:
Lumen app
Omnipay extension
sandbox buyer account - status: complete
sandbox shop account - status: complete
The Omnipay lib is configured with the credentials (username, password, signature) of the sandbox shop account
The purchase script looks like this:
$gateway = Omnipay::gateway('paypal');
$response = Omnipay::purchase([
'currency' => 'EUR',
'amount' => '100.00',
'returnUrl' => 'http://localhost:8000/return',
'cancelUrl' => 'http://localhost:8000/cancel',
])->send();
$response->redirect();
It's doing the redirect to PayPal, PayPal accepts then the payment with the buyers sandbox account and redirects me back to the returnUrl but both of the accounts have no balance changes and no transactions visible on their dashboard.
You're using PayPal express checkout to accept payment from your buyers. PayPal express checkout completes the payment in the 2 below steps:
SetExpressCheckout API: It initiates the payment & redirects the buyer to PayPal for approval. To know more, click here
DoExpressCheckoutPayment API: It completes the express Checkout transaction and transfers the amount from the buyer to the Merchant PayPal business account. To know more, click here
To resolve your issue, please check your code & call DoExpressCheckoutPayment API to complete the transaction and deduct the amount from the buyer's account.
If the issue still persists, contact PayPal MTS for better assistance.

Paypal merchant paying facilitator

I have set up a sandbox test case whereby I allow merchants to link and grant express checkout permission to my facilitator account, coupled with a second page where end users can purchase items from the merchants accounts. The problem I am having is that on completion of an express checkout, the facilitator is receiving all the money instead of the merchant. The merchant receives the credit card payment but immediately pays the facilitator the full amount.
Using this guide: https://devtools-paypal.com/guide/expresscheckout/php?interactive=OFF&env=sandbox
I have then created an express checkout on behalf of the merchant account.
Auth details:
'mode' => 'sandbox',
'acct1.UserName' => 'dev-facilitator...',
'acct1.Password' => 'dev-facilitator_pw...',
'acct1.Signature' => 'dev-facilitator...',
'acct1.AppId' => 'APP-80W284485P519543T',
'acct1.accessToken' => $merchant_token,
'acct1.tokenSecret' => $merchant_secret
My code looks very similar to the example, with the assumption that the PaymentDetailsType passed through to DoExpressCheckoutPayment is that same as received from GetExpressCheckoutDetails
Everything appears to be working correctly except that when the users completes the payment the merchants paypal ends up looking like:
Purchase From, dev-facilitator, Completed, Details, -$250 NZD
Transfer From, Credit Card , Completed, Details, $250 NZD
With the final result being:
Dev-facilitator balance: $250 NZD
Dev-merchant balance: $0 NZD
I'm not sure where in the express checkout setup I should be specifying the kind of invoice the merchant should file against the facilitator in relation to the express checkout.
I can provide further code snippets if required.
It appears the core of my problem is the fact that accessToken and tokenSecret are ignored if acct1.Subject is not also supplied (The email associated with the accessToken).
The second thing that caused confusion is that I was not paying attention to what account my buyer action was being performed against... Logging into my merchant account changed the cookies that I was using in the other tab for doing the express checkout. Thus the merchant account ended up being the buyer, and the facilitator the merchant... The Purchase From, Transfer From, was just the way credit card transactions are shown: IE first the credit card gets converted into paypal money and then that is used in the paypal purchase transaction.
Thus,
'mode' => 'sandbox',
'acct1.UserName' => 'dev-facilitator...',
'acct1.Password' => 'dev-facilitator_pw...',
'acct1.Signature' => 'dev-facilitator...',
'acct1.AppId' => 'APP-80W284485P519543T',
'acct1.Subject' => $merchant_email,
'acct1.accessToken' => $merchant_token,
'acct1.tokenSecret' => $merchant_secret
Is what I should have supplied.

Paypal refund api for paypal adaptive payments when sender is more than one?

I have paypal adaptive payments enabled in my website. When customer buy any product from a third party seller then about 90% of the amount seller gets and about 10% amount is transferred to me. Bu in case customer wants refund for that product then it should return amount from both accounts which are primary receiver and secondary receiver. So how to do that using refund api. I want to use this php api but i think it is only for one receiver.
Refund api
is there any other solution for this so payment will deduct from both the receiver primary and secondary ?
Refer to https://developer.paypal.com/docs/classic/api/adaptive-payments/Refund_API_Operation/ ("Using the payment key to refund an entire payment" part ), you can call https://svcs.sandbox.paypal.com/AdaptivePayments/Refund API , The total amount from each receiver is refunded to the sender.

Paypal Sandbox recurring payment with initial amount pending

I'm using the PHP library here to create a new subscription profile. If I set an initial amount, the profile appears as "Pending".
Example:
Pending
Customer Mark Wally Verified
Profile start date Feb 18, 2013 | Profile ID I-BE824P6F9PER
On the other hand, if I set no initial payment amount, the profile will be "Active". I am setting the initial payment and the start date 1 month in the future since I want to bill monthly and get a payment right away.
I've already verified:
Account is set to accept money in any currency
The seller account has digital goods enabled (created via automated process)
Both accounts are verified
The buyer account has a credit card as well as a paypal balance
Both accounts are US based
I've tried with multiple accounts
Any help would be greatly appreciated!
Code snippet to create the subscription that use the library listed above:
$subscription_details = array(
'description' => 'Premium membership: $4.95 every 30 days',
'initial_amount' => '4.95',
'amount' => '4.95',
'period' => 'Day',
'start_date' => gmdate( 'Y-m-d\TH:i:s', strtotime( '+30 day' ) ),
'frequency' => '30'
);
Just in case someone else has this trouble, my findings are:
There is nothing to solve -- the sandbox is just really slow, sometimes it took a couple days for the profile to become active and send the IPN. In other words, sandbox isn't good to test these functions at all, just go live and refund a couple tests. Even live sometimes takes a bit of time... I've seen it take a few hours sometimes, so don't go crazy.
From PayPal doco:
"By default, PayPal does not activate the profile if the initial payment amount fails. To override this default behavior, set the FAILEDINITAMTACTION field to ContinueOnFailure. If the initial payment amount fails, ContinueOnFailure instructs PayPal to add the failed payment amount to the outstanding balance due on this recurring payment profile.
If you do not set FAILEDINITAMTACTION or set it to CancelOnFailure, PayPal creates the recurring payment profile. However, PayPal places the profile into a pending status until the initial payment completes. If the initial payment clears, PayPal notifies you by Instant Payment Notification (IPN) that it has activated the pending profile. If the payment fails, PayPal notifies you by IPN that it has canceled the pending profile"
from https://cms.paypal.com/mx/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_WPRecurringPayments, just below Table 6.

Categories