1
1
using Checkout . Common ;
2
2
using Checkout . Payments . Request . Source . Contexts ;
3
+ using Checkout . Sessions ;
3
4
using Shouldly ;
4
5
using System . Collections . Generic ;
5
6
using System . Threading . Tasks ;
@@ -52,9 +53,23 @@ private async Task ShouldGetAPaymentContext()
52
53
{
53
54
Source = new PaymentContextsPaypalSource ( ) ,
54
55
Amount = 2000 ,
55
- Currency = Currency . EUR ,
56
+ Currency = Currency . USD ,
56
57
PaymentType = PaymentType . Regular ,
58
+ Customer = GetCustomer ( ) ,
57
59
Capture = true ,
60
+ Shipping = new ShippingDetails
61
+ {
62
+ FirstName = "John" ,
63
+ LastName = "Smith" ,
64
+
65
+ Address = GetAddress ( ) ,
66
+ Phone = GetPhone ( ) ,
67
+ FromAddressZip = "43434" ,
68
+ Timeframe = DeliveryTimeframe . ElectronicDelivery ,
69
+ Method = PaymentContextsShippingMethod . Digital ,
70
+ Delay = 0
71
+ } ,
72
+
58
73
ProcessingChannelId = System . Environment . GetEnvironmentVariable ( "CHECKOUT_PROCESSING_CHANNEL_ID" ) ,
59
74
SuccessUrl = "https://example.com/payments/success" ,
60
75
FailureUrl = "https://example.com/payments/fail" ,
@@ -66,7 +81,7 @@ private async Task ShouldGetAPaymentContext()
66
81
Quantity = 1 ,
67
82
UnitPrice = 2000
68
83
}
69
- } ,
84
+ }
70
85
} ;
71
86
72
87
var paymentContextResponse = await DefaultApi . PaymentContextsClient ( ) . RequestPaymentContexts ( paymentContextsRequest ) ;
@@ -76,8 +91,9 @@ private async Task ShouldGetAPaymentContext()
76
91
response . ShouldNotBeNull ( ) ;
77
92
response . PaymentRequest . ShouldNotBeNull ( ) ;
78
93
response . PaymentRequest . Amount . ShouldBe ( 2000 ) ;
79
- response . PaymentRequest . Currency . ShouldBe ( Currency . EUR ) ;
94
+ response . PaymentRequest . Currency . ShouldBe ( Currency . USD ) ;
80
95
response . PaymentRequest . PaymentType . ShouldBe ( PaymentType . Regular ) ;
96
+ response . PaymentRequest . AuthorizationType . ShouldBe ( "Final" ) ;
81
97
response . PaymentRequest . Capture . ShouldBe ( true ) ;
82
98
response . PaymentRequest . Items [ 0 ] . Name . ShouldBe ( "mask" ) ;
83
99
response . PaymentRequest . Items [ 0 ] . Quantity . ShouldBe ( 1 ) ;
0 commit comments