Recurring in Authorization & Capture - paypal

I managed to make an authorized payment using Authorization & Capture API.
SetExpressCheckout with PAYMENTREQUEST_n_PAYMENTACTION=Authorization
GetExpressCheckoutDetails to get PAYERID and other information
DoExpressCheckoutPayment with PAYMENTREQUEST_n_PAYMENTACTION=Authorization
DoCapture with AUTHORIZATIONID={transactionID_from_step_3}
Everything works fine. But, I unable to perform doAuthorization and DoReauthorization for the next time. I wish to charge my subscribers recurring every month. A few attempts have been tried. Does anyone know how to perform Authorization & Capture recurring? Any suggestions are greatly appreciated.
PS: Sorry for my broken English.

An authorization is an agreement to pay for one bundle of goods. Once that authorized transaction is completed the authorization is consumed/used up. You cannot use it (alone) for multiple transaction payments.
You need to use the Reference Transaction product, which is how PayPal collects the user's agreement for you to make (current and) future transactions:
https://developer.paypal.com/docs/classic/express-checkout/integration-guide/ECReferenceTxns/

Related

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.

get state of agreement paypal subscriptions

I have integrated paypal php rest api to create plan and then I have create billing agreement for this plan but the issue is payment is not deducting instantly and I want to know that how will came to know that payment is deducted from payee account.
after executing billing agreement I get object of billing agreement as response and in that object it show that billing agreement is activated but in payee's account transaction status of agreement is pending in response object outstanding amount is also zero
I want to know way to identify that amount is deducted form payee's account or not. so that I can take action accordingly.
I have solved this issue but for this I have to use callback or we can say webhooks
One more thing was there is
Webhook never works on subdomain and ssl is also requiered .

Handle recurring payments with paypal

I'am having troubles about how to handle the paypal recurrent payment system.
I followed every instruction in the website, but once i create the profile, paypal puts it in pending, making me doubt about the reliability of the service itself.
I tried to look over the internet but i didn't really get how this should work...
i made the first call with SetExpressCheckout in order to create the request, when the token is returned, i send the token to the paypal page, the user confirms the payment, then i call the CreateRecurringPaymentsProfile method to confirm the operation (passing PAYERID and TOKEN and setting the AMT value for the first payment and the PROFILESTARTDATE as now +1 month for the future payments)
Now when i try to read the response from the last call (or if i go to the buyer/seller paypal account) i see that the payment is in pending and i have to wait an undefined amount of time before this payment is activated.
Now the real question is: can i trust the fact that even if the payment is in pending, i'll receive the payment and so i can set set the user as member or i have to check and wait until the status is 'active' with the GetRecurringPaymentsProfileDetails method?
PS: i'm doing this in the sandbox version, maybe the official version is a bit faster and more reliable?
Thank you!
In Sandbox as in Live when you call CreateRecurringPaymentsProfile you will also get the response in which it will give you the status of the profile (ActiveProfile or PendingProfile). When the status is in Penidng it means that the system is in process of creating the recurring payment profile. You can then check your IPN messages for an update. It is normal but obviously if you notice that all the profiles you create get into Pending and never activate then there could be a bug but should not be the case. In here is the PayPal technical guide for this API: https://developer.paypal.com/docs/classic/api/merchant/CreateRecurringPaymentsProfile_API_Operation_NVP/

Paypal classic API : Get declined recurring payment details

Please help me, How can I get list of declined recurring payments/profiles using classic API.
Create a script that takes your payment profile IDs and runs GetRecurringPaymentsProfileDetails API call for each profile and you can see the status of each one, the date of the last payment made, any past due amounts from failed payments, and more. You can then use the BillOutstandingAmount API to attempt to capture the past due amount for that profile.

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.