From 912f803a4abe9dfee6eae68e9343d57471f052b1 Mon Sep 17 00:00:00 2001 From: Johan Wassberg Date: Thu, 20 Aug 2020 15:51:02 +0200 Subject: [PATCH] MARVAL-1626942: Prepare for tooling get order --- SU/API/NexusCardOrdering.pm | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/SU/API/NexusCardOrdering.pm b/SU/API/NexusCardOrdering.pm index e0d830d..8afa77d 100644 --- a/SU/API/NexusCardOrdering.pm +++ b/SU/API/NexusCardOrdering.pm @@ -224,6 +224,25 @@ sub get_orderid return $orderId; } +sub get_order +{ + my ($self, $id) = @_; + + my $response = $self->do_request("GET", "order/$id"); + + my $code = $self->request_code; + if ($code == 404) + { + warn "No orders not found"; + return undef; + } + elsif ($code != 200) + { + die "unknown response code $code" + } + return $response; +} + sub set_lookback { my ($self, $date) = @_;