public async Task When_a_wrong_merchant_id_is_sent_then_the_transaction_should_fail() { var idinUrl = new Uri("https://idintest.rabobank.nl/bvn-idx-bankid-rs/bankidGateway"); var client = new IdinClient( idinUrl, () => certificateStore.GetCertificate( "BC2262A6F2E6DB3A63138A167A0E2AA114E2E3AD", false), () => new List <X509Certificate2> { certificateStore.GetCertificate( "ad96a0ce00209e56f536f0e017415e68460b2b22", false), }, () => new List <X509Certificate2> { certificateStore.GetCertificate( "4CC9A1382521DA468F657191EA9B6B996EFFFCF8", false), }, "Test"); var idinResult = await client.GetIssuersAsync( new GetIssuersSettings { SubId = 0, }); idinResult.HasError.Should().BeTrue(); idinResult.ErrorDetails.ErrorMessage.Should().Contain("Value too short"); }
private static IdinClient CreateIdinClient() { var certificateStore = new CertificateStore(); var idinUrl = new Uri("https://idintest.rabobank.nl/bvn-idx-bankid-rs/bankidGateway"); var client = new IdinClient( idinUrl, () => certificateStore.GetCertificate( "BC2262A6F2E6DB3A63138A167A0E2AA114E2E3AD", false), () => new List <X509Certificate2> { certificateStore.GetCertificate( "ad96a0ce00209e56f536f0e017415e68460b2b22", false), }, () => new List <X509Certificate2> { certificateStore.GetCertificate( "4CC9A1382521DA468F657191EA9B6B996EFFFCF8", false), }, "0020000012"); return(client); }
private static async Task <TransactionResult> SendTransactionRequestAsync( IdinClient client, string entranceCode, ServiceIds serviceIds) { var merchantReference = MerchantReference; var dirRes = await client.GetIssuersAsync( new GetIssuersSettings { SubId = 0 }); var issuerId = dirRes.Issuers[0].IssuerId; var returnUrl = new Uri("http://localhost/"); return(await client.InitiateTransactionAsync( new InitiateTransactionSettings { IssuerId = issuerId, ReturnUrl = returnUrl, MerchantReference = merchantReference, EntranceCode = entranceCode, ServiceIds = serviceIds, Language = "nl", SubId = 0, })); }