NBluem 1.0.3

dotnet add package NBluem --version 1.0.3
NuGet\Install-Package NBluem -Version 1.0.3
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NBluem" Version="1.0.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add NBluem --version 1.0.3
#r "nuget: NBluem, 1.0.3"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install NBluem as a Cake Addin
#addin nuget:?package=NBluem&version=1.0.3

// Install NBluem as a Cake Tool
#tool nuget:?package=NBluem&version=1.0.3

NBluem

NuGet

NBluem is a .NET-library that enables usage of the Bluem payment provider.

Usage

Basic example

using System;
using System.Security.Cryptography.X509Certificates;
using NBluem.Net;
using NBluem.Net.Request;
using NBluem.Net.Request.Factory;
using NBluem.Net.RequestTypes;
using NBluem.Net.Response;
using NBluem.Security;
using NBluem.Structure.Net.Response;
using NBluem.ValueObjects;
using NLog;

namespace NBluem
{
    public class TestClass
    {
        public BluemTransactionResponse DoTest()
        {
            // Create certificate store that contains your Bluem certificate
            var store = new X509Store(StoreName.My, StoreLocation.LocalMachine);

            // Create a logger
            var logger = new LogFactory().GetCurrentClassLogger(typeof(TestClass));

            // Create the signage object to sign your request to Bluem
            var signage = new Signage(store, logger);

            // Create a new request via the BluemRequestFactory, for instance a payment request
            var paymentRequest = new BluemRequestFactory().CreateRequest(
                new BluemPaymentRequestType()) as IBluePaymentRequest;

            // Add some data to the payment request
            paymentRequest.AddPaymentData(
                new EntranceCode(),             // A unique entrance code
                "paymentReference",             // Your unique payment-reference
                "debtorReference",              // A unique debtor-reference
                "My description",               // A short description
                12.34,                          // The payment amount
                DateTime.Today.AddDays(10));    // The due datetime for the payment request

            // Create a new Bluem-client to handle the request
            BluemClient client = new BluemClient(logger);

            // Sign the actual request
            var signedRequest = signage.SignRequest(paymentRequest);

            // Send the signed request
            var response = (BluemTransactionResponse) client.SendRequest(signedRequest);

            // Return the actual response
            return response;
        }
    }
}

Install certificate

All communication between your application and Bluem is encrypted via a certificate which can be obtained from Bluem.

Configuration

Add the following NBluem configuration section to your web.config:

<configSections>
    ...
    <section name="NBluem.BluemConfiguration" type="NBluem.Configuration.BluemConfiguration"/>
</configSections>

Configuration example:

<NBluem.BluemConfiguration
    
    CertificateThumbprint="n533t2mguoq8mkneetdvch2x2dnjx37zullns738"
    Fingerprint="E823B6A6AFC5B06E5F9C6B02936764BA80B3A1347948EE876E186A0232B643BF"
    SenderId="S1234"
    ReturnUrl="https://return.to.me"
    
    PaymentRequestUri="https://test.viamijnbank.net/pr/createTransaction"
    PaymentStatusUri="https://test.viamijnbank.net/pr/requestTransactionStatus"
    BrandId="IDEAL"
    SkinId="PayRequest"
    Currency="EUR"
    DumpReports="false"
    HashSalt="BluemDefaultHashSalt"
    HashLength="16"
    
></NBluem.BluemConfiguration>

Parameters

Mandatory

CertificateThumbprint
Type: string
Format: 40-character alphanumeric string ([0-9a-z]{40})

The certificate thumbprint as it is registered in the Windows Certificate Store.

Fingerprint
Type: string
Format: 64-character alphanumeric string ([0-9A-Za-z]{64})

The certificate fingerprint as it is generated by OpenSSL

SenderId
Type: string

The unique client ID as agreed by Bluem

ReturnUrl
Type: string
Format: Basic URL-encoded URI

The URL where the paymentrequest is redirected to upon registering the payment. The URL can contain optional format parameters that are automatically replaced with data from the request. The possible parameters are:

  • entranceCode
  • paymentReference
  • debtorReference

So for instance, the following ReturnUrl can be constructed:

ReturnUrl="https://return.to.me/?ec={entranceCode}&pr={paymentReference}&dr={debtorReference}"

Which will result in something like:

GET https://return.to.me/?ec=123abc&pr=456def&dr=789ghi

Optional

PaymentRequestUri
Type: string
Format: Basic URL-encoded URI
Default: https://viamijnbank.net/pr/createTransaction

The URI which is used to create a new payment transaction.

PaymentStatusUri
Type: string
Format: Basic URL-encoded URI
Default: https://viamijnbank.net/pr/requestTransactionStatus

The URI which is used to create a new payment status transaction.

BrandId
Type: string
Default: IDEAL

The prefered method of payment.

SkinId
Type: string
Default: PayRequest

The skin that is used on the payment page as it is set in Bluem.

Currency
Type: string
Format: 3-character string
Default: EUR

The currency which is used on your payment-page.

DumpReports
Type: boolean
Default: false

Get a complete dump of the request as it being build-up and sent to Bluem for debugging purposes.

HashSalt
Type: string
Default: BluemDefaultHashSalt

The salt that is used to generate an EntranceCode for each request that's being sent to Bluem.

HashLength
Type: integer
Default: 16

The length of the hash that is used as an EntranceCode.

Product Compatible and additional computed target framework versions.
.NET Framework net45 is compatible.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.3 1,010 6/15/2018