Skip to content

Commit 423fbd9

Browse files
authored
Merge pull request #201 from sherrardb/fix-get-invoiceitems
get_invoiceitems() not passing customer id
2 parents fc95fe5 + 5d82542 commit 423fbd9

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

lib/Net/Stripe.pm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3202,6 +3202,7 @@ InvoiceItems: {
32023202
}
32033203
my %args = (
32043204
path => 'invoiceitems',
3205+
customer => $customer,
32053206
created => $created,
32063207
ending_before => $ending_before,
32073208
limit => $limit,

t/live.t

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2528,9 +2528,20 @@ Invoices_and_items: {
25282528
is $newitem->currency, $item->currency, 'item currency unchanged';
25292529
is $newitem->description, $item->description, 'item desc changed';
25302530

2531+
# create an additional customer and invoiceitem
2532+
my $other_customer = $stripe->post_customer(
2533+
card => $token_id_visa,
2534+
plan => $plan->id,
2535+
);
2536+
$stripe->create_invoiceitem(
2537+
customer => $other_customer->id,
2538+
amount => 700,
2539+
currency => 'usd',
2540+
description => 'Pickles',
2541+
);
2542+
25312543
my $items = $stripe->get_invoiceitems(
25322544
customer => $customer->id,
2533-
limit => 1,
25342545
);
25352546
is scalar(@{$items->data}), 1, 'only 1 item returned';
25362547
is $items->get(0)->id, $item->id, 'item id is correct';

0 commit comments

Comments
 (0)