Skip to content

Commit

Permalink
Support for account provider id when register account
Browse files Browse the repository at this point in the history
  • Loading branch information
lontivero committed Sep 3, 2015
1 parent da5a485 commit 1273f1e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
7 changes: 6 additions & 1 deletion MetacoClient.Tests/AccountTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ public void ClientCanRegisterAndValidateAccount()
var client = CreateClient();

/** Account registration **/
var result = client.RegisterAccount(new RegisterAccountRequest {Phone = "+15005550006"});
var result = client.RegisterAccount(
new RegisterAccountRequest {
Phone = "+15005550006",
ProviderId = "TestsProvider"
});

Assert.NotNull(result.ApiId);

var validationCode = client.LatestDebugData;
Expand Down
6 changes: 6 additions & 0 deletions MetacoClient/Contracts/RegisterAccountRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,11 @@ public string Phone
set;
}

[JsonProperty("provider_id")]
public string ProviderId
{
get;
set;
}
}
}
2 changes: 2 additions & 0 deletions MetacoClient/MetacoClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ public RestClient(Uri apiUrl, string apiId, string apiKey, bool testingMode)
/// Register an account on Metaco
/// Sends an SMS to the provided phone number
/// If you are in debug mode, this request will return a HTTP header X-Metaco-DebugData with the validation code, it won't be send by SMS
///
/// If you are a wallet registering accounts for your clients, don't forget to set the provider_id with your Name/ID.
/// </summary>
/// <param name="request">The request containing the phone number.</param>
/// <returns>The initial account settings</returns>
Expand Down
4 changes: 2 additions & 2 deletions MetacoClient/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.8.3.0")]
[assembly: AssemblyFileVersion("0.8.3.0")]
[assembly: AssemblyVersion("0.8.4.0")]
[assembly: AssemblyFileVersion("0.8.4.0")]

0 comments on commit 1273f1e

Please sign in to comment.