SantiagoInteractive / mobilpay-card-gateway-for-woocommerce

mobilPay Card Gateway for WooCommerce
GNU General Public License v2.0
19 stars 6 forks source link

returnUrl issue #3

Closed tudorached closed 7 years ago

tudorached commented 7 years ago

Hi,

The returnUrl sent by _$this->get_returnurl($order) is not beeing recognised by mobilpay.

$objPmReqCard->returnUrl  = $this->get_return_url($order);

should be replaced with:

$objPmReqCard->returnUrl  = str_replace( '&', '&',  $this->get_return_url($order) );
SantiagoInteractive commented 7 years ago

Hi,

Also working without doing this. Just tested right now with and without your fix and works just fine in both cases. What was the error you were receiving before doing this change? Can you please provide more information?

Thanks!

tudorached commented 7 years ago

More information: Mobilpay degresses to the return url settings found in the user account, on mobilpay's website. I have tested the plugin on two different websites hosted on different servers. Making that change solves the problem.

Might be caused because of php's mbstring extension, which I've activated recently because Woocommerce emails were not rendered correctly.

I will test without mbstring and come back with the results.

SantiagoInteractive commented 7 years ago

Tested with mbstring extension on. Works both ways.

SantiagoInteractive commented 7 years ago

What's your return url structure? Check under: mobilpay panel > order details > api tab. It should be like: website-url/checkout/order-received/numeric-order-id?key=wc_order_some-string

If not, try saving again your permalink structure under wp-admin panel > settings > permalinks.

tudorached commented 7 years ago

Until I did the change the return node was empty

<return/>
SantiagoInteractive commented 7 years ago

I understand. I will commit your change. Thank you for sharing!

tudorached commented 7 years ago

Thanks for creating the plugin!

SantiagoInteractive commented 7 years ago

You're welcome! 👍

SantiagoInteractive commented 7 years ago

https://github.com/SantiagoInteractive/mobilpay-card-gateway-for-woocommerce/commit/04dbcf2e99e1f02079ac5283544935976a9326a0#diff-04fa96050c19d66b0302739443f68a47R274