/// <summary> /// /// </summary> /// <param name="credentials">PagSeguro credentials</param> /// <param name="transactionCode">Transaction Code</param> /// <param name="refundValue">Refund Value</param> /// <returns></returns> private static string BuildRefundURL(Credentials credentials, string transactionCode, decimal? refundValue) { QueryStringBuilder builder = new QueryStringBuilder(); builder.EncodeCredentialsAsQueryString(credentials); builder.Append("transactionCode", transactionCode); if (refundValue.HasValue) { builder.Append("refundValue", PagSeguroUtil.DecimalFormat(refundValue.Value)); } return builder.ToString(); }
/// <summary> /// /// </summary> /// <param name="credentials">PagSeguro credentials</param> /// <param name="transactionCode">Transaction Code</param> /// <returns></returns> private static string BuildCancelURL(Credentials credentials, string transactionCode) { QueryStringBuilder builder = new QueryStringBuilder(); builder.EncodeCredentialsAsQueryString(credentials); builder.Append("transactionCode", transactionCode); return builder.ToString(); }
/// <summary> /// /// </summary> /// <param name="credentials"></param> /// <param name="payment"></param> /// <returns></returns> internal static string BuildCheckoutUrl(Credentials credentials, PaymentRequest payment) { QueryStringBuilder builder = new QueryStringBuilder(); IDictionary<string, string> data = PaymentParse.GetData(payment); builder. EncodeCredentialsAsQueryString(credentials); foreach (KeyValuePair<string, string> pair in data) { builder.Append(pair.Key, pair.Value); } return builder.ToString(); }
/// <summary> /// /// </summary> /// <param name="credentials"></param> /// <param name="preApproval"></param> /// <returns></returns> internal static string BuildPreApprovalUrl(Credentials credentials, PreApprovalRequest preApproval) { QueryStringBuilder builder = new QueryStringBuilder(); IDictionary<string, string> data = PreApprovalParse.GetData(preApproval); builder. EncodeCredentialsAsQueryString(credentials); foreach (KeyValuePair<string, string> pair in data) { builder.Append(pair.Key, pair.Value); } return builder.ToString(); }
/// <summary> /// /// </summary> /// <param name="credentials"></param> /// <param name="payment"></param> /// <returns></returns> internal static string BuildTransactionUrl(Credentials credentials, Checkout checkout) { QueryStringBuilder builder = new QueryStringBuilder(); IDictionary<string, string> data = TransactionParse.GetData(checkout); builder. EncodeCredentialsAsQueryString(credentials); foreach (KeyValuePair<string, string> pair in data) { builder.Append(pair.Key, pair.Value); } return builder.ToString(); }
/// <summary> /// /// </summary> /// <param name="connection"></param> /// <param name="code"></param> /// <returns></returns> internal static string buildAuthorizationRequestUrl(Credentials credentials, AuthorizationRequest authorizationRequest) { QueryStringBuilder builder = new QueryStringBuilder(); IDictionary<string, string> data = AuthorizationParse.GetData(authorizationRequest); builder. EncodeCredentialsAsQueryString(credentials); foreach (KeyValuePair<string, string> pair in data) { builder.Append(pair.Key, pair.Value.ToString(CultureInfo.InvariantCulture)); } return HttpUtility.UrlDecode(builder.ToString()); }