E-commerce Paypal Integration Confirm_Payment Error

Hello,

I am trying to set up a ERPNext E-commerce online shop using version 14.
I will first explain steps I followed and finally share the error I get.

To test if payment integration works, I have set up a Paypal Sandbox Test Account and entered the information to Paypal Settings as follows

After Paypal Integration is complete, in the Accounting module, Chart of Accounts creates Paypal ledger under the banks folder. Also the Payment Gateway is set up and available like the image below

Last thing I did was to enable the Ecommerce Settings to accept payments.

UX is working right, redirection to paypal payment and login there is working as well, after pay button is clicked the user is redirected back to our website however instead of the Orders URL, it displays a Server Error.
Everything seems to be working until very last step of accepting the payment.

Server Error
Traceback (most recent call last):
  File "apps/frappe/frappe/app.py", line 69, in application
    response = frappe.api.handle()
  File "apps/frappe/frappe/api.py", line 54, in handle
    return frappe.handler.handle()
  File "apps/frappe/frappe/handler.py", line 45, in handle
    data = execute_cmd(cmd)
  File "apps/frappe/frappe/handler.py", line 83, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "apps/frappe/frappe/__init__.py", line 1590, in call
    return fn(*args, **newargs)
TypeError: confirm_payment() missing 1 required positional argument: 'token'

Is anyone else getting this error? If so I would be glad if you could give me some hints to fix it.
Thank you very much

BTW I don’t know if I should’ve submitted this to github as a bug, since I am a newbie to ERPNext ecosystem, I would like to spam as less as possible :slight_smile:

Best Regards

From the steps you’ve followed, it looks like you’re on the right track. Kudos for setting up the Paypal Sandbox Test Account and configuring the Paypal Settings. It’s always a good idea to test the payment integration.
Now, let’s tackle the error you’re encountering. It seems like everything is working smoothly until the final step of accepting the payment. The Server Error traceback you shared indicates a missing positional argument called ‘token’ in the confirm_payment() function. This might be the cause of the issue.
If you’re still facing difficulties, you can find more info on similar issues and potential solutions. They have a wealth of knowledge and discussions around ERPNext, so it’s worth checking out their resources.

@Y_S Hello, did you install the Paypal integration aditionally or was it part of the installation?
We have started with V15 and I’m missing the integration. We only like to use for checking outgoing payments but we can’t find in any case.

Kind regards!

Hello,

I believe its because I have the payments app, you can see your installed apps on Frappe admin dashboard, top right, Help → About
image

I didnt check the Version 15 out yet, but I’d argue Payments or (E-commerce, new name is Webshop) is what you will need.