Paypal Chained Payments Setup Error

Hello!

I've followed the excellent "marketpress-chained-payments-by-ozbod" pdf to setup Marketpress with paypal chained payments.

However, something isn't working right when I try to buy with my sandbox's buyer test account.

I've uploaded some screenshots to help you see what I'm talking about.

Thank you!
Bruno Coelho

  • bcoelho2000
    • Design Lord, Child of Thor

    P.S: As the update to WP 3.2 is concerned, should I pay attention to some details that could cause my current installation to break?

    I'm planning to backup my wp 3.0 folders and deploy the 3.2 files via FTP except my config. Anything else?

    Thank you!

  • Philip John
    • DEV MAN’s Apprentice

    Ah okay, I believe that this could be because you have Multisite installed in a sub-directory.

    I think I may have mentioned to you before in another thread that WP really doesn't handle being in a sub-directory well at all. I believe it may be that MP is sending the network site address to PayPal but that isn't the same as the domain or something along those lines.

    I'll ask the developer to comment but I strongly suggest you move to a root installation.

    Phil

  • bcoelho2000
    • Design Lord, Child of Thor

    Why do I believe that changing from subdirectory to root is going to be a painful process? :slight_smile: However, if you're sure that the subdirectory is causing this mess... I'll change it.

    Here's what I have now:
    /
    /home <-- this is my default wp single site at http://therabbitway.com
    /network <- this is a new service that I'm selling using Supporter.

    The idea is making "/home" (therabbitway.com) a launching platform for new products & services of TheRabbitWay.

    To implement your advice I need to:

    / <- install WP 3.2 MultiSite version. This will become my launching platform using, for example, the Product theme.

    Create a new site, called "Network" and use a BuddyPress theme, like the SocialTheme.

    If I do this I'll become a regular user from my own network...hence I have to become a Supporter to use my own paid features (I can solve this by extending the Network blog supporter status... but is there any other way to do this?).

    Today at therabbitway.com/network I can display my network global products, posts, members etc... after moving to root can I still do this? If a user wants to create a new blog inside my Network can he do it?

    Thank you once again.

  • Philip John
    • DEV MAN’s Apprentice

    Hiya,

    Yep it ain't gonna be super simple but we see so many issues with Multisite in subdirectories that it's best to bite the bullet now.

    You rightly assume that you'll need to make your new 'network' subsite a Supporter. That shouldn't be too much trouble though. I currently do that on one of my sites.

    You can still display a global products site, sure and people will still be able to join your network.

    Phil

  • bcoelho2000
    • Design Lord, Child of Thor

    Phil,

    One more thing: can you look at wpmu.network.design.JPG (attached file)? This is the wp setup that we talked about.

    Now here's some questions about this setup:

    a) anyone who becomes a paid supporter of TheRabbitWay.com gets access to TheRabbitWay.com/Network and all other services that I'll launch in the future, right? I don't want that because I need to offer different prices and conditions to the different TheRabbitWay's services.

    b) is it possible for a user to create "MySite" that is a child of "Network"? What's the difference between "Network" and "Mysite"? Aren't both child sites of TheRabbitWay root site?

    c) instead of being a registered user of the "Network" site, that user should register in TheRabbitWay, because TheRabbitWay is the root multisite, correct? This is weird in itself...

    That's why I created the setup described by wpmu.network.design.2.JPG. The only thing that I have to do, if I really need to install WP MU in root is to pay for a new hosting plan for "TheRabbitWay Network" that is independent of TheRabbitWay.

    I would really appreciate your experienced view about this plan.

    Thank you!

  • Philip John
    • DEV MAN’s Apprentice

    a) anyone who becomes a paid supporter of TheRabbitWay.com gets access to TheRabbitWay.com/Network and all other services that I'll launch in the future, right? I don't want that because I need to offer different prices and conditions to the different TheRabbitWay's services.

    You could do this with multiple levels using URL Groups to restrict access to the different services.

    b) is it possible for a user to create "MySite" that is a child of "Network"? What's the difference between "Network" and "Mysite"? Aren't both child sites of TheRabbitWay root site?

    That wouldn't be possible, no - all sites would be created on the same level as /network

    c) instead of being a registered user of the "Network" site, that user should register in TheRabbitWay, because TheRabbitWay is the root multisite, correct? This is weird in itself...

    Yes, that's correct.

    Having a separate multisite would complicate matters, but it's doable.

    Phil

  • bcoelho2000
    • Design Lord, Child of Thor

    Thank you Phil.

    This means that, if I really have to install WP @ root level I need to buy a new domain & hosting to implement my platform.

    Can I still expect an answer about the paypal chain error from the developer that you contacted or will I have to install my multisite network in the server's root and expect that all things will work?

  • bcoelho2000
    • Design Lord, Child of Thor

    Phil,

    I've found another thread https://premium.wpmudev.org/forums/topic/the-link-you-have-used-to-enter-the-paypal-system-is-invalid that talks about some major issues on paypal's sandbox vs supporter...

    The real question is this: does anyone followed the "marketpress-chained-payments-by-ozbod" manual and made it work on a WP Multisite install? As far as I know, it's required by X.com for us to have a fully functional sandbox marketpress test environment so they can approve our application.

  • ozbod
    • The Incredible Code Injector

    Hi,

    yes I can confirm that I have chained payments working on a multisite install that I am developing.

    I have moved it out of sandbox and it's live, I have tested the chained payments by setting up a test product for 10pence on one of the network sites, got a friend to purchase it, then we checked the sellers paypal account and she received the full 10 pence, then the next entry in her paypal was a payment out to me for 1pence, which is correct as we set the commission level at 10%.

    So in a nushell it does work.

    I still have much developement to do on this network.

    One thing to keep in mind, make sure you have both a paypal business and personal email address becsue when a purchase is made both the network admins paypal address and the buyers address is sent to paypal. I spent ages trying to get my head around this! I realised the problem when I was testing, I was using my paypal business email to try and make a purchase off a network site and it wouldnt work because both the network admin address and the adress I was using to make the purchase were the same.

    I hope this allays your fears

    Cheers

    Dave

  • bcoelho2000
    • Design Lord, Child of Thor

    Dave,

    Thank you for your feedback!

    It's reassuring that the live paypal chained payments on multisite setup does work.

    However, my problem is getting the sandbox setup to work so X.com can validate my application... How did you accomplish that in your Multisite network? I've followed your fantastic pdf manual but I'm still getting the errors described in the beginning of this post. Did you made it

    Phil told me to move my WP Multisite from a subdirectory to root... but I'm wondering if this will solve the sandbox issue... I'm still waiting for a developer to reply to my questions...

  • ozbod
    • The Incredible Code Injector

    Hi Phil may be correct, my set up is in the root and once I figured out the stuff I wrote about in the PDF it was pretty much plain sailing after that, in fact it only took a couple of weeks to get the app aprroved from start to finish.

    I will look at this whole thread in more detail over the weekend and see if there is anything I can see where I might be able to help you.

    Cheers

    Dave

  • bcoelho2000
    • Design Lord, Child of Thor

    Just to let you know that I've successfully upgraded to WP 3.2.1 and I'm still having problems with MarketPress vs Paypal's Sandbox Chained Recurring payments...

    @Dave just to be clear: in your chained payments did you used recurring payments or single payments?

    My only option right now, since I didn't get any reply from the development team, is to follow Phi's advice, reinstall WP in the root directory and pray to the gods that PayPal Sandbox & Marketpress will start to work...

  • ozbod
    • The Incredible Code Injector

    @bcoelho2000

    where are the settings for recurring payments or single payments, I ahve just looked in the ADMIN and storeowners setting and can't find these settings in MP, I am only using MP and don't have supporter or any other membership plugins installed

    Cheers

    Dave

  • bcoelho2000
    • Design Lord, Child of Thor

    @Phil: Just finished installing WP Multisite on root directory and... MarketPress still isn't working with PayPal's Sandbox... clearly the problem isn't where WP is installed but how PayPal's Sandbox is integrated in Marketpress.

    I need to make this work as soon as possible so I can send my application to X.com for approval.

    @Ozbod: Login as Network Admin -> Settings -> MarketPress and then scroll down.

  • ozbod
    • The Incredible Code Injector

    Hey,

    this really wierd because I really do not have any setting to do with recurring payments or single payments, I even used the browser search facility in case my old eyes were deceiving me but no those setting are not visible.

    I dont know if this helps, but under Gatway Settings, all are set to "No Access" apart from PayPal Chained Payments which is set to "all can access".

    I know this might sound a bit daft, but when you are pasteing in the credential from the sandbox are you first pasteing them into notepad to ensure you have no extra spaces at the end of the strings, this has caught me out more than once and will stop things working.

    Really confused about the recurring payments or single payments as I haven't got options for them at all.

    MP v 2.1.3
    WP v 3.2.1 MU

    Hope this helps

    Dave

  • ozbod
    • The Incredible Code Injector

    Further to this Ijust went and checked Site Admin, went to:

    products > store setting > payments and the only options in here are to select a payment gateway, at the moment I have none selected.

    then I went to a network store products > store setting > payments

    General settings PayPal box is ticked

    Pay Pal currency is set to my currency (GBP in my case)

    PayPal mode is set to live in my case, you should be set to sandbox at this stage

    Pay pal emial address, this has the store owners pay pal address, in your case it would be a sandbox address so that you can receive payments into the sadbox sellers account.

    I hope this helps and do appreciate how frustrating this set up is, that is why I kept notes and wrote that pdf

    Just persevere you will get there there is no reason why you shouldn't!
    Cheers

    Dave

  • bcoelho2000
    • Design Lord, Child of Thor

    I'm sorry Dave. It wasn't an Marketpress option but the type of product you were buying (single or recurring payment).

    "I dont know if this helps, but under Gatway Settings, all are set to "No Access" apart from PayPal Chained Payments which is set to "all can access"." Yep. Just like you wrote on your manual that I've followed step by step... the only thing that might be happening is PayPal changing how Sandbox is handling chained payments...

    Dave, can you just confirm that you still have Marketpress working in the Sandbox setup?

    MP v 2.1.3
    WP v 3.2.1 MU

  • bcoelho2000
    • Design Lord, Child of Thor

    I just created a step by step pdf showing my setup and how I'm testing my marketplace... I believe that I followed Dave's steps but maybe I'm missing something... or maybe is PayPal's sandbox that's broken...

    Anyway here's the attached file: MarketPressVsPaypal.pdf.

  • ozbod
    • The Incredible Code Injector

    Hi,

    I noticed from your pdf that you also have Supporter installed, I honestly do not know if that will have any effect on chained payments or not as I haven't used Supporter.

    Maybe you could deactivate Supporter and try again at least it woud rule that out if its still the same.

    I could well be wrong in what I am about to say to you, but just my thoughts.

    MP I would think would be working with single payments for a purchase whereas Supporter would work with either single or recurring payments for a single subscription or a recurring monthy subscription for example. I don't know if the two are compatible or not, thats why i suggested deactivating Supporter just to test.

    I wish I had more time at the moment to delve into this deeper but I have oter things calling me away right now, but I will continue following your progress and jump in where I can.

    Cheers

    Dave

  • bcoelho2000
    • Design Lord, Child of Thor

    A couple more ideas so we can figure it out why this is not working:

    a) what if the paypal's sandbox app id, that Marketpress is using, expired or something?

    $this->appId = 'APP-80W284485P519543T'; //this is PayPals generic test app id for sandbox

    b) how can Marketpress show more debug information from Paypal when things go wrong? This would help talking with their support team...

    c) does anyone, right now, got the MarketPress with Paypal chained payments solution working in a sandbox setup?

    Paypal is known for changing their code without notifying anyone... I'm betting that this is one of those cases... can MarketPress dev/support team check this?

    Thank you!

  • bcoelho2000
    • Design Lord, Child of Thor

    Another strange thing that I noticed in the \wp-content\plugins\marketpress\marketpress-includes\plugins-gateway\paypal-chained-payments.php file.

    function api_call($methodName, $nvpStr) adds "X-PAYPAL-REQUEST-RESPONSE-FORMAT" to the headers... however, in PayPal's adaptative payments reference they use "X-PAYPAL-RESPONSE-DATA-FORMAT"

    Any reason for this mismatch?

  • bcoelho2000
    • Design Lord, Child of Thor

    Here's what Marketpress is sending to PayPal...

    Notice anything wrong here?

    actionType=PAY&
    returnUrl=http://therabbitway.com/psicodigital/store/shopping-cart/confirmation/&
    cancelUrl=http://therabbitway.com/psicodigital/store/shopping-cart/checkout/?cancel=1&
    ipnNotificationUrl=http://therabbitway.com/psicodigital/store/payment-return/paypal-chained&
    currencyCode=EUR&
    feesPayer=PRIMARYRECEIVER&
    trackingId=189224d4d766&
    memo=PsicoDigital+Store+Purchase+-+Order+ID%3A+189224d4d766&
    receiverList.receiver(0).email=seller_1311697317_biz%40gmail.com&
    receiverList.receiver(0).amount=47&
    receiverList.receiver(0).invoiceId=189224d4d766&
    receiverList.receiver(0).paymentType=GOODS&
    receiverList.receiver(0).primary=true&
    receiverList.receiver(1).email=me_1311981478_biz%40gmail.com&
    receiverList.receiver(1).amount=4.7&
    receiverList.receiver(1).paymentType=SERVICE&
    receiverList.receiver(1).primary=false
  • ozbod
    • The Incredible Code Injector

    Hi,

    I am thinking you need a deeper level of technical help that I can offer you here, it's time for you to request support from PayPal which in my experience is pretty good and help from the Devs here at WPMU.

    I am really pleased that the Supporter plugin wasn't the problem, but it was an easy way of checking it wasn't causeing the issues you have.

    Good luck

    Cheers

    Dave

  • bcoelho2000
    • Design Lord, Child of Thor

    Good morning Dave! I really appreciated your help.

    My point is this: right now, anyone who downloads and installs MarketPress won't be able to use PayPal's chained payments in sandbox mode... in spite of what's promoted at https://premium.wpmudev.org/project/e-commerce

    Use our advanced Adaptive Payments gateway - Take a predetermined percentage fee of all store sales on your network! Completely automated and invisible to store customers."

    @WPMUDEV: How do you plan to fix this?

    Yesterday I posted this issue at the X Developer Network forum: https://www.x.com/message/21423

    As for the WPMU developers help... Phil requested dev support on 27th July but I didn't got a reply since... Since I posted this topic, the official support I got was:
    - upgrade wordpress
    - move your wordpress to root
    And Marketpress + PayPal chained payments on Sandbox feature is still broken.

  • ozbod
    • The Incredible Code Injector

    Hi I can feel your frustrations and believe me if I could help you further I would, I hope that you get a response from a DEV soon as this does need to be sorted out if there is a problem.

    I can tell you though that the support I have had from WPMU has always been nothing short of excellent from both Phil and David but you do have to wait a little while for the DEVS to become involved, I am sure this because they are super busy writing upgrades and other stuff.

    Just hang in there, I always find it's best to find something else to do and wait for a response, as tinckering can make things worse! I am sure Phil or David will pick this up and do whatever is required at the WPMU end to get things moving for you.

    The only other thing I can think of is if you have a spare domain could you try an installation on there, just to make sure your original one isn't broken in some way.

    Good luck my friend

    Dave

  • bcoelho2000
    • Design Lord, Child of Thor

    Latest news from PayPal support:

    "Hi Bruno,
    I was able to reproduce this with one of my own senders account. The issue is being caused because you are using currency Code EUR and the receivers do not have a EUR balance. With chained payments the recievers need to have a balance in the currency the payment is being sent in."

    I will test this and update this thread.

  • bcoelho2000
    • Design Lord, Child of Thor

    !!! Issue resolved !!!

    Lesson learned: if you need to test chained payments in PayPal's sandbox make sure that you set the currency in all stores/products to USD $.

    @Dave: Can you add this information to your manual? Another thing... your step-by-step guide should be promoted to the WPMUDEV's Manual area!

  • ozbod
    • The Incredible Code Injector

    Bruno,

    so sorry, I MUST have had a problem with this as well at the time, resolved it and then forgotten about it, but yes this will be a very important update to the "How to" and I will add this information.

    I have just revisited my Sandbox account and all the test account in there were set to GBP with GBP balances, so maybe I didn't come across this problem after all, but yes I will make sure it gest added into the pdf.

    Something like:

    Ensure that your Pay pal Sandbox accounts are in the same currency as the currency set up in your Market Press, eg GBP, also ensure that your Sandbox receiver account has a balance in the currency you selected in Market Press before you start testing

    I am so pleased that you have got this resolved now and can move on.

    David, Phil, I will edit the PDF, let me know how to get this across to you again please

    Thanks

    Dave

  • ozbod
    • The Incredible Code Injector

    Hi Phil,

    I am ging to update the PDF with this info and a nother snippet I realised after I had gone live this being:

    that both sellers paypal address and the buyuers address are sent to pay pal when making a purchase, this caused me some headaches until I realised for testing puposes when live that you need to have both a business email with pay pall and a personal email with paypal otherwsie you just go round in circles.

    Can you tell me how to send the reviesed PDF to you again please as I have foirgotten how we did it last time

    Ta

    Dave

  • bcoelho2000
    • Design Lord, Child of Thor

    Another reply from PayPal support:

    "To clarify: When you make the Pay API call, one of the parameters that you specify is currencyCode.

    This can be any of the supported currencies (Page 76 of the Adaptive Payments developers guide: [ https://cms.paypal.com/cms_content/US/en_US/files/developer/PP_AdaptivePayments.pdf ]).

    The only requirement that chained payment has, is that the primary receiver holds the specified currency in his account.

    i.e. If you specify EUR as currency code, the primary receiver must also have EUR as a holding currency."

    This means that the Seller's PayPal account currency code should match the one defined by the Seller in MarketPress settings!

  • ozbod
    • The Incredible Code Injector

    This pretty much clarifies what you said earlier but it could get interesting if you have sellers from many different countries in your network and for the Network Owner, does this mean that he has to have currencies to match those of the sellers in his network too, I wonder.
    This could get very interesting

    Will get the PDF altered tomorrow and them semd it Phil

    Cheers

    Dave

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.