Copied to clipboard

Flag this post as spam?

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


  • Andreas Kaltenhuber 107 posts 286 karma points
    Jun 15, 2015 @ 14:10
    Andreas Kaltenhuber
    0

    capturePayment() not working in backend

    Hi,

    we have implemented an online shop, actually works fine, BUT we are unable to capture any funds:

    • Umbraco 7.2.6
    • Merchello 1.8.3
    • Cash Payment Provider
    • PayPal Payment Provider

    anytime we click on capture funds, nothing happens (no modal window, no error, nothing).

    Appreciate any help!

    Regards, Andreas

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Jun 16, 2015 @ 15:44
    Rusty Swayne
    0

    You are trying to capture funds in the back office right?

    Does this happen with both the Cash provider and PayPal, or only orders originally paid for using the PayPal provider?

  • Biagio Paruolo 1594 posts 1825 karma points c-trib
    Jul 15, 2015 @ 13:53
    Biagio Paruolo
    0

    It happen for me with both methods.

  • PierreD Savard 183 posts 290 karma points
    Jun 17, 2015 @ 00:40
    PierreD Savard
    0

    I got the same problem (and some other user too). Cash Provider work well, but not the paypal one. I desperate need to fix that to release the site in production..... But I can find a way to debug that. No Error! The all backend crash (all buttons in the side bar of the umbraco backend disappears) when clicking on the "capture funds" button. And the capture pane open empty...

    see:

    https://our.umbraco.org/projects/collaboration/merchello/merchello/64487-Paypal-Express-capture-funds-problem

  • Andreas Kaltenhuber 107 posts 286 karma points
    Jun 17, 2015 @ 03:48
    Andreas Kaltenhuber
    0

    Hi,

    in my case the cash doesn't work too.

  • Biagio Paruolo 1594 posts 1825 karma points c-trib
    Jul 15, 2015 @ 10:11
    Biagio Paruolo
    0

    me too

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Jun 17, 2015 @ 15:03
    Rusty Swayne
    0

    @PierreD I think you may need to update your PayPal provider, I know Nik and Scandia were working on an update to that one and I believe addressed the capturing of funds. I have not tried it myself though.

    @Andreas, the cash provider should work without any problems. If you open up the JS console when you click the capture funds button, do you get any messages?

  • PierreD Savard 183 posts 290 karma points
    Jun 17, 2015 @ 22:22
    PierreD Savard
    0

    Thanks Rusty, I will check that. I am already at the version 1.0.4 (the last one on their website).

  • Andreas Kaltenhuber 107 posts 286 karma points
    Jun 18, 2015 @ 08:07
    Andreas Kaltenhuber
    0

    @rusty no errors, nothing in the console.

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Jun 18, 2015 @ 14:52
    Rusty Swayne
    0

    @Andreas - are you using the Bazaar install or have you based your setup off of one of the earlier example sites?

    The way the Capture Funds button works is it looks to the model to determine which payment method was selected at checkout. So if you chose to pay by cash, it would use the cash method and likewise if you chose PayPal it would call the PayPal method.

    The PayPal provider is something I am planning on checking out once 1.9.0 is released as it is getting increasingly popular. Also, I wrote the Braintree payment provider (https://www.braintreepayments.com/) which I've been thinking about adding a PayPal method to (Braintree is owned by PayPal).

  • Andreas Kaltenhuber 107 posts 286 karma points
    Jun 25, 2015 @ 07:43
    Andreas Kaltenhuber
    0

    Hi Rusty,

    sorry for my late reply, have been on holidays.

    this is a custom solutions with more webapi controller in use but most of the solution (especially the checkout process) is inspired by earlier example sites and bazaar as well.

    i don't really understand why the capture funds for pay by cash isn't working. i understand that the paypal provider needs some updates to work with 1.8.3, but cash should work.

    i must have a look at the braintree provider. is there a good example somewhere? do i have to build my own credit card details checkout view?

    i think it would be a very good idea, to have the most important payment providers updated and ready for easy integration in the latest merchello release.

    thx, Andreas

  • Biagio Paruolo 1594 posts 1825 karma points c-trib
    Jul 15, 2015 @ 10:10
    Biagio Paruolo
    0

    +1

  • Biagio Paruolo 1594 posts 1825 karma points c-trib
    Jul 15, 2015 @ 10:10
    Biagio Paruolo
    0

    Don't work with Paypal and Cash too.

  • Biagio Paruolo 1594 posts 1825 karma points c-trib
    Jul 15, 2015 @ 15:13
    Biagio Paruolo
    0

    I found the problem. Into AngularJS merchello.controller.js, function capturePayment() , the dialogData.isValid() return always false. Why?

     var dialogData = dialogDataFactory.createCapturePaymentDialogData();
                    dialogData.setPaymentData($scope.payments[0]);
                    dialogData.setInvoiceData($scope.payments, $scope.invoice, $scope.currencySymbol);
                    if (!dialogData.isValid()) {
                        return false;
                    }
    

    Into merchello.model.js -> CapturePaymentDialogData.prototype =

    (function() {:
       function isValid() {
                return this.paymentKey !== '' && this.invoiceKey !== '' && this.invoiceBalance !==0;
            }
    

    The is Valid return false because invoiceBalance is zero. Why?

    Image javascript angularjs debug

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Jul 15, 2015 @ 18:09
    Rusty Swayne
    0

    Invoice balance is a calculated value. For that invoice, what payments are applied to it?

  • Biagio Paruolo 1594 posts 1825 karma points c-trib
    Jul 15, 2015 @ 18:37
    Biagio Paruolo
    0

    I applied Paypal for it. But don't work for cash too.

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Jul 15, 2015 @ 19:03
    Rusty Swayne
    0

    I'm not sure what's going on with the PayPal method, but if it added an applied payment in the amount of the invoice, the balance of the invoice will be zero - Have you looked at the PayPal provider source?

  • Biagio Paruolo 1594 posts 1825 karma points c-trib
    Jul 15, 2015 @ 19:36
    Biagio Paruolo
    0

    I don't understand. The workflow goes to Paypal express to authorize the amount. All go ok on Paypal and return to Merchello. Maybe that when go to Paypal it send Authorize&Capture and not only Authorize. Maybe?

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Jul 15, 2015 @ 19:59
    Rusty Swayne
    0

    That depends on the provider.

    The way I think it should work:

    1. Authorize payment in the PayPal Payment Method
    2. Redirect to PayPal - handle the actual payment
    3. Response from PayPal hits a handler of some sort which does the "Capture Payment"

    At that point there would be no need to have a Capture Payment in the Back Office ... unless the customer did not complete the PayPal part of it. If that happens you could void the payment and take a payment using a different method, cancel the sale or have some sort of way on your front end to have them go back to PayPal can complete the transaction using the same invoice and payment keys ....

  • Biagio Paruolo 1594 posts 1825 karma points c-trib
    Jul 15, 2015 @ 20:20
    Biagio Paruolo
    0

    Hi,

    I see in sandbox that there are the authorization transaction with correct info and the capture button. So I need to check if this Paypal plugin is able to receipt the capture from Paypal. Other way is to Authorize&Capture action when go to Paypal express.

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Jul 15, 2015 @ 21:14
    Rusty Swayne
    0

    An Authorize/Capture would work but may be incorrect if the PayPal payment fails ...

  • Biagio Paruolo 1594 posts 1825 karma points c-trib
    Jul 16, 2015 @ 07:36
    Biagio Paruolo
    0

    Hi, so

    1) Check that Paypal plugin is able to receipt capture from Paypal backoffice. How and where to save Paypal token or other info for finding order and match it to operate with Paypal IPN?

    2) Which is the url that need to point after authorized?

    3) How to manually change the state into Merchello backoffice?

    4) Why Do not work capture for standard cash payment?

  • Biagio Paruolo 1594 posts 1825 karma points c-trib
    Jul 16, 2015 @ 10:38
    Biagio Paruolo
    0

    I see NotifyURL = "http://IPNhost". Is't implemented IPN into Paypal plugin?

    var paymentDetails = new PaymentDetailsType
                {
                    PaymentDetailsItem = paymentDetailItems,
                    ItemTotal = new BasicAmountType(currencyCodeType, PriceToString(itemTotal, currencyDecimals)),
                    TaxTotal = new BasicAmountType(currencyCodeType, PriceToString(taxTotal, currencyDecimals)),
                    ShippingTotal = new BasicAmountType(currencyCodeType, PriceToString(shippingTotal, currencyDecimals)),
                    OrderTotal = new BasicAmountType(currencyCodeType, PriceToString(itemTotal + taxTotal + shippingTotal, currencyDecimals)),
                    PaymentAction = PaymentActionCodeType.ORDER,
                    InvoiceID = invoice.InvoiceNumberPrefix + invoice.InvoiceNumber.ToString("0"),
                    SellerDetails = new SellerDetailsType { PayPalAccountID = _settings.AccountId },
                    PaymentRequestID = "PaymentRequest",
                    ShipToAddress = shipAddress,
                    NotifyURL = "http://IPNhost"
                };
    
  • Biagio Paruolo 1594 posts 1825 karma points c-trib
    Jul 16, 2015 @ 11:52
    Biagio Paruolo
    0

    See the image why capture don't work. Why balance is zero?

    enter image description here

  • Biagio Paruolo 1594 posts 1825 karma points c-trib
    Jul 16, 2015 @ 12:58
    Biagio Paruolo
    0

    Update: I manually change the code

    _merchelloContext.Services.GatewayProviderService.ApplyPaymentToInvoice(payment.Key, invoice.Key, AppliedPaymentType.Debit, "PayPal: capture authorized", 1);
    

    and the into backend I've a value different to zero. enter image description here

    After i click on Capture Fund and appear the form to input value to capture and capture funds.

    enter image description here

    enter image description here

    So, Is there something wrong into the workflow of Paypal plugin or some assignement?

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Jul 16, 2015 @ 15:49
    Rusty Swayne
    0

    It looks like there may be an issue in the PayPal method. You might try a compare and contrast between the PayPal method code and the SagePay method code which I believe operate in similar ways.

  • Biagio Paruolo 1594 posts 1825 karma points c-trib
    Jul 17, 2015 @ 08:38
    Biagio Paruolo
    0

    Here is an update: https://github.com/Merchello/Merchello/issues/1352

    The problem is caused by that product has a price with decimal value. So its a big issue of Merchello.

  • Biagio Paruolo 1594 posts 1825 karma points c-trib
    Jul 17, 2015 @ 12:53
    Biagio Paruolo
    0

    Solved with the workaround described here: http://issues.merchello.com/youtrack/issue/M-284#comment=93-640

    I add into ExamineSettings.config:

    After I rebuild MerchelloInvoiceIndexer from Umbraco backend.

    So, all balance was populated and I try another test with decimal value and Paypal plugin. So, I'm able to capture the fund and close the transaction.

    Will be patched the index?

Please Sign in or register to post replies

Write your reply to:

Draft