appointments+ & marketpress autoconfirm manual payments

Having a very similar issue to this one:

https://premium.wpmudev.org/forums/topic/appointments-and-marketpress-manual-payment-question#post-810077

I'm using marketpress for payment gateways, we want a manual payment option that automatically confirms (b/c the person will be paying upon arrival).

I tried the membership suggestion listed in the thread I linked to, but despite checking to allow a certain membership level to not have to put a deposit down in my appointments settings, it still throws the appointment into "pending."

Another membership related question that I was failing at figuring out. Can you automatically put anyone who registers into a certain access level? The second question is moot if the first question doesn't actually work as a solution.

  • Michelle Shull

    Hey there, Ali!

    As far as I know, there's not currently a system or a known workaround to automatically approve manual payments.

    How about I give second level support a holler here and see if they can whip up a simple solution for you.

    On your second question - Yes! With membership, you can set a default subscription for new site subscribers. It's on the first tab of Membership's settings.

    Thanks!

  • Jude

    He there Ali,

    I missed the MarketPress checkout process when I gave you that code. After studying the code of both plugins. I think the best way to get this working would be to add some code to the manual-payment.php file. It has a function order_confirmation which is a placeholder for specifically this purpose.

    You can copy paste this code and it should do the trick.

    /**
       * Runs before page load incase you need to run any scripts before loading the success message page
       */
    function order_confirmation($order) {
          global $appointments ;
          if ( isset( $_COOKIE["wpmudev_appointments"] ) ):
              $apps = unserialize( stripslashes( $_COOKIE["wpmudev_appointments"] ) );
              $apps = array_values(array_filter(array_map('intval', $apps)));
                  foreach ($apps as $id) {
                      $a = $appointments->get_app($id);
                      if('pending' === $a->status)
                          $appointments->change_status('confirmed',$id);
                  }
          endif;
      }

    Let me know if it serves your purposes

    Cheers
    Jude

  • Ali

    awesome! this was REALLY helpful. I just made a slight adjustment to it to send out the appointment confirmation emails and now it works perfectly.

    function order_confirmation($order) {
          global $appointments ;
          if ( isset( $_COOKIE["wpmudev_appointments"] ) ):
              $apps = unserialize( stripslashes( $_COOKIE["wpmudev_appointments"] ) );
              $apps = array_values(array_filter(array_map('intval', $apps)));
                  foreach ($apps as $id) {
                      $a = $appointments->get_app($id);
                      if('pending' === $a->status){
                          $appointments->change_status('confirmed',$id);
                          $appointments->send_confirmation($id);
                      }
                  }
          endif;
      }
  • Jude

    Hi there @Kieran

    Would I currently have to overwrite my manual-payment.php file with every appointments+ upgrade?

    This functionality is not standard behavior. Many members would prefer to manually verify payments from this gateway before processing the order/appointment. That with no mention of spammers. So as of now you'll need to do this at every update.

    I will mark this as a feature request and we'll definitely consider it if many members request it.

    Cheers
    Jude

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.