@@ -64,22 +64,23 @@ public PaymentsServiceIntegrationTest()
6464 public async Task Given_Payments_When_CardDetails_Provided_Returns_OK ( )
6565 {
6666 // Arrange
67- var request = new PaymentRequest (
68- amount : new Amount ( "EUR" , 1999 ) ,
69- merchantAccount : _merchantAccount ,
70- reference : "reference" ,
71- returnUrl : "https://adyen.com/" ,
72- paymentMethod : new CheckoutPaymentMethod (
73- new CardDetails (
74- type : CardDetails . TypeEnum . Scheme ,
75- encryptedCardNumber : "test_4111111111111111" ,
76- encryptedExpiryMonth : "test_03" ,
77- encryptedExpiryYear : "test_2030" ,
78- encryptedSecurityCode : "test_737" ,
79- holderName : "John Smith"
80- )
81- )
82- ) ;
67+ var request = new PaymentRequest
68+ {
69+ Amount = new Amount { Currency = "EUR" , Value = 1999 } ,
70+ MerchantAccount = _merchantAccount ,
71+ Reference = "reference" ,
72+ ReturnUrl = "https://adyen.com/" ,
73+ PaymentMethod = new CheckoutPaymentMethod (
74+ new CardDetails
75+ {
76+ Type = CardDetails . TypeEnum . Scheme ,
77+ EncryptedCardNumber = "test_4111111111111111" ,
78+ EncryptedExpiryMonth = "test_03" ,
79+ EncryptedExpiryYear = "test_2030" ,
80+ EncryptedSecurityCode = "test_737" ,
81+ HolderName = "John Smith"
82+ } )
83+ } ;
8384 IPaymentsApiResponse response = await _paymentsApiService . PaymentsAsync ( request ) ;
8485
8586 response . TryDeserializeOkResponse ( out var result ) ;
@@ -90,22 +91,23 @@ public async Task Given_Payments_When_CardDetails_Provided_Returns_OK()
9091 public async Task xGiven_Payments_When_CardDetails_With_Empty_RequestOptions_Succeeds ( )
9192 {
9293 // Test when no idempotency key is provided
93- var request = new PaymentRequest (
94- amount : new Amount ( "EUR" , 1999 ) ,
95- merchantAccount : _merchantAccount ,
96- reference : "ref1-original-request-1" ,
97- returnUrl : "https://adyen.com/" ,
98- paymentMethod : new CheckoutPaymentMethod (
99- new CardDetails (
100- type : CardDetails . TypeEnum . Scheme ,
101- encryptedCardNumber : "test_4111111111111111" ,
102- encryptedExpiryMonth : "test_03" ,
103- encryptedExpiryYear : "test_2030" ,
104- encryptedSecurityCode : "test_737" ,
105- holderName : "John Smith"
106- )
107- )
108- ) ;
94+ var request = new PaymentRequest
95+ {
96+ Amount = new Amount { Currency = "EUR" , Value = 1999 } ,
97+ MerchantAccount = _merchantAccount ,
98+ Reference = "ref1-original-request-1" ,
99+ ReturnUrl = "https://adyen.com/" ,
100+ PaymentMethod = new CheckoutPaymentMethod (
101+ new CardDetails
102+ {
103+ Type = CardDetails . TypeEnum . Scheme ,
104+ EncryptedCardNumber = "test_4111111111111111" ,
105+ EncryptedExpiryMonth = "test_03" ,
106+ EncryptedExpiryYear = "test_2030" ,
107+ EncryptedSecurityCode = "test_737" ,
108+ HolderName = "John Smith"
109+ } )
110+ } ;
109111 IPaymentsApiResponse response = await _paymentsApiService . PaymentsAsync ( request , new RequestOptions ( ) ) ;
110112
111113 response . TryDeserializeOkResponse ( out PaymentResponse result ) ;
@@ -117,67 +119,70 @@ public async Task xGiven_Payments_When_CardDetails_With_Empty_RequestOptions_Suc
117119 public async Task Given_Payments_When_CardDetails_Without_Idempotency_Key_Provided_Returns_DifferentRefs ( )
118120 {
119121 // Test when no idempotency key is provided
120- var request = new PaymentRequest (
121- amount : new Amount ( "EUR" , 1999 ) ,
122- merchantAccount : _merchantAccount ,
123- reference : "ref1-original-request-1" ,
124- returnUrl : "https://adyen.com/" ,
125- paymentMethod : new CheckoutPaymentMethod (
126- new CardDetails (
127- type : CardDetails . TypeEnum . Scheme ,
128- encryptedCardNumber : "test_4111111111111111" ,
129- encryptedExpiryMonth : "test_03" ,
130- encryptedExpiryYear : "test_2030" ,
131- encryptedSecurityCode : "test_737" ,
132- holderName : "John Smith"
133- )
134- )
135- ) ;
122+ var request = new PaymentRequest
123+ {
124+ Amount = new Amount { Currency = "EUR" , Value = 1999 } ,
125+ MerchantAccount = _merchantAccount ,
126+ Reference = "ref1-original-request-1" ,
127+ ReturnUrl = "https://adyen.com/" ,
128+ PaymentMethod = new CheckoutPaymentMethod (
129+ new CardDetails
130+ {
131+ Type = CardDetails . TypeEnum . Scheme ,
132+ EncryptedCardNumber = "test_4111111111111111" ,
133+ EncryptedExpiryMonth = "test_03" ,
134+ EncryptedExpiryYear = "test_2030" ,
135+ EncryptedSecurityCode = "test_737" ,
136+ HolderName = "John Smith"
137+ } )
138+ } ;
136139 IPaymentsApiResponse response = await _paymentsApiService . PaymentsAsync ( paymentRequest : request ) ;
137140
138141 response . TryDeserializeOkResponse ( out PaymentResponse result ) ;
139142 Assert . AreEqual ( result ? . MerchantReference , "ref1-original-request-1" ) ;
140143
141144
142145 // Test when no idempotency key is provided
143- var request2 = new PaymentRequest (
144- amount : new Amount ( "EUR" , 1999 ) ,
145- merchantAccount : _merchantAccount ,
146- reference : "ref2-should-be-different" ,
147- returnUrl : "https://adyen.com/" ,
148- paymentMethod : new CheckoutPaymentMethod (
149- new CardDetails (
150- type : CardDetails . TypeEnum . Scheme ,
151- encryptedCardNumber : "test_4111111111111111" ,
152- encryptedExpiryMonth : "test_03" ,
153- encryptedExpiryYear : "test_2030" ,
154- encryptedSecurityCode : "test_737" ,
155- holderName : "John Smith"
156- )
157- )
158- ) ;
146+ var request2 = new PaymentRequest
147+ {
148+ Amount = new Amount { Currency = "EUR" , Value = 1999 } ,
149+ MerchantAccount = _merchantAccount ,
150+ Reference = "ref2-should-be-different" ,
151+ ReturnUrl = "https://adyen.com/" ,
152+ PaymentMethod = new CheckoutPaymentMethod (
153+ new CardDetails
154+ {
155+ Type = CardDetails . TypeEnum . Scheme ,
156+ EncryptedCardNumber = "test_4111111111111111" ,
157+ EncryptedExpiryMonth = "test_03" ,
158+ EncryptedExpiryYear = "test_2030" ,
159+ EncryptedSecurityCode = "test_737" ,
160+ HolderName = "John Smith"
161+ } )
162+ } ;
159163 IPaymentsApiResponse response2 = await _paymentsApiService . PaymentsAsync ( paymentRequest : request2 ) ;
160164
161165 response2 . TryDeserializeOkResponse ( out PaymentResponse result2 ) ;
162166 Assert . AreEqual ( result2 ? . MerchantReference , "ref2-should-be-different" ) ;
163167
164168 // Test when null is explicitly provided.
165- var request3 = new PaymentRequest (
166- amount : new Amount ( "EUR" , 1999 ) ,
167- merchantAccount : _merchantAccount ,
168- reference : "ref3-should-be-very-different" ,
169- returnUrl : "https://adyen.com/" ,
170- paymentMethod : new CheckoutPaymentMethod (
171- new CardDetails (
172- type : CardDetails . TypeEnum . Scheme ,
173- encryptedCardNumber : "test_4111111111111111" ,
174- encryptedExpiryMonth : "test_03" ,
175- encryptedExpiryYear : "test_2030" ,
176- encryptedSecurityCode : "test_737" ,
177- holderName : "John Smith"
178- )
179- )
180- ) ;
169+ var request3 = new PaymentRequest
170+ {
171+ Amount = new Amount { Currency = "EUR" , Value = 1999 } ,
172+ MerchantAccount = _merchantAccount ,
173+ Reference = "ref3-should-be-very-different" ,
174+ ReturnUrl = "https://adyen.com/" ,
175+ PaymentMethod = new CheckoutPaymentMethod (
176+ new CardDetails
177+ {
178+ Type = CardDetails . TypeEnum . Scheme ,
179+ EncryptedCardNumber = "test_4111111111111111" ,
180+ EncryptedExpiryMonth = "test_03" ,
181+ EncryptedExpiryYear = "test_2030" ,
182+ EncryptedSecurityCode = "test_737" ,
183+ HolderName = "John Smith"
184+ } )
185+ } ;
181186 IPaymentsApiResponse response3 = await _paymentsApiService . PaymentsAsync ( request3 ) ;
182187 response3 . TryDeserializeOkResponse ( out PaymentResponse result3 ) ;
183188 Assert . AreEqual ( result3 ? . MerchantReference , "ref3-should-be-very-different" ) ;
@@ -232,22 +237,23 @@ public async Task PaymentsServiceEvents_Override_Delegates_Example()
232237 {
233238 // Arrange
234239
235- var request = new PaymentRequest (
236- amount : new Amount ( "EUR" , 1999 ) ,
237- merchantAccount : _merchantAccount ,
238- reference : "reference" ,
239- returnUrl : "https://adyen.com/" ,
240- paymentMethod : new CheckoutPaymentMethod (
241- new CardDetails (
242- type : CardDetails . TypeEnum . Scheme ,
243- encryptedCardNumber : "test_4111111111111111" ,
244- encryptedExpiryMonth : "test_03" ,
245- encryptedExpiryYear : "test_2030" ,
246- encryptedSecurityCode : "test_737" ,
247- holderName : "John Smith"
248- )
249- )
250- ) ;
240+ var request = new PaymentRequest
241+ {
242+ Amount = new Amount { Currency = "EUR" , Value = 1999 } ,
243+ MerchantAccount = _merchantAccount ,
244+ Reference = "reference" ,
245+ ReturnUrl = "https://adyen.com/" ,
246+ PaymentMethod = new CheckoutPaymentMethod (
247+ new CardDetails
248+ {
249+ Type = CardDetails . TypeEnum . Scheme ,
250+ EncryptedCardNumber = "test_4111111111111111" ,
251+ EncryptedExpiryMonth = "test_03" ,
252+ EncryptedExpiryYear = "test_2030" ,
253+ EncryptedSecurityCode = "test_737" ,
254+ HolderName = "John Smith"
255+ } )
256+ } ;
251257
252258
253259 PaymentsServiceEvents paymentsServiceEvents = _host . Services . GetRequiredService < PaymentsServiceEvents > ( ) ;
0 commit comments