PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

PayPal and user reg. add ons, how to and where?

  1. obvio
    Member

    hi,
    I've been playing with both and they're working pretty cool but I have a couple of questions so I'll better understand how this can be applied to my needs:

    1. where're the paypal transactions are stored? own table or as meta to a form/post submission?

    2. can I somehow output all the transactions? can the transaction status can be seen as a column in the entries table ui?

    3. say a registered user bought a product "gold package" (for example: gives him the ability to post 5 listings and mark 2 as "top" listing), how do I get the purchases (and their statuses) associated with this specific user? is there something like:
    get_user_purchase_history($user_id) for example?

    4. similar to 3, if a user bought a monthly subscription product, how do I access that info in relation to the user? how do I make sure it is still valid? is that shown somehow in the interface of the user profile?

    5. on general: when using ipn on test-mode with paypal test-site, does it take a while to get the confirmation back?

    I'll be happy to some code samples (or point me to which of the files contains those functions in the plugin).

    thanks!

    Posted 13 years ago on Friday February 25, 2011 | Permalink
  2. Here we go.

    1.
    The PayPal transactions are stored in a separate table. It is called wp_rg_paypal_transaction. It keeps all paypal transactions (i.e. payments, refunds, etc...)

    2.
    PayPal transactions are added as notes for that entry, so you can view all transactions by going through the entry notes on the entry detail page.
    To output all transactions in a different format, you would have to query the wp_rg_paypal_transaction table and manually output them.

    You add the "Payment Status", "Payment Amount" and "Payment Date" columns to the entry grid. Simply click the edit link on the top right corner of the entry grid and drag those columns to the active list.

    3.
    There is no easy function for you here, but it is possible to achieve what you need. If the user is logged in when submitting the form, the user_id is stored in the entry table (wp_rg_lead table, created_by column).
    If you query the wp_rg_lead table where created_by = user_id, you will get all entries submitted by that user. You can then inspect the payment_status column to determine if the product has been paid and you can determine which product was purchased by the form_id.
    If you need to get more information about which specific product was purchased, you can call RGFormsModel::get_lead($lead_id), where lead_id is the the ID column of the wp_rg_lead table. This will give you all the information about that entry.

    4.
    There is no interface in the user profile for this. When a subscription is expired, the entry's payment status will be set to "Expired". You can see that by adding the Payment Status to the entry grid, going to the entry detail page,
    or manually querying the wp_rg_lead table for the specific user_id (similar to 3) and inspecting the payment_status column.

    5.
    I have not had long delays with the test IPNs. They usually happen within a minute or two. If you are developing locally, however, the IPN just won't work since PayPal won't be able to reach http://localhost/....

    I hope this helps.

    Posted 13 years ago on Monday February 28, 2011 | Permalink