| Line 22... |
Line 22... |
| 22 |
print "Adding $classid to $accountid...";
|
22 |
print "Adding $classid to $accountid...";
|
| 23 |
my $client = REST::Client->new();
|
23 |
my $client = REST::Client->new();
|
| 24 |
$client->setHost('https://core.wrstbnd.io');
|
24 |
$client->setHost('https://core.wrstbnd.io');
|
| Line 25... |
Line 25... |
| 25 |
|
25 |
|
| 26 |
my $body = {
|
26 |
my $body = {
|
| 27 |
"eventId" => "event_893C6u5olU",
|
27 |
"eventId" => getSetting ("WRSTBND_EVENT_ID"),
|
| 28 |
"activeStatus" => "active",
|
28 |
"activeStatus" => "active",
|
| 29 |
"ticketTypeId" => $classid
|
29 |
"ticketTypeId" => $classid
|
| 30 |
};
|
30 |
};
|
| Line 40... |
Line 40... |
| 40 |
#print Dumper $response;
|
40 |
#print Dumper $response;
|
| 41 |
my $activationCode = $response->{activationCode};
|
41 |
my $activationCode = $response->{activationCode};
|
| 42 |
print $activationCode."...";
|
42 |
print $activationCode."...";
|
| 43 |
my $api_key = getSetting ("WRSTBND_API_KEY");
|
43 |
my $api_key = getSetting ("WRSTBND_API_KEY");
|
| 44 |
my $add_response = `/bin/curl --location 'https://core.wrstbnd.io/rest/core/v1/assign' --header 'Authorization: $api_key' --form accountid=$accountid --form ticketactcode=$activationCode --output /dev/null --silent --write-out '%{http_code}\n'`;
|
44 |
my $add_response = `/bin/curl --location 'https://core.wrstbnd.io/rest/core/v1/assign' --header 'Authorization: $api_key' --form accountid=$accountid --form ticketactcode=$activationCode --output /dev/null --silent --write-out '%{http_code}\n'`;
|
| 45 |
print $add_response;
|
45 |
print $add_response; chomp $add_response;
|
| 46 |
$assignment->execute ($activationCode, $id, $rcid, 'CLA-%') unless $add_response ne "200";
|
46 |
$assignment->execute ($activationCode, $id, $rcid, 'CLA-%') unless $add_response ne "200";
|
| 47 |
}
|
47 |
}
|
| Line 48... |
Line 48... |
| 48 |
|
48 |
|
| 49 |
|
49 |
|