@@ -15,7 +15,7 @@ version 0.40
15
15
my $charge = $stripe->post_charge( # Net::Stripe::Charge
16
16
amount => 12500,
17
17
currency => 'usd',
18
- card => $card_token,
18
+ source => $card_token,
19
19
description => 'YAPC Registration',
20
20
);
21
21
print "Charge was not paid!\n" unless $charge->paid;
@@ -140,7 +140,7 @@ Returns a L<Net::Stripe::BalanceTransaction>.
140
140
141
141
Create a new charge.
142
142
143
- L<https://stripe.com/docs/api#create_charge>
143
+ L<https://stripe.com/docs/api/charges/create #create_charge>
144
144
145
145
=over
146
146
@@ -152,6 +152,8 @@ L<https://stripe.com/docs/api#create_charge>
152
152
153
153
=item * card - StripeTokenId or StripeCardId - card to use - optional
154
154
155
+ =item * source - StripeTokenId or StripeCardId - source to use - optional
156
+
155
157
=item * description - Str - description for the charge - optional
156
158
157
159
=item * metadata - HashRef - metadata for the charge - optional
@@ -250,7 +252,8 @@ Returns a L<Net::Stripe::Charge>.
250
252
251
253
Create or update a customer.
252
254
253
- L<https://stripe.com/docs/api#create_customer>
255
+ L<https://stripe.com/docs/api/customers/create#create_customer>
256
+ L<https://stripe.com/docs/api/customers/update#update_customer>
254
257
255
258
=over
256
259
@@ -260,8 +263,14 @@ L<https://stripe.com/docs/api#create_customer>
260
263
261
264
=item * card - L<Net::Stripe::Token> or StripeTokenId, default card for the customer, optional
262
265
266
+ =item * source - StripeTokenId or StripeSourceId, source for the customer, optional
267
+
263
268
=item * coupon - Str, optional
264
269
270
+ =item * default_card - L<Net::Stripe::Token>, L<Net::Stripe::Card>, Str or HashRef, default card for the customer, optional
271
+
272
+ =item * default_source - StripeCardId or StripeSourceId, default source for the customer, optional
273
+
265
274
=item * description - Str, optional
266
275
267
276
=item * email - Str, optional
@@ -279,7 +288,7 @@ L<https://stripe.com/docs/api#create_customer>
279
288
Returns a L<Net::Stripe::Customer> object.
280
289
281
290
my $customer = $stripe->post_customer(
282
- card => $token_id,
291
+ source => $token_id,
283
292
284
293
description => 'Test for Net::Stripe',
285
294
);
@@ -390,11 +399,13 @@ L<https://stripe.com/docs/api/cards/create#create_card>
390
399
391
400
=item * card - L<Net::Stripe::Token> or StripeTokenId
392
401
402
+ =item * source - StripeTokenId
403
+
393
404
=back
394
405
395
406
Returns a L<Net::Stripe::Card>.
396
407
397
- $stripe->post_card(customer => $customer, card => $card );
408
+ $stripe->post_card(customer => $customer, source => $token_id );
398
409
399
410
=head2 update_card
400
411
@@ -465,6 +476,171 @@ Returns a L<Net::Stripe::Card>.
465
476
466
477
$stripe->delete_card(customer => $customer, card => $card);
467
478
479
+ =head1 Source Methods
480
+
481
+ =head2 create_source
482
+
483
+ Create a new source object
484
+
485
+ L<https://stripe.com/docs/api/sources/create#create_source>
486
+
487
+ =over
488
+
489
+ =item * amount - Int - amount associated with the source
490
+
491
+ =item * currency - Str - currency associated with the source
492
+
493
+ =item * flow - StripeSourceFlow - authentication flow for the source
494
+
495
+ =item * mandate - HashRef - information about a mandate attached to the source
496
+
497
+ =item * metadata - HashRef - metadata for the source
498
+
499
+ =item * owner - HashRef - information about the owner of the payment instrument
500
+
501
+ =item * receiver - HashRef - parameters for the receiver flow
502
+
503
+ =item * redirect - HashRef - parameters required for the redirect flow
504
+
505
+ =item * source_order - HashRef - information about the items and shipping associated with the source
506
+
507
+ =item * statement_descriptor - Str - descriptor for statement
508
+
509
+ =item * token - StripeTokenId - token used to create the source
510
+
511
+ =item * type - StripeSourceType - type of source to create - required
512
+
513
+ =item * usage - StripeSourceUsage - whether the source should be reusable or not
514
+
515
+ =back
516
+
517
+ Returns a L<Net::Stripe::Source>
518
+
519
+ $stripe->create_source(
520
+ type => 'card',
521
+ token => $token_id,
522
+ );
523
+
524
+ =head2 get_source
525
+
526
+ Retrieve an existing source object
527
+
528
+ L<https://stripe.com/docs/api/sources/retrieve#retrieve_source>
529
+
530
+ =over
531
+
532
+ =item * source_id - StripeSourceId - id of source to retrieve - required
533
+
534
+ =item * client_secret - Str - client secret of the source
535
+
536
+ =back
537
+
538
+ Returns a L<Net::Stripe::Source>
539
+
540
+ $stripe->get_source(
541
+ source_id => $source_id,
542
+ );
543
+
544
+ =head2 update_source
545
+
546
+ Update the specified source by setting the values of the parameters passed
547
+
548
+ L<https://stripe.com/docs/api/sources/update#update_source>
549
+
550
+ =over
551
+
552
+ =item * source_id - StripeSourceId - id of source to update - required
553
+
554
+ =item * amount - Int - amount associated with the source
555
+
556
+ =item * metadata - HashRef - metadata for the source
557
+
558
+ =item * mandate - HashRef - information about a mandate attached to the source
559
+
560
+ =item * owner - HashRef - information about the owner of the payment instrument
561
+
562
+ =item * source_order - HashRef - information about the items and shipping associated with the source
563
+
564
+ =back
565
+
566
+ Returns a L<Net::Stripe::Source>
567
+
568
+ $stripe->update_source(
569
+ source_id => $source_id,
570
+ owner => {
571
+ email => $new_email,
572
+ phone => $new_phone,
573
+ },
574
+ );
575
+
576
+ =head2 attach_source
577
+
578
+ Attaches a Source object to a Customer
579
+
580
+ L<https://stripe.com/docs/api/sources/attach#attach_source>
581
+
582
+ =over
583
+
584
+ =item * source_id - StripeSourceId - id of source to be attached - required
585
+
586
+ =item * customer_id - StripeCustomerId - id of customer to which source should be attached - required
587
+
588
+ =back
589
+
590
+ Returns a L<Net::Stripe::Source>
591
+
592
+ $stripe->attach_source(
593
+ customer_id => $customer_id,
594
+ source_id => $source->id,
595
+ );
596
+
597
+ =head2 detach_source
598
+
599
+ Detaches a Source object from a Customer
600
+
601
+ L<https://stripe.com/docs/api/sources/detach#detach_source>
602
+
603
+ =over
604
+
605
+ =item * source_id - StripeSourceId - id of source to be detached - required
606
+
607
+ =item * customer_id - StripeCustomerId - id of customer from which source should be detached - required
608
+
609
+ =back
610
+
611
+ Returns a L<Net::Stripe::Source>
612
+
613
+ $stripe->detach_source(
614
+ customer_id => $customer_id,
615
+ source_id => $source->id,
616
+ );
617
+
618
+ =head2 list_sources
619
+
620
+ List all sources belonging to a Customer
621
+
622
+ =over
623
+
624
+ =item * customer_id - StripeCustomerId - id of customer for which source to list sources - required
625
+
626
+ =item * object - Str - object type - required
627
+
628
+ =item * ending_before - Str - ending before condition
629
+
630
+ =item * limit - Int - maximum number of charges to return
631
+
632
+ =item * starting_after - Str - starting after condition
633
+
634
+ =back
635
+
636
+ Returns a L<Net::Stripe::List> object containing objects of the requested type
637
+
638
+ $stripe->list_sources(
639
+ customer_id => $customer_id,
640
+ object => 'card',
641
+ limit => 10,
642
+ );
643
+
468
644
=head1 Subscription Methods
469
645
470
646
=head2 post_subscription
0 commit comments