PlacetoPay.Integrations.Library.CSharp
1.0.1
dotnet add package PlacetoPay.Integrations.Library.CSharp --version 1.0.1
NuGet\Install-Package PlacetoPay.Integrations.Library.CSharp -Version 1.0.1
<PackageReference Include="PlacetoPay.Integrations.Library.CSharp" Version="1.0.1" />
<PackageVersion Include="PlacetoPay.Integrations.Library.CSharp" Version="1.0.1" />
<PackageReference Include="PlacetoPay.Integrations.Library.CSharp" />
paket add PlacetoPay.Integrations.Library.CSharp --version 1.0.1
#r "nuget: PlacetoPay.Integrations.Library.CSharp, 1.0.1"
#:package PlacetoPay.Integrations.Library.CSharp@1.0.1
#addin nuget:?package=PlacetoPay.Integrations.Library.CSharp&version=1.0.1
#tool nuget:?package=PlacetoPay.Integrations.Library.CSharp&version=1.0.1
SDK Redirection for .Net Standard 2.0 (EN)
Refer to https://www.getnet.cl/developers for more information.
Requirements
- SoapHttpClient = v1.4.3
- RestSharp = v105.2.3
- Newtonsoft.Json = v10.0.1
Adding Dependency in Visual Studio
Go to Solution Explorer, expand project options and then:
Dependencies → Add Reference → Browse → Browse → Select dll → Accept
Authentication
Configure PlacetoPay instance required to authenticate against PlacetoPay web services.
Config:
using P2P = PlacetoPay.Integrations.Library.CSharp.PlacetoPay;
Gateway gateway = new P2P(YOUR_LOGIN, YOUR_TRANKEY, new Uri("URL_INTEGRATION"), Gateway.TP_SOAP or Gateway.TP_REST);
Create a New Payment Session
Requests the creation of a session (payment request or subscription) and returns the identifier and processing URL.
Example Call:
Amount amount = new Amount('PAYMENT_AMOUNT');
Payment payment = new Payment("REFERENCE", "DESCRIPTION", amount);
RedirectRequest request = new RedirectRequest(payment, RETURN_URL, IP_ADDRESS, USER_AGENT, EXPIRATION);
RedirectResponse response = gateway.Request(request);
Return:
Service responds with an instance of the RedirectResponse class. By checking the response status, you can determine if the payment session was created.
Success Response:
If status equals "OK" verify
response.IsSuccessful() // return boolean
Error Response:
If status equals "ERROR". Check error reason
response.Status.Message // return string
Get Session Information
Gets the information of the session and completed transactions.
Example Call:
RedirectInformation response = gateway.Query(requestId);
Return:
Service responds with an instance of the RedirectInformation class. You can verify the session status through
response.IsSuccessful() // return boolean
response.IsRejected() // return boolean
response.IsApproved() // return boolean
response.Status.status // return boolean
Charge Without User Intervention
Allows making charges without user intervention using previously subscribed payment methods.
Example Call:
Token token = new Token("YOUR_TOKEN");
Instrument instrument = new Instrument(token);
Person person = new Person(dni, type, Name, Surname, email);
Amount amount = new Amount(1000);
Payment payment = new Payment("123456789", "TEST", amount);
CollectRequest collectRequest = new CollectRequest(person, payment, instrument);
RedirectInformation collect = this.gateway.Collect(collectRequest);
Return:
Service responds with an instance of the RedirectInformation class. You can verify the session status through:
response.IsSuccessful() // return boolean
response.IsRejected() // return boolean
response.IsApproved() // return boolean
response.Status.status // return boolean
Reverse a Payment
Allows reversing an approved payment using the internal reference code.
Example Call:
ReverseResponse response = this.gateway.Reverse(requestId);
Return:
Service responds with an instance of the ReverseResponse class. You can verify the session status through:
response.IsSuccessful() // return boolean
response.Status.status // return boolean
SDK Redirection for .Net Standard 2.0 (ES)
Refer to https://www.getnet.cl/developers for more information.
Requerimientos
- SoapHttpClient = v1.4.3
- RestSharp = v105.2.3
- Newtonsoft.Json = v10.0.1
Agregar dependencia en Visual Studio
Ir al explorador de soluciones, desplegar las opciones delproyecto y luego:
Dependencias → agregar referencia → examinar → examinar → seleccionar dll → Aceptar
Autenticación
Configurar instancia PlacetoPay necesaria para autenticarse ante los servicios web de PlacetoPay.
Config:
using P2P = PlacetoPay.Integrations.Library.CSharp.PlacetoPay;
Gateway gateway = new P2P(YOUR_LOGIN, YOUR_TRANKEY, new Uri("URL_INTEGRATION"), Gateway.TP_SOAP or Gateway.TP_REST);
Crear una nueva sesión de pago
Solicita la creación de la sesión (petición de cobro o suscripción) y retorna el identificador y la URL de procesamiento.
Ejemplo de llamada:
Amount amount = new Amount('PAYMENT_AMOUNT');
Payment payment = new Payment("REFERENCE", "DESCRIPTION", amount);
RedirectRequest request = new RedirectRequest(payment, RETURN_URL, IP_ADDRESS, USER_AGENT, EXPIRATION);
RedirectResponse response = gateway.Request(request);
Retorno:
Servicio responde una instancia de la clase RedirectResponse. Verificando el status de la respuesta se puede determinar si se creó la session de pago.
Success Response:
Si el status es igual a “OK” verifica
response.IsSuccessful() // return boolean
Error Response:
Si el status es igual a “ERROR”. Verificar motivo del error
response.Status.Message // return string
Obtenga información sobre una sesión
Obtiene la información de la sesión y transacciones realizadas.
Ejemplo de llamada:
RedirectInformation response = gateway.Query(requestId);
Retorno:
Servicio responde una instancia de la clase RedirectInformation. Se puede verificar el status de la sesión a través
response.IsSuccessful() // return boolean
response.IsRejected() // return boolean
response.IsApproved() // return boolean
response.Status.status // return boolean
Cobro sin intervención del usuario
Permite realizar cobros sin la intervención del usuario usando medios de pago previamente suscritos.
Ejemplo de llamada:
Token token = new Token(“YOUR_TOKEN”);
Instrument instrument = new Instrument(token);
Person person = new Person(dni, type, Name, Surname, email);
Amount amount = new Amount(1000);
Payment payment = new Payment("123456789", "TEST", amount);
CollectRequest collectRequest = new CollectRequest(person, payment, instrument);
RedirectInformation collect = this.gateway.Collect(collectRequest);
Retorno:
Servicio responde una instancia de la clase RedirectInformation. Se puede verificar el status de la sesión a través:
response.IsSuccessful() // return boolean
response.IsRejected() // return boolean
response.IsApproved() // return boolean
response.Status.status // return boolean
Revertir un pago
Permite revertir un pago aprobado con el código de referencia interna.
Ejemplo de llamada:
ReverseResponse response = this.gateway.Reverse(requestId);
Retorno:
Servicio responde una instancia de la clase ReverseResponse. Se puede verificar el status de la sesión a través:
response.IsSuccessful() // return boolean
response.Status.status // return boolean
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Microsoft.CSharp (>= 4.7.0)
- Newtonsoft.Json (>= 13.0.3)
- RestSharp (>= 106.15.0)
- System.ServiceModel.Http (>= 4.10.0)
- System.ServiceModel.Primitives (>= 4.10.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.