### Start PATPASS Subscription in Python Source: https://www.transbankdevelopers.cl/documentacion/patpass Initiates a PATPASS subscription using the Transbank Python SDK. This example shows how to set up the inscription object and call the start method with all necessary details. ```Python file_copy inscription = Inscription(PatpassComercioOptions("commerceCode", "APIKey", IntegrationType.TEST)) return_url = "https://callback_url/resultado/de/la/transaccion" name = "Nombre" first_last_name = "Primer Apellido" second_last_name = "Segundo Apellido" rut = "11111111-1" service_id = "Identificador del servicio unico de suscripción" final_url = "https://callback/final/comprobante/transacción" max_amount = 10000; # monto máximo de la suscripció phone_number = "numero telefono fijo de suscrito" mobile_number = "numero de telefono móvil de suscrito" patpass_name = "Nombre asignado a la suscripción" person_email = "Correo de suscrito" commerce_mail = "Correo de comercio" address = "Dirección de Suscrito" city = "Ciudad de suscrito" resp = inscription.start(return_url, name, first_last_name, second_last_name, rut, service_id, None, max_amount, phone_number, mobile_number, patpass_name, person_email, commerce_mail, address, city) ``` -------------------------------- ### Install Transbank POS SDK for Python Source: https://www.transbankdevelopers.cl/documentacion/posintegrado Install the Transbank POS SDK for Python from PyPI using pip. ```bash pip install transbank-pos-sdk ``` -------------------------------- ### Install Transbank POS SDK for Web (JavaScript) Source: https://www.transbankdevelopers.cl/documentacion/posintegrado Install the transbank-pos-sdk-web package for web integrations using npm. ```bash npm install transbank-pos-sdk-web ``` -------------------------------- ### Start PATPASS Subscription in Node.js Source: https://www.transbankdevelopers.cl/documentacion/patpass Initiates a PATPASS subscription using the Transbank Node.js SDK. This example demonstrates setting up options and calling the inscription start method with all required parameters. ```Node.js file_copy const options = new Options( "commerceCode", "APIKey", PatpassEnvironment.Integration ); const inscription = new PatpassComercio.Inscription(options); var returnUrl ="https://callback_url/resultado/de/la/transaccion" var name = "Nombre"; var firstLastName = "Primer Apellido" var secondLastName = "Segundo Apellido" var rut = "11111111-1" var serviceId = "Identificador del servicio único de suscripción" var finalUrl = "https://callback/final/comprobante/transaccion" var maxAmount = 10000; # monto máximo de la suscripción" var phoneNumber = "Numero telefono fijo de suscrito" var mobileNumber = "Numero telefono móvil de suscrito"; var patpassName = "Nombre asignado a la suscripción" var personEmail = "Correo de suscrito" var commerceEmail = "Correo de comercio" var address = "Dirección de suscrit" var city = "Ciudad de suscrito" const resp = await inscription.start( returnUrl, name, firstLastName, secondLastName, rut, serviceId, finalUrl, maxAmount, phoneNumber, mobileNumber, patpassName, personEmail, commerceEmail, address, city ); ``` -------------------------------- ### Install Transbank POS SDK for .NET Source: https://www.transbankdevelopers.cl/documentacion/pos-autoservicio Install the Transbank POS SDK for .NET using the Package Manager Console in Visual Studio. ```powershell PM> Install-Package TransbankPosSDK ``` -------------------------------- ### Configure Transbank Products with Options Object (PHP) Source: https://www.transbankdevelopers.cl/documentacion/como_empezar Demonstrates initializing Transbank products using the Options object constructor. This method is applicable to all products. ```PHP /** * Todos los productos se pueden configurar de 2 formas: * 1.- Pasando un objeto Options en su constructor. * 2.- Utilizando los nuevos métodos de configuración */ //Uso del objeto Options (aplicable a todos los productos) use Transbank\Webpay\Options; use Transbank\Webpay\WebpayPlus\Transaction; $option = new Options($apiKey, $commerceCode, Options::ENVIRONMENT_PRODUCTION); $transaction = new Transaction($option); ``` ```PHP //Uso del objeto Options (aplicable a todos los productos) use Transbank\Webpay\Options; use Transbank\Webpay\WebpayPlus\Transaction; $option = new Options($apiKey, $commerceCode, Options::ENVIRONMENT_PRODUCTION); $transaction = new Transaction($option); ``` ```PHP //Uso del objeto Options $options = new Options($apiKey, $commerceCode, Options::ENVIRONMENT_PRODUCTION); $inscription = new Inscription($options); ``` -------------------------------- ### Installment Response JSON Source: https://www.transbankdevelopers.cl/referencia/transaccion-completa Example JSON response structure for installment queries, detailing amounts, IDs, and deferred periods. ```json file_copy200 OK Content-Type: application/json { "installments_amount": 3334, "id_query_installments": 11, "deferred_periods": [ { "amount": 1000, "period": 1 } ] } ``` -------------------------------- ### Get Installment Details (Ruby) Source: https://www.transbankdevelopers.cl/referencia/transaccion-completa Retrieves installment details from the response object in Ruby. Accesses deferred periods and their amounts and periods. ```ruby file_copyresponse.installment_amount response.id_query_installment deferred_period = response.deferred_periods[0] deferred_period.amount deferred_period.period ``` -------------------------------- ### Configure Transbank Products with Options Object (C#) Source: https://www.transbankdevelopers.cl/documentacion/como_empezar Demonstrates initializing Transbank products using the Options object constructor in C#. This method is applicable to all products. ```C# //Uso del objeto Options (aplicable a todos los productos) using Transbank.Webpay.Common; using Transbank.Webpay.WebpayPlus; var tx = new Transaction(new Options("commerceCode", "APIKey", WebpayIntegrationType.Live )); ``` ```C# //Uso del objeto Options using Transbank.PatpassComercio; using Transbank.Common; Inscription inscription = new Inscription(new Options("commerceCode", "APIKey", PatpassComercioIntegrationType.Live )); ``` -------------------------------- ### Get Installment Details (Python) Source: https://www.transbankdevelopers.cl/referencia/transaccion-completa Retrieves installment details from the response object in Python. Accesses deferred periods and their amounts and periods. ```python file_copyresponse.installments_amount response.id_query_installments deferred_period = response.deferred_periods[0] deferred_period.amount deferred_period.period ``` -------------------------------- ### Configure Transbank Products with Options Object (Ruby) Source: https://www.transbankdevelopers.cl/documentacion/como_empezar Demonstrates initializing Transbank products using the Options object constructor in Ruby. This method is applicable to all products. ```Ruby # Uso del objeto Options (aplicable a todos los productos) @options = Transbank::Webpay::Options.new("commerceCode", "APIKey", :production) @transaction = Transbank::Webpay::WebpayPlus::Transaction.new(@options) ``` ```Ruby # Uso del objeto Options @options = Transbank::Patpass::Options.new("commerceCode", "APIKey", :production); @inscription = Transbank::Patpass::PatpassComercio::Inscription.new(@options); ``` -------------------------------- ### Instalar SDK .NET con Package Manager Source: https://www.transbankdevelopers.cl/documentacion/como_empezar Utiliza este comando en el Package Manager de Visual Studio para instalar el SDK de .NET de Transbank. ```powershell PM> Install-Package TransbankSDK ``` -------------------------------- ### Get Installment Details (C#) Source: https://www.transbankdevelopers.cl/referencia/transaccion-completa Retrieves installment details from the response object in C#. Accesses deferred periods and their amounts and periods. ```csharp file_copyresponse.InstallmentsAmount; response.IdQueryInstallments; var deferredPeriod = response.DeferredPeriods[0]; deferredPeriod.Amount; deferredPeriod.Period; ``` -------------------------------- ### Get Installment Details (Java) Source: https://www.transbankdevelopers.cl/referencia/transaccion-completa Retrieves installment details from the response object in Java. Accesses the deferred periods and their amounts and periods. ```java file_copyresponse.getInstallmentsAmount(); response.getIdQueryInstallments(); DeferredPeriod deferredPeriod = response.getDeferredPeriods()[0]; deferredPeriod.getAmount(); deferredPeriod.getPeriod(); ``` -------------------------------- ### Get Installment Details (PHP) Source: https://www.transbankdevelopers.cl/referencia/transaccion-completa Retrieves installment details from the response object in PHP. Includes a check for the existence of deferred periods before accessing them. ```php file_copy$firstResponse = $response[0]; $firstResponse->getInstallmentsAmount(); $firstResponse->getIdQueryInstallments(); $deferredPeriods = $firstResponse->getDeferredPeriods(); if (isset($deferredPeriods[0])) { $deferredPeriod = $deferredPeriods[0]; $deferredPeriod->getAmount(); $deferredPeriod->getPeriod(); } ``` -------------------------------- ### Get Mall Transaction Status (Node.js) Source: https://www.transbankdevelopers.cl/documentacion/webpay-plus Use this snippet to get the status of a mall transaction in Node.js. Requires integration setup with commerce code and API key. ```javascript const mallTransaction = WebpayPlus.MallTransaction.buildForIntegration( "commerceCode", "APIKey" ); const response = await mallTransaction.status(token); ``` -------------------------------- ### Import POSIntegrado SDK (C) Source: https://www.transbankdevelopers.cl/documentacion/posintegrado Include header files for the Transbank SDK in C. ```c #include "transbank.h" #include "transbank_serial_utils.h" ``` -------------------------------- ### Get Mall Transaction Status (Python) Source: https://www.transbankdevelopers.cl/documentacion/webpay-plus Use this snippet to get the status of a mall transaction in Python. Requires integration setup with commerce code and API key. ```python mall_tx = MallTransaction.build_for_integration("commerceCode", "APIKey") resp = mall_tx.status(token) ``` -------------------------------- ### Initialization Response Example (JSON) Source: https://www.transbankdevelopers.cl/referencia/posautoservicio A sample JSON object representing a successful initialization response. ```json { "FunctionCode": 1080, "ResponseCode": 0, "ResponseMessage": "Aprobado", "Success": true, "Real Date": "28/10/2019 22:35:12" } ``` -------------------------------- ### Initialize POS Autoservicio SDK (Node.js) Source: https://www.transbankdevelopers.cl/documentacion/pos-autoservicio Import and instantiate the POSAutoservicio class in Node.js. ```Node.js const { POSAutoservicio } = require('transbank-pos-sdk'); const pos = new POSAutoservicio() ``` -------------------------------- ### Get Mall Transaction Status (Ruby) Source: https://www.transbankdevelopers.cl/documentacion/webpay-plus Use this snippet to get the status of a mall transaction in Ruby. Requires integration setup with commerce code and API key. ```ruby @mall_transaction = Transbank::Webpay::WebpayPlus::MallTransaction.build_for_integration("commerceCode", "APIKey"); @resp = @mall_transaction.status(token: @token); ``` -------------------------------- ### Run Magento Setup Commands Source: https://www.transbankdevelopers.cl/plugin/magento/webpay Execute these Magento commands after enabling the module to complete the setup, including dependency injection compilation and static content deployment. ```bash magento setup:upgrade && magento setup:di:compile && magento setup:static-content:deploy ``` -------------------------------- ### Get Mall Transaction Status (.NET) Source: https://www.transbankdevelopers.cl/documentacion/webpay-plus Use this snippet to get the status of a mall transaction in .NET. Requires integration setup with commerce code and API key. ```csharp MallTransaction mallTransaction = MallTransaction.buildForIntegration("commerceCode", "APIKey"); var response = mallTransaction.Status(token); ``` -------------------------------- ### Get Mall Transaction Status (PHP) Source: https://www.transbankdevelopers.cl/documentacion/webpay-plus Use this snippet to get the status of a mall transaction in PHP. Requires integration setup with API key and commerce code. ```php $mallTransaction = MallTransaction::buildForIntegration($apiKey, $commerceCode); $response = $mallTransaction->status($token); ``` -------------------------------- ### Instalar SDK Python con Pip Source: https://www.transbankdevelopers.cl/documentacion/como_empezar Instala el SDK de Python de Transbank desde PyPI usando este comando. ```bash pip install transbank-sdk ``` -------------------------------- ### Get Mall Transaction Status (Java) Source: https://www.transbankdevelopers.cl/documentacion/webpay-plus Use this snippet to get the status of a mall transaction in Java. Requires integration setup with commerce code and API key. ```java WebpayPlus.MallTransaction mallTransaction = WebpayPlus.MallTransaction.buildForIntegration("commerceCode", "APIKey"); final WebpayPlusMallTransactionStatusResponse response = mallTransaction.status(token); ``` -------------------------------- ### Configure Transbank Products with Configuration Methods (C#) Source: https://www.transbankdevelopers.cl/documentacion/como_empezar Shows how to configure Transbank products using their respective build methods in C#. This is an alternative to the Options object constructor. ```C# //Uso de los método de configuración //Webpay Plus using Transbank.Webpay.WebpayPlus; Transaction transaction = Transaction.buildForProduction("commerceCode", "APIKey"); MallTransaction mallTransaction = MallTransaction.buildForProduction("commerceCode", "APIKey"); //Oneclick using Transbank.Webpay.Oneclick; MallInscription mallInscription = MallInscription.buildForProduction("commerceCode", "APIKey"); MallTransaction mallTransaction = MallTransaction.buildForProduction("commerceCode", "APIKey"); // Transacción Completa using Transbank.Webpay.TransaccionCompleta; using Transbank.Webpay.TransaccionCompletaMall; FullTransaction fullTransaction = FullTransaction.buildForProduction("commerceCode", "APIKey"); MallFullTransaction mallFullTransaction = MallFullTransaction.buildForProduction("commerceCode", "APIKey"); // PatPass Comercio // Es importante destacar que la clase IntegrationType para PatPass se importa desde una ruta distinta que en el resto de productos. using Transbank.PatpassComercio; //Uso del método de configuración Inscription inscription = Inscription.buildForProduction("commerceCode", "APIKey"); ``` -------------------------------- ### Configure Transbank Products with Configuration Methods (PHP) Source: https://www.transbankdevelopers.cl/documentacion/como_empezar Shows how to configure Transbank products using their respective build methods. This is an alternative to the Options object constructor. ```PHP //Uso de los métodos de configuración //Webpay Plus use Transbank\Webpay\WebpayPlus\Transaction; use Transbank\Webpay\WebpayPlus\MallTransaction; $transaction = Transaction::buildForProduction($apiKey, $commerceCode); $mallTransaction = MallTransaction::buildForProduction($apiKey, $commerceCode); //Oneclick use Transbank\Webpay\Oneclick\MallInscription; use Transbank\Webpay\Oneclick\MallTransaction; $mallInscription = MallInscription::buildForProduction($apiKey, $commerceCode); $mallTransaction = MallTransaction::buildForProduction($apiKey, $commerceCode); // PatPass Comercio // Es importante destacar que la clase Options para PatPass se importa desde una ruta distinta que en el resto de productos. use Transbank\PatpassComercio\Options; use Transbank\PatpassComercio\Inscription; //Uso del método de configuración $inscription = Inscription::buildForProduction($apiKey, $commerceCode); ``` ```PHP //Uso de los métodos de configuración //Webpay Plus $transaction = Transaction::buildForProduction($apiKey, $commerceCode); $mallTransaction = MallTransaction::buildForProduction($apiKey, $commerceCode); //Oneclick $mallInscription = MallInscription::buildForProduction($apiKey, $commerceCode); $mallTransaction = MallTransaction::buildForProduction($apiKey, $commerceCode); // PatPass Comercio // Es importante destacar que la clase Options para PatPass se importa desde una ruta distinta que en el resto de productos. //Uso del método de configuración $inscription = Inscription::buildForProduction($apiKey, $commerceCode); ``` -------------------------------- ### Ruby Mall Transaction Installments Source: https://www.transbankdevelopers.cl/documentacion/transaccion-completa This Ruby snippet shows how to get installment amounts for a mall transaction. Ensure you have correctly initialized the `Transbank::Webpay::Options` and `Transbank::Webpay::TransaccionCompleta::Transaction` objects. ```ruby @options = Transbank::Webpay::Options.new("commerceCode", "APIKey", :integration) @tx = Transbank::Webpay::TransaccionCompleta::Transaction.new(options) @installment_details = [ { commerce_code: 'commerce_store_1', buy_order: '123456789', installments_number: 2 }, { commerce_code: 'commerce_store_2', buy_order: '123456790', installments_number: 2 }, ] @resp = @tx.installments(token, installment_details) ``` -------------------------------- ### Instalar SDK NodeJS con NPM Source: https://www.transbankdevelopers.cl/documentacion/como_empezar Instala el SDK de NodeJS de Transbank desde NPM ejecutando este comando. ```bash npm install transbank-sdk ``` -------------------------------- ### Get Transaction Token and URL - Python/Node.js Source: https://www.transbankdevelopers.cl/documentacion/webpay-plus Retrieves the transaction token and redirect URL from the Webpay Plus Mall response. Includes examples for SDK versions 3.x and 2.x in Python, and a general Node.js example. ```python ## Versión 3.x del SDK response['token'] response['url'] ## Versión 2.x del SDK response.token response.url ``` ```javascript response.token response.url ``` -------------------------------- ### Acceso a datos de respuesta de transacción (SDK v3.x y v2.x) Source: https://www.transbankdevelopers.cl/referencia/transaccion-completa Ejemplos de cómo acceder a los datos de respuesta de una transacción utilizando el SDK de Transbank. Muestra el acceso a través de diccionarios (v3.x) y objetos (v2.x) para obtener información como monto, estado, orden de compra, etc. ```python response['amount'] response['status'] response['buy_order'] response['session_id'] response['card_number'] response['accounting_date'] response['transaction_date'] response['authorization_code'] response['payment_type_code'] response['response_code'] response['installments_number'] response['installments_amount'] response['balance'] ## Versión 2.x del SDK response.amount response.status response.buy_order response.session_id response.card_number response.accounting_date response.transaction_date response.authorization_code response.payment_type_code response.response_code response.installments_number response.installments_amount response.balance ``` -------------------------------- ### Get Installment Details (SDK Versions) Source: https://www.transbankdevelopers.cl/referencia/transaccion-completa Shows how to access installment details using different SDK versions. Version 3.x uses array access for deferred periods, while version 2.x uses object property access. ```plaintext file_copy## Versión 3.x del SDK response['installments_amount'] response['id_query_installments'] response['deferred_periods'] ## Versión 2.x del SDK response.installments_amount response.id_query_installments deferred_period = response.deferred_periods[0] deferred_period.amount deferred_period.period ``` -------------------------------- ### Get Transaction Status in Node.js Source: https://www.transbankdevelopers.cl/referencia/webpay?l=http This asynchronous JavaScript example retrieves transaction status. It requires the WebpayPlus module and valid integration credentials. ```javascript const transaction = WebpayPlus.Transaction.buildForIntegration( "commerceCode", "APIKey" ); const response = await transaction.status(token); ``` -------------------------------- ### Initialize POS Autoservicio SDK (.NET) Source: https://www.transbankdevelopers.cl/documentacion/pos-autoservicio Include necessary namespaces for using the POS Autoservicio SDK in .NET applications. ```.NET using Transbank.POSAutoservicio; using Transbank.Responses.CommonResponses; using Transbank.Responses.AutoservicioResponse; ``` -------------------------------- ### List Available Serial Ports (Java) Source: https://www.transbankdevelopers.cl/documentacion/pos-autoservicio Get a list of available serial ports using the Java SDK. Assumes drivers are installed. ```Java import cl.transbank.pos.POSAutoservicio; //... POSAutoservicio pos = new POSAutoservicio(); List ports = pos.listPorts(); ``` -------------------------------- ### Configure Transbank Products with Configuration Methods (Ruby) Source: https://www.transbankdevelopers.cl/documentacion/como_empezar Shows how to configure Transbank products using their respective build methods in Ruby. This is an alternative to the Options object constructor. ```Ruby # Uso de los métodos de configuración # Webpay Plus @transaction = Transbank::Webpay::WebpayPlus::Transaction.build_for_production("commerceCode", "APIKey"); @mall_transaction = Transbank::Webpay::WebpayPlus::MallTransaction.build_for_production("commerceCode", "APIKey"); # Oneclick @mall_inscription = Transbank::Webpay::Oneclick::MallInscription.build_for_production("commerceCode", "APIKey"); @mall_transaction = Transbank::Webpay::Oneclick::MallTransaction.build_for_production("commerceCode", "APIKey"); # Transacción Completa @transaction = Transbank::Webpay::TransaccionCompleta::Transaction.build_for_production("commerceCode", "APIKey"); @mall_transaction = Transbank::Webpay::TransaccionCompleta::MallTransaction.build_for_production("commerceCode", "APIKey"); # PatPass Comercio # Es importante destacar que la clase Options para PatPass se importa desde una ruta distinta que en el resto de productos. # Uso del método de configuración @inscription = Transbank::Patpass::PatpassComercio::Inscription.build_for_production("commerceCode", "APIKey"); ``` -------------------------------- ### Instalar SDK Ruby con Gem Source: https://www.transbankdevelopers.cl/documentacion/como_empezar Instala el SDK de Ruby de Transbank ejecutando este comando para instalar la gema. ```bash gem install transbank-sdk ``` -------------------------------- ### Get Transaction Status in C# Source: https://www.transbankdevelopers.cl/referencia/webpay?l=http This C# example demonstrates how to initialize the transaction object and query its status. Make sure to use the correct integration parameters. ```csharp using Transbank.Webpay.WebpayPlus; Transaction transaction = Transaction.buildForIntegration("commerceCode", "APIKey"); var response = transaction.status(token); ``` -------------------------------- ### Start PCL Service Function Source: https://www.transbankdevelopers.cl/documentacion/pos-bluetooth Function to initiate the PCL service connection with a terminal and security parameters. It also gets the server state to activate communication. ```swift func startPclService(terminal:ICTerminal, sslParameters: ICSSLParameters) { /*Se inicia el servicio de PCL*/ pclService?.start(with: terminal, andSecurity: sslParameters) /*Se obtiene el estado del servidor lo cual gatilla que se active la comunicación si es que estaba inactiva*/ pclService?.getState() } ``` -------------------------------- ### C#: Consultar cuotas de transacción completa Source: https://www.transbankdevelopers.cl/referencia/transaccion-completa Realiza una consulta de cuotas usando el método `Installments` de la clase `FullTransaction`. Se necesita un objeto `Options` con la configuración de la integración. ```csharp var tx = new FullTransaction(new Options(IntegrationCommerceCodes.TRANSACCION_COMPLETA, IntegrationApiKeys.WEBPAY, IntegrationType.TEST)); var response = tx.Installments( token, installments_number); ``` -------------------------------- ### Get Transaction Status (C#) Source: https://www.transbankdevelopers.cl/referencia This C# example demonstrates how to initialize the transaction object and retrieve the status using the provided token. It requires the API key and commerce code. ```csharp file_copy using Transbank.Webpay.WebpayPlus; Transaction transaction = Transaction.buildForIntegration("commerceCode", "APIKey"); var response = transaction.status(token); ``` -------------------------------- ### Iniciar Suscripción Patpass (Java SDK v3.x y v2.x) Source: https://www.transbankdevelopers.cl/documentacion/patpass Utiliza este código para iniciar una suscripción con Patpass. Asegúrate de tener las dependencias del SDK de Transbank Patpass configuradas. La versión 3.x utiliza una instancia de PatpassComercio, mientras que la 2.x utiliza un método estático. ```java import cl.transbank.patpass.PatpassComercio; import cl.transbank.patpass.model.PatpassComercioInscriptionStartResponse; import cl.transbank.patpass.model.PatpassComercioTransactionStatusResponse; String url = request.getRequestURL().toString().replace("start","end-subscription"); String name = "nombre"; String firstLastName = "apellido"; String secondLastName = "sapellido"; String rut = "14140066-5"; String serviceId = String.valueOf(new Random().nextInt(Integer.MAX_VALUE));; String finalUrl = request.getRequestURL().toString().replace("start","voucher-generated"); double maxAmount = 1500; String phoneNumber = "123456734"; String mobileNumber = "123456723"; String patpassName = "nombre del patpass"; String personEmail = "otromail@persona.cl"; String commerceEmail = "otrocomercio@comercio.cl"; String address = "huerfanos 101"; String city = "Santiago"; // Versión 3.x del SDK PatpassComercio.Inscription inscription = new PatpassComercio.Inscription(new PatpassComercioOptions(IntegrationCommerceCodes.PATPASS_COMERCIO, IntegrationApiKeys.PATPASS_COMERCIO, PatpassComercioIntegrationType.TEST)); final PatpassComercioInscriptionStartResponse response = inscription.start(url, name, firstLastName, secondLastName, rut, serviceId, finalUrl, maxAmount, phoneNumber, mobileNumber, patpassName, personEmail, commerceEmail, address, city); // Versión 2.x del SDK final PatpassComercioInscriptionStartResponse response = PatpassComercio.Inscription.start(url, name, firstLastName, secondLastName, rut, serviceId, finalUrl, maxAmount, phoneNumber, mobileNumber, patpassName, personEmail, commerceEmail, address, city); ``` -------------------------------- ### Realizar transacción de inicialización del POS Source: https://www.transbankdevelopers.cl/referencia/posautoservicio Ejecuta la transacción de inicialización para cargar parámetros y el aplicativo en el terminal. Se recomienda realizar una transacción de cierre previamente. El POS puede quedar fuera de comunicación temporalmente. ```.NET using Transbank.POSAutoservicio; Task initialized = POSAutoservicio.Instance.Initialization(); ``` ```Java import cl.transbank.pos.POSAutoservicio; POSAutoservicio pos = new POSAutoservicio(); boolean pollResult = pos.initialization(); ``` ```Node.js pos.initialization().then( (res) => { console.log('Resultado ejecución: ', res); }).catch( (err) => { console.log('Ocurrió un error inesperado', err); }); ``` -------------------------------- ### Get Oneclick Transaction Status in C# Source: https://www.transbankdevelopers.cl/referencia/oneclick Retrieve the status of a Oneclick transaction using this C# example. It utilizes the MallTransaction class and requires commerce code and API key. ```csharp MallTransaction mallTransaction = MallTransaction.buildForIntegration("commerceCode", "APIKey"); var result = mallTransaction.Status(buyOrder); ``` -------------------------------- ### Iniciar Suscripción con Patpass Comercio (SDK v4.x) Source: https://www.transbankdevelopers.cl/documentacion/patpass Utiliza esta función para iniciar una nueva suscripción. Asegúrate de tener las opciones de integración configuradas correctamente. ```csharp using Transbank.Patpass.PatpassComercio; // ... var returnUrl = "https://callback_url/resultado/de/la/transaccion"; var name = "Nombre"; var lastname1 = "Primer Apellido"; var lastname2 = "Segundo Apellido"; var rut = "11111111-1"; var serviceId = "Identificador del servicio unico de suscripción"; var finalUrl = "https://callback/final/comprobante/transacción"; var maxAmount = 10000; // monto máximo de la suscripción var telephone = "numero telefono fijo de suscrito"; var mobilePhone = "numero de telefono móvil de suscrito"; var patpassName = "Nombre asignado a la suscripción"; var clientEmail = "Correo de suscrito"; var commerceEmail = "Correo de comercio"; var address = "Dirección de Suscrito"; var city = "Ciudad de suscrito"; // Versión 4.x del SDK var inscription = new Inscription(new Options(IntegrationCommerceCodes.PATPASS_COMERCIO, IntegrationApiKeys.PATPASS_COMERCIO, PatpassComercioIntegrationType.Test)); var result = inscription.Start( url: url, name: name, lastName: f_lastname, secondLastName: s_lastname, rut: rut, serviceId: service_id, finalUrl: final_url, maxAmount: max_amount, phone: phone_number, cellPhone: mobile_number, patpassName: patpass_name, personEmail: client_email, commerceEmail: commerce_email, address: address, city: city); // Versión 3.x del SDK var response = Inscription.Start( returnUrl, name, lastname1, lastname2, rut, serviceId, finalUrl, maxAmount, telephone, mobilePhone, patpassName, clientEmail, commerceEmail, address, city ); ``` -------------------------------- ### Get Transaction Status in .NET Source: https://www.transbankdevelopers.cl/documentacion/webpay-plus Obtain the status of a Webpay Plus transaction by sending the transaction token. This requires prior integration setup with your commerce code and API key. ```.NET using Transbank.Webpay.WebpayPlus; Transaction transaction = Transaction.buildForIntegration("commerceCode", "APIKey"); var response = transaction.status(token); ``` -------------------------------- ### Get Transaction Status in Java Source: https://www.transbankdevelopers.cl/documentacion/webpay-plus Use this snippet to retrieve the status of a Webpay Plus transaction by providing its token. Requires integration setup with commerce code and API key. ```Java WebpayPlus.Transaction transaction = WebpayPlus.Transaction.buildForIntegration("commerceCode", "APIKey"); final WebpayPlusTransactionStatusResponse response = transaction.status(token); ```