コード例 #1
0
ファイル: Confirmation.aspx.cs プロジェクト: waldronj/LaSuBu
 protected void MakePayment()
 {
     string userId = System.Configuration.ConfigurationManager.AppSettings["userId"].ToString();
     string password = System.Configuration.ConfigurationManager.AppSettings["password"].ToString();
     string signature = System.Configuration.ConfigurationManager.AppSettings["signature"].ToString();
     var configuration = new Moolah.PayPal.PayPalConfiguration(PaymentEnvironment.Live, userId, password, signature);
     var gateway = new Moolah.PayPal.PayPalExpressCheckout(configuration);
     var details = gateway.GetExpressCheckoutDetails(Request.QueryString["token"]);
     decimal amount = details.OrderDetails.OrderTotal;
     lblConfirm.Text = amount.ToString();
     lblConfirm.Text = Request.QueryString["token"] + " Was successfully placed";
     var response = gateway.DoExpressCheckoutPayment(amount, Moolah.PayPal.CurrencyCodeType.USD, Request["token"], Request["PayerID"]);
     if (response.Status == PaymentStatus.Failed)
     {
         if (response.IsSystemFailure)
             // System failures can indicate issues like a configuration problem
             throw new Exception(response.FailureMessage);
         else
             // Non-system failure messages can be shown directly to the customer
             lblConfirm.Text = response.FailureMessage.ToString();
     }
     else
     {
         lblConfirm.Text = string.Format("Transaction successful! <br />PayPal Reference: <strong>{0}</strong> <br /><br />Thank you {1} for paying online.", response.TransactionReference, Session["name"]);
         Session["transRef"] = response.TransactionReference;
     }
 }
コード例 #2
0
 public PayPalRequestBuilder(PayPalConfiguration configuration)
 {
     if (configuration == null)
     {
         throw new ArgumentNullException("configuration");
     }
     _configuration = configuration;
 }
コード例 #3
0
ファイル: PayPalResponseParser.cs プロジェクト: elacy/Moolah
 public PayPalResponseParser(PayPalConfiguration configuration)
 {
     if (configuration == null)
     {
         throw new ArgumentNullException("configuration");
     }
     _configuration = configuration;
 }
コード例 #4
0
 /// <summary>
 /// For testing.
 /// </summary>
 public PayPalExpressCheckout(PayPalConfiguration configuration, IHttpClient httpClient,
     IPayPalRequestBuilder requestBuilder, IPayPalResponseParser responseParser)
 {
     if (configuration == null) throw new ArgumentNullException("configuration");
     if (httpClient == null) throw new ArgumentNullException("httpClient");
     if (requestBuilder == null) throw new ArgumentNullException("requestBuilder");
     if (responseParser == null) throw new ArgumentNullException("responseParser");
     _configuration = configuration;
     _httpClient = httpClient;
     _requestBuilder = requestBuilder;
     _responseParser = responseParser;
 }
コード例 #5
0
ファイル: PayPalMassPay.cs プロジェクト: vo-ch/Moolah
 /// <summary>
 /// For testing.
 /// </summary>
 public PayPalMassPay(PayPalConfiguration configuration, IHttpClient httpClient,
                      IPayPalRequestBuilder requestBuilder, IPayPalResponseParser responseParser)
 {
     if (configuration == null)
     {
         throw new ArgumentNullException("configuration");
     }
     if (httpClient == null)
     {
         throw new ArgumentNullException("httpClient");
     }
     if (requestBuilder == null)
     {
         throw new ArgumentNullException("requestBuilder");
     }
     if (responseParser == null)
     {
         throw new ArgumentNullException("responseParser");
     }
     _configuration  = configuration;
     _httpClient     = httpClient;
     _requestBuilder = requestBuilder;
     _responseParser = responseParser;
 }
コード例 #6
0
ファイル: PayPalRequestBuilder.cs プロジェクト: kenkh/Moolah
 public PayPalRequestBuilder(PayPalConfiguration configuration)
 {
     if (configuration == null) throw new ArgumentNullException("configuration");
     _configuration = configuration;
 }
コード例 #7
0
 public PayPalExpressCheckout(PayPalConfiguration configuration)
     : this(configuration, new HttpClient(), new PayPalRequestBuilder(configuration), new PayPalResponseParser(configuration))
 {
 }
コード例 #8
0
ファイル: PayPalMassPay.cs プロジェクト: vo-ch/Moolah
 public PayPalMassPay(PayPalConfiguration configuration)
     : this(configuration, new HttpClient(), new PayPalRequestBuilder(configuration), new PayPalResponseParser(configuration))
 {
 }
コード例 #9
0
 public PayPalExpressCheckout(PayPalConfiguration configuration)
     : this(configuration, new HttpClient(), new PayPalRequestBuilder(configuration), new PayPalResponseParser(configuration))
 {
 }
コード例 #10
0
ファイル: PayPalResponseParser.cs プロジェクト: tjaart/Moolah
 public PayPalResponseParser(PayPalConfiguration configuration)
 {
     if (configuration == null) throw new ArgumentNullException("configuration");
     _configuration = configuration;
 }