Exemplo n.º 1
0
        public SinglePayeeCreditResult CreateSinglePayeeCredit(long alias, decimal amount, DateTime payDate,
                                                               PayforwardPaymentType payType)
        {
            var result = payClient.CreatePayforwardPayment(
                this.clientId, this.clientCode, alias,
                payDate, Convert.ToDouble(amount), (int)payType);

            var paymentResult = new SinglePayeeCreditResult();

            paymentResult.TransactionId = result;
            switch (result)
            {
            case -1:
                paymentResult.ErrorMessage = "Authentication with Payforward failed";
                break;

            case -2:
                paymentResult.ErrorMessage = "Customer alias not found";
                break;

            case -3:
                paymentResult.ErrorMessage = "An ACH payment was specified, but the customer has no bank account information.";
                break;

            case -6:
                paymentResult.ErrorMessage = "Invalid payment type";
                break;

            case -7:
                paymentResult.ErrorMessage         = "Duplicate payment";
                paymentResult.DuplicateTransaction = true;
                break;

            default:
                paymentResult.Accepted = true;
                break;
            }

            return(paymentResult);
        }
Exemplo n.º 2
0
        public SinglePayeeCreditResult CreateSinglePayeeCredit(long alias, decimal amount, DateTime payDate,
											  PayforwardPaymentType payType)
        {
            var result = payClient.CreatePayforwardPayment(
                this.clientId, this.clientCode, alias,
                payDate, Convert.ToDouble(amount), (int)payType);

            var paymentResult = new SinglePayeeCreditResult();
            paymentResult.TransactionId = result;
            switch(result)
            {
                case -1:
                    paymentResult.ErrorMessage = "Authentication with Payforward failed";
                    break;
                case -2:
                    paymentResult.ErrorMessage = "Customer alias not found";
                    break;
                case -3:
                    paymentResult.ErrorMessage = "An ACH payment was specified, but the customer has no bank account information.";
                    break;
                case -6:
                    paymentResult.ErrorMessage = "Invalid payment type";
                    break;
                case -7:
                    paymentResult.ErrorMessage = "Duplicate payment";
                    paymentResult.DuplicateTransaction = true;
                    break;
                default:
                    paymentResult.Accepted = true;
                    break;
            }

            return paymentResult;
        }