my $stripe = Business::Stripe->new(-api_key => $psettings->{secretkey});
$stripe->api('post','payment_intents/' . $cc_args->{stripe_payment_intent});
if ($stripe->success) {
- $logger->info('Stripe payment intent retrieved');
+ $logger->info('STRIPE: Stripe payment intent retrieved');
my $intent = $stripe->success;
if ($intent->{status} eq 'succeeded') {
- $logger->info('Stripe payment succeeded');
+ $logger->info('STRIPE: Stripe payment succeeded');
return OpenILS::Event->new(
'SUCCESS', payload => {
invoice => $intent->{invoice},
}
);
} else {
- $logger->info('Stripe payment failed');
+ $logger->info('STRIPE: Stripe payment failed');
return OpenILS::Event->new(
'CREDIT_PROCESSOR_DECLINED_TRANSACTION',
payload => $intent->{last_payment_error}
);
}
} else {
- $logger->info('Stripe payment intent not retrieved');
- $logger->info('Stripe payment failed');
+ $logger->info('STRIPE: Stripe payment intent not retrieved');
+ $logger->info('STRIPE: Stripe payment failed');
return OpenILS::Event->new(
"CREDIT_PROCESSOR_DECLINED_TRANSACTION",
payload => $stripe->error # XXX what happens if this contains
&& $self->ctx->{get_org_setting}->($e->requestor->home_ou, 'credit.processor.default') eq 'Stripe') {
my $skey = $self->ctx->{get_org_setting}->($e->requestor->home_ou, 'credit.processor.stripe.secretkey');
my $currency = $self->ctx->{get_org_setting}->($e->requestor->home_ou, 'credit.processor.stripe.currency');
+ $logger->info("STRIPE: about to start Stripe with amount = $self->ctx->{fines}->{balance_owed} * 100 " . ($currency || 'usd') . " for user " . $self->ctx->{user}->id);
my $stripe = Business::Stripe->new(-api_key => $skey);
my $intent = $stripe->api('post', 'payment_intents',
amount => $self->ctx->{fines}->{balance_owed} * 100,
);
if ($stripe->success) {
$self->ctx->{stripe_client_secret} = $stripe->success()->{client_secret};
+ $logger->info("STRIPE: Success for user " . $self->ctx->{user}->id);
} else {
- $logger->error('Error initializing Stripe: ' . Dumper($stripe->error));
+ $logger->error('STRIPE: Error initializing Stripe: ' . Dumper($stripe->error));
$self->ctx->{cc_configuration_error} = 1;
}
}