Update payment methods.

@param  string  $id
@param  array   $codes

@return \Laravie\Codex\Contracts\Response
342036
public function update(string $collectionId, array $codes = []): Response
    {
        $payments = [];

        foreach ($codes as $code) {
            \array_push($payments, \compact('code'));
        }

        return $this->send('PUT', "collections/{$collectionId}/payment_methods", [], $payments);
    }
117790
public function updateAction($id)
    {
        $this->initializeScaffolding();
        $this->checkRequest();

        try {
            $this->beforeRead();
            $this->view->record = $this->scaffolding->doRead($id);
            $this->afterRead();

            $this->beforeUpdate();
            $this->scaffolding->doUpdate($id, $this->request->getPost());
            $this->flash->success($this->successMessage);
            return $this->afterUpdate();
        } catch (Exception $e) {
            $this->flash->error($e->getMessage());
            $this->afterUpdateException();
        }

        return $this->dispatcher->forward(['action' => 'edit']);
    }
508188
public function update($id, $data)
    {
        $this->mangleCidrNotation($id);

        $response = Request::put("{$this->uri}/$id")
            ->authenticateWith($this->username, $this->password)
            ->body(json_encode($data))
            ->sendsType('application/json')
            ->send();

        return $this->processResponse($response);
    }
66406
public function update($id)
    {
        /** @var FormRequest $request */
        $request = app($this->getUpdateRequestClass());
        $record  = $this->modelRepository->findOrFail($id);

        $data = $request->only($this->getRelevantFormFieldKeys());

        /** @var FormDataStorerInterface $storer */
        $storer = app(FormDataStorerInterface::class);
        $storer->setModelInformation($this->getModelInformation());

        if ( ! $storer->store($record, $data)) {
            // @codeCoverageIgnoreStart
            return redirect()->back()
                ->withInput()
                ->withErrors([
                    static::GENERAL_ERRORS_KEY => [ $this->getGeneralStoreFailureError() ],
                ]);
            // @codeCoverageIgnoreEnd
        }

        $this->storeActiveTab($request->input(static::ACTIVE_TAB_PANE_KEY));

        cms_flash(
            cms_trans(
                'models.store.success-message-edit',
                [ 'record' => $this->getSimpleRecordReference($id, $record) ]
            ),
            FlashLevel::SUCCESS
        );

        event( new Events\ModelUpdatedInCms($record) );

        if ($request->input(static::SAVE_AND_CLOSE_KEY)) {
            return redirect()->route("{$this->routePrefix}.index");
        }

        return redirect()->route("{$this->routePrefix}.edit", [ $record->getKey() ]);
    }
1132593
public function updateById($id, $attributes)
    {
        $attributes = $this->formatUpdateAttributes($attributes);

        $model = $this->model->find($id);

        if (empty($model))
            return $this;

        $model->update($this->mapAttributesWithScope($attributes));

        $apiModel = $this->getById($model->id);
        $this->afterUpdate($apiModel, $attributes);
        return $apiModel;
    }
252365
public function update(Request $request, $id = null)
    {
        return $this->processor->update($this, $id, $request->all());
    }
777935
public function update($id, array $data)
    {
        $upload = $this->client->put(
            sprintf('buckets/%d/uploads/%d.json', $this->bucket, $id),
            [
                'json' => $data,
            ]
        );

        return new Upload($this->response($upload));
    }
1323539
public function actionUpdate($id)
    {
        $model = $this->findModel($id);

        $this->beginTransaction();
        try {
            $this->fire('beforeUpdate', [$model]);
            $model->load(Yii::$app->request->post(), '');
            $this->fire('update', [$model]);
            if ($model->save()) {
                $this->fire('updated', [$model]);
                $this->commit();
                $model->refresh();
            } else {
                $this->fire('rollbackUpdate', [$model]);
                $this->rollBack();
            }
        } catch (\Exception $e) {
            $this->fire('errorUpdate', [$model, $e]);
            $this->rollBack();
            throw $e;
        }

        return $model;
    }
1179387
public function updatePaymentMethod(string $id, array $data, array $headers = [])
    {
        $url = $this->url('customers/%s/update_payment_method', $id);

        return $this->post($url, $data, $headers);
    }
1023654
public function update($id, $attributes)
    {
        $attributes = $this->castRequest($attributes);
        $updated    = false;
        $instance   = $id instanceof Model ? $id : $this->find($id);

        if ($instance) {
            event(implode('-', $this->tag).'.entity.updating', [$this, $instance, $attributes]);

            $updated = $instance->update($attributes);

            event(implode('-', $this->tag).'.entity.updated', [$this, $instance, $attributes]);
        }

        return [
            $updated,
            $instance,
        ];
    }
194127
public function update($id, array $data)
    {
        $project = $this->client->put(sprintf('projects/%d.json', $id), [
            'json' => $data,
        ]);

        return new Project($this->response($project));
    }
787880
public function updateDetails(string $id, array $data, array $headers = [])
    {
        $url = $this->url('invoices/%s/update_details', $id);

        return $this->post($url, $data, $headers);
    }
397882
public function update(array $data, $id)
    {
        if (array_key_exists('password', $data)) {
            $data['password'] = bcrypt($data['password']);
        }

        return parent::update($data, $id);
    }
473540
public function update(array $data, $id)
    {
        $scene = '';
        if (func_num_args() === 3) {
            $scene = func_get_arg(2);
        }

        $this->setOriginal($data);

        $this->setData($this->guardResult($data, $scene));

        if ($this->fireEvent('updating', $data) === false) {
            return false;
        }

        $model = is_numeric($id) ?
            $this->driver->updateByIntId($this->getData(), $id) :
            $this->driver->updateByStringId($this->getData(), $id);

        $this->fireEvent('updated', $model);

        return $model;
    }
26399
public function codeUpdate($code, $new_code, $card_id)
    {
        if (empty($code) || empty($new_code)) {
            $this->setError('缺少错误');

            return false;
        }

        $queryStr             = [];
        $queryStr['code']     = $code;
        $queryStr['new_code'] = $new_code;
        if (!empty($card_id)) {
            $queryStr['card_id'] = $card_id;
        }

        $this->apitype = 'card';
        $this->module  = 'code';

        $res = $this->_post('update', $queryStr);

        return $res;
    }
634194
public function update($id, array $attributes)
    {
        $user = $this->findById($id);

        $user->first_name = $attributes['first_name'];
        $user->last_name = $attributes['last_name'];
        $user->email = $attributes['email'];
        $user->permissions = $attributes['permissions'];

        if( array_key_exists('password', $attributes) )
        {
            $user->password = $attributes['password'];
        }

        $user->save();

        if ( array_key_exists('groups',$attributes) )
        {
            $this->syncGroups($attributes['groups'], $user);
        }

        $this->event->fire('users.update',array($user));

        return $user;
    }
555385
public function update($id, array $data)
    {
        $todo = $this->client->put(
            sprintf('buckets/%d/todos/%d.json', $this->bucket, $id),
            [
                'json' => $data,
            ]
        );

        return new Todo($this->response($todo));
    }