Payment request through paypal gateway ERROR

Hi members,

I am having some trouble in sending payment request. I have added one client today and created an invoice for him, now when I create the payment request from the Invoice then at the time of submission it gives me the error “Looks like something is wrong with this site’s Paypal configuration.” But my paypal configuration is correct.

I have tried to amend the last payment request which was already initiated, and I didn’t get any error on that.

I don’t know what went wrong.

Please suggest to fix this issue.

Below is the console log of my browser.

POST http://abc.example.com/ 417 (EXPECTATION FAILED)send @ jquery.min.js:4ajax @ jquery.min.js:4frappe.request.call @ desk.min.js:138frappe.call @ desk.min.js:134_call @ form.min.js:242(anonymous function) @ form.min.js:232check_name @ form.min.js:235save @ form.min.js:232frappe.ui.form.save @ form.min.js:242(anonymous function) @ form.min.js:94i @ jquery.min.js:2add @ jquery.min.js:2_f.Frm._save @ form.min.js:92(anonymous function) @ form.min.js:86
desk.min.js:150 Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/save.py”, line 19, in savedocs
doc.submit()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 723, in submit
self._submit()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 712, in _submit
self.save()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 233, in save
return self._save(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 279, in _save
self.run_post_save_methods()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 771, in run_post_save_methods
self.run_method(“on_submit”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 651, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 879, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 862, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 645, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/doctype/payment_request/payment_request.py”, line 39, in on_submit
self.set_payment_request_url()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/doctype/payment_request/payment_request.py”, line 56, in set_payment_request_url
self.payment_url = self.get_payment_url()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/doctype/payment_request/payment_request.py”, line 80, in get_payment_url
“currency”: self.currency
File “/home/frappe/frappe-bench/apps/frappe/frappe/integrations/doctype/paypal_settings/paypal_settings.py”, line 115, in get_payment_url
response = self.execute_set_express_checkout(kwargs[“amount”], kwargs[“currency”])
File “/home/frappe/frappe-bench/apps/frappe/frappe/integrations/doctype/paypal_settings/paypal_settings.py”, line 146, in execute_set_express_checkout
frappe.throw(“Looks like something is wrong with this site’s Paypal configuration.”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 300, in throw
msgprint(msg, raise_exception=exc, title=title, indicator=‘red’)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 293, in msgprint
_raise_exception()
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 266, in _raise_exception
raise raise_exception, encode(msg)
ValidationError: Looks like something is wrong with this site’s Paypal configuration.

desk.min.js:150 Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/app.py”, line 55, in application
response = frappe.handler.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 19, in handle
execute_cmd(cmd)
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 36, in execute_cmd
ret = frappe.call(method, **frappe.form_dict)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 890, in call
return fn(*args, **newargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/save.py”, line 19, in savedocs
doc.submit()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 723, in submit
self._submit()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 712, in _submit
self.save()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 233, in save
return self._save(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 279, in _save
self.run_post_save_methods()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 771, in run_post_save_methods
self.run_method(“on_submit”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 651, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 879, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 862, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 645, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/doctype/payment_request/payment_request.py”, line 39, in on_submit
self.set_payment_request_url()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/doctype/payment_request/payment_request.py”, line 56, in set_payment_request_url
self.payment_url = self.get_payment_url()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/doctype/payment_request/payment_request.py”, line 80, in get_payment_url
“currency”: self.currency
File “/home/frappe/frappe-bench/apps/frappe/frappe/integrations/doctype/paypal_settings/paypal_settings.py”, line 115, in get_payment_url
response = self.execute_set_express_checkout(kwargs[“amount”], kwargs[“currency”])
File “/home/frappe/frappe-bench/apps/frappe/frappe/integrations/doctype/paypal_settings/paypal_settings.py”, line 146, in execute_set_express_checkout
frappe.throw(“Looks like something is wrong with this site’s Paypal configuration.”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 300, in throw
msgprint(msg, raise_exception=exc, title=title, indicator=‘red’)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 293, in msgprint
_raise_exception()
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 266, in _raise_exception
raise raise_exception, encode(msg)
ValidationError: Looks like something is wrong with this site’s Paypal configuration.

Hi

I have found some info,

Newly created customers are affected and that is only on payment request.

I have upgraded the erpnext from 7.0 to 7.1 latest release.

Before upgrade there were some customers but they were not affected, it happens with new customers only.

What could be the cause? anyone please…

Regards

Hi

I have traced the issue, the issue was the exchange rate.

While creating the invoice I was using the exchange rate $1=68.740000000, so when I was sending the payment request through paypal it was showing me the above error.

But when I used $1=68.000000000 it went smoothly.

I just wanted to know is that can i use the currency exchange rate upto 2 or 3 decimal points or not

Can we call it bug or something. Please suggest

Hi members,

Please let me know about this, should I open the issue for this on github or is there any workaround ?

I am still getting the error.

Regards,

@deepak727

Please create a GitHub issue if the error still exists.

Hi,

This is working just fine in my test account. I created Sales Order in USD, with value in the decimal places. I was able to create Payment Request fine against it.

Sales Order:

Payment Request:

1 Like

Hi @umair

The payment request is only initiating if i am making it through sales order, not with sales invoice.

Can you try with sales invoice and let me know.

Hi @umair

Did you tried it? please let me know.

Regards

Hello,

I was able to create Payment Request against Sales Invoice fine. Can you please share screenshots indicating issue?

Hi @umair

Thanks a lot for the response I have still not tested it, I will post the results soon.