Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 26 additions & 3 deletions source/Configuration/PagSeguroConfig.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,41 @@
<Payment>
<Link>https://ws.pagseguro.uol.com.br/v2/checkout</Link>
</Payment>
<!-- url for payment service -->
<!-- url for paymentRedirect service -->
<PaymentRedirect>
<Link>https://pagseguro.uol.com.br/v2/checkout/payment.html</Link>
</PaymentRedirect>
<!-- url for payment service -->
<!-- url for notifications service -->
<Notification>
<Link>https://ws.pagseguro.uol.com.br/v2/transactions/notifications</Link>
</Notification>
<!-- url for payment service -->
<!-- url for transactions service -->
<Search>
<Link>https://ws.pagseguro.uol.com.br/v2/transactions</Link>
</Search>
<!-- url for preApproval request service -->
<PreApproval>
<Link>https://ws.pagseguro.uol.com.br/v2/pre-approvals/request</Link>
</PreApproval>
<!-- url for preApprovalRedirect service -->
<PreApprovalRedirect>
<Link>https://pagseguro.uol.com.br/v2/pre-approvals/request.html</Link>
</PreApprovalRedirect>
<!-- url for preApproval notifications service -->
<PreApprovalNotification>
<Link>https://ws.pagseguro.uol.com.br/v2/pre-approvals/notifications</Link>
</PreApprovalNotification>
<!-- url for preApproval transactions service -->
<PreApprovalSearch>
<Link>https://ws.pagseguro.uol.com.br/v2/pre-approvals</Link>
</PreApprovalSearch>
<!-- url for preApproval cancel service -->
<PreApprovalCancel>
<Link>https://ws.pagseguro.uol.com.br/v2/pre-approvals/cancel</Link>
</PreApprovalCancel>
<PreApprovalPayment>
<Link>https://ws.pagseguro.uol.com.br/v2/pre-approvals/payment</Link>
</PreApprovalPayment>
</Urls>
<!-- user's credential -->
<Credential>
Expand Down
58 changes: 58 additions & 0 deletions source/Examples/CancelPreApproval/CancelPreApproval.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{EE47C281-48C4-486C-9F0D-7CD78EF8F266}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CancelPreApproval</RootNamespace>
<AssemblyName>CancelPreApproval</AssemblyName>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Uol.PagSeguro\Uol.PagSeguro.csproj">
<Project>{BABC5658-6AFD-4F8E-81F1-434553663D99}</Project>
<Name>Uol.PagSeguro</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<?xml version="1.0" encoding="UTF-8"?>
<PagSeguroConfiguration>
<!-- Urls defaults for call services PagSeguro -->
<Urls>
<!-- url for payment service -->
<Payment>
<Link>https://ws.pagseguro.uol.com.br/v2/checkout</Link>
</Payment>
<!-- url for paymentRedirect service -->
<PaymentRedirect>
<Link>https://pagseguro.uol.com.br/v2/checkout/payment.html</Link>
</PaymentRedirect>
<!-- url for notifications service -->
<Notification>
<Link>https://ws.pagseguro.uol.com.br/v2/transactions/notifications</Link>
</Notification>
<!-- url for transactions service -->
<Search>
<Link>https://ws.pagseguro.uol.com.br/v2/transactions</Link>
</Search>
<!-- url for preApproval request service -->
<PreApproval>
<Link>https://ws.pagseguro.uol.com.br/v2/pre-approvals/request</Link>
</PreApproval>
<!-- url for preApprovalRedirect service -->
<PreApprovalRedirect>
<Link>https://pagseguro.uol.com.br/v2/pre-approvals/request.html</Link>
</PreApprovalRedirect>
<!-- url for preApproval notifications service -->
<PreApprovalNotification>
<Link>https://ws.pagseguro.uol.com.br/v2/pre-approvals/notifications</Link>
</PreApprovalNotification>
<!-- url for preApproval transactions service -->
<PreApprovalSearch>
<Link>https://ws.pagseguro.uol.com.br/v2/pre-approvals</Link>
</PreApprovalSearch>
<!-- url for preApproval cancel service -->
<PreApprovalCancel>
<Link>https://ws.pagseguro.uol.com.br/v2/pre-approvals/cancel</Link>
</PreApprovalCancel>
<PreApprovalPayment>
<Link>https://ws.pagseguro.uol.com.br/v2/pre-approvals/payment</Link>
</PreApprovalPayment>
</Urls>
<!-- user's credential -->
<Credential>
<!-- your email here -->
<Email />
<!-- your token here -->
<Token />
</Credential>
<!-- configuration default for PagSeguro API-->
<Configuration>
<!-- version library API PagSeguro .NET C# -->
<LibVersion>2.0.4</LibVersion>
<!-- content type -->
<FormUrlEncoded>application/x-www-form-urlencoded</FormUrlEncoded>
<!-- encoding of the outcoming/incoming communication to/from PagSeguro API -->
<Encoding>ISO-8859-1</Encoding>
<!-- default request timeout for call service -->
<RequestTimeout>10000</RequestTimeout>
</Configuration>
</PagSeguroConfiguration>
50 changes: 50 additions & 0 deletions source/Examples/CancelPreApproval/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// Copyright [2011] [PagSeguro Internet Ltda.]
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// 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;

