コード例 #1
0
        //RefundTransaction
        public static string RefundTransaction(long profile_id, decimal amount, string CCNumber, string tranID, string description)
        {
            LastError = String.Empty;
            CustomerProfileWS.ProfileTransRefundType auth_capture = new Vauction.CustomerProfileWS.ProfileTransRefundType();
            auth_capture.amount                 = amount;
            auth_capture.customerProfileId      = profile_id;
            auth_capture.creditCardNumberMasked = "XXXX" + CCNumber;
            auth_capture.transId                = tranID;
            auth_capture.order             = new Vauction.CustomerProfileWS.OrderExType();
            auth_capture.order.description = description;
            CustomerProfileWS.ProfileTransactionType trans = new CustomerProfileWS.ProfileTransactionType();
            trans.Item = auth_capture;
            CustomerProfileWS.CreateCustomerProfileTransactionResponseType response = SoapAPIUtilities.Service.CreateCustomerProfileTransaction(SoapAPIUtilities.MerchantAuthentication, trans, null);
            if (response.resultCode == Vauction.CustomerProfileWS.MessageTypeEnum.Error)
            {
                SetLastError(response.messages);
            }
            string transactionID = String.Empty;

            if (response.resultCode == Vauction.CustomerProfileWS.MessageTypeEnum.Ok)
            {
                string[] par = response.directResponse.Split(new char[] { '|', ',' });
                transactionID = (par[6] != null) ? par[6] : String.Empty;
            }
            return(transactionID);
        }
コード例 #2
0
        //CreateTransactionForDeposit
        public static string CreateTransactionForDeposit(long profile_id, long payment_profile_id, long shipping_profile_id, decimal amount, CreditCardInfo cci, string descr)
        {
            LastError = String.Empty;
            CustomerProfileWS.ProfileTransAuthCaptureType auth_capture = new CustomerProfileWS.ProfileTransAuthCaptureType();
            auth_capture.customerProfileId        = profile_id;
            auth_capture.customerPaymentProfileId = payment_profile_id;
            auth_capture.amount                    = amount;
            auth_capture.order                     = new CustomerProfileWS.OrderExType();
            auth_capture.order.description         = descr;
            auth_capture.cardCode                  = cci.CardCode;
            auth_capture.customerShippingAddressId = shipping_profile_id;
            CustomerProfileWS.ProfileTransactionType trans = new CustomerProfileWS.ProfileTransactionType();
            trans.Item = auth_capture;
            CustomerProfileWS.CreateCustomerProfileTransactionResponseType response = SoapAPIUtilities.Service.CreateCustomerProfileTransaction(SoapAPIUtilities.MerchantAuthentication, trans, null);
            if (response.resultCode == Vauction.CustomerProfileWS.MessageTypeEnum.Error)
            {
                SetLastError(response.messages);
            }
            string transactionID = String.Empty;

            if (response.resultCode == Vauction.CustomerProfileWS.MessageTypeEnum.Ok)
            {
                string[] par = response.directResponse.Split(new char[] { '|', ',' });
                transactionID = (par[6] != null) ? par[6] : String.Empty;
            }
            return(transactionID);
        }