Skip to content

Commit

Permalink
Correção dos erros provenientes do merge com o repositório original
Browse files Browse the repository at this point in the history
O repositório original foi aparentemente abandonado, e possui inúmeros erros de sintaxe em seu último commit.

As correções desse commit são apenas correções de sintaxe, e não devem impactar nas funcionalidades existentes na biblioteca.
  • Loading branch information
mirandaasm committed Jan 20, 2025
1 parent cbbfbf9 commit bf350de
Show file tree
Hide file tree
Showing 37 changed files with 381 additions and 522 deletions.
12 changes: 6 additions & 6 deletions source/Examples/Authorization/CreateAuthorization/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ static void Main(string[] args)

authorization.NotificationURL = "http://www.lojamodelo.com.br/notification";

authorization.addPermission(PermissionType.CREATE_CHECKOUTS);
authorization.addPermission(PermissionType.DIRECT_PAYMENT);
authorization.addPermission(PermissionType.MANAGE_PAYMENT_PRE_APPROVALS);
authorization.addPermission(PermissionType.RECEIVE_TRANSACTION_NOTIFICATIONS);
authorization.addPermission(PermissionType.SEARCH_TRANSACTIONS);
authorization.AddPermission(PermissionType.CREATE_CHECKOUTS);
authorization.AddPermission(PermissionType.DIRECT_PAYMENT);
authorization.AddPermission(PermissionType.MANAGE_PAYMENT_PRE_APPROVALS);
authorization.AddPermission(PermissionType.RECEIVE_TRANSACTION_NOTIFICATIONS);
authorization.AddPermission(PermissionType.SEARCH_TRANSACTIONS);

try
{
Expand All @@ -54,7 +54,7 @@ static void Main(string[] args)


}
catch (WebException exception)
catch (WebException)
{


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,16 @@ static void Main(string[] args)


}
catch (WebException exception)
catch (WebException)
{

}
catch (PagSeguroServiceException exception)
{


foreach (ServiceError element in exception.Errors)
{

}

}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,16 @@ static void Main(string[] args)
AuthorizationSearchResult result = AuthorizationSearchService.SearchByDate(credentials, initialDate, finalDate, pageNumber, maxPageResults);

}
catch (WebException exception)
catch (WebException)
{

}
catch (PagSeguroServiceException exception)
{


foreach (ServiceError element in exception.Errors)
{

}

}
}
}
Expand Down
16 changes: 8 additions & 8 deletions source/Examples/Checkout/SearchTransactionAbandoned/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@
// limitations under the License.

using System;
using System.Net;
using Uol.PagSeguro.Domain;
using Uol.PagSeguro.Exception;
using Uol.PagSeguro.Resources;
using Uol.PagSeguro.Service;
using System.Collections.Generic;

namespace SearchTransactionAbandoned
{
Expand Down Expand Up @@ -58,26 +56,28 @@ static void Main(string[] args)

if (result.Transactions.Count <= 0)
{
e("Nenhuma transação abandonada");
Console.WriteLine("Nenhuma transação abandonada");
}

foreach (TransactionSummary transaction in result.Transactions)
{

Console.WriteLine("Começando listagem de transações abandonadas - \n");
Console.WriteLine(transaction.ToString());
Console.WriteLine(" - Terminando listagem de transações abandonadas");
}


Console.ReadKey();

}
catch (PagSeguroServiceException exception)
{

Console.WriteLine(exception.Message + "\n");

foreach (ServiceError element in exception.Errors)
{

Console.WriteLine(element + "\n");
}

Console.ReadKey();
}
}
}
Expand Down
30 changes: 19 additions & 11 deletions source/Examples/DocExamples/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,14 @@ static void SenderExample()
);

paymentRequest.Sender = sender;
if (paymentRequest.Sender)
if (paymentRequest.Sender != null)
{

if (paymentRequest.Sender.Phone)
Console.WriteLine(paymentRequest.Sender.Name);
Console.WriteLine(paymentRequest.Sender.Email);
if (paymentRequest.Sender.Phone != null)
{

Console.WriteLine(paymentRequest.Sender.Phone.AreaCode);
Console.WriteLine(paymentRequest.Sender.Phone.Number);
}
}

