January 2020
Intermediate to advanced
530 pages
11h 11m
English
The setTransactions() method fetches the customer's transactions by calling the /gettrans endpoint in the backend server.
It sends the customer's account in the request body, and all transactions to or from the customer account are returned in the response object, as follows:
setTransactions(){let app = this; var url = 'http://'+ this.state.server +'/gettrans'; fetch(url, { method: 'POST', headers: { 'Accept': 'application/json', 'Content-Type': 'application/json', },body: JSON.stringify({ account : app.state.account }) })
Read now
Unlock full access