'Cancel and Return' redirect has changed

Discussion in 'Payments processing' started by ak48avk, Sep 15, 2011.

  1. ak48avk

    ak48avk Angela Kane

    Joined:
    Aug 9, 2010
    Messages:
    124
    When setting up my system I set this return address to a specific page so that customers who change their mind or don't have paypal are offered a non repeating purchase.

    'Cancel and Return' is now returning to amember fail page saying an error has occurred and return to sign up.

    I don't believe I have changed anything but I can't remember how I set it up before. I have a feeling it was a PayPal setting which I can't now find.

    I use amember in its simplest form but it is fantastic and has worked perfectly for me since I implemented it eighteen months ago.

    Regards
    Angela
  2. davidm1

    davidm1 aMember User & Partner

    Joined:
    May 16, 2006
    Messages:
    4,437
    Do you know the amember URL its sending you back too?

    David
  3. ak48avk

    ak48avk Angela Kane

    Joined:
    Aug 9, 2010
    Messages:
    124
    Cancel and Return?

    Hi David, thank you for responding.

    When my customer clicks on Paypal pay by card option. The next page rightly states you need Paypal for this purchase (subscription). So then the customer clicks on return to Angela Kane and is directed to this URL:

    http://angelakane.com/ak_amember/cancel.php?payment_id=3514

    Whereas I did have it returning to this page:

    http://angelakane.com/failed_for_paypal.html

    which directs them to my other signup page with the One Year option.

    I don't know when it changed. I don't think I have changed anything. As I said I can't work out how I did it in the first place. I suspect it is a PayPal option but I can't find the option in the Profile setup.

    Help much appreciated.

    Angela
  4. davidm1

    davidm1 aMember User & Partner

    Joined:
    May 16, 2006
    Messages:
    4,437
    You can edit the plugin to pass the new cancel page you want:
    'cancel_return' => "$config[root_url]/cancel.php?payment_id=$invoice",
    to
    'cancel_return' => "http://yoursite.com/betterpage",

    David
  5. ak48avk

    ak48avk Angela Kane

    Joined:
    Aug 9, 2010
    Messages:
    124
    Thank you that works.

    On testing I find that my new cancel return page sends them to my alternative signup page with the negative price group for my special one year sign up but of course by that time they are already registered so I need to send them to an Add/Renew page with the special Add sub. I'm not sure how to do an Add/Renew page for a price group. I have checked the manual - I may have missed it.

    Thanks
  6. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    /amember/member.php?price_group=-1&tab=add_renew
  7. ak48avk

    ak48avk Angela Kane

    Joined:
    Aug 9, 2010
    Messages:
    124
    Thank you Alexander.

    That is exactly right and is now working.

    I appreciate the quick response.
  8. orish

    orish aMember Pro Customer

    Joined:
    Mar 15, 2011
    Messages:
    49
    This is the response I got from tech support, it works well for paypal.
    Edit /amember/application/plugins/payment/paypal.php
    and change
    $a->cancel_return = $this->getCancelUrl();
    to
    foreach($invoice->getProducts() as $p){
    if($p->pk() == 1)
    $a->cancel_return = '/url/for/product/1';
    if($p->pk() == 2)
    $a->cancel_return = '/url/for/product/2';
    if($p->pk() == 3)
    $a->cancel_return = '/url/for/product/3';
    }

    I think $p is the aMember product ID and the url (for joomla) is www.yourwebsite.com/index.php?option=com_content&view=article&id=xx

    Be careful to ensure that you update this file each time you add a product or if any of the product IDs change, otherwise nothing will happen. Maybe there should keep the line
    $a->cancel_return = $this->getCancelUrl();
    after the foreach statement in case none of them apply, or create a generic catch-all cancel page:
    $a->cancel_return = 'catch-all url';


    For completed payments, I found the plugin solution for customized thank you pages for each product (provided by http://www.amember.com/forum/threads/custom-thankyou-page-redirect-solution.14397/) is excellent!

Share This Page