Created
September 3, 2021 21:13
-
-
Save Chrisa0418/a4cbc03d659e111d9133965652736ceb to your computer and use it in GitHub Desktop.
Quickbooks API in React.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
class QuickBooks extends React.Component { | |
constructor(props){ | |
super(props); | |
window.intuit.ipp.anywhere.setup({ | |
grantUrl: 'http://www.mycompany.com/HelloWorld/RequestTokenServlet', | |
datasources: { | |
quickbooks : true, | |
payments : true | |
}, | |
paymentOptions:{ | |
intuitReferred : true | |
} | |
}) | |
} | |
callQuickBooks() { | |
return await require("@pipedreamhq/platform").axios(this, { | |
url: `https://quickbooks.api.intuit.com/v3/company/${auths.quickbooks.company_id}/companyinfo/${auths.quickbooks.company_id}`, | |
headers: { | |
Authorization: `Bearer ${auths.quickbooks.oauth_access_token}`, | |
"accept": `application/json`, | |
"content-type": `application/json`, | |
}, | |
}) | |
} | |
render(){ | |
return ( | |
<div @click="callQuickBooks"></div> | |
) | |
} | |
} | |
export default QuickBooks |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment