PayPal: Validate proper payee set with ISU integration (#4206)

This commit is contained in:
Raphael Michel
2024-06-10 14:10:02 +02:00
committed by GitHub
parent d0184c1f48
commit 5bc622bcfe
2 changed files with 11 additions and 5 deletions

View File

@@ -229,7 +229,10 @@ class Paypal(BasePaymentProvider):
kwargs['cart_namespace'] = request.resolver_match.kwargs['cart_namespace']
try:
if request.event.settings.payment_paypal_connect_user_id:
if self.settings.connect_client_id and not self.settings.secret:
if not request.event.settings.payment_paypal_connect_user_id:
raise PaymentException('Payment method misconfigured')
try:
tokeninfo = Tokeninfo.create_with_refresh_token(request.event.settings.payment_paypal_connect_refresh_token)
except BadRequest as ex:

View File

@@ -524,10 +524,13 @@ class PaypalMethod(BasePaymentProvider):
kwargs['cart_namespace'] = request.resolver_match.kwargs['cart_namespace']
# ISU
if request.event.settings.payment_paypal_isu_merchant_id:
payee = {
"merchant_id": request.event.settings.payment_paypal_isu_merchant_id,
}
if self.settings.connect_client_id and self.settings.connect_secret_key and not self.settings.secret:
if request.event.settings.payment_paypal_isu_merchant_id:
payee = {
"merchant_id": request.event.settings.payment_paypal_isu_merchant_id,
}
else:
raise PaymentException('Payment method misconfigured')
# Manual API integration
else:
payee = {}