Membership Plugin

WordPress Membership Plugin

  • Home
  • Documentation
  • Addons
  • Support
    • Quick Setup
    • Documentation
    • Premium Addon Support
    • Paid Support
    • Support Forum
    • Support Forum Search
    • Forum Login
    • Forum Registration
  • Contact

[Resolved] Is it possible to access payment transactions via API

Simple Membership Plugin › Forums › Simple Membership Plugin › Is it possible to access payment transactions via API

Tagged: api, payments

  • This topic has 4 replies, 2 voices, and was last updated 2 years, 8 months ago by Somedev.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • September 27, 2023 at 2:55 pm #27220
    Somedev
    Participant

    Hi guys.
    I see in the documentation that one can access, create and update the member details via the API, but I actually need to access the payments, so based on that to be able to do some other actions depending if members’ subscriptions are paid or not.
    So, is there a way via the API to read the payments?
    This is the admin page: /wp-admin/admin.php?page=simple_wp_membership_payments
    Thank you so much for any help!

    September 28, 2023 at 1:26 am #27225
    The Assurer
    Moderator

    Payment history is maintained by whatever payment gateway you select. SWPM only has no knowledge of the payment types or amounts paid. It only has knowledge of successful payments.

    September 28, 2023 at 6:12 am #27228
    Somedev
    Participant

    Thanks a lot for the quick reply.
    I see, but just to clarify, how are the listings in the “Simple Membership::Payments” admin page recorded? Are they not created when let’s say a paypal payment happens?
    That’s actually important to clearly establish, because if those are synced with the real payments, then all you need is to access the payment records in there which I presume are saved in the DB.
    In the DB I saw there is a “wp_swpm_payments_tbl” table that seems to hold those payment records.
    Can you please confirm or not that those are the correct payments recorded? Cause that would be another good way to get them.
    Thanks a lot!

    September 29, 2023 at 1:51 am #27232
    The Assurer
    Moderator

    The table you are referring to has the following structure:

    
           $sql = "CREATE TABLE " . $wpdb->prefix . "swpm_payments_tbl (
                        id int(12) NOT NULL PRIMARY KEY AUTO_INCREMENT,
                        email varchar(255) DEFAULT NULL,
                        first_name varchar(64) DEFAULT '',
                        last_name varchar(64) DEFAULT '',
                        member_id varchar(16) DEFAULT '',
                        membership_level varchar(64) DEFAULT '',
                        txn_date date NOT NULL default '0000-00-00',
                        txn_id varchar(255) NOT NULL default '',
                        subscr_id varchar(255) NOT NULL default '',
                        reference varchar(255) NOT NULL default '',
                        payment_amount varchar(32) NOT NULL default '',
                        gateway varchar(32) DEFAULT '',
                        status varchar(255) DEFAULT '',
                        ip_address varchar(128) default ''
                        )" . $charset_collate . ";";
    

    The payment_amount is the gross amount (before fees) the member paid. The entries are created at the time the payment IPN is received, from the payment gateway.

    Disclaimer: If you are seeking records that will withstand the scrutiny of a financial audit; it is best to match up the transaction IDs recorded in the table, against the payment amounts on the chosen payment gateway.

    September 29, 2023 at 10:36 am #27240
    Somedev
    Participant

    That’s so much clearer. Thanks a lot for the detailed description!
    It looks like it should be fairly OK to check that table for the payments, but I think then it’s a bit better to check the paypal API for the actual monthly payments to be on the safe side.
    And the swpm_payments_tbl would be for cross reference and WP visual admin utility, which is very helpful too.
    OK, thanks again! I think I’ll research a bit of paypal api.
    Have a great day!

  • Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
Log In

Please read this message before using our plugin.

Search

Featured Addons and Extensions

  • Membership Form Builder Addon
  • Member Directory Listing Addon
  • WooCommerce Payment Integration
  • Member Data Exporter Addon

Documentation

  • Documentation Index Page

Copyright © 2026 | Simple Membership Plugin | Privacy Policy