Paypal Cancel Recurring option doesn't work

Discussion in 'Payments processing' started by 187ci, Mar 4, 2012.

  1. 187ci

    187ci New Member

    Joined:
    Dec 19, 2006
    Messages:
    9
    The "cancel recurring" option for paypal transactions in the admin panel does not work. It sends you to paypal to search for recurring subscriptions for your own email address.
  2. alex

    alex Administrator Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,020
    Unfortunately, there are no ways to submit cancellations from aMember CP and no way to make direct link to payment in paypal account to cancel.
  3. 187ci

    187ci New Member

    Joined:
    Dec 19, 2006
    Messages:
    9
    I don't understand why? I just found some code to do it. The only possible problem I can see is that it would require an API key to be made by the user.

    <?php
    // Include required library files.
    require_once('includes/config.php');
    require_once('includes/paypal.class.php');

    // Create PayPal object.
    $PayPalConfig = array('Sandbox' => $sandbox, 'APIUsername' => $api_username, 'APIPassword' => $api_password, 'APISignature' => $api_signature);
    $PayPal = new PayPal($PayPalConfig);

    // Prepare request arrays
    $MRPPSFields = array(
    'profileid' => '',// Required. Recurring payments profile ID returned from CreateRecurring...
    'action' => '',// Required. The action to be performed. Mest be: Cancel, Suspend, Reactivate
    'note' => ''// The reason for the change in status. For express checkout the message will be included in email to buyers. Can also be seen in both accounts in the status history.
    );

    // Pass data into class for processing with PayPal and load the response array into $PayPalResult
    $PayPalResult = $PayPal->ManageRecurringPaymentsProfileStatus($PayPalRequestData);

    // Write the contents of the response array to the screen for demo purposes.
    echo '<pre />';
    print_r($PayPalResult);
    ?>

Share This Page