Skip to content

Commit 4067fa0

Browse files
committed
Update methods to match updated API
1 parent 2e0c61a commit 4067fa0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

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)