Merge branch 'master' of github.com:crunchbutton/crunchbutton
This commit is contained in:
commit
723c2dd888
@ -212,7 +212,7 @@ class Controller_api_restaurant extends Crunchbutton_Controller_Rest {
|
||||
|
||||
case 'bankinfo':
|
||||
if ($r->id_restaurant) {
|
||||
$r->saveBankInfo($this->request()['name'],$this->request()['account'],$this->request()['routing']);
|
||||
$r->saveBankInfo($this->request()['name'],$this->request()['account'],$this->request()['routing'],$this->request()['type']);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
@ -265,11 +265,10 @@ class Crunchbutton_Restaurant extends Cana_Table_Trackchange {
|
||||
return $merchant;
|
||||
}
|
||||
|
||||
public function saveBankInfo($name, $account, $routing) {
|
||||
public function saveBankInfo($name, $account, $routing, $type) {
|
||||
try {
|
||||
$bank = c::balanced()->createBankAccount($name, $account, $routing);
|
||||
$bank = c::balanced()->createBankAccount($name, $account, $routing, $type);
|
||||
$info = $this->merchant()->addBankAccount($bank);
|
||||
|
||||
$this->balanced_bank = $bank->id;
|
||||
$this->save();
|
||||
} catch (Exception $e) {
|
||||
|
||||
@ -39,6 +39,15 @@
|
||||
<input type="text" name="name">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Type</td>
|
||||
<td>
|
||||
<select name="type" class="chzn-select" >
|
||||
<option value="checking" default>Checking</option>
|
||||
<option value="savings">Savings</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<br />
|
||||
@ -363,6 +372,7 @@
|
||||
$.post('/api/restaurant/<?=$this->restaurant->id_restaurant?>/bankinfo', {
|
||||
routing: form.find('[name="routing"]').val(),
|
||||
account: form.find('[name="account"]').val(),
|
||||
type: form.find('[name="type"]').val(),
|
||||
name: form.find('[name="name"]').val()
|
||||
}, function() {
|
||||
location.href = location.href;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user