@@ -194,3 +194,79 @@ def test_process_document_url():
194194 boost_mode = True ,
195195 )
196196 assert d == mock
197+
198+
199+ @responses .activate
200+ def test_process_w9_document_url ():
201+ mock = {
202+ "account_numbers" : "" ,
203+ "address1" : "28 E 3rd Ave, Suite 201" ,
204+ "address2" : "San Mateo, California, 94401" ,
205+ "business_name" : "" ,
206+ "c_corp" : 0 ,
207+ "ein" : "" ,
208+ "exempt_payee_code" : "" ,
209+ "exemption" : "" ,
210+ "individual" : 0 ,
211+ "llc" : 0 ,
212+ "name" : "Veryfi, Inc." ,
213+ "other" : 0 ,
214+ "other_description" : "" ,
215+ "partnership" : 0 ,
216+ "pdf_url" : "https://scdn.veryfi.com/w9s/ec278ba0-31d6-4bd4-9d18-cb6a1232788e/output-1.pdf?Expires=1653031170&Signature=bftl34pf~Yni3ysaauqwL4BkfzgMPdAwMpw-SkjKZaxkgSt2~EYmX7NK~BGZ5IFUNdUIGBxTIsBsVWrP8LDQ3fME3kFM6qSn-udZp9Y8WJ-HbqQrIf1DwZQp-A2NSBCkRWgqAtYJo5dQW~UJJdCJx19ZIaYQZzYVQvuHmornzBStTV6D2qXQKUZpv9d5BrvTExZDnIxKy-ibyy09CfUPMc-lsVQLQEb-uQvud-JTf9Guy6k9Y4oT32HSvKcL0pMLvJqYC6mJUM2-5MJiBsYQSNs2e6s8xXcSBotiChMQwBg3RhGv5y-o8Aih1GNmBcvPHJIEyKOuiHeC9TUSELvp~w__&Key-Pair-Id=APKAJCILBXEJFZF4DCHQ" ,
217+ "requester" : "AcMe Corporation 1010 Elm Str,\n Mountain View, CA 94043" ,
218+ "s_corp" : 1 ,
219+ "signature" : 1 ,
220+ "signature_date" : "June 19, 2020" ,
221+ "ssn" : "" ,
222+ "trust_estate" : 0 ,
223+ }
224+
225+ client = Client (client_id = "v" , client_secret = "w" , username = "o" , api_key = "c" )
226+ responses .add (
227+ responses .POST ,
228+ f"{ client .versioned_url } /partner/w9s/" ,
229+ json = mock ,
230+ status = 200 ,
231+ )
232+ d = client .process_w9_document_url (
233+ file_url = "http://cdn-dev.veryfi.com/testing/veryfi-python/receipt_public.jpg" ,
234+ )
235+ assert d == mock
236+
237+
238+ @responses .activate
239+ def test_process_w9_document ():
240+ mock = {
241+ "account_numbers" : "" ,
242+ "address1" : "28 E 3rd Ave, Suite 201" ,
243+ "address2" : "San Mateo, California, 94401" ,
244+ "business_name" : "" ,
245+ "c_corp" : 0 ,
246+ "ein" : "" ,
247+ "exempt_payee_code" : "" ,
248+ "exemption" : "" ,
249+ "individual" : 0 ,
250+ "llc" : 0 ,
251+ "name" : "Veryfi, Inc." ,
252+ "other" : 0 ,
253+ "other_description" : "" ,
254+ "partnership" : 0 ,
255+ "pdf_url" : "https://scdn.veryfi.com/w9s/ec278ba0-31d6-4bd4-9d18-cb6a1232788e/output-1.pdf?Expires=1653031170&Signature=bftl34pf~Yni3ysaauqwL4BkfzgMPdAwMpw-SkjKZaxkgSt2~EYmX7NK~BGZ5IFUNdUIGBxTIsBsVWrP8LDQ3fME3kFM6qSn-udZp9Y8WJ-HbqQrIf1DwZQp-A2NSBCkRWgqAtYJo5dQW~UJJdCJx19ZIaYQZzYVQvuHmornzBStTV6D2qXQKUZpv9d5BrvTExZDnIxKy-ibyy09CfUPMc-lsVQLQEb-uQvud-JTf9Guy6k9Y4oT32HSvKcL0pMLvJqYC6mJUM2-5MJiBsYQSNs2e6s8xXcSBotiChMQwBg3RhGv5y-o8Aih1GNmBcvPHJIEyKOuiHeC9TUSELvp~w__&Key-Pair-Id=APKAJCILBXEJFZF4DCHQ" ,
256+ "requester" : "AcMe Corporation 1010 Elm Str,\n Mountain View, CA 94043" ,
257+ "s_corp" : 1 ,
258+ "signature" : 1 ,
259+ "signature_date" : "June 19, 2020" ,
260+ "ssn" : "" ,
261+ "trust_estate" : 0 ,
262+ }
263+
264+ client = Client (client_id = "v" , client_secret = "w" , username = "o" , api_key = "c" )
265+ responses .add (
266+ responses .POST ,
267+ f"{ client .versioned_url } /partner/w9s/" ,
268+ json = mock ,
269+ status = 200 ,
270+ )
271+ d = client .process_w9_document (file_path = "tests/assets/receipt_public.jpg" )
272+ assert d == mock
0 commit comments