Expand Down Expand Up @@ -159,7 +161,8 @@ static void SearchByCodeExample()
Transaction transaction =
TransactionSearchService.SearchByCode(credentials, transactionCode);


Console.WriteLine(transaction.TransactionStatus);
Console.WriteLine(transaction.GrossAmount);
}

static void PaymentMethodExample(Transaction transaction)
Expand Down Expand Up @@ -219,12 +222,14 @@ static void ShippingExample()

static void Shipping2Example(Transaction transaction)
{
if (transaction.Shipping)
if (transaction.Shipping != null)
{

if (transaction.Shipping.Address)
Console.WriteLine(transaction.Shipping.ShippingType);
Console.WriteLine(transaction.Shipping.Cost);
if (transaction.Shipping.Address != null)
{

Console.WriteLine(transaction.Shipping.Address.Street);
Console.WriteLine(transaction.Shipping.Address.Number);
}
}
}
Expand All @@ -247,7 +252,10 @@ static void ItemsExample(PaymentRequest paymentRequest)
{
foreach (Item item in paymentRequest.Items)
{

Console.WriteLine(item.Id);
Console.WriteLine(item.Description);
Console.WriteLine(item.Quantity);
Console.WriteLine(item.Amount);
}
}

Expand All @@ -270,7 +278,7 @@ static void SearchByCodeExample2()
transactionCode);

// Imprime o status da transação

Console.WriteLine(transaction.TransactionStatus);
}

static void SearchByDateExample()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,18 @@ static void Main(string[] args)

PreApprovalTransaction result = PreApprovalSearchService.SearchByNofication(credentials, notificationCode);


Console.WriteLine(result);
Console.ReadKey();
}
catch (PagSeguroServiceException exception)
{}
{
Console.WriteLine(exception.Message + "\n");

foreach (ServiceError element in exception.Errors)
{

Console.WriteLine(element + "\n");
}

Console.ReadKey();
}
}
}
Expand Down
31 changes: 8 additions & 23 deletions source/Uol.PagSeguro/Constants/BankName.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,41 +26,26 @@ public static class BankName
/// <summary>
/// Bradesco
/// </summary>
public static string Bradesco

{
get { return "bradesco"; }
}
public const string Bradesco = "bradesco";

/// <summary>
/// Itaú
/// </summary>
public const string Itau
{
get { return "itau"; }
}
public const string Itau = "itau";

/// <summary>
/// Banco do Brasil
/// </summary>
public static string BancoDoBrasil
{
get { return "bancodobrasil"; }
}
public const string BancoDoBrasil = "bancodobrasil";

/// <summary>
/// Banrisul
/// </summary>
public static string Banrisul
{
get { return "banrisul"; }
}
/// <summary>
public const string Banrisul = "banrisul";

/// <summary>
/// HSBC
/// </summary>
public static string HSBC
{
get { return "hsbc"; }
}

public const string HSBC= "hsbc";
}
}
5 changes: 1 addition & 4 deletions source/Uol.PagSeguro/Constants/Currency.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ public static class Currency
/// <summary>
/// Brazilian Real
/// </summary>
public const string Brl
{
get { return "BRL"; }
}
public const string Brl = "BRL";
}
}
29 changes: 9 additions & 20 deletions source/Uol.PagSeguro/Constants/ListPaymentMethodGroups.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,37 +23,26 @@ public static class ListPaymentMethodGroups
/// <summary>
/// PagSeguro Balance
/// </summary>
public static string Balance
{
get { return "BALANCE"; }
}
public const string Balance = "BALANCE";

/// <summary>
/// Boleto
/// </summary>
public static string Boleto
{
get { return "BOLETO"; }
}
public const string Boleto = "BOLETO";

/// <summary>
/// Credit card
/// </summary>
public static string CreditCard
{
get { return "CREDIT_CARD"; }
}
public const string CreditCard = "CREDIT_CARD";

/// <summary>
/// Deposit
/// </summary>
public static string Deposit
{
get { return "DEPOSIT"; }
}
public const string Deposit = "DEPOSIT";

/// <summary>
/// Online debit
/// </summary>
public static string ETF
{
get { return "EFT"; }
}
public const string ETF = "EFT";
}
}
Loading

0 comments on commit bf350de

Please sign in to comment.