@@ -89,6 +89,32 @@ def test_payments_error_mocked(self):
8989 "-data-422"
9090 ".json" )
9191 result = self .adyen .checkout .payments (request )
92+
93+ self .adyen .client .http_client .request .assert_called_once_with (
94+ 'https://checkout-test.adyen.com/v64/payments' ,
95+ headers = {},
96+ json = {
97+ 'returnUrl' : 'https://your-company.com/...' ,
98+ u'applicationInfo' : {
99+ u'adyenLibrary' : {
100+ u'version' : '4.0.0' ,
101+ u'name' : 'adyen-python-api-library'
102+ }
103+ },
104+ 'reference' : '54431' ,
105+ 'merchantAccount' : 'YourMerchantAccount' ,
106+ 'amount' : {'currency' : 'EUR' , 'value' : '100000' },
107+ 'paymentMethod' : {
108+ 'expiryYear' : '2018' ,
109+ 'holderName' : 'John Smith' ,
110+ 'number' : '4111111111111111' ,
111+ 'expiryMonth' : '08' ,
112+ 'type' : 'scheme' ,
113+ 'cvc' : '737'
114+ }
115+ },
116+ xapikey = 'YourXapikey'
117+ )
92118 self .assertEqual (422 , result .message ['status' ])
93119 self .assertEqual ("130" , result .message ['errorCode' ])
94120 self .assertEqual ("Reference Missing" , result .message ['message' ])
@@ -104,7 +130,19 @@ def test_payments_details_success_mocked(self):
104130 "checkout/"
105131 "paymentsdetails"
106132 "-success.json" )
133+
107134 result = self .adyen .checkout .payments_details (request )
135+
136+ self .adyen .client .http_client .request .assert_called_once_with (
137+ u'https://checkout-test.adyen.com/v64/payments/details' ,
138+ headers = {},
139+ json = {
140+ 'paymentData' : 'Hee57361f99....' ,
141+ u'merchantAccount' : None ,
142+ 'details' : {'MD' : 'sdfsdfsdf...' , 'PaRes' : 'sdkfhskdjfsdf...' }
143+ },
144+ xapikey = 'YourXapikey'
145+ )
108146 self .assertEqual ("8515232733321252" , result .message ['pspReference' ])
109147 self .assertEqual ("Authorised" , result .message ['resultCode' ])
110148 self .assertEqual ("true" ,
0 commit comments