MiniShop2 - Payments

Hi all - so worked through the docs on the miniShop site - andit’s all fairly straight forward, until i get to accepting payments.

I’ve selected Paypal as the payment option - but when I go to the checkout, it processes the order, and sends me a confirmation email without going to paypal to take a payment.

In the system settings there are the following settings for paypal, which i assume need completing or changing, but I can’t find anything on the paypal site which correlates with these settings:

ms2_payment_paypal_api_url = https://api-3t.paypal.com/nvp
ms2_payment_paypal_cancel_id = blank

ms2_payment_paypal_cancel_order = No

ms2_payment_paypal_checkout_url = https://www.paypal.com/webscr?cmd=_express-checkout&token=
	
ms2_payment_paypal_currency = GBP
	
ms2_payment_paypal_pwd = blank
	
ms2_payment_paypal_signature = blank

ms2_payment_paypal_success_id = blank

has anyone used this before so they can let me know what I need?
Or can I use another payment processor like Stripe?

The documentation doesn’t seem to cover payments at all
https://docs.modx.pro/en/components/minishop2/

Thanks in advance!

Andy

Hi Andy,
How about PP API credentials, did you create it properly already?
Here is some useful instruction: Настройки PayPal - Google Docs

p.s. here is another useful instruction(PP/ minishop integration), hopefully it’ll help (in Russian unfortunately): Интеграция PayPal с MODX в 2021 году | REVOLUTION

Thank you - I don’t speak Russian so will have to try and translate that page!
With the PP API credentials - I will check - but i can’t see in the system settings where it asks for an API key?

Ah Also - the paypal account we have is a personal one rather than a business one - which i think could be a problem?

ms2_payment_paypal_pwd, ms2_payment_paypal_signature, ms2_payment_paypal_user - as far as I remember these fields require PP API details.

So I’ve just managed to set up API keys in paypal - but the system settings isn’t asking for any of those details - see original post - those are the settings it’s asking for.

Any ideas?

Thanks
Andy

btw how about error.log, if there are PP errors minishop should give some details ?

Ah yes you’re correct - see below:

[2022-04-27 14:23:34] (ERROR @ /account/domain/public_html/core/components/minishop2/custom/payment/paypal.class.php : 92) [miniShop2] Payment error while request. Request: Array
(
    [METHOD] => SetExpressCheckout
    [PAYMENTREQUEST_0_CURRENCYCODE] => USD
    [PAYMENTREQUEST_0_ITEMAMT] => 20
    [PAYMENTREQUEST_0_SHIPPINGAMT] => 1
    [PAYMENTREQUEST_0_AMT] => 21
    [RETURNURL] => https://domain/assets/components/minishop2/payment/paypal.php?action=success
    [CANCELURL] => https://domain/assets/components/minishop2/payment/paypal.php?action=cancel
    [PAYMENTREQUEST_0_INVNUM] => 4
    [L_PAYMENTREQUEST_0_NAME0] => Product 1
    [L_PAYMENTREQUEST_0_AMT0] => 20
    [L_PAYMENTREQUEST_0_QTY0] => 1
)
, response: Array
(
    [TIMESTAMP] => 2022-04-27T14:23:34Z
    [CORRELATIONID] => 1242cd611ed19
    [ACK] => Failure
    [VERSION] => 74.0
    [BUILD] => 56755938
    [L_ERRORCODE0] => 10002
    [L_SHORTMESSAGE0] => Security error
    [L_LONGMESSAGE0] => Security header is not valid
    [L_SEVERITYCODE0] => Error
)

OK but my Paypal API credentials don’t include a username or password?
There is a signature though.

  [L_ERRORCODE0] => 10002
  [L_SHORTMESSAGE0] => Security error
  [L_LONGMESSAGE0] => Security header is not valid
  [L_SEVERITYCODE0] => Error

I think this piece is most important here.
Please check these links as well:
https://henrywill2409.medium.com/how-to-fix-paypal-error-code-10002-9967461eafdf

as for me system settings may have wrong credentials still. Could please share (hide sensitive data of course) them? Btw what kind of user login do you use? something like yourlogin_api1.domain.com?

Thanks for this - very much appreciated!!
When installed, the paypal settings already had some fields completed, so i assumed they were correct:

ms2_payment_paypal_api_url:
https://api-3t.paypal.com/nvp

ms2_payment_paypal_cancel_id:
(blank)

ms2_payment_paypal_cancel_order:
no

ms2_payment_paypal_checkout_url:
https://www.paypal.com/webscr?cmd=_express-checkout&token=
(I think the above is missing a token??)

ms2_payment_paypal_currency:
GBP

