Search code examples
paypalrecurring-billingpayum

paypal express checkout - recurring billing - check recurring status


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?


Solution

  • 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.