Beispiel #1
0
        private void pay_Click(object sender, RoutedEventArgs e)
        {
            if (result.Text.Length > 7)
            {
                txtResponse.Text = "Invalid Amount.";
            }
            else
            {
                txtResponse.Text = "Processing ...";
                PaymentManager mgr = PaymentManager.Instance;

                mgr.setPaymentResponseListener(this);

                AuthParameters parameters = new AuthParameters();
                parameters.amount            = result.Text.Trim();
                parameters.amountOther       = "0";
                parameters.isQuickChip       = false;
                parameters.transactionOption = TRANSACTION_OPTION.Purchase;
                parameters.transactionMethod = PaymentSDK.ChecoutServiceReference.TransactionMethod.MSR_EMV_CL;
#if (SHIFT4)
                Shift4AuthParameters gwparams = new Shift4AuthParameters();
                gwparams.customerReference     = "";
                gwparams.destinationPostalCode = "";
                gwparams.invoice = "";
                //gwparams.surcharge = "";
                gwparams.tax = Settings.tax;
                gwparams.tip = Settings.tip;

                ObservableCollection <string> ob = new ObservableCollection <string>();

                ob.Add("salmon");
                ob.Add("tuna");
                gwparams.productDescriptors  = ob;
                parameters.gateWayParameters = gwparams;
#endif

#if (CREDITCALL)
                //Nothing required from cc prespective
#endif

                mgr.Pay(parameters);

                Settings.tax = null;
                Settings.tip = null;
            }
        }
Beispiel #2
0
        private void btnAuth_Click(object sender, RoutedEventArgs e)
        {
            txtResponse.Text = "Processing ...";

            PaymentManager mgr = PaymentManager.Instance;

            mgr.setPaymentResponseListener(this);
            AuthParameters authParameters = new AuthParameters();

            authParameters.amount            = result.Text.Trim();
            authParameters.amountOther       = "0";
            authParameters.transactionOption = TRANSACTION_OPTION.Purchase;
            authParameters.transactionMethod = PaymentSDK.ChecoutServiceReference.TransactionMethod.MSR_EMV_CL;

#if (SHIFT4)
            Shift4AuthParameters parameters = new Shift4AuthParameters();

            parameters.customerReference     = "";
            parameters.destinationPostalCode = "";
            parameters.surcharge             = "";
            parameters.tax = Settings.tax;
            parameters.tip = Settings.tip;

            ObservableCollection <string> ob = new ObservableCollection <string>();
            ob.Add("salmon");
            ob.Add("tuna");
            parameters.productDescriptors    = ob;
            authParameters.gateWayParameters = parameters;
#endif

#if (CREDITCALL)
            // No special parameter required for CreditCall in this case
#endif


            mgr.Auth(authParameters);
        }