Sample code: Web Services 

 

Below you can find examples of how to register and authorize a payment using Web Services interface (WCF). In this page, you can also download sample codes to help your Web Services implementation. The examples assume you have added the WSDL to your project with the namespace BBS.

Please note that below mentioned calls are meant to be only examples and shouldn’t be used as such.  For example [MERCHANTID] and [TOKEN] in the examples need to be replaced for the values provided by Nets. In addition, a unique value needs to be generated for each transaction in the TransactionId tag. After the registration phase, you should refer to this unique value in all later operations for this transaction.

 

Step 1: Register payment

Merchant sends the Register call to Netaxept:

// Create the Netaxept client and make the Register call

BBS.NetaxeptClient client = new TestNetaxept.BBS.NetaxeptClient();
BBS.RegisterResponse response = client.Register([MERCHANTID], [TOKEN],
              new BBS.RegisterRequest
              {
                  Order = new Order
                  {
                      Amount = "1000",
                      OrderNumber = "12345",
                      CurrencyCode = "EUR"
                  },
                  Terminal = new Terminal
                  {
                      RedirectUrl = "http://localhost/Test/"
                  },
                  Environment = new Environment {
                      WebServicePlatform = "WCF"
                  }
              });

Merchant receives the RegisterResponse from Netaxept:

Please find the transaction ID in the element response.TransactionId.

 

Step 2: Authorize payment

Merchant sends the Process (AUTH) call to Netaxept:

// Make the authorization for the payment

BBS.NetaxeptClient client = new TestNetaxept.BBS.NetaxeptClient();
var authres = client.Process([MERCHANT_ID], [TOKEN],
                new ProcessRequest
                {
                    Operation = "AUTH",
                    TransactionId = [TRANSACTION_ID]
                });

Merchant receives the ProcessResponse from Netaxept:

Please find the transaction ID in the element response.TransactionId.

 

Below you can download sample code for the Web Services implementation: