aMember + alertpay

Discussion in 'Troubleshooting' started by chronoshift, Mar 14, 2008.

  1. chronoshift

    chronoshift aMember Pro Customer

    Joined:
    Jul 23, 2007
    Messages:
    61
    Anyone get aMember working properly with AlertPay and want to lend me a hand?

    I have it working to the point of where if you go to /amember/signup.php and fill in your info it will take you to alertpay's signup form, however after you sign up with alertpay and pay, your aMember membership doesn't end up getting activated.
  2. focusring

    focusring New Member

    Joined:
    Mar 15, 2008
    Messages:
    9
    I am also having problems to make alertpay work with amember. The alertpay payment page does not load when coming from the signup page at /amember/signup.php

    I get this error on the alertpay site, "Sorry, the return URL field cannot be left empty. Please try again."

    Please help.
  3. focusring

    focusring New Member

    Joined:
    Mar 15, 2008
    Messages:
    9
    I found the solution to the problem of "Sorry, the return URL field cannot be left empty. Please try again."

    in /plugins/payment/alertpay/alertpay.inc.php

    'ap_return_url' must be changed to 'ap_returnurl'

    I will let you know if I find other problems/solutions.
  4. focusring

    focusring New Member

    Joined:
    Mar 15, 2008
    Messages:
    9
    In regards to the problem of memberships not activating after payment, I believe I found the source of the problem.

    I removed this text from ipn.php

    if (md5($this_config[secret]) != $vars[securitycode]){
    alertpay_error(_PLUG_PAY_ALERTPAY_ERROR);
    }

    and it works now! There are still errors in the error log in amember but memberships are now automatically activated. By removing it, it seems the security code is not verified.

    If anyone knows a better solution, please let me know.
  5. chronoshift

    chronoshift aMember Pro Customer

    Joined:
    Jul 23, 2007
    Messages:
    61
    Thanks for the help. I thought the problem may have been with the security code. I tried putting the security code into the aMember plugin as encrypted, and as non-encrypted and neither would end up without giving an error in the debug log.
  6. CrackBaby

    CrackBaby Member

    Joined:
    Aug 22, 2006
    Messages:
    154
    I discovered this in the alertpay.ipn.php file (all the way to the bottom)

    you need to change

    header("Location: http://www.alertpay.com/PayProcess.aspx?$vars");

    to

    header("Location: https://www.alertpay.com/PayProcess.aspx?$vars");


    NOTICE THE httpS
  7. CrackBaby

    CrackBaby Member

    Joined:
    Aug 22, 2006
    Messages:
    154
    the ap_securitycode is there to make sure that payment postings are in fact from alertpay. This is an optional setting so it is NOT required by AlertPay but if you have a high volume or high risk website I would recommend to get this to work before you take too many payments. I have not figured it out yet but I will.

    I have people using paypal that change the price all the time or try and fool my website by sending their own posts to it.

    For me it is not an option it is a requirement
  8. CrackBaby

    CrackBaby Member

    Joined:
    Aug 22, 2006
    Messages:
    154
    Try changing
    if (md5($this_config[secret]) != $vars[securitycode]){
    alertpay_error(_PLUG_PAY_ALERTPAY_ERROR);
    }

    to

    if (!$vars['ap_securitycode'] == $this_config['secret']){alertpay_error(_PLUG_PAY_ALERTPAY_ERROR);}
  9. CrackBaby

    CrackBaby Member

    Joined:
    Aug 22, 2006
    Messages:
    154
    Ok I have done several test transactions and they are all working just fine now.

    I would call this a fix

    You still get the debug info in the error logs but i want to keep that on for a month or two, just to be sure.

    Goodluck guys and thanks for the first tip.
  10. CrackBaby

    CrackBaby Member

    Joined:
    Aug 22, 2006
    Messages:
    154
    In alertpay.inc.php

    find:

    $vars += array(
    'aps_period'=> alertpay_get_interval_unit($product->config['expire_days'], 'expire_days'),
    'aps_intervals'=> alertpay_get_interval_mult($product->config['expire_days'], 'expire_days'),
    );



    Change to:

    $vars += array(
    'ap_timeunit'=> alertpay_get_interval_unit($product->config['expire_days'], 'expire_days'),
    'ap_periodlength'=> alertpay_get_interval_mult($product->config['expire_days'], 'expire_days'),
    );
  11. chronoshift

    chronoshift aMember Pro Customer

    Joined:
    Jul 23, 2007
    Messages:
    61
    Thanks for that fix

    There is another problem with the plugin however, it will not properly recognize recurring subscriptions... so if you're doing recurring subscriptions, members will not be re-activated for another month even if alertpay charges them
  12. CrackBaby

    CrackBaby Member

    Joined:
    Aug 22, 2006
    Messages:
    154
    I do not use recurring subscriptions so I have no way to really test this. I might have some time this weekend to take a look at it but I doubt it. My days are full again.
  13. bs73112

    bs73112 New Member

    Joined:
    Feb 28, 2008
    Messages:
    24
    Well I see that they have fixed this code, but the "Incorrect secret code" seems to still be a problem... I have tried using the plain-text code and the encrypted one and they both die...
  14. shahg12

    shahg12 New Member

    Joined:
    Oct 11, 2007
    Messages:
    24
    Was this ever resolved? I'm having the same issue right now!!!
  15. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    Please contact us in helpdesk and provide access info and example of user who have an issue.
  16. shahg12

    shahg12 New Member

    Joined:
    Oct 11, 2007
    Messages:
    24
    Hi I have opened the ticket but it doesn't appear in the "Open Tickets" page!

    Can you please post the solution here??

    Thanks
  17. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    What aMember version you have? I believe you need to upgrade to latest version.
  18. shahg12

    shahg12 New Member

    Joined:
    Oct 11, 2007
    Messages:
    24
    I have managed to fix the recurring payment activation issue myself...

    In the alertpay folder edit /ipn.php

    replace:

    Code:
    if ($status != 'Success')
        alertpay_error(_PLUG_PAY_ALERTPAY_ERROR2);

    with:

    Code:
     if ($status != 'Success' && $status != 'Subscription-Payment-Success' && $status != 'Subscription-Canceled')
        alertpay_error(_PLUG_PAY_ALERTPAY_ERROR2);
    Have tested it and all seems OK now! FIXED

    Thanks
  19. 1309

    1309 New Member

    Joined:
    Feb 1, 2011
    Messages:
    1
    I have the next error in the setup instalation plugin to alertpay.
    In the step two when I click in the url show "Incorrect secret code".
    Help me please
  20. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    It should generate that error when you try to open notifications url from browser.
    That url should be accessed only by Alertpay server.

Share This Page