How to enable refunds for paypal adaptive payments? - paypal

I'm trying to make refunds for adaptive payments and I get following Error in response: 'NO_API_ACCESS_TO_RECEIVER'
On this page
https://developer.paypal.com/docs/classic/api/adaptive-payments/Refund_API_Operation/
in documentation exists link to Grant API permission, but looks like it obsolete, and I can't find any other information how to enable refunds, has anyone resolved this issue?

The receiver must provide you (primary receiver) access to the refund API. The PayPal document clearly states the following:
Have made a Pay request for which payment you want to refund the
payment, or you must have received the part of the payment you want to
refund, and
Have permission to make a refund on behalf of the receiver, unless you
are also the receiver; in other words, each receiver whose account is
the source of the refund must have granted you third-party access
permission to call the Refund API operation.

Related

PayPal refund permissions for custom payee

I have the following flow -
A buyer makes a payment, I add a customer payee on the client, pass the orderId to the server and capture the transaction on the server.
Can I do a refund in this case?
using the following API I get "PERMISSION_DENIED"
https://api.sandbox.paypal.com/v2/payments/captures/0NA021645B5069646/refund
description: "You do not have permission to access or perform operations on this resource."
What am I doing wrong?
You don't have permission to refund payments from someone else's account.
They need to grant the permission to your API caller account.
Once granted, for that particular v2 refund call you'll need to construct and pass a PayPal-Auth-Assertion header, documented here: https://developer.paypal.com/docs/api/reference/api-requests/#http-request-headers

How to interprete paypal billing agreement creation?

I am building a paypal subscription system but i have some difficulties to understand some points. When using sandbox i can't simulate a payment denial process so when the payment is made, paypal redirect me to my "approval url callback" and a billing agreement is created.
So i want to know , in a real situation, will paypal redirect me to the approval url and create this billing agreement even if the payment didn't occur yet ? or this one can be created if and only if the payment is accepted ? (So if paypal denied the payment the billing agreement will never be created)
In my case, my customers will need to access to some paid features of my website so, should i wait for the "ipn webhook notification (PAYMENT.SALE.COMPLETED)" which can take several minutes to be fired to my endpoint, or can i grant access immediately after the billing agreement is created ?
Which is the most secure thing to do ?
thanks.
If the user cancels the checkout, Paypal will redirect to your cancel URL.
But the failed payment cases are not clear to me either. I believe that the agreement will be created even if the payment fails, since it needs to exist for the payment attempt to be done, but I don't work at Paypal :).
My approach is to activate the subscription on a successful redirect no matter what, [edit: the execute response returns an agreement_details.next_billing_date in the past, so you can't use that] with a short initial subscription expiration (4h). When our webhook receives a PAYMENT.SALE.COMPLETED message, we fetch the agreement billing agreement details, and update the subscription expiration to the new agreement_details.next_billing_date. But if the webhook receives a PAYMENT.SALE.DENIED, we just let the subscription expire.
HTH.

Programming with PayPal to transfer money without manually input account and password

I'm currently developing a payment system using PayPal.
I'd like to use the adaptive payment method to pay money from my account to other accounts without logging in, entering password, confirming manually by myself, instead, I may store my account and password in a file, and during the payment, this file will be read and used as the certificate for my payment.
Is this possible to implement?
Accessing a file & filling the login user name / password won't work in this case.
But with Adaptive Payments, you'll be able to make the payments from your account to another by implicit payment (when API caller is also the payment sender).
Implicit approval payments are payments where the sender and the API caller are using the same account. Because PayPal draws the funds for the payment from your own account, there is no approval necessary, and as such there is no visible flow for implicit approval payments.
Technical wise, you would need to implement a pay API call with sender set to your own account, you may refer to the API Ref for details
The payouts API may be what you want: https://developer.paypal.com/docs/api/#payouts

Paypal Chained Payment

Is there any way that I can programmatically check to be sure a customer's account is confirmed and is ready to receive payments in paypal?
Donations via our website always fail due to unconfirmed email of our primary receiver. I am using Paypal's Adaptive Payment (Chained Payment).
Thank you.
There isn't specifically an API currently for confirming that a buyer account/email is confirmed. What some merchants use as a work around for checking this is use the same API call that you are making, with a failure inidicating that it is not confirmed.

Paypal merchant acceept or deny each transcation

I'm developing website for online shopping in which i have integrate paypal as payment method.
but, i want each transaction must be confirmed by merchant so that merchant can accept or reject(decline-deny) each transaction.
payments for the rejected transaction will be refunded to payer. and accepted transaction will we processed as confirmed order.
is their any way to do this ?
please help me on this. thanks in advance
I found my answer.
now i will go with "paypal authorization capture api"
for this i need to use paymentaction="authorization" in my paypal standard payment form that make the transaction on hold.
and at admin side i need to make that onhold transaction make capture to proceed order or void orders to cancel i just need transaction id their.
i will use "paypal authorize and capture api" for that...
you should manually lo-gin into you merchant account to reject(decline-deny) each transaction.