@@ -119,6 +119,45 @@ def test_uses_configured_pix_channel_and_one_br_proxy(self) -> None:
119119 provider_proxy = "http://br-shared.example.test:8000" ,
120120 )
121121
122+ def test_scheme3_uses_configured_vn_promotion_proxy (self ) -> None :
123+ with (
124+ patch ("api.checkout.require_admin" , return_value = {"id" : "admin" , "role" : "admin" }),
125+ patch .object (
126+ checkout .register_service ,
127+ "get" ,
128+ return_value = {
129+ "checkout" : {
130+ "channel" : "pix" ,
131+ "pix_protocol" : "standalone" ,
132+ "checkout_proxy_enabled" : True ,
133+ "checkout_proxy_url" : "http://br.example.test:8000" ,
134+ "promotion_proxy_enabled" : True ,
135+ "promotion_proxy_url" : "http://vn.example.test:8001" ,
136+ }
137+ },
138+ ),
139+ patch .object (
140+ checkout .openai_checkout_service ,
141+ "extract_and_store_checkout_link" ,
142+ return_value = {"checkout_final_url" : "https://payments.stripe.com/qr/instructions/pix_scheme3" },
143+ ) as create ,
144+ ):
145+ response = self .client .post (
146+ "/api/accounts/checkout-session" ,
147+ headers = {"Authorization" : "Bearer test-admin-key" },
148+ json = {"access_token" : "stored-access-token" },
149+ )
150+
151+ self .assertEqual (response .status_code , 200 )
152+ create .assert_called_once_with (
153+ "stored-access-token" ,
154+ checkout_channel = "pix" ,
155+ pix_protocol = "standalone" ,
156+ checkout_proxy = "http://br.example.test:8000" ,
157+ promotion_proxy = "http://vn.example.test:8001" ,
158+ provider_proxy = "http://br.example.test:8000" ,
159+ )
160+
122161 def test_enqueues_selected_accounts_for_continuous_retries (self ) -> None :
123162 with (
124163 patch ("api.checkout.require_admin" , return_value = {"id" : "admin" , "role" : "admin" }),
0 commit comments