Skip to content

Commit

Permalink
Initial work
Browse files Browse the repository at this point in the history
  • Loading branch information
LasseRafn committed Nov 28, 2016
1 parent 3c8b657 commit ed39c79
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions src/PipedriveSignup.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

class PipedriveSignup
{
protected $endpoint = 'https://secure.e-conomic.com';
protected $endpoint = 'https://app.pipedrive.com';
private $referralKey;

function __construct()
{
$this->referralKey = config( 'pipedrive-signup.referral_key' );
$this->referralKey = config( 'pipedrive-signup.referral_key' );

$this->client = new Client( [
'base_uri' => $this->endpoint,
Expand All @@ -19,17 +19,29 @@ function __construct()
] );
}

public function signup( $userName, $userEmail, $companyName )
public function signup( $plan = 1, $name = '', $company = '', $email = '', $password = '', $companySize = '', $companyIndustry = '', $source = 'Other', $optInNews = 1, $country = 'US', $language = 'en', $locale = 'en_US', $collectPhone = 0, $timezone = 'UP1', $timezoneId = 'Europe/Copenhagen' )
{
try
{
$this->client->post( '/secure/signup/partnertrial/', [
$this->client->post( "/register?_v_country={$country}&_v_lang={$language}&promocode={$this->referralKey}", [
'form_params' => [
'UserEmail' => $userEmail,
'UserName' => $userName,
'CompanyName' => $companyName,
'PartnerAgreementNo' => $this->partnerAgreementNo,
'PartnerKey' => $this->partnerKey
'ducktape' => 'cought',
'country_code' => $country,
'user_lang' => 1,
'user_locale' => $locale,
'timezone' => $timezone,
'timezone_id' => $timezoneId,
'collect_phone_nr' => $collectPhone,
'plan' => $plan,
'name' => $name,
'company_name' => $company,
'email' => $email,
'password' => $password,
'company_size' => $companySize,
'company_industry' => $companyIndustry,
'signup_source' => $source,
'promo_code' => $this->referralKey,
'optin_news' => $optInNews
],
'Content-Type' => 'application/x-www-form-urlencoded'
] );
Expand Down

0 comments on commit ed39c79

Please sign in to comment.