using System;
using System.Collections.Generic;
using System.Text;
using com.paypal.sdk.profiles;

namespace KashFlowPayPal.Classes
{
 
    public class SetProfile
    {



        /// <summary>
        /// Required designer variable.
        /// </summary
        public readonly static IAPIProfile DefaultProfile = CreateAPIProfile(PayPalConstants.API_USERNAME, PayPalConstants.API_PASSWORD, PayPalConstants.API_SIGNATURE, "", "", PayPalConstants.CERTIFICATE, PayPalConstants.PRIVATE_KEY_PASSWORD);
        public static IAPIProfile CreateAPIProfile(string apiUsername, string apiPassword, string signature, string CertificateFile_Sig, string APISignature_Sig, string CertificateFile_Cer, string PrivateKeyPassword_Cer)
        {
            //IAPIProfile profile = ProfileFactory.CreateAPIProfile();

                IAPIProfile profile = ProfileFactory.createSignatureAPIProfile();
                profile.APIUsername = apiUsername;
                profile.APIPassword = apiPassword;
                profile.Environment = PayPalConstants.ENVIRONMENT;

                profile.Subject = string.Empty;
                profile.APISignature = signature;
                return profile;
           
            //else
            //{
            //    IAPIProfile profile = ProfileFactory.createSSLAPIProfile();
            //    profile.APIUsername = apiUsername;
            //    profile.APIPassword = apiPassword;
            //    profile.Environment = Constants.ENVIRONMENT;

            //    profile.CertificateFile = CertificateFile_Cer;
            //    profile.PrivateKeyPassword = PrivateKeyPassword_Cer;
            //    profile.Subject = signature;
            //    //profile.Subject = string.Empty;
            //    //profile.APISignature = signature;
            //    return profile;
            //}



        }

    }
	
}
