404 on payment completion (/confirm-checkout/) MarketPress/Events+

Subject says it all. Should I just create a page with that slug? I'd rather use an "official" method if there is one, but I cannot find any way to define the page in the store settings.

Thanks!
Arthur

  • Arthur

    Hi Ash,

    I'm still getting a 404 - it's on the PayFast option, Manual Payments work ok, yes. Steps are:

    1. Click buy now
    2. Click checkout
    3. Fill in the address details -> next steps
    4. Change payment method to PayFast
    5. On the PayFast screen click "confirm payment" -> redirect back to website

    That's when I get the 404:
    https://www.dropbox.com/s/psuxh84cesckrmb/Screenshot%202018-03-07%2014.32.33.png?dl=0

    Cheers,
    Arthur

  • Ash

    Ahh, I was checking with manual gateway.

    Payfast doesn't come with marketpress bundle, I think you are using by downloading from here: https://www.payfast.co.za/shopping-carts/market-press-ecommerce/

    It looks like the order complete URL you are getting is set somewhere. Maybe in payfast settings or it might be in the code. You can try by creating a page with same slug, though I am not 100% sure that it will work, but worth a try. Otherwise, you may need to talk to payfast mode support team.

    Let us know how it goes. Have a nice day!

    Cheers,
    Ash

  • Arthur

    Hi Ash,

    You're right, I installed the MarketPress plugin from the PayFast website.

    Well, I had a look round Payfast and in theory it should not be necessary to specify a URL - and there is certainly not a place for this setting. I will contact them to find out more, but meantime, I have created a page using the missing slug (setting /store/ as the parent page) and it seems to work. I can only assume that this final page was not created automagically as with the other pages so it may be a bug.

    Either way, both attendance and payment has been recorded, so hopefully we're good to go! (Now if I could just sort out the Twitter login...time for another ticket...:grimacing:!)

    I'll leave this open until I've talked to Payfast to record full resolution for future users.

    Cheers,
    Arthur

  • Arthur

    Going through old tickets and realised I haven't update this. PayFast seem to think that everything is working as it should. I am less than convinced, as the email confirmation says the payment is not yet complete and following the link to the order status gives an "Oops! we couldn't locate any orders matching that order number...etc". However, it does register the person for the event and I'm assuming that the payment, when in live mode, will be processed correctly - maybe this is the issue, though it's not a very realistic sandbox if that's the case!

    So I'll probably proceed with launch now anyway and deal with any customer queries if and when they arise (fingers crossed!).

    FYI the PayFast MarketPress "adaptor"/plugin actually changes the final page to /confirm-checkout/ - I guess this caused the 404 because MarketPress was expecting /order-complete/ and not /confirm-checkout/ which didn't exist.

    I'm in two minds whether to mark this as resolved as it's not fully resolved. I reckon it's PayFast's tweaking that's the problem, not EAB, but it might still be misleading to mark it as resolved and some clever people around here might be able to fix it. So I'll leave it for now and post an update once I have some live experience.

    Cheers,
    Arthur

  • Arthur

    Without delving into the code there doesn't seem to be a way to set the order complete page in MarketPresss, but either way, I suspect the FastPay add-on is interfering and, as you say, ignoring MarketPress settings at that key stage.

    I wonder if you guys could follow up with them since the conversation would be much more direct and meaningful? That would certainly help South African businesses (who I will be training and encouraging to use technology like this...!)

    Have a good one yourself!
    Arthur

  • Arthur

    Hi Ash,

    But Order Status is not the same. This comes after the completed payment. If I change that, there will be no order status page, as the confirm-checkout is a static page I created to return from PayFast.

    Not that this is necessarily a bad thing for the events, since there is no order status to show (and better not to show a misleading one). However, a) the email takes you to the order status page (to check the status) and people may click on it since the email says it's still in process and b) we may want to sell tangible goods such as books or merchandise in future which will require this functionality.

    Cheers,
    Arthur

    • Ash

      Hello Arthur

      a) Do you mean the email sent to the client? If so, you can change the content from the Store Settings > Notifications section.

      b) I think that plugin from payfast should adjust their checkout URL with marketpress. Would you please ask them to contact us if they need any help with information, hooks, documentation etc. We will be happy to provide any help that is needed. So, if they can fix the URL and align with marketpress order submit URL, I think it would work good together.

      Have a nice day!

      Cheers,
      Ash

  • Arthur

    Hi Ash,

    a) Yes, the email to the client. There are a few issues with changing the message, though I agree it would solve the immediate one.
    1. I want to keep payment information as it confirms how they've paid. The problem is that it includes this line, which is embedded in the function:

    Your payment for this order is not yet complete. Here is the latest status: April 11, 2018 - 10:27 am: Received

    2. If I remove the tracking info for this, as and when we send physical goods, we will want that link.

    b) I'll ask PayFast to get in touch about changing the URLs, let's hope they are willing to sort this out!

    Cheers,
    Arthur

    • Ash

      Hi Arthur

      b) Awesome :slight_smile:

      a)
      #1: As a workaround, please go to /wp-content/plugins/marketpress/includes/common/helpers.php line no from 261 to 266 and remove:

      $payment_info .= __( 'Your payment for this order is not yet complete. Here is the latest status:', 'mp' ) . "\n";
      			$statuses = $order->get_meta( 'mp_payment_info->status' );
      			krsort( $statuses ); //sort with latest status at the top
      			$status    = reset( $statuses );
      			$timestamp = key( $statuses );
      			$payment_info .= mp_format_date( $timestamp ) . ': ' . $status;

      #2: Why would you need to remove tracking info? I am sorry, I think missing something here.

      Have a nice day!

      Cheers,
      Ash

  • Arthur

    Hi Ash,

    Nice workaround, I'll test it on my dev site, but that should remove the confusion.

    Meaning I wouldn't need to remove the tracking info. The only reason I said that is because it follows on from the "payment not complete" message, which leads you to click on the order status link to find out why/what's happening (and the information that you're presented with doesn't help!). Of course, it's not relevant anyway for events, but I don't want to remove it, no, for its use in other types of order in due course.

    I'll let you know how it goes (and the conversation with PayFast).

    You too, man! :slight_smile:
    Arthur

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.