Download the PHP package klebervmv/bs2pay without Composer

On this page you can find all versions of the php package klebervmv/bs2pay. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package bs2pay

SDK PHP - BS2 Pay ADIQ E-commerce

SDK PHP completo e pronto para produção da adquirente BS2 Pay ADIQ, construído sobre a biblioteca HTTP easyCurl.


Instalação

Dependências:


Configuração rápida

Ambientes

Ambiente URL
sandbox https://ecommerce-sandbox.adiq.io
homologation https://ecommerce-hml.adiq.io
production https://ecommerce.adiq.io

Uso

1. Tokenizar cartão (uso único, ~10 min)

2. Criar pagamento (autoriza + captura)

3. Capturar pagamento autorizado (late capture)

4. Cancelar / refund

5. Consultar pagamento

6. Vault (one-click / recorrência)

7. Zero Auth (validar cartão sem cobrar)

8. Consulta BIN

9. 3DS 2.0 integrado

10. Webhook


Tratamento de erros

Todas as exceptions herdam de Adiq\Exceptions\AdiqException:

Exception Quando ocorre
ValidationException Validação local OU HTTP 400
AuthException HTTP 401 / 403, falha de OAuth
NotFoundException HTTP 404
RateLimitException HTTP 429 (com getRetryAfter())
PaymentException Recusa de bandeira (com getReturnCode(), MAC, etc)
NetworkException Timeout, DNS, conexão recusada, 5xx persistente

Política de retry — leia antes

O SDK não faz retry automático. Essa é uma decisão deliberada de segurança.

Em pagamentos, um POST /v1/payments que falha com timeout ou 5xx pode ter sido processado com sucesso pelo servidor — apenas a resposta se perdeu. Retentar automaticamente nesse caso pode debitar o cartão do cliente duas vezes.

Como lidar com falhas incertas

  1. Use orderNumber único e determinístico por pedido (em sellerInfo.orderNumber).
  2. Em caso de NetworkException em payments->create(), não retente cegamente. Antes, consulte:

Quando retentar é seguro (decisão do caller)

Operação Seguro retentar?
GET (consultas) ✅ Sempre — idempotente
DELETE vault ✅ — idempotente
POST /v1/tokens/cards ⚠️ Baixo risco — não cobra
POST /v1/payments ❌ Apenas após verificar via getByOrderNumber
PUT capture/cancel ❌ "Já capturado" pode ser falso-OK

RateLimitException (HTTP 429) expõe getRetryAfter() — você pode aguardar e reenviar manualmente.


Logging

Por padrão, o SDK loga em JSON em STDERR com mascaramento automático de campos sensíveis (cardNumber, securityCode, numberToken, clientSecret, authorization, etc).

Para usar logger customizado:


Estrutura

Executando os testes

O tests/3ds-challenge.html é uma página auxiliar — abra direto no browser (via Laragon ou servidor PHP embutido) para concluir manualmente o passo de challenge do fluxo 3DS 2.0.


Boas práticas


Próximos passos


Licença

MIT — veja LICENSE.


All versions of bs2pay with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
ext-json Version *
ext-curl Version *
klebervmv/easycurl Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package klebervmv/bs2pay contains the following files

Loading the files please wait ...