-
Notifications
You must be signed in to change notification settings - Fork 3
/
credits.php
40 lines (32 loc) · 1.12 KB
/
credits.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
include_once("includes/mysql_connect.php");
include_once("includes/shopify.php");
/**
* ===================================================
* CREATE THE VARIABLES:
* - $shopify
* - $parameters
* ===================================================
*/
$shopify = new Shopify();
$parameters = $_GET;
/**
* ===================================================
* CHECKING THE SHOPIFY STORE
* ===================================================
*/
include_once("includes/check_token.php");
$access_scopes = $shopify->rest_api('/admin/oauth/access_scopes.json', array(), 'GET');
$response = json_decode($access_scopes['body'], true);
$array = json_decode('
{
"application_credit": {
"description": "application credit for refund",
"amount": 5.0,
"test": true
}
}
', true);
$credit = $shopify->rest_api('/admin/api/2021-07/application_credits.json', $array, 'POST');
$credit = json_decode($credit['body'], true);
echo print_r($credit);