├── .gitignore ├── .vscode └── launch.json ├── README.md ├── azure-pipelines.yml ├── composer.json ├── lib ├── API │ ├── AccountDepositRequest.php │ ├── AdvancedPaymentRequest.php │ ├── BankTransferRequest.php │ ├── InvoiceRequest.php │ ├── MarketplaceRequest.php │ ├── PaymentRequest.php │ ├── TokenizationRequest.php │ ├── TransactionRequest.php │ └── TransferenceRequest.php └── Models │ ├── Bank │ ├── AccountType.php │ ├── Bank.php │ └── BankData.php │ ├── Core │ ├── Client.php │ └── Config.php │ ├── General │ ├── Address.php │ ├── Customer.php │ └── Product.php │ ├── Merchant │ ├── Configuration.php │ ├── ListTax.php │ ├── Merchant.php │ ├── MerchantConfiguration.php │ ├── MerchantNotify.php │ ├── MerchantPaymentDate.php │ ├── MerchantPaymentMethod.php │ ├── MerchantSplit.php │ ├── MerchantSplitTax.php │ ├── MerchantType.php │ ├── Plan.php │ ├── PlanFrequence.php │ └── TaxType.php │ ├── Payment │ ├── BankSlip.php │ ├── BankTransfer.php │ ├── Carnet.php │ ├── CarnetItems.php │ ├── CarnetLot.php │ ├── CreditCard.php │ ├── Cryptocoin.php │ ├── DebitCard.php │ ├── PaymentMethod.php │ └── Pix.php │ ├── Plan │ └── Plans.php │ ├── Response │ └── Response.php │ ├── SingleSale │ ├── SingleSale.php │ ├── SingleSalePayment.php │ ├── SingleSalePaymentMethod.php │ └── SingleSaleProduct.php │ ├── Subscription │ ├── Subscription.php │ └── SubscriptionRequest.php │ ├── Transactions │ ├── Base.php │ ├── Splits.php │ ├── Transaction.php │ └── TransactionStatus.php │ └── Transference │ ├── Transfer.php │ └── TransferRegister.php └── test ├── AccountDepositRequestTest.php ├── InvoiceTest.php ├── MarketplaceTest.php ├── PaymentTest.php ├── TokenizationTest.php ├── TransactionTests.php └── TransferenceTest.php /.gitignore: -------------------------------------------------------------------------------- 1 | /vendor/ 2 | composer.lock -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": "Listen for XDebug", 6 | "type": "php", 7 | "request": "launch", 8 | "port": 9003 9 | }, 10 | { 11 | "name": "Launch currently open script", 12 | "type": "php", 13 | "request": "launch", 14 | "program": "${file}", 15 | "stopOnEntry": true, 16 | "cwd": "${fileDirname}", 17 | "port": 9003, 18 | } 19 | ] 20 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # Safe2Pay PHP SDK 3 | 4 | ![Safe2Pay](https://safe2pay.com.br/static/img/banner-github.png) 5 | 6 | ## Principais recursos 7 | 8 | * [x] Consulta de transações. 9 | * [x] Tokenização de cartão. 10 | * [x] Pagamentos. 11 | * [x] Boleto bancário. 12 | * [x] Cartão de crédito. 13 | * [x] Bitcoin. 14 | * [x] Cartão de débito. 15 | * [x] Pix. 16 | * [x] Gerenciamento de subcontas para Marketplace. 17 | * [x] Venda simples. 18 | 19 | ## Utilização 20 | 21 | `composer require safe2pay/sdk:dev-master` 22 | 23 | ## Utilização 24 | 25 | A integração com a API do Safe2Pay se dá pelo modelo RESTful, de forma a realizar a transferência segura e simplificada dos dados pelo formato JSON. Para facilitar o envio dos dados, deve-se montar um objeto para envio baseado nos modelos disponíveis, com exemplos abaixo, e a própria chamada do método desejado realizará o tratamento e conversão deste objeto para JSON. 26 | 27 | 28 | ### Tratamento das respostas da API 29 | 30 | Após o envio, a própria chamada devolverá a resposta em um objeto completo com as propriedades desta, onde um cast das classes de resposta permitirá o tratamento das propriedades do objeto de retorno de forma simplificada, sem a necessidade de criar os mesmos modelos em seu projeto. 31 | 32 | ## Dependências 33 | 34 | * PHP >= 7.1 35 | 36 | ## Pagamentos / Transações 37 | 38 | A informação da forma de pagamento é dada por meio da propriedade `PaymentMethod`, onde deve ser informado o código correspondente ao método desejado: 39 | 40 | 1. Boleto Bancário; 41 | 2. Cartão de Crédito; 42 | 3. Bitcoin; 43 | 4. Cartão de Débito 44 | 45 | O retorno do envio da transação trará um status para esta, que pode ser igual a: 46 | 47 | ``` 48 | 1 = PENDENTE 49 | 2 = PROCESSAMENTO 50 | 3 = AUTORIZADO 51 | 4 = DISPONÍVEL 52 | 5 = EM DISPUTA 53 | 6 = DEVOLVIDO 54 | 7 = BAIXADO 55 | 8 = RECUSADO 56 | 11 = LIBERADO 57 | 12 = EM CANCELAMENTO 58 | 13 = CHARGEBACK 59 | ``` 60 | 61 | ### Criando uma venda com Boleto 62 | 63 | ```php 64 | setAPIKEY('x-api-key'); 78 | 79 | //Inicializar método de pagamento 80 | $payload = new Transaction(); 81 | //Ambiente de homologação 82 | $payload->setIsSandbox(true); 83 | //Descrição geral 84 | $payload->setApplication("Teste SDK PHP"); 85 | //Nome do vendedor 86 | $payload->setVendor("João da Silva"); 87 | //Url de callback 88 | $payload->setCallbackUrl("https://callbacks.exemplo.com.br/api/Notify"); 89 | 90 | //Código da forma de pagamento 91 | // 1 - Boleto bancário 92 | // 2 - Cartão de crédito 93 | // 3 - Criptomoeda 94 | // 4 - Cartão de débito 95 | $payload->setPaymentMethod("1"); 96 | 97 | //Informa o objeto de pagamento 98 | $BankSlip = new BankSlip(); 99 | //Data de vencimento 100 | $BankSlip->setDueDate("16/10/2019"); 101 | //Instrução 102 | $BankSlip->setInstruction("Instrução de Exemplo"); 103 | //Multa 104 | $BankSlip->setPenaltyRate(2.00); 105 | //Juros 106 | $BankSlip->setInterestRate(4.00); 107 | //Cancelar após o vencimento 108 | $BankSlip->setCancelAfterDue(false); 109 | //Pagamento parcial 110 | $BankSlip->setIsEnablePartialPayment(false); 111 | //Mensagens 112 | $BankSlip->setMessage(array( 113 | "mensagem 1", 114 | "mensagem 2", 115 | "mensagem 3" 116 | )); 117 | 118 | //Objeto de pagamento - para boleto bancário 119 | $payload->setPaymentObject($BankSlip); 120 | 121 | $Products = array(); 122 | 123 | $payloadProduct = new Product(); 124 | $payloadProduct->setCode(1); 125 | $payloadProduct->setDescription("Produto 1"); 126 | $payloadProduct->setUnitPrice(2.50); 127 | $payloadProduct->setQuantity(2); 128 | 129 | array_push($Products, $payloadProduct); 130 | 131 | $payload->setProducts($Products); 132 | 133 | //Customer 134 | $Customer = new Customer(); 135 | $Customer->setName("Teste Cliente"); 136 | $Customer->setIdentity("01579286000174"); 137 | $Customer->setEmail("Teste@Teste.com.br"); 138 | $Customer->setPhone("51999999999"); 139 | 140 | $Customer->Address = new Address(); 141 | $Customer->Address->setZipCode("90620000"); 142 | $Customer->Address->setStreet("Avenida Princesa Isabel"); 143 | $Customer->Address->setNumber("828"); 144 | $Customer->Address->setComplement("Lado B"); 145 | $Customer->Address->setDistrict("Santana"); 146 | $Customer->Address->setStateInitials("RS"); 147 | $Customer->Address->setCityName("Porto Alegre"); 148 | $Customer->Address->setCountryName("Brasil"); 149 | 150 | 151 | $payload->setCustomer($Customer); 152 | 153 | $response = PaymentRequest::CreatePayment($payload); 154 | 155 | // ... 156 | ``` 157 | 158 | ### Criando uma venda com cartão de crédito 159 | 160 | ```php 161 | setAPIKEY('x-api-key'); 175 | 176 | //Inicializar método de pagamento 177 | $payload = new Transaction(); 178 | //Ambiente de homologação 179 | $payload->setIsSandbox(true); 180 | //Descrição geral 181 | $payload->setApplication("Teste SDK PHP"); 182 | //Nome do vendedor 183 | $payload->setVendor("João da Silva"); 184 | //Url de callback 185 | $payload->setCallbackUrl("https://callbacks.exemplo.com.br/api/Notify"); 186 | 187 | //Código da forma de pagamento 188 | // 1 - Boleto bancário 189 | // 2 - Cartão de crédito 190 | // 3 - Criptomoeda 191 | // 4 - Cartão de débito 192 | $payload->setPaymentMethod("2"); 193 | 194 | $CreditCard = new CreditCard("João da Silva", "4024007153763191", "12/2019", "241", 2); 195 | 196 | //Objeto de pagamento - para boleto bancário 197 | $payload->setPaymentObject($CreditCard); 198 | 199 | $Products = array(); 200 | 201 | $payloadProduct = new Product(); 202 | $payloadProduct->setCode(1); 203 | $payloadProduct->setDescription("Produto 1"); 204 | $payloadProduct->setUnitPrice(2.50); 205 | $payloadProduct->setQuantity(2); 206 | 207 | array_push($Products, $payloadProduct); 208 | 209 | $payload->setProducts($Products); 210 | 211 | //Customer 212 | $Customer = new Customer(); 213 | $Customer->setName("Teste Cliente"); 214 | $Customer->setIdentity("01579286000174"); 215 | $Customer->setEmail("Teste@Teste.com.br"); 216 | $Customer->setPhone("51999999999"); 217 | 218 | $Customer->Address = new Address(); 219 | $Customer->Address->setZipCode("90620000"); 220 | $Customer->Address->setStreet("Avenida Princesa Isabel"); 221 | $Customer->Address->setNumber("828"); 222 | $Customer->Address->setComplement("Lado B"); 223 | $Customer->Address->setDistrict("Santana"); 224 | $Customer->Address->setStateInitials("RS"); 225 | $Customer->Address->setCityName("Porto Alegre"); 226 | $Customer->Address->setCountryName("Brasil"); 227 | 228 | 229 | $payload->setCustomer($Customer); 230 | 231 | $response = PaymentRequest::CreatePayment($payload); 232 | 233 | // ... 234 | ``` 235 | 236 | ### Criando uma venda com Criptomoedas 237 | 238 | ```php 239 | setAPIKEY('x-api-key'); 252 | 253 | //Inicializar método de pagamento 254 | $payload = new Transaction(); 255 | //Ambiente de homologação 256 | $payload->setIsSandbox(true); 257 | //Descrição geral 258 | $payload->setApplication("Teste SDK PHP"); 259 | //Nome do vendedor 260 | $payload->setVendor("João da Silva"); 261 | //Url de callback 262 | $payload->setCallbackUrl("https://callbacks.exemplo.com.br/api/Notify"); 263 | 264 | //Código da forma de pagamento 265 | // 1 - Boleto bancário 266 | // 2 - Cartão de crédito 267 | // 3 - Criptomoeda 268 | // 4 - Cartão de débito 269 | $payload->setPaymentMethod("3"); 270 | 271 | $CryptoCoin = new Cryptocoin("LTC"); 272 | 273 | //Objeto de pagamento - para Criptomoedas 274 | $payload->setPaymentObject($CryptoCoin); 275 | 276 | $Products = array(); 277 | 278 | $Products = array(); 279 | 280 | $payloadProduct = new Product(); 281 | $payloadProduct->setCode(1); 282 | $payloadProduct->setDescription("Produto 1"); 283 | $payloadProduct->setUnitPrice(2.50); 284 | $payloadProduct->setQuantity(2); 285 | 286 | array_push($Products, $payloadProduct); 287 | 288 | $payload->setProducts($Products); 289 | 290 | //Customer 291 | $Customer = new Customer(); 292 | $Customer->setName("Teste Cliente"); 293 | $Customer->setIdentity("01579286000174"); 294 | $Customer->setEmail("Teste@Teste.com.br"); 295 | $Customer->setPhone("51999999999"); 296 | 297 | $Customer->Address = new Address(); 298 | $Customer->Address->setZipCode("90620000"); 299 | $Customer->Address->setStreet("Avenida Princesa Isabel"); 300 | $Customer->Address->setNumber("828"); 301 | $Customer->Address->setComplement("Lado B"); 302 | $Customer->Address->setDistrict("Santana"); 303 | $Customer->Address->setStateInitials("RS"); 304 | $Customer->Address->setCityName("Porto Alegre"); 305 | $Customer->Address->setCountryName("Brasil"); 306 | 307 | 308 | $payload->setCustomer($Customer); 309 | 310 | $response = PaymentRequest::CreatePayment($payload); 311 | 312 | // ... 313 | ``` 314 | 315 | ### Criando uma venda com cartão de débito 316 | 317 | ```php 318 | setAPIKEY('x-api-key'); 332 | 333 | //Inicializar método de pagamento 334 | $payload = new Transaction(); 335 | //Ambiente de homologação 336 | $payload->setIsSandbox(true); 337 | //Descrição geral 338 | $payload->setApplication("Teste SDK PHP"); 339 | //Nome do vendedor 340 | $payload->setVendor("João da Silva"); 341 | //Url de callback 342 | $payload->setCallbackUrl("https://callbacks.exemplo.com.br/api/Notify"); 343 | 344 | //Código da forma de pagamento 345 | // 1 - Boleto bancário 346 | // 2 - Cartão de crédito 347 | // 3 - Criptomoeda 348 | // 4 - Cartão de débito 349 | $payload->setPaymentMethod("4"); 350 | 351 | $CreditCard = new DebitCard("João da Silva", "4024007153763191", "12/2019", "241"); 352 | 353 | //Objeto de pagamento - para boleto bancário 354 | $payload->setPaymentObject($CreditCard); 355 | 356 | $Products = array(); 357 | 358 | $Products = array(); 359 | 360 | $payloadProduct = new Product(); 361 | $payloadProduct->setCode(1); 362 | $payloadProduct->setDescription("Produto 1"); 363 | $payloadProduct->setUnitPrice(2.50); 364 | $payloadProduct->setQuantity(2); 365 | 366 | array_push($Products, $payloadProduct); 367 | 368 | $payload->setProducts($Products); 369 | 370 | //Customer 371 | $Customer = new Customer(); 372 | $Customer->setName("Teste Cliente"); 373 | $Customer->setIdentity("01579286000174"); 374 | $Customer->setEmail("Teste@Teste.com.br"); 375 | $Customer->setPhone("51999999999"); 376 | 377 | $Customer->Address = new Address(); 378 | $Customer->Address->setZipCode("90620000"); 379 | $Customer->Address->setStreet("Avenida Princesa Isabel"); 380 | $Customer->Address->setNumber("828"); 381 | $Customer->Address->setComplement("Lado B"); 382 | $Customer->Address->setDistrict("Santana"); 383 | $Customer->Address->setStateInitials("RS"); 384 | $Customer->Address->setCityName("Porto Alegre"); 385 | $Customer->Address->setCountryName("Brasil"); 386 | 387 | 388 | $payload->setCustomer($Customer); 389 | 390 | $response = PaymentRequest::CreatePayment($payload); 391 | 392 | // ... 393 | ``` 394 | 395 | ### Tokenizando um cartão 396 | 397 | ```php 398 | setAPIKEY('x-api-key'); 408 | 409 | 410 | /** 411 | * Class TokenizationTest 412 | * 413 | * @package Safe2Pay\Test 414 | */ 415 | class TokenizationTest 416 | { 417 | 418 | public static function Create() 419 | { 420 | //Cria uma instância do objeto do cartão para realizar a tokenização 421 | $CreditCard = new CreditCard("João da Silva", "4024007153763191", "12/2019", "241", null); 422 | //Realiza a tokenização e traz o retorno 423 | 424 | $response = TokenizationRequest::Create($CreditCard); 425 | 426 | //... 427 | 428 | } 429 | } 430 | 431 | // ... 432 | ``` 433 | 434 | ### Consultar transação 435 | 436 | ```php 437 | setAPIKEY('x-api-key'); 446 | /** 447 | * Class TransactionTest 448 | * 449 | * @package Safe2Pay\Test 450 | */ 451 | class TransactionTest 452 | { 453 | 454 | public static function Get() 455 | { 456 | $Id=535489; 457 | 458 | $response =TransactionRequest::Get($Id); 459 | 460 | //... 461 | } 462 | } 463 | 464 | // ... 465 | ``` 466 | 467 | ## Informações adicionais / Contato 468 | 469 | Em caso de dúvidas, ficamos à disposição em nossos canais ou diretamente pelo e-mail integracao@safe2pay.com.br. 470 | 471 | Para mais informações acesse: https://safe2pay.com.br 472 | -------------------------------------------------------------------------------- /azure-pipelines.yml: -------------------------------------------------------------------------------- 1 | # Starter pipeline 2 | 3 | # Start with a minimal pipeline that you can customize to build and deploy your code. 4 | # Add steps that build, run tests, deploy, and more: 5 | # https://aka.ms/yaml 6 | 7 | trigger: 8 | - main 9 | 10 | resources: 11 | repositories: 12 | - repository: template 13 | type: git 14 | name: Safe2Pay/yaml-templates 15 | ref: refs/heads/features/github-copy 16 | 17 | pool: 18 | vmImage: 'windows-latest' 19 | 20 | stages: 21 | - template: templates/stages/github-repository-sync.yml@template 22 | parameters: 23 | githubRepositoryName: 'PHP' -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "safe2pay/sdk", 3 | "description": "Biblioteca para integração com a plataforma de pagamentos Safe2Pay", 4 | "keywords": [ 5 | "payment", 6 | "pagamento", 7 | "boleto", 8 | "credito", 9 | "debito", 10 | "facil", 11 | "segurança" 12 | ], 13 | "license": "MIT", 14 | "homepage": "https://safe2pay.com.br/", 15 | "authors": [ 16 | { 17 | "name": "Safe2Pay", 18 | "email": "integracao@safe2pay.com.br" 19 | } 20 | ], 21 | "minimum-stability": "dev", 22 | "prefer-stable": false, 23 | "autoload": { 24 | "classmap": [ 25 | "./lib/" 26 | ] 27 | }, 28 | "autoload-dev": { 29 | "classmap": [ 30 | "./test/" 31 | ] 32 | }, 33 | "require": { 34 | "php": ">=5.6.0" 35 | }, 36 | "require-dev": { 37 | "phpunit/phpunit": "^5.7" 38 | } 39 | } -------------------------------------------------------------------------------- /lib/API/AccountDepositRequest.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/API/InvoiceRequest.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/API/MarketplaceRequest.php: -------------------------------------------------------------------------------- 1 | Id}", $merchant,false); 42 | return $response; 43 | } 44 | 45 | /** 46 | * Delete Merchant 47 | * 48 | * @param [int] $Id 49 | * @return Response 50 | */ 51 | public static function Delete($Id){ 52 | 53 | $response = Client:: HttpClient("DELETE","Marketplace/Delete?id={$Id}", null,false); 54 | return $response; 55 | } 56 | 57 | /** 58 | * Get Merchant 59 | * 60 | * @param [int] $Id 61 | * @return Response 62 | */ 63 | public static function Get($Id){ 64 | 65 | $response = Client:: HttpClient('GET',"Marketplace/Get?id={$Id}", null,false); 66 | return $response; 67 | } 68 | 69 | /** 70 | * Merchant List 71 | * 72 | * @param [PageNumber] $PageNumber 73 | * @param [RowsPage] $RowsPage 74 | * @return Response 75 | */ 76 | public static function List($PageNumber,$RowsPage){ 77 | 78 | $response = Client:: HttpClient('GET',"Marketplace/List?PageNumber={$PageNumber}&RowsPerPage={$RowsPage}", null,false); 79 | return $response; 80 | } 81 | } 82 | 83 | ?> -------------------------------------------------------------------------------- /lib/API/PaymentRequest.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/API/TransactionRequest.php: -------------------------------------------------------------------------------- 1 | 103 | -------------------------------------------------------------------------------- /lib/API/TransferenceRequest.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/Models/Bank/AccountType.php: -------------------------------------------------------------------------------- 1 | Code = $Code; 17 | } 18 | 19 | public function getCode() 20 | { 21 | return $this->Code; 22 | } 23 | 24 | public function setCode($Code) 25 | { 26 | $this->Code = $Code; 27 | } 28 | 29 | public function JsonSerialize() 30 | { 31 | return [ 32 | 'Code' => (string) $this->Code 33 | ]; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /lib/Models/Bank/Bank.php: -------------------------------------------------------------------------------- 1 | Code = $Code; 17 | } 18 | 19 | public function getCode() 20 | { 21 | return $this->Code; 22 | } 23 | 24 | public function setCode($Code) 25 | { 26 | $this->Code = $Code; 27 | } 28 | 29 | public function JsonSerialize() 30 | { 31 | return [ 32 | 'Code' => (string) $this->Code 33 | ]; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /lib/Models/Bank/BankData.php: -------------------------------------------------------------------------------- 1 | Bank; 23 | } 24 | 25 | public function setBank($Bank) 26 | { 27 | $this->Bank = $Bank; 28 | } 29 | 30 | public function getAccountType() 31 | { 32 | return $this->AccountType; 33 | } 34 | 35 | public function setAccountType($AccountType) 36 | { 37 | $this->AccountType = $AccountType; 38 | } 39 | 40 | public function getBankAgency() 41 | { 42 | return $this->BankAgency; 43 | } 44 | 45 | public function setBankAgency($BankAgency) 46 | { 47 | $this->BankAgency = $BankAgency; 48 | } 49 | 50 | public function getBankAgencyDigit() 51 | { 52 | return $this->BankAgencyDigit; 53 | } 54 | 55 | public function setBankAgencyDigit($BankAgencyDigit) 56 | { 57 | $this->BankAgencyDigit = $BankAgencyDigit; 58 | } 59 | 60 | public function getBankAccount() 61 | { 62 | return $this->BankAccount; 63 | } 64 | 65 | public function setBankAccount($BankAccount) 66 | { 67 | $this->BankAccount = $BankAccount; 68 | } 69 | 70 | public function getBankAccountDigit() 71 | { 72 | return $this->BankAccountDigit; 73 | } 74 | 75 | public function setBankAccountDigit($BankAccountDigit) 76 | { 77 | $this->BankAccountDigit = $BankAccountDigit; 78 | } 79 | 80 | public function JsonSerialize() 81 | { 82 | return [ 83 | 'Bank' => $this->Bank, 84 | 'AccountType' => $this->AccountType, 85 | 'BankAgency' => (string) $this->BankAgency, 86 | 'BankAgencyDigit' => (string) $this->BankAgencyDigit, 87 | 'BankAccount' => (string) $this->BankAccount, 88 | 'BankAccountDigit' => (string) $this->BankAccountDigit, 89 | ]; 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /lib/Models/Core/Client.php: -------------------------------------------------------------------------------- 1 | $value) $response->{$key} = $value; 73 | 74 | return $response; 75 | } 76 | 77 | public static function SetEnviroment($Token){ 78 | self::$APIKEY = $Token; 79 | } 80 | 81 | private static function GetEnviroment(){ 82 | return self::$APIKEY; 83 | } 84 | 85 | private static function GetWebMethodUri($IsPayment) 86 | { 87 | 88 | if (!$IsPayment) { 89 | return "https://api.safe2pay.com.br/v2/"; 90 | } else { 91 | return "https://payment.safe2pay.com.br/v2/"; 92 | } 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /lib/Models/Core/Config.php: -------------------------------------------------------------------------------- 1 | Token = $Token; 15 | Enviroment::SetEnviroment($this->Token); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/Models/General/Address.php: -------------------------------------------------------------------------------- 1 | ZipCode; 24 | } 25 | 26 | public function setZipCode($ZipCode){ 27 | $this->ZipCode = $ZipCode; 28 | } 29 | 30 | public function getStreet(){ 31 | return $this->Street; 32 | } 33 | 34 | public function setStreet($Street){ 35 | $this->Street = $Street; 36 | } 37 | 38 | public function getNumber(){ 39 | return $this->Number; 40 | } 41 | 42 | public function setNumber($Number){ 43 | $this->Number = $Number; 44 | } 45 | 46 | public function getComplement(){ 47 | return $this->Complement; 48 | } 49 | 50 | public function setComplement($Complement){ 51 | $this->Complement = $Complement; 52 | } 53 | 54 | public function getDistrict(){ 55 | return $this->District; 56 | } 57 | 58 | public function setDistrict($District){ 59 | $this->District = $District; 60 | } 61 | 62 | public function getCityName(){ 63 | return $this->CityName; 64 | } 65 | 66 | public function setCityName($CityName){ 67 | $this->CityName = $CityName; 68 | } 69 | 70 | public function getStateInitials(){ 71 | return $this->StateInitials; 72 | } 73 | 74 | public function setStateInitials($StateInitials){ 75 | $this->StateInitials = $StateInitials; 76 | } 77 | 78 | public function getCountryName(){ 79 | return $this->CountryName; 80 | } 81 | 82 | public function setCountryName($CountryName){ 83 | $this->CountryName = $CountryName; 84 | } 85 | 86 | public function jsonSerialize() 87 | { 88 | return[ 89 | "ZipCode" => $this->ZipCode, 90 | "Street" => $this->Street, 91 | "Number" => $this->Number, 92 | "Complement" => $this->Complement, 93 | "District" => $this->District, 94 | "CityName" => $this->CityName, 95 | "StateInitials" => $this->StateInitials, 96 | "CountryName" => $this->CountryName 97 | ]; 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /lib/Models/General/Customer.php: -------------------------------------------------------------------------------- 1 | Name; 22 | } 23 | 24 | public function setName($Name) 25 | { 26 | $this->Name = $Name; 27 | } 28 | 29 | public function getIdentity() 30 | { 31 | return $this->Identity; 32 | } 33 | 34 | public function setIdentity($Identity) 35 | { 36 | $this->Identity = $Identity; 37 | } 38 | 39 | public function getPhone() 40 | { 41 | return $this->Phone; 42 | } 43 | 44 | public function setPhone($Phone) 45 | { 46 | $this->Phone = $Phone; 47 | } 48 | 49 | public function getEmail() 50 | { 51 | return $this->Email; 52 | } 53 | 54 | public function setEmail($Email) 55 | { 56 | $this->Email = $Email; 57 | } 58 | 59 | 60 | public function getAddress() 61 | { 62 | return $this->Address; 63 | } 64 | 65 | public function setAddress($Address) 66 | { 67 | $this->Address = $Address; 68 | } 69 | 70 | public function jsonSerialize() 71 | { 72 | return 73 | [ 74 | "Name" => $this->Name, 75 | "Identity" => $this->Identity, 76 | "Phone" => $this->Phone, 77 | "Email" => $this->Email, 78 | "Address" => $this->Address 79 | ]; 80 | } 81 | } 82 | 83 | ?> -------------------------------------------------------------------------------- /lib/Models/General/Product.php: -------------------------------------------------------------------------------- 1 | Code; 20 | } 21 | 22 | public function setCode($Code){ 23 | $this->Code = $Code; 24 | } 25 | 26 | public function getDescription(){ 27 | return $this->Description; 28 | } 29 | 30 | public function setDescription($Description){ 31 | $this->Description = $Description; 32 | } 33 | 34 | public function getUnitPrice(){ 35 | return $this->UnitPrice; 36 | } 37 | 38 | public function setUnitPrice($UnitPrice){ 39 | $this->UnitPrice = $UnitPrice; 40 | } 41 | 42 | public function getQuantity(){ 43 | return $this->Quantity; 44 | } 45 | 46 | public function setQuantity($Quantity){ 47 | $this->Quantity = $Quantity; 48 | } 49 | 50 | public function jsonSerialize() 51 | { 52 | return[ 53 | "Code" => $this->Code, 54 | "Description" => $this->Description, 55 | "UnitPrice" => $this->UnitPrice, 56 | "Quantity" => $this->Quantity 57 | ]; 58 | } 59 | 60 | } 61 | 62 | ?> -------------------------------------------------------------------------------- /lib/Models/Merchant/Configuration.php: -------------------------------------------------------------------------------- 1 | MerchantPaymentMethod; 18 | } 19 | 20 | public function setMerchantPaymentMethod($MerchantPaymentMethod){ 21 | $this->MerchantPaymentMethod = $MerchantPaymentMethod; 22 | } 23 | 24 | public function getMerchantNotify(){ 25 | return $this->MerchantNotify; 26 | } 27 | 28 | public function setMerchantNotify($MerchantNotify){ 29 | $this->MerchantNotify = $MerchantNotify; 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /lib/Models/Merchant/ListTax.php: -------------------------------------------------------------------------------- 1 | Id; 24 | } 25 | 26 | public function setId($Id){ 27 | $this->Id = $Id; 28 | } 29 | 30 | public function getIdMerchantPaymentMethod(){ 31 | return $this->IdMerchantPaymentMethod; 32 | } 33 | 34 | public function setIdMerchantPaymentMethod($IdMerchantPaymentMethod){ 35 | $this->IdMerchantPaymentMethod = $IdMerchantPaymentMethod; 36 | } 37 | 38 | public function getInitialInstallment(){ 39 | return $this->InitialInstallment; 40 | } 41 | 42 | public function setInitialInstallment($InitialInstallment){ 43 | $this->InitialInstallment = $InitialInstallment; 44 | } 45 | 46 | public function getEndInstallment(){ 47 | return $this->EndInstallment; 48 | } 49 | 50 | public function setEndInstallment($EndInstallment){ 51 | $this->EndInstallment = $EndInstallment; 52 | } 53 | 54 | public function getAmount(){ 55 | return $this->Amount; 56 | } 57 | 58 | public function setAmount($Amount){ 59 | $this->Amount = $Amount; 60 | } 61 | 62 | public function getTaxType(){ 63 | return $this->TaxType; 64 | } 65 | 66 | public function setTaxType($TaxType){ 67 | $this->TaxType = $TaxType; 68 | } 69 | } -------------------------------------------------------------------------------- /lib/Models/Merchant/Merchant.php: -------------------------------------------------------------------------------- 1 | Id; 38 | } 39 | 40 | public function setId($Id){ 41 | $this->Id = $Id; 42 | } 43 | 44 | public function getName(){ 45 | return $this->Name; 46 | } 47 | 48 | public function setName($Name){ 49 | $this->Name = $Name; 50 | } 51 | 52 | public function getCommercialName(){ 53 | return $this->CommercialName; 54 | } 55 | 56 | public function setCommercialName($CommercialName){ 57 | $this->CommercialName = $CommercialName; 58 | } 59 | 60 | public function getIdentity(){ 61 | return $this->Identity; 62 | } 63 | 64 | public function setIdentity($Identity){ 65 | $this->Identity = $Identity; 66 | } 67 | 68 | public function getResponsibleName(){ 69 | return $this->ResponsibleName; 70 | } 71 | 72 | public function setResponsibleName($ResponsibleName){ 73 | $this->ResponsibleName = $ResponsibleName; 74 | } 75 | 76 | public function getResponsibleIdentity(){ 77 | return $this->ResponsibleIdentity; 78 | } 79 | 80 | public function setResponsibleIdentity($ResponsibleIdentity){ 81 | $this->ResponsibleIdentity = $ResponsibleIdentity; 82 | } 83 | 84 | public function getEmail(){ 85 | return $this->Email; 86 | } 87 | 88 | public function setEmail($Email){ 89 | $this->Email = $Email; 90 | } 91 | 92 | public function getTechName(){ 93 | return $this->TechName; 94 | } 95 | 96 | public function setTechName($TechName){ 97 | $this->TechName = $TechName; 98 | } 99 | 100 | public function getTechIdentity(){ 101 | return $this->TechIdentity; 102 | } 103 | 104 | public function setTechIdentity($TechIdentity){ 105 | $this->TechIdentity = $TechIdentity; 106 | } 107 | 108 | public function getTechEmail(){ 109 | return $this->TechEmail; 110 | } 111 | 112 | public function setTechEmail($TechEmail){ 113 | $this->TechEmail = $TechEmail; 114 | } 115 | 116 | public function getToken(){ 117 | return $this->Token; 118 | } 119 | 120 | public function setToken($Token){ 121 | $this->Token = $Token; 122 | } 123 | 124 | public function getSecretKey(){ 125 | return $this->SecretKey; 126 | } 127 | 128 | public function setSecretKey($SecretKey){ 129 | $this->SecretKey = $SecretKey; 130 | } 131 | 132 | public function getTokenSandbox(){ 133 | return $this->TokenSandbox; 134 | } 135 | 136 | public function setTokenSandbox($TokenSandbox){ 137 | $this->TokenSandbox = $TokenSandbox; 138 | } 139 | 140 | public function getSecretKeySandbox(){ 141 | return $this->SecretKeySandbox; 142 | } 143 | 144 | public function setSecretKeySandbox($SecretKeySandbox){ 145 | $this->SecretKeySandbox = $SecretKeySandbox; 146 | } 147 | 148 | public function getBankData(){ 149 | return $this->BankData; 150 | } 151 | 152 | public function setBankData($BankData){ 153 | $this->BankData = $BankData; 154 | } 155 | 156 | public function getAddress(){ 157 | return $this->Address; 158 | } 159 | 160 | public function setAddress($Address){ 161 | $this->Address = $Address; 162 | } 163 | 164 | public function getConfiguration(){ 165 | return $this->Configuration; 166 | } 167 | 168 | public function setConfiguration($Configuration){ 169 | $this->Configuration = $Configuration; 170 | } 171 | 172 | public function getMerchantSplit(){ 173 | return $this->MerchantSplit; 174 | } 175 | 176 | public function setMerchantSplit($MerchantSplit){ 177 | $this->MerchantSplit = $MerchantSplit; 178 | } 179 | 180 | public function getIsRemoved(){ 181 | return $this->IsRemoved; 182 | } 183 | 184 | public function setIsRemoved($IsRemoved){ 185 | $this->IsRemoved = $IsRemoved; 186 | } 187 | 188 | public function getIsPanelRestricted(){ 189 | return $this->IsPanelRestricted; 190 | } 191 | 192 | public function setIsPanelRestricted($IsPanelRestricted = false){ 193 | $this->IsPanelRestricted = $IsPanelRestricted; 194 | } 195 | 196 | public function getIsTransferCheckingAccountDisabled(){ 197 | return $this->IsTransferCheckingAccountDisabled; 198 | } 199 | 200 | public function setIsTransferCheckingAccountDisabled($IsTransferCheckingAccountDisabled = false){ 201 | $this->IsTransferCheckingAccountDisabled = $IsTransferCheckingAccountDisabled; 202 | } 203 | 204 | public function getExtensionLogotipo(){ 205 | return $this->ExtensionLogotipo; 206 | } 207 | 208 | public function setExtensionLogotipo($ExtensionLogotipo = ""){ 209 | $this->ExtensionLogotipo = $ExtensionLogotipo; 210 | } 211 | 212 | public function getLogotipo(){ 213 | return $this->ExtensionLogotipo; 214 | } 215 | 216 | public function setLogotipo($Logotipo = ""){ 217 | $this->Logotipo = $Logotipo; 218 | } 219 | 220 | public function JsonSerialize() 221 | { 222 | return [ 223 | 'Id' => (int) $this->Id, 224 | 'Name' => (string) $this->Name, 225 | 'CommercialName' => (string) $this->CommercialName, 226 | 'Identity' =>(string) $this->Identity, 227 | 'ResponsibleName' =>(string) $this->ResponsibleName, 228 | 'ResponsibleIdentity' =>(string) $this->ResponsibleIdentity, 229 | 'Email' =>(string) $this->Email, 230 | 'TechName' =>(string) $this->TechName, 231 | 'TechIdentity' =>(string) $this->TechIdentity, 232 | 'TechEmail' =>(string) $this->TechEmail, 233 | 'Address' => $this->Address, 234 | 'BankData' => $this->BankData, 235 | 'MerchantSplit' => $this->MerchantSplit, 236 | 'IsPanelRestricted' => $this->IsPanelRestricted, 237 | 'IsTransferCheckingAccountDisabled' => (bool)$this->IsTransferCheckingAccountDisabled, 238 | 'ExtensionLogotipo' => $this->ExtensionLogotipo, 239 | 'Logotipo' => $this->Logotipo 240 | ]; 241 | } 242 | 243 | 244 | } -------------------------------------------------------------------------------- /lib/Models/Merchant/MerchantConfiguration.php: -------------------------------------------------------------------------------- 1 | MerchantPaymentMethod; 18 | } 19 | 20 | public function setMerchantPaymentMethod($MerchantPaymentMethod){ 21 | $this->MerchantPaymentMethod = $MerchantPaymentMethod; 22 | } 23 | 24 | public function getMerchantNotify(){ 25 | return $this->MerchantNotify; 26 | } 27 | 28 | public function setMerchantNotify($MerchantNotify){ 29 | $this->MerchantNotify = $MerchantNotify; 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /lib/Models/Merchant/MerchantNotify.php: -------------------------------------------------------------------------------- 1 | Id; 21 | } 22 | 23 | public function setId($Id){ 24 | $this->Id = $Id; 25 | } 26 | 27 | public function getMerchant(){ 28 | return $this->Merchant; 29 | } 30 | 31 | public function setMerchant($Merchant){ 32 | $this->Merchant = $Merchant; 33 | } 34 | 35 | public function getIsPaymentReceived(){ 36 | return $this->IsPaymentReceived; 37 | } 38 | 39 | public function setIsPaymentReceived($IsPaymentReceived){ 40 | $this->IsPaymentReceived = $IsPaymentReceived; 41 | } 42 | 43 | public function getIsBankSlipCreated(){ 44 | return $this->IsBankSlipCreated; 45 | } 46 | 47 | public function setIsBankSlipCreated($IsBankSlipCreated){ 48 | $this->IsBankSlipCreated = $IsBankSlipCreated; 49 | } 50 | 51 | public function getIsBankSlipDue(){ 52 | return $this->IsBankSlipDue; 53 | } 54 | 55 | public function setIsBankSlipDue($IsBankSlipDue){ 56 | $this->IsBankSlipDue = $IsBankSlipDue; 57 | } 58 | 59 | public function getIsPaymentRefused(){ 60 | return $this->IsPaymentRefused; 61 | } 62 | 63 | public function setIsPaymentRefused($IsPaymentRefused){ 64 | $this->IsPaymentRefused = $IsPaymentRefused; 65 | } 66 | 67 | } -------------------------------------------------------------------------------- /lib/Models/Merchant/MerchantPaymentDate.php: -------------------------------------------------------------------------------- 1 | Id; 20 | } 21 | 22 | public function setId($Id){ 23 | $this->Id = $Id; 24 | } 25 | 26 | public function getMerchant(){ 27 | return $this->Merchant; 28 | } 29 | 30 | public function setMerchant($Merchant){ 31 | $this->Merchant = $Merchant; 32 | } 33 | 34 | public function getPlanFrequence(){ 35 | return $this->PlanFrequence; 36 | } 37 | 38 | public function setPlanFrequence($PlanFrequence){ 39 | $this->PlanFrequence = $PlanFrequence; 40 | } 41 | 42 | public function getPaymentDay(){ 43 | return $this->PaymentDay; 44 | } 45 | 46 | public function setPaymentDay($PaymentDay){ 47 | $this->PaymentDay = $PaymentDay; 48 | } 49 | } -------------------------------------------------------------------------------- /lib/Models/Merchant/MerchantPaymentMethod.php: -------------------------------------------------------------------------------- 1 | Id; 22 | } 23 | 24 | public function setId($Id){ 25 | $this->Id = $Id; 26 | } 27 | 28 | public function getMerchant(){ 29 | return $this->Merchant; 30 | } 31 | 32 | public function setMerchant($Merchant){ 33 | $this->Merchant = $Merchant; 34 | } 35 | 36 | public function getPaymentMethod(){ 37 | return $this->PaymentMethod; 38 | } 39 | 40 | public function setPaymentMethod($PaymentMethod){ 41 | $this->PaymentMethod = $PaymentMethod; 42 | } 43 | 44 | public function getIsEnabled(){ 45 | return $this->IsEnabled; 46 | } 47 | 48 | public function setIsEnabled($IsEnabled){ 49 | $this->IsEnabled = $IsEnabled; 50 | } 51 | 52 | public function getInstallmentLimit(){ 53 | return $this->InstallmentLimit; 54 | } 55 | 56 | public function setInstallmentLimit($InstallmentLimit){ 57 | $this->InstallmentLimit = $InstallmentLimit; 58 | } 59 | 60 | public function getMinorInstallmentAmount(){ 61 | return $this->MinorInstallmentAmount; 62 | } 63 | 64 | public function setMinorInstallmentAmount($MinorInstallmentAmount){ 65 | $this->MinorInstallmentAmount = $MinorInstallmentAmount; 66 | } 67 | 68 | } 69 | 70 | ?> -------------------------------------------------------------------------------- /lib/Models/Merchant/MerchantSplit.php: -------------------------------------------------------------------------------- 1 | PaymentMethodCode; 20 | } 21 | 22 | public function setPaymentMethodCode($PaymentMethodCode){ 23 | $this->PaymentMethodCode = $PaymentMethodCode; 24 | } 25 | 26 | public function getPaymentMethod(){ 27 | return $this->PaymentMethod; 28 | } 29 | 30 | public function setPaymentMethod($PaymentMethod){ 31 | $this->PaymentMethod = $PaymentMethod; 32 | } 33 | 34 | public function getIsSubaccountTaxPayer(){ 35 | return $this->IsSubaccountTaxPayer; 36 | } 37 | 38 | public function setIsSubaccountTaxPayer($IsSubaccountTaxPayer){ 39 | $this->IsSubaccountTaxPayer = $IsSubaccountTaxPayer; 40 | } 41 | 42 | public function getTaxes(){ 43 | return $this->Taxes; 44 | } 45 | 46 | public function setTaxes($Taxes){ 47 | $this->Taxes = $Taxes; 48 | } 49 | 50 | public function __construct($IsSubaccountTaxPayer,$PaymentMethodCode,$Taxes) 51 | { 52 | $this->IsSubaccountTaxPayer = $IsSubaccountTaxPayer; 53 | $this->PaymentMethodCode = $PaymentMethodCode; 54 | $this->Taxes = $Taxes; 55 | } 56 | 57 | public function JsonSerialize() 58 | { 59 | return [ 60 | 'IsSubaccountTaxPayer' => (bool) $this->IsSubaccountTaxPayer, 61 | 'PaymentMethodCode' =>(string) $this->PaymentMethodCode, 62 | 'Taxes' =>(array) $this->Taxes 63 | ]; 64 | } 65 | } 66 | 67 | ?> -------------------------------------------------------------------------------- /lib/Models/Merchant/MerchantSplitTax.php: -------------------------------------------------------------------------------- 1 | TaxTypeName; 18 | } 19 | 20 | public function setTaxTypeName($TaxTypeName){ 21 | $this->TaxTypeName = $TaxTypeName; 22 | } 23 | 24 | public function getTaxType(){ 25 | return $this->TaxType; 26 | } 27 | 28 | public function setTaxType($TaxType){ 29 | $this->TaxType = $TaxType; 30 | } 31 | 32 | public function getTax(){ 33 | return $this->Tax; 34 | } 35 | 36 | public function setTax($Tax){ 37 | $this->Tax = $Tax; 38 | } 39 | 40 | public function __construct($TaxTypeName,$Tax) 41 | { 42 | $this->TaxTypeName = $TaxTypeName; 43 | $this->Tax = $Tax; 44 | } 45 | 46 | public function JsonSerialize() 47 | { 48 | return [ 49 | 'TaxTypeName' => (string) $this->TaxTypeName, 50 | 'Tax' =>(string) $this->Tax 51 | ]; 52 | } 53 | 54 | } 55 | 56 | ?> -------------------------------------------------------------------------------- /lib/Models/Merchant/MerchantType.php: -------------------------------------------------------------------------------- 1 | Id; 25 | } 26 | 27 | public function setId($Id){ 28 | $this->Id = $Id; 29 | } 30 | 31 | public function getCode(){ 32 | return $this->Code; 33 | } 34 | 35 | public function setCode($Code){ 36 | $this->Code = $Code; 37 | } 38 | 39 | public function getName(){ 40 | return $this->Name; 41 | } 42 | 43 | public function setName($Name){ 44 | $this->Name = $Name; 45 | } 46 | } 47 | 48 | ?> -------------------------------------------------------------------------------- /lib/Models/Merchant/Plan.php: -------------------------------------------------------------------------------- 1 | Id; 30 | } 31 | 32 | public function setId($Id){ 33 | $this->Id = $Id; 34 | } 35 | 36 | public function getPlanFrequence(){ 37 | return $this->PlanFrequence; 38 | } 39 | 40 | public function setPlanFrequence($PlanFrequence){ 41 | $this->PlanFrequence = $PlanFrequence; 42 | } 43 | 44 | public function getName(){ 45 | return $this->Name; 46 | } 47 | 48 | public function setName($Name){ 49 | $this->Name = $Name; 50 | } 51 | 52 | public function getDescription(){ 53 | return $this->Description; 54 | } 55 | 56 | public function setDescription($Description){ 57 | $this->Description = $Description; 58 | } 59 | 60 | public function getAmount(){ 61 | return $this->Amount; 62 | } 63 | 64 | public function setAmount($Amount){ 65 | $this->Amount = $Amount; 66 | } 67 | 68 | public function getSubscriptionLimit(){ 69 | return $this->SubscriptionLimit; 70 | } 71 | 72 | public function setSubscriptionLimit($SubscriptionLimit){ 73 | $this->SubscriptionLimit = $SubscriptionLimit; 74 | } 75 | 76 | public function getDaysTrial(){ 77 | return $this->DaysTrial; 78 | } 79 | 80 | public function setDaysTrial($DaysTrial){ 81 | $this->DaysTrial = $DaysTrial; 82 | } 83 | 84 | public function getDaysToInactive(){ 85 | return $this->DaysToInactive; 86 | } 87 | 88 | public function setDaysToInactive($DaysToInactive){ 89 | $this->DaysToInactive = $DaysToInactive; 90 | } 91 | 92 | public function getChargeDay(){ 93 | return $this->ChargeDay; 94 | } 95 | 96 | public function setChargeDay($ChargeDay){ 97 | $this->ChargeDay = $ChargeDay; 98 | } 99 | 100 | public function getSubscriptionTax(){ 101 | return $this->SubscriptionTax; 102 | } 103 | 104 | public function setSubscriptionTax($SubscriptionTax){ 105 | $this->SubscriptionTax = $SubscriptionTax; 106 | } 107 | 108 | public function getIsProRata(){ 109 | return $this->IsProRata; 110 | } 111 | 112 | public function setIsProRata($IsProRata){ 113 | $this->IsProRata = $IsProRata; 114 | } 115 | 116 | public function getIsEnabled(){ 117 | return $this->IsEnabled; 118 | } 119 | 120 | public function setIsEnabled($IsEnabled){ 121 | $this->IsEnabled = $IsEnabled; 122 | } 123 | 124 | public function getIsImmediateCharge(){ 125 | return $this->IsImmediateCharge; 126 | } 127 | 128 | public function setIsImmediateCharge($IsImmediateCharge){ 129 | $this->IsImmediateCharge = $IsImmediateCharge; 130 | } 131 | 132 | public function getCallbackUrl(){ 133 | return $this->CallbackUrl; 134 | } 135 | 136 | public function setCallbackUrl($CallbackUrl){ 137 | $this->CallbackUrl = $CallbackUrl; 138 | } 139 | 140 | public function getExpirationDate(){ 141 | return $this->ExpirationDate; 142 | } 143 | 144 | public function setExpirationDate($ExpirationDate){ 145 | $this->ExpirationDate = $ExpirationDate; 146 | } 147 | 148 | public function JsonSerialize() 149 | { 150 | return [ 151 | 'Id' => $this->Id, 152 | 'PlanFrequence' => $this->PlanFrequence, 153 | 'Name' => (string) $this->Name, 154 | 'Description' =>(string) $this->Description, 155 | 'Amount' =>(string) $this->Amount, 156 | 'SubscriptionLimit' =>(string) $this->SubscriptionLimit, 157 | 'DaysTrial' => (int) $this->DaysTrial, 158 | 'DaysToInactive' =>(string) $this->DaysToInactive, 159 | 'ChargeDay' =>(string) $this->ChargeDay, 160 | 'SubscriptionTax'=>(string) $this->SubscriptionTax, 161 | 'IsProRata' =>(bool) $this->IsProRata, 162 | 'IsEnabled' => (bool) $this->IsEnabled, 163 | 'IsImmediateCharge' => (bool) $this->IsImmediateCharge, 164 | 'CallbackUrl' =>(string) $this->CallbackUrl, 165 | 'ExpirationDate' =>(string) $this->ExpirationDate 166 | ]; 167 | } 168 | 169 | 170 | 171 | } 172 | 173 | ?> -------------------------------------------------------------------------------- /lib/Models/Merchant/PlanFrequence.php: -------------------------------------------------------------------------------- 1 | Id; 28 | } 29 | 30 | public function setId($Id){ 31 | $this->Id = $Id; 32 | } 33 | 34 | public function getCode(){ 35 | return $this->Code; 36 | } 37 | 38 | public function setCode($Code){ 39 | $this->Code = $Code; 40 | } 41 | 42 | public function getName(){ 43 | return $this->Name; 44 | } 45 | 46 | public function setName($Name){ 47 | $this->Name = $Name; 48 | } 49 | 50 | public function JsonSerialize() 51 | { 52 | return [ 53 | 'Code' => $this->Code, 54 | ]; 55 | } 56 | 57 | } 58 | 59 | ?> -------------------------------------------------------------------------------- /lib/Models/Merchant/TaxType.php: -------------------------------------------------------------------------------- 1 | Id; 23 | } 24 | 25 | public function setId($Id){ 26 | $this->Id = $Id; 27 | } 28 | 29 | public function getCode(){ 30 | return $this->Code; 31 | } 32 | 33 | public function setCode($Code){ 34 | $this->Code = $Code; 35 | } 36 | 37 | public function getName(){ 38 | return $this->Name; 39 | } 40 | 41 | public function setName($Name){ 42 | $this->Name = $Name; 43 | } 44 | } 45 | 46 | ?> -------------------------------------------------------------------------------- /lib/Models/Payment/BankSlip.php: -------------------------------------------------------------------------------- 1 | Id; 38 | } 39 | 40 | public function setId($Id) 41 | { 42 | $this->Id = $Id; 43 | } 44 | 45 | public function getIdCarnet() 46 | { 47 | return $this->IdCarnet; 48 | } 49 | 50 | public function setIdCarnet($IdCarnet) 51 | { 52 | $this->IdCarnet = $IdCarnet; 53 | } 54 | 55 | public function getIdTransaction() 56 | { 57 | return $this->IdTransaction; 58 | } 59 | 60 | public function setIdTransaction($IdTransaction) 61 | { 62 | $this->IdTransaction = $IdTransaction; 63 | } 64 | 65 | public function getSeedNumber() 66 | { 67 | return $this->SeedNumber; 68 | } 69 | 70 | public function setSeedNumber($SeedNumber) 71 | { 72 | $this->SeedNumber = $SeedNumber; 73 | } 74 | 75 | public function getBankSlipNumber() 76 | { 77 | return $this->BankSlipNumber; 78 | } 79 | 80 | public function setBankSlipNumber($BankSlipNumber) 81 | { 82 | $this->BankSlipNumber = $BankSlipNumber; 83 | } 84 | 85 | public function getDigitableLine() 86 | { 87 | return $this->DigitableLine; 88 | } 89 | 90 | public function setDigitableLine($DigitableLine) 91 | { 92 | $this->DigitableLine = $DigitableLine; 93 | } 94 | 95 | public function getBarcode() 96 | { 97 | return $this->Barcode; 98 | } 99 | 100 | public function setBarcode($Barcode) 101 | { 102 | $this->Barcode = $Barcode; 103 | } 104 | 105 | public function getFile() 106 | { 107 | return $this->File; 108 | } 109 | 110 | public function setFile($File) 111 | { 112 | $this->File = $File; 113 | } 114 | 115 | public function getAmountPayment() 116 | { 117 | return $this->AmountPayment; 118 | } 119 | 120 | public function setAmountPayment($AmountPayment) 121 | { 122 | $this->AmountPayment = $AmountPayment; 123 | } 124 | 125 | public function getDueDate() 126 | { 127 | return $this->DueDate; 128 | } 129 | 130 | public function setDueDate($DueDate) 131 | { 132 | $this->DueDate = $DueDate; 133 | } 134 | 135 | public function getInstruction() 136 | { 137 | return $this->Instruction; 138 | } 139 | 140 | public function setInstruction($Instruction) 141 | { 142 | $this->Instruction = $Instruction; 143 | } 144 | 145 | public function getMessage() 146 | { 147 | return $this->Message; 148 | } 149 | 150 | public function setMessage($Message) 151 | { 152 | $this->Message = $Message; 153 | } 154 | 155 | public function getPenaltyRate() 156 | { 157 | return $this->PenaltyRate; 158 | } 159 | 160 | public function setPenaltyRate($PenaltyRate = 0) 161 | { 162 | $this->PenaltyRate = $PenaltyRate; 163 | } 164 | 165 | public function getInterestRate() 166 | { 167 | return $this->InterestRate; 168 | } 169 | 170 | public function setInterestRate($InterestRate = 0) 171 | { 172 | $this->InterestRate = $InterestRate; 173 | } 174 | 175 | public function getBankSplipUrl() 176 | { 177 | return $this->BankSplipUrl; 178 | } 179 | 180 | public function setBankSplipUrl($BankSplipUrl) 181 | { 182 | $this->BankSplipUrl = $BankSplipUrl; 183 | } 184 | 185 | public function getCancelAfterDue() 186 | { 187 | return $this->CancelAfterDue; 188 | } 189 | 190 | public function setCancelAfterDue($CancelAfterDue = false) 191 | { 192 | $this->CancelAfterDue = $CancelAfterDue; 193 | } 194 | 195 | public function getIsEnablePartialPayment() 196 | { 197 | return $this->IsEnablePartialPayment; 198 | } 199 | 200 | public function setIsEnablePartialPayment($IsEnablePartialPayment = false) 201 | { 202 | $this->IsEnablePartialPayment = $IsEnablePartialPayment; 203 | } 204 | 205 | public function getDaysBeforeCancel() 206 | { 207 | return $this->DaysBeforeCancel; 208 | } 209 | 210 | public function setDaysBeforeCancel($DaysBeforeCancel = 29) 211 | { 212 | $this->DaysBeforeCancel = $DaysBeforeCancel; 213 | } 214 | 215 | public function getDiscountAmount() 216 | { 217 | return $this->DaysBeforeCancel; 218 | } 219 | 220 | public function setDiscountAmount($DiscountAmount = 0) 221 | { 222 | $this->DiscountAmount = $DiscountAmount; 223 | } 224 | 225 | public function getDiscountType() 226 | { 227 | return $this->DiscountType; 228 | } 229 | 230 | public function setDiscountType($DiscountType) 231 | { 232 | $this->DiscountType = $DiscountType; 233 | } 234 | 235 | public function getDiscountDue() 236 | { 237 | return $this->DiscountDue; 238 | } 239 | 240 | public function setDiscountDue($DiscountDue) 241 | { 242 | $this->DiscountDue = $DiscountDue; 243 | } 244 | 245 | public function getIdMerchant() 246 | { 247 | return $this->IdMerchant; 248 | } 249 | 250 | public function setIdMerchant($IdMerchant) 251 | { 252 | $this->IdMerchant = $IdMerchant; 253 | } 254 | 255 | public function jsonSerialize() 256 | { 257 | $PaymentObject = []; 258 | 259 | $PaymentObject["DueDate"] = $this->DueDate; 260 | $PaymentObject["CancelAfterDue"] = $this->CancelAfterDue; 261 | $PaymentObject["IsEnablePartialPayment"] = $this->IsEnablePartialPayment; 262 | $PaymentObject["Instruction"] = $this->Instruction; 263 | $PaymentObject["Message"] = $this->Message; 264 | 265 | if ($this->InterestRate > 0) 266 | $PaymentObject["InterestRate"] = $this->InterestRate; 267 | 268 | if ($this->PenaltyRate > 0) 269 | $PaymentObject["PenaltyRate"] = $this->PenaltyRate; 270 | 271 | if ($this->DiscountAmount > 0) { 272 | $PaymentObject["DiscountAmount"] = $this->DiscountAmount; 273 | $PaymentObject["DiscountType"] = $this->DiscountType; 274 | $PaymentObject["DiscountDue"] = $this->DiscountDue; 275 | } 276 | 277 | return $PaymentObject; 278 | } 279 | } -------------------------------------------------------------------------------- /lib/Models/Payment/BankTransfer.php: -------------------------------------------------------------------------------- 1 | Provider; 18 | } 19 | 20 | public function setProvider($Provider){ 21 | $this->Provider = $Provider; 22 | } 23 | 24 | public function getToken(){ 25 | return $this->Token; 26 | } 27 | 28 | public function setToken($Token){ 29 | $this->Token = $Token; 30 | } 31 | 32 | public function getAuthenticationUrl(){ 33 | return $this->AuthenticationUrl; 34 | } 35 | 36 | public function setAuthenticationUrl($AuthenticationUrl){ 37 | $this->AuthenticationUrl = $AuthenticationUrl; 38 | } 39 | } 40 | 41 | ?> -------------------------------------------------------------------------------- /lib/Models/Payment/Carnet.php: -------------------------------------------------------------------------------- 1 | Id; 31 | } 32 | 33 | public function setId($Id){ 34 | $this->Id = $Id; 35 | } 36 | 37 | public function getEmails(){ 38 | return $this->Emails; 39 | } 40 | 41 | public function setEmails($Emails){ 42 | $this->Emails = $Emails; 43 | } 44 | 45 | public function getIdCarnetLot(){ 46 | return $this->IdCarnetLot; 47 | } 48 | 49 | public function setIdCarnetLot($IdCarnetLot){ 50 | $this->IdCarnetLot = $IdCarnetLot; 51 | } 52 | 53 | public function getIdentifier(){ 54 | return $this->Identifier; 55 | } 56 | 57 | public function setIdentifier($Identifier){ 58 | $this->Identifier = $Identifier; 59 | } 60 | 61 | public function getReference(){ 62 | return $this->Reference; 63 | } 64 | 65 | public function setReference($Reference){ 66 | $this->Reference = $Reference; 67 | } 68 | 69 | public function getIsProcessed(){ 70 | return $this->IsProcessed; 71 | } 72 | 73 | public function setIsProcessed($IsProcessed){ 74 | $this->IsProcessed = $IsProcessed; 75 | } 76 | 77 | public function getIsAsync(){ 78 | return $this->IsAsync; 79 | } 80 | 81 | public function setIsAsync($IsAsync){ 82 | $this->IsAsync = $IsAsync; 83 | } 84 | 85 | public function getMessage(){ 86 | return $this->Message; 87 | } 88 | 89 | public function setMessage($Message){ 90 | $this->Message = $Message; 91 | } 92 | 93 | public function getPenaltyAmount(){ 94 | return $this->PenaltyAmount; 95 | } 96 | 97 | public function setPenaltyAmount($PenaltyAmount){ 98 | $this->PenaltyAmount = $PenaltyAmount; 99 | } 100 | 101 | public function getInterestAmount(){ 102 | return $this->InterestAmount; 103 | } 104 | 105 | public function setInterestAmount($InterestAmount){ 106 | $this->InterestAmount = $InterestAmount; 107 | } 108 | 109 | public function getPayableAfterDue(){ 110 | return $this->PayableAfterDue; 111 | } 112 | 113 | public function setPayableAfterDue($PayableAfterDue){ 114 | $this->PayableAfterDue = $PayableAfterDue; 115 | } 116 | 117 | public function getIsEnablePartialPayment(){ 118 | return $this->IsEnablePartialPayment; 119 | } 120 | 121 | public function setIsEnablePartialPayment($IsEnablePartialPayment){ 122 | $this->IsEnablePartialPayment = $IsEnablePartialPayment; 123 | } 124 | 125 | public function getBankSlips(){ 126 | return $this->BankSlips; 127 | } 128 | 129 | public function setBankSlips($BankSlips){ 130 | $this->BankSlips = $BankSlips; 131 | } 132 | 133 | 134 | public function JsonSerialize() 135 | { 136 | return [ 137 | 'Id' =>(int) $this->Id, 138 | 'IdCarnetLot' => (int) $this->IdCarnetLot, 139 | 'Identifier' => (string) $this->Identifier, 140 | 'Reference' => (string) $this->Reference, 141 | 'IsProcessed' => (bool) $this->IsProcessed, 142 | 'IsAsync' => (bool) $this->IsAsync, 143 | 'PenaltyAmount' => (int) $this->PenaltyAmount, 144 | 'InterestAmount' => (int) $this->InterestAmount, 145 | 'PayableAfterDue' =>(bool) $this->PayableAfterDue, 146 | 'IsEnablePartialPayment' =>(bool) $this->IsEnablePartialPayment, 147 | 'Emails' => $this->Emails, 148 | 'BankSlips' =>(array) $this->BankSlips 149 | ]; 150 | } 151 | } 152 | 153 | class CarnetBankslip implements \JsonSerializable 154 | { 155 | private $IdTransaction; 156 | private $IdMerchant; 157 | private $Amount; 158 | private $DueDate; 159 | private $Instruction; 160 | private $Message; 161 | 162 | 163 | public function getIdTransaction(){ 164 | return $this->IdTransaction; 165 | } 166 | 167 | public function setIdTransaction($IdTransaction){ 168 | $this->IdTransaction = $IdTransaction; 169 | } 170 | 171 | public function getIdMerchant(){ 172 | return $this->IdMerchant; 173 | } 174 | 175 | public function setIdMerchant($IdMerchant){ 176 | $this->IdMerchant = $IdMerchant; 177 | } 178 | 179 | public function getAmount(){ 180 | return $this->Amount; 181 | } 182 | 183 | public function setAmount($Amount){ 184 | $this->Amount = $Amount; 185 | } 186 | 187 | public function getDueDate(){ 188 | return $this->DueDate; 189 | } 190 | 191 | public function setDueDate($DueDate){ 192 | 193 | $this->DueDate = $DueDate; 194 | } 195 | 196 | public function getInstruction(){ 197 | return $this->Instruction; 198 | } 199 | 200 | public function setInstruction($Instruction){ 201 | $this->Instruction = $Instruction; 202 | } 203 | 204 | public function getMessage(){ 205 | return $this->Message; 206 | } 207 | 208 | public function setMessage($Message){ 209 | $this->Message = $Message; 210 | } 211 | 212 | public function JsonSerialize() 213 | { 214 | return [ 215 | 'Amount' => $this->Amount, 216 | 'DueDate' => $this->DueDate, 217 | 'IdMerchant' => (int) $this->IdMerchant, 218 | 'IdTransaction' => (int) $this->IdTransaction, 219 | 'Instruction' => (string) $this->Instruction, 220 | 'Message' => (array) $this->Message, 221 | ]; 222 | } 223 | 224 | } 225 | 226 | ?> -------------------------------------------------------------------------------- /lib/Models/Payment/CarnetItems.php: -------------------------------------------------------------------------------- 1 | Id; 20 | } 21 | 22 | public function setId($Id){ 23 | $this->Id = $Id; 24 | } 25 | 26 | public function getIdentifier(){ 27 | return $this->Identifier; 28 | } 29 | 30 | public function setIdentifier($Identifier){ 31 | $this->Identifier = $Identifier; 32 | } 33 | 34 | public function getReference(){ 35 | return $this->Reference; 36 | } 37 | 38 | public function setReference($Reference){ 39 | $this->Reference = $Reference; 40 | } 41 | 42 | public function getIsProcessed(){ 43 | return $this->IsProcessed; 44 | } 45 | 46 | public function setIsProcessed($IsProcessed){ 47 | $this->IsProcessed = $IsProcessed; 48 | } 49 | 50 | public function getMessage(){ 51 | return $this->Message; 52 | } 53 | 54 | public function setMessage($Message){ 55 | $this->Message = $Message; 56 | } 57 | 58 | public function getPaymentObject(){ 59 | return $this->PaymentObject; 60 | } 61 | 62 | public function setPaymentObject($PaymentObject){ 63 | $this->PaymentObject = $PaymentObject; 64 | } 65 | 66 | } 67 | 68 | 69 | class PaymentObjectCarnet 70 | { 71 | private $BankSlips; 72 | 73 | public function getBankSlips(){ 74 | return $this->BankSlips; 75 | } 76 | 77 | public function setBankSlips($BankSlips){ 78 | $this->BankSlips = $BankSlips; 79 | } 80 | } 81 | 82 | class CarnetLotBankSlip 83 | { 84 | private $IdTransaction; 85 | private $TransactionStatus; 86 | private $BankSlipNumber; 87 | private $DigitableLine; 88 | private $Barcode; 89 | private $DueDate; 90 | 91 | public function getIdTransaction(){ 92 | return $this->IdTransaction; 93 | } 94 | 95 | public function setIdTransaction($IdTransaction){ 96 | $this->IdTransaction = $IdTransaction; 97 | } 98 | 99 | public function getTransactionStatus(){ 100 | return $this->TransactionStatus; 101 | } 102 | 103 | public function setTransactionStatus($TransactionStatus){ 104 | $this->TransactionStatus = $TransactionStatus; 105 | } 106 | 107 | public function getBankSlipNumber(){ 108 | return $this->BankSlipNumber; 109 | } 110 | 111 | public function setBankSlipNumber($BankSlipNumber){ 112 | $this->BankSlipNumber = $BankSlipNumber; 113 | } 114 | 115 | public function getDigitableLine(){ 116 | return $this->DigitableLine; 117 | } 118 | 119 | public function setDigitableLine($DigitableLine){ 120 | $this->DigitableLine = $DigitableLine; 121 | } 122 | 123 | public function getBarcode(){ 124 | return $this->Barcode; 125 | } 126 | 127 | public function setBarcode($Barcode){ 128 | $this->Barcode = $Barcode; 129 | } 130 | 131 | public function getDueDate(){ 132 | return $this->DueDate; 133 | } 134 | 135 | public function setDueDate($DueDate){ 136 | $this->DueDate = $DueDate; 137 | } 138 | } 139 | 140 | 141 | ?> -------------------------------------------------------------------------------- /lib/Models/Payment/CarnetLot.php: -------------------------------------------------------------------------------- 1 | Id; 25 | } 26 | 27 | public function setId($Id){ 28 | $this->Id = $Id; 29 | } 30 | 31 | public function getIdMerchant(){ 32 | return $this->IdMerchant; 33 | } 34 | 35 | public function setIdMerchant($IdMerchant){ 36 | $this->IdMerchant = $IdMerchant; 37 | } 38 | 39 | public function getMerchant(){ 40 | return $this->Merchant; 41 | } 42 | 43 | public function setMerchant($Merchant){ 44 | $this->Merchant = $Merchant; 45 | } 46 | 47 | public function getJsonGzip(){ 48 | return $this->JsonGzip; 49 | } 50 | 51 | public function setJsonGzip($JsonGzip){ 52 | $this->JsonGzip = $JsonGzip; 53 | } 54 | 55 | public function getIdentifier(){ 56 | return $this->Identifier; 57 | } 58 | 59 | public function setIdentifier($Identifier){ 60 | $this->Identifier = $Identifier; 61 | } 62 | 63 | public function getCallbackUrl(){ 64 | return $this->CallbackUrl; 65 | } 66 | 67 | public function setCallbackUrl($CallbackUrl){ 68 | $this->CallbackUrl = $CallbackUrl; 69 | } 70 | 71 | public function getIsProcessed(){ 72 | return $this->IsProcessed; 73 | } 74 | 75 | public function setIsProcessed($IsProcessed){ 76 | $this->IsProcessed = $IsProcessed; 77 | } 78 | 79 | public function getCreatedDate(){ 80 | return $this->CreatedDate; 81 | } 82 | 83 | public function setCreatedDate($CreatedDate){ 84 | $this->CreatedDate = $CreatedDate; 85 | } 86 | 87 | public function getItems(){ 88 | return $this->Items; 89 | } 90 | 91 | public function setItems($Items){ 92 | $this->Items = $Items; 93 | } 94 | 95 | public function getCarnets(){ 96 | return $this->Carnets; 97 | } 98 | 99 | public function setCarnets($Carnets){ 100 | $this->Carnets = $Carnets; 101 | } 102 | 103 | public function getApiVersion(){ 104 | return $this->ApiVersion; 105 | } 106 | 107 | public function setApiVersion($ApiVersion){ 108 | $this->ApiVersion = $ApiVersion; 109 | } 110 | 111 | public function JsonSerialize() 112 | { 113 | return [ 114 | 'Id' => (int) $this->Id, 115 | 'IdMerchant' =>(int) $this->IdMerchant, 116 | 'Identifier' => (string) $this->Identifier, 117 | 'CallbackUrl' => (string) $this->CallbackUrl, 118 | 'IsProcessed' => (bool) $this->IsProcessed, 119 | 'Items' => (array) $this->Items, 120 | 'Carnets' => (array) $this->Carnets, 121 | 'ApiVersion' => (int) $this->ApiVersion, 122 | ]; 123 | } 124 | } 125 | 126 | 127 | ?> -------------------------------------------------------------------------------- /lib/Models/Payment/CreditCard.php: -------------------------------------------------------------------------------- 1 | Holder = $Holder; 26 | $this->CardNumber = $CardNumber; 27 | $this->ExpirationDate = $ExpirationDate; 28 | $this->SecurityCode = $SecurityCode; 29 | $this->Token = $Token; 30 | $this->InstallmentQuantity = $InstallmentQuantity; 31 | $this->IsPreAuthorization = $IsPreAuthorization; 32 | $this->IsApplyInterest = $IsApplyInterest; 33 | $this->InterestRate = $InterestRate; 34 | $this->SoftDescriptor = $SoftDescriptor; 35 | } 36 | 37 | public function getHolder() 38 | { 39 | return $this->Holder; 40 | } 41 | 42 | public function setHolder($Holder) 43 | { 44 | $this->Holder = $Holder; 45 | } 46 | 47 | public function getCardNumber() 48 | { 49 | return $this->CardNumber; 50 | } 51 | 52 | public function setCardNumber($CardNumber) 53 | { 54 | $this->CardNumber = $CardNumber; 55 | } 56 | 57 | public function getExpirationDate() 58 | { 59 | return $this->ExpirationDate; 60 | } 61 | 62 | public function setExpirationDate($ExpirationDate) 63 | { 64 | $this->ExpirationDate = $ExpirationDate; 65 | } 66 | 67 | public function getSecurityCode() 68 | { 69 | return $this->SecurityCode; 70 | } 71 | 72 | public function setSecurityCode($SecurityCode) 73 | { 74 | $this->SecurityCode = $SecurityCode; 75 | } 76 | 77 | public function getToken() 78 | { 79 | return $this->Token; 80 | } 81 | 82 | public function setToken($Token) 83 | { 84 | $this->Token = $Token; 85 | } 86 | 87 | public function getInstallmentQuantity() 88 | { 89 | return $this->InstallmentQuantity; 90 | } 91 | 92 | public function setInstallmentQuantity($InstallmentQuantity = 1) 93 | { 94 | $this->InstallmentQuantity = $InstallmentQuantity; 95 | } 96 | 97 | public function getIsPreAuthorization() 98 | { 99 | return $this->IsPreAuthorization; 100 | } 101 | 102 | public function setIsPreAuthorization($IsPreAuthorization = false) 103 | { 104 | $this->IsPreAuthorization = $IsPreAuthorization; 105 | } 106 | 107 | public function getIsApplyInterest() 108 | { 109 | return $this->IsApplyInterest; 110 | } 111 | 112 | public function setIsApplyInterest($IsApplyInterest = false) 113 | { 114 | $this->IsApplyInterest = $IsApplyInterest; 115 | } 116 | 117 | public function getInterestRate() 118 | { 119 | return $this->InterestRate; 120 | } 121 | 122 | public function setInterestRate($InterestRate = null) 123 | { 124 | $this->InterestRate = $InterestRate; 125 | } 126 | 127 | public function getSoftDescriptor() 128 | { 129 | return $this->SoftDescriptor; 130 | } 131 | 132 | public function setSoftDescriptor($SoftDescriptor = "") 133 | { 134 | $this->SoftDescriptor = $SoftDescriptor; 135 | } 136 | 137 | public function JsonSerialize() 138 | { 139 | if ($this->Token) { 140 | return [ 141 | 'Token' => $this->Token, 142 | 'InstallmentQuantity' => (int) $this->InstallmentQuantity, 143 | 'IsPreAuthorization' => (bool) $this->IsPreAuthorization, 144 | 'IsApplyInterest' => (bool) $this->IsApplyInterest, 145 | 'InterestRate' => (float) $this->InterestRate, 146 | 'SoftDescriptor' => $this->SoftDescriptor, 147 | ]; 148 | } 149 | 150 | return [ 151 | 'Holder' => $this->Holder, 152 | 'CardNumber' => $this->CardNumber, 153 | 'ExpirationDate' => $this->ExpirationDate, 154 | 'SecurityCode' => $this->SecurityCode, 155 | 'Token' => $this->Token, 156 | 'InstallmentQuantity' => (int) $this->InstallmentQuantity, 157 | 'IsPreAuthorization' => (bool) $this->IsPreAuthorization, 158 | 'IsApplyInterest' => (bool) $this->IsApplyInterest, 159 | 'InterestRate' => (float) $this->InterestRate, 160 | 'SoftDescriptor' => $this->SoftDescriptor, 161 | ]; 162 | } 163 | } 164 | -------------------------------------------------------------------------------- /lib/Models/Payment/Cryptocoin.php: -------------------------------------------------------------------------------- 1 | Symbol; 21 | } 22 | 23 | public function setSymbol($Symbol) 24 | { 25 | $this->Symbol = $Symbol; 26 | } 27 | 28 | public function getAmount() 29 | { 30 | return $this->Amount; 31 | } 32 | 33 | public function setAmount($Amount) 34 | { 35 | $this->Amount = $Amount; 36 | } 37 | 38 | public function getAddress() 39 | { 40 | return $this->Address; 41 | } 42 | 43 | public function setAddress($Address) 44 | { 45 | $this->Address = $Address; 46 | } 47 | 48 | 49 | public function getQrCode() 50 | { 51 | return $this->QrCode; 52 | } 53 | 54 | public function setQrCode($QrCode) 55 | { 56 | $this->QrCode = $QrCode; 57 | } 58 | 59 | function __construct($Symbol) 60 | { 61 | $this->Symbol = $Symbol; 62 | } 63 | 64 | public function jsonSerialize() 65 | { 66 | return 67 | [ 68 | "Symbol" => $this->Symbol 69 | ]; 70 | } 71 | } -------------------------------------------------------------------------------- /lib/Models/Payment/DebitCard.php: -------------------------------------------------------------------------------- 1 | Holder; 23 | } 24 | 25 | public function setHolder($Holder) 26 | { 27 | $this->Holder = $Holder; 28 | } 29 | 30 | public function getCardNumber() 31 | { 32 | return $this->CardNumber; 33 | } 34 | 35 | public function setCardNumber($CardNumber) 36 | { 37 | $this->CardNumber = $CardNumber; 38 | } 39 | 40 | public function getExpirationDate() 41 | { 42 | return $this->ExpirationDate; 43 | } 44 | 45 | public function setExpirationDate($ExpirationDate) 46 | { 47 | $this->ExpirationDate = $ExpirationDate; 48 | } 49 | 50 | public function getSecurityCode() 51 | { 52 | return $this->SecurityCode; 53 | } 54 | 55 | public function setSecurityCode($SecurityCode) 56 | { 57 | $this->SecurityCode = $SecurityCode; 58 | } 59 | 60 | function __construct($Holder, $CardNumber, $ExpirationDate, $SecurityCode) 61 | { 62 | $this->Holder = $Holder; 63 | $this->CardNumber = $CardNumber; 64 | $this->ExpirationDate = $ExpirationDate; 65 | $this->SecurityCode = $SecurityCode; 66 | } 67 | 68 | public function JsonSerialize() 69 | { 70 | return [ 71 | 'Holder' => $this->Holder, 72 | 'CardNumber' => $this->CardNumber, 73 | 'ExpirationDate' => $this->ExpirationDate, 74 | 'SecurityCode' => $this->SecurityCode 75 | ]; 76 | } 77 | } 78 | 79 | ?> -------------------------------------------------------------------------------- /lib/Models/Payment/PaymentMethod.php: -------------------------------------------------------------------------------- 1 | Id; 20 | } 21 | 22 | public function setId($Id) 23 | { 24 | $this->Id = $Id; 25 | } 26 | 27 | public function getCode() 28 | { 29 | return $this->Code; 30 | } 31 | 32 | public function setCode($Code) 33 | { 34 | $this->Code = $Code; 35 | } 36 | 37 | public function getName() 38 | { 39 | return $this->Name; 40 | } 41 | 42 | public function setName($Name) 43 | { 44 | $this->Name = $Name; 45 | } 46 | 47 | public function getCodePaymentMethod() 48 | { 49 | return $this->CodePaymentMethod; 50 | } 51 | 52 | public function setCodePaymentMethod($CodePaymentMethod) 53 | { 54 | $this->CodePaymentMethod = $CodePaymentMethod; 55 | } 56 | 57 | public function __construct($Code) 58 | { 59 | $this->Code = $Code; 60 | } 61 | 62 | public function JsonSerialize() 63 | { 64 | return [ 65 | 'Code' => $this->Code 66 | ]; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /lib/Models/Payment/Pix.php: -------------------------------------------------------------------------------- 1 | Expiration; 18 | } 19 | 20 | public function setExpiration($Expiration) 21 | { 22 | $this->Expiration = $Expiration; 23 | } 24 | 25 | function __construct($Expiration = null) 26 | { 27 | $this->Expiration = $Expiration; 28 | } 29 | 30 | public function jsonSerialize() 31 | { 32 | return [ 33 | "Expiration" => $this->Expiration 34 | ]; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /lib/Models/Plan/Plans.php: -------------------------------------------------------------------------------- 1 | Id; 30 | } 31 | 32 | public function setId($Id){ 33 | $this->Id = $Id; 34 | } 35 | 36 | public function getPlanFrequence(){ 37 | return $this->PlanFrequence; 38 | } 39 | 40 | public function setPlanFrequence($PlanFrequence){ 41 | $this->PlanFrequence = $PlanFrequence; 42 | } 43 | 44 | public function getName(){ 45 | return $this->Name; 46 | } 47 | 48 | public function setName($Name){ 49 | $this->Name = $Name; 50 | } 51 | 52 | public function getDescription(){ 53 | return $this->Description; 54 | } 55 | 56 | public function setDescription($Description){ 57 | $this->Description = $Description; 58 | } 59 | 60 | public function getAmount(){ 61 | return $this->Amount; 62 | } 63 | 64 | public function setAmount($Amount){ 65 | $this->Amount = $Amount; 66 | } 67 | 68 | public function getSubscriptionLimit(){ 69 | return $this->SubscriptionLimit; 70 | } 71 | 72 | public function setSubscriptionLimit($SubscriptionLimit){ 73 | $this->SubscriptionLimit = $SubscriptionLimit; 74 | } 75 | 76 | public function getChargeDay(){ 77 | return $this->ChargeDay; 78 | } 79 | 80 | public function setChargeDay($ChargeDay){ 81 | $this->ChargeDay = $ChargeDay; 82 | } 83 | 84 | public function getIsEnabled(){ 85 | return $this->IsEnabled; 86 | } 87 | 88 | public function setIsEnabled($IsEnabled){ 89 | $this->IsEnabled = $IsEnabled; 90 | } 91 | 92 | public function getCallbackUrl(){ 93 | return $this->CallbackUrl; 94 | } 95 | 96 | public function setCallbackUrl($CallbackUrl){ 97 | $this->CallbackUrl = $CallbackUrl; 98 | } 99 | 100 | public function getExpirationDate(){ 101 | return $this->ExpirationDate; 102 | } 103 | 104 | public function setExpirationDate($ExpirationDate){ 105 | $this->ExpirationDate = $ExpirationDate; 106 | } 107 | 108 | public function getDaysDue(){ 109 | return $this->DaysDue; 110 | } 111 | 112 | public function setDaysDue($DaysDue){ 113 | $this->DaysDue = $DaysDue; 114 | } 115 | 116 | public function getDaysChurn(){ 117 | return $this->DaysChurn; 118 | } 119 | 120 | public function setDaysChurn($DaysChurn){ 121 | $this->DaysChurn = $DaysChurn; 122 | } 123 | 124 | public function getDaysChurnAlert(){ 125 | return $this->DaysChurnAlert; 126 | } 127 | 128 | public function setDaysChurnAlert($DaysChurnAlert){ 129 | $this->DaysChurnAlert = $DaysChurnAlert; 130 | } 131 | 132 | public function getDaysDelayAlert(){ 133 | return $this->DaysDelayAlert; 134 | } 135 | 136 | public function setDaysDelayAlert($DaysDelayAlert){ 137 | $this->DaysDelayAlert = $DaysDelayAlert; 138 | } 139 | 140 | public function getIsChargeOverdue(){ 141 | return $this->IsChargeOverdue; 142 | } 143 | 144 | public function setIsChargeOverdue($IsChargeOverdue){ 145 | $this->IsChargeOverdue = $IsChargeOverdue; 146 | } 147 | 148 | public function JsonSerialize() 149 | { 150 | return [ 151 | 'Id' => (int)$this->Id, 152 | 'PlanFrequence' => (string)$this->PlanFrequence, 153 | 'Name' => (string) $this->Name, 154 | 'Description' =>(string) $this->Description, 155 | 'Amount' =>(double) $this->Amount, 156 | 'SubscriptionLimit' =>(int) $this->SubscriptionLimit, 157 | 'ChargeDay' =>(int) $this->ChargeDay, 158 | 'IsEnabled' => (bool) $this->IsEnabled, 159 | 'CallbackUrl' =>(string) $this->CallbackUrl, 160 | 'ExpirationDate' =>(string) $this->ExpirationDate, 161 | 'DaysDue' =>(int) $this->DaysDue, 162 | 'DaysChurn' =>(int) $this->DaysChurn, 163 | 'DaysChurnAlert' =>(int) $this->DaysChurnAlert, 164 | 'DaysDelayAlert' =>(int) $this->DaysDelayAlert, 165 | 'IsChargeOverdue' =>(bool) $this->IsChargeOverdue 166 | ]; 167 | } 168 | } 169 | 170 | ?> -------------------------------------------------------------------------------- /lib/Models/Response/Response.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/Models/SingleSale/SingleSale.php: -------------------------------------------------------------------------------- 1 | Merchant; 38 | } 39 | 40 | public function setMerchant($Merchant){ 41 | $this->Merchant = $Merchant; 42 | } 43 | 44 | public function getCustomer(){ 45 | return $this->Customer; 46 | } 47 | 48 | public function setCustomer($Customer){ 49 | $this->Customer = $Customer; 50 | } 51 | 52 | public function getIdTransaction(){ 53 | return $this->IdTransaction; 54 | } 55 | 56 | public function setIdTransaction($IdTransaction){ 57 | $this->IdTransaction = $IdTransaction; 58 | } 59 | 60 | public function getSingleSaleHash(){ 61 | return $this->SingleSaleHash; 62 | } 63 | 64 | public function setSingleSaleHash($SingleSaleHash){ 65 | $this->SingleSaleHash = $SingleSaleHash; 66 | } 67 | 68 | public function getReference(){ 69 | return $this->Reference; 70 | } 71 | 72 | public function setReference($Reference){ 73 | $this->Reference = $Reference; 74 | } 75 | 76 | public function getCallbackUrl(){ 77 | return $this->CallbackUrl; 78 | } 79 | 80 | public function setCallbackUrl($CallbackUrl){ 81 | $this->CallbackUrl = $CallbackUrl; 82 | } 83 | 84 | public function getSingleSaleUrl(){ 85 | return $this->SingleSaleUrl; 86 | } 87 | 88 | public function setSingleSaleUrl($SingleSaleUrl){ 89 | $this->SingleSaleUrl = $SingleSaleUrl; 90 | } 91 | 92 | public function getBankSplipUrl(){ 93 | return $this->BankSplipUrl; 94 | } 95 | 96 | public function setBankSplipUrl($BankSplipUrl){ 97 | $this->BankSplipUrl = $BankSplipUrl; 98 | } 99 | 100 | public function getDueDate(){ 101 | return $this->DueDate; 102 | } 103 | 104 | public function setDueDate($DueDate){ 105 | $this->DueDate = $DueDate; 106 | } 107 | 108 | public function getExpirationDate(){ 109 | return $this->ExpirationDate; 110 | } 111 | 112 | public function setExpirationDate($ExpirationDate){ 113 | $this->ExpirationDate = $ExpirationDate; 114 | } 115 | 116 | public function getCreatedDate(){ 117 | return $this->CreatedDate; 118 | } 119 | 120 | public function setCreatedDate($CreatedDate){ 121 | $this->CreatedDate = $CreatedDate; 122 | } 123 | 124 | public function getAmount(){ 125 | return $this->Amount; 126 | } 127 | 128 | public function setAmount($Amount){ 129 | $this->Amount = $Amount; 130 | } 131 | 132 | public function getDiscountAmount(){ 133 | return $this->DiscountAmount; 134 | } 135 | 136 | public function setDiscountAmount($DiscountAmount){ 137 | $this->DiscountAmount = $DiscountAmount; 138 | } 139 | 140 | public function getPenaltyAmount(){ 141 | return $this->PenaltyAmount; 142 | } 143 | 144 | public function setPenaltyAmount($PenaltyAmount){ 145 | $this->PenaltyAmount = $PenaltyAmount; 146 | } 147 | 148 | public function getInterestAmount(){ 149 | return $this->InterestAmount; 150 | } 151 | 152 | public function setInterestAmount($InterestAmount){ 153 | $this->InterestAmount = $InterestAmount; 154 | } 155 | 156 | public function getEmails(){ 157 | return $this->Emails; 158 | } 159 | 160 | public function setEmails($Emails){ 161 | $this->Emails = $Emails; 162 | } 163 | 164 | public function getMessages(){ 165 | return $this->Messages; 166 | } 167 | 168 | public function setMessages($Messages){ 169 | $this->Messages = $Messages; 170 | } 171 | 172 | public function getInstruction(){ 173 | return $this->Instruction; 174 | } 175 | 176 | public function setInstruction($Instruction){ 177 | $this->Instruction = $Instruction; 178 | } 179 | 180 | public function getIsExcluded(){ 181 | return $this->IsExcluded; 182 | } 183 | 184 | public function setIsExcluded($IsExcluded){ 185 | $this->IsExcluded = $IsExcluded; 186 | } 187 | 188 | public function getPayment(){ 189 | return $this->Payment; 190 | } 191 | 192 | public function setPayment($Payment){ 193 | $this->Payment = $Payment; 194 | } 195 | 196 | public function getProducts(){ 197 | return $this->Products; 198 | } 199 | 200 | public function setProducts($Products){ 201 | $this->Products = $Products; 202 | } 203 | 204 | public function getPaymentMethods(){ 205 | return $this->PaymentMethods; 206 | } 207 | 208 | public function setPaymentMethods($PaymentMethods){ 209 | $this->PaymentMethods = $PaymentMethods; 210 | } 211 | 212 | public function getIdSubscription(){ 213 | return $this->IdSubscription; 214 | } 215 | 216 | public function setIdSubscription($IdSubscription){ 217 | $this->IdSubscription = $IdSubscription; 218 | } 219 | 220 | public function getInstallmentQuantity(){ 221 | return $this->InstallmentQuantity; 222 | } 223 | 224 | public function setInstallmentQuantity($InstallmentQuantity){ 225 | $this->InstallmentQuantity = $InstallmentQuantity; 226 | } 227 | 228 | public function JsonSerialize() 229 | { 230 | return [ 231 | 'Customer' => $this->Customer, 232 | 'Products' => (array) $this->Products, 233 | 'ExpirationDate' => $this->ExpirationDate, 234 | 'PaymentMethods' =>$this->PaymentMethods, 235 | 'DueDate' => $this->DueDate, 236 | 'Reference' =>(string) $this->Reference, 237 | 'PenaltyAmount' => $this->PenaltyAmount, 238 | 'InterestAmount' => $this->InterestAmount, 239 | 'Emails' => $this->Emails, 240 | 'Messages' =>(array) $this->Messages, 241 | 'Instruction' => $this->Instruction, 242 | 'SingleSaleHash' =>(string) $this->SingleSaleHash, 243 | 'CallbackUrl' =>(string) $this->CallbackUrl, 244 | 'InstallmentQuantity' =>(int) $this->InstallmentQuantity 245 | ]; 246 | } 247 | } 248 | ?> -------------------------------------------------------------------------------- /lib/Models/SingleSale/SingleSalePayment.php: -------------------------------------------------------------------------------- 1 | PaymentMethod; 16 | } 17 | 18 | public function setPaymentMethod($PaymentMethod){ 19 | $this->PaymentMethod = $PaymentMethod; 20 | } 21 | 22 | public function getPaymentDate(){ 23 | return $this->PaymentDate; 24 | } 25 | 26 | public function setPaymentDate($PaymentDate){ 27 | $this->PaymentDate = $PaymentDate; 28 | } 29 | } 30 | 31 | ?> -------------------------------------------------------------------------------- /lib/Models/SingleSale/SingleSalePaymentMethod.php: -------------------------------------------------------------------------------- 1 | Id; 18 | } 19 | 20 | public function setId($Id){ 21 | $this->Id = $Id; 22 | } 23 | 24 | public function getIdSingleSale(){ 25 | return $this->IdSingleSale; 26 | } 27 | 28 | public function setIdSingleSale($IdSingleSale){ 29 | $this->IdSingleSale = $IdSingleSale; 30 | } 31 | 32 | public function getCodePaymentMethod(){ 33 | return $this->CodePaymentMethod; 34 | } 35 | 36 | public function setCodePaymentMethod($CodePaymentMethod){ 37 | $this->CodePaymentMethod = $CodePaymentMethod; 38 | } 39 | 40 | public function getPaymentMethod(){ 41 | return $this->PaymentMethod; 42 | } 43 | 44 | public function setPaymentMethod($PaymentMethod){ 45 | $this->PaymentMethod = $PaymentMethod; 46 | } 47 | 48 | public function __construct($CodePaymentMethod) 49 | { 50 | $this->CodePaymentMethod = $CodePaymentMethod; 51 | } 52 | 53 | public function JsonSerialize() 54 | { 55 | return [ 56 | 'CodePaymentMethod' => $this->CodePaymentMethod 57 | ]; 58 | } 59 | } 60 | 61 | ?> -------------------------------------------------------------------------------- /lib/Models/SingleSale/SingleSaleProduct.php: -------------------------------------------------------------------------------- 1 | Code; 18 | } 19 | 20 | public function setId($Id){ 21 | $this->Id = $Id; 22 | } 23 | 24 | public function getDescription(){ 25 | return $this->Description; 26 | } 27 | 28 | public function setDescription($Description){ 29 | $this->Description = $Description; 30 | } 31 | 32 | public function getUnitPrice(){ 33 | return $this->UnitPrice; 34 | } 35 | 36 | public function setUnitPrice($UnitPrice){ 37 | $this->UnitPrice = $UnitPrice; 38 | } 39 | 40 | public function getQuantity(){ 41 | return $this->Quantity; 42 | } 43 | 44 | public function setQuantity($Quantity){ 45 | $this->Quantity = $Quantity; 46 | } 47 | 48 | public function __construct($Id,$Description,$UnitPrice,$Quantity) 49 | { 50 | $this->Id = $Id; 51 | $this->Description = $Description; 52 | $this->UnitPrice = $UnitPrice; 53 | $this->Quantity = $Quantity; 54 | 55 | } 56 | 57 | 58 | public function jsonSerialize() 59 | { 60 | return[ 61 | "Id" => $this->Id, 62 | "Description" => $this->Description, 63 | "UnitPrice" => $this->UnitPrice, 64 | "Quantity" => $this->Quantity 65 | ]; 66 | } 67 | 68 | } 69 | 70 | ?> -------------------------------------------------------------------------------- /lib/Models/Subscription/Subscription.php: -------------------------------------------------------------------------------- 1 | Plan; 24 | } 25 | 26 | public function setPlan($Plan) 27 | { 28 | $this->Plan = $Plan; 29 | } 30 | 31 | public function getPaymentMethod() 32 | { 33 | return $this->PaymentMethod; 34 | } 35 | 36 | public function setPaymentMethod($PaymentMethod) 37 | { 38 | $this->PaymentMethod = $PaymentMethod; 39 | } 40 | 41 | public function getCustomer() 42 | { 43 | return $this->Customer; 44 | } 45 | 46 | public function setCustomer($Customer) 47 | { 48 | $this->Customer = $Customer; 49 | } 50 | 51 | public function getIsSendSMS() 52 | { 53 | return $this->IsSendSMS; 54 | } 55 | 56 | public function setIsSendSMS($IsSendSMS) 57 | { 58 | $this->IsSendSMS = $IsSendSMS; 59 | } 60 | 61 | public function getIsSendEmail() 62 | { 63 | return $this->IsSendEmail; 64 | } 65 | 66 | public function setIsSendEmail($IsSendEmail) 67 | { 68 | $this->IsSendEmail = $IsSendEmail; 69 | } 70 | 71 | public function getEmails() 72 | { 73 | return $this->Emails; 74 | } 75 | 76 | public function setEmails($Emails) 77 | { 78 | $this->Emails = $Emails; 79 | } 80 | 81 | public function getIsSandbox() 82 | { 83 | return $this->IsSandbox; 84 | } 85 | 86 | public function setIsSandbox($IsSandbox) 87 | { 88 | $this->IsSandbox = $IsSandbox; 89 | } 90 | 91 | public function getFirstChargeDate() 92 | { 93 | return $this->FirstChargeDate; 94 | } 95 | 96 | public function setFirstChargeDate($FirstChargeDate) 97 | { 98 | $this->FirstChargeDate = $FirstChargeDate; 99 | } 100 | 101 | public function setToken($Token) 102 | { 103 | $this->Token = $Token; 104 | } 105 | 106 | public function setCreditCard($CreditCard) 107 | { 108 | $this->CreditCard = $CreditCard; 109 | } 110 | 111 | public function JsonSerialize() 112 | { 113 | return [ 114 | 'Plan' => (int) $this->Plan, 115 | 'PaymentMethod' => (string) $this->PaymentMethod, 116 | 'Customer' => (array) $this->Customer, 117 | 'IsSendSMS' => (bool) $this->IsSendSMS, 118 | 'IsSendEmail' => (bool) $this->IsSendEmail, 119 | 'Emails' => (array) $this->Emails, 120 | 'IsSandbox' => (bool) $this->IsSandbox, 121 | 'FirstChargeDate' => (string) $this->FirstChargeDate, 122 | 'Token' => (string) $this->Token, 123 | 'CreditCard' => (array) $this->CreditCard 124 | ]; 125 | } 126 | } 127 | 128 | ?> -------------------------------------------------------------------------------- /lib/Models/Subscription/SubscriptionRequest.php: -------------------------------------------------------------------------------- 1 | Plan; 19 | } 20 | 21 | 22 | public function setPlan($Plan) 23 | { 24 | $this->Plan = $Plan; 25 | } 26 | 27 | public function getCustomer() 28 | { 29 | return $this->Customer; 30 | } 31 | 32 | public function setCustomer($Customer) 33 | { 34 | $this->Customer = $Customer; 35 | } 36 | 37 | public function getSubscriptionObject() 38 | { 39 | return $this->SubscriptionObject; 40 | } 41 | 42 | public function setSubscriptionObject($SubscriptionObject) 43 | { 44 | $this->SubscriptionObject = $SubscriptionObject; 45 | } 46 | 47 | public function JsonSerialize() 48 | { 49 | return [ 50 | 'Plan' => $this->Plan, 51 | 'IsSandbox' => $this->IsSandbox, 52 | 'Customer' => $this->Customer, 53 | 'ChargeDate' => $this->ChargeDate, 54 | 'SubscriptionObject' => $this->SubscriptionObject 55 | ]; 56 | } 57 | } 58 | 59 | ?> -------------------------------------------------------------------------------- /lib/Models/Transactions/Base.php: -------------------------------------------------------------------------------- 1 | Id; 33 | } 34 | 35 | public function setId($Id) 36 | { 37 | $this->Id = $Id; 38 | } 39 | 40 | public function getIdTransaction() 41 | { 42 | return $this->IdTransaction; 43 | } 44 | 45 | public function setIdTransaction($IdTransaction) 46 | { 47 | $this->IdTransaction = $IdTransaction; 48 | } 49 | 50 | public function getIpAddress() 51 | { 52 | return $this->IpAddress; 53 | } 54 | 55 | public function setIpAddress($IpAddress) 56 | { 57 | $this->IpAddress = $IpAddress; 58 | } 59 | 60 | public function getVisitorId() 61 | { 62 | return $this->VisitorId; 63 | } 64 | 65 | public function setVisitorId($VisitorId) 66 | { 67 | $this->VisitorId = $VisitorId; 68 | } 69 | 70 | public function getIsSandbox() 71 | { 72 | return $this->IsSandbox; 73 | } 74 | 75 | public function setIsSandbox($IsSandbox) 76 | { 77 | $this->IsSandbox = $IsSandbox; 78 | } 79 | 80 | public function getApplication() 81 | { 82 | return $this->Application; 83 | } 84 | 85 | public function setApplication($Application) 86 | { 87 | $this->Application = $Application; 88 | } 89 | 90 | public function getReference() 91 | { 92 | return $this->Reference; 93 | } 94 | 95 | public function setReference($Reference) 96 | { 97 | $this->Reference = $Reference; 98 | } 99 | 100 | public function getVendor() 101 | { 102 | return $this->Vendor; 103 | } 104 | 105 | public function setVendor($Vendor) 106 | { 107 | $this->Vendor = $Vendor; 108 | } 109 | 110 | public function getCallbackUrl() 111 | { 112 | return $this->CallbackUrl; 113 | } 114 | 115 | public function setCallbackUrl($CallbackUrl) 116 | { 117 | $this->CallbackUrl = $CallbackUrl; 118 | } 119 | 120 | public function getPaymentMethod() 121 | { 122 | return $this->PaymentMethod; 123 | } 124 | 125 | public function setPaymentMethod($Code) 126 | { 127 | if ($Code != null) { 128 | $this->PaymentMethod = new PaymentMethod($Code); 129 | } 130 | } 131 | 132 | public function getCustomer() 133 | { 134 | return $this->Customer; 135 | } 136 | 137 | public function setCustomer($Customer) 138 | { 139 | $this->Customer = $Customer; 140 | } 141 | 142 | public function getProducts() 143 | { 144 | return $this->Products; 145 | } 146 | 147 | public function setProducts($Products) 148 | { 149 | $this->Products = $Products; 150 | } 151 | 152 | public function getSplits() 153 | { 154 | return $this->Splits; 155 | } 156 | 157 | public function setSplits($Splits) 158 | { 159 | $this->Splits = $Splits; 160 | } 161 | } 162 | -------------------------------------------------------------------------------- /lib/Models/Transactions/Splits.php: -------------------------------------------------------------------------------- 1 | IdReceiver = $IdReceiver; 20 | } 21 | 22 | public function getIdReceiver() 23 | { 24 | return $this->IdReceiver; 25 | } 26 | 27 | public function setIdentity($Identity) 28 | { 29 | $this->Identity = $Identity; 30 | } 31 | 32 | public function getIdentity() 33 | { 34 | return $this->Identity; 35 | } 36 | 37 | public function setName($Name) 38 | { 39 | $this->Name = $Name; 40 | } 41 | 42 | public function getName() 43 | { 44 | return $this->Name; 45 | } 46 | 47 | public function setIsPayTax($IsPayTax) 48 | { 49 | $this->IsPayTax = $IsPayTax; 50 | } 51 | 52 | public function getIsPayTax() 53 | { 54 | return $this->IsPayTax; 55 | } 56 | 57 | public function setAmount($Amount) 58 | { 59 | $this->Amount = $Amount; 60 | } 61 | 62 | public function getAmount() 63 | { 64 | return $this->Amount; 65 | } 66 | 67 | public function setCodeTaxType($CodeTaxType) 68 | { 69 | $this->CodeTaxType = $CodeTaxType; 70 | } 71 | 72 | public function getCodeTaxType() 73 | { 74 | return $this->CodeTaxType; 75 | } 76 | 77 | public function setCodeReceiverType($CodeReceiverType) 78 | { 79 | $this->CodeReceiverType = $CodeReceiverType; 80 | } 81 | 82 | public function getCodeReceiverType() 83 | { 84 | return $this->CodeReceiverType; 85 | } 86 | 87 | 88 | public function jsonSerialize() 89 | { 90 | return [ 91 | 'IdReceiver' => $this->getIdReceiver(), 92 | 'Identity' => $this->getIdentity(), 93 | 'Name' => $this->getName(), 94 | 'IsPayTax' => $this->getIsPayTax(), 95 | 'Amount' => $this->getAmount(), 96 | 'CodeTaxType' => $this->getCodeTaxType(), 97 | 'CodeReceiverType' => $this->getCodeReceiverType() 98 | ]; 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /lib/Models/Transactions/Transaction.php: -------------------------------------------------------------------------------- 1 | PaymentObject; 16 | } 17 | 18 | public function setPaymentObject($PaymentObject) 19 | { 20 | $this->PaymentObject = $PaymentObject; 21 | } 22 | 23 | public function jsonSerialize() 24 | { 25 | return[ 26 | 'PaymentObject' => $this->getPaymentObject(), 27 | 'Application' => $this->getApplication(), 28 | 'IpAddress' => $this->getIpAddress(), 29 | 'VisitorId' => $this->getVisitorId(), 30 | 'Vendor' => $this->getVendor(), 31 | 'Reference' => $this->getReference(), 32 | 'IsSandbox' => $this->getIsSandbox(), 33 | 'CallbackUrl' => $this->getCallbackUrl(), 34 | 'PaymentMethod' => $this->getPaymentMethod(), 35 | 'Customer' => $this->getCustomer(), 36 | 'Products' => $this->getProducts(), 37 | 'Splits' => $this->getSplits() 38 | ]; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /lib/Models/Transactions/TransactionStatus.php: -------------------------------------------------------------------------------- 1 | Id; 17 | } 18 | 19 | public function setId($Id) 20 | { 21 | $this->Id = $Id; 22 | } 23 | 24 | public function getCode() 25 | { 26 | return $this->Code; 27 | } 28 | 29 | public function setCode($Code) 30 | { 31 | $this->Code = $Code; 32 | } 33 | 34 | public function getName() 35 | { 36 | return $this->Name; 37 | } 38 | 39 | public function setName($Name) 40 | { 41 | $this->Name = $Name; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /lib/Models/Transference/Transfer.php: -------------------------------------------------------------------------------- 1 | IsUseCheckingaccount; 16 | } 17 | 18 | public function setIsUseCheckingaccount($IsUseCheckingaccount){ 19 | $this->IsUseCheckingaccount = $IsUseCheckingaccount; 20 | } 21 | public function getTransferRegisters(){ 22 | return $this->IdMerchantRequester; 23 | } 24 | 25 | public function setTransferRegisters($TransferRegisters){ 26 | $this->TransferRegisters = $TransferRegisters; 27 | } 28 | 29 | public function __construct($IsUseCheckingaccount,$TransferRegisters) 30 | { 31 | $this->IsUseCheckingaccount = $IsUseCheckingaccount; 32 | $this->TransferRegisters = $TransferRegisters; 33 | } 34 | 35 | public function JsonSerialize() 36 | { 37 | 38 | return [ 39 | 'IsUseCheckingaccount' =>(bool) $this->IsUseCheckingaccount, 40 | 'TransferRegisters' => (array) $this->TransferRegisters 41 | ]; 42 | } 43 | } 44 | ?> -------------------------------------------------------------------------------- /lib/Models/Transference/TransferRegister.php: -------------------------------------------------------------------------------- 1 | Id; 39 | } 40 | 41 | public function setId($Id){ 42 | $this->Id = $Id; 43 | } 44 | 45 | public function getIdTransfer(){ 46 | return $this->IdTransfer; 47 | } 48 | 49 | public function setIdTransfer($IdTransfer){ 50 | $this->IdTransfer = $IdTransfer; 51 | } 52 | 53 | public function getIdMerchant(){ 54 | return $this->IdMerchant; 55 | } 56 | 57 | public function setIdMerchant($IdMerchant){ 58 | $this->IdMerchant = $IdMerchant; 59 | } 60 | 61 | public function getBankData(){ 62 | return $this->BankData; 63 | } 64 | 65 | public function setBankData($BankData){ 66 | $this->BankData = $BankData; 67 | } 68 | 69 | public function getIdentity(){ 70 | return $this->Identity; 71 | } 72 | 73 | public function setIdentity($Identity){ 74 | $this->Identity = $Identity; 75 | } 76 | public function getReceiverName(){ 77 | return $this->ReceiverName; 78 | } 79 | 80 | public function setIReceiverName($ReceiverName){ 81 | $this->ReceiverName = $ReceiverName; 82 | } 83 | 84 | public function getAmount(){ 85 | return $this->Amount; 86 | } 87 | 88 | public function setAmount($Amount){ 89 | $this->Amount = $Amount; 90 | } 91 | 92 | public function getIdentification(){ 93 | return $this->Identification; 94 | } 95 | 96 | public function setIdentification($Identification){ 97 | $this->Identification = $Identification; 98 | } 99 | 100 | public function getCallbackUrl(){ 101 | return $this->CallbackUrl; 102 | } 103 | 104 | public function setCallbackUrl($CallbackUrl){ 105 | $this->CallbackUrl = $CallbackUrl; 106 | } 107 | 108 | public function getIsTransferred(){ 109 | return $this->IsTransferred; 110 | } 111 | 112 | public function setIsTransferred($IsTransferred){ 113 | $this->IsTransferred = $IsTransferred; 114 | } 115 | 116 | public function getIsReleaseTransfer(){ 117 | return $this->IsReleaseTransfer; 118 | } 119 | 120 | public function setIsReleaseTransfer($IsReleaseTransfer){ 121 | $this->IsReleaseTransfer = $IsReleaseTransfer; 122 | } 123 | 124 | public function getTransferRegisters(){ 125 | return $this->TransferRegisters; 126 | } 127 | 128 | public function setTransferRegisters($TransferRegisters){ 129 | $this->TransferRegisters = $TransferRegisters; 130 | } 131 | 132 | public function getIsNotified(){ 133 | return $this->IsNotified; 134 | } 135 | 136 | public function setIsNotified($IsNotified){ 137 | $this->IsNotified = $IsNotified; 138 | } 139 | 140 | public function getIsReturned(){ 141 | return $this->IsReturned; 142 | } 143 | 144 | public function setIsReturned($IsReturned){ 145 | $this->IsReturned = $IsReturned; 146 | } 147 | 148 | public function getHashScheduling(){ 149 | return $this->HashScheduling; 150 | } 151 | 152 | public function setHashScheduling($HashScheduling){ 153 | $this->HashScheduling = $HashScheduling; 154 | } 155 | 156 | public function getHashConfirmation(){ 157 | return $this->HashConfirmation; 158 | } 159 | 160 | public function setHashConfirmation($HashConfirmation){ 161 | $this->HashConfirmation = $HashConfirmation; 162 | } 163 | 164 | public function getCompensationDate(){ 165 | return $this->CompensationDate; 166 | } 167 | 168 | public function setCompensationDate($CompensationDate){ 169 | $this->CompensationDate = $CompensationDate; 170 | } 171 | 172 | public function getCreatedDate(){ 173 | return $this->CreatedDate; 174 | } 175 | 176 | public function setCreatedDate($CreatedDate){ 177 | $this->CreatedDate = $CreatedDate; 178 | } 179 | 180 | public function getChangedDate(){ 181 | return $this->ChangedDate; 182 | } 183 | 184 | public function setChangedDate($ChangedDate){ 185 | $this->ChangedDate = $ChangedDate; 186 | } 187 | 188 | public function getValidation(){ 189 | return $this->Validation; 190 | } 191 | 192 | public function setValidation($Validation){ 193 | $this->Validation = $Validation; 194 | } 195 | 196 | public function getIdMerchantRequester(){ 197 | return $this->IdMerchantRequester; 198 | } 199 | 200 | public function setIdMerchantRequester($IdMerchantRequester){ 201 | $this->IdMerchantRequester = $IdMerchantRequester; 202 | } 203 | public function __construct($ReceiverName,$Amount,$Identity,$Identification,$CompensationDate,$CallbackUrl, 204 | $BankData) 205 | { 206 | $this->ReceiverName = $ReceiverName; 207 | $this->Amount = $Amount; 208 | $this->Identity = $Identity; 209 | $this->Identification = $Identification; 210 | $this->CompensationDate = $CompensationDate; 211 | $this->CallbackUrl = $CallbackUrl; 212 | $this->BankData = $BankData; 213 | } 214 | 215 | public function JsonSerialize() 216 | { 217 | return [ 218 | 'ReceiverName' =>(string)$this->ReceiverName, 219 | 'Amount' => $this->Amount, 220 | 'Identity' =>(string) $this->Identity, 221 | 'Identification' =>(string) $this->Identification, 222 | 'CompensationDate' =>(string) $this->CompensationDate, 223 | 'CallbackUrl' =>(string) $this->CallbackUrl, 224 | 'BankData' => $this->BankData 225 | ]; 226 | } 227 | } 228 | ?> -------------------------------------------------------------------------------- /test/AccountDepositRequestTest.php: -------------------------------------------------------------------------------- 1 | setAPIKEY('x-api-key'); 12 | /** 13 | * Class AccountDepositTest 14 | * 15 | * @package Safe2Pay\Test 16 | */ 17 | class AccountDepositTest 18 | { 19 | public static function GetBankAccount() 20 | { 21 | 22 | $response = AccountDepositRequest::GetBankAccount(); 23 | 24 | echo (json_encode($response)); 25 | } 26 | 27 | public static function GetListDeposits() 28 | { 29 | $month = 5; 30 | $year = 2019; 31 | 32 | $response = AccountDepositRequest::GetListDeposits($month,$year); 33 | 34 | echo (json_encode($response)); 35 | } 36 | 37 | public static function GetListDetailsDeposits() 38 | { 39 | $day = 17; 40 | $month = 9; 41 | $year = 2019; 42 | $page = 1; 43 | $RowsPerPage = 100; 44 | 45 | $response = AccountDepositRequest::GetListDetailsDeposits($day, $month,$year,$page,$RowsPerPage); 46 | 47 | echo (json_encode($response)); 48 | } 49 | 50 | public static function GetTransferDetail() 51 | { 52 | $Id = 1049319; 53 | 54 | $response = AccountDepositRequest::GetDepositDetail($Id); 55 | 56 | echo (json_encode($response)); 57 | } 58 | 59 | } 60 | 61 | //AccountDepositTest::GetBankAccount(); 62 | //AccountDepositTest::GetListDeposits(); 63 | //AccountDepositTest::GetListDetailsDeposits(); 64 | //AccountDepositTest::GetTransferDetail(); 65 | -------------------------------------------------------------------------------- /test/InvoiceTest.php: -------------------------------------------------------------------------------- 1 | setAPIKEY('x-api-key'); 24 | 25 | /** 26 | * Class InvoiceTest 27 | * 28 | * @package Safe2Pay\Test 29 | */ 30 | class InvoiceTest 31 | { 32 | 33 | public static function Add() 34 | { 35 | 36 | //Customer 37 | $Customer = new Customer(); 38 | $Customer->setName("Teste Cliente"); 39 | $Customer->setIdentity("01579286000174"); 40 | $Customer->setEmail("Teste@Teste.com.br"); 41 | $Customer->setPhone("51999999999"); 42 | 43 | $Customer->Address = new Address(); 44 | $Customer->Address->setZipCode("90620000"); 45 | $Customer->Address->setStreet("Avenida Princesa Isabel"); 46 | $Customer->Address->setNumber("828"); 47 | $Customer->Address->setComplement("Lado B"); 48 | $Customer->Address->setDistrict("Santana"); 49 | $Customer->Address->setStateInitials("RS"); 50 | $Customer->Address->setCityName("Porto Alegre"); 51 | $Customer->Address->setCountryName("Brasil"); 52 | 53 | 54 | $singleSale = new SingleSale(); 55 | 56 | $singleSale->setCustomer($Customer); 57 | 58 | $singleSale->setPaymentMethods( 59 | (array( 60 | new SingleSalePaymentMethod("1"), 61 | new SingleSalePaymentMethod("2"), 62 | new SingleSalePaymentMethod("3"), 63 | new SingleSalePaymentMethod("4"), 64 | )) 65 | ); 66 | 67 | $singleSale->setProducts( 68 | (array( 69 | new SingleSaleProduct(1, "teste", "1", "1.00"), 70 | new SingleSaleProduct(2, "teste", "1", "1.00"), 71 | new SingleSaleProduct(3, "teste", "1", "1.00"), 72 | )) 73 | ); 74 | $singleSale->setMessages( 75 | array( 76 | "Message 1", 77 | "Message 2", 78 | "Message 3", 79 | ) 80 | ); 81 | 82 | //Lista de emails 83 | $singleSale->setEmails( 84 | (array( 85 | "lucas@safe2pay.com" 86 | )) 87 | ); 88 | 89 | $singleSale->setCallbackUrl("https://safe2pay.com.br/api/Notify"); 90 | 91 | $singleSale->setExpirationDate("2021-10-16"); 92 | $singleSale->setDueDate("2021-10-16"); 93 | $singleSale->setReference("teste"); 94 | $singleSale->setPenaltyAmount("1.00"); 95 | $singleSale->setInterestAmount("1.00"); 96 | 97 | $response = InvoiceRequest::Add($singleSale); 98 | 99 | echo (json_encode($response)); 100 | } 101 | 102 | public static function Update() 103 | { 104 | 105 | //Customer 106 | $Customer = new Customer(); 107 | $Customer->setName("Teste Cliente"); 108 | $Customer->setIdentity("01579286000174"); 109 | $Customer->setEmail("Teste@Teste.com.br"); 110 | $Customer->setPhone("51999999999"); 111 | 112 | $Customer->Address = new Address(); 113 | $Customer->Address->setZipCode("90620000"); 114 | $Customer->Address->setStreet("Avenida Princesa Isabel"); 115 | $Customer->Address->setNumber("828"); 116 | $Customer->Address->setComplement("Lado B"); 117 | $Customer->Address->setDistrict("Santana"); 118 | $Customer->Address->setStateInitials("RS"); 119 | $Customer->Address->setCityName("Porto Alegre"); 120 | $Customer->Address->setCountryName("Brasil"); 121 | 122 | 123 | $singleSale = new SingleSale(); 124 | 125 | $singleSale->setCustomer($Customer); 126 | 127 | $singleSale->setPaymentMethods( 128 | (array( 129 | new SingleSalePaymentMethod("1"), 130 | new SingleSalePaymentMethod("2"), 131 | new SingleSalePaymentMethod("3"), 132 | new SingleSalePaymentMethod("4"), 133 | )) 134 | ); 135 | 136 | $singleSale->setProducts( 137 | (array( 138 | new SingleSaleProduct(1, "teste", "1", "1.00"), 139 | new SingleSaleProduct(2, "teste", "1", "1.00"), 140 | new SingleSaleProduct(3, "teste", "1", "1.00"), 141 | )) 142 | ); 143 | $singleSale->setMessages( 144 | array( 145 | "Message 1", 146 | "Message 2", 147 | "Message 3", 148 | ) 149 | ); 150 | 151 | //Lista de emails 152 | $singleSale->setEmails( 153 | (array( 154 | "lucas@safe2pay.com" 155 | )) 156 | ); 157 | 158 | $singleSale->setCallbackUrl("https://safe2pay.com.br/api/Notify"); 159 | 160 | $singleSale->setExpirationDate("2019-10-16"); 161 | $singleSale->setDueDate("2019-10-16"); 162 | $singleSale->setReference("teste"); 163 | $singleSale->setPenaltyAmount("1.00"); 164 | $singleSale->setInterestAmount("1.00"); 165 | $singleSale->setSingleSaleHash("5f29ac6809d34e82bc1b97477261eaa0"); 166 | 167 | $response = InvoiceRequest::Update($singleSale); 168 | 169 | echo (json_encode($response)); 170 | } 171 | 172 | public static function Cancel() 173 | { 174 | $hashSale = "9166d462f3c440c6adebff2f2fe82b35"; 175 | 176 | $response = InvoiceRequest::Cancel($hashSale); 177 | 178 | echo (json_encode($response)); 179 | } 180 | 181 | public static function Get() 182 | { 183 | $hashSale = "5f29ac6809d34e82bc1b97477261eaa0"; 184 | 185 | $response = InvoiceRequest::Get($hashSale); 186 | 187 | echo (json_encode($response)); 188 | } 189 | 190 | public static function Resend() 191 | { 192 | $hashSale = "5f29ac6809d34e82bc1b97477261eaa0"; 193 | 194 | $response = InvoiceRequest::Resend($hashSale); 195 | 196 | echo (json_encode($response)); 197 | } 198 | } 199 | 200 | InvoiceTest::Cancel(); 201 | InvoiceTest::Get(); 202 | InvoiceTest::Add(); 203 | InvoiceTest::Update(); 204 | InvoiceTest::Resend(); 205 | -------------------------------------------------------------------------------- /test/MarketplaceTest.php: -------------------------------------------------------------------------------- 1 | setAPIKEY('x-api-key'); 19 | 20 | /** 21 | * Class MarketplaceTest 22 | * 23 | * @package Safe2Pay\Test 24 | */ 25 | class MarketplaceTest 26 | { 27 | 28 | public static function Add() 29 | { 30 | 31 | $Merchant = new Merchant(); 32 | $Merchant->setIdentity("72618919000154"); 33 | $Merchant->setName("Francisco e Laís Filmagens ME"); 34 | $Merchant->setCommercialName("Empresa Teste"); 35 | $Merchant->setIsPanelRestricted(false); 36 | //Dados do responsável 37 | $Merchant->setResponsibleIdentity("04270435062"); 38 | $Merchant->setResponsibleName("Lucas"); 39 | $Merchant->setEmail("4ba9b0275sdf79f@HOTMasdfasdf.com"); 40 | //Dados do responsável técnico 41 | $Merchant->setTechIdentity("32001774117"); 42 | $Merchant->setTechName("Responsável técnico"); 43 | $Merchant->setTechEmail("4ba9beeeee02757sdfg9f@tedfgdfgste.cdfgom"); 44 | 45 | //Endereço 46 | $Merchant->Address = new Address(); 47 | $Merchant->Address->setZipCode("90620000"); 48 | $Merchant->Address->setStreet("Avenida Princesa Isabel"); 49 | $Merchant->Address->setNumber("828"); 50 | $Merchant->Address->setComplement("Lado B"); 51 | $Merchant->Address->setDistrict("Santana"); 52 | $Merchant->Address->setStateInitials("RS"); 53 | $Merchant->Address->setCityName("Porto Alegre"); 54 | $Merchant->Address->setCountryName("Brasil"); 55 | 56 | 57 | $bankData = new BankData(); 58 | $bankData->setBank(new Bank("041")); 59 | $bankData->setAccountType(new AccountType("CC")); 60 | $bankData->setBankAccount("1676"); 61 | $bankData->setBankAccountDigit("0"); 62 | $bankData->setBankAgency("41776"); 63 | $bankData->setBankAgencyDigit("7"); 64 | //Split de taxas 65 | //Código da forma de pagamento 66 | // 1 - Boleto bancário 67 | // 2 - Cartão de crédito 68 | // 3 - Criptomoeda 69 | // 4 - Cartão de débito 70 | $merchantSplit = array( 71 | new MerchantSplit(false,"1",array(new MerchantSplitTax("1","1.00"))), 72 | new MerchantSplit(false,"2",array(new MerchantSplitTax("1","1.75"))), 73 | new MerchantSplit(false,"3",array(new MerchantSplitTax("1","1.50"))), 74 | new MerchantSplit(false,"4",array(new MerchantSplitTax("1","1.50"))), 75 | ); 76 | 77 | 78 | $Merchant->setBankData($bankData); 79 | $Merchant->setMerchantSplit($merchantSplit); 80 | 81 | $response = MarketplaceRequest::Add($Merchant); 82 | 83 | echo (json_encode($response)); 84 | } 85 | 86 | public static function Update() 87 | { 88 | 89 | $Merchant = new Merchant(); 90 | $Merchant->setId(5280); 91 | $Merchant->setIdentity("53797700000115"); 92 | $Merchant->setName("Francisco e Laís Filmagens ME"); 93 | $Merchant->setCommercialName("Empresa Teste"); 94 | //Dados do responsável 95 | $Merchant->setResponsibleIdentity("04270435062"); 96 | $Merchant->setResponsibleName("Lucas"); 97 | $Merchant->setEmail("4ba9b029f@HOTMAIL.COM"); 98 | //Dados do responsável técnico 99 | $Merchant->setTechIdentity("32001774117"); 100 | $Merchant->setTechName("Responsável técnico"); 101 | $Merchant->setTechEmail("Teste12@teste.com"); 102 | 103 | //Endereço 104 | $Merchant->Address = new Address(); 105 | $Merchant->Address->setZipCode("90620000"); 106 | $Merchant->Address->setStreet("Avenida Princesa Isabel"); 107 | $Merchant->Address->setNumber("828"); 108 | $Merchant->Address->setComplement("Lado B"); 109 | $Merchant->Address->setDistrict("Santana"); 110 | $Merchant->Address->setStateInitials("RS"); 111 | $Merchant->Address->setCityName("Porto Alegre"); 112 | $Merchant->Address->setCountryName("Brasil"); 113 | 114 | 115 | $bankData = new BankData(); 116 | $bankData->setBank(new Bank("041")); 117 | $bankData->setBankAccount("1676"); 118 | $bankData->setBankAccountDigit("0"); 119 | $bankData->setBankAgency("41776"); 120 | $bankData->setBankAgencyDigit("7"); 121 | $bankData->setOperation("3"); 122 | 123 | //Split de taxas 124 | //Código da forma de pagamento 125 | // 1 - Boleto bancário 126 | // 2 - Cartão de crédito 127 | // 3 - Criptomoeda 128 | // 4 - Cartão de débito 129 | $merchantSplit = array( 130 | new MerchantSplit(false,"1",array(new MerchantSplitTax("1","1.00"))), 131 | new MerchantSplit(false,"2",array(new MerchantSplitTax("1","1.75"))), 132 | new MerchantSplit(false,"3",array(new MerchantSplitTax("1","1.50"))), 133 | new MerchantSplit(false,"4",array(new MerchantSplitTax("1","1.50"))), 134 | ); 135 | 136 | 137 | $Merchant->setBankData($bankData); 138 | $Merchant->setMerchantSplit($merchantSplit); 139 | 140 | $response = MarketplaceRequest::Update($Merchant); 141 | 142 | echo (json_encode($response)); 143 | } 144 | 145 | public static function Delete() 146 | { 147 | $Id = 4354; 148 | $response = MarketplaceRequest::Delete($Id); 149 | 150 | echo (json_encode($response)); 151 | } 152 | 153 | public static function List() 154 | { 155 | $PageNumber = 1; 156 | $RowsPage = 10; 157 | 158 | $response = MarketplaceRequest::List($PageNumber,$RowsPage); 159 | 160 | echo (json_encode($response)); 161 | } 162 | 163 | public static function Get() 164 | { 165 | $Id = 4346; 166 | 167 | $response = MarketplaceRequest::Get($Id); 168 | 169 | echo (json_encode($response)); 170 | } 171 | } 172 | 173 | //MarketplaceTest::Get(); 174 | //MarketplaceTest::List(); 175 | //MarketplaceTest::Delete(); 176 | //MarketplaceTest::Add(); 177 | //MarketplaceTest::Update(); 178 | -------------------------------------------------------------------------------- /test/PaymentTest.php: -------------------------------------------------------------------------------- 1 | setAPIKEY('x-api-key'); 28 | 29 | /** 30 | * Class PaymentTest 31 | * 32 | * @package Safe2Pay\Test 33 | */ 34 | class PaymentTest 35 | { 36 | public static function GetPaymentMethods() 37 | { 38 | $response = PaymentRequest::GetPaymentMethods(); 39 | 40 | echo(json_encode($response)); 41 | } 42 | 43 | //Boleto bancário 44 | public static function BankSlip() 45 | { 46 | //Inicializar método de pagamento 47 | $payload = new Transaction(); 48 | //Ambiente de homologação 49 | $payload->setIsSandbox(false); 50 | //Descrição geral 51 | $payload->setApplication("Teste SDK PHP"); 52 | //Nome do vendedor 53 | $payload->setVendor("João da Silva"); 54 | //Url de callback 55 | $payload->setCallbackUrl("https://callbacks.exemplo.com.br/api/Notify"); 56 | 57 | //Código da forma de pagamento 58 | // 1 - Boleto bancário 59 | // 2 - Cartão de crédito 60 | // 3 - Criptomoeda 61 | // 4 - Cartão de débito 62 | // 6 - Pix 63 | $payload->setPaymentMethod("1"); 64 | 65 | //Informa o objeto de pagamento 66 | $BankSlip = new BankSlip(); 67 | //Data de vencimento 68 | $BankSlip->setDueDate("16/10/2021"); 69 | //Instrução 70 | $BankSlip->setInstruction("Instrução de Exemplo"); 71 | //Multa 72 | $BankSlip->setPenaltyRate(2.00); 73 | //Juros 74 | $BankSlip->setInterestRate(4.00); 75 | //Cancelar após o vencimento 76 | $BankSlip->setCancelAfterDue(false); 77 | //Pagamento parcial 78 | $BankSlip->setIsEnablePartialPayment(false); 79 | //desconto 80 | $BankSlip->setDiscountAmount(5); 81 | $BankSlip->setDiscountType(1); 82 | $BankSlip->setDiscountDue("16/10/2021"); 83 | 84 | //Mensagens 85 | $BankSlip->setMessage(array( 86 | "mensagem 1", 87 | "mensagem 2", 88 | "mensagem 3" 89 | )); 90 | 91 | //Objeto de pagamento para boleto bancário 92 | $payload->setPaymentObject($BankSlip); 93 | 94 | $Products = array(); 95 | 96 | for ($i = 0; $i < 10; $i++) { 97 | 98 | $payloadProduct = new Product(); 99 | $payloadProduct->setCode($i + 1); 100 | $payloadProduct->setDescription("Produto " . ($i + 1)); 101 | $payloadProduct->setUnitPrice(2.50); 102 | $payloadProduct->setQuantity(2); 103 | 104 | array_push($Products, $payloadProduct); 105 | }; 106 | 107 | $payload->setProducts($Products); 108 | 109 | $split1 = new Splits(); 110 | $split1->setIdReceiver(123); 111 | $split1->setName('Recebedor do split 1'); 112 | $split1->setCodeReceiverType('1'); 113 | $split1->setCodeTaxType('2'); 114 | $split1->setAmount(50.00); 115 | $split1->setIsPayTax(false); 116 | 117 | $split2 = new Splits(); 118 | $split2->setIdentity('99999999999'); 119 | $split2->setName('Recebedor do split 2'); 120 | $split2->setCodeReceiverType('2'); 121 | $split2->setCodeTaxType('1'); 122 | $split2->setAmount(100.00); 123 | $split2->setIsPayTax(true); 124 | 125 | $splits = array($split1, $split2); 126 | 127 | $payload->setSplits($splits); 128 | 129 | //Customer 130 | $Customer = new Customer(); 131 | $Customer->setName("Teste Cliente"); 132 | $Customer->setIdentity("01579286000174"); 133 | $Customer->setEmail("Teste@Teste.com.br"); 134 | $Customer->setPhone("51999999999"); 135 | 136 | $Customer->Address = new Address(); 137 | $Customer->Address->setZipCode("90620000"); 138 | $Customer->Address->setStreet("Avenida Princesa Isabel"); 139 | $Customer->Address->setNumber("828"); 140 | $Customer->Address->setComplement("Lado B"); 141 | $Customer->Address->setDistrict("Santana"); 142 | $Customer->Address->setStateInitials("RS"); 143 | $Customer->Address->setCityName("Porto Alegre"); 144 | $Customer->Address->setCountryName("Brasil"); 145 | 146 | 147 | $payload->setCustomer($Customer); 148 | 149 | $response = PaymentRequest::CreatePayment($payload); 150 | 151 | //echo(json_encode($response)); 152 | 153 | echo(json_encode($payload)); 154 | } 155 | 156 | //Cartão de crédito 157 | public static function CreditCard() 158 | { 159 | 160 | //Inicializar método de pagamento 161 | $payload = new Transaction(); 162 | //Ambiente de homologação 163 | $payload->setIsSandbox(true); 164 | //Descrição geral 165 | $payload->setApplication("Teste SDK PHP"); 166 | //Nome do vendedor 167 | $payload->setVendor("João da Silva"); 168 | //Url de callback 169 | $payload->setCallbackUrl("https://callbacks.exemplo.com.br/api/Notify"); 170 | 171 | //Código da forma de pagamento 172 | // 1 - Boleto bancário 173 | // 2 - Cartão de crédito 174 | // 3 - Criptomoeda 175 | // 4 - Cartão de débito 176 | // 6 - Pix 177 | $payload->setPaymentMethod("2"); 178 | 179 | //Inicialização do cartão de crédito (Holder, CardNumber, ExpirationDate, SecurityCode, InstallmentQuantity 180 | // , IsPreAuthorization, IsApplyInterest, InterestRate, SoftDescriptor) 181 | $CreditCard = new CreditCard("João da Silva", "4024007153763191", "12/2021", "241", 2, false, true, 2.32 182 | , "Teste"); 183 | 184 | //Objeto de pagamento - para boleto bancário 185 | $payload->setPaymentObject($CreditCard); 186 | 187 | $Products = array(); 188 | 189 | for ($i = 0; $i < 10; $i++) { 190 | 191 | $payloadProduct = new Product(); 192 | $payloadProduct->setCode($i + 1); 193 | $payloadProduct->setDescription("Produto " . ($i + 1)); 194 | $payloadProduct->setUnitPrice(2.50); 195 | $payloadProduct->setQuantity(2); 196 | 197 | array_push($Products, $payloadProduct); 198 | }; 199 | 200 | $payload->setProducts($Products); 201 | 202 | 203 | //Customer 204 | $Customer = new Customer(); 205 | $Customer->setName("Teste Cliente"); 206 | $Customer->setIdentity("01579286000174"); 207 | $Customer->setEmail("Teste@Teste.com.br"); 208 | $Customer->setPhone("51999999999"); 209 | 210 | $Customer->Address = new Address(); 211 | $Customer->Address->setZipCode("90620000"); 212 | $Customer->Address->setStreet("Avenida Princesa Isabel"); 213 | $Customer->Address->setNumber("828"); 214 | $Customer->Address->setComplement("Lado B"); 215 | $Customer->Address->setDistrict("Santana"); 216 | $Customer->Address->setStateInitials("RS"); 217 | $Customer->Address->setCityName("Porto Alegre"); 218 | $Customer->Address->setCountryName("Brasil"); 219 | 220 | 221 | $payload->setCustomer($Customer); 222 | 223 | $response = PaymentRequest::CreatePayment($payload); 224 | 225 | echo(json_encode($response)); 226 | } 227 | 228 | //Criptomoedas 229 | public static function CryptoCurrency() 230 | { 231 | 232 | //Inicializar método de pagamento 233 | $payload = new Transaction(); 234 | //Ambiente de homologação 235 | $payload->setIsSandbox(true); 236 | //Descrição geral 237 | $payload->setApplication("Teste SDK PHP"); 238 | //Nome do vendedor 239 | $payload->setVendor("João da Silva"); 240 | //Url de callback 241 | $payload->setCallbackUrl("https://callbacks.exemplo.com.br/api/Notify"); 242 | 243 | //Código da forma de pagamento 244 | // 1 - Boleto bancário 245 | // 2 - Cartão de crédito 246 | // 3 - Criptomoeda 247 | // 4 - Cartão de débito 248 | // 6 - Pix 249 | $payload->setPaymentMethod("3"); 250 | 251 | $CryptoCoin = new Cryptocoin("LTC"); 252 | 253 | //Objeto de pagamento - para Criptomoedas 254 | $payload->setPaymentObject($CryptoCoin); 255 | 256 | $Products = array(); 257 | 258 | for ($i = 0; $i < 10; $i++) { 259 | 260 | $payloadProduct = new Product(); 261 | $payloadProduct->setCode($i + 1); 262 | $payloadProduct->setDescription("Produto " . ($i + 1)); 263 | $payloadProduct->setUnitPrice(2.50); 264 | $payloadProduct->setQuantity(2); 265 | 266 | array_push($Products, $payloadProduct); 267 | }; 268 | 269 | $payload->setProducts($Products); 270 | 271 | //Customer 272 | $Customer = new Customer(); 273 | $Customer->setName("Teste Cliente"); 274 | $Customer->setIdentity("01579286000174"); 275 | $Customer->setEmail("Teste@Teste.com.br"); 276 | $Customer->setPhone("51999999999"); 277 | 278 | $Customer->Address = new Address(); 279 | $Customer->Address->setZipCode("90620000"); 280 | $Customer->Address->setStreet("Avenida Princesa Isabel"); 281 | $Customer->Address->setNumber("828"); 282 | $Customer->Address->setComplement("Lado B"); 283 | $Customer->Address->setDistrict("Santana"); 284 | $Customer->Address->setStateInitials("RS"); 285 | $Customer->Address->setCityName("Porto Alegre"); 286 | $Customer->Address->setCountryName("Brasil"); 287 | 288 | 289 | $payload->setCustomer($Customer); 290 | 291 | $response = PaymentRequest::CreatePayment($payload); 292 | 293 | echo(json_encode($response)); 294 | } 295 | 296 | //Cartão de débito 297 | public static function DebitCard() 298 | { 299 | //Inicializar método de pagamento 300 | $payload = new Transaction(); 301 | //Ambiente de homologação 302 | $payload->setIsSandbox(true); 303 | //Descrição geral 304 | $payload->setApplication("Teste SDK PHP"); 305 | //Nome do vendedor 306 | $payload->setVendor("João da Silva"); 307 | //Url de callback 308 | $payload->setCallbackUrl("https://callbacks.exemplo.com.br/api/Notify"); 309 | 310 | //Código da forma de pagamento 311 | // 1 - Boleto bancário 312 | // 2 - Cartão de crédito 313 | // 3 - Criptomoeda 314 | // 4 - Cartão de débito 315 | // 6 - Pix 316 | $payload->setPaymentMethod("4"); 317 | 318 | $DebitCard = new DebitCard("João da Silva", "4024007153763191", "12/2019", "241"); 319 | 320 | //Objeto de pagamento - para boleto bancário 321 | $payload->setPaymentObject($DebitCard); 322 | 323 | $Products = array(); 324 | 325 | for ($i = 0; $i < 10; $i++) { 326 | 327 | $payloadProduct = new Product(); 328 | $payloadProduct->setCode($i + 1); 329 | $payloadProduct->setDescription("Produto " . ($i + 1)); 330 | $payloadProduct->setUnitPrice(2.50); 331 | $payloadProduct->setQuantity(2); 332 | 333 | array_push($Products, $payloadProduct); 334 | }; 335 | 336 | $payload->setProducts($Products); 337 | 338 | //Customer 339 | $Customer = new Customer(); 340 | $Customer->setName("Teste Cliente"); 341 | $Customer->setIdentity("01579286000174"); 342 | $Customer->setEmail("Teste@Teste.com.br"); 343 | $Customer->setPhone("51999999999"); 344 | 345 | $Customer->Address = new Address(); 346 | $Customer->Address->setZipCode("90620000"); 347 | $Customer->Address->setStreet("Avenida Princesa Isabel"); 348 | $Customer->Address->setNumber("828"); 349 | $Customer->Address->setComplement("Lado B"); 350 | $Customer->Address->setDistrict("Santana"); 351 | $Customer->Address->setStateInitials("RS"); 352 | $Customer->Address->setCityName("Porto Alegre"); 353 | $Customer->Address->setCountryName("Brasil"); 354 | 355 | 356 | $payload->setCustomer($Customer); 357 | 358 | $response = PaymentRequest::CreatePayment($payload); 359 | 360 | echo(json_encode($response)); 361 | } 362 | 363 | //Pix 364 | public static function Pix() 365 | { 366 | 367 | //Inicializar método de pagamento 368 | $payload = new Transaction(); 369 | //Ambiente de homologação 370 | $payload->setIsSandbox(true); 371 | //Descrição geral 372 | $payload->setApplication("Teste SDK PHP"); 373 | //Nome do vendedor 374 | $payload->setVendor("João da Silva"); 375 | //Url de callback 376 | $payload->setCallbackUrl("https://callbacks.exemplo.com.br/api/Notify"); 377 | 378 | //Código da forma de pagamento 379 | // 1 - Boleto bancário 380 | // 2 - Cartão de crédito 381 | // 3 - Criptomoeda 382 | // 4 - Cartão de débito 383 | // 6 - Pix 384 | $payload->setPaymentMethod("6"); 385 | 386 | $Products = array(); 387 | 388 | for ($i = 0; $i < 10; $i++) { 389 | 390 | $payloadProduct = new Product(); 391 | $payloadProduct->setCode($i + 1); 392 | $payloadProduct->setDescription("Produto " . ($i + 1)); 393 | $payloadProduct->setUnitPrice(2.50); 394 | $payloadProduct->setQuantity(2); 395 | 396 | array_push($Products, $payloadProduct); 397 | }; 398 | 399 | $payload->setProducts($Products); 400 | 401 | $Pix = new Pix(86400); 402 | 403 | //Objeto de pagamento - para PIX 404 | $payload->setPaymentObject($Pix); 405 | 406 | //Customer 407 | $Customer = new Customer(); 408 | $Customer->setName("Teste Cliente"); 409 | $Customer->setIdentity("01579286000174"); 410 | $Customer->setEmail("Teste@Teste.com.br"); 411 | $Customer->setPhone("51999999999"); 412 | 413 | $Customer->Address = new Address(); 414 | $Customer->Address->setZipCode("90620000"); 415 | $Customer->Address->setStreet("Avenida Princesa Isabel"); 416 | $Customer->Address->setNumber("828"); 417 | $Customer->Address->setComplement("Lado B"); 418 | $Customer->Address->setDistrict("Santana"); 419 | $Customer->Address->setStateInitials("RS"); 420 | $Customer->Address->setCityName("Porto Alegre"); 421 | $Customer->Address->setCountryName("Brasil"); 422 | 423 | $payload->setCustomer($Customer); 424 | 425 | $response = PaymentRequest::CreatePayment($payload); 426 | 427 | echo(json_encode($response)); 428 | } 429 | 430 | public static function Refund() 431 | { 432 | $Id = 1093075; 433 | $type = RefundType::BANKSLIP; 434 | // $type = RefundType::BANKSLIP; 435 | // $type = RefundType::DEBIT; 436 | 437 | $response = PaymentRequest::Refund($Id, $type); 438 | 439 | echo(json_encode($response)); 440 | } 441 | 442 | //===========================================CARNET METHODS====================================================// 443 | 444 | public static function Carnet() 445 | { 446 | //Inicializar método de pagamento 447 | $payload = new Transaction(); 448 | //Ambiente de homologação 449 | $payload->setIsSandbox(true); 450 | //Descrição geral 451 | $payload->setApplication("Teste SDK PHP"); 452 | //Nome do vendedor 453 | $payload->setVendor("João da Silva"); 454 | //Url de callback 455 | $payload->setCallbackUrl("https://callbacks.exemplo.com.br/api/Notify"); 456 | 457 | //Código da forma de pagamento 458 | // 1 - Boleto bancário 459 | // 2 - Cartão de crédito 460 | // 3 - Criptomoeda 461 | // 4 - Cartão de débito 462 | // 10 - Débito em conta 463 | 464 | //Informa o objeto de pagamento 465 | $carnet = new Carnet(); 466 | $carnet->setMessage("Teste"); 467 | $carnet->setPenaltyAmount(10); 468 | $carnet->setInterestAmount(10); 469 | $carnet->setIsProcessed(false); 470 | $carnet->setIsAsync(false); 471 | $carnet->setIsEnablePartialPayment(false); 472 | $carnet->setPayableAfterDue(false); 473 | 474 | $bankslips = array(); 475 | 476 | for ($i = 0; $i < 3; $i++) { 477 | $carnetBankslip = new CarnetBankslip(); 478 | $carnetBankslip->setAmount(1.99); 479 | $carnetBankslip->setDueDate("2020-" . ($i + 1) . "-13"); 480 | $carnetBankslip->setInstruction("Instrução de Exemplo"); 481 | $carnetBankslip->setMessage = array( 482 | "mensagem 1", 483 | "mensagem 2", 484 | "mensagem 3", 485 | ); 486 | 487 | array_push($bankslips, $carnetBankslip); 488 | } 489 | 490 | $carnet->setBankSlips($bankslips); 491 | 492 | //Objeto de pagamento - para boleto bancário - 1 493 | $payload->setPaymentObject($carnet); 494 | 495 | $Products = array(); 496 | 497 | for ($i = 0; $i < 3; $i++) { 498 | 499 | $payloadProduct = new Product(); 500 | $payloadProduct->setCode($i + 1); 501 | $payloadProduct->setDescription("Produto " . ($i + 1)); 502 | $payloadProduct->setUnitPrice(2.50); 503 | $payloadProduct->setQuantity(2); 504 | 505 | array_push($Products, $payloadProduct); 506 | }; 507 | 508 | $payload->setProducts($Products); 509 | 510 | //Customer 511 | $Customer = new Customer(); 512 | $Customer->setName("Teste Cliente"); 513 | $Customer->setIdentity("01579286000174"); 514 | $Customer->setEmail("Teste@Teste.com.br"); 515 | $Customer->setPhone("51999999999"); 516 | 517 | $Customer->Address = new Address(); 518 | $Customer->Address->setZipCode("90620000"); 519 | $Customer->Address->setStreet("Avenida Princesa Isabel"); 520 | $Customer->Address->setNumber("828"); 521 | $Customer->Address->setComplement("Lado B"); 522 | $Customer->Address->setDistrict("Santana"); 523 | $Customer->Address->setStateInitials("RS"); 524 | $Customer->Address->setCityName("Porto Alegre"); 525 | $Customer->Address->setCountryName("Brasil"); 526 | 527 | 528 | $payload->setCustomer($Customer); 529 | 530 | $response = PaymentRequest::Carnet($payload); 531 | 532 | echo(json_encode($response)); 533 | } 534 | 535 | public static function CarnetLot() 536 | { 537 | 538 | $lote = new CarnetLot(); 539 | 540 | $lote->setCallbackUrl("https://callbacks.exemplo.com.br/api/Notify"); 541 | 542 | $transactions = array(); 543 | 544 | for ($x = 0; $x <= 10; $x++) { 545 | 546 | //Inicializar método de pagamento 547 | $payload = new Transaction(); 548 | //Ambiente de homologação 549 | $payload->setIsSandbox(true); 550 | //Descrição geral 551 | $payload->setApplication("Teste SDK PHP"); 552 | //Nome do vendedor 553 | $payload->setVendor("João da Silva"); 554 | //Url de callback 555 | $payload->setCallbackUrl("https://callbacks.exemplo.com.br/api/Notify"); 556 | 557 | //Código da forma de pagamento 558 | // 1 - Boleto bancário 559 | // 2 - Cartão de crédito 560 | // 3 - Criptomoeda 561 | // 4 - Cartão de débito 562 | // 10 - Débito em conta 563 | 564 | //Informa o objeto de pagamento 565 | $carnet = new Carnet(); 566 | $carnet->setMessage("Teste"); 567 | $carnet->setPenaltyAmount(10); 568 | $carnet->setInterestAmount(10); 569 | $carnet->setIsProcessed(false); 570 | $carnet->setIsAsync(false); 571 | $carnet->setIsEnablePartialPayment(false); 572 | $carnet->setPayableAfterDue(false); 573 | 574 | $bankslips = array(); 575 | 576 | for ($i = 0; $i < 3; $i++) { 577 | $carnetBankslip = new CarnetBankslip(); 578 | $carnetBankslip->setAmount(1.99); 579 | $carnetBankslip->setDueDate("2020-" . ($i + 1) . "-13"); 580 | $carnetBankslip->setInstruction("Instrução de Exemplo"); 581 | $carnetBankslip->setMessage = array( 582 | "mensagem 1", 583 | "mensagem 2", 584 | "mensagem 3", 585 | ); 586 | 587 | array_push($bankslips, $carnetBankslip); 588 | } 589 | 590 | $carnet->setBankSlips($bankslips); 591 | 592 | //Objeto de pagamento - para boleto bancário - 1 593 | $payload->setPaymentObject($carnet); 594 | 595 | $Products = array(); 596 | 597 | for ($i = 0; $i < 3; $i++) { 598 | 599 | $payloadProduct = new Product(); 600 | $payloadProduct->setCode($i + 1); 601 | $payloadProduct->setDescription("Produto " . ($i + 1)); 602 | $payloadProduct->setUnitPrice(2.50); 603 | $payloadProduct->setQuantity(2); 604 | 605 | array_push($Products, $payloadProduct); 606 | }; 607 | 608 | $payload->setProducts($Products); 609 | 610 | //Customer 611 | $Customer = new Customer(); 612 | $Customer->setName("Teste Cliente"); 613 | $Customer->setIdentity("01579286000174"); 614 | $Customer->setEmail("Teste@Teste.com.br"); 615 | $Customer->setPhone("51999999999"); 616 | 617 | $Customer->Address = new Address(); 618 | $Customer->Address->setZipCode("90620000"); 619 | $Customer->Address->setStreet("Avenida Princesa Isabel"); 620 | $Customer->Address->setNumber("828"); 621 | $Customer->Address->setComplement("Lado B"); 622 | $Customer->Address->setDistrict("Santana"); 623 | $Customer->Address->setStateInitials("RS"); 624 | $Customer->Address->setCityName("Porto Alegre"); 625 | $Customer->Address->setCountryName("Brasil"); 626 | $payload->setCustomer($Customer); 627 | 628 | array_push($transactions, $payload); 629 | } 630 | 631 | $lote->setItems($transactions); 632 | 633 | $response = PaymentRequest::CarnetLot($lote); 634 | 635 | echo(json_encode($response)); 636 | } 637 | 638 | public static function GetCarnet() 639 | { 640 | $Identifier = "b46b36865edf44e0acd240057d858745"; 641 | 642 | $response = PaymentRequest::GetCarnet($Identifier); 643 | 644 | echo(json_encode($response)); 645 | } 646 | 647 | public static function GetCarnetAsync() 648 | { 649 | $Identifier = "cddb9c4cde4446ae91ba6a8dd157853e"; 650 | 651 | $response = PaymentRequest::GetCarnetAsync($Identifier); 652 | 653 | echo(json_encode($response)); 654 | } 655 | 656 | public static function ResendCarnet() 657 | { 658 | $Identifier = "4b9d8c72e9474f53910af6a27bf7000b"; 659 | 660 | $response = PaymentRequest::ResendCarnet($Identifier); 661 | 662 | echo(json_encode($response)); 663 | } 664 | 665 | public static function CancelCarnet() 666 | { 667 | $Identifier = "4b9d8c72e9474f53910af6a27bf7000b"; 668 | 669 | $response = PaymentRequest::CancelCarnet($Identifier); 670 | 671 | echo(json_encode($response)); 672 | } 673 | 674 | public static function CancelCarnetLot() 675 | { 676 | $Identifier = "cddb9c4cde4446ae91ba6a8dd157853e"; 677 | 678 | $response = PaymentRequest::CancelCarnetLot($Identifier); 679 | 680 | echo(json_encode($response)); 681 | } 682 | } 683 | 684 | 685 | //PaymentTest::GetPaymentMethods(); 686 | //PaymentTest::BankSlip(); 687 | //PaymentTest::CreditCard(); 688 | //PaymentTest::CryptoCurrency(); 689 | //PaymentTest::DebitCard(); 690 | //PaymentTest::Refund(); 691 | //PaymentTest::Carnet(); 692 | //PaymentTest::CarnetLot(); 693 | //PaymentTest::GetCarnet(); 694 | //PaymentTest::GetCarnetAsync(); 695 | //PaymentTest::ResendCarnet(); 696 | //PaymentTest::CancelCarnet(); 697 | //PaymentTest::CancelCarnetLot(); 698 | //PaymentTest::Pix(); -------------------------------------------------------------------------------- /test/TokenizationTest.php: -------------------------------------------------------------------------------- 1 | setAPIKEY('x-api-key'); 15 | 16 | /** 17 | * Class TokenizationTest 18 | * 19 | * @package Safe2Pay\Test 20 | */ 21 | class TokenizationTest 22 | { 23 | 24 | public static function Create() 25 | { 26 | //Cria uma instância do objeto do cartão para realizar a tokenização 27 | $CreditCard = new CreditCard("João da Silva", "4444 3333 2222 1111", "12/2021", "241", null, false); 28 | //Realiza a tokenização e traz o retorno 29 | 30 | $response = TokenizationRequest::Create($CreditCard); 31 | 32 | echo (json_encode($response)); 33 | } 34 | public static function GetListToken(){ 35 | 36 | $pageNumber = 1; 37 | $rowsPerPage = 5; 38 | 39 | $response = TokenizationRequest::ListToken($pageNumber, $rowsPerPage); 40 | 41 | echo (json_encode($response)); 42 | } 43 | } 44 | 45 | //TokenizationTest::Create(); 46 | //TokenizationTest::GetListToken(); 47 | -------------------------------------------------------------------------------- /test/TransactionTests.php: -------------------------------------------------------------------------------- 1 | setAPIKEY('x-api-key'); 12 | 13 | /** 14 | * Class TransactionTest 15 | * 16 | * @package Safe2Pay\Test 17 | */ 18 | class TransactionTest 19 | { 20 | 21 | public static function Get() 22 | { 23 | $Id=8497120; 24 | 25 | $response =TransactionRequest::Get($Id); 26 | 27 | echo (json_encode($response)); 28 | 29 | } 30 | 31 | 32 | public static function GetByReference() 33 | { 34 | $reference='1059856'; 35 | 36 | $response = TransactionRequest::GetByRefeference($reference); 37 | 38 | echo (json_encode($response)); 39 | } 40 | 41 | //Listagem geral das transações 42 | public static function GetList() 43 | { 44 | //--------Obrigatórios:-------- 45 | $pageNumber = '1'; 46 | $rowsPerPage = '10'; 47 | $isSandbox = 'false'; 48 | 49 | // --------Opcionais-------- 50 | $createdDateInitial = '2021-06-01'; 51 | $createdDateEnd = '2021-06-02'; 52 | $paymentDateInitial = '2021-06-02'; 53 | $paymentDateEnd = '2021-06-02'; 54 | $Id = 0; 55 | $reference = 'Teste SDK PHP'; 56 | $customerName = 'Joao da Silva'; 57 | $customerIdentity = '12345678910'; 58 | $paymentMethodCode = '1'; 59 | $transactionStatusCode = '3'; 60 | 61 | $response = TransactionRequest::List($pageNumber, $rowsPerPage, $isSandbox, $createdDateInitial, $createdDateEnd, 62 | $paymentDateInitial, $paymentDateEnd, $Id, $reference, $customerName, 63 | $customerIdentity, $paymentMethodCode, $transactionStatusCode); 64 | 65 | //echo (json_encode($response)); 66 | } 67 | 68 | } 69 | 70 | //TransactionTest::Get(); 71 | //TransactionTest::GetByReference(); 72 | //TransactionTest::GetList(); 73 | ?> 74 | -------------------------------------------------------------------------------- /test/TransferenceTest.php: -------------------------------------------------------------------------------- 1 | setAPIKEY('x-api-key'); 19 | 20 | /** 21 | * Class TransferenceTest 22 | * 23 | * @package Safe2Pay\Test 24 | */ 25 | class TransferenceTest 26 | { 27 | public static function GetTransference() 28 | { 29 | $response = TransferenceRequest::GetTransference(478330); 30 | 31 | echo(json_encode($response)); 32 | } 33 | 34 | public static function GetListLot() 35 | { 36 | $PageNumber = 1; 37 | $RowsPerPage = 10; 38 | 39 | $response = TransferenceRequest::GetListLot($PageNumber, $RowsPerPage); 40 | 41 | echo(json_encode($response)); 42 | } 43 | 44 | public static function GetDetailLot() 45 | { 46 | $IdTransferRegisterLot = 1926; 47 | $PageNumber = 1; 48 | $RowsPerPage = 10; 49 | 50 | $response = TransferenceRequest::GetDetailLot($IdTransferRegisterLot, $PageNumber, $RowsPerPage); 51 | 52 | echo(json_encode($response)); 53 | } 54 | 55 | // 56 | public static function CreateTransference() 57 | { 58 | $bankData = new BankData(); 59 | $bankData->setBank(new Bank("041")); 60 | $bankData->setAccountType(new AccountType("CC")); 61 | $bankData->setBankAccount("1676"); 62 | $bankData->setBankAccountDigit("0"); 63 | $bankData->setBankAgency("41776"); 64 | $bankData->setBankAgencyDigit("7"); 65 | 66 | $transferRegisters = array ( 67 | new TransferRegister("teste", 50.00, "95916839014", "teste", "2021-10-21", "urldeexemplo.com.br", $bankData), 68 | new TransferRegister("teste2", 50.00, "95916839014", "teste2", "2021-10-21", "urldeexemplo.com.br4", $bankData) 69 | ); 70 | 71 | $payload = new Transfer(false, $transferRegisters); 72 | 73 | $response = TransferenceRequest::CreateTransference($payload); 74 | 75 | echo(json_encode($response)); 76 | } 77 | } 78 | //TransferenceTest::GetTransference(); 79 | //TransferenceTest::GetListLot(); 80 | //TransferenceTest::GetDetailLot(); 81 | //TransferenceTest::CreateTransference(); 82 | ?> --------------------------------------------------------------------------------