GithubHelp home page GithubHelp logo

Comments (8)

kovshenin avatar kovshenin commented on September 26, 2024

Is that a manual confirmation or can it trigger an HTTP call like the PayPal API would? If not, then I guess you'll have to extend the user interface, perhaps add a confirm/deny button to the attendees screen.

from camptix.

Kargha avatar Kargha commented on September 26, 2024

Right now it's a very straight forward payment system. Just select the ticket(s) you want and then select "Wire transfer" in the list of payment methods. The actual information for the wire transfer itself is sent as part of the confirmation e-mail (essentially they just use it to book a ticket).

They then transfer it, the treasurer confirms the payment should then click a "Payment Received" button or something of that nature that changes the payment status to "Completed". Not quite certain where in the code I would modify to extend the attendee interface.

from camptix.

kovshenin avatar kovshenin commented on September 26, 2024

You would probably add a metabox to the edit attendee page containing the button.

from camptix.

Kargha avatar Kargha commented on September 26, 2024

Thanks mate, managed to figure it out. One question. At the moment I added it inside of the camptix.php. Would it be possible to call this from an addon as well?

from camptix.

kovshenin avatar kovshenin commented on September 26, 2024

Sure, you can call it from an addon file or a third party plugin.

from camptix.

karlusy avatar karlusy commented on September 26, 2024

Hi Kargha,

I have the same problem you had. Would you share your solution?
I'm not that code proficient. Thanks.

from camptix.

Kargha avatar Kargha commented on September 26, 2024

Hi karlusy,

My version is not very elegant and it's put into the camptix.php which isn't very efficient as, if you'd update the camptix plug-in, then the changes will be lost.

In camptix.php, add the following function:

    /**  
     * Generates a drop-down to set ticket status to either "pending" or "completed"     
     */
    function metabox_attendee_payment_approval() {
        global $post;
        $ticket_id = get_post_meta( $post->ID, 'tix_ticket_id', true );
        $ticket = get_post( $ticket_id );
        ?>
        <p>Current Status: <?php echo $post->post_status; ?></p>
        <p>Change Status to: </p>
        <select id="payment_status" name="payment_status">
            <option value="pending">Pending</option>
            <option value="publish">Completed</option>
        </select>
    <?php
    }

Then, in the function "save_attendee_post", before the following line:

add_action( 'save_post', array( $this, __FUNCTION__ ) );

add

        if(isset($_POST['payment_status']))
        {
            wp_update_post( array(
                'ID' => $post_id,
                'post_status' => $_POST['payment_status'],
            ) );
        }

This will take care of the functionality of getting the data from the drop-down to actually update the status of the attendee.

Finally, you need to add the following line inside the "add_meta_boxes" function in order for the metabox with the dropdown to show up:

        add_meta_box( 'tix_payment_info', __( 'Payment Information', 'camptix' ), array( $this, 'metabox_attendee_payment_approval' ), 'tix_attendee', 'side' );

You should modify this code to fit your needs, as well as move it outside of the camptix.php so it doesn't disappear.

from camptix.

karlusy avatar karlusy commented on September 26, 2024

Fantastic! Thank you for your quick reply. I'll give it a try.

Thanks also to the developers of camptix for providing such a nice plugin.

from camptix.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.