@@ -117,16 +117,10 @@ def checkout_confirm_render(self, request, order=None, info_data=None):
117117 template = get_template ("pretix_pix_manual/checkout_confirm.html" )
118118 return template .render ({})
119119
120- def order_pending_mail_render (self , order , payment ):
121- return "Alguma coisa no email de confirmação"
122-
123- def payment_pending_render (self , request , payment ):
120+ def _generate_pix_code (self , payment ):
124121 pix_key = self .settings .get ("_pix_key" )
125122 merchant_city = self .settings .get ("_merchant_city" ) or ""
126123 merchant_name = self .settings .get ("_merchant_name" ) or ""
127- proof_of_payment_email = self .settings .get ("_proof_of_payment_email" )
128-
129- txid = f"{ self .event .id } -{ payment .order .code } "
130124 amount = str (payment .amount )
131125
132126 pix = Pix ()
@@ -137,6 +131,22 @@ def payment_pending_render(self, request, payment):
137131 pix .set_txid (payment .order .code )
138132 pix_code = str (pix )
139133
134+ return pix_code
135+
136+ def order_pending_mail_render (self , order , payment ):
137+ pix_code = self ._generate_pix_code (payment )
138+ proof_of_payment_email = self .settings .get ("_proof_of_payment_email" )
139+
140+ return _ (f"""To make the payment, copy and paste the following Pix code into your banking app.
141+
142+ { pix_code }
143+
144+ After making payment, send proof of payment to { proof_of_payment_email } , including your order code { payment .order .code } in the subject line.""" )
145+
146+ def payment_pending_render (self , request , payment ):
147+ pix_code = self ._generate_pix_code (payment )
148+ proof_of_payment_email = self .settings .get ("_proof_of_payment_email" )
149+
140150 qr = qrcode .QRCode (
141151 version = 1 ,
142152 error_correction = qrcode .constants .ERROR_CORRECT_M ,
0 commit comments