Skip to content

Commit 7f748a7

Browse files
authored
Merge pull request #8 from thepeerstack/update-payload
Update Request Body
2 parents 2e0c61a + 38679cd commit 7f748a7

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ let user = thepeer.indexUser("Thor Odin", "thor", "[email protected]");
3030
* processSendReceipt
3131
- `accepts`:
3232
- receipt_id (string)
33-
- insufficient_funds (bool)
33+
- event (string)
3434
- `returns`: object
3535

3636
* indexUser
@@ -65,7 +65,7 @@ let user = thepeer.indexUser("Thor Odin", "thor", "[email protected]");
6565
* authorizeDirectCharge
6666
- `accepts`:
6767
- reference (string)
68-
- insufficient_funds (bool)
68+
- event (string)
6969
- `returns`: object
7070

7171
## Extra

lib/Thepeer.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,14 +142,14 @@ class ThePeer {
142142
/**
143143
* Authorize direct charge request via webhooks
144144
* @param {*} reference - The direct charge reference sent via webhook
145-
* @param {boolean} insufficientFunds - Status of user funds
145+
* @param {string} event - Event type (success, insufficient_funds)
146146
* @returns {JSON} A JSON response containing the details of the user
147147
* @memberof ThePeer
148148
*/
149-
async authorizeDirectCharge (reference, insufficientFunds) {
149+
async authorizeDirectCharge (reference, event) {
150150
try {
151151
const response = await this.request.post(`/debit/${reference}`, {
152-
insufficient_funds: insufficientFunds
152+
event: event
153153
})
154154

155155
return response.data
@@ -161,13 +161,13 @@ class ThePeer {
161161
/**
162162
* @memberof ThePeer
163163
* @param {string} receipt - The reference returned to your receiptURL via the Chain SDK
164-
* @param {boolean} insufficientFunds - Status of user funds
164+
* @param {string} event - Event type (success, insufficient_funds)
165165
* @returns {JSON} A JSON response containing the details of the user
166166
*/
167-
async processSendReceipt (receipt, insufficientFunds) {
167+
async processSendReceipt (receipt, event) {
168168
try {
169169
const response = await this.request.post(`/send/${receipt}`, {
170-
insufficient_funds: insufficientFunds
170+
event: event
171171
})
172172

173173
return response.data

0 commit comments

Comments
 (0)