You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All the necessary receipts can print successfully through the hardware station. Both customer and merchant copies print once a successful transaction has been done, so the printer works.
The "Print card decline receipt" flag has been set under Payment Processing in the POS functionality profiles.
I've tried all the following in code but none of it triggers a decline slip:
//SAMPLE : https://learn.microsoft.com/en-us/dynamics365/commerce/dev-itpro/payment-custom-error-messages
PaymentInfo paymentInfo = new PaymentInfo();
bool isLocalized = true;
string errorMessage = string.Format("The payment was declined. Reference number '{0}'.", "STRATEGIX - 000");
PaymentError paymentError = new PaymentError(ErrorCode.Decline, errorMessage, isLocalized);
paymentInfo.Errors = new PaymentError[] { paymentError };
return new AuthorizePaymentTerminalDeviceResponse(paymentInfo);
}
Throwing CardpaymentException
throw new CardPaymentException(CardPaymentException.CardPaymentError, "Operation is not supported (Declined) by payment terminal.", inner : null);
Throwing PeriperalException
throw new PeripheralException(PeripheralException.PaymentTerminalError, "Authorization failed, terminal busy", Array.Empty());
Throwing PaymentException
throw new PaymentException(PaymentErrors.UnableToAuthorizePayment, "Operation is not supported (Declined) by payment terminal.", inner: null);
Has anyone done this successfully and what can I change on my side? I've logged a call with Microsoft and they've asked me to post here.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to print a credit card decline slip on D365 Commerce POS.
We’ve written our own payment connector following this guide:
Create an end-to-end payment integration for a payment terminal - Commerce | Dynamics 365 | Microsoft Learn
All the necessary receipts can print successfully through the hardware station. Both customer and merchant copies print once a successful transaction has been done, so the printer works.
The "Print card decline receipt" flag has been set under Payment Processing in the POS functionality profiles.
I've tried all the following in code but none of it triggers a decline slip:
Sample error as per this link: https://learn.microsoft.com/en-us/dynamics365/commerce/dev-itpro/payment-custom-error-messages
private AuthorizePaymentTerminalDeviceResponse AuthorizePayment(AuthorizePaymentTerminalDeviceRequest request)
{
ThrowIf.Null(request, nameof(request));
//PaymentInfo paymentInfo = Utilities.WaitAsyncTask(() => this.AuthorizePaymentAsync(request.PaymentConnectorName, request.Amount, request.Currency, request.TenderInfo, request.ExtensionTransactionProperties));
//SAMPLE : https://learn.microsoft.com/en-us/dynamics365/commerce/dev-itpro/payment-custom-error-messages
PaymentInfo paymentInfo = new PaymentInfo();
bool isLocalized = true;
string errorMessage = string.Format("The payment was declined. Reference number '{0}'.", "STRATEGIX - 000");
PaymentError paymentError = new PaymentError(ErrorCode.Decline, errorMessage, isLocalized);
paymentInfo.Errors = new PaymentError[] { paymentError };
return new AuthorizePaymentTerminalDeviceResponse(paymentInfo);
}
Throwing CardpaymentException
throw new CardPaymentException(CardPaymentException.CardPaymentError, "Operation is not supported (Declined) by payment terminal.", inner : null);
Throwing PeriperalException
throw new PeripheralException(PeripheralException.PaymentTerminalError, "Authorization failed, terminal busy", Array.Empty());
Throwing PaymentException
throw new PaymentException(PaymentErrors.UnableToAuthorizePayment, "Operation is not supported (Declined) by payment terminal.", inner: null);
Has anyone done this successfully and what can I change on my side? I've logged a call with Microsoft and they've asked me to post here.
Beta Was this translation helpful? Give feedback.
All reactions