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.

Possible bug with PayPal add-on for pay-to-create-post forms?

  1. Following up on this post I created - Need help modifying the saved value of a custom taxonomy - I think the problem could be with the PayPal add-on.

    To recap: My form allows users to pay to create a 'ticket' custom post type from the front end. The problem was that the terms were not being properly saved on the resulting CPT.

    I tested the same form but without PayPal integration and it worked fine (Screenshot: http://skit.ch/ndf2). Tickets #107 and #108 were created by user John Doe without PayPal integration. Ticket #109 was created by John Doe as well but the Status, Priority and Type taxonomies were not saved. The author (Submitted by) was saved as the default post author, not John Doe who submitted the form.

    I also tested this against regular posts to rule out that the bug exists with Brad Vincent's GF + Custom Post Types plugin (screenshot: http://skit.ch/ndf3). Here we see that the categories and tags are applied and not left blank but post author is definitely wrong (should be John Doe).

    Anyway, I realized that leaving the "Create post only when payment is received" option unchecked will not cause the bug so that's what I'm doing at the moment.

    I'm just reporting this here so that you are aware of the problem. Hopefully you guys are able to fix this, and save someone else from making lots of payments to PayPal while trying to figure this out!

    Posted 7 years ago on Friday December 30, 2011 | Permalink
  2. Thanks for the info! This is a bug I was able to replicate and we are working on getting it resolved. It should be fixed by our next release (1.6.3).

    Posted 7 years ago on Monday January 23, 2012 | Permalink
  3. Jordi Damwichers
    Member

    I am facing the same issue still. I am on version 1.6.3.4 and the beta release 1.6.4 does not solve the problem either.

    I would like to not select the "Create post only when payment is received" option and instead give the Custom Post concept status. Then, after payment is completed, update the post status to published.

    How would I do that? Please give me some code ;-)

    Jordi

    Posted 7 years ago on Saturday April 28, 2012 | Permalink
  4. Jordi Damwichers
    Member

    Figured it out.

    I used the gform_paypal_fulfillment-filter to achieve this.

    function change_post_status($post_id,$status){
        $current_post = get_post( $post_id, 'ARRAY_A' );
        $current_post['post_status'] = $status;
        wp_update_post($current_post);
    }
    function update_post_status_after_payment($entry, $config, $transaction_id, $amount) {
    
        // get post_id from $entry
        $post_id = $entry['post_id'];
    	change_post_status($post_id,'publish');
    }
    add_action("gform_paypal_fulfillment", "update_post_status_after_payment", 10, 4);
    Posted 7 years ago on Saturday April 28, 2012 | Permalink

This topic has been resolved and has been closed to new replies.