WebsiteBaker Community Forum

WebsiteBaker Support (2.8.x) => Bakery Shop => Topic started by: rumen on February 20, 2018, 12:39:19 PM

Title: Errors with PayPal payements
Post by: rumen on February 20, 2018, 12:39:19 PM
The payment is done but after the payment I was redirected to page with error message:

Code: [Select]
ERROR: Payment status or payment method is not defined.
Also after I was redirected to the site I saw that the item and the amount in the "shopping card" still exist!

I use WB 2.10 and Bakery 1.83

Title: Re: Errors with PayPal payements
Post by: rumen on February 20, 2018, 02:40:08 PM
Here is a screenshot

(https://preview.ibb.co/iqaTCc/paypal_error.png)
Title: Re: Errors with PayPal payements
Post by: rumen on February 20, 2018, 02:48:26 PM
Also

1. I don't get e-mail message from the site with my order.
2. The e-mail in the site doesn't get by e-mail the order ...
3. The only e-mail is from PayPal just for the payment (in the spam)

Title: Re: Errors with PayPal payements
Post by: rumen on February 20, 2018, 03:06:56 PM
Even COD doesn't work - I don't need COD in this case, but turned on just to see if it works. The module give message on the screen that will send message, but doesn't send e-mails and also the card is not cleared - the item still exist there.

(https://preview.ibb.co/bZinNc/COD_error.png) (https://ibb.co/ecACoH)
Title: Re: Errors with PayPal payements
Post by: Gast on February 20, 2018, 04:03:17 PM
you have to see, how it works in the payment

you send a request to paypal with some datas to pay it. if you pay there for it, paypal (or others) send's a request back to your adress to the ipn.php of this payment method. this ipn.php update the record in the database and set a variable to TRUE. And only if this variable is true, bakery sends the mails and clear the session

use the check_payment.php of your favorite payment method and there the settings for $testing and $sandbox to get more information about the problem

a simple example: if the adress of the back-url to your ipn.php is not correct in your payment settings, it's not possible for paypal to send a success report back to you
Title: Re: Errors with PayPal payements
Post by: rumen on February 20, 2018, 05:03:33 PM
I sent 2 payments with EUR 0.01 and both passed OK. The funds were transferred to the shop account in PayPal. But still I got same error. Maybe I miss something in the settings?

(https://preview.ibb.co/e60j2c/paypal_error2.png) (https://ibb.co/gmJF8H)

Fields:
PayPal Page:          (I didn't understand should there be something and what?)
PDT Identity Token:   (I didn't understand should there be something and what?)

In Bakery Docs it was written:

Your Identity Token is shown below the PDT On/Off radio buttons. Copy your identity token and paste it to the "PDT Identity Token" field right above the yellow box at Bakeries backend (see "PayPal Settings").


I activate also the COD payment. With COD payment I didn't get any e-mail for the order I did, only the shop received the order. Should I change the version of the Bakery?

Title: Re: Errors with PayPal payements
Post by: Gast on February 20, 2018, 05:44:18 PM
Quote
Fields:
PayPal Page:          (I didn't understand should there be something and what?)
PDT Identity Token:   (I didn't understand should there be something and what?)

Paypal-Page: is the adress of the shop - normalize also registered in your paypal-administration, look there to the correct url and use copy&paste
normalize it is the absolute url to your shop-page
Correction:
but: http://transfer.photography  is not a valid url, no domain-ending

is your shop registered in the paypal-administration??

same problem for the ipn-adress
the script use here your wb-url and build this path automatically in the bakery-payment-settings
you need here also a valid url
Title: Re: Errors with PayPal payements
Post by: rumen on February 20, 2018, 06:02:41 PM
Yes the shop is registered in PayPal - Business account. And the 2 test payments payments passed successfully as amounts from my account to the shop account in PayPal.

Quote
is your shop registered in the paypal-administration??

You mean the domain is wrong?

The domain in .photography  - yes it really is. The site is http://transfer.photography  and the site is for "Transfer photo to wood" - Yes it really!!!

Quote
Paypal-Page: is the adress of the shop - normalize also registered in your paypal-administration, look there to the correct url and use copy&paste
normalize it is the absolute url to your shop-page

So it should not be the site itself but the shop page! For example this one?

http://transfer.photography/pages/order.php

or the card?

http://transfer.photography/pages/order.php?view_cart=yes




 
Title: Re: Errors with PayPal payements
Post by: rumen on February 20, 2018, 06:06:45 PM
Do you think the problem can appear because by some reason the WB doesn't recognize the domain? For example I couldn't exter the e-mail address in the settings ... the WB doesn't recognize it as e-mail "info@transfer.photography"  - gave me error - this is not valid e-mail address ....
Title: Re: Errors with PayPal payements
Post by: rumen on February 20, 2018, 06:12:22 PM
OK I put the address of the shop in settings but same error appeared:

(https://preview.ibb.co/cLBwXc/error_pay_Pal3.png) (https://ibb.co/d6UiCc)
Title: Re: Errors with PayPal payements
Post by: Gast on February 20, 2018, 06:37:55 PM
go into the ipn.php of your payment method and set this variabels (debud && sandbox) step by step to TRUE, then try again

Code: [Select]
$active   = true;        // IPN on = true, IPN off = false
$debug    = false;       // Enable debug mode
$sandbox  = false;       // Use paypal sandbox
$delay    = false;

i hope, you get there some more informations

Quote
Do you think the problem can appear because by some reason the WB doesn't recognize the domain? For example I couldn't exter the e-mail address in the settings ... the WB doesn't recognize it as e-mail "info@transfer.photography"  - gave me error - this is not valid e-mail address ....

we will check that - but if i look into the code from bakery, the code tell's me, you get no replay from paypal
Title: Re: Errors with PayPal payements
Post by: Gast on February 20, 2018, 06:55:16 PM
Quote
Do you think the problem can appear because by some reason the WB doesn't recognize the domain? For example I couldn't exter the e-mail address in the settings ... the WB doesn't recognize it as e-mail "info@transfer.photography"  - gave me error - this is not valid e-mail address ....

where do you have this problem??? 

in wb or in bakery (as shop-email)?

we've no problem's, to use a mail like this (with a newer top-level-domain) inside of wb
Title: Re: Errors with PayPal payements
Post by: Gast on February 20, 2018, 07:13:22 PM
please look into the database from bakery_general_sett ings and there specially to the shop_email.
is it the exact!!! the same mailadress, what you've write in the input field????
Title: Re: Errors with PayPal payements
Post by: rumen on February 20, 2018, 07:21:14 PM
E-mail error in Settings - Admin E-mail - I set e-mail:  info@transfer.photography

(https://preview.ibb.co/kLtGhc/e_mail_error1.png) (https://ibb.co/n0CnoH)

After "Save" I got:

(https://preview.ibb.co/d1xgFx/e_mail_error2.png) (https://ibb.co/eYXFax)

When I put another e-mail ... info@lystoto.com for example - it works and there is no problems to "Save" it

Title: Re: Errors with PayPal payements
Post by: rumen on February 20, 2018, 07:29:26 PM
please look into the database from bakery_general_sett ings and there specially to the shop_email.
is it the exact!!! the same mailadress, what you've write in the input field????

Yes it is the same: info@lystoto.com  as shop e-mail and in Settings - General e-mail - it is the same. 

Title: Re: Errors with PayPal payements
Post by: Gast on February 20, 2018, 07:30:41 PM
Quote
E-mail error in Settings - Admin E-mail - I set e-mail:  info@transfer.photography

see it - give me a minute
Title: Re: Errors with PayPal payements
Post by: crnogorac081 on February 20, 2018, 11:04:32 PM
i guess tld is limited to 2 or 3 characters in php chevk function. i would recomend to open your database phpmyadmin and manually in settings table input your email.
Title: Re: Errors with PayPal payements
Post by: Gast on February 20, 2018, 11:25:20 PM
For WB 2.10.x and older

Original-Code in admin/settings/save.php  ~Line 151

Quote
$pattern = '/^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.(([0-9]{1,3})|([a-zA-Z]{2,6}))$/';

that means: max 6 chars for the domain-name (see red marked place)

remove this number 6 (leave it empty) to use Domain-Name's without limit

here the corrected line
Code: [Select]
$pattern = '/^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.(([0-9]{1,3})|([a-zA-Z]{2,}))$/';
P.S.: WB 2.11 use a new method
Title: Re: Errors with PayPal payements
Post by: rumen on February 21, 2018, 01:52:25 PM
go into the ipn.php of your payment method and set this variabels (debud && sandbox) step by step to TRUE, then try again

Code: [Select]
$active   = true;        // IPN on = true, IPN off = false
$debug    = false;       // Enable debug mode
$sandbox  = false;       // Use paypal sandbox
$delay    = false;

i hope, you get there some more informations

Quote
Do you think the problem can appear because by some reason the WB doesn't recognize the domain? For example I couldn't exter the e-mail address in the settings ... the WB doesn't recognize it as e-mail "info@transfer.photography"  - gave me error - this is not valid e-mail address ....

we will check that - but if i look into the code from bakery, the code tell's me, you get no replay from paypal

After I turned on that options

Code: [Select]
$active   = true;        // IPN on = true, IPN off = false
$debug    = false;       // Enable debug mode
$sandbox  = false;       // Use paypal sandbox
$delay    = false;

in the log file I got:

Code: [Select]
INVALID
[2018-02-21 12:38 Etc/UTC] INVALID IPN: The transaction is invalid and has not been completed.
Title: Re: Errors with PayPal payements
Post by: Gast on February 21, 2018, 04:58:50 PM
you get the most information's in the open debug-mode

Code: [Select]
$debug    = true;
the sandbox is (in simple words) a testbox without payments, you see there the transfer protocolls from and to paypal

normalize, you get a complete protocoll about all your sending datas and also the answer from paypal.
maybe, it is also a problem with the domain-ending "photography"

see also here
https://developer.paypal.com/docs/classic/ipn/integration-guide/IPNTesting/

P.S.: a simple test is a copy from this wb-installation to a different server with a "normal" domain-ending like *.com etc
for this, you have to change the wb-url in config.php and also the shop-url and ipn-url in bakery on the new server
Title: Re: Errors with PayPal payements
Post by: rumen on February 28, 2018, 11:06:22 PM
I tried also http://lystoto.com - same result. Maybe there are some limitation from the host. I don't know. I spoke with the host, but they said there is no any problem from their side. Don't worry with this.
Title: Re: Errors with PayPal payements
Post by: Gast on March 01, 2018, 02:15:27 AM
two possible problems from my view

#1. wrong settings in your paypal-account - shop administration - but only theory for me, i've never see'n this admin panel there

#2. problems with the domain ending

have you try to talk with the hotline from paypal?
Title: Re: Errors with PayPal payements
Post by: rumen on March 01, 2018, 04:13:09 PM
I still wait for their answer.