Permalink
Browse files

fix a bug with new member signup

  • Loading branch information...
1 parent a997b51 commit 60f5768be57264048e9874483d379384fd46d10a Luke Closs committed Jun 24, 2012
Showing with 7 additions and 2 deletions.
  1. +7 −2 bin/job-runner
View
@@ -9,6 +9,7 @@ use Biopay::Member;
use Biopay::Receipt;
use Biopay::EmailReceipt qw/parse_email/;
use Biopay::Transaction;
+use Biopay::PaymentProcessor;
use Biopay::Util qw/email_admin email_board host/;
use Try::Tiny;
@@ -112,11 +113,15 @@ sub register_member {
print " (Register: $email) ";
# Process sign-up fee
my $order_num = 'signup:' . $member->id;
- $daemon->processor->process(
+ my ($ok, $msg) = Biopay::PaymentProcessor->new->process(
order_num => $order_num,
amount => $signup_price,
hash => $member->payment_hash,
);
+ if (!$ok) {
+ die "Failed to process registration payment for " .
+ $member->id . ": $msg\n";
+ }
Biopay::Receipt->Create(
member_id => $member->id,
order_num => $order_num,
@@ -145,7 +150,7 @@ sub register_member {
"Hello Board, we just had a new member join the co-op: "
. $member->name . ".\n\n"
. "Details: " . host() . "/members/" . $member->id . "\n");
- };
+ }
catch {
my $err = "Failed to register new member: $_";
debug $err;

0 comments on commit 60f5768

Please sign in to comment.