I set up correctly my website to support an account annual subscription payment using paypal recurring billing with payum bundle.
these are the parameters my website send to paypal on the prepare
$agreementDetails['PAYMENTREQUEST_0_AMT'] = $this->view['user']->money;
$agreementDetails['PAYMENTREQUEST_0_CURRENCYCODE'] = 'EUR';
$agreementDetails['PAYMENTREQUEST_0_ITEMAMT'] = $this->view['user']->money;
$agreementDetails['PAYMENTREQUEST_0_PAYMENTACTION'] = "sale";
$agreementDetails['L_PAYMENTREQUEST_0_NAME0'] = "Annual subscription";
$agreementDetails['L_PAYMENTREQUEST_0_QTY0'] = 1;
$agreementDetails['L_PAYMENTREQUEST_0_AMT0'] = $this->view['user']->money;
$agreementDetails['NOSHIPPING'] = Api::NOSHIPPING_NOT_DISPLAY_ADDRESS;
$agreementDetails['L_BILLINGTYPE0'] = Api::BILLINGTYPE_RECURRING_PAYMENTS;
$agreementDetails['L_BILLINGAGREEMENTDESCRIPTION0'] = 'Annual account subscription';
and these on the recurring request
$recurringPaymentDetails['TOKEN'] = $agreementDetails['TOKEN'];
$recurringPaymentDetails['DESC'] = 'annual account subscription';
$recurringPaymentDetails['EMAIL'] = $agreementDetails['EMAIL'];
$recurringPaymentDetails['AMT'] = $this->view['user']->money;
$recurringPaymentDetails['CURRENCYCODE'] = 'EUR';
$recurringPaymentDetails['BILLINGFREQUENCY'] = 365;
$recurringPaymentDetails['PROFILESTARTDATE'] = date(DATE_ATOM);
$recurringPaymentDetails['BILLINGPERIOD'] = Api::BILLINGPERIOD_DAY;
everything works fine.
my question here is that I just want to know if my clients' recurring payments will be accepted and paid. and also, if my client didn't pay his annual fee.
I mean, how to know (server side, php) the last succesful payment date for a specific account?
You'll want to configure an IPN solution. PayPal will POST data to a listener script you setup anytime a transaction takes place. You can update your database, send custom email notifications, hit 3rd party web services, or anything else you might want to automate based on payments, refunds, new profiles, suspended profiles, disputes, etc.
You can also use the TransactionSearch API and pass in a ProfileID to get the transactions associated with that profile.
Related
I am trying to create a recurring profile using express-checkout (Payum/paypal-express-checkout-nvp).
Howto from Payum
private function createAgreement(Purchase $purchase)
{
$storage = $this->payum->getStorage('Coachup\PaymentBundle\Entity\PaymentAgreement');
$agreementDetails = $storage->createModel();
$agreementDetails['L_BILLINGTYPE0'] = Api::BILLINGTYPE_RECURRING_PAYMENTS;
$agreementDetails['L_BILLINGAGREEMENTDESCRIPTION0'] = 'test';
$agreementDetails['PAYMENTREQUEST_0_AMT'] = 0;
$agreementDetails->setPurchase($purchase);
$storage->updateModel($agreementDetails);
$captureToken = $this->securityTokenFactory->createCaptureToken(
$this->paymentName,
$agreementDetails,
'payment_checkout_progress_payment',
['purchaseId' => $purchase->getId(), 'paymentType' => $this->getId()]
);
$agreementDetails['RETURNURL'] = $captureToken->getTargetUrl();
$agreementDetails['CANCELURL'] = $captureToken->getTargetUrl();
$storage->updateModel($agreementDetails);
return $captureToken->getTargetUrl();
}
A token seems to be generated with paypal, the user gets redirected to paypal (sandbox) and once i log in to confirm the agreement, i get a generic error message (loosely translated)
"The request can not be processed, please return to the store and choose another option".
Not even an error code...
Any help?
Its possible that the initial payment of 0.00 is failing, which is making it so the billing agreement is not created. Here is a way that you can override this and create the profile anyway. This comes directly from the PayPal documentation:
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.
If you created the profile using Express Checkout, the buyer receives an email stating that PayPal cleared the initial payment or canceled the pending profile.
Here is the direct link in case you need it:
Recurring Billing Integration Guide
I want to allow customers to pay with paypal without having to create a paypal account. Paypal allows this by setting 2 variables:
SOLUTIONTYPE = 'Sole';
LANDINGPAGE = 'Billing';
This takes the customer to a page where he can enter his details and pay. Creating a paypal account is optional.
Does anybody know a way to not have to ask for delivery address? Just enter the CC details and that is it?
I tried:
NOSHIPPING = 1
REQCONFIRMSHIPPING = 0 (and not setting it at all)
ADDROVERRIDE = all values (and not setting it at all)
Any way of doing this?
I don't think you can do this with Payments Basic and you certainly can't do it inside API Express Checkout (which is ONLY for Paypal accounts). You really need the flexibility of an API to do it. Have you considered Payments Pro or Stripe?
My application uses the Adaptive Payment Service to send payments to users. If the user has no bank account attached to their PayPal account and their account is not verified, PayPal sends them an email and they need to click on a Claim button in that email to receive their payment.
The problem is that this process seems to change the Fees Payer initially set by the transaction. My app sets the fees payer to "SENDER" and in the example above, PayPal seemingly changes this to "RECEIVER".
Does anyone know why this would happen? Here is an excerpt from the code ... seems pretty straightforward to me ...
$payRequest = new PayRequest(new RequestEnvelope("en_US"), 'PAY', $cancelURL, 'USD', $receiverList, $returnURL);
$payRequest->feesPayer = 'SENDER';
$payRequest->senderEmail = $senderAccount;
$service = new AdaptivePaymentsService();
$response = $service->Pay($payRequest);
I finally submitted this question directly to PayPal support and eventually got back the following:
As per the Pay API reference;
https://www.x.com/developers/paypal/documentation-tools/api/pay-api-operation,
the 'Sender' cannot be the feesPayer for unilateral payments (payments
made to users who have not yet registered with PayPal). This is
probably why you are seeing it change to 'Receiver' instead.
So, apparently this is by design and there is no way around it.
I have a site which will receive money from customers in a regular period(Say once in a week). I am storing my clients details in my database and i want withdraw money form my customers account with out prompting them for authentication every time.The amount will be vary with respect to the customers. How can i do this with pay pal?Do i need to buy pay pal pro for implementing this.I read some docs related to recurring payments and reference payment services of pay pal, but i don't know how it will work when my business pay pal account registered in Australia.
Thanks in advance.
We recently (Jan 2013) implemented a recurring payment integration with PalPal for an Australian site (paypal account).
We used;
PayFlow Pro (doc:
https://www.x.com/sites/default/files/payflowgateway_guide.pdf)
Recurring Payments module (doc: https://www.x.com/sites/default/files/pp_payflowpro_recurringbilling_guide.pdf)
I can't say the experience was a pleasant one, a lot of reading, phone calls to support, and hair-pulling - but we got there in the end.
Depending on your situation I would suggest looking at Pin Payment Gateway (https://pin.net.au/) as an alternative.
You can use PayPal Recurring Payment method for this.
As you said you do not want you want to withdraw money from there account without authenticating them again, you have to create a subscription profile of customer on paypal via an NVP API (CreateRecurringPaymentsProfile).
After you get the Subscription ID of the customer with a success message you need not to store customers details (card details), which is also illegal to do so.
While calling the
CreateRecurringPaymentsProfile method of API
You need to set the following fields.
BILLINGPERIOD = MONTH or DAY (according to your need)
BILLINGFREQUENCY = 2 (means after 2 BILLINGPERIOD )
TOTALBILLINGCYCLES = 10
For Example : if BILLINGPERIOD = MONTH & BILLINGFREQUENCY = 2 & TOTALBILLINGCYCLES = 10 then automatic payment will occur after every 2 months till 10 payment cycles are completed.
You can also find the example code here :
http://paypal.github.io/sample-apps/
Is it possible to make a refund via PayPal PayFlow API on last transaction when I'm using PayFlow recurring payments.
Thanks,
Maciek
Simple answer to this is "yes".
You need to credit as you would a normal transaction. Parameters are:
USER
VENDOR
PARTNER
PWD
TENDER=C // C = credit card, P = PayPal
TRXTYPE=C // S = Sale transaction, A = Authorisation, C = Credit, D = Delayed Capture,
ORIGID=XXXX // ORIGID to the PNREF value returned from the original transaction
Then you may need to cancel the recurring transaction to stop it happening again. Parameters are:
USER
VENDOR
PARTNER
PWD
ACTION=C // C = Cancel
TRXTYPE=R // R = Recurring
ORIGPROFILEID=XXXX // Original Profile ID (of the recurring transaction)
https://www.paypalobjects.com/webstatic/en_US/developer/docs/pdf/pp_payflowpro_recurringbilling_guide.pdf