Home Forums WC Vendors Free Support Jamie Question – PayPal Chained Payments

NOTICE: We've Moved to a Ticket System for Support

As of August 31, 2017 (12am EST) our support forums will be retired (read-only), and we will be moving to a support ticket system.  This will allow us to better organize and answer support requests, and provide a more personalized experience as we assist our customers.

For the time being, we will leave our forums open for reading and learning while we work on creating a more robust Knowledge Base for everyone to use.

If you are a WC Vendors Pro customer please open a support ticket here. 

If you are a WC Vendors user please open a support ticket on the Wordpress.org forums.

The information on this forum is outdated and in most instances no longer relevant. Please be sure to check our documentation for the most up to date information.

https://docs.wcvendors.com/

Thank you to all of our customers!

 

  • This topic has 32 replies, 8 voices, and was last updated 6 years ago by aand.
Viewing 33 posts - 1 through 33 (of 33 total)
  • Author
    Posts
  • #304
    sunay
    Participant

    I posted this on the other topic which is marked as resolved. Not sure if you see resolved topic comments, so I am posting here as new.

    Jamie, do you happen to have the updated code for the paypal_ap.php? to get the chained payments going with the new plugin?
    There are some wc_product_vendor references, aside from the Product_Vendor that you mention in the download instruction. I am not sure if those are supposed to change as well, or stay as they are.
    Here is what I currently have that used to overwrite Matt’s paypal_ap.php. This code was provided by Matt on his forum.

    • This topic was modified 8 years, 5 months ago by Jamie. Reason: Fixing code highlighting
    • This topic was modified 8 years, 5 months ago by Jamie.
    #324
    sunay
    Participant

    In an effort to fix this myself, here is what I have tried so far, unfortunately with no success.

    Downloaded Matt’s suggested patch for chained payments from http://support.mgates.me/discussions/woocommerce/613-request-for-chained-payments/page/1″

    To modify for WC Vendors I manually replaced:

    wc_product_vendor to wcvendors
    Product_Vendor to WC_Vendors
    PV_Commission to WCV_Commission
    PV_Vendors to WCV_Vendors

    Uploaded the new paypal_ap.php and overwrite the existing paypal_ap.php in
    wp-content/plugins/wcvendors/WCVendors/classes/gateways/PayPal_AdvPayments

    When I try to “Place Order” it gets stuck, seems like it is trying to connect but nothing happens.
    This also happens if I I use the original paypal_ap.php without overwriting it.

    Seems like it gets stuck when it has to get to the PayPal site for payment.

    Any ideas on how to get that resolved?

    • This reply was modified 8 years, 5 months ago by sunay.
    • This reply was modified 8 years, 5 months ago by sunay.
    #333
    sunay
    Participant

    Update:
    when it gets stuck on “Place Order”, the order actually gets placed, it appears in the back end and has a status pending although i never was able to get to the Paypal site to pay for it.

    #345
    sunay
    Participant

    Nothing on this issue?

    #346
    WC Vendors Support
    Participant

    No, we’re just ignoring you. 😉 All jokes aside, I do not use PayPal on my sites, so I am unable to really understand and code how it works. I’ve sent Jamie a message on it to get back to you, you’ll hear from him soon.

    Ben

    #347
    sunay
    Participant

    I know you haven’t been ignoring.
    I’ll look out for his input.

    #348
    sunay
    Participant

    Update on the chained payments fix.

    Like I’ve said before I don’t know php, and am not a programmer I only go by logic that I think may be true. I read the code, and sort of know what it does, but do not edit, unless I am following a tutorial or copy/paste from a trusted source.

    With that being said, I am sort of proud of myself 🙂 for managing to get this working, or at least worked on the test purchase I made. Here is what I did, in case someone is experiencing similar issues and needs an option to try.

    Jaime, please let me know if what I’ve done makes sense and if I should keep it like that, or you think there is a better way to go about this.

    ====

    I was getting stuck on the Place Order page. Right after clicking the button it seemed like the site is trying to connect to PayPal but just kept trying with no luck. I knew it has something to do with the communication between the sites, but wasn’t sure where to look, or what to look for.

    After circling around it for few hours, I decided to activate the debug mode in wp_config, and see if it may show something I can use.
    With the debug=true, it showed an error on the checkout page, when trying to Place Order, that pointed to /var/www/mysite/wp-content/plugins/wcvendors/WCVendors/classes/gateways/PayPal_AdvPayments/PayPal_AP/classes/adaptivepayments-sdk/lib/auth/PPAuth.php

    I downloaded the file on to my desktop to see what it may be.
    What I also did is, I got the same file, but from Matt’s plugin directories.

    Searched both files for references to PV_vendor, or WC, or Vendor and I didn’t find any in either of them, so I figured, let me override the WCVendors PPAuth.php file with the one from Matt’s plugin. No changes were made to either of the files.
    I did save the original PPAuth.php from WCVendors, in case I need to go back to it.

    When I did that…..drum roll….it worked. I was able to place the order and get to PayPal’s site for payment. I made a purchase with my sandbox credentials, and sure enough, it went through, and commission was deducted, and everything seemed to work fine.

    ====

    The email that got sent to the buyer had some errors related to:

    WCVendors/classes/class-shipping.php
    WCVendors/classes/admin/emails/class-wc-notify-vendor.php
    WCVendors/views/emails/admin-new-order.php

    I also saw a reference in the class-shipping.php to Table Rate Shipping 2. Did you make WCVendors play nice with TRS2 or that’s a future plan?

    Jamie, does that fix for the chained payments seem legit?

    #349
    zhongmincan
    Participant

    It worked fine with my sandbox credentials but when I go to the real purchase it throw me a ‘Transaction Invalid’ error. I’m using Matt’s plugin with PPAuth.php file.

    Zhong.

    #350
    Jamie
    Keymaster

    Hey guys,

    Sorry for the delay, it’s been super busy over there. I don’t have a paypal account to test this with sandbox/chained payments.

    I’ll have some time tonight to look into the chained payments side of things and see if its a quick fix or not. Those files you mentioned are the paypal api classes, these weren’t changed in the updates of the plugins. I will check to see if anything was changed by accident in my search and replaces.

    cheers,

    #354
    Jamie
    Keymaster

    Hello,

    Here is a replacement version of the matt chained payments file.

    https://gist.github.com/digitalchild/00565df0939e7fde14eb

    I have gone through and changed everything correctly so this _should_ work with WC Vendors. You shouldn’t have to mess around with the PPAuth files.

    Let me know how this goes.

    cheers,

    #356
    sunay
    Participant

    Hi Jamie,
    Thanks for the fix.
    I tested it with the file you provided, had the same thing happen, getting stuck in the place order stage.

    Fixed it when I did the PPAuth replacement again. I guess I’ll just keep that fix. I remember I had “invalid transaction” error a while back and I got a developer to take a look at it and fix it. I was told at the time that it was related to crone. Is there a chance they may have changes something in the PPAuth?
    I’ll ask them later today and post back here.

    #365
    Jamie
    Keymaster

    Hi Sunay,

    I checked the PPAuth file and I can’t see any differences between Matts version and the one in WC Vendors.

    Can you zip up the 2 files and pu them somewhere so I can check them?

    Thanks.

    #366
    sunay
    Participant

    Sure thing.
    I put them in a dropbox folder
    https://www.dropbox.com/sh/66mawdcjsi1yq2x/AADGeOSXEyTEkLK4RxJdPZsZa

    let me know if you have trouble accessing it.

    • This reply was modified 8 years, 5 months ago by sunay.
    #379
    majaz
    Participant

    Hi Jamie

    I installed your replacement version but got the following error

    any help would be much appreciated:

    Fatal error: Class ‘WC_Vendor’ not found in /public_html/wp-content/plugins/wcvendors/WCVendors/classes/gateways/PayPal_AdvPayments/paypal_ap.php on line 55

    #386
    WC Vendors Support
    Participant

    majaz: WC_Vendor should be WC_Vendors — Search and replace in that file the error references should resolve that.

    #396
    Jamie
    Keymaster

    I’ve updated the Gist for any future users of this ‘hack’.

    #402
    majaz
    Participant

    Thanks Jamie

    Unfortunately that didn’t work, I got the following message: “This transaction is invalid. Please return to the recipient’s website and try again.” After looking at Sunay’s posts above it looks like the same issue though I did not try his quick fix.

    So far I have managed to order an item and see the split payment on the paypal payment screen (sandbox). As for chained payments (where the split is hidden from the buyer’s payment page) then I’m still stuck. It would be great once the issue is resolved to get a tutorial on the documentation page with screenshots for simpletons like me!

    #403
    majaz
    Participant

    I should mention here that on the order confirmation email, I get the following message too:

    Warning: strstr() expects parameter 1 to be string, array given in /home/*****/public_html/wp-content/plugins/wcvendors/WCVendors/classes/class-shipping.php on line 67

    #405
    sunay
    Participant

    Majaz,
    I had this invalid transaction message a while back, and if I remember correctly the guy that worked on fixing it told me it was a cron issue, I did’not had it installed and working properly.

    Your email warning messages: I had that too, and still not sure why it showed, but when the wp_config debug mode is off it does not show.

    #407
    Jamie
    Keymaster

    The class-shipping issue is known and I’m working on it. To fix this issue the plugin will require WC 2.1 or higher once this is addressed. I’m away for a week but will be working on fixing this bug properly its currently running on a hack that I inherited.

    #428
    sunay
    Participant

    Hi Jamie,
    I know you said you’re away, but I wanted to put this up here so you see it whenever you log back in.

    After being able to make a sandbox payment, and all seemed to work fine, I now tried to switch to live credentials, and stuff is not working again…arrrgh.

    I posted in a new tread, but I’ll repeat here, because I think it is relevant to the chained payments issue.

    1) What happens if I want to sell products that are not by any vendor but by me (the website) meaning I may have stuff in stock that will be sold by me? How is that handled, do you know? Any suggestions?

    2) I have put all the live credentials in place:
    paypal email is the one I use to log in to paypal
    API username is the one that I find in Profile>Selling Tools>API credentials
    API pass and API signature are from the same place.
    I have created an app for advanced payments and have put it’s ID in too.

    However, I can’t seem to be able to checkout. It gives me Invalid Transaction Error.
    When I get back to the page and try again, it gives me this

    Error ID: 550001. User is not allowed to perform this action
    Error ID: 580022. Invalid request parameter: payKey cannot be null

    Is there anything else that needs to be done? As far as I know, that should be it…but for some reason not working as expected.

    #441
    sunay
    Participant

    Forgot to mention above that I have my PayPal app created in the classic API and according to Matt’s instructions from his PDF, that is available on his site.

    I also have a Business account with them.

    When the app was approved by PayPal the message said:

    Your application has been approved for parallel payment API.

    Would that have something to do with it, since I am using chained payments, not parallel?

    It does note in the application that chained payments will be used as well…

    #442
    sunay
    Participant

    Update:

    I contacted the person that sent me the PayPal app approval notice. There is a link next to the message with their nickname where you can click and view their profile, and send personal messages.

    I send personal message and asked about the parallel payment and chained payment authorizations. They were very quick to respond, and basically just said..”Chained Payment has been enabled”. So yes, that was the problem for why the “Error ID: 550001. User is not allowed to perform this action” message was appearing.

    I tried it now, after they enabled chained payments and seemed like it went through. I didn’t complete a transaction because I am using one of my vendor’s emails on a test product, just to see if I’ll be able to get to the PayPal payment screen, which I did.

    …That is a relief…Hopefully this helps someone that experiences same Error issues.
    Check to see what your app was approved for. I did send a form with both Parallel, and chained payment selected, but for some reason only had it approved for Parallel.

    #448
    Jamie
    Keymaster

    Hi Sunay,

    Thanks for the update. I’ll be sure to put this into our knowledge base as this is very important. When my client set up their paypal account I made them triple check that they had both payment methods setup.

    cheers,

    jamie.

    #449
    sunay
    Participant

    Sure Jamie, glad if I am able to help.
    It took me a while to come to that, and it is a relatively simple “fix”.

    #1866
    mattbrummett
    Participant

    Has chained payments made it into core yet? Reason I ask is that PayPal does not want me to create an application in “Advanced Payments > Basic Payments > Parallel Payments” mode as the instructions I found on this site suggested.

    I understand they’re looking out for the best interest of a multi-vendor site owner by requiring us to use “Chained Payments > Instant”, so this leaves me wondering if I’m going to violate my agreement with PayPal by using the payment gateway provided with the wc vendors plugin as is, without the modifications mentioned on this thread.

    If it hasn’t already been incorporated, can a link to the tested/working file updates be provided for anyone needing to enable chained payments?

    Thanks in advance for your help!
    – Matt

    ——-
    ** below is one of 2 messages from PayPal explaining why they’re requiring this, in response to my explanation of how my site will function with the wc-vendors plugin and delayed vs instant payment options for vendors, etc. (good info here!) …
    ——-
    Wed, 11/26/2014 – 17:42 (PP_PAR_John)

    Thank you for contacting PayPal’s Application Review team.

    If you want to utilize a Multi-vendor checkout, we require you to use Chained Payments from either the Adaptive Platform or Express Checkout:

    https://developer.paypal.com/webapps/developer/docs/classic/product-info/. In this case, everyone is responsible for their portion of disputes and refunds.

    The reason we strongly suggest you to do so is because a single credit card payment sent from a buyer’s account to your PayPal account will be considered as one transaction. If a chargeback comes in, the whole transaction amount will be taken out of your PayPal account instantly, even if the buyer only has questions on one of the products purchased and associated with this specific transaction. It is the developer’s responsibility to provide all of the necessary product and delivery information in order for PayPal to dispute the chargeback with the buyer’s credit card company. It is up to the card issuer’s discretion as to whether the dispute is approved and how much would be refunded to you. If you are not in charge of product fulfillment or quality, you, as the platform owner, are still required to vet and monitor your marketplace activities.

    As the API APP ID owner, you should still be able to facilitate refunds and payments through 3rd party permission APIs and use of the Instant Chained Payments API without assuming the full financial responsibility of the entire marketplace.

    Let’s say I want to buy from multiple sellers on your platform. Using Parallel Payments, the customer would send one payment to a maximum of 6 receivers. You would have to be one of the receivers in order to collect your commission. In order to receive your commission on a multi-vendor order, you would need to designate yourself as one of the receivers. Every receiver, including you, would be responsible for any PayPal fees. In other words, you would receive your commission but then have to pay any PayPal transaction fees. Additionally, in a Parallel Payments checkout flow, every receiver is responsible for their portion of any refunds and/or chargebacks. On the other hand, Instant Chained Payments is the right API as the seller would be the primary receiver and liable for any refunds or chargebacks.

    Does this make sense? Basically it comes down to whether you want customers to be able to send one payment for an order that could include more than one seller or to one seller only. Regrettably, we do not have a product to fully support Parallel Payments in a multi-vendor checkout flow at this time.

    I realize that i’m sending a great deal of information here. I hope it helps

    Based on our recommendation, please consider to amend the integration and application submission to Instant Chained Payments. .

    Sincerely,

    John

    • This reply was modified 8 years, 2 months ago by mattbrummett.
    #1868
    Jamie
    Keymaster

    Hi Matt,

    At this moment we only support parallel payments which is available via the paypal adaptive payments system. This is the simple split payment method which makes refunds easy. As the refund is directed only to the vendor who’s product was purchased. Chained payments will be a pro feature as it is a lot more work to support correctly than the piece of code above.

    He is only outlining the differences between the two systems. In chained payments, the entire payment goes to you and then you send them on to all the vendors (instantly). In parallel you are just one of the people in the chain of payments. They also highlight the problem with chained payments in that you are financially responsible for the entire refund. You get stung with the chargeback for the entire amount instead of the per product amount which is how our parallel system works.

    You will not be violating their terms as ALL our users that have implemented paypal are using the adaptive payments system for parallel and instant pay (via the masspay system). When you apply for an account the adaptive system is the first one to apply for. You have to apply for the chained payments AFTER you get your adaptive (parallel) account setup.

    In this thread is a hacked UNSUPPORTED piece of code that allows chained payments to work IF your paypal account is enabled for this method.

    cheers,

    Jamie.

    #1875
    mattbrummett
    Participant

    Awesome! Thanks for the quick response and for clarifying what PayPal was asking of me. Seemed they were saying that I had to use instant chained payments or else I would be liable for the entire purchase amount. Much appreciated!

    – Matt

    #16734
    Philip
    Participant

    Hi guys,
    I’m just wondering, is the code above (from August 14th 2014) still valid?

    If so, could you tell me where I need to put it please? (The reference site linked to further up the page is dead).

    Many thanks in advance.
    Philip.

    #16735
    WC Vendors Support
    Participant

    Unsupported means just that. 😉 If it works for you, that’s great! If not, we dont support Chained payments anyway, so it’s up to you to figure it out.

    #16751
    aand
    Participant

    @philip: To get it working, I’ve simply replaced paypal_ap.php in wc-vendors/classes/gateways/PayPal_AdvPayments with the updated version (back up the original paypal_ap.php, just in case). Hope this helps!

    #16765
    Philip
    Participant

    Hi Asbjoern,
    thank you for your answer, I hope I can copy your success 🙂
    Regards,
    Philip.

    #54385
    aand
    Participant

    Just a quick heads up that if you’ve seen issues where your customers are redirected to PayPal’s homepage rather than continuing through the checkout process on Paypal (after clicking Place Order), I’ve come across a solution:

    You need to change the redirect URL:

    From this: https://www.paypal.com/webscr&cmd=_ap-payment&paykey=XXXXXXXXXX

    To: https://www.paypal.com/webscr?cmd=_ap-payment&paykey=XXXXXXXXXX

    Note the “?” after ‘webscr’.

    I’ve had the & for years without any problems but looks like PayPal changed something last week, causing a number of customer orders to fail. Originally spotted the solution here:
    http://stackoverflow.com/questions/41654069/302-url-redirect-to-paypal-home-page

    Hope it helps someone!

Viewing 33 posts - 1 through 33 (of 33 total)
  • The forum ‘WC Vendors Free Support’ is closed to new topics and replies.
This website uses cookies to ensure you get the best experience on our website.