Example #1
0
        public StorePaymentMethod_Result StorePaymentMethod(StorePaymentMethod_Details details)
        {
            var client = new PaymentGatewayLibrary.VCSTokenisation.Svc_VirtualRecur();

            var token = ShortStringCreator.Create(15);

            var result = client.AddCCTransaction(
                new PaymentGatewayLibrary.VCSTokenisation.AddCCRequest
            {
                UserID          = userID,
                UserName        = UserName,
                Password        = Password,
                ReferenceNumber = token,     //the tokenization token
                CardNumber      = details.CardNumber,
                CardExpiryYY    = details.CardExpiryYear.ToString(),
                CardExpiryMM    = details.CardExpiryMonth.ToString(),
                CVC             = details.CardCVV,
                CardHolderName  = details.CardHolderFullName,
                StartDate       = DateTime.Now.AddDays(1).ToString("yyyy'/'MM'/'dd"), //"2016/04/29",//otherwise complains that it should be in future if set to DateTime.Now
                Frequency       = "O",                                                //on demand
                OccurCount      = "U",                                                //unlimited
                MerchantVar1    = details.ClientIdentifier,
            });

            var return_result = new StorePaymentMethod_Result {
                CardToken = token, ErrorCode = result.ResultCode, ErrorMessage = result.ResultMessage, isSuccess = int.Parse(result.ResultCode) == 0
            };

            //if (paymentOptions.ThreeDSecure && details.doThreeDSecure)
            //{
            //    return_result.ThreeDSecurePost = Lookup3dSecure(new Lookup3dSecure_Details { ProviderToken = return_result.CardToken, ExternalIdentifier1 = details.ClientIdentifier, ExternalIdentifier2 = details.CardIdentifier }).ThreeDSecurePost;
            //}

            return(return_result);
        }
Example #2
0
        public RevokePaymentMethod_Result RevokePaymentMethod(RevokePaymentMethod_Details details)
        {
            var client = new PaymentGatewayLibrary.VCSTokenisation.Svc_VirtualRecur();
            var result = client.DeleteCCTransaction(new PaymentGatewayLibrary.VCSTokenisation.DeleteCCRequest {
                UserID = userID, UserName = UserName, Password = Password, ReferenceNumber = details.CardToken
            });

            return(new RevokePaymentMethod_Result {
                ErrorCode = result.ResultCode, ErrorMessage = result.ResultMessage, isSuccess = int.Parse(result.ResultCode) == 0
            });
        }