Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Neil Hodges 338 posts 987 karma points
    Feb 13, 2020 @ 17:22
    Neil Hodges
    0

    Tea Commerce and Multiple Payment Gateways - PayPal

    Hi

    So onto another e-commerce site. Were using Stripe and Paypal as the payment gateways.

    enter image description here

    Selecting Stripe fires off the Payment Page and I can build the Stripe elements out fine. All working well.

    PayPal returns an empty form post action? I assume this should be generated and send the user off-site to PayPal checkout?

     <form action="" method="post">
    <input type="hidden" id="cmd" name="cmd" value="_s-xclick" />
    <input type="hidden" id="encrypted" name="encrypted" value="" /><button id="checkout-final-button" type="submit" class="checkout__button site-btn cta cta--small">Continue to Payment</button>
    </form>
    

    Also, I'd like to limit the Delivery options based on the size of the product. The largest product in basket determines the shipping price. Is that doable?

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Feb 14, 2020 @ 09:12
    Matt Brailsford
    0

    Hi Neil,

    I think this is usually down to the PayPal configuration so I'd double check your PayPal settings in the payment provider. Might also be worth checking the log file to see if it's logging any particular error.

    RE Delivery methods, if you want to filter them, then this would need to be done manually, but if you want to provide different prices based on weight you can override the build in IShippingCalculator and implement your own shipping calculation to take the weight into account.

    Matt

  • Neil Hodges 338 posts 987 karma points
    Feb 14, 2020 @ 10:18
    Neil Hodges
    0

    Hi Matt

    Thanks, I've got access to the customers' Pay Pal sandbox account. I can see a Business and a Personal account setup.

    I'm adding in the generated Pay Pal credentials for the Business account into the back office of Tea Commerce.

    API Credentials: Username: Password: Signature:

    Reading your Docs it says to create a user manually? Does using the generated account from Pay Pal cause issues? The dashboard and the doc images are out of sync somewhat as PayPal have updated their look and feel, but I kinda get the gist of what's in the docs, to what im see ing on screen.

    I'm getting this error in the logs -

    `TeaCommerce.PaymentProviders.Classic.PayPal - PayPal() - Error making API request - error code: 11928`
    

    Google this error and can't see what it pertains to? Any ideas?

    When I try to create an account manually, Pay Pal is erroring in the Sandbox dashboard, so I cant create an account manually.

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Feb 14, 2020 @ 10:43
    Matt Brailsford
    100

    Hi Neil,

    11928 = The email or merchant ID specified is invalid.

    So it looks like it doesn't like something about the merchant email. Something in the back of mind is thinking there is a setting in the business account that needs toggling to say you want to use it through the APIs and I'm not sure the auto generated ones have it set by default. It should work, but might need that setting toggling.

    I think if you take the sandbox business credentials (username + password) then login to https://www.sandbox.paypal.com/ and go to Settings > Account Settings > Api Access (Update) > Manage PayPal checkout settings and make sure that is set to "Accept PayPal payments before API permissions or credentials are set up", that could be it.

    Matt

  • Neil Hodges 338 posts 987 karma points
    Feb 14, 2020 @ 11:20
    Neil Hodges
    0

    Hi Matt

    That did the trick, toggling that on and off worked!!

    They don't make it easy for us do they, how convoluted!

    Looks to be working well now, I'm getting back to the confirmation page. I cant see a transactionId however I do have it as 'Authorize' in the back end so think that just needs setting to Sale.

    Again thanks for your help on this.

    We have another ecommerce site after this one as well to do ha ha, so will be picking your brains again no doubt.

    Quick question: I want to hook into TNT and Parcel Force on completion of an order to setup the delivery of the product.

    I noticed that in PayPal I'm not automatically sent back to the merchant site, so don't really want to post info to shipping APIs at that point on the confirmation page.

    Is there a way I can hook into when the payment is made and tea commerce knows about it? Regardless of the payment provider?

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Feb 14, 2020 @ 11:26
    Matt Brailsford
    0

    Hey Neil,

    No, they do not. Honestly, Payment Gateways are the bane of my life at the moment 😁 Glad we are able to get you working though.

    I think you might not be getting finalized orders as again, this uses a webhook to notify you off payment success so you may need to make sure that it working (if you are testing locally, it'll be the ngrok thing again).

    Nice to hear you have another project in the pipeline, and we are always here to provide guidance if you are unsure of anything.

    RE Delivery setup, the best way to do this would be to hook into TC's events system and listen for an OrderFinalized event (https://docs.teacommerce.net/3.4.0/api/events/). This event should only be fired once we have received confirmation of payment from the payment gateway via webhook so this should be guaranteed that payment was taken at that point. From there you can call the 3rd party APIs to setup the delivery.

    Hope this helps

    Matt

  • Neil Hodges 338 posts 987 karma points
    Feb 14, 2020 @ 11:33
    Neil Hodges
    0

    Fantastic! Thanks, Matt, just what I need.

    I'll try again with ngrok, I think I hit an error testing as we have over 20 items in the back office, this one already has a TC licence but for its domain name.

    We're still in testing so I'll clear down the Orders table and try again with ngrok to make sure.

    Thanks again for your help Matt.

Please Sign in or register to post replies

Write your reply to:

Draft