forked from cafeasp/shopifytutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCreateCharged
More file actions
16 lines (12 loc) · 696 Bytes
/
CreateCharged
File metadata and controls
16 lines (12 loc) · 696 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
public IRestResponse CreateCharged(string token, string shop, Recurring recurring)
{
var client = new RestClient("https://" + shop + "/admin/");
var request = new RestRequest("recurring_application_charges.json", Method.POST);
request.RequestFormat = DataFormat.Json;
request.AddHeader("X-Shopify-Access-Token", token);
string json = JsonConvert.SerializeObject(recurring, Formatting.Indented);
request.AddParameter("application/json", json, ParameterType.RequestBody);
// execute the request
var result = client.Execute(request);
return result;
}