Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with Paypal Payment #143

Closed
joaocosta-azores opened this issue Feb 22, 2019 · 13 comments
Closed

Problem with Paypal Payment #143

joaocosta-azores opened this issue Feb 22, 2019 · 13 comments

Comments

@joaocosta-azores
Copy link

Hello,

I'm not sure if I'm missing any step on configuration for PayPal payment.
This is what I get when after begin checkout:
screenshot 2019-02-22 at 16 48 56
No input to enter any email or anything.
I've already setup PayPal Rest Api to use test mode with Paypal App Cliente ID and Paypal Secret.

@tobias-kuendig
Copy link
Member

This partial doesn't seem to be included correctly. Could you try to debug it?

https://github.com/OFFLINE-GmbH/oc-mall-plugin/blob/develop/components/paymentmethodselector/method.htm#L28

Did you overwrite some partials? Did you give the component an alias?

Thank you!

@joaocosta-azores
Copy link
Author

For what I see in your component when i dump method.payment_provider {% set path = __SELF__ ~ '::gateways/' ~ (method.payment_provider) %} there should be a partial "paypal-rest". But I can't find any partial for PayPal-rest in oc-mall-plugin. Should be anything else beside save payment information button? Also seems like there should be another partial called offline for invoice payment.
Another thing, event with this I was able to save payment information and proceed to next step
screenshot 2019-02-23 at 12 14 40
I was able to finish the payment and was sent back.
screenshot 2019-02-23 at 12 17 34
As you can see, the payments were successful but they appear as payment pending.
screenshot 2019-02-23 at 12 20 03

Hope this helps, let me know if you need more testing.

@tobias-kuendig
Copy link
Member

Sorry, I didn't get the problem yesterday. The Paypal provider does not have any configuration values for the user to enter so there is no partial to display.

If you want to add a custom message to display when the user select "Paypal" simply create the partial in your theme folder and it will be included.

It's odd that your payments are marked as "pending". Do you see the payments in your backend under Orders -> Payments?

@joaocosta-azores
Copy link
Author

In the backend there is no payments in Orders -> payments. This is what I get in Orders -> orders:
screenshot 2019-02-23 at 15 36 08

@tobias-kuendig
Copy link
Member

It looks like the return redirect from PayPal is not detected as such.

If you're being returned from PayPal this conditional should catch on and handle the rest:
https://github.com/OFFLINE-GmbH/oc-mall-plugin/blob/develop/components/Checkout.php#L152

@tobias-kuendig
Copy link
Member

@jonnydevv Were you able to fix your checkout flow? If not I'm happy to help.

@joaocosta-azores
Copy link
Author

Hello,

Sorry for late response.
I've been testing it yesterday. It seems like it doesn't work only on localhost using vhost. I 've pushed to remote and is works on remote. I think it should work on local tho, but it's ok for me.

Thank you very much!

@tobias-kuendig
Copy link
Member

Thank you for the feedback. Is it possible that your localhost adds an additional redirect when the user returns from PayPal? Like https:// -> http:// or www -> non-www?

In any case this problem should not occur even with an additional redirect. I'll take a closer look at it since the problem you're experiencing on localhost might happen to someone in production.

@joaocosta-azores
Copy link
Author

Just in case it helps, when returned from PayPal, my url is kept the same. I always use vhost with local tld eg:. http://domain.local. In this case, when returned, I'm returned with http://domain.local, the correct domain.

@Apoculos
Copy link

GREAT plugin, like it very much so far!

I'm having a similar payment pending problem for Paypal and stripe on both local dev/remote. I've even tried configuring a SSL in case that was the issue. The payment is definitely going through to stripe/paypal.. as I'm getting receipt urls/etc in the data returned. The error log receives "Could not mark paid order as paid" and "Could not log successful payment" in both of the errors the "response" part is empty.. so not sure if that is a clue! Let me know if I can provide anymore info to help solve this.

"response":"[object] (Omnipay\Stripe\Message\Response: {})"

@tobias-kuendig
Copy link
Member

Thank you very much @Apoculos and @jonnydevv. Could either one of you update to v1.1.8 and check the system.log after a checkout? The original exception is now logged in full. It would help me debug this problem if you could post the exception that gets logged with the OFFLINE.Mall log entries.

@Apoculos
Copy link

Apoculos commented Feb 28, 2019

Here is a copy paste of the errors now. Definitely some good clues! For me the problem is fixed by upping the varchar character count to 500 on the "payment_method' column of "offline_mall_payments_log"

Thanks for the quick response tobias-kuendig.

[2019-02-28 14:19:48] development.ERROR: OFFLINE.Mall: Could not log successful payment.
at /www/catselman/vendor/laravel/framework/src/Illuminate/Database/Connection.php:664, Doctrine\DBAL\Driver\PDOException(code: 22001): SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'payment_method' at row 1 at /www/catselman/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:107, PDOException(code: 22001): SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'payment_method' at row 1 at
/www/catselman/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:105)

[2019-02-28 14:19:48] development.CRITICAL: OFFLINE.Mall: Could not mark paid order as paid. ","exception":"[object] (ErrorException(code: 0): Undefined variable: payment at /www/catselman/plugins/offline/mall/classes/payments/PaymentResult.php:97)

@tobias-kuendig
Copy link
Member

Thank you very much, @Apoculos. I've just released a new version with a fix for this problem. Please respond to this issue if the problem is not solved for you in v1.1.9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants