Skip to content
Snippets Groups Projects
Verified Commit 3f1cf3e2 authored by Andrej Ramašeuski's avatar Andrej Ramašeuski
Browse files

Lepsi info o platbe

parent 407c0b3d
No related branches found
No related tags found
No related merge requests found
Pipeline #12458 passed
......@@ -2,7 +2,7 @@ image: docker:20.10.9
variables:
DOCKER_TLS_CERTDIR: "/certs"
IMAGE_VER: 0.17.0
IMAGE_VER: 0.18.0
services:
- docker:20.10.9-dind
......
......@@ -251,8 +251,28 @@ sub payment ($c ) {
}
return $c->error(404, 'NOT FOUND') if ! $order;
my $url = sprintf ('%s/organizers/%s/events/%s/orders/%s/',
$c->config->{pretix_api},
$c->config->{pretix_organizer},
$c->config->{pretix_event},
$order->order_id,
);
my $ua = Mojo::UserAgent->new;
my $rc = $ua->get( $url,
{ Authorization => 'Token ' . $c->config->{pretix_token} },
)->result;
my $order_pretix = $rc->json;
$order->update({ response => $order_pretix });
my $pr = $c->_payment_request($order);
if ( $order_pretix->{status} eq 'p' ) {
$pr->{payed} = $order_pretix->{payments}[0]{payment_date};
}
$c->render(
status => 200,
json => $pr,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment