Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all articles
Browse latest Browse all 72043

Retail POS SDK 2012 - Custom payment handling

$
0
0

Hi all,

How do I simulate a cash payment tender as per the standard POS functionality?

Reason is, I added custom functionality within frmPayCash that relies on reading the actual user entry with the purpose of ultimately placing it into the transaction for subsequent processing (during saving, printing, etc.).

I've extended the standard PaymentTriggers project and my code looks like this at the moment (code abbreviated for simplicity):

public void PrePayment(IPreTriggerResult preTriggerResult, IPosTransaction posTransaction, object posOperation, string tenderId)
{
	switch ((PosisOperations)posOperation)
	{
		case PosisOperations.PayCash:
			PayCashConfirmation confirmationRequest = new PayCashConfirmation();
			frmPayCash payCashForm = frmPayCash(confirmationRequest);
			PosApplication.Instance.ApplicationFramework.POSShowForm(payCashForm);
			PayCashConfirmation confirmationResponse = payCashForm.GetResults<PayCashConfirmation>();
			if (confirmationResponse.OperationDone)
			{
				transaction.PartnerObject = payCashForm.CustomDataObject;
			}

			// Somehow simulate the PreRegisterPayment and OnPayment triggers
			???

			// This cancels the entire operation
			preTriggerResult.ContinueOperation = false;
			break;
		...


 

If I set ContinueOperation to false then the entire payment is cancelled.  If I set it to true then frmPayCash is displayed again by the standard POS functionality.  Hence why I'm looking to simulate the standard POS functionality (which may be a part cash payment or a finalised cash payment).

Any advice is welcome.

Thank you,

John


Viewing all articles
Browse latest Browse all 72043

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>