File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -116,17 +116,29 @@ public function generate_form($order_id){
116116 $ this ->secret_key
117117 )));
118118
119- return
119+ $ form =
120120 '<form action="https:// ' . $ this ->domain . '/pay/ ' . $ this ->public_key . '" method="POST" id="unitpay_form"> ' .
121121 '<input type="hidden" name="sum" value=" ' . $ sum . '" /> ' .
122122 '<input type="hidden" name="account" value=" ' . $ account . '" /> ' .
123123 '<input type="hidden" name="desc" value=" ' . $ desc . '" /> ' .
124124 '<input type="hidden" name="currency" value=" ' . $ currency . '" /> ' .
125125 '<input type="hidden" name="locale" value=" ' . $ locale . '" /> ' .
126- '<input type="hidden" name="signature" value=" ' . $ signature . '" /> ' .
126+ '<input type="hidden" name="signature" value=" ' . $ signature . '" /> ' ;
127+
128+ if ($ order ->billing_email ) {
129+ $ form .= '<input type="hidden" name="customerEmail" value=" ' . $ order ->billing_email . '" /> ' ;
130+ }
131+
132+ if ($ order ->billing_phone ) {
133+ $ form .= '<input type="hidden" name="customerPhone" value=" ' . $ order ->billing_phone . '" /> ' ;
134+ }
135+
136+ $ form .=
127137 '<input type="submit" class="button alt" id="submit_unitpay_form" value=" ' .__ ('Pay ' , 'unitpay ' ).'" />
128138 <a class="button cancel" href=" ' .$ order ->get_cancel_order_url ().'"> ' .__ ('Cancel payment and return back to card ' , 'unitpay ' ).'</a> ' ."\n" .
129139 '</form> ' ;
140+
141+ return $ form ;
130142 }
131143
132144 /**
You can’t perform that action at this time.
0 commit comments