create new customer.

@param $body

@return \Exception|mixed
15373
public function save($body)
    {
        $request = $this->paystackHttpClient->post(
            $this->transformUrl(Resource::CUSTOMERS_URL, ''),
            [
                'body'  => is_array($body) ? $this->toJson($body) : $body,
            ]
        );

        return $this->processResourceRequestResponse($request);
    }
228976
public function create()
    {
        if (!userHasPermission('admin:invoice:customer:create')) {
            unauthorised();
        }

        $oInput = Factory::service('Input');
        if ($oInput->post()) {

            try {

                $this->formValidation();
                $oCustomerModel = Factory::model('Customer', 'nails/module-invoice');
                if (!$oCustomerModel->create($this->prepPostData())) {
                    throw new NailsException('Failed to create item. ' . $oCustomerModel->lastError(), 1);
                }

                $oSession = Factory::service('Session', 'nails/module-auth');
                $oSession->setFlashData('success', 'Item created successfully.');
                redirect('admin/invoice/customer');

            } catch (\Exception $e) {
                $this->data['error'] = $e->getMessage();
            }
        }

        $this->data['page']->title = 'Create customer';
        Helper::loadView('edit');
    }
1327481
public function createList($body)
    {
        $response = $this->client->post(Resources::$Contactslist, ['body' => $body]);
        if (!$response->success()) {
            $this->throwError("MailjetService:createList() failed", $response);
        }
        return $response;
    }
864588
public function initialize($body)
    {
        $request = $this->paystackHttpClient->post(
            Resource::INITIALIZE_TRANSACTION,
            [
                'body'  => is_array($body) ? $this->toJson($body) : $body,
            ]
        );

        return $this->processResourceRequestResponse($request);
    }
983844
public function create()
    {
        $instance = self::createStoreCreditPayment($this);
        $this->setId($instance->getId());
        return $instance;
    }
702277
protected function createMessage($body)
    {
        $message = new models\DbMessage();
        $message->setAttributes([
            'queue_id'  => $this->id,
            'timeout'   => $this->timeout,
            'sender_id' => Yii::$app->has('user') ? Yii::$app->user->getId() : null,
            'status'    => Message::AVAILABLE,
            'body'      => $body,
        ], false);

        return $this->formatMessage($message);
    }
255276
public function createAction(Request $request)
        {

            $oCustomer = new Customer();
            // create customerform for validation
            $oForm = $this->createCreateForm($oCustomer);
            $oForm->handleRequest($request);
            if ($oForm->isValid()) {

                // handle logoupload if present
                $sLogoPath = $this->_handleLogoUpload($request, $oCustomer);
                $oCustomer->setLogo($sLogoPath);
                // save logo to customer
                $oCustomer->save();

                // redirect to customerlist if successful
                return $this->redirect($this->generateUrl('backend_system_customer'));
            }

            // if error occured, redirect back to form
            return $this->render('SlashworksAppBundle:Customer:new.html.twig', array(
                'entity' => $oCustomer,
                'form'   => $oForm->createView(),
            ));
        }
14331
public static function CreateInstance (
		$code = \MvcCore\IResponse::OK,
		$headers = [],
		$body = ''
	) {
		$responseClass = \MvcCore\Application::GetInstance()->GetResponseClass();
		return new $responseClass($code, $headers, $body);
	}
136876
public function newAction()
        {

            $oCustomer = new Customer();
            $form      = $this->createCreateForm($oCustomer);

            return $this->render('SlashworksAppBundle:Customer:new.html.twig', array(
                'entity' => $oCustomer,
                'form'   => $form->createView(),
            ));
        }
436691
public function create(Customer &$customer)
    {
        $data = $customer->exportData();
        $endpoint = '/admin/customers.json';
        $response = $this->request(
            $endpoint, "POST", array(
            'customer' => $data
            )
        );
        $customer->setData($response['customer']);
    }
1209129
public function createUser($data)
    {
        return DB::transaction(function() use ($data) {
            $user = User::create([
                'name' => $data['name'],
                'email' => $data['email'],
                'password' => bcrypt($data['password']),
            ]);

            return $this->service->create($user, $data['password']);
        });
    }
1220185
public function afterCreate(\Magento\Sales\Api\OrderCustomerManagementInterface $subject, $customer)
    {
        //New Automation enrolment to queue
        $this->automation->newCustomerAutomation($customer);

        return $customer;
    }
1371507
public function withBody($body): self {
        $clone = clone $this;

        if ($body === null) {
            $clone->body = new StringBody("");
        } elseif (\is_scalar($body)) {
            $clone->body = new StringBody((string) $body);
        } elseif ($body instanceof RequestBody) {
            $clone->body = $body;
        } else {
            throw new \TypeError("Invalid body type: " . gettype($body));
        }

        return $clone;
    }
1160305
public function create($user, $password, $role = 'member', $sendEmail = false)
    {
        try {
            DB::transaction(function () use ($user, $password, $role, $sendEmail) {
                $this->userMeta->firstOrCreate([
                    'user_id' => $user->id
                ]);

                $this->assignRole($role, $user->id);

                if ($sendEmail) {
                    event(new UserRegisteredEmail($user, $password));
                }
            });

            $this->setAndSendUserActivationToken($user);

            return $user;
        } catch (Exception $e) {
            throw new Exception("We were unable to generate your profile, please try again later.", 1);
        }
    }
1041410
def create_new(self, body):
        
        return self.client.post(self._url(), data=body)
303591
public function create($data)
    {
        $res = $this->request(self::PAYMENTS_PATH)->setRequestBody($data)->post();

        if ($res->isError()) {
            throw new RequestError($res->errorMessage, null, $res);
        }

        return new Payment($res->json);
    }
463796
protected function createMessage($body)
    {
        $now = new \DateTime('now', new \DateTimezone('UTC'));
        $message = new Message();
        $message->setAttributes([
            'id'         => $this->redis->incr($this->id.self::MESSAGE_ID),
            'status'     => Message::AVAILABLE,
            'created_on' => $now->format('Y-m-d H:i:s'),
            'sender_id'  => Yii::$app->has('user') ? Yii::$app->user->getId() : null,
            'body'       => $body,
        ]);

        return $this->formatMessage($message);
    }