Variable Payment

Discussion in 'Payments processing' started by xindexer, Aug 30, 2011.

  1. xindexer

    xindexer Member

    Joined:
    Apr 17, 2011
    Messages:
    52
    I am trying to create a variable payment for Paypal.

    I received this from Andrey in regards to a ticket I placed:

    "This way you don't need customization at all.
    Upgrade to aMember 3.2.4 or 3.3.0 both have allow to crteate accounts from paypal function.
    Enable that in paypal plugin settings.
    Then create regular paypal buttons. "

    I enabled the feature in the amember admin section but I'm confused as to how to make it work...


    By create regular paypal button, I'm assuming you are talking about something like this:

    <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
    <input type="hidden" name="cmd" value="_s-xclick">
    <input type="hidden" name="hosted_button_id" value="KU55V27RCDHP6">
    <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
    <img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
    </form>


    how does a regular paypal button send a response back to amember for that particular product?

    I created a new product ID for this variable payment (id-7).

    How do I tie the two together so that I can run a script to update the database when somebody makes a payment?

    Thanks
  2. davidm1

    davidm1 aMember User & Partner

    Joined:
    May 16, 2006
    Messages:
    4,437
    If you properly integrate amember/paypal, paypal will notify amember (IPN) that the payment was made, and create a new account for that member, or add the product to the existing account (if the email is the same).


    David
  3. xindexer

    xindexer Member

    Joined:
    Apr 17, 2011
    Messages:
    52
    still need some help

    I set up a test payment, it went through and Paypal is sending the information back to Amember; however, I have some setting wrong still because Amember isn't doing anything with the information. Here's the info out of the log file:

    paypal_r ERROR: amount passed is [1], should be [0]
    mc_gross => 1.05
    protection_eligibility => Eligible
    address_status => confirmed
    payer_id => 7G5EYC2HGKP2E
    tax => 0.00
    address_street => *********
    payment_date => 11:33:40 Aug 30, 2011 PDT
    payment_status => Completed
    charset => windows-1252
    address_zip => *****
    first_name => Dan
    mc_fee => 0.33
    address_country_code => US
    address_name => Dan *****
    notify_version => 3.2
    custom =>
    payer_status => verified
    business => dan@******.com
    address_country => United States
    address_city => ******
    quantity => 1
    verify_sign => AUC0HFLbyX.9sULLTUzWYLgDqaf5AW-aog-lXn9GylsQ3YgfWth-cBTw
    payer_email => ******@gmail.com
    txn_id => 2KJ5902428650744F
    payment_type => instant
    last_name => *****
    address_state => *****
    receiver_email => dan@*****.com
    payment_fee => 0.33
    receiver_id => K9K2B8TRVUJ3L
    txn_type => web_accept
    item_name => Clear My Queue
    mc_currency => USD
    item_number => 7
    residence_country => US
    handling_amount => 0.00
    transaction_subject => Clear My Queue
    payment_gross => 1.05
    shipping => 0.00
    ipn_track_id => xTfvBZaHBeCpDt0VJHOZHQ



    I have a product with ID 7 with a price of 0.00, duration is 0 (this is a one time payment) with everything else set to the defaults.

    How do I tie the payment to the product?

    Thanks
  4. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    Make sure that Trial price field is empty(and not set to zero)
  5. xindexer

    xindexer Member

    Joined:
    Apr 17, 2011
    Messages:
    52
    Trial Price

    Trial 1 Price was empty for these tests

    Anything else?
  6. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    Can you attach screenshot of product settings? Also did you make payment from aMember signup page or in paypal directly? Did you use coupon?
  7. xindexer

    xindexer Member

    Joined:
    Apr 17, 2011
    Messages:
    52
    Screenshot

    Screenshot attached, this payment was not initiated from the member.php page but from within the website (i.e. the user is logged in but the payment is a custom form):

    <form id="payment3" name="payment" method="post" action="../amember/member.php">
    <input type="hidden" name="paysis_id" value="paypal_r">
    <input type="hidden" name="product_id" value="7">
    <input type="hidden" name="amount" value="<?= number_format(($stored-$dailyLimit)*$perURL,2); ?>">

    <div style="text-align: center">
    <div id="paypalButton3">
    <input type="image" src="../img/paypal_buynow.gif" border="0" id="paypalImage3" alt="PayPal - The safer, easier way to pay online!">
    </div>
    </div>
    </form>

    The value is calculated automatically based on user input.

    No coupons used

    Dan
  8. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    By default aMember do not allow to change amount? So was this semothing that you have customized?
    Error generated because product have price set to 0 but you change amount to 1.
    You need to edit paypal_r.inc.php and remove amount check from process_postback function.

Share This Page