Paypal Rest API Recurring Setup Fee Refund - rest

I am using PayPal Rest API for recurring billing.
As described in the API i have created a billing plan with a Setup fee $10 and future price $5 and create and execute a agreement.
Now my question is, now user want to refund of his setup fee($10) and cancel his billing agreement.
I can cancel his billing agreement because we have his agreement id but how can we refund his setup fee because we don't have the transaction id of this transaction.
Please suggest us.
With Regards,
Alok

After you login www.paypal.com, in transaction history page, you can click " Issue refund" button to refund specific transaction. For this setup fee charge, there is also a record and you can refund it.

Related

How to implement paypal recurring payment in angular2

I want to implement paypal recurring payments using angular2. I have successfully included the button for express checkout which works perfectly, but i don't have an idea of the api to use for recurring payments.
When i try to use checkout.js with this code
paypal.billingPlan.create(billingPlanAttributes, function (error, billingPlan) {
...
})
I get billingPlan is not defined. Has anybody done this successfully, please let me know.
The correct way to do Recurring payment in REST API with Paypal is that you are required to have an active billing plans.
The orders are ;
Create Billing Plans
Update Billing Plans to Active
Call Billing Agreement.
In your cases, you need an active billing plans before calling the billing agreement. PayPal use the billing plans to define the billing agreement between buyer and seller.

Adaptive Payments API - Chained Refunds

I am interested in using Adaptive Payments API to setup a simple service site where I act as an agent between a seller and a buyer.
Lets say the buyer purchases a product for $100, I take a $20 cut and the $80 goes to the seller. Now lets say the buyer is unhappy and wants a refund.
How does the system actually work this, with myself holding the Paypal business account if I issue a refund will it refund both my $20 and the $80 from the sellers account? Or does the buyer have to request a refund from the seller directly?
Thanks
The seller need to grant you with permission to make a refund on behalf of him, so that you could call the Refund API . You may refer to the below page for more details .
https://developer.paypal.com/webapps/developer/docs/classic/api/adaptive-payments/Refund_API_Operation/

Paypal Express Checkout : Get Billing Agreement ID later

During a transaction with creation of billing agreement id using Paypal Express Checkout, if customer completes the payment on paypal page and the network between him and merchant disrupts when redirecting to merchant page. Will his card be charged even if DoExpressCheckout is not made? How to get transaction status along with billing Id after the token is expired for above scenario?
No, Unless you call the DoExpressCheckout API , money is not going to be charged on the buyer's account .

Detecting cancellation of a paypal billing agreement setup with reference transactions

I am using the 'reference transactions' of the Paypal express checkout api to set up a recurring billing scenario for our customers. I have chosen this method since the amount billed per month will vary and there is no initial payment when entering into the billing agreement.
My question is, can I use the paypal IPN to detect when the user cancels this? I know that if the customer enters into this agreement they have the power to log into their own Paypal account and cancel the agreement. What variables should I be listening for through the IPN?
Whilst I see mention of recurring payments and recurring payment profiles in the IPN documentation these are not actually the same as setting up a recurring billing scenario via reference transactions (recurring payments and reference transactions are in two different parts of the general paypal api documentation).
Enable IPN in your PayPal account , then PayPal will notify you via IPN about the Billing agreement cancel from the customer.
If you include IPN with SetExpressCheckout, it will not work with Reference Transaction. You need to Enable IPN on PayPal site.

Recurring payment using reference transaction

Is it possible to Create a Recurring Payment Profile using DoReferenceTransaction or is there any other way to set up recurring payment when I've got "billing agree" from customer and REFERENCEID - an id of customer's previous transaction.
Thanks
You can set
RECURRING
field of DoReferenceTransaction API call, but first you need a billing agreement with buyer.
I recommend doing recurring payment with CreateRecurringPaymentsProfile call.
API is here.
I've got billing agreement with buyer ("billing agreement ID") - according to reference transaction api .
I also can do transactions with DoReferenceTransaction like:
$nvpstr="&L_AMT0=".$itemamt."&L_QTY0=1&AMT=".(string)$amt."&ITEMAMT=".(string)$itemamt."&CALLBACKTIMEOUT=4&REFERENCEID=B-6J7244599E964634T&ReturnUrl=".$returnURL."&CANCELURL=".$cancelURL ."&CURRENCYCODE=".$currencyCodeType."&PAYMENTACTION=".$paymentType;
$resArray=hash_call("DoReferenceTransaction",$nvpstr);
However I still don't know how to set up recurring payment using reference transaction cause in API link you gave me, there is a note that Credit Card ACCT number is required - but I don't want to store client's card numbers in my database (I am using express checkout).