namespace CancelPreApproval
{
class Program
{
static void Main(string[] args)
{
// TODO: Substitute the parameters below with your credentials
//AccountCredentials credentials = new AccountCredentials("[email protected]", "your_token_here");
AccountCredentials credentials = PagSeguroConfiguration.Credentials;

try
{
// TODO: Substitute the code below with a valid transaction code for your transaction
bool cancelResult = PreApprovalService.CancelPreApproval(credentials, "610CAACE8A8ABA0BB4EA9F864DA11A43");

Console.WriteLine(cancelResult);
Console.ReadKey();
}
catch (PagSeguroServiceException exception)
{
if (exception.StatusCode == HttpStatusCode.Unauthorized)
{
Console.WriteLine("Unauthorized: please verify if the credentials used in the web service call are correct.\n");
}
Console.ReadKey();
}
}
}
}
36 changes: 36 additions & 0 deletions source/Examples/CancelPreApproval/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("CancelPreApproval")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CancelPreApproval")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("d2abcd87-9624-44ce-bb77-53e16f664dc7")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
29 changes: 26 additions & 3 deletions source/Examples/CreatePayment/Configuration/PagSeguroConfig.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,41 @@
<Payment>
<Link>https://ws.pagseguro.uol.com.br/v2/checkout</Link>
</Payment>
<!-- url for payment service -->
<!-- url for paymentRedirect service -->
<PaymentRedirect>
<Link>https://pagseguro.uol.com.br/v2/checkout/payment.html</Link>
</PaymentRedirect>
<!-- url for payment service -->
<!-- url for notifications service -->
<Notification>
<Link>https://ws.pagseguro.uol.com.br/v2/transactions/notifications</Link>
</Notification>
<!-- url for payment service -->
<!-- url for transactions service -->
<Search>
<Link>https://ws.pagseguro.uol.com.br/v2/transactions</Link>
</Search>
<!-- url for preApproval request service -->
<PreApproval>
<Link>https://ws.pagseguro.uol.com.br/v2/pre-approvals/request</Link>
</PreApproval>
<!-- url for preApprovalRedirect service -->
<PreApprovalRedirect>
<Link>https://pagseguro.uol.com.br/v2/pre-approvals/request.html</Link>
</PreApprovalRedirect>
<!-- url for preApproval notifications service -->
<PreApprovalNotification>
<Link>https://ws.pagseguro.uol.com.br/v2/pre-approvals/notifications</Link>
</PreApprovalNotification>
<!-- url for preApproval transactions service -->
<PreApprovalSearch>
<Link>https://ws.pagseguro.uol.com.br/v2/pre-approvals</Link>
</PreApprovalSearch>
<!-- url for preApproval cancel service -->
<PreApprovalCancel>
<Link>https://ws.pagseguro.uol.com.br/v2/pre-approvals/cancel</Link>
</PreApprovalCancel>
<PreApprovalPayment>
<Link>https://ws.pagseguro.uol.com.br/v2/pre-approvals/payment</Link>
</PreApprovalPayment>
</Urls>
<!-- user's credential -->
<Credential>
Expand Down
34 changes: 34 additions & 0 deletions source/Examples/CreatePayment/CreatePayment.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,21 @@
<AssemblyName>CreatePayment</AssemblyName>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
Expand All @@ -22,6 +37,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<PlatformTarget>x86</PlatformTarget>
Expand All @@ -31,6 +47,7 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
Expand All @@ -47,6 +64,23 @@
<Name>Uol.PagSeguro</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
<Visible>False</Visible>
<ProductName>Windows Installer 3.1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
Loading