Skip to content

Commit fb2f5d5

Browse files
committed
Standardizes endpoint's responses
1 parent 975930f commit fb2f5d5

File tree

7 files changed

+28
-29
lines changed

7 files changed

+28
-29
lines changed

docs/all-in-one.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ Response:
9191

9292
```js
9393
{ "code": 200,
94-
"charge": {
95-
"id": 260,
94+
"data": {
95+
"charge_id": 260,
9696
"total": 2250,
9797
"status": 'new',
9898
"custom_id": null,
@@ -103,8 +103,8 @@ Response:
103103
{ "code": 200 } //customer created
104104

105105
{ "code": 200,
106-
"response": {
107-
"transaction": 143,
106+
"data": {
107+
"charge_id": 260,
108108
"total": 2400,
109109
"payment": "credit_card",
110110
"installments": 1,
@@ -113,7 +113,6 @@ Response:
113113
} //payment created
114114
```
115115

116-
117116
If we embbed the `customerInput` inside `chargeInput`, we can skip the second step and go straight to payment:
118117

119118
```js
@@ -144,8 +143,8 @@ Response:
144143

145144
```js
146145
{ "code": 200,
147-
"charge": {
148-
"id": 260,
146+
"data": {
147+
"charge_id": 260,
149148
"total": 2250,
150149
"status": 'new',
151150
"custom_id": null,
@@ -154,8 +153,8 @@ Response:
154153
} //charge created
155154

156155
{ "code": 200,
157-
"response": {
158-
"transaction": 143,
156+
"data": {
157+
"charge_id": 260,
159158
"total": 2400,
160159
"payment": "credit_card",
161160
"installments": 1,

docs/charge-with-customer.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ Check out the response:
4545
```js
4646
{
4747
"code": 200,
48-
"charge": {
49-
"id": 253,
48+
"data": {
49+
"charge_id": 253,
5050
"total": 2000,
5151
"status": "new",
5252
"custom_id": null,

docs/charge-with-marketplace.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ The response is the sames as usual:
5353
```js
5454
{
5555
"code": 200,
56-
"charge": {
57-
"id": 254,
56+
"data": {
57+
"charge_id": 254,
5858
"total": 10000,
5959
"status": "new",
6060
"custom_id": null,

docs/charge-with-shippings.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ Check out the response:
4343
```js
4444
{
4545
"code": 200,
46-
"charge": {
47-
"id": 252,
46+
"data": {
47+
"charge_id": 252,
4848
"total": 2220,
4949
"status": "new",
5050
"custom_id": null,

docs/detailing.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ Check out the response:
2626
```js
2727
{
2828
"code": 200,
29-
"charge": {
30-
"id": 233,
29+
"data": {
30+
"charge_id": 233,
3131
"subscription_id": 12,
3232
"total": 2000,
3333
"status": "new",
@@ -71,8 +71,8 @@ gerencianet
7171
```js
7272
{
7373
"code": 200,
74-
"subscription": {
75-
"id": 12,
74+
"data": {
75+
"subscription_id": 12,
7676
"value": 2000,
7777
"status": "new",
7878
"payment_method": null,

docs/notifications.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ Response:
5757
```js
5858
{
5959
"code": 200,
60-
"charge": {
61-
"id": 233,
60+
"data": {
61+
"charge_id": 233,
6262
"subscription_id": 12,
6363
"total": 2000,
6464
"status": "new",

docs/payments.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ You'll receive the payment info in the callback, such as the barcode and the bil
5050
```js
5151
{
5252
"code": 200,
53-
"response": {
54-
"transaction": 137,
53+
"data": {
54+
"charge_id": 242,
5555
"total": 1150,
5656
"payment": "banking_billet",
5757
"barcode": "00190.00009 01523.894002 00059.161182 9 64350000001150",
@@ -100,12 +100,12 @@ If everything went well, the response will come with the total value, installmen
100100
```js
101101
{
102102
"code": 200,
103-
"response": {
104-
"transaction": 139,
105-
"total": 1150,
106-
"payment": "credit_card",
107-
"installments": 1,
108-
"installment_value": 1150
103+
"data": {
104+
"charge_id": 223,
105+
"total": 1150,
106+
"payment": "credit_card",
107+
"installments": 1,
108+
"installment_value": 1150
109109
}
110110
}
111111
```

0 commit comments

Comments
 (0)