Enable refunds using customer account payment for all customers not depending on 'Allow on account' config #336
Unanswered
alexanderkurilenko
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is it possible to set config Payments.EnableToValidateCustomerToPayRefundwithCustomerAccount?
During SDK checking we found the following configuration "Payments.EnableToValidateCustomerToPayRefundwithCustomerAccount" -- true; that might help to allow on Account payments for the refunds not checking 'Allow on account flag'
SDK code:
bool flag = context.IsFeatureEnabled(OrderManagementFeatureNames.RetailB2bEcommerceFeatureName, defaultValue: false);
bool flag2 = context.IsFeatureEnabled(PaymentsFeatureNames.POSCustomerAccountPaymentFeatureName, defaultValue: false);
bool? settingValue = context.Runtime.Configuration.GetSettingValue("Payments.EnableToValidateCustomerToPayRefundwithCustomerAccount");
bool flag3 = settingValue.HasValue && settingValue.Value;
if (!customerToPayWith.AllowOnAccountPayment && ((isPositiveAmount && (flag || flag2)) || (!isPositiveAmount && flag2 && !flag3)))
{
RetailLogger.Log.LogError(Events.CustomerAccountPaymentFeatureDisabled, "Customer on account payment feature disabled");
throw new PaymentException(PaymentErrors.Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentForCustomerWithoutAllowOnAccount, string.Format(CultureInfo.InvariantCulture, "This customer is not allowed to use on account payments."));
}
Beta Was this translation helpful? Give feedback.
All reactions