ms2_payment_paypal_pwd:
(blank - wasn't sure what passwod to put here - is it my actual paypal login password??)

ms2_payment_paypal_signature:
I won't put this here, but it came from the paypal API settings)

ms2_payment_paypal_success_id:
blank - I assume this should just the id of a thanks page?


ms2_payment_paypal_user:
I've put my email address here that I log in to Paypal with - not sure if that's right though!

But there’s nowere to put the APi credentials that were generated by Paypal, apart from the signature - so I’m very confused!

Thanks again so much for any assistance!

Andy

So I had a search aroudn, and I found a few people are using Fondy (https://fondy.io/) as an alternative payment processor. Has anyone tried this?

I’ve setup a test acount, and it seems to work - is this a trusted payment provider?

Unfortunatly the provider above (fondy) isn’t going to work for various reasons.

I’m a little surprised how little information I can find online about setting up a payment gateway for minishop2. It seems a great little extra, but doesn’t work if I can take transactions.

So - i changed the URLs for the APi and checkout based on further reading.
For the API url I used:

https://api-m.sandbox.paypal.com/v1/oauth2/token

For the checkout URL I used:

https://api-m.sandbox.paypal.com/v2/checkout/orders

It’s not working, but it’s a different error this time:

[2022-04-28 15:30:59] (ERROR @ /home/site/public_html/core/xpdo/om/xpdoquery.class.php : 708) Error parsing condition with key 0: 13
[2022-04-28 15:30:59] (ERROR @ /home/site/public_html/core/xpdo/om/xpdoquery.class.php : 708) Error parsing condition with key 1: 1651159850
[2022-04-28 15:30:59] (ERROR @ /home/site/public_html/core/model/modx/modx.class.php : 2466) Could not load context: web
[2022-04-28 15:51:16] (ERROR @ /home/site/public_html/core/xpdo/om/xpdoquery.class.php : 708) Error parsing condition with key 0: 14
[2022-04-28 15:51:16] (ERROR @ /home/site/public_html/core/xpdo/om/xpdoquery.class.php : 708) Error parsing condition with key 1: 1651161040
[2022-04-28 15:51:16] (ERROR @ /home/site/public_html/core/model/modx/modx.class.php : 2466) Could not load context: web
[2022-04-28 15:53:21] (ERROR @ /home/site/public_html/core/xpdo/om/xpdoquery.class.php : 708) Error parsing condition with key 0: 16
[2022-04-28 15:53:21] (ERROR @ /home/site/public_html/core/xpdo/om/xpdoquery.class.php : 708) Error parsing condition with key 1: 1651161191
[2022-04-28 15:53:21] (ERROR @ /home/site/public_html/core/model/modx/modx.class.php : 2466) Could not load context: web
[2022-04-28 16:04:44] (ERROR @ /home/site/public_html/core/xpdo/om/xpdoquery.class.php : 708) Error parsing condition with key 0: 17
[2022-04-28 16:04:44] (ERROR @ /home/site/public_html/core/xpdo/om/xpdoquery.class.php : 708) Error parsing condition with key 1: 1651161852
[2022-04-28 16:04:44] (ERROR @ /home/site/public_html/core/model/modx/modx.class.php : 2466) Could not load context: web
[2022-04-28 16:23:54] (ERROR in modMenu::getSubMenus @ /home/site/public_html/core/model/modx/modmenu.class.php : 148) modAction support is deprecated since version 2.3.0. Support for modAction has been replaced with routing based on a namespace and action name. Please update the extra with the namespace moddevtools to the routing based system.
[2022-04-28 16:24:22] (ERROR @ /home/site/public_html/core/components/minishop2/custom/payment/paypal.class.php : 92) [miniShop2] Payment error while request. Request: Array
(
    [METHOD] => SetExpressCheckout
    [PAYMENTREQUEST_0_CURRENCYCODE] => GBP
    [PAYMENTREQUEST_0_ITEMAMT] => 20
    [PAYMENTREQUEST_0_SHIPPINGAMT] => 0
    [PAYMENTREQUEST_0_AMT] => 20
    [RETURNURL] => https://www.site.co.uk/assets/components/minishop2/payment/paypal.php?action=success
    [CANCELURL] => https://www.site.co.uk/assets/components/minishop2/payment/paypal.php?action=cancel
    [PAYMENTREQUEST_0_INVNUM] => 18
    [L_PAYMENTREQUEST_0_NAME0] => Fiat 500 Print
    [L_PAYMENTREQUEST_0_AMT0] => 20
    [L_PAYMENTREQUEST_0_QTY0] => 1
)
, response: Array
(
    [{"error":"invalid_client","error_description":"Client_Authentication_failed"}] => 
)


I’m in a right muddle now!
Arghhh!!

I just realised I had mixed V1 with V2, so changed the above URls to both be V2 - and got this error instead:

[2022-04-28 16:29:10] (ERROR @ /home/site/public_html/core/components/minishop2/custom/payment/paypal.class.php : 92) [miniShop2] Payment error while request. Request: Array
(
    [METHOD] => SetExpressCheckout
    [PAYMENTREQUEST_0_CURRENCYCODE] => GBP
    [PAYMENTREQUEST_0_ITEMAMT] => 20
    [PAYMENTREQUEST_0_SHIPPINGAMT] => 0
    [PAYMENTREQUEST_0_AMT] => 20
    [RETURNURL] => https://www.site.co.uk/assets/components/minishop2/payment/paypal.php?action=success
    [CANCELURL] => https://www.site.co.uk/assets/components/minishop2/payment/paypal.php?action=cancel
    [PAYMENTREQUEST_0_INVNUM] => 19
    [L_PAYMENTREQUEST_0_NAME0] => Fiat 500 Print
    [L_PAYMENTREQUEST_0_AMT0] => 20
    [L_PAYMENTREQUEST_0_QTY0] => 1
)
, response: Array
(
    [{"name":"RESOURCE_NOT_FOUND","message":"The_specified_resource_does_not_exist_","debug_id":"d95395e670b76","details":] => Array
        (
            [0] => 
        )

)

[2022-04-28 16:29:19] (ERROR in modMenu::getSubMenus @ /home/site/public_html/core/model/modx/modmenu.class.php : 148) modAction support is deprecated since version 2.3.0. Support for modAction has been replaced with routing based on a namespace and action name. Please update the extra with the namespace moddevtools to the routing based system.

OK - Aplogies for all the posts her - i just found some sandbox URLs:

ms2_payment_paypal_api_url:

https://api-3t.sandbox.paypal.com/nvp

and for the ms2_payment_paypal_checkout_url:

https://sandbox.paypal.com/webscr?cmd=_express-checkout&token=

This seems to work on my sandbox paypal account!!

But now just need to work out how to get it working in ‘real life’!!!