· 7 years ago · May 02, 2018, 03:24 PM
1oauth_token_secret=<Token>&oauth_token=<Token>&oauth_callback_confirmed=true
2
3https%3A%2F%2FMyWeb.com%2FMyController
4
5// HMAC-SHA1 encoding to get the tokens from quickbooks Api
6
7 $callback = urlencode('https://MyWeb.com/MyController'); // First urlencode of the callback url set on the grantUrl setup()
8
9
10 $action = 'GET'; // The Action to perform the request
11 $action .= '&'; // Append an &
12 $action .= urlencode('https://oauth.intuit.com/oauth/v1/get_request_token'); // Append the baseUrl request url encoded
13 $action .= '&'; // Append an &
14 $action .= urlencode('oauth_callback=' . $callback . '&oauth_consumer_key=<consumerKey>&oauth_nonce=<nonce>&oauth_signature_method=HMAC-SHA1&oauth_timestamp=<timestamp>&oauth_version=1.0'); // Append Parameters url encoded (callbak must be encoded twice)
15
16 $secretKey = urlencode('keyHere'); // Set the secretKey urlEncoded
17 $secretKey .= '&'; // Append an &
18
19 $resultant = base64_encode(hash_hmac('sha1', $action, $secretKey, TRUE)); // Get the hash_hmac with a base64_encode.
20
21 $f_result = urlencode($resultant); // url encode the $resultant to put it as the signature
22
23https://oauth.intuit.com/oauth/v1/get_request_token?oauth_callback=https%3A%2F%2FMyWeb.com%2FMyController&oauth_consumer_key=<ConsumerKey>&oauth_nonce=<nonce>&oauth_signature_method=HMAC-SHA1&oauth_timestamp=<timestamp>&oauth_version=1.0&oauth_signature=E0SagYvSY6wxpjp2QRIIP%2Bmz%2Fiw%3D
24
25<script
26 type="text/javascript"
27 src="https://appcenter.intuit.com/Content/IA/intuit.ipp.anywhere-1.3.3.js">
28</script>
29<!-- Implement the setup function for the connect button -->
30<script>
31intuit.ipp.anywhere.setup({
32 grantUrl: 'queryUrl post above',
33 datasources: {
34 quickbooks : true,
35 payments : true
36 },
37 paymentOptions:{
38 intuitReferred : true
39 }
40});
41</script>