Skip to content

Commit 24613a8

Browse files
authored
Merge pull request #6 from unitpay/cashbox_support
Added cashboxes support
2 parents 626b21d + 85614af commit 24613a8

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

unitpay/unitpay.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff 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
/**

0 commit comments

Comments
 (0)