Customer not added as a student to the course

Course on the site is sold via MarketPress with PayPal Express configured. When a student signs up he/she are asked either to login using an existing account or to create a new account. However, while the transaction is completed in PayPal (payment is made). The customer is not being added to a course as a student and no account seems to be created.

  • Predrag Dubajic

    Hi Ido,

    Hope you're well :slight_smile:

    I was doing some extensive testing with MarketPress and CoursePress, even with Israel PP sandbox account but I was unable to replicate this issue I'm afraid.

    Is it ok if we switch to sandbox account temporarily on your site so we can perform couple of tests there?
    We will of course restore to live account after we finish with testing.

    Best regards,
    Predrag

  • ido

    Hi Predrag,

    I've just tested again.

    1. When directed to paypal form cart – I get to a page that don’t have my details (so it is unclear if paying for the right product or the right price)

    2. After payment is done – I'm redirected to the same cart page, and asked to "confirm your order details and click submit order" see pic 1

    a. The btn says "you will be charged upon clicking" – and that is after I was all done and paid for on paypal. See pic 2

    3. When I click the "submit order" btn – I get to a Download page. see pic 3

    a. When I'm sent back from paypal I'm registered and logged in, but the only clue for that is the WP black bar, papule will not see that. And no emails are sent to client.

    4. And last… the course is on a subdomain. And if I go thru the "forgot my password" I am redirected to the main site and that’s not working.

    Sorry about all the mess,
    Hop you can help me sort all that up.

    P.S.- you can shift to sandbox or whatever you need.

    Thanks in advance
    Ido

  • Predrag Dubajic

    Hi Ido,

    Thanks for the additional info, I did some tests with sandbox details and I must say that I'm not sure what is the actual issue here because the process worked fine for me.

    When I finished with payment on PayPal I was redirected back to your site in order to confirm the order (Pic 2 from your comment), and this doesn't mean that I was billed again, it's just to confirm the purchase.

    After that I was added as a student to course and when I visited it I was able to access its units without any issues.

    Only issue that I did notice is that I didn't receive email about my enrollment in the course, however this doesn't seem to be the issue with CoursePress because it looks like emails on your site are not working at all.
    I tried creating new user from backend and that by default sends confirmation email but I didn't receive that as well.
    This is why reset password isn't working either.

    This might be best discussed with your hosting provider so they can check the logs and see why the emails are not going through.

    One thing you could try is create email with your domain, for example something@rampa.online, and use that email as main email in your WordPress settings.
    Some servers send emails only if their email address is used so this might do the trick.

    Best regards,
    Predrag

    • ido

      Hi Predrag,
      Thanks for everything.
      please note that the first point is happening in live mode and not sendbox

      1. The PayPal page don’t have my details or the order summary on it (I've only seen it once on sandbox test)

      2. After confirm the purchase students are sent to the "Order Status" page – is there a way to edit only this part [mp_order_status] on that page (in red ) - It is set for "Digital Download" – I can't find a better option for Coursepress pro

      3. My invoice service uses notification from PayPal (IPN) and my settings in PayPal gets override and the notification are sent to the site instead.
      To fix it they told me to Search in my site for IPN settings – I didn’t find it.
      Another option is if field named {notify_url} is sent to PayPal it overrides the IPN settings I've entered in PayPal.
      Adam said that the new version of the plugin is not using that method.

      Thanks again for everything
      ido

  • Predrag Dubajic

    Hi Ido,

    1. The PayPal page don’t have my details or the order summary on it (I've only seen it once on sandbox test)

    This is handled by PayPal and their checkout page depends on the API and location so there's not much we can do here.
    When I test on my end with Israel sandbox account I'm getting the same thing as on right side of that attached image.
    If you login with your PayPal account it will still show the summary of your purchase before confirming the purchase.

    2. After confirm the purchase students are sent to the "Order Status" page – is there a way to edit only this part [mp_order_status] on that page (in red ) - It is set for "Digital Download" – I can't find a better option for Coursepress pro

    You can also sell courses as physical items and that would remove the download button, but I'm guessing you're using Digital Download in order to hide the additional checkout fields that physical products have?
    In that case you can hide the download link with some simple CSS like this one:

    .mp_order_cart .mp_cart_item_content.mp_cart_item_content-title > a {
        display: none;
    }

    WordPress offers Custom CSS field inside Appearance > Customizer but if your theme disables this and it doesn't have its own CSS field you may wish to use a child theme or a plugin like this one for this additional CSS. That way you're protected when you come to upgrade.

    And then go to CoursePress > Settings > MarketPress tab and enable "Redirect MarketPress product post to a parent course post" option, that will redirect the product directly to course.

    3. My invoice service uses notification from PayPal (IPN) and my settings in PayPal gets override and the notification are sent to the site instead.

    Are you referring to emails not sending?
    As I mentioned before this is not plugin related because none of your WordPress emails are working and that needs to be sorted out first so that CoursePress can send emails as well.

    Best regards,
    Predrag

    • ido

      Hi Predrag,
      Thank you for your replay.

      1. For some reason the sandbox works differently. But you don't need sandbox to reproduce this, just go thru the live purchase until the PayPal page and stop.
      You'll see that you don’t get the summary of your purchase and not even the price. Because their checkout page depends on the API I think there is something wrong on our side.

      2. Your right I wont to keep it as short as possible. I use a child theme and I think the solution you offered will work.

      3. No, it's not the emails.
      In my PayPal account I setup IPN (instant Payment Notifications) according to instructions I got from form the invoice provider, (this way they get instant notification from PayPal and issue the invoices directly to customers and handle the accounting and…).
      When invoices were not issued we found that the provider don't get the notifications and that my settings in PayPal gets override and the notifications are sent to the site. (as you can see in the next picture)

      the invoice provider told me to search for IPN settings and I didn’t find any.
      Another option is if field named –notify url-- is sent to PayPal it overrides the IPN settings entered in PayPal.

      Whatever the issue is, it probably has to do with MarketPress and not CoursePress but I'm not sure.

      Thank you very much a gain.
      Ido

  • Predrag Dubajic

    Hi Ido,

    1. For some reason the sandbox works differently. But you don't need sandbox to reproduce this, just go thru the live purchase until the PayPal page and stop.
    You'll see that you don’t get the summary of your purchase and not even the price. Because their checkout page depends on the API I think there is something wrong on our side.

    I'm afraid that I'm not understanding this because I don't see anything wrong with the process.
    When you go to PayPal you are just using it to login with your payment account, you are then redirected back to your site where the payment needs to be confirmed and that contains all the details about the price, there's no payment being done before this is confirmed.
    After you confirm the payment there then it sends another request to PayPal to finish the payment.

    About the #3, MarketPress does use IPN but it sets it dynamically, there's no option to change it in plugin itself.
    If you want to point your PayPal IPN to different address you will probably need to use third party solution for IPN forwarding, something like this for example: https://github.com/cferdinandi/gmt-paypal-ipn-forwarder

    Best regards,
    Predrag

  • ido

    Hi Predrag,

    Thank you for your replay.

    Let's only try to solve #3, this is the part that’s holding me back from lunching.

    I followed your advice and install the third party solution for IPN forwarding.

    But I end up with the same problem unless we can setup MarketPress to get the notifications from that third party solution.

    You said that MarketPress does use IPN but it sets it dynamically.

    Paypal are saying that "In this case, PayPal sends the IPN message to the listener specified in the notification URL for a specific button or API operation instead of the listener specified in your Profile." Here

    PayPal only send out one IPN message per event. The plugin you suggested takes that one message and sends it to as many locations as needed. But it must be the one receiving the original messages from PayPal.

    Thanks in advance
    Ido

  • Predrag Dubajic

    Hi Ido,

    We didn't quite have such requests before and since both MarketPress and your Invoice service require IPN from PayPal but PayPal allows only one IPN notification it will require some kind of IPN forwarder to get this working.

    I will need to discuss this further with our developers to see what could be done here so I have forwarded your thread to them for further info.
    Please note that, developer response might be slower than usual staff response, so we appreciate your patience on this.

    Best regards,
    Predrag

  • Ivan

    Hi @ido!

    If you want to send two (or more) IPN URLs - you can install and activate these plugins : https://github.com/cferdinandi/gmt-paypal-ipn-forwarder and https://wordpress.org/plugins/paypal-ipn/
    Then you should set these IPN URLs via Admin Area (WP Dashboard -> Settings -> PayPal IPN Forwarder) If you use PayPal Express it will look like

    Then you could try adding the following snippet in a mu-plugin

    <?php
    function wpmu_marketpress_change_ipn_url( $ipn_url , $plugin_name ) {
    	if ( 'paypal_express' === $plugin_name  ) {
    		$ipn_url = '{yourdomain.com}?action=ipn_handler';
    	}
        return $ipn_url;
    }
    
    add_filter( 'mp_gateway_api/ipn_url', 'wpmu_marketpress_change_ipn_url', 10, 2 );

    Note: change {yourdomain.com} to your real site.

    And please, open {wordpress_folder}/wp-content/plugins/marketpress/includes/common/payment-gateways/class-mp-gateway-api.php file via FTP and replace this line (approximately 303rd line)
    $this->ipn_url = admin_url( 'admin-ajax.php?action=mp_process_ipn_return_' . $this->plugin_name );
    to

    $ipn_url = admin_url( 'admin-ajax.php?action=mp_process_ipn_return_' . $this->plugin_name );
    $this->ipn_url = apply_filters( 'mp_gateway_api/ipn_url', $ipn_url , $this->plugin_name );

    I will also ping our developer to implement this change to the plugin.

    Let me know how it goes for you.

    Best regards,
    Ivan.

  • ido

    Hi Ivan,
    I've followed your instructions but for some reason it is still not working.
    Here is what I have:
    The snippet was add using the snippet plugin (this might be the reason – it is in function.php and not in the plugin, I don’t know how to get it in to the MP plugin)

    line 303 was replaced

    The URLs are set in Admin Area IPN Forwarder

    The settings in PayPal is correct

    And still the notification was sent to the original URL plugin.

    Thanks a lot
    Ido.

  • Ivan

    Hi ido !

    Just FYI, how to create MU plugins you can see here.
    But it's OK if this snippet is in function.php of your CURRENT theme.
    I'm sorry, I found my mistake there. Please, replace this line
    if ( 'paypal_express' === $ipn_url ) {
    to this one
    if ( 'paypal_express' === $plugin_name ) {
    I also have edited it in my previous message.
    Also, you didn't replace {your_domain} to real site in this snippet!!!

    And just FYI - The IPN setting in PayPal won't work because our plugin passes IPN URL for each payment. So, this setting won't apply.

    Best regards,
    Ivan.

  • ido

    Hey Ivan,
    I can think of two reasons for this not to work:

    1. I'm using the add-on for MarketPress you posted on a different support ticket that add a way to activate / cancel MarketPress emails.
    That add-on created a second MarketPress plugin on my installation

    2. The setup is a multi-site, and I activate some of the plugins on the sub-site only.

    P.S. – I don’t mind paying for someone to solve this issue, but ide radder it be someone from WPMU so that the fix will be well done and permanent and will not make a mess on the next MarketPress update.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.