public async void Example() { #pragma warning disable 0168 using (Client client = GetClient()) { BankAccountBban bankAccountBban = new BankAccountBban(); bankAccountBban.AccountNumber = "0532013000"; bankAccountBban.BankCode = "37040044"; bankAccountBban.CountryCode = "DE"; AmountOfMoney amountOfMoney = new AmountOfMoney(); amountOfMoney.Amount = 100L; amountOfMoney.CurrencyCode = "EUR"; Address billingAddress = new Address(); billingAddress.CountryCode = "US"; CustomerRiskAssessment customer = new CustomerRiskAssessment(); customer.BillingAddress = billingAddress; customer.Locale = "en_US"; OrderRiskAssessment order = new OrderRiskAssessment(); order.AmountOfMoney = amountOfMoney; order.Customer = customer; RiskAssessmentBankAccount body = new RiskAssessmentBankAccount(); body.BankAccountBban = bankAccountBban; body.Order = order; RiskAssessmentResponse response = await client.Merchant("merchantId").Riskassessments().Bankaccounts(body); } #pragma warning restore 0168 }
/// <summary> /// Resource /{merchantId}/riskassessments/bankaccounts /// <a href="https://developer.globalcollect.com/documentation/api/server/#__merchantId__riskassessments_bankaccounts_post">Risk-assess bank account</a> /// </summary> /// <param name="body">RiskAssessmentBankAccount</param> /// <param name="context">CallContext</param> /// <returns>RiskAssessmentResponse</returns> /// <exception cref="ValidationException">if the request was not correct and couldn't be processed (HTTP status code BadRequest)</exception> /// <exception cref="AuthorizationException">if the request was not allowed (HTTP status code Forbidden)</exception> /// <exception cref="IdempotenceException">if an idempotent request caused a conflict (HTTP status code Conflict)</exception> /// <exception cref="ReferenceException">if an object was attempted to be referenced that doesn't exist or has been removed, /// or there was a conflict (HTTP status code NotFound, Conflict or Gone)</exception> /// <exception cref="GlobalCollectException">if something went wrong at the GlobalCollect platform, /// the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, /// or the service that you're trying to reach is temporary unavailable (HTTP status code InternalServerError, BadGateway or ServiceUnavailable)</exception> /// <exception cref="ApiException">if the GlobalCollect platform returned any other error</exception> public async Task <RiskAssessmentResponse> Bankaccounts(RiskAssessmentBankAccount body, CallContext context = null) { string uri = InstantiateUri("/{apiVersion}/{merchantId}/riskassessments/bankaccounts", null); try { return(await _communicator.Post <RiskAssessmentResponse>( uri, ClientHeaders, null, body, context)); } catch (ResponseException e) { object errorObject; switch (e.StatusCode) { default: errorObject = _communicator.Marshaller.Unmarshal <ErrorResponse>(e.Body); break; } throw CreateException(e.StatusCode, e.Body, errorObject, context); } }
public async Task Test() { RiskAssessmentBankAccount body = new RiskAssessmentBankAccount(); BankAccountBban bankAccountBban = new BankAccountBban(); bankAccountBban.CountryCode = ("DE"); bankAccountBban.AccountNumber = ("0532013000"); bankAccountBban.BankCode = ("37040044"); body.BankAccountBban = (bankAccountBban); OrderRiskAssessment order = new OrderRiskAssessment(); AmountOfMoney amountOfMoney = new AmountOfMoney(); amountOfMoney.Amount = (100L); amountOfMoney.CurrencyCode = ("EUR"); order.AmountOfMoney = (amountOfMoney); CustomerRiskAssessment customer = new CustomerRiskAssessment(); customer.Locale = ("en_GB"); order.Customer = (customer); body.Order = (order); using (Client client = GetClient()) { RiskAssessmentResponse riskAssessmentResponse = await client .Merchant(GetMerchantId()) .Riskassessments() .Bankaccounts(body); Assert.That(riskAssessmentResponse.Results, Is.Not.Empty); } }