Skip to content
This repository has been archived by the owner on Sep 15, 2023. It is now read-only.

Commit

Permalink
Capture e eventos (#91)
Browse files Browse the repository at this point in the history
* adiciona flag capture nos inputs do cartão de crédito

* adiciona exemplos de eventos de transação.

Co-authored-by: PedroRegisPOAR <pedroalencarregis@hotmail.com>
  • Loading branch information
rodrigondec and PedroRegisPOAR authored Jul 15, 2020
1 parent d384e69 commit 694d494
Show file tree
Hide file tree
Showing 16 changed files with 562 additions and 105 deletions.
28 changes: 28 additions & 0 deletions docs/eventos/transacao.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Eventos de Transação
========================================

No mundo de transações, existem alguns eventos. Dentro deles temos por exemplo::

- success
- failed
- canceled
- reversed
- charged_back
- pre_authorized
- captured
- voided


Charge Back
***********************************
Processo no qual o gateway de pagamento cobra a um vendedor o valor da compra pago pelo comprador.
Retornando o dinheiro ao comprador.

Void
***********************************
Estorno de transação.

Reverse
***********************************
A transação foi revertida. Isso acontece devido à alguma falha técnica em algum momento do fluxo.
Com isso todo o fluxo feito é revertido.
27 changes: 27 additions & 0 deletions docs/eventos/transacao_cartao.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Transação de Cartão de crédito
========================================

No mundo de transações de cartão de crédito, existem alguns eventos. Dentro deles temos por exemplo::


- pre autorização
- captura


Pré autorização
***********************************
A pré autorização realiza o bloqueio do valor no cartão de crédito do comprador.

.. important::
Mas isso não realiza o pagamento, vulgo débito do valor!


Captura
***********************************
A captura realiza o pagamento propriamente dito do valor passado!

.. important::
O valor passado pode ser menor ou igual ao valor pré autorizado. Nesse cenário a diferença é desbloqueada automaticamente para o comprador.

.. warning::
Se o valor desejado a ser capturado for maior do que o valor pré autorizado, a transação deverá ser estornada e feita novamente.
8 changes: 8 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ Documentação do zoop-wrapper
instrucoes/input
instrucoes/*

.. toctree::
:caption: Eventos
:maxdepth: 2
:numbered:
:glob:

eventos/*

.. toctree::
:caption: Exemplos
:maxdepth: 2
Expand Down
28 changes: 14 additions & 14 deletions examples/data/add_transaction_card_not_present.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"id": "b8d82a6296b346f58fa02bd47b14c095",
"id": "d4ec5e8310cc433486f416ba44522d4d",
"resource": "transaction",
"status": "succeeded",
"amount": "5.00",
Expand All @@ -14,7 +14,7 @@
"rewards": null,
"discounts": null,
"pre_authorization": null,
"sales_receipt": "2450c0ac030343619926e27db9cdb7b1",
"sales_receipt": "24467ddf6521444c9265a039d888b0b2",
"on_behalf_of": "25037b2978b14e7fa5b902d9322e8426",
"customer": "0b05a360f4b749498f74e13004c08024",
"statement_descriptor": "LOJA DO JOAO",
Expand Down Expand Up @@ -45,7 +45,7 @@
"updated_at": "2020-06-08T20:52:00+00:00"
},
"source": {
"id": "f3d7c119a4784893a211042caf68421c",
"id": "ae8b9207b3544ad39a5dc4d293a62a8c",
"status": "used",
"usage": "single_use",
"amount": "5.00",
Expand Down Expand Up @@ -102,20 +102,20 @@
],
"location_latitude": null,
"location_longitude": null,
"uri": "/v1/marketplaces/foo/transactions/b8d82a6296b346f58fa02bd47b14c095",
"uri": "/v1/marketplaces/foo/transactions/d4ec5e8310cc433486f416ba44522d4d",
"metadata": {},
"expected_on": "2020-07-10T00:00:00+00:00",
"created_at": "2020-06-10T17:11:07+00:00",
"updated_at": "2020-06-10T17:11:09+00:00",
"expected_on": "2020-08-13T00:00:00+00:00",
"created_at": "2020-07-14T20:38:55+00:00",
"updated_at": "2020-07-14T20:38:57+00:00",
"payment_authorization": {
"authorizer_id": "000260004",
"authorization_code": "133937",
"authorization_nsu": "20180510122911535"
},
"history": [
{
"id": "670a7fb321064c219af924e50462bf4f",
"transaction": "b8d82a6296b346f58fa02bd47b14c095",
"id": "9e2edfe497964c149f0a58f9e2d4e67a",
"transaction": "d4ec5e8310cc433486f416ba44522d4d",
"amount": "5.00",
"operation_type": "created",
"status": "succeeded",
Expand All @@ -126,11 +126,11 @@
"authorization_nsu": null,
"gatewayResponseTime": null,
"authorizer": null,
"created_at": "2020-06-10 17:11:07"
"created_at": "2020-07-14 20:38:55"
},
{
"id": "054c08ff3c4b4e7cb4de7206286ed2e8",
"transaction": "b8d82a6296b346f58fa02bd47b14c095",
"id": "6678b4b54a344609aeb71cc8f1ab0a69",
"transaction": "d4ec5e8310cc433486f416ba44522d4d",
"amount": "5.00",
"operation_type": "authorization",
"status": "succeeded",
Expand All @@ -139,9 +139,9 @@
"authorization_code": "133937",
"authorizer_id": "000260004",
"authorization_nsu": "20180510122911535",
"gatewayResponseTime": "2207",
"gatewayResponseTime": "2204",
"authorizer": "cielo",
"created_at": "2020-06-10 17:11:09"
"created_at": "2020-07-14 20:38:57"
}
]
}
56 changes: 28 additions & 28 deletions examples/data/add_transaction_card_present.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"id": "8eec76a8aafa468296806d19f412edbd",
"id": "baf49b89431c439d8eaf7f753315a532",
"resource": "transaction",
"status": "succeeded",
"amount": "12.34",
Expand All @@ -14,38 +14,38 @@
"rewards": null,
"discounts": null,
"pre_authorization": null,
"sales_receipt": "0a45412a0f114669b4819e859d07386c",
"sales_receipt": "088214337e4e4b9c9efbbfb530fa8f8d",
"on_behalf_of": "25037b2978b14e7fa5b902d9322e8426",
"customer": null,
"statement_descriptor": "DENISE SMITH",
"statement_descriptor": "JOHN THOMAS",
"payment_method": {
"id": "e11e077ba3cd47ab98f44e0cc78649ef",
"id": "840cbd335e0f46b090a1835fda8f8697",
"resource": "card",
"description": null,
"card_brand": "MasterCard",
"first4_digits": "2295",
"last4_digits": "2924",
"first4_digits": "2131",
"last4_digits": "9184",
"expiration_month": "5",
"expiration_year": "2030",
"holder_name": "foo",
"is_active": false,
"is_valid": true,
"is_verified": false,
"customer": null,
"fingerprint": "a6091c1cd50e0911400ea18c6a4471e1b038fc896db6356e0a35eb9fe8561089",
"fingerprint": "2d46e6a03ee8dbb42c306a9c19ac18b0ccb61bd123ed4ba78eb4467ea1bcebea",
"address": null,
"verification_checklist": {
"postal_code_check": "unchecked",
"security_code_check": "unchecked",
"address_line1_check": "unchecked"
},
"metadata": {},
"uri": "/v1/marketplaces/foo/transactions/e11e077ba3cd47ab98f44e0cc78649ef",
"created_at": "2020-06-10T22:51:19+00:00",
"updated_at": "2020-06-10T22:51:20+00:00"
"uri": "/v1/marketplaces/foo/transactions/840cbd335e0f46b090a1835fda8f8697",
"created_at": "2020-07-14T20:39:04+00:00",
"updated_at": "2020-07-14T20:39:07+00:00"
},
"source": {
"id": "0666ec792ae048f59eaed2f7813dd421",
"id": "6707f1129e8a43f898408db40ee12417",
"status": "used",
"usage": "single_use",
"amount": "12.34",
Expand All @@ -54,30 +54,30 @@
"statement_descriptor": null,
"type": "card",
"card": {
"id": "e11e077ba3cd47ab98f44e0cc78649ef",
"id": "840cbd335e0f46b090a1835fda8f8697",
"resource": "card",
"description": null,
"card_brand": "MasterCard",
"first4_digits": "2295",
"last4_digits": "2924",
"first4_digits": "2131",
"last4_digits": "9184",
"expiration_month": "5",
"expiration_year": "2030",
"holder_name": "foo",
"is_active": false,
"is_valid": true,
"is_verified": false,
"customer": null,
"fingerprint": "a6091c1cd50e0911400ea18c6a4471e1b038fc896db6356e0a35eb9fe8561089",
"fingerprint": "2d46e6a03ee8dbb42c306a9c19ac18b0ccb61bd123ed4ba78eb4467ea1bcebea",
"address": null,
"verification_checklist": {
"postal_code_check": "unchecked",
"security_code_check": "unchecked",
"address_line1_check": "unchecked"
},
"metadata": {},
"uri": "/v1/marketplaces/foo/transactions/e11e077ba3cd47ab98f44e0cc78649ef",
"created_at": "2020-06-10T22:51:19+00:00",
"updated_at": "2020-06-10T22:51:20+00:00",
"uri": "/v1/marketplaces/foo/transactions/840cbd335e0f46b090a1835fda8f8697",
"created_at": "2020-07-14T20:39:04+00:00",
"updated_at": "2020-07-14T20:39:07+00:00",
"amount": "12.34"
}
},
Expand All @@ -102,20 +102,20 @@
],
"location_latitude": null,
"location_longitude": null,
"uri": "/v1/marketplaces/foo/transactions/8eec76a8aafa468296806d19f412edbd",
"uri": "/v1/marketplaces/foo/transactions/baf49b89431c439d8eaf7f753315a532",
"metadata": {},
"expected_on": "2020-07-10T00:00:00+00:00",
"created_at": "2020-06-10T22:51:19+00:00",
"updated_at": "2020-06-10T22:51:22+00:00",
"expected_on": "2020-08-13T00:00:00+00:00",
"created_at": "2020-07-14T20:39:04+00:00",
"updated_at": "2020-07-14T20:39:09+00:00",
"payment_authorization": {
"authorizer_id": "000260004",
"authorization_code": "133937",
"authorization_nsu": "20180510122911535"
},
"history": [
{
"id": "ce441c8b17cb41818f42eaa0d6a3ec62",
"transaction": "8eec76a8aafa468296806d19f412edbd",
"id": "ffe03817e7be4b7a90274b1889a5ab03",
"transaction": "baf49b89431c439d8eaf7f753315a532",
"amount": "12.34",
"operation_type": "created",
"status": "succeeded",
Expand All @@ -126,11 +126,11 @@
"authorization_nsu": null,
"gatewayResponseTime": null,
"authorizer": null,
"created_at": "2020-06-10 22:51:20"
"created_at": "2020-07-14 20:39:07"
},
{
"id": "b604f7f7026b415893a7c16d925b4a76",
"transaction": "8eec76a8aafa468296806d19f412edbd",
"id": "4f181e89817e47ceab8e4157494cf5f8",
"transaction": "baf49b89431c439d8eaf7f753315a532",
"amount": "12.34",
"operation_type": "authorization",
"status": "succeeded",
Expand All @@ -141,7 +141,7 @@
"authorization_nsu": "20180510122911535",
"gatewayResponseTime": "2205",
"authorizer": "cielo",
"created_at": "2020-06-10 22:51:22"
"created_at": "2020-07-14 20:39:09"
}
]
}
Loading

0 comments on commit 694d494

Please sign in to comment.