@@ -561,6 +561,76 @@ func TestClient_ListCheckouts_Integration(t *testing.T) {
561
561
}
562
562
}
563
563
564
+ func TestClient_ShowCheckout_Integration (t * testing.T ) {
565
+ if ! integration {
566
+ return
567
+ }
568
+
569
+ type args struct {
570
+ ctx context.Context
571
+ req * entity.ShowCheckoutReq
572
+ }
573
+ tests := []struct {
574
+ name string
575
+ args args
576
+ wantErr bool
577
+ }{
578
+ {
579
+ name : "Missing identifier" ,
580
+ args : args {
581
+ ctx : context .Background (),
582
+ req : & entity.ShowCheckoutReq {
583
+ CheckoutID : "" ,
584
+ },
585
+ },
586
+ wantErr : true ,
587
+ },
588
+ {
589
+ name : "Show using checkout id" ,
590
+ args : args {
591
+ ctx : context .Background (),
592
+ req : & entity.ShowCheckoutReq {
593
+ CheckoutID : func () string {
594
+ c := client
595
+ got , err := c .checkouts .Create (context .Background (), & entity.CreateCheckoutReq {
596
+ Name : "The Sovereign Individual" ,
597
+ Description : "Mastering the Transition to the Information Age" ,
598
+ LocalPrice : entity.CreateCheckoutPrice {
599
+ Amount : "100.00" ,
600
+ Currency : "USD" ,
601
+ },
602
+ PricingType : enum .PricingTypeFixedPrice ,
603
+ RequestedInfo : []enum.CheckoutRequestedInfo {
604
+ enum .CheckoutRequestedInfoName ,
605
+ enum .CheckoutRequestedInfoEmail ,
606
+ },
607
+ })
608
+ if err != nil {
609
+ return ""
610
+ }
611
+ return got .Data .ID
612
+ }(),
613
+ },
614
+ },
615
+ wantErr : false ,
616
+ },
617
+ }
618
+ for _ , tt := range tests {
619
+ t .Run (tt .name , func (t * testing.T ) {
620
+ c := client
621
+ got , err := c .ShowCheckout (tt .args .ctx , tt .args .req )
622
+ if (err != nil ) != tt .wantErr {
623
+ t .Errorf ("ShowCheckout() error = %v, wantErr %v" , err , tt .wantErr )
624
+ return
625
+ }
626
+ L .Describe (got , err )
627
+ if ! tt .wantErr {
628
+ assert .NotNil (t , got )
629
+ }
630
+ })
631
+ }
632
+ }
633
+
564
634
func TestClient_CreateCheckout_Integration (t * testing.T ) {
565
635
if ! integration {
566
636
return
0 commit comments