I use Paypal .Net SDK (https://github.com/paypal/PayPal-NET-SDK ) for payment API calls. It needs an APIContext object to be passed in API calls.
By using clientid and clientsecret of my paypal app, I can obtain accesstoken to create the APIContext object. But this makes payment into my merchant account.
I wanted to make payment and refund API calls on behalf of other merchants. For that I used Paypal Permission SDK (https://github.com/paypal/permissions-sdk-dotnet) to obatain permissions from Third Party Merchants. Once a merchant grants permission, I get token and secret. At this stage I cannot find any documentation how do I use that token and secret to call paypal API?
Can anyone guide me how to use that token and secret (received from permission API) to make valid APIContext, which can be used to call various paypal.net sdk API calls?
My answer is a bit late, but may help others as I found this question when searching for how to do this.
This applies if using the PayPal .NET SDK.
Create a
PayPal.Api.Payee
object and add this to yourPayPal.Api.Transaction
object that you use to make your payment.Example 1:
Example 2:
Instead of
email
you could usemerchant_id
orphone
to identify the third party to receive the funds.Note: the third party must have granted your PayPal application the appropriate permission for the type of transaction you are attempting.