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
I added a payment method "Pay by credits on account" to HQ. This is in place for some time now.
The users want this feature now in POS as well.
I added a new custom POS operation and assigned it to the existing "Pay by credits on account" on the retail store.
I added code on POS for this POS operation. Everything up to this point is still working.
I need to add a tenderline to the cart for this custom tender type using AddTenderLineToCartClientRequest/AddTenderLineToCartClientResponse trigger pair.
However it gives me an error:
The payment information is either missing information or it is incorrect. Verify the payment information and then try again., Status code 412. POS runtime request of type 'AddTenderLineToCartClientRequest' for extension in package 'ABC' failed. Error Message: Unable to retrieve tender service for operation: {0}. Please check your payment method setup for this tender type.
The payment method is setup very similar to Pay customer Account (tendertypeId = 1)
In HQ this standard payment method (tender type) has function = Customer and POS operation = 202 (Pay customer account).
In HQ our credits on account tender type is set up with Function = customer and POS operation = custom operation (4017 = Pay by Credit)
Looking at the code in Pos.viewModels.js for Pay cash (POS operation = 200), it first calls executePaymentFlow which calls ExecutePaymentOperation. This one calls HandlePaymentOperationResult(this.PayCashAsync). the latter load PaymentView.
After I entered the amount and click on the enter-button, it calls PaymentMethodfViewmodelBase.Prototype.AddCartTenderLinetoCart(tenderline).
So for my custom operation, I call the handler and request/response created for POS operation 4017.
This handler retrieves the available credit and open a dialog where I then select the credit line to use as payment (I add the custTransRecid to the extension properties of TenderLine).
On OK on the dialog, I then calls the code that runs AddTenderLineToCartClientRequest/Response.
So similar to what is in PaymentMethodfViewmodelBase.Prototype.AddCartTenderLinetoCart(tenderline).
So why does it look for an operation id in the above trigger while there is no parameter to assign it to and I don't see nothign in the standard code for PayCash that at the point of adding the tenderLine that it uses the oprationId 200.
`
private _saveTenderToCart(_creditRecids: string, _correlationId: string, _operationId: number, _cart: ProxyEntities.Cart): any {
let deviceConfig: ProxyEntities.DeviceConfiguration = CommonHelper.GetDeviceConfigurationLocal();
let tenderTypeLocal: ProxyEntities.TenderType = TMC.Commerce.ApplicationContext.Instance.tenderTypesMap.getTenderTypeByOperationId(_operationId);
let vMarkStringValue: ProxyEntities.CommercePropertyValueClass = new ProxyEntities.CommercePropertyValueClass();
vMarkStringValue.StringValue = _creditRecids;
let vMarked: ProxyEntities.CommercePropertyClass = new ProxyEntities.CommercePropertyClass();
vMarked.Key = "TenderType90CustTrans";
vMarked.Value = vMarkStringValue;
let vTenderLine: ProxyEntities.CartTenderLine = {
TenderLineId: StringExtensions.EMPTY,
Currency: deviceConfig.Currency,
TenderTypeId: tenderTypeLocal.TenderTypeId,
SignatureData: null,
Amount: _cart.AmountDue,
AmountInTenderedCurrency: _cart.AmountDue,
AmountInCompanyCurrency: _cart.AmountDue,
IsPolicyBypassed: false,
CustomerId: _cart.CustomerId,
ExtensionProperties: [vMarked]
};
let addRequest: AddTenderLineToCartClientRequest<AddTenderLineToCartClientResponse> =
new AddTenderLineToCartClientRequest<AddTenderLineToCartClientResponse>(vTenderLine, _correlationId);
this.context.runtime.executeAsync(addRequest)
.then((vResult: ClientEntities.ICancelableDataResult<AddTenderLineToCartClientResponse>): any => {
if (!vResult.canceled) {
var addedTenderLine = TMC.Commerce.CartHelper.getLastTenderLine(_cart);
TMC.Commerce.Payments.Utilities.PaymentFeatureHelper.clearSensitiveDataOnTenderLine(addedTenderLine, TMC.Commerce.ApplicationContext.Instance.storeInformation);
this.context.logger.logInformational("TMCPayCreditOperationRequestHandler added tenderline for Pay by credit, operation ID 4017 successfully.");
}
else {
this.context.logger.logInformational("TMCPayCreditOperationRequestHandler tenderline add for Pay by credit, operation ID 4017 canceled.");
}
}).catch((reason: any): any => {
sessionStorage.removeItem("Execute4017TMC");
var vError = "TMCPayCreditOperationRequestHandler Pay by credit failed: " + JSON.stringify(reason);
this.context.logger.logInformational(vError);
});
`
Any help is much appreciated to get the tenderline created so that it can flow through the conclude transaction.
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
-
I added a payment method "Pay by credits on account" to HQ. This is in place for some time now.
The users want this feature now in POS as well.
I added a new custom POS operation and assigned it to the existing "Pay by credits on account" on the retail store.
I added code on POS for this POS operation. Everything up to this point is still working.
I need to add a tenderline to the cart for this custom tender type using AddTenderLineToCartClientRequest/AddTenderLineToCartClientResponse trigger pair.
However it gives me an error:
The payment information is either missing information or it is incorrect. Verify the payment information and then try again., Status code 412. POS runtime request of type 'AddTenderLineToCartClientRequest' for extension in package 'ABC' failed. Error Message: Unable to retrieve tender service for operation: {0}. Please check your payment method setup for this tender type.
The payment method is setup very similar to Pay customer Account (tendertypeId = 1)
In HQ this standard payment method (tender type) has function = Customer and POS operation = 202 (Pay customer account).
In HQ our credits on account tender type is set up with Function = customer and POS operation = custom operation (4017 = Pay by Credit)
Looking at the code in Pos.viewModels.js for Pay cash (POS operation = 200), it first calls executePaymentFlow which calls ExecutePaymentOperation. This one calls HandlePaymentOperationResult(this.PayCashAsync). the latter load PaymentView.
After I entered the amount and click on the enter-button, it calls PaymentMethodfViewmodelBase.Prototype.AddCartTenderLinetoCart(tenderline).
So for my custom operation, I call the handler and request/response created for POS operation 4017.
This handler retrieves the available credit and open a dialog where I then select the credit line to use as payment (I add the custTransRecid to the extension properties of TenderLine).
On OK on the dialog, I then calls the code that runs AddTenderLineToCartClientRequest/Response.
So similar to what is in PaymentMethodfViewmodelBase.Prototype.AddCartTenderLinetoCart(tenderline).
So why does it look for an operation id in the above trigger while there is no parameter to assign it to and I don't see nothign in the standard code for PayCash that at the point of adding the tenderLine that it uses the oprationId 200.
`
private _saveTenderToCart(_creditRecids: string, _correlationId: string, _operationId: number, _cart: ProxyEntities.Cart): any {
let deviceConfig: ProxyEntities.DeviceConfiguration = CommonHelper.GetDeviceConfigurationLocal();
let tenderTypeLocal: ProxyEntities.TenderType = TMC.Commerce.ApplicationContext.Instance.tenderTypesMap.getTenderTypeByOperationId(_operationId);
`
Any help is much appreciated to get the tenderline created so that it can flow through the conclude transaction.
Beta Was this translation helpful? Give feedback.
All reactions