How to mark a user 'Paid' programmatically?

Discussion in 'Payments processing' started by edward, Mar 26, 2006.

  1. edward

    edward New Member

    Joined:
    Feb 4, 2006
    Messages:
    15
    Hi:

    Is there any programmatical way to mark a user as 'Paid'? For example, if I can get 'user name', 'e-mail address', and 'product#' via POST into a PHP script. How can I code it so that the script can make aMember recognize that 'user name' with 'e-mail address' has paid for 'product#'. Please advise and thank you!

    Regards,
    Edward
  2. alex

    alex aMember Pro Customer Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,021
    Yes, it is easy enough to do. You should call:

    PHP:
    require_once 'amember/config.inc.php';
    $member_id $db->add_waiting_user(...); // see call example in amember/signup.php
    $pr get_product(111);
    $payment = array(
    'member_id' $member_id,
    'product_id' => $product->config['product_id'],
    'completed' => 1,
    'begin_date' => $d date('Y-m-d'),
    'expire_date' => $product->get_expire($d),
    );
    $db->add_payment($payment);
  3. edward

    edward New Member

    Joined:
    Feb 4, 2006
    Messages:
    15
    I will give it a try!

    Dear Alex:

    I will give this a try. Thank you!

    Regards,
    Edward
  4. alex

    alex aMember Pro Customer Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,021
    Feel free to ask any questions if necessary.
  5. edward

    edward New Member

    Joined:
    Feb 4, 2006
    Messages:
    15
    Did not show up in Payment History or Payment Report

    Dear Alex:

    I did what you described and basically it worked expect that the record did not show up in "Payments for last 7 days" in CP.

    How to correct this problem? Please advise. Thank you!

    Best regards,
    Edward
  6. alex

    alex aMember Pro Customer Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,021
    What are start/expire date of the record?
  7. edward

    edward New Member

    Joined:
    Feb 4, 2006
    Messages:
    15
    Alex:

    I noticed that the start date was a date in the future and was able to resolve the issue. Thank you!

    Regards,
    Edward

Share This Page