diff --git a/README.md b/README.md index 57fed72..4fdd3c7 100644 --- a/README.md +++ b/README.md @@ -3291,6 +3291,41 @@ Console.WriteLine(response); ``` +#### Add Gateway Merchant + + + +* **API Credential Types:** Partner +* **Required Role:** Gateway Boarding + +This is a partner level API that can be used to manually board gateway merchants. Use this API in conjunction +with Platform Configuration to instantly board gateway merchants. Note that most partners don't have +permission to do this and are unlikely to get it. + +Settings can be changed by using the Update Merchant API. + + + + +```c# +// Populate request parameters. +AddGatewayMerchantRequest request = new AddGatewayMerchantRequest +{ + Profile = new MerchantProfile + { + DbaName = "DBA Name", + CompanyName = "Corporate Entity Name", + }, +}; + +// Run the transaction. +MerchantProfileResponse response = await blockchyp.AddGatewayMerchantAsync(request); + +// View the result. +Console.WriteLine(response); + +``` + #### Add Test Merchant diff --git a/src/BlockChyp/Client/BlockChypClient.cs b/src/BlockChyp/Client/BlockChypClient.cs index 1ccf208..df24aea 100644 --- a/src/BlockChyp/Client/BlockChypClient.cs +++ b/src/BlockChyp/Client/BlockChypClient.cs @@ -1051,6 +1051,25 @@ public Acknowledgement InviteMerchantUser(InviteMerchantUserRequest request) return DashboardRequest(HttpMethod.Post, "/api/invite-merchant-user", request, null); } + /// + /// Adds a live gateway merchant account. + /// + /// The request details. + public async Task AddGatewayMerchantAsync(AddGatewayMerchantRequest request) + { + return await DashboardRequestAsync(HttpMethod.Post, "/api/add-gateway-merchant", request, null) + .ConfigureAwait(false); + } + + /// + /// Synchronous form of . + /// + /// The request details. + public MerchantProfileResponse AddGatewayMerchant(AddGatewayMerchantRequest request) + { + return DashboardRequest(HttpMethod.Post, "/api/add-gateway-merchant", request, null); + } + /// /// Adds a test merchant account. /// diff --git a/src/BlockChyp/Entities/AddGatewayMerchantRequest.cs b/src/BlockChyp/Entities/AddGatewayMerchantRequest.cs new file mode 100644 index 0000000..d6454ee --- /dev/null +++ b/src/BlockChyp/Entities/AddGatewayMerchantRequest.cs @@ -0,0 +1,34 @@ +// Copyright 2019-2024 BlockChyp, Inc. All rights reserved. Use of this code is +// governed by a license that can be found in the LICENSE file. +// +// This file was generated automatically by the BlockChyp SDK Generator. Changes +// to this file will be lost every time the code is regenerated. + +using Newtonsoft.Json; + +namespace BlockChyp.Entities +{ + /// + /// Models basic information needed to create a gateway merchant. + /// + public class AddGatewayMerchantRequest : BaseEntity, ITimeoutRequest + { + /// + /// Whether or not to route transaction to the test gateway. + /// + [JsonProperty(PropertyName = "test")] + public bool Test { get; set; } + + /// + /// The merchant profile to be boarded. + /// + [JsonProperty(PropertyName = "profile")] + public MerchantProfile Profile { get; set; } + + /// + /// The request timeout in seconds. + /// + [JsonProperty(PropertyName = "timeout")] + public int Timeout { get; set; } + } +} diff --git a/src/BlockChyp/Entities/MerchantCredentialGenerationRequest.cs b/src/BlockChyp/Entities/MerchantCredentialGenerationRequest.cs index 344b83d..d81904e 100644 --- a/src/BlockChyp/Entities/MerchantCredentialGenerationRequest.cs +++ b/src/BlockChyp/Entities/MerchantCredentialGenerationRequest.cs @@ -49,5 +49,11 @@ public class MerchantCredentialGenerationRequest : BaseEntity, ITimeoutRequest /// [JsonProperty(PropertyName = "notes")] public string Notes { get; set; } + + /// + /// Type of credentials to generate, either API or TOKENIZING. Defaults to API. + /// + [JsonProperty(PropertyName = "credentialType")] + public string CredentialType { get; set; } } } diff --git a/src/BlockChyp/Entities/MerchantCredentialGenerationResponse.cs b/src/BlockChyp/Entities/MerchantCredentialGenerationResponse.cs index 0fbb3b3..ab92bfc 100644 --- a/src/BlockChyp/Entities/MerchantCredentialGenerationResponse.cs +++ b/src/BlockChyp/Entities/MerchantCredentialGenerationResponse.cs @@ -48,5 +48,11 @@ public class MerchantCredentialGenerationResponse : BaseEntity, IAbstractAcknowl /// [JsonProperty(PropertyName = "signingKey")] public string SigningKey { get; set; } + + /// + /// The tokenizing key. + /// + [JsonProperty(PropertyName = "tokenizingKey")] + public string TokenizingKey { get; set; } } } diff --git a/src/BlockChyp/Entities/MerchantProfile.cs b/src/BlockChyp/Entities/MerchantProfile.cs index b2f2466..8a19325 100644 --- a/src/BlockChyp/Entities/MerchantProfile.cs +++ b/src/BlockChyp/Entities/MerchantProfile.cs @@ -32,6 +32,12 @@ public class MerchantProfile : BaseEntity, ITimeoutRequest [JsonProperty(PropertyName = "merchantId")] public string MerchantId { get; set; } + /// + /// The primary bank mid. + /// + [JsonProperty(PropertyName = "bankMid")] + public string BankMid { get; set; } + /// /// The merchant's company name. /// diff --git a/src/BlockChyp/Entities/MerchantProfileResponse.cs b/src/BlockChyp/Entities/MerchantProfileResponse.cs index 83594a6..81f146b 100644 --- a/src/BlockChyp/Entities/MerchantProfileResponse.cs +++ b/src/BlockChyp/Entities/MerchantProfileResponse.cs @@ -44,6 +44,12 @@ public class MerchantProfileResponse : BaseEntity, IAbstractAcknowledgement [JsonProperty(PropertyName = "merchantId")] public string MerchantId { get; set; } + /// + /// The primary bank mid. + /// + [JsonProperty(PropertyName = "bankMid")] + public string BankMid { get; set; } + /// /// The merchant's company name. /// diff --git a/src/BlockChyp/Entities/UpdateMerchantPlatformRequest.cs b/src/BlockChyp/Entities/UpdateMerchantPlatformRequest.cs new file mode 100644 index 0000000..6ff8a05 --- /dev/null +++ b/src/BlockChyp/Entities/UpdateMerchantPlatformRequest.cs @@ -0,0 +1,34 @@ +// Copyright 2019-2024 BlockChyp, Inc. All rights reserved. Use of this code is +// governed by a license that can be found in the LICENSE file. +// +// This file was generated automatically by the BlockChyp SDK Generator. Changes +// to this file will be lost every time the code is regenerated. + +using Newtonsoft.Json; + +namespace BlockChyp.Entities +{ + /// + /// Used to up platform configuration for gateway merchants. + /// + public class UpdateMerchantPlatformRequest : BaseEntity, ITimeoutRequest + { + /// + /// The request timeout in seconds. + /// + [JsonProperty(PropertyName = "timeout")] + public int Timeout { get; set; } + + /// + /// Whether or not to route transaction to the test gateway. + /// + [JsonProperty(PropertyName = "test")] + public bool Test { get; set; } + + /// + /// The merchant platform configuration. + /// + [JsonProperty(PropertyName = "platform")] + public MerchantPlatform Platform { get; set; } + } +} diff --git a/src/BlockChyp/Entities/UpdateMerchantPlatformResponse.cs b/src/BlockChyp/Entities/UpdateMerchantPlatformResponse.cs new file mode 100644 index 0000000..3da685a --- /dev/null +++ b/src/BlockChyp/Entities/UpdateMerchantPlatformResponse.cs @@ -0,0 +1,40 @@ +// Copyright 2019-2024 BlockChyp, Inc. All rights reserved. Use of this code is +// governed by a license that can be found in the LICENSE file. +// +// This file was generated automatically by the BlockChyp SDK Generator. Changes +// to this file will be lost every time the code is regenerated. + +using Newtonsoft.Json; + +namespace BlockChyp.Entities +{ + /// + /// Echoes back the state of the current platform configuration after a change. + /// + public class UpdateMerchantPlatformResponse : BaseEntity, IAbstractAcknowledgement + { + /// + /// Whether or not the request succeeded. + /// + [JsonProperty(PropertyName = "success")] + public bool Success { get; set; } + + /// + /// The error, if an error occurred. + /// + [JsonProperty(PropertyName = "error")] + public string Error { get; set; } + + /// + /// A narrative description of the transaction result. + /// + [JsonProperty(PropertyName = "responseDescription")] + public string ResponseDescription { get; set; } + + /// + /// The current platform configuration. + /// + [JsonProperty(PropertyName = "platform")] + public MerchantPlatform Platform { get; set; } + } +} diff --git a/tests/BlockChypTest/Integration/AddGatewayMerchantTest.cs b/tests/BlockChypTest/Integration/AddGatewayMerchantTest.cs new file mode 100644 index 0000000..2270b26 --- /dev/null +++ b/tests/BlockChypTest/Integration/AddGatewayMerchantTest.cs @@ -0,0 +1,64 @@ +// Copyright 2019-2024 BlockChyp, Inc. All rights reserved. Use of this code is +// governed by a license that can be found in the LICENSE file. +// +// This file was generated automatically by the BlockChyp SDK Generator. Changes +// to this file will be lost every time the code is regenerated. + +using System; +using System.Collections.Generic; +using System.IO; +using BlockChyp.Entities; +using Xunit; +using Xunit.Abstractions; + +namespace BlockChypTest.Integration +{ + public class AddGatewayMerchantTest : IntegrationTest + { + private readonly ITestOutputHelper output; + + public AddGatewayMerchantTest(ITestOutputHelper output) + { + this.output = output; + } + + [Trait("Category", "partner")] + [Trait("Category", "Integration")] + [Fact] + public async void Run_AddGatewayMerchantTest() + { + + + + UseProfile("partner"); + + + AddGatewayMerchantRequest request = new AddGatewayMerchantRequest + { + Profile = new MerchantProfile + { + DbaName = "DBA Name", + CompanyName = "Corporate Entity Name", + }, + }; + + output.WriteLine("Request: {0}", request); + + Exception err = null; + try + { + MerchantProfileResponse response = await blockchyp.AddGatewayMerchantAsync(request); + output.WriteLine("Response: {0}", response); + Assert.True(response.Success, "response.Success"); + } + catch (Exception e) { + err = e; + } + + + Assert.Null(err); + + + } + } +}