Download the PHP package am2tec/payment-api-sdk without Composer

On this page you can find all versions of the php package am2tec/payment-api-sdk. 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 payment-api-sdk

Payment API SDK

PHP SDK para integração com a Payment API (am2tec/payment-api).

Instalação

Publicar configuração:

Configuração


Uso

Cobranças únicas

billing_type varia por provider. Use provider()->capabilities($provider) para descobrir o que cada gateway aceita:

  • PIX / BOLETO: Asaas, MercadoPago, Iugu, C6 Bank
  • CREDIT_CARD: Asaas, MercadoPago, Iugu, Stripe (cartão transparente via tokenization_js do gateway)
  • CARD: C6 Bank (checkout transparente — ver seção abaixo)

Cartão transparente (checkout transparente)

O cartão é criptografado no browser pelo SDK do gateway (PAN nunca chega ao servidor). Envie o hash/token em billing_type=CARD:

Para o checkout transparente do C6, busque a chave pública do SDK:

Cartões salvos (tokenizados)

Assinaturas recorrentes

Gateways de pagamento

Webhooks

Configure a rota no seu routes/web.php:

Crie o controller estendendo a base:

Validação manual (sem middleware):


Respostas

ChargeResponse

Campo Tipo Descrição
id string UUID da cobrança
status string pending | authorized | confirmed | failed
providerAlias ?string Conta do gateway (multi-conta)
checkoutUrl ?string Link de pagamento
pixCode ?string Copia-e-cola PIX
amountCents ?int Valor em centavos
cardTokenId ?string UUID do cartão salvo (se save_card=true)

CardTokenResponse

Campo Tipo Descrição
id string UUID do cartão salvo
provider string Gateway de origem
brand ?string Bandeira (VISA, ...)
last4 ?string Últimos 4 dígitos
expMonth / expYear ?string Validade
isDefault bool Cartão padrão
lastUsedAt ?string ISO8601

SubscriptionResponse

Campo Tipo Descrição
id string UUID da assinatura
status string pending | active | trial | paused | dunning | past_due | cancelled
providerSubscriptionId ?string ID externo no gateway
referenceId ?string Seu ID de referência
startedAt ?string ISO8601
cancelledAt ?string ISO8601
trialEndsAt ?string ISO8601 — fim do trial
pausedAt ?string ISO8601 — quando foi pausada
nextBillingDate ?string YYYY-MM-DD — próxima cobrança

ExtensionRequestResponse

Campo Tipo Descrição
id string UUID do pedido
status string pending — aguarda análise admin
message string Confirmação textual

Erro 422: já existe pedido pendente para esta assinatura. Aguarde aprovação ou negação antes de criar novo.


Fluxo de Trial


Tratamento de Erros

O SDK lança Illuminate\Http\Client\RequestException em respostas 4xx/5xx.


Testes


All versions of payment-api-sdk with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/http Version ^10.0|^11.0|^12.0|^13.0
illuminate/routing Version ^10.0|^11.0|^12.0|^13.0
illuminate/support Version ^10.0|^11.0|^12.0|^13.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 am2tec/payment-api-sdk contains the following files

Loading the files please wait ...