Create a customer
335936
public function createCustomer()
    {
        $data = [
            "email" => request()->email,
            "first_name" => request()->fname,
            "last_name" => request()->lname,
            "phone" => request()->phone,
            "metadata" => request()->additional_info /* key => value pairs array */

        ];

        $this->setRequestOptions();
        return $this->setHttpResponse('/customer', 'POST', $data)->getResponse();
    }
25244
def create_user(ctx):
    """"""

    try:
        new_user = _create_user(ctx)

        new_user.save()
        log("Done")
    except KeyError:
        log('User already exists', lvl=warn)
1096252
def modify_customer(self, handle, address, phone, email=None, vat=None, fax=None,
                        company_name=None, additional_data=None, extension_additional_data=None):
        """"""

        self.request(E.modifyCustomerRequest(
            E.handle(handle),
            E.vat(vat or ''),
            _get_phone_xml('phone', phone),
            _get_phone_xml('fax', fax),
            E.address(
                E.street(address.street),
                E.number(address.number),
                E.suffix(address.suffix or ''),
                E.zipcode(address.zipcode),
                E.city(address.city),
                E.state(address.state or ''),
                E.country(address.country),
            ),
            E.email(email or ''),
            _additional_data(additional_data),
            _extension_additional_data(extension_additional_data),
        ))

        return True
760181
def create_user(email, password, active, confirmed_at, send_email):
    
    if confirmed_at == 'now':
        confirmed_at = security.datetime_factory()
    user = user_manager.create(email=email, password=password, active=active,
                               confirmed_at=confirmed_at)
    if click.confirm(f'Are you sure you want to create {user!r}?'):
        security_service.register_user(user, allow_login=False, send_email=send_email)
        user_manager.save(user, commit=True)
        click.echo(f'Successfully created {user!r}')
    else:
        click.echo('Cancelled.')
1040198
public function createFor(Customer $customer, array $options = [], array $filters = [])
    {
        $this->parentId = $customer->id;

        return parent::rest_create($options, $filters);
    }
181305
def create(
        cls, api_key=None, idempotency_key=None, stripe_account=None, **params
    ):
        """"""
        url = cls.class_url()
        headers = populate_headers(idempotency_key)
        return make_request(
            cls, 'post', url, stripe_account=stripe_account,
            headers=headers, params=params)
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(),
            ));
        }
1191296
def create_stripe_token!
      return if stripe_token.blank?

      Rails.logger.info "[STRIPE] update source: #{stripe_token}"
      customer.stripe_customer.source = stripe_token
      customer.stripe_customer.save

      return if customer.stripe_customer.default_source.blank?

      card = customer.stripe_customer.sources.retrieve(customer.stripe_customer.default_source)
      customer.active_card = "**** **** **** #{card.last4} #{card.brand} #{card.exp_month}/#{card.exp_year}"
      customer.save!
    end
1131029
def create_customer(name, email, phone):
    
    Party = client.model('party.party')
    ContactMechanism = client.model('party.contact_mechanism')

    party, = Party.create([{'name': name}])

    # Bulk create the email and phone
    ContactMechanism.create([
        {'type': 'email', 'value': email, 'party': party},
        {'type': 'phone', 'value': phone, 'party': party},
    ])

    return party
485264
def create_service(self, customer_id, name, publish_key=None, comment=None):
		""""""
		body = self._formdata({
			"customer_id": customer_id,
			"name": name,
			"publish_key": publish_key,
			"comment": comment,
		}, FastlyService.FIELDS)
		content = self._fetch("/service", method="POST", body=body)
		return FastlyService(self, content)
1204505
def create
      user = User.new(user_params)

      if user.save
        UserMailer.confirm_account(user).deliver_now
        render json: user, status: :created
      else
        render json: user.errors, status: 422
      end
    end
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']);
    }
939362
def create_with_user(self, user_params, **kwargs):
        
        affiliate = self.create(**kwargs)
        self.api.affiliate_users.create(affiliate_id=affiliate.id, **user_params)
        return affiliate
1187351
async def create_account(self, **params):
		
		logging.debug("\n\n[+] -- Create account debugging. ")
		model = {
		"unique": ["email", "public_key"],
		"required": ("public_key",),
		"default": {"count":len(settings.AVAILABLE_COIN_ID), 
					"level":2, 
					"news_count":0, 
					"email":None},
		"optional": ("phone",)}

		message = json.loads(params.get("message", "{}"))
	
		data = {**message.get("message"), "public_key":message["public_key"]}

		# check if all required
		required = all([True if i in data.keys() else False for i in model["required"]])

		if not required:
			return {"error": 400,
					"reason":"Missed required fields"}

		# Unique constraint
		get_account = await self.collection.find_one({"public_key":data.get("public_key")})

		# Try get account with current public key
		if get_account:
			return {"error": 400,
					"reason": "Unique violation error"}

		# Reload data.
		row = {i:data[i] for i in data 
				if i in model["required"] or i in model["optional"]}
		row.update({i:model["default"][i] for i in model["default"]})
		if data.get("email"):
			row["email"] = data.get("email")
		row.update({"id":await self.autoincrement()})
		await self.collection.insert_one(row)
		account = await self.collection.find_one({"public_key":row["public_key"]})

		# Create wallets
		for coinid in coin_ids:
			database = client[coinid]
			wallet_collection = database[settings.WALLET]
			wallet = await wallet_collection.insert_one({
					"account_id": account["id"],
					"wallet": self.account.validator[coinid](account["public_key"]) 
				})
		return account
407245
def new
      @customer = Customer.new

      respond_to do |format|
        format.html # new.html.erb
        format.json { render json: @customer }
      end
    end
396837
function createUser(user, callback) {
      /* jshint validthis:true */
      var cb = callback || angular.noop;

      return User.save(user,
        function (data) {
          return cb(user);
        },
        function (err) {
          return cb(err);
        }.bind(this)).$promise;
    }
9669
def create_project(self, name, **kwargs):
        
        data = self._wrap_dict("project", kwargs)
        data["customer"]["name"] = name
        return self.post("/projects.json", data=data)