Payment Cancel Redirection

Discussion in 'aMember Pro v.4' started by kroopa, May 9, 2012.

  1. kroopa

    kroopa Member

    Joined:
    May 2, 2012
    Messages:
    31
    How do I set up a custom optin page for redirecting users who click cancel button from the PayPal payment page after attempting to subscribe from the sign up page?
  2. davidm1

    davidm1 aMember User & Partner

    Joined:
    May 16, 2006
    Messages:
    4,437
    Good idea.
    1 )create a new signup form in the v4.x forms editor.
    2) hack the paypal plugin to give the cancel link to #1 url.
    (may be possible to set this in the paypal website setup page too- have to check)

    David
    kroopa likes this.
  3. kroopa

    kroopa Member

    Joined:
    May 2, 2012
    Messages:
    31
    This is the code I can find in the paypal plugin related to cancel url code.

    PHP:
    It is only necessary to enable IPN in PayPal. If IPN is already enabledit does not matter
    what exactly URL is specified
    aMember will automatically let PayPal know to use aMember URL.
    CUT;
        }
       
       
        function 
    getUserCancelUrl(Invoice $invoice)
        {
            return 
    'https://' $this->domain '?' http_build_query(array(
                
    'cmd' => '_subscr-find',
                
    'alias' => $this->getConfig('business'),
            ));
        }
       
        public function 
    getAdminCancelUrl(Invoice $invoice)
        {
            return 
    'https://' $this->domain '?' http_build_query(array(
                
    'cmd' => '_subscr-find',
                
    'alias' => $this->getConfig('business'),
            ));
        }
    Where or How I have to configure my URL for redirecting on Payment cancel
  4. orish

    orish aMember Pro Customer

    Joined:
    Mar 15, 2011
    Messages:
    49
    Hi, I'm having exactly the same problem. I've defined a cancel transaction URL in PayPal and I've set up IPN to go to ...xxx.com/amember4/payment/paypal/ipn.

    But when I cancel a transaction in PayPal, I end up on an aMember page
    Payment Failed


    An error occured while handling your payment.
    Choose another payment processor and try again

    that is completely meaningless to the customer.

    I've created a comprehensive page in my Joomla system to handle cancelled transactions - and I'd like my customers to be sent to that page (i.e. the custom URL that I defined in PayPal for the product).

    I'm wondering whether the 'success' page will be the one I defined in PayPal, or whether the customer will end up on some random aMember page (with no menu structure and our familiar website layout). That won't look professional at all!
  5. davidm1

    davidm1 aMember User & Partner

    Joined:
    May 16, 2006
    Messages:
    4,437
    I believe this is the line in amembers plugin
    $a->cancel_return = $this->getCancelUrl();
    This tells paypal where to redirect to on a cancelation during checkout.
    change to:
    $a->cancel_return = 'http://mysite.com/cancelurl';

    David
  6. kroopa

    kroopa Member

    Joined:
    May 2, 2012
    Messages:
    31
    did you mean that this code will be available in "paypal plugin" file?
  7. kroopa

    kroopa Member

    Joined:
    May 2, 2012
    Messages:
    31
    David, where can I find this piece code?
  8. davidm1

    davidm1 aMember User & Partner

    Joined:
    May 16, 2006
    Messages:
    4,437
    \amember\application\default\plugins\payment\paypal.php

    David

Share This Page