Commission Based Affiliate Model
In this model, the main merchant owns the product/service and processes the full transaction. Affiliates help generate sales and receive a commission, but they do not handle turnover.
Typical use cases include:
- Affiliate referrals (ads, links, blogs)
- Operational support (e.g., logistics, raw materials)
Main merchant is liable for:
- Generating invoice
- Capturing/cancelling
- Refunds
How the Commission-Based Model Is Technically Achieved
All turnover is tied to the main merchant. Commission is calculated using affiliate.subvendors and affiliate.commission_type
Percentage Commission Example:
"transaction.amount": "2500",
"affiliate.subvendors": {
"2261": "2",
"2271": "3"
},
"affiliate.commission_type": "percentage"Fixed Commission Example:
"transaction.amount": "2500",
"affiliate.subvendors": {
"2261": "100",
"2271": "200"
},
"affiliate.commission_type": "amount"Setup Locations in Admin Portal:
- Project-level commission is not applicable
- Must be defined dynamically in every transaction
Cost Sharing
Payment gateway costs (e.g., transaction fee, fraud module fee) are:
- Default: 100% borne by marketplace
- Can be customized per affiliate or entire project
Run a Sample Request
The following sample includes only the essential parameters required for demonstration and explanation purposes. For a complete list of all available parameters, along with their descriptions, header information, and result details, please refer to the links below:
- For Hosted Payment Page integration, see the full parameter reference >>here<< .
- For Direct API integration, see the full parameter reference >>here<< .
<?php
// Need to enter your payment access key value here
$payment_access_key = '###YOUR_PAYMENT_ACCESS_KEY###';
// Now, have to encode the $payment_access_key value with the base64 encode
$encoded_data = base64_encode($payment_access_key);
// Action Endpoint
$endpoint = 'https://payport.novalnet.de/v2/payment';
// Build the Headers array
$headers = [
// The Content-Type should be "application/json"
'Content-Type:application/json',
// The charset should be "utf-8"
'Charset:utf-8',
// Optional
'Accept:application/json',
// The formed authenticate value (case-sensitive)
'X-NN-Access-Key:' . $encoded_data
];
$data = [];
// Build Merchant Data
$data['merchant'] = [
// Your API signature value
'signature' => '###YOUR_API_SIGNATURE###',
// Your corresponding tariff ID
'tariff' => '###YOUR_TARIFF_ID###'
];
// Build Customer Data
$data['customer'] = [
// Shopper's first name
'first_name' => 'Max',
// Shopper's last name
'last_name' => 'Mustermann',
// Shopper's email
'email' => '###YOUR_MAIL###',
// Shopper's Ip address
'customer_ip' => '###CUSTOMER_IP###',
// Shopper's customer number from the shop
'customer_no' => '###CUSTOMER_NUMBER###',
// Shopper's Telephone number
'tel' => '+49 089 123456',
// Shopper's Mobile number
'mobile' => '+49 174 7781423',
// Shopper's birthdate value YYYY-MM-DD - Decomment it based on your usage
// 'birth_date' => '1992-06-10',
// Shopper's gender - Decomment it based on your usage
// 'gender' => 'u',
// Shopper's company vat ID value - Decomment it based on your usage
// 'vat_id' => 'DE123456',
// Shopper's company regestration number - Decomment it based on your usage
// 'reg_no' => 'HRB1234',
// Shopper's company tax ID value - Decomment it based on your usage
// 'tax_id' => '123/123/123',
// Shopper's session value - Decomment it based on your usage
// 'session' => 'fedgrgst5653653hdgfsvgdsf622627e',
// Shopper's fax number - Decomment it based on your usage
// 'fax' => '+49 89 654321',
// Use of minimal customer data
//'no_nc' => '1',
// Shopper's billing address
'billing' => [
// House number
'house_no' => '2',
// Street
'street' => 'Musterstr',
// City
'city' => 'Musterhausen',
// zip
'zip' => '12345',
// Country's ISO code
'country_code' => 'DE',
// Name of the company - Decomment it based on your usage
// 'company' => 'ABC GmbH',
// State
//'state' => 'Berlin'
],
/*
// Optional child object - Decomment it based on your usage
'shipping' => [
// Pass this parameter if the billing and the shipping address are identical
'same_as_billing' => '1',
// First name
'first_name' => 'Norbert',
// Last name
'last_name' => 'Maier',
// Email
'email' => 'test@novalnet.de',
// Street
'street' => 'Hauptstr',
// House number
'house_no' => '9',
// City
'city' => 'Kaiserslautern',
// zip
'zip' => '66862',
// Country's ISO code
'country_code' => 'DE',
// Name of the company
'company' => 'A.B.C. Ger�stbau GmbH',
// Telephone number
'tel' => '+49 089 123456',
// Mobile number
'mobile' => '+49 174 7781423',
// State
'state' => 'Berlin'
]
*/
];
// Build Transaction Data
$data['transaction'] = [
// The mode of the transaction
'test_mode' => '###TEST_MODE###',
// The Payment type of the transaction
'payment_type' => 'CREDITCARD',
// The transaction Amount in smaller currency unit
'amount' => '###TRANSACTION_AMOUNT###',
// The transaction currency's ISO code
'currency' => '###TRANSACTION_CURRENCY###',
// The order number of the transaction
'order_no' => '###TRANSACTION_ORDER_NUMBER###',
// The Hook URL value for this particular transaction
'hook_url' => '###YOUR_HOOK_URL###',
// The flag to create the token for the payment data - Decomment it based on your usage
'create_token' => 1,
// The invoice number related to your customer`s invoice of the order.
//'invoice_no' => '###INVOICE_NO###',
// The reference related to your customer`s invoice of the order.
//'invoice_ref' => '###INVOICE_REF###',
// Processing the transaction with SCA authentication
//'enforce_3d' => '1',
//'verify_payment_data' => '1',
//'call_n_pay' => '1',
//'dynamic_descriptor' => 'www.yourshop.com',
// Build Payment Data
'payment_data' => [
'pan_hash' => '###PAN_HASH###',
'unique_id' => '###UNIQUE_ID###'
]
];
/*
// Subscription Data, used for processing Novalnet`s subscription - Optional object - Decomment it based on your usage
$data['subscription'] = [
// The interval between each cycle
'interval' => '1m',
// Subscription trial interval if applicable
'trial_interval' => '3m',
// Subscription trial interval amount if applicable
'trial_amount' => '150'
// Subscription expiry date
//'expiry_date' => 'YYYY-MM-DD'
];
// Instalment data
$data['instalment'] = [
// The interval between each cycle
'interval' => '1m',
// Total number of cycles
'cycles' => '2'
];
// Marketplace data
$data['marketplace'] = [
// To submit amount for several affiliates to be booked
'tx_split' => [
'2261' => '100',
'2271' => '120'
],
// Commission type for the corresponding affiliates
'commission_split' => [
'2261' => [
'percentage' => '100',
'amount' => '700',
],
'2271' => [
'percentage' => '97'
]
]
];
// Affiliate Data
$data['affiliate'] = [
// To submit shares for several affiliates for the same transaction
'subvendors'=> [
'2261' => '100',
'2271' => '120'
],
// Commission type for several affiliates for the same transaction
//'commission_type'=> 'amount'
];
// Invoicing Data
$data['invoicing'] = [
// Total amount (excl. tax) should be mentioned here
'net_amount' => 5000,
// Total amount (incl. tax) should be mentioned here
'gross_amount' => 5000,
// Overall invoice tax percent should be mentioned here
'tax_percent' => 2,
// Overall invoice tax amount should be mentioned here
'tax_amount' => 2,
// Discount coupon percentage should be mentioned here
//'coupon_percent' => 1,
// Discount coupon amount should be mentioned here
//'coupon_amount' => 10,
// Individual product details should be mentioned here
'product_details' => [
[
//'code' => 'P001',
'name' => 'Product name',
//'group' => 'Product group',
//'description' => 'Product description',
'unit' => 2,
'quantity' => 2,
'unit_price' => 100,
'total_price' => 200,
'tax_amount' => 1,
'tax_percent' => 1,
//'discount' => 0,
//'note' => 'Note about the product'
]
],
// The notification which you wants to provide to the end-customer in invoice PDF.
'notice' => [
'1' => 'Notice 1',
'2' => 'Notice 2',
'3' => 'Notice 3'
],
// Customize the customer support details here
//'customer_support' => 'Max Mustermann | Email: support@yourshop.de',
// Custom Invoice number
//'custom_invoice_no' => 'INV-32',
// Send the invoice pdf to end customer
'send_invoice_pdf' => '1'
];
*/
// Custom Data - Optional object
$data['custom'] = [
// Shopper's selected language in shop
"lang" => "EN",
// Custom parameter's key - Optional object - Decomment it based on your usage
// 'input1' => 'your internal reference parameter name',
// Custom parameter's value - Optional object - Decomment it based on your usage
// 'inputval1' => 'your internal reference parameter value'
];
// Convert the array to JSON string
$json_data = json_encode($data);
// Handle Response
$response = send_request($json_data, $endpoint, $headers);
function send_request($data, $url, $headers) {
// Initiate cURL
$curl = curl_init();
// Set the url
curl_setopt($curl, CURLOPT_URL, $url);
// Set the result output to be a string
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
// Set the POST value to true (mandatory)
curl_setopt($curl, CURLOPT_POST, true);
// Set the post fields
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
// Set the headers
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
// Execute cURL
$result = curl_exec($curl);
// Handle cURL error
if (curl_errno($curl)) {
echo 'Request Error:' . curl_error($curl);
return $result;
}
// Close cURL
curl_close($curl);
// Decode the JSON string
$result = json_decode($result);
return $result;
}
?>
curl --location --request POST 'https://payport.novalnet.de/v2/payment' -H 'Content-Type: application/json' -H 'Charset:utf-8' -H 'Accept: application/json' -H 'X-NN-Access-Key: ###YOUR_ENCODED_PAYMENT_ACCESS_KEY###' -d '{"merchant":{"signature":"###YOUR_API_SIGNATURE###","tariff":"###YOUR_TARIFF_ID###"},"customer":{"first_name":"Max","last_name":"Mustermann","email":"###YOUR_MAIL###","tel":"+49 089 123456","mobile":"+49 174 7781423","billing":{"company":"ABC GmbH","house_no":"2","street":"Musterstr","city":"Musterhausen","zip":"12345","country_code":"DE","state":"Berlin"},"customer_ip":"###CUSTOMER_IP###","birth_date":"1992-06-10"},"transaction":{"test_mode":"###TEST_MODE###","payment_type":"CREDITCARD","amount":"###TRANSACTION_AMOUNT###","currency":"###TRANSACTION_CURRENCY###","order_no":"###TRANSACTION_ORDER_NUMBER###","hook_url":"###YOUR_HOOK_URL###","create_token":"1","payment_data":{"pan_hash":"###PAN_HASH###","unique_id":"###UNIQUE_ID###"}},"custom":{"lang":"EN"}}';
#!/usr/bin/node
const https = require('https');
// data sent in the body of the request
const postData = JSON.stringify({
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
//"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
"customer_ip": "###CUSTOMER_IP###",
//"customer_no": "###CUSTOMER_NUMBER###",
"birth_date": "1992-06-10",
//"tel": "+49 089 123456",
//"mobile": "+49 089 123456",
//"fax": "+49 89 654321",
/*
"shipping": {
"same_as_billing": "1",
"city": "Kaiserslautern",
"company": "A.B.C. Ger�stbau GmbH",
"country_code": "DE",
"email": "test@novanet.de",
"first_name": "Norbert",
"house_no": "9",
"last_name": "Maier",
"mobile": "+491747781423",
"state": "Berlin",
"street": "Hauptstr",
"tel": "+49 089 123456",
"zip": "66862"
},
*/
//"vat_id": "DE123456",
//"tax_id": "123/123/123",
//"reg_no": "HRB1234",
//"session": "fedgrgst5653653hdgfsvgdsf622627e",
//"no_nc": "1"
},
"transaction": {
"test_mode": "###TEST_MODE###",
"payment_type": "CREDITCARD",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"hook_url": "###YOUR_HOOK_URL###",
"create_token": "1",
/*
"invoice_ref": "###INVOICE_REF###",
"invoice_no": "###INVOICE_NO###",
'enforce_3d': '1',
'verify_payment_data': '1',
'call_n_pay': '1',
"dynamic_descriptor": "www.yourshop.com",
*/
"payment_data": {
"pan_hash": "###PAN_HASH###",
"unique_id": "###UNIQUE_ID###"
}
},
/*
"subscription": {
"interval": "2m",
"trial_interval": "3m",
"trial_amount": "150",
"expiry_date": "YYYY-MM-DD"
},
"instalment": {
"interval": "2m",
"cycles": "2"
},
"marketplace": {
"tx_split": {
"2261": "100",
"2271": "120"
},
"commission_split": {
"2261": {
"percentage": "100",
"amount": "700"
},
"2271": {
"percentage": "97"
}
}
},
"affiliate": {
"subvendors": {
"2261": "100",
"2271": "120"
},
//"commission_type": "amount"
},
"invoicing": {
"net_amount": 5000,
"gross_amount": 5000,
"tax_percent": 2,
"tax_amount": 2,
//"coupon_percent": 1,
//"coupon_amount": 10,
"product_details": [
{
//"code": "P001",
"name": "Product name",
//"group": "Product group",
//"description": "Product description",
"quantity": 2,
"unit": 2,
"unit_price": 100,
"total_price": 200,
"tax_amount": 1,
"tax_percent": 1,
//"discount": 0,
//"note": "Note about the product"
}
],
"notice": {
"1": "Notice 1",
"2": "Notice 2",
"3": "Notice 3"
},
//"customer_support": "Max Mustermann | Email: support@yourshop.de",
//"custom_invoice_no": "INV-32",
"send_invoice_pdf": "1"
},
*/
"custom": {
"lang": "EN",
//'input1': 'your internal reference parameter name',
//'inputval1': 'your internal reference parameter value',
}
});
const options = {
hostname: 'payport.novalnet.de',
port: 443,
path: '/v2/payment',
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(postData),
'Charset': 'utf-8',
'Accept': 'application/json',
'X-NN-Access-Key': '###YOUR_ENCODED_PAYMENT_ACCESS_KEY###'
},
};
const req = https.request(options, (res) => {
console.log('statuscode:', res.statuscode);
// console.log('headers:', res.headers);
res.on('data', (d) => {
process.stdout.write(d);
});
});
req.on('error', (e) => {
console.error('ERROR: ',e);
});
// Write data to request body
req.write(postData);
req.end();
#!/usr/bin/python3
import http.client
import json
CONN = http.client.HTTPSConnection("payport.novalnet.de")
PAYLOAD = json.dumps({
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
#"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
"customer_ip": "###CUSTOMER_IP###",
#"customer_no": "###CUSTOMER_NUMBER###",
"birth_date": "1992-06-10",
#"tel": "+49 089 123456",
#"mobile": "+49 089 123456",
#"fax": "+49 89 654321",
#"shipping": {
#"same_as_billing": "1",
#"city": "Kaiserslautern",
#"company": "A.B.C. Ger�stbau GmbH",
#"country_code": "DE",
#"email": "test@novanet.de",
#"first_name": "Norbert",
#"house_no": "9",
#"last_name": "Maier",
#"mobile": "+491747781423",
#"state": "Berlin",
#"street": "Hauptstr",
#"tel": "+49 089 123456",
#"zip": "66862"
#},
#"vat_id": "DE123456",
#"tax_id": "123/123/123",
#"reg_no": "HRB1234",
#"session": "fedgrgst5653653hdgfsvgdsf622627e",
#"no_nc": "1"
},
"transaction": {
"test_mode": "###TEST_MODE###",
"payment_type": "CREDITCARD",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"hook_url": "###YOUR_HOOK_URL###",
"create_token": "1",
#"invoice_ref": "###INVOICE_REF###",
#"invoice_no": "###INVOICE_NO###",
#'enforce_3d': '1',
#'verify_payment_data': '1',
#'call_n_pay': '1',
#"dynamic_descriptor": "www.yourshop.com",
"payment_data": {
"pan_hash": "###PAN_HASH###",
"unique_id": "###UNIQUE_ID###"
}
},
#"subscription": {
#"interval": "2m",
#"trial_interval": "3m",
#"trial_amount": "150",
#"expiry_date": "YYYY-MM-DD"
#},
#"instalment": {
#"interval": "2m",
#"cycles": "2"
#},
#"marketplace": {
# "tx_split": {
# "2261": "100",
# "2271": "120"
#},
#"commission_split": {
# "2261": {
# "percentage": "100",
# "amount": "700"
#},
#"2271": {
# "percentage": "97"
#}
#}
#},
#"affiliate": {
# "subvendors": {
# "2261": "100",
# "2271": "120"
# },
#"commission_type": "amount"
#},
#"invoicing": {
#"net_amount": 5000,
#"gross_amount": 5000,
#"tax_percent": 2,
#"tax_amount": 2,
#"coupon_percent": 1,
#"coupon_amount": 10,
#"product_details": [
#{
#"code": "P001",
#"name": "Product name",
#"group": "Product group",
#"description": "Product description",
#"quantity": 2,
#"unit": 2,
#"unit_price": 100,
#"total_price": 200,
#"tax_amount": 1,
#"tax_percent": 1,
#"discount": 0,
#"note": "Note about the product"
#}
#],
#"notice": {
# "1": "Notice 1",
# "2": "Notice 2",
# "3": "Notice 3"
# },
#"customer_support": "Max Mustermann | Email: support@yourshop.de",
#"custom_invoice_no": "INV-32",
#"send_invoice_pdf": "1"
#},
"custom": {
"lang": "EN",
#'input1': 'your internal reference parameter name',
#'inputval1': 'your internal reference parameter value',
}
})
HEADERS = {
'Content-Type': 'application/json',
'Charset': 'utf-8',
'Accept': 'application/json',
'X-NN-Access-Key': '###YOUR_ENCODED_PAYMENT_ACCESS_KEY###'
}
CONN.request("POST", "/v2/payment", PAYLOAD, HEADERS)
RES = CONN.getresponse()
DATA = RES.read()
print(DATA.decode("utf-8"))
#!/usr/lib/ruby
require "uri"
require "json"
require "net/http"
url = URI("https://payport.novalnet.de/v2/payment")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Accept"] = "application/json"
request["Charset"] = "utf-8"
request["X-NN-Access-Key"] = "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###"
request.body = JSON.dump({
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
#"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
"customer_ip": "###CUSTOMER_IP###",
#"customer_no": "###CUSTOMER_NUMBER###",
"birth_date": "1992-06-10",
#"tel": "+49 089 123456",
#"mobile": "+49 089 123456",
#"fax": "+49 89 654321",
#"shipping": {
#"same_as_billing": "1",
#"city": "Kaiserslautern",
#"company": "A.B.C. Ger�stbau GmbH",
#"country_code": "DE",
#"email": "test@novanet.de",
#"first_name": "Norbert",
#"house_no": "9",
#"last_name": "Maier",
#"mobile": "+491747781423",
#"state": "Berlin",
#"street": "Hauptstr",
#"tel": "+49 089 123456",
#"zip": "66862"
#},
#"vat_id": "DE123456",
#"tax_id": "123/123/123",
#"reg_no": "HRB1234",
#"session": "fedgrgst5653653hdgfsvgdsf622627e",
#"no_nc": "1"
},
"transaction": {
"test_mode": "###TEST_MODE###",
"payment_type": "CREDITCARD",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"hook_url": "###YOUR_HOOK_URL###",
"create_token": "1",
#"invoice_ref": "###INVOICE_REF###",
#"invoice_no": "###INVOICE_NO###",
#'enforce_3d': '1',
#'verify_payment_data': '1',
#'call_n_pay': '1',
#"dynamic_descriptor": "www.yourshop.com",
"payment_data": {
"pan_hash": "###PAN_HASH###",
"unique_id": "###UNIQUE_ID###"
}
},
#"subscription": {
#"interval": "2m",
#"trial_interval": "3m",
#"trial_amount": "150",
#"expiry_date": "YYYY-MM-DD"
#},
#"instalment": {
#"interval": "2m",
#"cycles": "2"
#},
#"marketplace": {
# "tx_split": {
# "2261": "100",
# "2271": "120"
#},
#"commission_split": {
# "2261": {
# "percentage": "100",
# "amount": "700"
#},
#"2271": {
# "percentage": "97"
#}
#}
#},
#"affiliate": {
# "subvendors": {
# "2261": "100",
# "2271": "120"
# },
#"commission_type": "amount"
#},
#"invoicing": {
#"net_amount": 5000,
#"gross_amount": 5000,
#"tax_percent": 2,
#"tax_amount": 2,
#"coupon_percent": 1,
#"coupon_amount": 10,
#"product_details": [
#{
#"code": "P001",
#"name": "Product name",
#"group": "Product group",
#"description": "Product description",
#"quantity": 2,
#"unit": 2,
#"unit_price": 100,
#"total_price": 200,
#"tax_amount": 1,
#"tax_percent": 1,
#"discount": 0,
#"note": "Note about the product"
#}
#],
#"notice": {
# "1": "Notice 1",
# "2": "Notice 2",
# "3": "Notice 3"
# },
#"customer_support": "Max Mustermann | Email: support@yourshop.de",
#"custom_invoice_no": "INV-32",
#"send_invoice_pdf": "1"
#},
"custom": {
"lang": "EN",
#'input1': 'your internal reference parameter name',
#'inputval1': 'your internal reference parameter value',
}
})
response = https.request(request)
puts response.read_body
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://payport.novalnet.de/v2/payment"
method := "POST"
payload := strings.NewReader(`{
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
//"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
"customer_ip": "###CUSTOMER_IP###",
//"customer_no": "###CUSTOMER_NUMBER###",
"birth_date": "1992-06-10",
//"tel": "+49 089 123456",
//"mobile": "+49 089 123456",
//"fax": "+49 89 654321",
/*
"shipping": {
"same_as_billing": "1",
"city": "Kaiserslautern",
"company": "A.B.C. Ger�stbau GmbH",
"country_code": "DE",
"email": "test@novanet.de",
"first_name": "Norbert",
"house_no": "9",
"last_name": "Maier",
"mobile": "+491747781423",
"state": "Berlin",
"street": "Hauptstr",
"tel": "+49 089 123456",
"zip": "66862"
},
*/
//"vat_id": "DE123456",
//"tax_id": "123/123/123",
//"reg_no": "HRB1234",
//"session": "fedgrgst5653653hdgfsvgdsf622627e",
//"no_nc": "1"
},
"transaction": {
"test_mode": "###TEST_MODE###",
"payment_type": "CREDITCARD",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"hook_url": "###YOUR_HOOK_URL###",
"create_token": "1",
/*
"invoice_ref": "###INVOICE_REF###",
"invoice_no": "###INVOICE_NO###",
'enforce_3d': '1',
'verify_payment_data': '1',
'call_n_pay': '1',
"dynamic_descriptor": "www.yourshop.com",
*/
"payment_data": {
"pan_hash": "###PAN_HASH###",
"unique_id": "###UNIQUE_ID###"
}
},
/*
"subscription": {
"interval": "2m",
"trial_interval": "3m",
"trial_amount": "150",
"expiry_date": "YYYY-MM-DD"
},
"instalment": {
"interval": "2m",
"cycles": "2"
},
"marketplace": {
"tx_split": {
"2261": "100",
"2271": "120"
},
"commission_split": {
"2261": {
"percentage": "100",
"amount": "700"
},
"2271": {
"percentage": "97"
}
}
},
"affiliate": {
"subvendors": {
"2261": "100",
"2271": "120"
},
//"commission_type": "amount"
},
"invoicing": {
"net_amount": 5000,
"gross_amount": 5000,
"tax_percent": 2,
"tax_amount": 2,
//"coupon_percent": 1,
//"coupon_amount": 10,
"product_details": [
{
//"code": "P001",
"name": "Product name",
//"group": "Product group",
//"description": "Product description",
"quantity": 2,
"unit": 2,
"unit_price": 100,
"total_price": 200,
"tax_amount": 1,
"tax_percent": 1,
//"discount": 0,
//"note": "Note about the product"
}
],
"notice": {
"1": "Notice 1",
"2": "Notice 2",
"3": "Notice 3"
},
//"customer_support": "Max Mustermann | Email: support@yourshop.de",
//"custom_invoice_no": "INV-32",
"send_invoice_pdf": "1"
},
*/
"custom": {
"lang": "EN",
//'input1': 'your internal reference parameter name',
//'inputval1': 'your internal reference parameter value',
}
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
req.Header.Add("Charset", "utf-8")
req.Header.Add("X-NN-Access-Key", "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
/* List of required libraries (see also the import statements below):
- commons-logging-1.2.jar
- httpasyncclient-4.1.5.jar
- httpclient-4.3.3.jar
- httpcore-4.4.16.jar
- httpcore-nio-4.4.16.jar
- httpmime-4.5.14.jar
- json-20230227.jar
- unirest-java-3.9.00.jar
*/
import java.io.*;
import org.json.JSONArray;
import org.apache.http.auth.*;
import org.apache.http.nio.conn.*;
import org.apache.http.concurrent.*;
import org.apache.http.nio.reactor.*;
import org.apache.commons.logging.*;
import org.apache.http.entity.mime.content.*;
import kong.unirest.*;
public class DirectApiRequest {
public static void main(String []args) throws Exception{
Unirest.config().connectTimeout(1000).socketTimeout(2000);
HttpResponse<String> response = Unirest.post("https://payport.novalnet.de/v2/payment")
.header("Content-Type", "application/json")
.header("Charset", "utf-8")
.header("Accept", "application/json")
.header("X-NN-Access-Key", "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###")
.body("{
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
//"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
"customer_ip": "###CUSTOMER_IP###",
//"customer_no": "###CUSTOMER_NUMBER###",
"birth_date": "1992-06-10",
//"tel": "+49 089 123456",
//"mobile": "+49 089 123456",
//"fax": "+49 89 654321",
/*
"shipping": {
"same_as_billing": "1",
"city": "Kaiserslautern",
"company": "A.B.C. Ger�stbau GmbH",
"country_code": "DE",
"email": "test@novanet.de",
"first_name": "Norbert",
"house_no": "9",
"last_name": "Maier",
"mobile": "+491747781423",
"state": "Berlin",
"street": "Hauptstr",
"tel": "+49 089 123456",
"zip": "66862"
},
*/
//"vat_id": "DE123456",
//"tax_id": "123/123/123",
//"reg_no": "HRB1234",
//"session": "fedgrgst5653653hdgfsvgdsf622627e",
//"no_nc": "1"
},
"transaction": {
"test_mode": "###TEST_MODE###",
"payment_type": "CREDITCARD",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"hook_url": "###YOUR_HOOK_URL###",
"create_token": "1",
/*
"invoice_ref": "###INVOICE_REF###",
"invoice_no": "###INVOICE_NO###",
'enforce_3d': '1',
'verify_payment_data': '1',
'call_n_pay': '1',
"dynamic_descriptor": "www.yourshop.com",
*/
"payment_data": {
"pan_hash": "###PAN_HASH###",
"unique_id": "###UNIQUE_ID###"
}
},
/*
"subscription": {
"interval": "2m",
"trial_interval": "3m",
"trial_amount": "150",
"expiry_date": "YYYY-MM-DD"
},
"instalment": {
"interval": "2m",
"cycles": "2"
},
"marketplace": {
"tx_split": {
"2261": "100",
"2271": "120"
},
"commission_split": {
"2261": {
"percentage": "100",
"amount": "700"
},
"2271": {
"percentage": "97"
}
}
},
"affiliate": {
"subvendors": {
"2261": "100",
"2271": "120"
},
//"commission_type": "amount"
},
"invoicing": {
"net_amount": 5000,
"gross_amount": 5000,
"tax_percent": 2,
"tax_amount": 2,
//"coupon_percent": 1,
//"coupon_amount": 10,
"product_details": [
{
//"code": "P001",
"name": "Product name",
//"group": "Product group",
//"description": "Product description",
"quantity": 2,
"unit": 2,
"unit_price": 100,
"total_price": 200,
"tax_amount": 1,
"tax_percent": 1,
//"discount": 0,
//"note": "Note about the product"
}
],
"notice": {
"1": "Notice 1",
"2": "Notice 2",
"3": "Notice 3"
},
//"customer_support": "Max Mustermann | Email: support@yourshop.de",
//"custom_invoice_no": "INV-32",
"send_invoice_pdf": "1"
},
*/
"custom": {
"lang": "EN",
//'input1': 'your internal reference parameter name',
//'inputval1': 'your internal reference parameter value',
}
}")
.asString();
System.out.println(response.getBody());
}
}
using System;
using System.Net.Http;
namespace DirectApiRequest
{
public class DirectApi {
public string check_direct_api_request() {
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://payport.novalnet.de/v2/payment");
request.Headers.Add("Charset", "utf-8");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("X-NN-Access-Key", "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###");
var content = new StringContent("{
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
//"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
"customer_ip": "###CUSTOMER_IP###",
//"customer_no": "###CUSTOMER_NUMBER###",
"birth_date": "1992-06-10",
//"tel": "+49 089 123456",
//"mobile": "+49 089 123456",
//"fax": "+49 89 654321",
/*
"shipping": {
"same_as_billing": "1",
"city": "Kaiserslautern",
"company": "A.B.C. Ger�stbau GmbH",
"country_code": "DE",
"email": "test@novanet.de",
"first_name": "Norbert",
"house_no": "9",
"last_name": "Maier",
"mobile": "+491747781423",
"state": "Berlin",
"street": "Hauptstr",
"tel": "+49 089 123456",
"zip": "66862"
},
*/
//"vat_id": "DE123456",
//"tax_id": "123/123/123",
//"reg_no": "HRB1234",
//"session": "fedgrgst5653653hdgfsvgdsf622627e",
//"no_nc": "1"
},
"transaction": {
"test_mode": "###TEST_MODE###",
"payment_type": "CREDITCARD",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"hook_url": "###YOUR_HOOK_URL###",
"create_token": "1",
/*
"invoice_ref": "###INVOICE_REF###",
"invoice_no": "###INVOICE_NO###",
'enforce_3d': '1',
'verify_payment_data': '1',
'call_n_pay': '1',
"dynamic_descriptor": "www.yourshop.com",
*/
"payment_data": {
"pan_hash": "###PAN_HASH###",
"unique_id": "###UNIQUE_ID###"
}
},
/*
"subscription": {
"interval": "2m",
"trial_interval": "3m",
"trial_amount": "150",
"expiry_date": "YYYY-MM-DD"
},
"instalment": {
"interval": "2m",
"cycles": "2"
},
"marketplace": {
"tx_split": {
"2261": "100",
"2271": "120"
},
"commission_split": {
"2261": {
"percentage": "100",
"amount": "700"
},
"2271": {
"percentage": "97"
}
}
},
"affiliate": {
"subvendors": {
"2261": "100",
"2271": "120"
},
//"commission_type": "amount"
},
"invoicing": {
"net_amount": 5000,
"gross_amount": 5000,
"tax_percent": 2,
"tax_amount": 2,
//"coupon_percent": 1,
//"coupon_amount": 10,
"product_details": [
{
//"code": "P001",
"name": "Product name",
//"group": "Product group",
//"description": "Product description",
"quantity": 2,
"unit": 2,
"unit_price": 100,
"total_price": 200,
"tax_amount": 1,
"tax_percent": 1,
//"discount": 0,
//"note": "Note about the product"
}
],
"notice": {
"1": "Notice 1",
"2": "Notice 2",
"3": "Notice 3"
},
//"customer_support": "Max Mustermann | Email: support@yourshop.de",
//"custom_invoice_no": "INV-32",
"send_invoice_pdf": "1"
},
*/
"custom": {
"lang": "EN",
//'input1': 'your internal reference parameter name',
//'inputval1': 'your internal reference parameter value',
}
}", null, "application/json");
request.Content = content;
var response = client.SendAsync(request).Result;
response.EnsureSuccessstatuscode();
var responseText = response.Content.ReadAsStringAsync().Result;
Console.WriteLine(responseText);
return responseText;
}
public static void Main() {
var testRequest = new DirectApi();
testRequest.check_direct_api_request();
}
}
}
<?php
// Need to enter your payment access key value here
$payment_access_key = '###YOUR_PAYMENT_ACCESS_KEY###';
// Now, have to encode the $payment_access_key value with the base64 encode
$encoded_data = base64_encode($payment_access_key);
// Action Endpoint
$endpoint = 'https://payport.novalnet.de/v2/payment';
// Build the Headers array
$headers = [
// The Content-Type should be "application/json"
'Content-Type:application/json',
// The charset should be "utf-8"
'Charset:utf-8',
// Optional
'Accept:application/json',
// The formed authenticate value (case-sensitive)
'X-NN-Access-Key:' . $encoded_data
];
$data = [];
// Build Merchant Data
$data['merchant'] = [
// Your API signature value
'signature' => '###YOUR_API_SIGNATURE###',
// Your corresponding tariff ID
'tariff' => '###YOUR_TARIFF_ID###'
];
// Build Customer Data
$data['customer'] = [
// Shopper's first name
'first_name' => 'Max',
// Shopper's last name
'last_name' => 'Mustermann',
// Shopper's email
'email' => '###YOUR_MAIL###',
// Shopper's Ip address
'customer_ip' => '###CUSTOMER_IP###',
// Shopper's customer number from the shop
'customer_no' => '###CUSTOMER_NUMBER###',
// Shopper's Telephone number
'tel' => '+49 089 123456',
// Shopper's Mobile number
'mobile' => '+49 174 7781423',
// Shopper's birthdate value YYYY-MM-DD - Decomment it based on your usage
// 'birth_date' => '1992-06-10',
// Shopper's gender - Decomment it based on your usage
// 'gender' => 'u',
// Shopper's company vat ID value - Decomment it based on your usage
// 'vat_id' => 'DE123456',
// Shopper's company regestration number - Decomment it based on your usage
// 'reg_no' => 'HRB1234',
// Shopper's company tax ID value - Decomment it based on your usage
// 'tax_id' => '123/123/123',
// Shopper's session value - Decomment it based on your usage
// 'session' => 'fedgrgst5653653hdgfsvgdsf622627e',
// Shopper's fax number - Decomment it based on your usage
// 'fax' => '+49 89 654321',
// Use of minimal customer data
//'no_nc' => '1',
// Shopper's billing address
'billing' => [
// House number
'house_no' => '2',
// Street
'street' => 'Musterstr',
// City
'city' => 'Musterhausen',
// zip
'zip' => '12345',
// Country's ISO code
'country_code' => 'DE',
// Name of the company - Decomment it based on your usage
// 'company' => 'ABC GmbH',
// State
//'state' => 'Berlin'
],
/*
// Optional child object - Decomment it based on your usage
'shipping' => [
// Pass this parameter if the billing and the shipping address are identical
'same_as_billing' => '1',
// First name
'first_name' => 'Norbert',
// Last name
'last_name' => 'Maier',
// Email
'email' => 'test@novalnet.de',
// Street
'street' => 'Hauptstr',
// House number
'house_no' => '9',
// City
'city' => 'Kaiserslautern',
// zip
'zip' => '66862',
// Country's ISO code
'country_code' => 'DE',
// Name of the company
'company' => 'A.B.C. Gerüstbau GmbH',
// Telephone number
'tel' => '+49 089 123456',
// Mobile number
'mobile' => '+49 174 7781423',
// State
'state' => 'Berlin'
]
*/
];
// Build Transaction Data
$data['transaction'] = [
// The mode of the transaction
'test_mode' => '###TEST_MODE###',
// The Payment type of the transaction
'payment_type' => 'DIRECT_DEBIT_SEPA',
// The transaction Amount in smaller currency unit
'amount' => '###TRANSACTION_AMOUNT###',
// The transaction currency's ISO code
'currency' => '###TRANSACTION_CURRENCY###',
// Date by which the customer must settle the payment
'due_date' => '###DUE_DATE###',
// The order number of the transaction
'order_no' => '###TRANSACTION_ORDER_NUMBER###',
// The Hook URL value for this particular transaction
'hook_url' => '###YOUR_HOOK_URL###',
// The reference related to your customer`s invoice of the order.
//'invoice_ref' => '###INVOICE_REF###',
// The invoice number related to your customer`s invoice of the order.
//'invoice_no' => '###INVOICE_NO###',
// The unique mandate reference of the written SEPA mandate.
// 'mandate_ref' => '###MANDATE_REF###',
// The start date at which the end-customer allowed Novalnet or the merchant to book from his/her account.
// 'mandate_date' => '###MANDATE_DATE###',
// The debit reason defines the text on the customer's proof of payment.
// 'debit_reason_1' => '###DEBIT_REASON_1###',
// 'debit_reason_2' => '###DEBIT_REASON_2###',
// 'debit_reason_3' => '###DEBIT_REASON_3###',
// 'debit_reason_4' => '###DEBIT_REASON_4###',
//'verify_payment_data' => '1',
// The flag to create the token for the payment data - Decomment it based on your usage
'create_token' => 1,
// Build Payment Data
'payment_data' => [
'account_holder' => 'Max Mustermann',
'iban' => '###IBAN###',
'bic' => '###BIC###'
]
];
/*
// Subscription Data, used for processing Novalnet`s subscription - Optional object - Decomment it based on your usage
$data['subscription'] = [
// The interval between each cycle
'interval' => '1m',
// Subscription trial interval if applicable
'trial_interval' => '3m',
// Subscription trial interval amount if applicable
'trial_amount' => '150'
// Subscription expiry date
//'expiry_date' => 'YYYY-MM-DD'
];
*/
/*
// Marketplace data
$data['marketplace'] = [
// To submit amount for several affiliates to be booked
'tx_split' => [
'2261' => '100',
'2271' => '120'
],
// Commission type for the corresponding affiliates
'commission_split' => [
'2261' => [
'percentage' => '100',
'amount' => '700',
],
'2271' => [
'percentage' => '97'
]
]
];
// Affiliate Data
$data['affiliate'] = [
// To submit shares for several affiliates for the same transaction
'subvendors'=> [
'2261' => '100',
'2271' => '120'
],
// Commission type for several affiliates for the same transaction
//'commission_type'=> 'amount'
];
// Invoicing Data
$data['invoicing'] = [
// Total amount (excl. tax) should be mentioned here
'net_amount' => 5000,
// Total amount (incl. tax) should be mentioned here
'gross_amount' => 5000,
// Overall invoice tax percent should be mentioned here
'tax_percent' => 2,
// Overall invoice tax amount should be mentioned here
'tax_amount' => 2,
// Discount coupon percentage should be mentioned here
//'coupon_percent' => 1,
// Discount coupon amount should be mentioned here
//'coupon_amount' => 10,
// Individual product details should be mentioned here
'product_details' => [
[
//'code' => 'P001',
'name' => 'Product name',
//'group' => 'Product group',
//'description' => 'Product description',
'unit' => 2,
'quantity' => 2,
'unit_price' => 100,
'total_price' => 200,
'tax_amount' => 1,
'tax_percent' => 1,
//'discount' => 0,
//'note' => 'Note about the product'
]
],
// The notification which you wants to provide to the end-customer in invoice PDF.
'notice' => [
'1' => 'Notice 1',
'2' => 'Notice 2',
'3' => 'Notice 3'
],
// Customize the customer support details here
//'customer_support' => 'Max Mustermann | Email: support@yourshop.de',
// Custom Invoice number
//'custom_invoice_no' => 'INV-32',
// Send the invoice pdf to end customer
'send_invoice_pdf' => '1'
];
*/
// Custom Data - Optional object
$data['custom'] = [
// Shopper's selected language in shop
"lang" => "EN",
// Custom parameter's key - Optional object - Decomment it based on your usage
// 'input1' => 'your internal reference parameter name',
// Custom parameter's value - Optional object - Decomment it based on your usage
// 'inputval1' => 'your internal reference parameter value'
];
// Convert the array to JSON string
$json_data = json_encode($data);
// Handle Response
$response = send_request($json_data, $endpoint, $headers);
function send_request($data, $url, $headers) {
// Initiate cURL
$curl = curl_init();
// Set the url
curl_setopt($curl, CURLOPT_URL, $url);
// Set the result output to be a string
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
// Set the POST value to true (mandatory)
curl_setopt($curl, CURLOPT_POST, true);
// Set the post fields
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
// Set the headers
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
// Execute cURL
$result = curl_exec($curl);
// Handle cURL error
if (curl_errno($curl)) {
echo 'Request Error:' . curl_error($curl);
return $result;
}
// Close cURL
curl_close($curl);
// Decode the JSON string
$result = json_decode($result);
return $result;
}
?>
curl --location --request POST 'https://payport.novalnet.de/v2/payment' -H 'Content-Type: application/json' -H 'Charset:utf-8' -H 'Accept: application/json' -H 'X-NN-Access-Key: ###YOUR_ENCODED_PAYMENT_ACCESS_KEY###' -d '{"merchant":{"signature":"###YOUR_API_SIGNATURE###","tariff":"###YOUR_TARIFF_ID###"},"customer":{"first_name":"Max","last_name":"Mustermann","email":"###YOUR_MAIL###","customer_ip":"###CUSTOMER_IP###","customer_no":"###CUSTOMER_NUMBER###","tel":"+49 089 123456","mobile":"+49 174 7781423","billing":{"house_no":"2","street":"Musterstr","city":"Musterhausen","zip":"12345","country_code":"DE"}},"transaction":{"payment_type":"DIRECT_DEBIT_SEPA","amount":"###TRANSACTION_AMOUNT###","currency":"###TRANSACTION_CURRENCY###","test_mode":"###TEST_MODE###","due_date":"###DUE_DATE###","order_no":"###TRANSACTION_ORDER_NUMBER###","hook_url":"###YOUR_HOOK_URL###","create_token":1,"payment_data":{"account_holder":"Max Mustermann","iban":"###IBAN###","bic":"###BIC###"}},"custom":{"lang":"EN"}}';
#!/usr/bin/node
const https = require('https');
// data sent in the body of the request
const postData = JSON.stringify({
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
"customer_ip": "###CUSTOMER_IP###",
"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"birth_date": "1992-06-10",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
/*
"shipping": {
"same_as_billing": "1",
"city": "Kaiserslautern",
"company": "A.B.C. Gerüstbau GmbH",
"country_code": "DE",
"email": "test@novanet.de",
"first_name": "Norbert",
"house_no": "9",
"last_name": "Maier",
"mobile": "+491747781423",
"state": "Berlin",
"street": "Hauptstr",
"tel": "+49 089 123456",
"zip": "66862"
},
*/
},
"transaction": {
"payment_type": "DIRECT_DEBIT_SEPA",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"test_mode": "###TEST_MODE###",
"due_date":"###DUE_DATE###",
"hook_url": "###YOUR_HOOK_URL###",
"create_token": "1",
"payment_data": {
"account_holder": "Max Mustermann",
"iban": "###IBAN###",
"bic": "###BIC###"
}
},
"custom": {
"lang": "EN"
}
});
const options = {
hostname: 'payport.novalnet.de',
port: 443,
path: '/v2/payment',
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(postData),
'Charset': 'utf-8',
'Accept': 'application/json',
'X-NN-Access-Key': '###YOUR_ENCODED_PAYMENT_ACCESS_KEY###'
},
};
const req = https.request(options, (res) => {
console.log('statuscode:', res.statuscode);
// console.log('headers:', res.headers);
res.on('data', (d) => {
process.stdout.write(d);
});
});
req.on('error', (e) => {
console.error('ERROR: ',e);
});
// Write data to request body
req.write(postData);
req.end();
#!/usr/bin/python3
import http.client
import json
CONN = http.client.HTTPSConnection("payport.novalnet.de")
PAYLOAD = json.dumps({
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
"customer_ip": "###CUSTOMER_IP###",
"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"birth_date": "1983-07-02",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
#"shipping": {
#"same_as_billing": "1",
#"city": "Kaiserslautern",
#"company": "A.B.C. Gerüstbau GmbH",
#"country_code": "DE",
#"email": "test@novanet.de",
#"first_name": "Norbert",
#"house_no": "9",
#"last_name": "Maier",
#"mobile": "+491747781423",
#"state": "Berlin",
#"street": "Hauptstr",
#"tel": "+49 089 123456",
#"zip": "66862"
#}
},
"transaction": {
"payment_type": "DIRECT_DEBIT_SEPA",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "EUR",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"test_mode": "###TEST_MODE###",
"due_date": "###DUE_DATE###",
"hook_url": "###YOUR_HOOK_URL###",
"create_token": "1",
"payment_data": {
"account_holder" : "Max Mustermann",
"iban" : "###IBAN###",
"bic" : "###BIC###"
}
},
"custom": {
"lang": "EN"
}
})
HEADERS = {
'Content-Type': 'application/json',
'Charset': 'utf-8',
'Accept': 'application/json',
'X-NN-Access-Key': '###YOUR_ENCODED_PAYMENT_ACCESS_KEY###'
}
CONN.request("POST", "/v2/payment", PAYLOAD, HEADERS)
RES = CONN.getresponse()
DATA = RES.read()
print(DATA.decode("utf-8"))
#!/usr/lib/ruby
require "uri"
require "json"
require "net/http"
url = URI("https://payport.novalnet.de/v2/payment")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Accept"] = "application/json"
request["Charset"] = "utf-8"
request["X-NN-Access-Key"] = "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###"
request.body = JSON.dump({
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
"customer_ip": "###CUSTOMER_IP###",
"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"birth_date": "1983-07-02",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
#"shipping": {
#"same_as_billing": "1",
#"city": "Kaiserslautern",
#"company": "A.B.C. Gerüstbau GmbH",
#"country_code": "DE",
#"email": "test@novanet.de",
#"first_name": "Norbert",
#"house_no": "9",
#"last_name": "Maier",
#"mobile": "+491747781423",
#"state": "Berlin",
#"street": "Hauptstr",
#"tel": "+49 089 123456",
#"zip": "66862"
#}
},
"transaction": {
"payment_type": "DIRECT_DEBIT_SEPA",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "EUR",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"test_mode": "###TEST_MODE###",
"due_date": "###DUE_DATE###",
"hook_url": "###YOUR_HOOK_URL###",
"create_token": "1",
"payment_data": {
"account_holder" : "Max Mustermann",
"iban" : "###IBAN###",
"bic" : "###BIC###"
}
},
"custom": {
"lang": "EN"
}
})
response = https.request(request)
puts response.read_body
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://payport.novalnet.de/v2/payment"
method := "POST"
payload := strings.NewReader(`{
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
"customer_ip": "###CUSTOMER_IP###",
"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"birth_date": "1983-07-02",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
/*
"shipping": {
"same_as_billing": "1",
"city": "Kaiserslautern",
"company": "A.B.C. Gerüstbau GmbH",
"country_code": "DE",
"email": "test@novanet.de",
"first_name": "Norbert",
"house_no": "9",
"last_name": "Maier",
"mobile": "+491747781423",
"state": "Berlin",
"street": "Hauptstr",
"tel": "+49 089 123456",
"zip": "66862"
}
*/
},
"transaction": {
"payment_type": "DIRECT_DEBIT_SEPA",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "EUR",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"test_mode": "###TEST_MODE###",
"due_date":"###DUE_DATE###",
"hook_url": "###YOUR_HOOK_URL###",
"create_token": "1",
"payment_data": {
"account_holder": "Max Mustermann",
"iban": "###IBAN###",
"bic": "###BIC###"
}
},
"custom": {
"lang": "EN"
}
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
req.Header.Add("Charset", "utf-8")
req.Header.Add("X-NN-Access-Key", "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
/* List of required libraries (see also the import statements below):
- commons-logging-1.2.jar
- httpasyncclient-4.1.5.jar
- httpclient-4.3.3.jar
- httpcore-4.4.16.jar
- httpcore-nio-4.4.16.jar
- httpmime-4.5.14.jar
- json-20230227.jar
- unirest-java-3.9.00.jar
*/
import java.io.*;
import org.json.JSONArray;
import org.apache.http.auth.*;
import org.apache.http.nio.conn.*;
import org.apache.http.concurrent.*;
import org.apache.http.nio.reactor.*;
import org.apache.commons.logging.*;
import org.apache.http.entity.mime.content.*;
import kong.unirest.*;
public class DirectApi {
public static void main(String []args) throws Exception{
Unirest.config().connectTimeout(1000).socketTimeout(2000);
HttpResponse<String> response = Unirest.post("https://payport.novalnet.de/v2/payment")
.header("Content-Type", "application/json")
.header("Charset", "utf-8")
.header("Accept", "application/json")
.header("X-NN-Access-Key", "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###")
.body("{\"merchant\":{\"signature\":\"###YOUR_API_SIGNATURE###\", \"tariff\" : \"###YOUR_TARIFF_ID###\"},\"customer\":{\"customer_ip\":\"###CUSTOMER_IP###\",\"gender\":\"u\", \"first_name\": \"Max\", \"last_name\": \"Mustermann\", \"email\": \"###YOUR_MAIL###\", \"birth_date\":\"1983-07-02\",\"billing\":{\"street\":\"Musterstr\",\"house_no\":\"2\",\"city\":\"Musterhausen\",\"zip\":\"12345\",\"country_code\":\"DE\",\"tel\":\"+49 089 123456\"}},\"transaction\":{\"payment_type\": \"DIRECT_DEBIT_SEPA\",\"amount\":\"###TRANSACTION_AMOUNT###\",\"currency\":\"EUR\",\"order_no\":\"###TRANSACTION_ORDER_NUMBER###\",\"test_mode\":\"###TEST_MODE###\",\"due_date\":\"###DUE_DATE###\",\"hook_url\":\"###YOUR_HOOK_URL###\",\"create_token\":\"1\",\"payment_data\":{\"account_holder\":\"Max Mustermann\",\"iban\":\"###IBAN###\",\"bic\":\"###BIC###\"}},\"custom\":{\"lang\":\"EN\"}}")
.asString();
System.out.println(response.getBody());
}
}
using System;
using System.Net.Http;
namespace DirectApiRequest
{
public class DirectApi {
public string check_direct_api_request() {
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://payport.novalnet.de/v2/payment");
request.Headers.Add("Charset", "utf-8");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("X-NN-Access-Key", "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###");
var content = new StringContent("{\"merchant\":{\"signature\":\"###YOUR_API_SIGNATURE###\", \"tariff\" : \"###YOUR_TARIFF_ID###\"},\"customer\":{\"customer_ip\":\"###CUSTOMER_IP###\",\"gender\":\"u\", \"first_name\": \"Max\", \"last_name\": \"Mustermann\", \"email\": \"###YOUR_MAIL###\", \"birth_date\":\"1983-07-02\",\"billing\":{\"street\":\"Musterstr\",\"house_no\":\"2\",\"city\":\"Musterhausen\",\"zip\":\"12345\",\"country_code\":\"DE\",\"tel\":\"+49 089 123456\"}},\"transaction\":{\"payment_type\": \"DIRECT_DEBIT_SEPA\",\"amount\":\"###TRANSACTION_AMOUNT###\",\"currency\":\"EUR\",\"order_no\":\"###TRANSACTION_ORDER_NUMBER###\",\"test_mode\":\"###TEST_MODE###\",\"due_date\":\"###DUE_DATE###\",\"hook_url\":\"###YOUR_HOOK_URL###\",\"create_token\":\"1\",\"payment_data\":{\"account_holder\":\"Max Mustermann\",\"iban\":\"###IBAN###\",\"bic\":\"###BIC###\"}},\"custom\":{\"lang\":\"EN\"}}", null, "application/json");
request.Content = content;
var response = client.SendAsync(request).Result;
response.EnsureSuccessstatuscode();
var responseText = response.Content.ReadAsStringAsync().Result;
Console.WriteLine(responseText);
return responseText;
}
public static void Main() {
var testRequest = new DirectApi();
testRequest.check_direct_api_request();
}
}
}
<?php
// Need to enter your payment access key value here
$payment_access_key = "###YOUR_PAYMENT_ACCESS_KEY###";
// Now, have to encode the $payment_access_key value with the base64 encode
$encoded_data = base64_encode($payment_access_key);
// Action Endpoint
$endpoint = "https://payport.novalnet.de/v2/payment";
// Build the Headers array
$headers = [
// The Content-Type should be "application/json"
"Content-Type:application/json",
// The charset should be "utf-8"
"Charset:utf-8",
// Optional
"Accept:application/json",
// The formed authenticate value (case-sensitive)
"X-NN-Access-Key:" . $encoded_data,
];
$data = [];
// Build Merchant Data
$data["merchant"] = [
// Your API signature value
"signature" => "###YOUR_API_SIGNATURE###",
// Your corresponding tariff ID
"tariff" => "###YOUR_TARIFF_ID###",
];
// Build Customer Data
$data["customer"] = [
// Shopper's first name
"first_name" => "Max",
// Shopper's last name
"last_name" => "Mustermann",
// Shopper's email
"email" => "###YOUR_MAIL###",
// Shopper's Ip address
"customer_ip" => "###CUSTOMER_IP###",
// Shopper's customer number from the shop
"customer_no" => "###CUSTOMER_NUMBER###",
// Shopper's Telephone number
"tel" => "+49 089 123456",
// Shopper's Mobile number
"mobile" => "+49 174 7781423",
// Shopper's birthdate value YYYY-MM-DD - Decomment it based on your usage
// 'birth_date' => '1992-06-10',
// Shopper's gender - Decomment it based on your usage
// 'gender' => 'u',
// Shopper's company vat ID value - Decomment it based on your usage
// 'vat_id' => 'DE123456',
// Shopper's company regestration number - Decomment it based on your usage
// 'reg_no' => 'HRB1234',
// Shopper's company tax ID value - Decomment it based on your usage
// 'tax_id' => '123/123/123',
// Shopper's session value - Decomment it based on your usage
// 'session' => 'fedgrgst5653653hdgfsvgdsf622627e',
// Shopper's fax number - Decomment it based on your usage
// 'fax' => '+49 89 654321',
// Use of minimal customer data
//'no_nc' => '1',
// Shopper's billing address
"billing" => [
// House number
"house_no" => "2",
// Street
"street" => "Musterstr",
// City
"city" => "Musterhausen",
// zip
"zip" => "12345",
// Country's ISO code
"country_code" => "DE",
// Name of the company - Decomment it based on your usage
// 'company' => 'ABC GmbH',
// State
//'state' => 'Berlin'
],
/*
// Optional child object - Decomment it based on your usage
'shipping' => [
// Pass this parameter if the billing and the shipping address are identical
'same_as_billing' => '1',
// First name
'first_name' => 'Norbert',
// Last name
'last_name' => 'Maier',
// Email
'email' => 'test@novalnet.de',
// Street
'street' => 'Hauptstr',
// House number
'house_no' => '9',
// City
'city' => 'Kaiserslautern',
// zip
'zip' => '66862',
// Country's ISO code
'country_code' => 'DE',
// Name of the company
'company' => 'A.B.C. Ger�stbau GmbH',
// Telephone number
'tel' => '+49 089 123456',
// Mobile number
'mobile' => '+49 174 7781423',
// State
'state' => 'Berlin'
]
*/
];
// Build Transaction Data
$data["transaction"] = [
// The mode of the transaction
"test_mode" => "###TEST_MODE###",
// The Payment type of the transaction
"payment_type" => "DIRECT_DEBIT_ACH",
// The transaction Amount in smaller currency unit
"amount" => "###TRANSACTION_AMOUNT###",
// The transaction currency's ISO code
"currency" => "###TRANSACTION_CURRENCY###",
// The order number of the transaction
"order_no" => "###TRANSACTION_ORDER_NUMBER###",
// The Hook URL value for this particular transaction
"hook_url" => "###YOUR_HOOK_URL###",
// The reference related to your customer`s invoice of the order.
//'invoice_ref' => '###INVOICE_REF###',
// The invoice number related to your customer`s invoice of the order.
//'invoice_no' => '###INVOICE_NO###',
// The flag to create the token for the payment data - Decomment it based on your usage
"create_token" => 1,
// Build Payment Data
"payment_data" => [
"account_holder" => "###ACCOUNT_HOLDER###",
"account_number" => "###ACCOUNT_NUMBER###",
"routing_number" => "###ROUTING_NUMBER###",
],
];
/*
// Subscription Data, used for processing Novalnet`s subscription - Optional object - Decomment it based on your usage
$data['subscription'] = [
// The interval between each cycle
'interval' => '1m',
// Subscription trial interval if applicable
'trial_interval' => '3m',
// Subscription trial interval amount if applicable
'trial_amount' => '150'
// Subscription expiry date
//'expiry_date' => 'YYYY-MM-DD'
];
*/
/*
// Marketplace data
$data['marketplace'] = [
// To submit amount for several affiliates to be booked
'tx_split' => [
'2261' => '100',
'2271' => '120'
],
// Commission type for the corresponding affiliates
'commission_split' => [
'2261' => [
'percentage' => '100',
'amount' => '700',
],
'2271' => [
'percentage' => '97'
]
]
];
// Affiliate Data
$data['affiliate'] = [
// To submit shares for several affiliates for the same transaction
'subvendors'=> [
'2261' => '100',
'2271' => '120'
],
// Commission type for several affiliates for the same transaction
//'commission_type'=> 'amount'
];
// Invoicing Data
$data['invoicing'] = [
// Total amount (excl. tax) should be mentioned here
'net_amount' => 5000,
// Total amount (incl. tax) should be mentioned here
'gross_amount' => 5000,
// Overall invoice tax percent should be mentioned here
'tax_percent' => 2,
// Overall invoice tax amount should be mentioned here
'tax_amount' => 2,
// Discount coupon percentage should be mentioned here
//'coupon_percent' => 1,
// Discount coupon amount should be mentioned here
//'coupon_amount' => 10,
// Individual product details should be mentioned here
'product_details' => [
[
//'code' => 'P001',
'name' => 'Product name',
//'group' => 'Product group',
//'description' => 'Product description',
'unit' => 2,
'quantity' => 2,
'unit_price' => 100,
'total_price' => 200,
'tax_amount' => 1,
'tax_percent' => 1,
//'discount' => 0,
//'note' => 'Note about the product'
]
],
// The notification which you wants to provide to the end-customer in invoice PDF.
'notice' => [
'1' => 'Notice 1',
'2' => 'Notice 2',
'3' => 'Notice 3'
],
// Customize the customer support details here
//'customer_support' => 'Max Mustermann | Email: support@yourshop.de',
// Custom Invoice number
//'custom_invoice_no' => 'INV-32',
// Send the invoice pdf to end customer
'send_invoice_pdf' => '1'
];
*/
// Custom Data - Optional object
$data["custom"] = [
// Shopper's selected language in shop
"lang" => "EN",
// Custom parameter's key - Optional object - Decomment it based on your usage
// 'input1' => 'your internal reference parameter name',
// Custom parameter's value - Optional object - Decomment it based on your usage
// 'inputval1' => 'your internal reference parameter value'
];
// Convert the array to JSON string
$json_data = json_encode($data);
// Handle Response
$response = send_request($json_data, $endpoint, $headers);
function send_request($data, $url, $headers)
{
// Initiate cURL
$curl = curl_init();
// Set the url
curl_setopt($curl, CURLOPT_URL, $url);
// Set the result output to be a string
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
// Set the POST value to true (mandatory)
curl_setopt($curl, CURLOPT_POST, true);
// Set the post fields
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
// Set the headers
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
// Execute cURL
$result = curl_exec($curl);
// Handle cURL error
if (curl_errno($curl)) {
echo "Request Error:" . curl_error($curl);
return $result;
}
// Close cURL
curl_close($curl);
// Decode the JSON string
$result = json_decode($result);
return $result;
}
?>
curl --location --request POST 'https://payport.novalnet.de/v2/payment' -H 'Content-Type: application/json' -H 'Charset:utf-8' -H 'Accept: application/json' -H 'X-NN-Access-Key: ###YOUR_ENCODED_PAYMENT_ACCESS_KEY###' -d '{"merchant":{"signature":"###YOUR_API_SIGNATURE###","tariff":"###YOUR_TARIFF_ID###"},"customer":{"first_name":"Max","last_name":"Mustermann","email":"###YOUR_MAIL###","customer_ip":"###CUSTOMER_IP###","customer_no":"###CUSTOMER_NUMBER###","tel":"+49 089 123456","mobile":"+49 174 7781423","billing":{"house_no":"2","street":"Musterstr","city":"Musterhausen","zip":"12345","country_code":"DE"}},"transaction":{"payment_type":"DIRECT_DEBIT_ACH","amount":"###TRANSACTION_AMOUNT###","currency":"###TRANSACTION_CURRENCY###","test_mode":"###TEST_MODE###","order_no":"###TRANSACTION_ORDER_NUMBER###","hook_url":"###YOUR_HOOK_URL###","create_token":1,"payment_data":{"account_holder":"###ACCOUNT_HOLDER###","account_number":"###ACCOUNT_NUMBER###","routing_number":"###ROUTING_NUMBER###"}},"custom":{"lang":"EN"}}';
#!/usr/bin/node
const https = require('https');
// data sent in the body of the request
const postData = JSON.stringify({
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
"customer_ip": "###CUSTOMER_IP###",
"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"birth_date": "1992-06-10",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
/*
"shipping": {
"same_as_billing": "1",
"city": "Kaiserslautern",
"company": "A.B.C. Ger�stbau GmbH",
"country_code": "DE",
"email": "test@novanet.de",
"first_name": "Norbert",
"house_no": "9",
"last_name": "Maier",
"mobile": "+491747781423",
"state": "Berlin",
"street": "Hauptstr",
"tel": "+49 089 123456",
"zip": "66862"
},
*/
},
"transaction": {
"payment_type": "DIRECT_DEBIT_ACH",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"test_mode": "###TEST_MODE###",
"hook_url": "###YOUR_HOOK_URL###",
"create_token": "1",
"payment_data": {
"account_holder": "###ACCOUNT_HOLDER###",
"account_number": "###ACCOUNT_NUMBER###",
"routing_number": "###ROUTING_NUMBER###"
}
},
"custom": {
"lang": "EN"
}
});
const options = {
hostname: 'payport.novalnet.de',
port: 443,
path: '/v2/payment',
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(postData),
'Charset': 'utf-8',
'Accept': 'application/json',
'X-NN-Access-Key': '###YOUR_ENCODED_PAYMENT_ACCESS_KEY###'
},
};
const req = https.request(options, (res) => {
console.log('statuscode:', res.statuscode);
// console.log('headers:', res.headers);
res.on('data', (d) => {
process.stdout.write(d);
});
});
req.on('error', (e) => {
console.error('ERROR: ',e);
});
// Write data to request body
req.write(postData);
req.end();
#!/usr/bin/python3
import http.client
import json
CONN = http.client.HTTPSConnection("payport.novalnet.de")
PAYLOAD = json.dumps({
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
"customer_ip": "###CUSTOMER_IP###",
"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"birth_date": "1983-07-02",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
#"shipping": {
#"same_as_billing": "1",
#"city": "Kaiserslautern",
#"company": "A.B.C. Ger�stbau GmbH",
#"country_code": "DE",
#"email": "test@novanet.de",
#"first_name": "Norbert",
#"house_no": "9",
#"last_name": "Maier",
#"mobile": "+491747781423",
#"state": "Berlin",
#"street": "Hauptstr",
#"tel": "+49 089 123456",
#"zip": "66862"
#}
},
"transaction": {
"payment_type": "DIRECT_DEBIT_ACH",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "EUR",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"test_mode": "###TEST_MODE###",
"hook_url": "###YOUR_HOOK_URL###",
"create_token": "1",
"payment_data": {
"account_holder" : "###ACCOUNT_HOLDER###",
"account_number": "###ACCOUNT_NUMBER###",
"routing_number": "###ROUTING_NUMBER###"
}
},
"custom": {
"lang": "EN"
}
})
HEADERS = {
'Content-Type': 'application/json',
'Charset': 'utf-8',
'Accept': 'application/json',
'X-NN-Access-Key': '###YOUR_ENCODED_PAYMENT_ACCESS_KEY###'
}
CONN.request("POST", "/v2/payment", PAYLOAD, HEADERS)
RES = CONN.getresponse()
DATA = RES.read()
print(DATA.decode("utf-8"))
#!/usr/lib/ruby
require "uri"
require "json"
require "net/http"
url = URI("https://payport.novalnet.de/v2/payment")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Accept"] = "application/json"
request["Charset"] = "utf-8"
request["X-NN-Access-Key"] = "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###"
request.body = JSON.dump({
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
"customer_ip": "###CUSTOMER_IP###",
"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"birth_date": "1983-07-02",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
#"shipping": {
#"same_as_billing": "1",
#"city": "Kaiserslautern",
#"company": "A.B.C. Ger�stbau GmbH",
#"country_code": "DE",
#"email": "test@novanet.de",
#"first_name": "Norbert",
#"house_no": "9",
#"last_name": "Maier",
#"mobile": "+491747781423",
#"state": "Berlin",
#"street": "Hauptstr",
#"tel": "+49 089 123456",
#"zip": "66862"
#}
},
"transaction": {
"payment_type": "DIRECT_DEBIT_ACH",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "EUR",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"test_mode": "###TEST_MODE###",
"hook_url": "###YOUR_HOOK_URL###",
"create_token": "1",
"payment_data": {
"account_holder" : "###ACCOUNT_HOLDER###",
"account_number": "###ACCOUNT_NUMBER###",
"routing_number": "###ROUTING_NUMBER###"
}
},
"custom": {
"lang": "EN"
}
})
response = https.request(request)
puts response.read_body
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://payport.novalnet.de/v2/payment"
method := "POST"
payload := strings.NewReader(`{
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
"customer_ip": "###CUSTOMER_IP###",
"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"birth_date": "1983-07-02",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
/*
"shipping": {
"same_as_billing": "1",
"city": "Kaiserslautern",
"company": "A.B.C. Ger�stbau GmbH",
"country_code": "DE",
"email": "test@novanet.de",
"first_name": "Norbert",
"house_no": "9",
"last_name": "Maier",
"mobile": "+491747781423",
"state": "Berlin",
"street": "Hauptstr",
"tel": "+49 089 123456",
"zip": "66862"
}
*/
},
"transaction": {
"payment_type": "DIRECT_DEBIT_ACH",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "EUR",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"test_mode": "###TEST_MODE###",
"hook_url": "###YOUR_HOOK_URL###",
"create_token": "1",
"payment_data": {
"account_holder": "###ACCOUNT_HOLDER###",
"account_number": "###ACCOUNT_NUMBER###",
"routing_number": "###ROUTING_NUMBER###"
}
},
"custom": {
"lang": "EN"
}
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
req.Header.Add("Charset", "utf-8")
req.Header.Add("X-NN-Access-Key", "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
/* List of required libraries (see also the import statements below):
- commons-logging-1.2.jar
- httpasyncclient-4.1.5.jar
- httpclient-4.3.3.jar
- httpcore-4.4.16.jar
- httpcore-nio-4.4.16.jar
- httpmime-4.5.14.jar
- json-20230227.jar
- unirest-java-3.9.00.jar
*/
import java.io.*;
import org.json.JSONArray;
import org.apache.http.auth.*;
import org.apache.http.nio.conn.*;
import org.apache.http.concurrent.*;
import org.apache.http.nio.reactor.*;
import org.apache.commons.logging.*;
import org.apache.http.entity.mime.content.*;
import kong.unirest.*;
public class DirectApi {
public static void main(String []args) throws Exception{
Unirest.config().connectTimeout(1000).socketTimeout(2000);
HttpResponse<String> response = Unirest.post("https://payport.novalnet.de/v2/payment")
.header("Content-Type", "application/json")
.header("Charset", "utf-8")
.header("Accept", "application/json")
.header("X-NN-Access-Key", "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###")
.body("{\"merchant\":{\"signature\":\"###YOUR_API_SIGNATURE###\", \"tariff\" : \"###YOUR_TARIFF_ID###\"},\"customer\":{\"customer_ip\":\"###CUSTOMER_IP###\",\"gender\":\"u\", \"first_name\": \"Max\", \"last_name\": \"Mustermann\", \"email\": \"###YOUR_MAIL###\", \"birth_date\":\"1983-07-02\",\"billing\":{\"street\":\"Musterstr\",\"house_no\":\"2\",\"city\":\"Musterhausen\",\"zip\":\"12345\",\"country_code\":\"DE\",\"tel\":\"+49 089 123456\"}},\"transaction\":{\"payment_type\": \"DIRECT_DEBIT_ACH\",\"amount\":\"###TRANSACTION_AMOUNT###\",\"currency\":\"EUR\",\"order_no\":\"###TRANSACTION_ORDER_NUMBER###\",\"test_mode\":\"###TEST_MODE###\",\"hook_url\":\"###YOUR_HOOK_URL###\",\"create_token\":\"1\",\"payment_data\":{\"account_holder\":\"###ACCOUNT_HOLDER###\",\"account_number\":\"###ACCOUNT_NUMBER###\",\"routing_number\":\"###ROUTING_NUMBER###\"}},\"custom\":{\"lang\":\"EN\"}}")
.asString();
System.out.println(response.getBody());
}
}
using System;
using System.Net.Http;
namespace DirectApiRequest
{
public class DirectApi {
public string check_direct_api_request() {
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://payport.novalnet.de/v2/payment");
request.Headers.Add("Charset", "utf-8");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("X-NN-Access-Key", "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###");
var content = new StringContent("{\"merchant\":{\"signature\":\"###YOUR_API_SIGNATURE###\", \"tariff\" : \"###YOUR_TARIFF_ID###\"},\"customer\":{\"customer_ip\":\"###CUSTOMER_IP###\",\"gender\":\"u\", \"first_name\": \"Max\", \"last_name\": \"Mustermann\", \"email\": \"###YOUR_MAIL###\", \"birth_date\":\"1983-07-02\",\"billing\":{\"street\":\"Musterstr\",\"house_no\":\"2\",\"city\":\"Musterhausen\",\"zip\":\"12345\",\"country_code\":\"DE\",\"tel\":\"+49 089 123456\"}},\"transaction\":{\"payment_type\": \"DIRECT_DEBIT_ACH\",\"amount\":\"###TRANSACTION_AMOUNT###\",\"currency\":\"EUR\",\"order_no\":\"###TRANSACTION_ORDER_NUMBER###\",\"test_mode\":\"###TEST_MODE###\",\"hook_url\":\"###YOUR_HOOK_URL###\",\"create_token\":\"1\",\"payment_data\":{\"account_holder\":\"###ACCOUNT_HOLDER###\",\"account_number\":\"###ACCOUNT_NUMBER###\",\"routing_number\":\"###ROUTING_NUMBER###\"}},\"custom\":{\"lang\":\"EN\"}}", null, "application/json");
request.Content = content;
var response = client.SendAsync(request).Result;
response.EnsureSuccessstatuscode();
var responseText = response.Content.ReadAsStringAsync().Result;
Console.WriteLine(responseText);
return responseText;
}
public static void Main() {
var testRequest = new DirectApi();
testRequest.check_direct_api_request();
}
}
}
<?php
// Need to enter your payment access key value here
$payment_access_key = '###YOUR_PAYMENT_ACCESS_KEY###';
// Now, have to encode the $payment_access_key value with the base64 encode
$encoded_data = base64_encode($payment_access_key);
// Action Endpoint
$endpoint = 'https://payport.novalnet.de/v2/payment';
// Build the Headers array
$headers = [
// The Content-Type should be "application/json"
'Content-Type:application/json',
// The charset should be "utf-8"
'Charset:utf-8',
// Optional
'Accept:application/json',
// The formed authenticate value (case-sensitive)
'X-NN-Access-Key:' . $encoded_data
];
$data = [];
// Build Merchant Data
$data['merchant'] = [
// Your API signature value
'signature' => '###YOUR_API_SIGNATURE###',
// Your corresponding tariff ID
'tariff' => '###YOUR_TARIFF_ID###'
];
// Build Customer Data
$data['customer'] = [
// Shopper's first name
'first_name' => 'Norbert',
// Shopper's last name
'last_name' => 'Maier',
// Shopper's email
'email' => '###YOUR_MAIL###',
// Shopper's Ip address
'customer_ip' => '###CUSTOMER_IP###',
// Shopper's customer number from the shop
'customer_no' => '###CUSTOMER_NUMBER###',
// Shopper's Telephone number
'tel' => '+49 089 123456',
// Shopper's Mobile number
'mobile' => '+49 174 7781423',
// Shopper's birthdate value YYYY-MM-DD
'birth_date' => '###BIRTHDATE###',
// Shopper's gender - Decomment it based on your usage
// 'gender' => 'u',
// Shopper's company vat ID value - Decomment it based on your usage
// 'vat_id' => 'DE123456',
// Shopper's company regestration number - Decomment it based on your usage
// 'reg_no' => 'HRB1234',
// Shopper's company tax ID value - Decomment it based on your usage
// 'tax_id' => '123/123/123',
// Shopper's session value - Decomment it based on your usage
// 'session' => 'fedgrgst5653653hdgfsvgdsf622627e',
// Shopper's fax number - Decomment it based on your usage
// 'fax' => '+49 89 654321',
// Shopper's billing address
'billing' => [
// House number
'house_no' => '9',
// Street
'street' => 'Hauptstr',
// City
'city' => 'Kaiserslautern',
// zip
'zip' => '66862',
// Country's ISO code
'country_code' => 'DE',
// Name of the company - Decomment it based on your usage
// 'company' => 'ABC GmbH',
// State
//'state' => 'Berlin'
],
/*
// Optional child object - Decomment it based on your usage
'shipping' => [
// Pass this parameter if the billing and the shipping address are identical
'same_as_billing' => '1',
// First name
'first_name' => 'Norbert',
// Last name
'last_name' => 'Maier',
// Email
'email' => 'test@novalnet.de',
// Street
'street' => 'Hauptstr',
// House number
'house_no' => '9',
// City
'city' => 'Kaiserslautern',
// zip
'zip' => '66862',
// Country's ISO code
'country_code' => 'DE',
// Name of the company
'company' => 'A.B.C. Gerüstbau GmbH',
// Telephone number
'tel' => '+49 089 123456',
// Mobile number
'mobile' => '+49 174 7781423',
// State
'state' => 'Berlin'
]
*/
];
// Build Transaction Data
$data['transaction'] = [
// The mode of the transaction
'test_mode' => '###TEST_MODE###',
// The Payment type of the transaction
'payment_type' => 'GUARANTEED_DIRECT_DEBIT_SEPA',
// The transaction Amount in smaller currency unit
'amount' => '###TRANSACTION_AMOUNT###',
// The transaction currency's ISO code
'currency' => '###TRANSACTION_CURRENCY###',
// The order number of the transaction
'order_no' => '###TRANSACTION_ORDER_NUMBER###',
// The Hook URL value for this particular transaction
'hook_url' => '###YOUR_HOOK_URL###',
// The reference related to your customer`s invoice of the order.
//'invoice_ref' => '###INVOICE_REF###',
// The invoice number related to your customer`s invoice of the order.
//'invoice_no' => '###INVOICE_NO###',
// The unique mandate reference of the written SEPA mandate.
// 'mandate_ref' => '###MANDATE_REF###',
// The start date at which the end-customer allowed Novalnet or the merchant to book from his/her account.
// 'mandate_date' => '###MANDATE_DATE###',
// The debit reason defines the text on the customer's proof of payment.
// 'debit_reason_1' => '###DEBIT_REASON_1###',
// 'debit_reason_2' => '###DEBIT_REASON_2###',
// 'debit_reason_3' => '###DEBIT_REASON_3###',
// 'debit_reason_4' => '###DEBIT_REASON_4###',
// The flag to create the token for the payment data - Decomment it based on your usage
'create_token' => 1,
// Build Payment Data
'payment_data' => [
'account_holder' => 'Max Mustermann',
'iban' => '###IBAN###',
'bic' => '###BIC###'
]
];
/*
// Subscription Data, used for processing Novalnet`s subscription - Optional object - Decomment it based on your usage
$data['subscription'] = [
// The interval between each cycle
'interval' => '1m',
// Subscription trial interval if applicable
'trial_interval' => '3m',
// Subscription trial interval amount if applicable
'trial_amount' => '150'
// Subscription expiry date
//'expiry_date' => 'YYYY-MM-DD'
];
*/
/*
// Marketplace data
$data['marketplace'] = [
// To submit amount for several affiliates to be booked
'tx_split' => [
'2261' => '100',
'2271' => '120'
],
// Commission type for the corresponding affiliates
'commission_split' => [
'2261' => [
'percentage' => '100',
'amount' => '700',
],
'2271' => [
'percentage' => '97'
]
]
];
// Affiliate Data
$data['affiliate'] = [
// To submit shares for several affiliates for the same transaction
'subvendors'=> [
'2261' => '100',
'2271' => '120'
],
// Commission type for several affiliates for the same transaction
//'commission_type'=> 'amount'
];
// Invoicing Data
$data['invoicing'] = [
// Total amount (excl. tax) should be mentioned here
'net_amount' => 5000,
// Total amount (incl. tax) should be mentioned here
'gross_amount' => 5000,
// Overall invoice tax percent should be mentioned here
'tax_percent' => 2,
// Overall invoice tax amount should be mentioned here
'tax_amount' => 2,
// Discount coupon percentage should be mentioned here
//'coupon_percent' => 1,
// Discount coupon amount should be mentioned here
//'coupon_amount' => 10,
// Individual product details should be mentioned here
'product_details' => [
[
//'code' => 'P001',
'name' => 'Product name',
//'group' => 'Product group',
//'description' => 'Product description',
'unit' => 2,
'quantity' => 2,
'unit_price' => 100,
'total_price' => 200,
'tax_amount' => 1,
'tax_percent' => 1,
//'discount' => 0,
//'note' => 'Note about the product'
]
],
// The notification which you wants to provide to the end-customer in invoice PDF.
'notice' => [
'1' => 'Notice 1',
'2' => 'Notice 2',
'3' => 'Notice 3'
],
// Customize the customer support details here
//'customer_support' => 'Max Mustermann | Email: support@yourshop.de',
// Custom Invoice number
//'custom_invoice_no' => 'INV-32',
// Send the invoice pdf to end customer
'send_invoice_pdf' => '1'
];
*/
// Custom Data - Optional object
$data['custom'] = [
// Shopper's selected language in shop
"lang" => "EN",
// Custom parameter's key - Optional object - Decomment it based on your usage
// 'input1' => 'your internal reference parameter name',
// Custom parameter's value - Optional object - Decomment it based on your usage
// 'inputval1' => 'your internal reference parameter value'
];
// Convert the array to JSON string
$json_data = json_encode($data);
// Handle Response
$response = send_request($json_data, $endpoint, $headers);
function send_request($data, $url, $headers) {
// Initiate cURL
$curl = curl_init();
// Set the url
curl_setopt($curl, CURLOPT_URL, $url);
// Set the result output to be a string
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
// Set the POST value to true (mandatory)
curl_setopt($curl, CURLOPT_POST, true);
// Set the post fields
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
// Set the headers
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
// Execute cURL
$result = curl_exec($curl);
// Handle cURL error
if (curl_errno($curl)) {
echo 'Request Error:' . curl_error($curl);
return $result;
}
// Close cURL
curl_close($curl);
// Decode the JSON string
$result = json_decode($result);
return $result;
}
?>
curl --location --request POST 'https://payport.novalnet.de/v2/payment' -H 'Content-Type: application/json' -H 'Charset:utf-8' -H 'Accept: application/json' -H 'X-NN-Access-Key: ###YOUR_ENCODED_PAYMENT_ACCESS_KEY###' -d '{"merchant":{"signature":"###YOUR_API_SIGNATURE###","tariff":"###YOUR_TARIFF_ID###"},"customer":{"first_name":"Norbert","last_name":"Maier","email":"###YOUR_MAIL###","customer_ip":"###CUSTOMER_IP###","customer_no":"###CUSTOMER_NUMBER###","tel":"+49 089 123456","mobile":"+49 174 7781423","birth_date":"###BIRTHDATE###","billing":{"house_no":"9","street":"Hauptstr","city":"Kaiserslautern","zip":"66862","country_code":"DE"}},"transaction":{"payment_type":"GUARANTEED_DIRECT_DEBIT_SEPA","amount":"###TRANSACTION_AMOUNT###","currency":"###TRANSACTION_CURRENCY###","test_mode":"###TEST_MODE###","order_no":"###TRANSACTION_ORDER_NUMBER###","hook_url":"###YOUR_HOOK_URL###","create_token":1,"payment_data":{"account_holder":"Max Mustermann","iban":"###IBAN###","bic":"###BIC###"}},"custom":{"lang":"EN"}}';
#!/usr/bin/node
const https = require('https');
// data sent in the body of the request
const postData = JSON.stringify({
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
"first_name": "Norbert",
"last_name": "Maier",
"email": "###YOUR_MAIL###",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
/*
"shipping": {
"same_as_billing": "1",
"city": "Kaiserslautern",
"company": "A.B.C. Gerüstbau GmbH",
"country_code": "DE",
"email": "test@novanet.de",
"first_name": "Norbert",
"house_no": "9",
"last_name": "Maier",
"mobile": "+491747781423",
"state": "Berlin",
"street": "Hauptstr",
"tel": "+49 089 123456",
"zip": "66862"
}
*/
"customer_ip": "###CUSTOMER_IP###",
"customer_no": "###CUSTOMER_NUMBER###",
"birth_date": "1992-06-10",
"tel": "+49 089 123456",
"mobile": "+49 174 7781423"
},
"transaction": {
"payment_type": "GUARANTEED_DIRECT_DEBIT_SEPA",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"test_mode":"###TEST_MODE###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"hook_url":"###YOUR_HOOK_URL###",
"create_token": 1,
"payment_data": {
"account_holder": "Max Mustermann",
"iban": "###IBAN###",
"bic": "###BIC###"
}
},
"custom": {
"lang": "EN"
}
});
const options = {
hostname: 'payport.novalnet.de',
port: 443,
path: '/v2/payment',
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(postData),
'Charset': 'utf-8',
'Accept': 'application/json',
'X-NN-Access-Key': '###YOUR_ENCODED_PAYMENT_ACCESS_KEY###'
},
};
const req = https.request(options, (res) => {
console.log('statuscode:', res.statuscode);
// console.log('headers:', res.headers);
res.on('data', (d) => {
process.stdout.write(d);
});
});
req.on('error', (e) => {
console.error('ERROR: ',e);
});
// Write data to request body
req.write(postData);
req.end();
#!/usr/bin/python3
import http.client
import json
CONN = http.client.HTTPSConnection("payport.novalnet.de")
PAYLOAD = json.dumps({
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
"first_name": "Norbert",
"last_name": "Maier",
"email": "###YOUR_MAIL###",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
#"shipping": {
#"same_as_billing": "1",
#"city": "Kaiserslautern",
#"company": "A.B.C. Gerüstbau GmbH",
#"country_code": "DE",
#"email": "test@novanet.de",
#"first_name": "Norbert",
#"house_no": "9",
#"last_name": "Maier",
#"mobile": "+491747781423",
#"state": "Berlin",
#"street": "Hauptstr",
#"tel": "+49 089 123456",
#"zip": "66862"
#},
"customer_ip": "###CUSTOMER_IP###",
"customer_no": "###CUSTOMER_NUMBER###",
"birth_date": "1992-06-10",
"tel": "+49 089 123456",
"mobile": "+49 174 7781423"
},
"transaction": {
"payment_type": "GUARANTEED_DIRECT_DEBIT_SEPA",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"test_mode":"###TEST_MODE###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"hook_url":"###YOUR_HOOK_URL###",
"create_token": 1,
"payment_data": {
"account_holder": "Max Mustermann",
"iban": "###IBAN###",
"bic": "###BIC###"
}
},
"custom": {
"lang": "EN"
}
})
HEADERS = {
'Content-Type': 'application/json',
'Charset': 'utf-8',
'Accept': 'application/json',
'X-NN-Access-Key': '###YOUR_ENCODED_PAYMENT_ACCESS_KEY###'
}
CONN.request("POST", "/v2/payment", PAYLOAD, HEADERS)
RES = CONN.getresponse()
DATA = RES.read()
print(DATA.decode("utf-8"))
#!/usr/lib/ruby
require "uri"
require "json"
require "net/http"
url = URI("https://payport.novalnet.de/v2/payment")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Accept"] = "application/json"
request["Charset"] = "utf-8"
request["X-NN-Access-Key"] = "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###"
request.body = JSON.dump({
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
"first_name": "Norbert",
"last_name": "Maier",
"email": "###YOUR_MAIL###",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
#"shipping": {
#"same_as_billing": "1",
#"city": "Kaiserslautern",
#"company": "A.B.C. Gerüstbau GmbH",
#"country_code": "DE",
#"email": "test@novanet.de",
#"first_name": "Norbert",
#"house_no": "9",
#"last_name": "Maier",
#"mobile": "+491747781423",
#"state": "Berlin",
#"street": "Hauptstr",
#"tel": "+49 089 123456",
#"zip": "66862"
#},
"customer_ip": "###CUSTOMER_IP###",
"customer_no": "###CUSTOMER_NUMBER###",
"birth_date": "1992-06-10",
"tel": "+49 089 123456",
"mobile": "+49 174 7781423"
},
"transaction": {
"payment_type": "GUARANTEED_DIRECT_DEBIT_SEPA",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"test_mode": "###TEST_MODE###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"hook_url": "###YOUR_HOOK_URL###",
"create_token": 1,
"payment_data": {
"account_holder": "Max Mustermann",
"iban": "###IBAN###",
"bic": "###BIC###"
}
},
"custom": {
"lang": "EN"
}
})
response = https.request(request)
puts response.read_body
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://payport.novalnet.de/v2/payment"
method := "POST"
payload := strings.NewReader(`{"merchant":{"signature":"###YOUR_API_SIGNATURE###", "tariff" : "###YOUR_TARIFF_ID###"},"customer": {
"first_name": "Norbert",
"last_name": "Maier",
"email": "###YOUR_MAIL###",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
/*
"shipping": {
"same_as_billing": "1",
"city": "Kaiserslautern",
"company": "A.B.C. Gerüstbau GmbH",
"country_code": "DE",
"email": "test@novanet.de",
"first_name": "Norbert",
"house_no": "9",
"last_name": "Maier",
"mobile": "+491747781423",
"state": "Berlin",
"street": "Hauptstr",
"tel": "+49 089 123456",
"zip": "66862"
}
*/
"customer_ip": "###CUSTOMER_IP###",
"customer_no": "###CUSTOMER_NUMBER###",
"birth_date": "1992-06-10",
"tel": "+49 089 123456",
"mobile": "+49 174 7781423"
},
"transaction": {
"payment_type": "GUARANTEED_DIRECT_DEBIT_SEPA",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"test_mode":"###TEST_MODE###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"hook_url":"###YOUR_HOOK_URL###",
"create_token": 1,
"payment_data": {
"account_holder": "Max Mustermann",
"iban": "###IBAN###",
"bic": "###BIC###"
}
},"custom":{"lang":"EN"}}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
req.Header.Add("Charset", "utf-8")
req.Header.Add("X-NN-Access-Key", "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
// request for creating a Token
/* List of required libraries (see also the import statements below):
- commons-logging-1.2.jar
- httpasyncclient-4.1.5.jar
- httpclient-4.3.3.jar
- httpcore-4.4.16.jar
- httpcore-nio-4.4.16.jar
- httpmime-4.5.14.jar
- json-20230227.jar
- unirest-java-3.9.00.jar
*/
import java.io.*;
import org.json.JSONArray;
import org.apache.http.auth.*;
import org.apache.http.nio.conn.*;
import org.apache.http.concurrent.*;
import org.apache.http.nio.reactor.*;
import org.apache.commons.logging.*;
import org.apache.http.entity.mime.content.*;
import kong.unirest.*;
public class DirectApi {
public static void main(String []args) throws Exception{
Unirest.config().connectTimeout(1000).socketTimeout(2000);
HttpResponse<String> response = Unirest.post("https://payport.novalnet.de/v2/payment")
.header("Content-Type", "application/json")
.header("Charset", "utf-8")
.header("Accept", "application/json")
.header("X-NN-Access-Key", "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###")
.body("{
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
"first_name": "Norbert",
"last_name": "Maier",
"email": "###YOUR_MAIL###",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
/*
"shipping": {
"same_as_billing": "1",
"city": "Kaiserslautern",
"company": "A.B.C. Gerüstbau GmbH",
"country_code": "DE",
"email": "test@novanet.de",
"first_name": "Norbert",
"house_no": "9",
"last_name": "Maier",
"mobile": "+491747781423",
"state": "Berlin",
"street": "Hauptstr",
"tel": "+49 089 123456",
"zip": "66862"
}
*/
"customer_ip": "###CUSTOMER_IP###",
"customer_no": "###CUSTOMER_NUMBER###",
"birth_date": "1992-06-10",
"tel": "+49 089 123456",
"mobile": "+49 174 7781423"
},
"transaction": {
"payment_type": "GUARANTEED_DIRECT_DEBIT_SEPA",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"test_mode":"###TEST_MODE###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"hook_url":"###YOUR_HOOK_URL###",
"create_token": 1,
"payment_data": {
"account_holder": "Max Mustermann",
"iban": "###IBAN###",
"bic": "###BIC###"
}
},
"custom": {
"lang": "EN"
}
}")
.asString();
System.out.println(response.getBody());
}
}
using System;
using System.Net.Http;
namespace DirectApiRequest
{
public class DirectApi {
public string check_direct_api_request() {
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://payport.novalnet.de/v2/payment");
request.Headers.Add("Charset", "utf-8");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("X-NN-Access-Key", "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###");
var content = new StringContent("{
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
"first_name": "Norbert",
"last_name": "Maier",
"email": "###YOUR_MAIL###",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
/*
"shipping": {
"same_as_billing": "1",
"city": "Kaiserslautern",
"company": "A.B.C. Gerüstbau GmbH",
"country_code": "DE",
"email": "test@novanet.de",
"first_name": "Norbert",
"house_no": "9",
"last_name": "Maier",
"mobile": "+491747781423",
"state": "Berlin",
"street": "Hauptstr",
"tel": "+49 089 123456",
"zip": "66862"
}
*/
"customer_ip": "###CUSTOMER_IP###",
"customer_no": "###CUSTOMER_NUMBER###",
"birth_date": "1992-06-10",
"tel": "+49 089 123456",
"mobile": "+49 174 7781423"
},
"transaction": {
"payment_type": "GUARANTEED_DIRECT_DEBIT_SEPA",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"test_mode":"###TEST_MODE###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"hook_url":"###YOUR_HOOK_URL###",
"create_token": 1,
"payment_data": {
"account_holder": "Max Mustermann",
"iban": "###IBAN###",
"bic": "###BIC###"
}
},
"custom": {
"lang": "EN"
}
}", null, "application/json");
request.Content = content;
var response = client.SendAsync(request).Result;
response.EnsureSuccessStatuscode();
var responseText = response.Content.ReadAsStringAsync().Result;
Console.WriteLine(responseText);
return responseText;
}
public static void Main() {
var testRequest = new DirectApi();
testRequest.check_direct_api_request();
}
}
}
<?php
// Need to enter your payment access key value here
$payment_access_key = '###YOUR_PAYMENT_ACCESS_KEY###';
// Now, have to encode the $payment_access_key value with the base64 encode
$encoded_data = base64_encode($payment_access_key);
// Action Endpoint
$endpoint = 'https://payport.novalnet.de/v2/payment';
// Build the Headers array
$headers = [
// The Content-Type should be "application/json"
'Content-Type:application/json',
// The charset should be "utf-8"
'Charset:utf-8',
// Optional
'Accept:application/json',
// The formed authenticate value (case-sensitive)
'X-NN-Access-Key:' . $encoded_data
];
$data = [];
// Build Merchant Data
$data['merchant'] = [
// Your API signature value
'signature' => '###YOUR_API_SIGNATURE###',
// Your corresponding tariff ID
'tariff' => '###YOUR_TARIFF_ID###'
];
// Build Customer Data
$data['customer'] = [
// Shopper's first name
'first_name' => 'Norbert',
// Shopper's last name
'last_name' => 'Maier',
// Shopper's email
'email' => '###YOUR_MAIL###',
// Shopper's Ip address
'customer_ip' => '###CUSTOMER_IP###',
// Shopper's customer number from the shop
'customer_no' => '###CUSTOMER_NUMBER###',
// Shopper's Telephone number
'tel' => '+49 089 123456',
// Shopper's Mobile number
'mobile' => '+49 174 7781423',
// Shopper's birthdate value YYYY-MM-DD
'birth_date' => '###BIRTHDATE###',
// Shopper's gender - Decomment it based on your usage
// 'gender' => 'u',
// Shopper's company vat ID value - Decomment it based on your usage
// 'vat_id' => 'DE123456',
// Shopper's company regestration number - Decomment it based on your usage
// 'reg_no' => 'HRB1234',
// Shopper's company tax ID value - Decomment it based on your usage
// 'tax_id' => '123/123/123',
// Shopper's session value - Decomment it based on your usage
// 'session' => 'fedgrgst5653653hdgfsvgdsf622627e',
// Shopper's fax number - Decomment it based on your usage
// 'fax' => '+49 89 654321',
// Shopper's billing address
'billing' => [
// House number
'house_no' => '9',
// Street
'street' => 'Hauptstr',
// City
'city' => 'Kaiserslautern',
// zip
'zip' => '66862',
// Country's ISO code
'country_code' => 'DE',
// Name of the company - Decomment it based on your usage
// 'company' => 'ABC GmbH',
// State
//'state' => 'Berlin'
],
/*
// Optional child object - Decomment it based on your usage
'shipping' => [
// Pass this parameter if the billing and the shipping address are identical
'same_as_billing' => '1',
// First name
'first_name' => 'Norbert',
// Last name
'last_name' => 'Maier',
// Email
'email' => 'test@novalnet.de',
// Street
'street' => 'Hauptstr',
// House number
'house_no' => '9',
// City
'city' => 'Kaiserslautern',
// zip
'zip' => '66862',
// Country's ISO code
'country_code' => 'DE',
// Name of the company
'company' => 'A.B.C. Gerüstbau GmbH',
// Telephone number
'tel' => '+49 089 123456',
// Mobile number
'mobile' => '+49 174 7781423',
// State
'state' => 'Berlin'
]
*/
];
// Build Transaction Data
$data['transaction'] = [
// The mode of the transaction
'test_mode' => '###TEST_MODE###',
// The Payment type of the transaction
'payment_type' => 'INSTALMENT_DIRECT_DEBIT_SEPA',
// The transaction Amount in smaller currency unit
'amount' => '###TRANSACTION_AMOUNT###',
// The transaction currency's ISO code
'currency' => '###TRANSACTION_CURRENCY###',
// The order number of the transaction
'order_no' => '###TRANSACTION_ORDER_NUMBER###',
// The Hook URL value for this particular transaction
'hook_url' => '###YOUR_HOOK_URL###',
// The reference related to your customer`s invoice of the order.
//'invoice_ref' => '###INVOICE_REF###',
// The invoice number related to your customer`s invoice of the order.
//'invoice_no' => '###INVOICE_NO###',
// The unique mandate reference of the written SEPA mandate.
// 'mandate_ref' => '###MANDATE_REF###',
// The start date at which the end-customer allowed Novalnet or the merchant to book from his/her account.
// 'mandate_date' => '###MANDATE_DATE###',
// The debit reason defines the text on the customer's proof of payment.
// 'debit_reason_1' => '###DEBIT_REASON_1###',
// 'debit_reason_2' => '###DEBIT_REASON_2###',
// 'debit_reason_3' => '###DEBIT_REASON_3###',
// 'debit_reason_4' => '###DEBIT_REASON_4###',
// The flag to create the token for the payment data - Decomment it based on your usage
'create_token' => 1,
// Build Payment Data
'payment_data' => [
'account_holder' => 'Max Mustermann',
'iban' => '###IBAN###',
'bic' => '###BIC###'
]
];
// Instalment data
$data['instalment'] = [
// The interval between each cycle
'interval' => '1m',
// Total number of cycles
'cycles' => '###INSTALMENT_CYCLES###'
];
/*
// Affiliate Data, used for the affiliate`s revenue split model - Optional object - Decomment it based on your usage
$data['affiliate'] = [
// To submit shares for several affiliates for the same transaction
'subvendors'=> [
'2261' => '100',
'2271' => '120'
],
// Commission type for several affiliates for the same transaction
//'commission_type'=> 'amount'
];
// Invoicing Data
$data['invoicing'] = [
// Total amount (excl. tax) should be mentioned here
'net_amount' => 5000,
// Total amount (incl. tax) should be mentioned here
'gross_amount' => 5000,
// Overall invoice tax percent should be mentioned here
'tax_percent' => 2,
// Overall invoice tax amount should be mentioned here
'tax_amount' => 2,
// Discount coupon percentage should be mentioned here
//'coupon_percent' => 1,
// Discount coupon amount should be mentioned here
//'coupon_amount' => 10,
// Individual product details should be mentioned here
'product_details' => [
[
//'code' => 'P001',
'name' => 'Product name',
//'group' => 'Product group',
//'description' => 'Product description',
'unit' => 2,
'quantity' => 2,
'unit_price' => 100,
'total_price' => 200,
'tax_amount' => 1,
'tax_percent' => 1,
//'discount' => 0,
//'note' => 'Note about the product'
]
],
// The notification which you wants to provide to the end-customer in invoice PDF.
'notice' => [
'1' => 'Notice 1',
'2' => 'Notice 2',
'3' => 'Notice 3'
],
// Customize the customer support details here
//'customer_support' => 'Max Mustermann | Email: support@yourshop.de',
// Custom Invoice number
//'custom_invoice_no' => 'INV-32',
// Send the invoice pdf to end customer
'send_invoice_pdf' => '1'
];
*/
// Custom Data - Optional object
$data['custom'] = [
// Shopper's selected language in shop
"lang" => "EN",
// Custom parameter's key - Optional object - Decomment it based on your usage
// 'input1' => 'your internal reference parameter name',
// Custom parameter's value - Optional object - Decomment it based on your usage
// 'inputval1' => 'your internal reference parameter value'
];
// Convert the array to JSON string
$json_data = json_encode($data);
// Handle Response
$response = send_request($json_data, $endpoint, $headers);
function send_request($data, $url, $headers) {
// Initiate cURL
$curl = curl_init();
// Set the url
curl_setopt($curl, CURLOPT_URL, $url);
// Set the result output to be a string
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
// Set the POST value to true (mandatory)
curl_setopt($curl, CURLOPT_POST, true);
// Set the post fields
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
// Set the headers
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
// Execute cURL
$result = curl_exec($curl);
// Handle cURL error
if (curl_errno($curl)) {
echo 'Request Error:' . curl_error($curl);
return $result;
}
// Close cURL
curl_close($curl);
// Decode the JSON string
$result = json_decode($result);
return $result;
}
?>
curl --location --request POST 'https://payport.novalnet.de/v2/payment' -H 'Content-Type: application/json' -H 'Charset:utf-8' -H 'Accept: application/json' -H 'X-NN-Access-Key: ###YOUR_ENCODED_PAYMENT_ACCESS_KEY###' -d '{"merchant":{"signature":"###YOUR_API_SIGNATURE###","tariff":"###YOUR_TARIFF_ID###"},"customer":{"first_name":"Norbert","last_name":"Maier","email":"###YOUR_MAIL###","customer_ip":"###CUSTOMER_IP###","customer_no":"###CUSTOMER_NUMBER###","tel":"+49 089 123456","mobile":"+49 174 7781423","birth_date":"###BIRTHDATE###","billing":{"house_no":"9","street":"Hauptstr","city":"Kaiserslautern","zip":"66862","country_code":"DE"}},"transaction":{"payment_type":"INSTALMENT_DIRECT_DEBIT_SEPA","amount":"###TRANSACTION_AMOUNT###","currency":"###TRANSACTION_CURRENCY###","test_mode":"###TEST_MODE###","order_no":"###TRANSACTION_ORDER_NUMBER###","hook_url":"###YOUR_HOOK_URL###","create_token":1,"payment_data":{"account_holder":"Max Mustermann","iban":"###IBAN###","bic":"###BIC###"}},"instalment":{"interval":"1m","cycles":"###INSTALMENT_CYCLES###"},"custom":{"lang":"EN"}}';
#!/usr/bin/node
const https = require('https');
// data sent in the body of the request
const postData = JSON.stringify({
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
"customer_ip": "###CUSTOMER_IP###",
"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"birth_date": "1992-06-10",
"billing": {
"street": "Musterstr",
"house_no": "2",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"tel": "+49 089 123456"
}
},
"transaction": {
"payment_type": "INSTALMENT_DIRECT_DEBIT_SEPA",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"test_mode": "###TEST_MODE###",
"hook_url": "###YOUR_HOOK_URL###",
"create_token": "1",
"payment_data": {
"account_holder" : "Max Mustermann",
"iban" : "###IBAN###",
"bic" : "###BIC###"
}
},
"instalment": {
"interval": "1m",
"cycles": "###INSTALMENT_CYCLES###",
},
"custom": {
"lang": "EN"
}
});
const options = {
hostname: 'payport.novalnet.de',
port: 443,
path: '/v2/payment',
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(postData),
'Charset': 'utf-8',
'Accept': 'application/json',
'X-NN-Access-Key': '###YOUR_ENCODED_PAYMENT_ACCESS_KEY###'
},
};
const req = https.request(options, (res) => {
console.log('statuscode:', res.statuscode);
// console.log('headers:', res.headers);
res.on('data', (d) => {
process.stdout.write(d);
});
});
req.on('error', (e) => {
console.error('ERROR: ',e);
});
// Write data to request body
req.write(postData);
req.end();
#!/usr/bin/python3
import http.client
import json
CONN = http.client.HTTPSConnection("payport.novalnet.de")
PAYLOAD = json.dumps({
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
"customer_ip": "###CUSTOMER_IP###",
"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"birth_date": "1983-07-02",
"billing": {
"street": "Musterstr",
"house_no": "2",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"tel": "+49 089 123456"
}
},
"transaction": {
"payment_type": "INSTALMENT_DIRECT_DEBIT_SEPA",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "EUR",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"test_mode": "###TEST_MODE###",
"hook_url": "###YOUR_HOOK_URL###",
"create_token": "1",
"payment_data": {
"account_holder" : "Max Mustermann",
"iban" : "###IBAN###",
"bic" : "###BIC###"
}
},
"instalment": {
"interval": "1m",
"cycles": "###INSTALMENT_CYCLES###",
},
"custom": {
"lang": "EN"
}
})
HEADERS = {
'Content-Type': 'application/json',
'Charset': 'utf-8',
'Accept': 'application/json',
'X-NN-Access-Key': '###YOUR_ENCODED_PAYMENT_ACCESS_KEY###'
}
CONN.request("POST", "/v2/payment", PAYLOAD, HEADERS)
RES = CONN.getresponse()
DATA = RES.read()
print(DATA.decode("utf-8"))
#!/usr/lib/ruby
require "uri"
require "json"
require "net/http"
url = URI("https://payport.novalnet.de/v2/payment")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Accept"] = "application/json"
request["Charset"] = "utf-8"
request["X-NN-Access-Key"] = "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###"
request.body = JSON.dump({
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
"customer_ip": "###CUSTOMER_IP###",
"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"birth_date": "1983-07-02",
"billing": {
"street": "Musterstr",
"house_no": "2",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"tel": "+49 089 123456"
}
},
"transaction": {
"payment_type": "INSTALMENT_DIRECT_DEBIT_SEPA",
"amount": "###CUSTOMER_IP###",
"currency": "EUR",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"test_mode": "###TEST_MODE###",
"hook_url": "###YOUR_HOOK_URL###",
"create_token": "1",
"payment_data": {
"account_holder" : "Max Mustermann",
"iban" : "###IBAN###",
"bic" : "###BIC###"
}
},
"instalment": {
"interval": "1m",
"cycles": "###INSTALMENT_CYCLES###",
},
"custom": {
"lang": "EN"
}
})
response = https.request(request)
puts response.read_body
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://payport.novalnet.de/v2/payment"
method := "POST"
payload := strings.NewReader(`{
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
"customer_ip": "###CUSTOMER_IP###",
"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"birth_date": "1983-07-02",
"billing": {
"street": "Musterstr",
"house_no": "2",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"tel": "+49 089 123456"
}
},
"transaction": {
"payment_type": "INSTALMENT_DIRECT_DEBIT_SEPA",
"amount": "###CUSTOMER_IP###",
"currency": "EUR",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"test_mode": "###TEST_MODE###",
"hook_url": "###YOUR_HOOK_URL###",
"create_token": "1",
"payment_data": {
"account_holder": "Max Mustermann",
"iban": "###IBAN###",
"bic": "###BIC###"
}
},
"instalment": {
"interval": "1m",
"cycles": "###INSTALMENT_CYCLES###"
},
"custom": {
"lang": "EN"
}
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
req.Header.Add("Charset", "utf-8")
req.Header.Add("X-NN-Access-Key", "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
/* List of required libraries (see also the import statements below):
- commons-logging-1.2.jar
- httpasyncclient-4.1.5.jar
- httpclient-4.3.3.jar
- httpcore-4.4.16.jar
- httpcore-nio-4.4.16.jar
- httpmime-4.5.14.jar
- json-20230227.jar
- unirest-java-3.9.00.jar
*/
import java.io.*;
import org.json.JSONArray;
import org.apache.http.auth.*;
import org.apache.http.nio.conn.*;
import org.apache.http.concurrent.*;
import org.apache.http.nio.reactor.*;
import org.apache.commons.logging.*;
import org.apache.http.entity.mime.content.*;
import kong.unirest.*;
public class DirectApi {
public static void main(String []args) throws Exception{
Unirest.config().connectTimeout(1000).socketTimeout(2000);
HttpResponse<String> response = Unirest.post("https://payport.novalnet.de/v2/payment")
.header("Content-Type", "application/json")
.header("Charset", "utf-8")
.header("Accept", "application/json")
.header("X-NN-Access-Key", "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###")
.body("{\"merchant\":{\"signature\":\"###YOUR_API_SIGNATURE###\", \"tariff\" : \"###YOUR_TARIFF_ID###\"},\"customer\":{\"customer_ip\":\"###CUSTOMER_IP###\",\"gender\":\"u\", \"first_name\": \"Max\", \"last_name\": \"Mustermann\", \"email\": \"###YOUR_MAIL###\", \"birth_date\":\"1983-07-02\",\"billing\":{\"street\":\"Musterstr\",\"house_no\":\"2\",\"city\":\"Musterhausen\",\"zip\":\"12345\",\"country_code\":\"DE\",\"tel\":\"+49 089 123456\"}},\"transaction\":{\"payment_type\": \"INSTALMENT_DIRECT_DEBIT_SEPA\",\"amount\":\"###CUSTOMER_IP###\",\"currency\":\"EUR\",\"order_no\":\"###TRANSACTION_ORDER_NUMBER###\",\"test_mode\":\"###TEST_MODE###\",\"hook_url\":\"###YOUR_HOOK_URL###\",\"create_token\":\"1\",\"payment_data\":{\"account_holder\":\"Max Mustermann\",\"iban\":\"###IBAN###\",\"bic\":\"###BIC###\"}},\"instalment\":{\"interval\":\"1m\",\"cycles\":\"2\"},\"custom\":{\"lang\":\"EN\"}}")
.asString();
System.out.println(response.getBody());
}
}
using System;
using System.Net.Http;
namespace DirectApiRequest
{
public class DirectApi {
public string check_direct_api_request() {
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://payport.novalnet.de/v2/payment");
request.Headers.Add("Charset", "utf-8");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("X-NN-Access-Key", "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###");
var content = new StringContent("{\"merchant\":{\"signature\":\"###YOUR_API_SIGNATURE###\", \"tariff\" : \"###YOUR_TARIFF_ID###\"},\"customer\":{\"customer_ip\":\"###CUSTOMER_IP###\",\"gender\":\"u\", \"first_name\": \"Max\", \"last_name\": \"Mustermann\", \"email\": \"###YOUR_MAIL###\", \"birth_date\":\"1983-07-02\",\"billing\":{\"street\":\"Musterstr\",\"house_no\":\"2\",\"city\":\"Musterhausen\",\"zip\":\"12345\",\"country_code\":\"DE\",\"tel\":\"+49 089 123456\"}},\"transaction\":{\"payment_type\": \"INSTALMENT_DIRECT_DEBIT_SEPA\",\"amount\":\"###CUSTOMER_IP###\",\"currency\":\"EUR\",\"order_no\":\"###TRANSACTION_ORDER_NUMBER###\",\"test_mode\":\"###TEST_MODE###\",\"hook_url\":\"###YOUR_HOOK_URL###\",\"create_token\":\"1\",\"payment_data\":{\"account_holder\":\"Max Mustermann\",\"iban\":\"###IBAN###\",\"bic\":\"###BIC###\"}},\"instalment\":{\"interval\":\"1m\",\"cycles\":\"2\"},\"custom\":{\"lang\":\"EN\"}}", null, "application/json");
request.Content = content;
var response = client.SendAsync(request).Result;
response.EnsureSuccessstatuscode();
var responseText = response.Content.ReadAsStringAsync().Result;
Console.WriteLine(responseText);
return responseText;
}
public static void Main() {
var testRequest = new DirectApi();
testRequest.check_direct_api_request();
}
}
}
<?php
// Need to enter your payment access key value here
$payment_access_key = '###YOUR_PAYMENT_ACCESS_KEY###';
// Now, have to encode the $payment_access_key value with the base64 encode
$encoded_data = base64_encode($payment_access_key);
// Action Endpoint
$endpoint = 'https://payport.novalnet.de/v2/payment';
// Build the Headers array
$headers = [
// The Content-Type should be "application/json"
'Content-Type:application/json',
// The charset should be "utf-8"
'Charset:utf-8',
// Optional
'Accept:application/json',
// The formed authenticate value (case-sensitive)
'X-NN-Access-Key:' . $encoded_data
];
$data = [];
// Build Merchant Data
$data['merchant'] = [
// Your API signature value
'signature' => '###YOUR_API_SIGNATURE###',
// Your corresponding tariff ID
'tariff' => '###YOUR_TARIFF_ID###'
];
// Build Customer Data
$data['customer'] = [
// Shopper's first name
'first_name' => 'Max',
// Shopper's last name
'last_name' => 'Mustermann',
// Shopper's email
'email' => '###YOUR_MAIL###',
// Shopper's Ip address
'customer_ip' => '###CUSTOMER_IP###',
// Shopper's customer number from the shop
'customer_no' => '###CUSTOMER_NUMBER###',
// Shopper's Telephone number
'tel' => '+49 089 123456',
// Shopper's Mobile number
'mobile' => '+49 174 7781423',
// Shopper's birthdate value YYYY-MM-DD
'birth_date' => '###BIRTHDATE###',
// Shopper's gender - Decomment it based on your usage
// 'gender' => 'u',
// Shopper's company vat ID value - Decomment it based on your usage
// 'vat_id' => 'DE123456',
// Shopper's company regestration number - Decomment it based on your usage
// 'reg_no' => 'HRB1234',
// Shopper's company tax ID value - Decomment it based on your usage
// 'tax_id' => '123/123/123',
// Shopper's session value - Decomment it based on your usage
// 'session' => 'fedgrgst5653653hdgfsvgdsf622627e',
// Shopper's fax number - Decomment it based on your usage
// 'fax' => '+49 89 654321',
// Shopper's billing address
'billing' => [
// House number
'house_no' => '2',
// Street
'street' => 'Musterstr',
// City
'city' => 'Musterhausen',
// zip
'zip' => '12345',
// Country's ISO code
'country_code' => 'DE',
// Name of the company - Decomment it based on your usage
'company' => 'ABC GmbH',
// State
//'state' => 'Berlin'
],
/*
// Optional child object - Decomment it based on your usage
'shipping' => [
// Pass this parameter if the billing and the shipping address are identical
'same_as_billing' => '1',
// First name
'first_name' => 'Norbert',
// Last name
'last_name' => 'Maier',
// Email
'email' => 'test@novalnet.de',
// Street
'street' => 'Hauptstr',
// House number
'house_no' => '9',
// City
'city' => 'Kaiserslautern',
// zip
'zip' => '66862',
// Country's ISO code
'country_code' => 'DE',
// Name of the company
'company' => 'A.B.C. Gerüstbau GmbH',
// Telephone number
'tel' => '+49 089 123456',
// Mobile number
'mobile' => '+49 174 7781423',
// State
'state' => 'Berlin'
]
*/
];
// Build Transaction Data
$data['transaction'] = [
// The mode of the transaction
'test_mode' => '###TEST_MODE###',
// The Payment type of the transaction
'payment_type' => 'SEPA_CREDIT',
// The transaction Amount in smaller currency unit
'amount' => '###TRANSACTION_AMOUNT###',
// The transaction currency's ISO code
'currency' => '###TRANSACTION_CURRENCY###',
// The order number of the transaction
'order_no' => '###TRANSACTION_ORDER_NUMBER###',
// The date on which the purchase is initiated
'order_date' => '###TRANSACTION_ORDER_DATE###',
// The amount in which the purchase is initiated
'order_amount' => '###TRANSACTION_ORDER_AMOUNT###',
// The order reference of the initial purchase
'order_reference' => '###TRANSACTION_ORDER_REFERENCE###',
// The credit reason defines the text on the customer's proof of payment.
'credit_reason_1' => 'www.test.com',
'credit_reason_2' => 'Test Product',
'credit_reason_3' => 'ABC Company',
'credit_reason_4' => 'INV-1234',
// The Hook URL value for this particular transaction
'hook_url' => '###YOUR_HOOK_URL###',
// The reference related to your customer`s invoice of the order.
//'invoice_ref' => '###INVOICE_REF###',
// The invoice number related to your customer`s invoice of the order.
//'invoice_no' => '###INVOICE_NO###',
// The flag to create the token for the payment data - Decomment it based on your usage
'create_token' => 1,
// Build Payment Data
'payment_data' => [
'account_holder' => 'Max Mustermann',
'iban' => '###IBAN###',
'bic' => '###BIC###'
]
];
/*
// Marketplace data
$data['marketplace'] = [
// To submit amount for several affiliates to be booked
'tx_split' => [
'2261' => '100',
'2271' => '120'
],
// Commission type for the corresponding affiliates
'commission_split' => [
'2261' => [
'percentage' => '100',
'amount' => '700',
],
'2271' => [
'percentage' => '97'
]
]
];
// Affiliate Data, used for the affiliate`s revenue split model - Optional object - Decomment it based on your usage
$data['affiliate'] = [
// To submit shares for several affiliates for the same transaction
'subvendors'=> [
'2261' => '20',
'2271' => '30'
],
// Commission type for several affiliates for the same transaction
//'commission_type'=> 'amount'
];
// Invoicing Data
$data['invoicing'] = [
// Total amount (excl. tax) should be mentioned here
'net_amount' => 5000,
// Total amount (incl. tax) should be mentioned here
'gross_amount' => 5000,
// Overall invoice tax percent should be mentioned here
'tax_percent' => 2,
// Overall invoice tax amount should be mentioned here
'tax_amount' => 2,
// Discount coupon percentage should be mentioned here
//'coupon_percent' => 1,
// Discount coupon amount should be mentioned here
//'coupon_amount' => 10,
// Individual product details should be mentioned here
'product_details' => [
[
//'code' => 'P001',
'name' => 'Product name',
//'group' => 'Product group',
//'description' => 'Product description',
'unit' => 2,
'quantity' => 2,
'unit_price' => 100,
'total_price' => 200,
'tax_amount' => 1,
'tax_percent' => 1,
//'discount' => 0,
//'note' => 'Note about the product'
]
],
// The notification which you wants to provide to the end-customer in invoice PDF.
'notice' => [
'1' => 'Notice 1',
'2' => 'Notice 2',
'3' => 'Notice 3'
],
// Customize the customer support details here
//'customer_support' => 'Max Mustermann | Email: support@yourshop.de',
// Custom Invoice number
//'custom_invoice_no' => 'INV-32',
// Send the invoice pdf to end customer
'send_invoice_pdf' => '1'
];
*/
// Custom Data - Optional object
$data['custom'] = [
// Shopper's selected language in shop
"lang" => "EN",
// Custom parameter's key - Optional object - Decomment it based on your usage
// 'input1' => 'your internal reference parameter name',
// Custom parameter's value - Optional object - Decomment it based on your usage
// 'inputval1' => 'your internal reference parameter value'
];
// Convert the array to JSON string
$json_data = json_encode($data);
// Handle Response
$response = send_request($json_data, $endpoint, $headers);
function send_request($data, $url, $headers) {
// Initiate cURL
$curl = curl_init();
// Set the url
curl_setopt($curl, CURLOPT_URL, $url);
// Set the result output to be a string
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
// Set the POST value to true (mandatory)
curl_setopt($curl, CURLOPT_POST, true);
// Set the post fields
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
// Set the headers
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
// Execute cURL
$result = curl_exec($curl);
// Handle cURL error
if (curl_errno($curl)) {
echo 'Request Error:' . curl_error($curl);
return $result;
}
// Close cURL
curl_close($curl);
// Decode the JSON string
$result = json_decode($result);
return $result;
}
?>
curl --location --request POST 'https://payport.novalnet.de/v2/payment' -H 'Content-Type: application/json' -H 'Charset:utf-8' -H 'Accept: application/json' -H 'X-NN-Access-Key: ###YOUR_ENCODED_PAYMENT_ACCESS_KEY###' -d '{"merchant":{"signature":"###YOUR_API_SIGNATURE###","tariff":"###YOUR_TARIFF_ID###"},"customer":{"first_name":"Max","last_name":"Mustermann","email":"###YOUR_MAIL###","customer_ip":"###CUSTOMER_IP###","customer_no":"###CUSTOMER_NUMBER###","tel":"+49 089 123456","mobile":"+49 174 7781423","billing":{"house_no":"2","street":"Musterstr","city":"Musterhausen","zip":"12345","country_code":"DE"}},"transaction":{"payment_type":"SEPA_CREDIT","amount":"###TRANSACTION_AMOUNT###","currency":"###TRANSACTION_CURRENCY###","test_mode":"###TEST_MODE###","order_no":"###TRANSACTION_ORDER_NUMBER###","hook_url":"###YOUR_HOOK_URL###","credit_reason_1":"www.test.com","credit_reason_2":"Test Product","credit_reason_3":"ABC Company","credit_reason_4":"INV-1234","order_date":"2021-06-10","order_amount":"2000","order_reference":"XXXYYYZZZ","create_token":1,"payment_data":{"account_holder":"Max Mustermann","iban":"###IBAN###","bic":"###BIC###"}},"custom":{"lang":"EN"}}';
#!/usr/bin/node
const https = require('https');
// data sent in the body of the request
const postData = JSON.stringify({
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_SUBSCRIPTION_TARIFF_ID###"
},
"customer": {
"customer_ip": "###CUSTOMER_IP###",
"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"birth_date": "1992-06-10",
"billing": {
"street": "Musterstr",
"house_no": "2",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"tel": "+49 089 123456"
}
},
"transaction": {
"payment_type": "SEPA_CREDIT",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"test_mode": "###TEST_MODE###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"order_date": "###TRANSACTION_ORDER_DATE###",
"order_amount": "###TRANSACTION_ORDER_AMOUNT###",
"order_reference": "###TRANSACTION_ORDER_REFERENCE###",
"credit_reason_1": "www.test.com",
"credit_reason_2": "Test Product",
"credit_reason_3": "ABC Company",
"credit_reason_4": "INV-1234",
"hook_url": "###YOUR_HOOK_URL###",
"create_token":1,
"payment_data": {
"account_holder" : "Max Mustermann",
"iban" : "###IBAN###",
"bic" : "###BIC###"
}
},
"custom": {
"lang": "EN"
}
});
const options = {
hostname: 'payport.novalnet.de',
port: 443,
path: '/v2/payment',
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(postData),
'Charset': 'utf-8',
'Accept': 'application/json',
'X-NN-Access-Key': '###YOUR_ENCODED_PAYMENT_ACCESS_KEY###'
},
};
const req = https.request(options, (res) => {
console.log('statuscode:', res.statuscode);
// console.log('headers:', res.headers);
res.on('data', (d) => {
process.stdout.write(d);
});
});
req.on('error', (e) => {
console.error('ERROR: ',e);
});
// Write data to request body
req.write(postData);
req.end();
#!/usr/bin/python3
import http.client
import json
CONN = http.client.HTTPSConnection("payport.novalnet.de")
PAYLOAD = json.dumps({
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
"customer_ip": "###CUSTOMER_IP###",
"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"birth_date": "1983-07-02",
"billing": {
"street": "Musterstr",
"house_no": "2",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"tel": "+49 089 123456"
}
},
"transaction": {
"payment_type": "SEPA_CREDIT",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"test_mode": "###TEST_MODE###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"order_date": "###TRANSACTION_ORDER_DATE###",
"order_amount": "###TRANSACTION_ORDER_AMOUNT###",
"order_reference": "###TRANSACTION_ORDER_REFERENCE###",
"credit_reason_1": "www.test.com",
"credit_reason_2": "Test Product",
"credit_reason_3": "ABC Company",
"credit_reason_4": "INV-1234",
"hook_url": "###YOUR_HOOK_URL###",
"create_token":1,
"payment_data": {
"account_holder" : "Max Mustermann",
"iban" : "###IBAN###",
"bic" : "###BIC###"
}
},
"custom": {
"lang": "EN"
}
})
HEADERS = {
'Content-Type': 'application/json',
'Charset': 'utf-8',
'Accept': 'application/json',
'X-NN-Access-Key': '###YOUR_ENCODED_PAYMENT_ACCESS_KEY###'
}
CONN.request("POST", "/v2/payment", PAYLOAD, HEADERS)
RES = CONN.getresponse()
DATA = RES.read()
print(DATA.decode("utf-8"))
#!/usr/lib/ruby
require "uri"
require "json"
require "net/http"
url = URI("https://payport.novalnet.de/v2/payment")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Accept"] = "application/json"
request["Charset"] = "utf-8"
request["X-NN-Access-Key"] = "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###"
request.body = JSON.dump({
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
"customer_ip": "###CUSTOMER_IP###",
"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"birth_date": "1983-07-02",
"billing": {
"street": "Musterstr",
"house_no": "2",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"tel": "+49 089 123456"
}
},
"transaction": {
"payment_type": "SEPA_CREDIT",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"test_mode": "###TEST_MODE###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"order_date": "###TRANSACTION_ORDER_DATE###",
"order_amount": "###TRANSACTION_ORDER_AMOUNT###",
"order_reference": "###TRANSACTION_ORDER_REFERENCE###",
"credit_reason_1": "www.test.com",
"credit_reason_2": "Test Product",
"credit_reason_3": "ABC Company",
"credit_reason_4": "INV-1234",
"hook_url": "###YOUR_HOOK_URL###",
"create_token":1,
"payment_data": {
"account_holder" : "Max Mustermann",
"iban" : "###IBAN###",
"bic" : "###BIC###"
}
},
"custom": {
"lang": "EN"
}
})
response = https.request(request)
puts response.read_body
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://payport.novalnet.de/v2/payment"
method := "POST"
payload := strings.NewReader(`{"merchant":{"signature":"###YOUR_API_SIGNATURE###", "tariff" : "###YOUR_TARIFF_ID###"},"customer":{"customer_ip":"###CUSTOMER_IP###","gender":"u", "first_name": "Max", "last_name": "Mustermann", "email": "###YOUR_MAIL###", "birth_date":"1983-07-02","billing":{"street":"Musterstr","house_no":"2","city":"Musterhausen","zip":"12345","country_code":"DE","tel":"+49 089 123456"}},"transaction": {
"payment_type": "SEPA_CREDIT",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"test_mode": "###TEST_MODE###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"order_date": "###TRANSACTION_ORDER_DATE###",
"order_amount": "###TRANSACTION_ORDER_AMOUNT###",
"order_reference": "###TRANSACTION_ORDER_REFERENCE###",
"credit_reason_1": "www.test.com",
"credit_reason_2": "Test Product",
"credit_reason_3": "ABC Company",
"credit_reason_4": "INV-1234",
"hook_url": "###YOUR_HOOK_URL###",
"create_token":1,
"payment_data": {
"account_holder" : "Max Mustermann",
"iban" : "###IBAN###",
"bic" : "###BIC###"
}
},"custom":{"lang":"EN"}}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
req.Header.Add("Charset", "utf-8")
req.Header.Add("X-NN-Access-Key", "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
/* List of required libraries (see also the import statements below):
- commons-logging-1.2.jar
- httpasyncclient-4.1.5.jar
- httpclient-4.3.3.jar
- httpcore-4.4.16.jar
- httpcore-nio-4.4.16.jar
- httpmime-4.5.14.jar
- json-20230227.jar
- unirest-java-3.9.00.jar
*/
import java.io.*;
import org.json.JSONArray;
import org.apache.http.auth.*;
import org.apache.http.nio.conn.*;
import org.apache.http.concurrent.*;
import org.apache.http.nio.reactor.*;
import org.apache.commons.logging.*;
import org.apache.http.entity.mime.content.*;
import kong.unirest.*;
public class DirectApi {
public static void main(String []args) throws Exception{
Unirest.config().connectTimeout(1000).socketTimeout(2000);
HttpResponse<String> response = Unirest.post("https://payport.novalnet.de/v2/payment")
.header("Content-Type", "application/json")
.header("Charset", "utf-8")
.header("Accept", "application/json")
.header("X-NN-Access-Key", "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###")
.body("{\"merchant\":{\"signature\":\"###YOUR_API_SIGNATURE###\", \"tariff\" : \"###YOUR_TARIFF_ID###\"},\"customer\":{\"customer_ip\":\"###CUSTOMER_IP###\",\"gender\":\"u\", \"first_name\": \"Max\", \"last_name\": \"Mustermann\", \"email\": \"###YOUR_MAIL###\", \"birth_date\":\"1983-07-02\",\"billing\":{\"street\":\"Musterstr\",\"house_no\":\"2\",\"city\":\"Musterhausen\",\"zip\":\"12345\",\"country_code\":\"DE\",\"tel\":\"+49 089 123456\"}},\"transaction\":{\"payment_type\": \"SEPA_CREDIT\",\"amount\":\"###TRANSACTION_AMOUNT###\",\"currency\":\"EUR\",\"order_no\":\"###TRANSACTION_ORDER_NUMBER###\",\"order_date\":\"###TRANSACTION_ORDER_DATE###\",\"order_amount\":\"###TRANSACTION_ORDER_AMOUNT###\",\"order_reference\":\"###TRANSACTION_ORDER_REFERENCE###\",\"test_mode\":\"###TEST_MODE###\",\"hook_url\":\"###YOUR_HOOK_URL###\",\"credit_reason_1\":\"www.test.com\",\"credit_reason_2\":\"Test Product\",\"credit_reason_3\":\"ABC Company\",\"credit_reason_4\":\"INV-1234\","create_token":1,\"payment_data\":{\"account_holder\":\"Max Mustermann\",\"iban\":\"###IBAN###\",\"bic\":\"###BIC###\"}},\"custom\":{\"lang\":\"EN\"}}")
.asString();
System.out.println(response.getBody());
}
}
using System;
using System.Net.Http;
namespace DirectApiRequest
{
public class DirectApi {
public string check_direct_api_request() {
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://payport.novalnet.de/v2/payment");
request.Headers.Add("Charset", "utf-8");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("X-NN-Access-Key", "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###");
var content = new StringContent("{\"merchant\":{\"signature\":\"###YOUR_API_SIGNATURE###\", \"tariff\" : \"###YOUR_TARIFF_ID###\"},\"customer\":{\"customer_ip\":\"###CUSTOMER_IP###\",\"gender\":\"u\", \"first_name\": \"Max\", \"last_name\": \"Mustermann\", \"email\": \"###YOUR_MAIL###\", \"birth_date\":\"1983-07-02\",\"billing\":{\"street\":\"Musterstr\",\"house_no\":\"2\",\"city\":\"Musterhausen\",\"zip\":\"12345\",\"country_code\":\"DE\",\"tel\":\"+49 089 123456\"}},\"transaction\":{\"payment_type\": \"SEPA_CREDIT\",\"amount\":\"###TRANSACTION_AMOUNT###\",\"currency\":\"EUR\",\"order_no\":\"###TRANSACTION_ORDER_NUMBER###\",,\"order_amount\":\"###TRANSACTION_ORDER_AMOUNT###\",\"order_reference\":\"###TRANSACTION_ORDER_REFERENCE###\",\"test_mode\":\"###TEST_MODE###\",\"hook_url\":\"###YOUR_HOOK_URL###\",\"credit_reason_1\":\"www.test.com\",\"credit_reason_2\":\"Test Product\",\"credit_reason_3\":\"ABC Company\",\"credit_reason_4\":\"INV-1234\","create_token":1,\"payment_data\":{\"account_holder\":\"Max Mustermann\",\"iban\":\"###IBAN###\",\"bic\":\"###BIC###\"}},\"custom\":{\"lang\":\"EN\"}}", null, "application/json");
request.Content = content;
var response = client.SendAsync(request).Result;
response.EnsureSuccessstatuscode();
var responseText = response.Content.ReadAsStringAsync().Result;
Console.WriteLine(responseText);
return responseText;
}
public static void Main() {
var testRequest = new DirectApi();
testRequest.check_direct_api_request();
}
}
}
<?php
// Need to enter your payment access key value here
$payment_access_key = '###YOUR_PAYMENT_ACCESS_KEY###';
// Now, have to encode the $payment_access_key value with the base64 encode
$encoded_data = base64_encode($payment_access_key);
// Action Endpoint
$endpoint = 'https://payport.novalnet.de/v2/payment';
// Build the Headers array
$headers = [
// The Content-Type should be "application/json"
'Content-Type:application/json',
// The charset should be "utf-8"
'Charset:utf-8',
// Optional
'Accept:application/json',
// The formed authenticate value (case-sensitive)
'X-NN-Access-Key:' . $encoded_data,
];
$data = [];
// Build Merchant Data
$data['merchant'] = [
// Your API signature value
'signature' => '###YOUR_API_SIGNATURE###',
// Your corresponding tariff ID
'tariff' => '###YOUR_TARIFF_ID###',
];
// Build Customer Data
$data['customer'] = [
// Shopper's first name
'first_name' => 'Max',
// Shopper's last name
'last_name' => 'Mustermann',
// Shopper's email
'email' => '###YOUR_MAIL###',
// Shopper's Ip address
'customer_ip' => '###CUSTOMER_IP###',
// Shopper's customer number from the shop
'customer_no' => '###CUSTOMER_NUMBER###',
// Shopper's Telephone number
'tel' => '+49 089 123456',
// Shopper's Mobile number
'mobile' => '+49 174 7781423',
// Shopper's birthdate value YYYY-MM-DD
'birth_date' => '###BIRTHDATE###',
// Shopper's gender - Decomment it based on your usage
// 'gender' => 'u',
// Shopper's company vat ID value - Decomment it based on your usage
// 'vat_id' => 'DE123456',
// Shopper's company regestration number - Decomment it based on your usage
// 'reg_no' => 'HRB1234',
// Shopper's company tax ID value - Decomment it based on your usage
// 'tax_id' => '123/123/123',
// Shopper's session value - Decomment it based on your usage
// 'session' => 'fedgrgst5653653hdgfsvgdsf622627e',
// Shopper's fax number - Decomment it based on your usage
// 'fax' => '+49 89 654321',
// Shopper's billing address
'billing' => [
// House number
'house_no' => '2',
// Street
'street' => 'Musterstr',
// City
'city' => 'Musterhausen',
// zip
'zip' => '12345',
// Country's ISO code
'country_code' => 'DE',
// Name of the company - Decomment it based on your usage
// 'company' => 'ABC GmbH',
// State
//'state' => 'Berlin'
]
/*
// Shopper's shipping address (optional)
'shipping' => [
// Pass this parameter if the billing and the shipping address are identical
'same_as_billing' => '1',
// First name
'first_name' => 'Norbert',
// Last name
'last_name' => 'Maier',
// Email
'email' => 'test@novalnet.de',
// Name of the company
'company' => 'A.B.C. Gerüstbau GmbH',
// House number
'house_no' => '9',
// Street
'street' => 'Hauptstr',
// City
'city' => 'Kaiserslautern',
// zip
'zip' => '66862',
// Country's ISO code
'country_code' => 'DE',
// Telephone number
'tel' => '+49 089 123456',
// Mobile number
'mobile' => '+49 174 7781423',
// State
'state' => 'Berlin'
],
*/
];
// Build Transaction Data
$data['transaction'] = [
// The Payment type of the transaction
'payment_type' => 'APPLEPAY',
// The transaction Amount in smaller currency unit
'amount' => '###TRANSACTION_AMOUNT###',
// The transaction currency's ISO code
'currency' => '###TRANSACTION_CURRENCY###',
// The mode of the transaction
'test_mode' => '###TEST_MODE###',
// The mode of the transaction
'order_no' => '###TRANSACTION_ORDER_NUMBER###',
// The Hook URL value for this particular transaction
'hook_url' => '###YOUR_HOOK_URL###',
// The reference related to your customer`s invoice of the order.
//'invoice_ref' => '###INVOICE_REF###',
// The invoice number related to your customer`s invoice of the order.
//'invoice_no' => '###INVOICE_NO###',
//'dynamic_descriptor' => 'www.yourshop.com',
// The flag to create the token for the payment data - Decomment it based on your usage
'create_token' => 1,
// Build Payment Data
'payment_data' => [
'wallet_token' => '###WALLET_TOKEN###'
]
];
/*
// Marketplace data
$data['marketplace'] = [
// To submit amount for several affiliates to be booked
'tx_split' => [
'2261' => '20',
'2271' => '30'
],
// Commission type for the corresponding affiliates
'commission_split' => [
'2261' => [
'percentage' => '100',
'amount' => '700',
],
'2271' => [
'percentage' => '97'
]
]
];
*/
/*
// Affiliate Data, used for the affiliate`s revenue split model - Optional object - Decomment it based on your usage
$data['affiliate'] = [
// To submit shares for several affiliates for the same transaction
'subvendors'=> [
'2261' => '100',
'2271' => '120'
],
// Commission type for several affiliates for the same transaction
//'commission_type'=> 'amount'
];
// Invoicing Data
$data['invoicing'] = [
// Total amount (excl. tax) should be mentioned here
'net_amount' => 5000,
// Total amount (incl. tax) should be mentioned here
'gross_amount' => 5000,
// Overall invoice tax percent should be mentioned here
'tax_percent' => 2,
// Overall invoice tax amount should be mentioned here
'tax_amount' => 2,
// Discount coupon percentage should be mentioned here
//'coupon_percent' => 1,
// Discount coupon amount should be mentioned here
//'coupon_amount' => 10,
// Individual product details should be mentioned here
'product_details' => [
[
//'code' => 'P001',
'name' => 'Product name',
//'group' => 'Product group',
//'description' => 'Product description',
'unit' => 2,
'quantity' => 2,
'unit_price' => 100,
'total_price' => 200,
'tax_amount' => 1,
'tax_percent' => 1,
//'discount' => 0,
//'note' => 'Note about the product'
]
],
// The notification which you wants to provide to the end-customer in invoice PDF.
'notice' => [
'1' => 'Notice 1',
'2' => 'Notice 2',
'3' => 'Notice 3'
],
// Customize the customer support details here
//'customer_support' => 'Max Mustermann | Email: support@yourshop.de',
// Custom Invoice number
//'custom_invoice_no' => 'INV-32',
// Send the invoice pdf to end customer
'send_invoice_pdf' => '1'
];
*/
// Custom Data - Optional object
$data['custom'] = [
// Shopper's selected language in shop
"lang" => "EN",
// Custom parameter's key - Optional object - Decomment it based on your usage
// 'input1' => 'your internal reference parameter name',
// Custom parameter's value - Optional object - Decomment it based on your usage
// 'inputval1' => 'your internal reference parameter value'
];
// Convert the array to JSON string
$json_data = json_encode($data);
// Handle Response
$response = send_request($json_data, $endpoint, $headers);
// Printing the response back to the Javascript to complete the Apple Pay purchase
print $response;
exit;
function send_request($data, $url, $headers) {
// Initiate cURL
$curl = curl_init();
// Set the url
curl_setopt($curl, CURLOPT_URL, $url);
// Set the result output to be a string
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
// Set the POST value to true (mandatory)
curl_setopt($curl, CURLOPT_POST, true);
// Set the post fields
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
// Set the headers
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
// Execute cURL
$result = curl_exec($curl);
// Handle cURL error
if (curl_errno($curl)) {
echo 'Request Error:' . curl_error($curl);
return $result;
}
// Close cURL
curl_close($curl);
return $result;
}
?>
curl --location --request POST 'https://payport.novalnet.de/v2/payment' -H 'Content-Type: application/json' -H 'Charset:utf-8' -H 'Accept: application/json' -H 'X-NN-Access-Key: ###YOUR_ENCODED_PAYMENT_ACCESS_KEY###' -d '{"merchant":{"signature":"###YOUR_API_SIGNATURE###","tariff":"###YOUR_TARIFF_ID###"},"customer":{"first_name":"Max","last_name":"Mustermann","email":"###YOUR_MAIL###","customer_ip":"###CUSTOMER_IP###","billing":{"house_no":"2","street":"Musterstr","city":"Musterhausen","zip":"12345","country_code":"DE"}},"transaction":{"payment_type":"APPLEPAY","amount":"###TRANSACTION_AMOUNT###","currency":"###TRANSACTION_CURRENCY###","test_mode":"###TEST_MODE###","order_no":"###TRANSACTION_ORDER_NUMBER###","hook_url":"###YOUR_HOOK_URL###","create_token":"1","payment_data":{"wallet_token":"###WALLET_TOKEN###"}},"custom":{"lang":"EN"}}';
#!/usr/bin/node
const https = require('https');
// data sent in the body of the request
const postData = JSON.stringify({
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
//"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "test@novalnet.de",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
"customer_ip": "###CUSTOMER_IP###",
//"customer_no": "###CUSTOMER_NUMBER###",
"birth_date": "1992-06-10",
//"tel": "+49 089 123456",
//"mobile": "+49 089 123456",
//"fax": "+49 89 654321",
/*
"shipping": {
"same_as_billing": "1",
"city": "Kaiserslautern",
"company": "A.B.C. Gerüstbau GmbH",
"country_code": "DE",
"email": "test@novanet.de",
"first_name": "Norbert",
"house_no": "9",
"last_name": "Maier",
"mobile": "+491747781423",
"state": "Berlin",
"street": "Hauptstr",
"tel": "+49 089 123456",
"zip": "66862"
},
*/
//"vat_id": "DE123456",
//"tax_id": "123/123/123",
//"reg_no": "HRB1234",
//"session": "fedgrgst5653653hdgfsvgdsf622627e",
//"no_nc": "1"
},
"transaction": {
"test_mode": "###TEST_MODE###",
"payment_type": "APPLEPAY",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"hook_url": "###HOOK_URL###",
"create_token": "1",
/*
"invoice_ref": "###INVOICE_REF###",
"invoice_no": "###INVOICE_NO###",
"dynamic_descriptor": "www.yourshop.com",
*/
"payment_data": {
"wallet_token" : "###WALLET_TOKEN###"
}
},
/*
"subscription": {
"interval": "2m",
"trial_interval": "3m",
"trial_amount": "150",
"expiry_date": "YYYY-MM-DD"
},
"instalment": {
"interval": "2m",
"cycles": "2"
},
"marketplace": {
"tx_split": {
"2261": "100",
"2271": "120"
},
"commission_split": {
"2261": {
"percentage": "100",
"amount": "700"
},
"2271": {
"percentage": "97"
}
}
},
"affiliate": {
"subvendors": {
"2261": "100",
"2271": "120"
},
//"commission_type": "amount"
},
"invoicing": {
"net_amount": 5000,
"gross_amount": 5000,
"tax_percent": 2,
"tax_amount": 2,
//"coupon_percent": 1,
//"coupon_amount": 10,
"product_details": [
{
//"code": "P001",
"name": "Product name",
//"group": "Product group",
//"description": "Product description",
"quantity": 2,
"unit": 2,
"unit_price": 100,
"total_price": 200,
"tax_amount": 1,
"tax_percent": 1,
//"discount": 0,
//"note": "Note about the product"
}
],
"notice": {
"1": "Notice 1",
"2": "Notice 2",
"3": "Notice 3"
},
//"customer_support": "Max Mustermann | Email: support@yourshop.de",
//"custom_invoice_no": "INV-32",
"send_invoice_pdf": "1"
},
*/
"custom": {
"lang": "EN"
}
});
const options = {
hostname: 'payport.novalnet.de',
port: 443,
path: '/v2/payment',
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(postData),
'Charset': 'utf-8',
'Accept': 'application/json',
'X-NN-Access-Key': '###YOUR_ENCODED_PAYMENT_ACCESS_KEY###'
},
};
const req = https.request(options, (res) => {
console.log('statuscode:', res.statuscode);
// console.log('headers:', res.headers);
res.on('data', (d) => {
process.stdout.write(d);
});
});
req.on('error', (e) => {
console.error('ERROR: ',e);
});
// Write data to request body
req.write(postData);
req.end();
#!/usr/bin/python3
import http.client
import json
CONN = http.client.HTTPSConnection("payport.novalnet.de")
PAYLOAD = json.dumps({
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
#"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "test@novalnet.de",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
"customer_ip": "###CUSTOMER_IP###",
#"customer_no": "###CUSTOMER_NUMBER###",
"birth_date": "1992-06-10",
#"tel": "+49 089 123456",
#"mobile": "+49 089 123456",
#"fax": "+49 89 654321",
#"shipping": {
#"same_as_billing": "1",
#"city": "Kaiserslautern",
#"company": "A.B.C. Gerüstbau GmbH",
#"country_code": "DE",
#"email": "test@novanet.de",
#"first_name": "Norbert",
#"house_no": "9",
#"last_name": "Maier",
#"mobile": "+491747781423",
#"state": "Berlin",
#"street": "Hauptstr",
#"tel": "+49 089 123456",
#"zip": "66862"
#},
#"vat_id": "DE123456",
#"tax_id": "123/123/123",
#"reg_no": "HRB1234",
#"session": "fedgrgst5653653hdgfsvgdsf622627e",
#"no_nc": "1"
},
"transaction": {
"test_mode": "###TEST_MODE###",
"payment_type": "APPLEPAY",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"hook_url": "###HOOK_URL###",
"create_token": "1",
#"invoice_ref": "###INVOICE_REF###",
#"invoice_no": "###INVOICE_NO###",
#"dynamic_descriptor": "www.yourshop.com",
"payment_data": {
"wallet_token" : "###WALLET_TOKEN###"
}
},
#"subscription": {
#"interval": "2m",
#"trial_interval": "3m",
#"trial_amount": "150",
#"expiry_date": "YYYY-MM-DD"
#},
#"instalment": {
#"interval": "2m",
#"cycles": "2"
#},
#"marketplace": {
# "tx_split": {
# "2261": "100",
# "2271": "120"
#},
#"commission_split": {
# "2261": {
# "percentage": "100",
# "amount": "700"
#},
#"2271": {
# "percentage": "97"
#}
#}
#},
#"affiliate": {
# "subvendors": {
# "2261": "100",
# "2271": "120"
# },
#"commission_type": "amount"
#},
#"invoicing": {
#"net_amount": 5000,
#"gross_amount": 5000,
#"tax_percent": 2,
#"tax_amount": 2,
#"coupon_percent": 1,
#"coupon_amount": 10,
#"product_details": [
#{
#"code": "P001",
#"name": "Product name",
#"group": "Product group",
#"description": "Product description",
#"quantity": 2,
#"unit": 2,
#"unit_price": 100,
#"total_price": 200,
#"tax_amount": 1,
#"tax_percent": 1,
#"discount": 0,
#"note": "Note about the product"
#}
#],
#"notice": {
# "1": "Notice 1",
# "2": "Notice 2",
# "3": "Notice 3"
# },
#"customer_support": "Max Mustermann | Email: support@yourshop.de",
#"custom_invoice_no": "INV-32",
#"send_invoice_pdf": "1"
#},
"custom": {
"lang": "EN"
}
})
HEADERS = {
'Content-Type': 'application/json',
'Charset': 'utf-8',
'Accept': 'application/json',
'X-NN-Access-Key': '###YOUR_ENCODED_PAYMENT_ACCESS_KEY###'
}
CONN.request("POST", "/v2/payment", PAYLOAD, HEADERS)
RES = CONN.getresponse()
DATA = RES.read()
print(DATA.decode("utf-8"))
#!/usr/lib/ruby
require "uri"
require "json"
require "net/http"
url = URI("https://payport.novalnet.de/v2/payment")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Accept"] = "application/json"
request["Charset"] = "utf-8"
request["X-NN-Access-Key"] = "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###"
request.body = JSON.dump({
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
#"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "test@novalnet.de",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
"customer_ip": "###CUSTOMER_IP###",
#"customer_no": "###CUSTOMER_NUMBER###",
"birth_date": "1992-06-10",
#"tel": "+49 089 123456",
#"mobile": "+49 089 123456",
#"fax": "+49 89 654321",
#"shipping": {
#"same_as_billing": "1",
#"city": "Kaiserslautern",
#"company": "A.B.C. Gerüstbau GmbH",
#"country_code": "DE",
#"email": "test@novanet.de",
#"first_name": "Norbert",
#"house_no": "9",
#"last_name": "Maier",
#"mobile": "+491747781423",
#"state": "Berlin",
#"street": "Hauptstr",
#"tel": "+49 089 123456",
#"zip": "66862"
#},
#"vat_id": "DE123456",
#"tax_id": "123/123/123",
#"reg_no": "HRB1234",
#"session": "fedgrgst5653653hdgfsvgdsf622627e",
#"no_nc": "1"
},
"transaction": {
"test_mode": "###TEST_MODE###",
"payment_type": "APPLEPAY",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"hook_url": "###HOOK_URL###",
"create_token": "1",
#"invoice_ref": "###INVOICE_REF###",
#"invoice_no": "###INVOICE_NO###",
#"dynamic_descriptor": "www.yourshop.com",
"payment_data": {
"wallet_token" : "###WALLET_TOKEN###"
}
},
#"subscription": {
#"interval": "2m",
#"trial_interval": "3m",
#"trial_amount": "150",
#"expiry_date": "YYYY-MM-DD"
#},
#"instalment": {
#"interval": "2m",
#"cycles": "2"
#},
#"marketplace": {
# "tx_split": {
# "2261": "100",
# "2271": "120"
#},
#"commission_split": {
# "2261": {
# "percentage": "100",
# "amount": "700"
#},
#"2271": {
# "percentage": "97"
#}
#}
#},
#"affiliate": {
# "subvendors": {
# "2261": "100",
# "2271": "120"
# },
#"commission_type": "amount"
#},
#"invoicing": {
#"net_amount": 5000,
#"gross_amount": 5000,
#"tax_percent": 2,
#"tax_amount": 2,
#"coupon_percent": 1,
#"coupon_amount": 10,
#"product_details": [
#{
#"code": "P001",
#"name": "Product name",
#"group": "Product group",
#"description": "Product description",
#"quantity": 2,
#"unit": 2,
#"unit_price": 100,
#"total_price": 200,
#"tax_amount": 1,
#"tax_percent": 1,
#"discount": 0,
#"note": "Note about the product"
#}
#],
#"notice": {
# "1": "Notice 1",
# "2": "Notice 2",
# "3": "Notice 3"
# },
#"customer_support": "Max Mustermann | Email: support@yourshop.de",
#"custom_invoice_no": "INV-32",
#"send_invoice_pdf": "1"
#},
"custom": {
"lang": "EN"
}
})
response = https.request(request)
puts response.read_body
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://payport.novalnet.de/v2/payment"
method := "POST"
payload := strings.NewReader(`{
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
//"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "test@novalnet.de",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
"customer_ip": "###CUSTOMER_IP###",
//"customer_no": "###CUSTOMER_NUMBER###",
"birth_date": "1992-06-10",
//"tel": "+49 089 123456",
//"mobile": "+49 089 123456",
//"fax": "+49 89 654321",
/*
"shipping": {
"same_as_billing": "1",
"city": "Kaiserslautern",
"company": "A.B.C. Gerüstbau GmbH",
"country_code": "DE",
"email": "test@novanet.de",
"first_name": "Norbert",
"house_no": "9",
"last_name": "Maier",
"mobile": "+491747781423",
"state": "Berlin",
"street": "Hauptstr",
"tel": "+49 089 123456",
"zip": "66862"
},
*/
//"vat_id": "DE123456",
//"tax_id": "123/123/123",
//"reg_no": "HRB1234",
//"session": "fedgrgst5653653hdgfsvgdsf622627e",
//"no_nc": "1"
},
"transaction": {
"test_mode": "###TEST_MODE###",
"payment_type": "APPLEPAY",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"hook_url": "###HOOK_URL###",
"create_token": "1",
/*
"invoice_ref": "###INVOICE_REF###",
"invoice_no": "###INVOICE_NO###",
"dynamic_descriptor": "www.yourshop.com",
*/
"payment_data": {
"wallet_token" : "###WALLET_TOKEN###"
}
},
/*
"subscription": {
"interval": "2m",
"trial_interval": "3m",
"trial_amount": "150",
"expiry_date": "YYYY-MM-DD"
},
"instalment": {
"interval": "2m",
"cycles": "2"
},
"marketplace": {
"tx_split": {
"2261": "100",
"2271": "120"
},
"commission_split": {
"2261": {
"percentage": "100",
"amount": "700"
},
"2271": {
"percentage": "97"
}
}
},
"affiliate": {
"subvendors": {
"2261": "100",
"2271": "120"
},
//"commission_type": "amount"
},
"invoicing": {
"net_amount": 5000,
"gross_amount": 5000,
"tax_percent": 2,
"tax_amount": 2,
//"coupon_percent": 1,
//"coupon_amount": 10,
"product_details": [
{
//"code": "P001",
"name": "Product name",
//"group": "Product group",
//"description": "Product description",
"quantity": 2,
"unit": 2,
"unit_price": 100,
"total_price": 200,
"tax_amount": 1,
"tax_percent": 1,
//"discount": 0,
//"note": "Note about the product"
}
],
"notice": {
"1": "Notice 1",
"2": "Notice 2",
"3": "Notice 3"
},
//"customer_support": "Max Mustermann | Email: support@yourshop.de",
//"custom_invoice_no": "INV-32",
"send_invoice_pdf": "1"
},
*/
"custom": {
"lang": "EN"
}
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
req.Header.Add("Charset", "utf-8")
req.Header.Add("X-NN-Access-Key", "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
/* List of required libraries (see also the import statements below):
- commons-logging-1.2.jar
- httpasyncclient-4.1.5.jar
- httpclient-4.3.3.jar
- httpcore-4.4.16.jar
- httpcore-nio-4.4.16.jar
- httpmime-4.5.14.jar
- json-20230227.jar
- unirest-java-3.9.00.jar
*/
import java.io.*;
import org.json.JSONArray;
import org.apache.http.auth.*;
import org.apache.http.nio.conn.*;
import org.apache.http.concurrent.*;
import org.apache.http.nio.reactor.*;
import org.apache.commons.logging.*;
import org.apache.http.entity.mime.content.*;
import kong.unirest.*;
public class DirectApi {
public static void main(String []args) throws Exception{
Unirest.config().connectTimeout(1000).socketTimeout(2000);
HttpResponse<String> response = Unirest.post("https://payport.novalnet.de/v2/payment")
.header("Content-Type", "application/json")
.header("Charset", "utf-8")
.header("Accept", "application/json")
.header("X-NN-Access-Key", "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###")
.body("{
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
//"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "test@novalnet.de",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
"customer_ip": "###CUSTOMER_IP###",
//"customer_no": "###CUSTOMER_NUMBER###",
"birth_date": "1992-06-10",
//"tel": "+49 089 123456",
//"mobile": "+49 089 123456",
//"fax": "+49 89 654321",
/*
"shipping": {
"same_as_billing": "1",
"city": "Kaiserslautern",
"company": "A.B.C. Gerüstbau GmbH",
"country_code": "DE",
"email": "test@novanet.de",
"first_name": "Norbert",
"house_no": "9",
"last_name": "Maier",
"mobile": "+491747781423",
"state": "Berlin",
"street": "Hauptstr",
"tel": "+49 089 123456",
"zip": "66862"
},
*/
//"vat_id": "DE123456",
//"tax_id": "123/123/123",
//"reg_no": "HRB1234",
//"session": "fedgrgst5653653hdgfsvgdsf622627e",
//"no_nc": "1"
},
"transaction": {
"test_mode": "###TEST_MODE###",
"payment_type": "APPLEPAY",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"hook_url": "###HOOK_URL###",
"create_token": "1",
/*
"invoice_ref": "###INVOICE_REF###",
"invoice_no": "###INVOICE_NO###",
"dynamic_descriptor": "www.yourshop.com",
*/
"payment_data": {
"wallet_token" : "###WALLET_TOKEN###"
}
},
/*
"subscription": {
"interval": "2m",
"trial_interval": "3m",
"trial_amount": "150",
"expiry_date": "YYYY-MM-DD"
},
"instalment": {
"interval": "2m",
"cycles": "2"
},
"marketplace": {
"tx_split": {
"2261": "100",
"2271": "120"
},
"commission_split": {
"2261": {
"percentage": "100",
"amount": "700"
},
"2271": {
"percentage": "97"
}
}
},
"affiliate": {
"subvendors": {
"2261": "100",
"2271": "120"
},
//"commission_type": "amount"
},
"invoicing": {
"net_amount": 5000,
"gross_amount": 5000,
"tax_percent": 2,
"tax_amount": 2,
//"coupon_percent": 1,
//"coupon_amount": 10,
"product_details": [
{
//"code": "P001",
"name": "Product name",
//"group": "Product group",
//"description": "Product description",
"quantity": 2,
"unit": 2,
"unit_price": 100,
"total_price": 200,
"tax_amount": 1,
"tax_percent": 1,
//"discount": 0,
//"note": "Note about the product"
}
],
"notice": {
"1": "Notice 1",
"2": "Notice 2",
"3": "Notice 3"
},
//"customer_support": "Max Mustermann | Email: support@yourshop.de",
//"custom_invoice_no": "INV-32",
"send_invoice_pdf": "1"
},
*/
"custom": {
"lang": "EN"
}
}")
.asString();
System.out.println(response.getBody());
}
}
using System;
using System.Net.Http;
namespace DirectApiRequest
{
public class DirectApi {
public string check_direct_api_request() {
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://payport.novalnet.de/v2/payment");
request.Headers.Add("Charset", "utf-8");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("X-NN-Access-Key", "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###");
var content = new StringContent("{
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
//"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "test@novalnet.de",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
"customer_ip": "###CUSTOMER_IP###",
//"customer_no": "###CUSTOMER_NUMBER###",
"birth_date": "1992-06-10",
//"tel": "+49 089 123456",
//"mobile": "+49 089 123456",
//"fax": "+49 89 654321",
/*
"shipping": {
"same_as_billing": "1",
"city": "Kaiserslautern",
"company": "A.B.C. Gerüstbau GmbH",
"country_code": "DE",
"email": "test@novanet.de",
"first_name": "Norbert",
"house_no": "9",
"last_name": "Maier",
"mobile": "+491747781423",
"state": "Berlin",
"street": "Hauptstr",
"tel": "+49 089 123456",
"zip": "66862"
},
*/
//"vat_id": "DE123456",
//"tax_id": "123/123/123",
//"reg_no": "HRB1234",
//"session": "fedgrgst5653653hdgfsvgdsf622627e",
//"no_nc": "1"
},
"transaction": {
"test_mode": "###TEST_MODE###",
"payment_type": "APPLEPAY",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"hook_url": "###HOOK_URL###",
"create_token": "1",
/*
"invoice_ref": "###INVOICE_REF###",
"invoice_no": "###INVOICE_NO###",
"dynamic_descriptor": "www.yourshop.com",
*/
"payment_data": {
"wallet_token" : "###WALLET_TOKEN###"
}
},
/*
"subscription": {
"interval": "2m",
"trial_interval": "3m",
"trial_amount": "150",
"expiry_date": "YYYY-MM-DD"
},
"instalment": {
"interval": "2m",
"cycles": "2"
},
"marketplace": {
"tx_split": {
"2261": "100",
"2271": "120"
},
"commission_split": {
"2261": {
"percentage": "100",
"amount": "700"
},
"2271": {
"percentage": "97"
}
}
},
"affiliate": {
"subvendors": {
"2261": "100",
"2271": "120"
},
//"commission_type": "amount"
},
"invoicing": {
"net_amount": 5000,
"gross_amount": 5000,
"tax_percent": 2,
"tax_amount": 2,
//"coupon_percent": 1,
//"coupon_amount": 10,
"product_details": [
{
//"code": "P001",
"name": "Product name",
//"group": "Product group",
//"description": "Product description",
"quantity": 2,
"unit": 2,
"unit_price": 100,
"total_price": 200,
"tax_amount": 1,
"tax_percent": 1,
//"discount": 0,
//"note": "Note about the product"
}
],
"notice": {
"1": "Notice 1",
"2": "Notice 2",
"3": "Notice 3"
},
//"customer_support": "Max Mustermann | Email: support@yourshop.de",
//"custom_invoice_no": "INV-32",
"send_invoice_pdf": "1"
},
*/
"custom": {
"lang": "EN"
}
}", null, "application/json");
request.Content = content;
var response = client.SendAsync(request).Result;
response.EnsureSuccessstatuscode();
var responseText = response.Content.ReadAsStringAsync().Result;
Console.WriteLine(responseText);
return responseText;
}
public static void Main() {
var testRequest = new DirectApi();
testRequest.check_direct_api_request();
}
}
}
<?php
// Need to enter your payment access key value here
$payment_access_key = '###YOUR_PAYMENT_ACCESS_KEY###';
// Now, have to encode the $payment_access_key value with the base64 encode
$encoded_data = base64_encode($payment_access_key);
// Action Endpoint
$endpoint = 'https://payport.novalnet.de/v2/payment';
// Build the Headers array
$headers = [
// The Content-Type should be "application/json"
'Content-Type:application/json',
// The charset should be "utf-8"
'Charset:utf-8',
// Optional
'Accept:application/json',
// The formed authenticate value (case-sensitive)
'X-NN-Access-Key:' . $encoded_data,
];
$data = [];
// Build Merchant Data
$data['merchant'] = [
// Your API signature value
'signature' => '###YOUR_API_SIGNATURE###',
// Your corresponding tariff ID
'tariff' => '###YOUR_TARIFF_ID###',
];
// Build Customer Data
$data['customer'] = [
// Shopper's first name
'first_name' => 'Max',
// Shopper's last name
'last_name' => 'Mustermann',
// Shopper's email
'email' => '###YOUR_MAIL###',
// Shopper's Ip address
'customer_ip' => '###CUSTOMER_IP###',
// Shopper's customer number from the shop
//'customer_no' => '###CUSTOMER_NUMBER###',
// Shopper's Telephone number
'tel' => '+49 089 123456',
// Shopper's Mobile number
'mobile' => '+49 174 7781423',
// Shopper's birthdate value YYYY-MM-DD
'birth_date' => '###BIRTHDATE###',
// Shopper's gender - Decomment it based on your usage
// 'gender' => 'u',
// Shopper's company vat ID value - Decomment it based on your usage
// 'vat_id' => 'DE123456',
// Shopper's company regestration number - Decomment it based on your usage
// 'reg_no' => 'HRB1234',
// Shopper's company tax ID value - Decomment it based on your usage
// 'tax_id' => '123/123/123',
// Shopper's session value - Decomment it based on your usage
// 'session' => 'fedgrgst5653653hdgfsvgdsf622627e',
// Shopper's fax number - Decomment it based on your usage
// 'fax' => '+49 89 654321',
// Shopper's billing address
'billing' => [
// House number
'house_no' => '2',
// Street
'street' => 'Musterstr',
// City
'city' => 'Musterhausen',
// zip
'zip' => '12345',
// Country's ISO code
'country_code' => 'DE',
// Name of the company - Decomment it based on your usage
// 'company' => 'ABC GmbH',
// State
//'state' => 'Berlin'
]
/*
// Shopper's shipping address (optional)
'shipping' => [
// Pass this parameter if the billing and the shipping address are identical
'same_as_billing' => '1',
// First name
'first_name' => 'Norbert',
// Last name
'last_name' => 'Maier',
// Email
'email' => 'test@novalnet.de',
// Name of the company
'company' => 'A.B.C. Gerüstbau GmbH',
// House number
'house_no' => '9',
// Street
'street' => 'Hauptstr',
// City
'city' => 'Kaiserslautern',
// zip
'zip' => '66862',
// Country's ISO code
'country_code' => 'DE',
// Telephone number
'tel' => '+49 089 123456',
// Mobile number
'mobile' => '+49 174 7781423',
// State
'state' => 'Berlin'
],
*/
];
// Build Transaction Data
$data['transaction'] = [
// The Payment type of the transaction
'payment_type' => 'GOOGLEPAY',
// The transaction Amount in smaller currency unit
'amount' => '###TRANSACTION_AMOUNT###',
// The transaction currency's ISO code
'currency' => '###TRANSACTION_CURRENCY###',
// The mode of the transaction
'test_mode' => '###TEST_MODE###',
// The mode of the transaction
'order_no' => '###TRANSACTION_ORDER_NUMBER###',
// The Hook URL value for this particular transaction
'hook_url' => '###YOUR_HOOK_URL###',
// The reference related to your customer`s invoice of the order.
//'invoice_ref' => '###INVOICE_REF###',
// The invoice number related to your customer`s invoice of the order.
//'invoice_no' => '###INVOICE_NO###',
// Processing the transaction with SCA authentication
//'enforce_3d' => '1',
//'dynamic_descriptor' => 'www.yourshop.com',
// The flag to create the token for the payment data - Decomment it based on your usage
'create_token' => 1,
// Build Payment Data
'payment_data' => [
'wallet_token' => '###WALLET_TOKEN###'
]
];
/*
// Affiliate Data, used for the affiliate`s revenue split model - Optional object - Decomment it based on your usage
$data['affiliate'] = [
// To submit shares for several affiliates for the same transaction
'subvendors'=> [
'2261' => '100',
'2271' => '120'
],
// Commission type for several affiliates for the same transaction
//'commission_type'=> 'amount'
];
// Invoicing Data
$data['invoicing'] = [
// Total amount (excl. tax) should be mentioned here
'net_amount' => 5000,
// Total amount (incl. tax) should be mentioned here
'gross_amount' => 5000,
// Overall invoice tax percent should be mentioned here
'tax_percent' => 2,
// Overall invoice tax amount should be mentioned here
'tax_amount' => 2,
// Discount coupon percentage should be mentioned here
//'coupon_percent' => 1,
// Discount coupon amount should be mentioned here
//'coupon_amount' => 10,
// Individual product details should be mentioned here
'product_details' => [
[
//'code' => 'P001',
'name' => 'Product name',
//'group' => 'Product group',
//'description' => 'Product description',
'unit' => 2,
'quantity' => 2,
'unit_price' => 100,
'total_price' => 200,
'tax_amount' => 1,
'tax_percent' => 1,
//'discount' => 0,
//'note' => 'Note about the product'
]
],
// The notification which you wants to provide to the end-customer in invoice PDF.
'notice' => [
'1' => 'Notice 1',
'2' => 'Notice 2',
'3' => 'Notice 3'
],
// Customize the customer support details here
//'customer_support' => 'Max Mustermann | Email: support@yourshop.de',
// Custom Invoice number
//'custom_invoice_no' => 'INV-32',
// Send the invoice pdf to end customer
'send_invoice_pdf' => '1'
];
*/
// Custom Data - Optional object
$data['custom'] = [
// Shopper's selected language in shop
"lang" => "EN",
// Custom parameter's key - Optional object - Decomment it based on your usage
// 'input1' => 'your internal reference parameter name',
// Custom parameter's value - Optional object - Decomment it based on your usage
// 'inputval1' => 'your internal reference parameter value'
];
// Convert the array to JSON string
$json_data = json_encode($data);
// Handle Response
$response = send_request($json_data, $endpoint, $headers);
// Printing the response back to the Javascript to complete the Google Pay purchase
print $response;
exit;
function send_request($data, $url, $headers) {
// Initiate cURL
$curl = curl_init();
// Set the url
curl_setopt($curl, CURLOPT_URL, $url);
// Set the result output to be a string
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
// Set the POST value to true (mandatory)
curl_setopt($curl, CURLOPT_POST, true);
// Set the post fields
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
// Set the headers
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
// Execute cURL
$result = curl_exec($curl);
// Handle cURL error
if (curl_errno($curl)) {
echo 'Request Error:' . curl_error($curl);
return $result;
}
// Close cURL
curl_close($curl);
return $result;
}
?>
curl --location --request POST 'https://payport.novalnet.de/v2/payment' -H 'Content-Type: application/json' -H 'Charset:utf-8' -H 'Accept: application/json' -H 'X-NN-Access-Key: ###YOUR_ENCODED_PAYMENT_ACCESS_KEY###' -d '{"merchant":{"signature":"###YOUR_API_SIGNATURE###","tariff":"###YOUR_TARIFF_ID###"},"customer":{"first_name":"Max","last_name":"Mustermann","email":"###YOUR_MAIL###","customer_ip":"###CUSTOMER_IP###","billing":{"house_no":"2","street":"Musterstr","city":"Musterhausen","zip":"12345","country_code":"DE"}},"transaction":{"payment_type":"GOOGLEPAY","amount":"###TRANSACTION_AMOUNT###","currency":"###TRANSACTION_CURRENCY###","test_mode":"###TEST_MODE###","order_no":"###TRANSACTION_ORDER_NUMBER###","hook_url":"###YOUR_HOOK_URL###","create_token":"1","payment_data":{"wallet_token":"###WALLET_TOKEN###"}},"custom":{"lang":"EN"}}';
#!/usr/bin/node
const https = require('https');
// data sent in the body of the request
const postData = JSON.stringify({
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
"customer_ip": "###CUSTOMER_IP###",
"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"birth_date": "1992-06-10",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
/*
"shipping": {
"same_as_billing": "1",
"city": "Kaiserslautern",
"company": "A.B.C. Gerüstbau GmbH",
"country_code": "DE",
"email": "test@novanet.de",
"first_name": "Norbert",
"house_no": "9",
"last_name": "Maier",
"mobile": "+491747781423",
"state": "Berlin",
"street": "Hauptstr",
"tel": "+49 089 123456",
"zip": "66862"
},
*/
},
"transaction": {
"payment_type": "GOOGLEPAY",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"test_mode": "###TEST_MODE###",
"hook_url": "###YOUR_HOOK_URL###",
"return_url": "###YOUR_RETURN_URL###",
"error_return_url": "###YOUR_ERROR_RETURN_URL###",
"create_token": "1",
"payment_data": {
"wallet_token":"###WALLET_TOKEN###"
}
},
"custom": {
"lang": "EN"
}
});
const options = {
hostname: 'payport.novalnet.de',
port: 443,
path: '/v2/payment',
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(postData),
'Charset': 'utf-8',
'Accept': 'application/json',
'X-NN-Access-Key': '###YOUR_ENCODED_PAYMENT_ACCESS_KEY###'
},
};
const req = https.request(options, (res) => {
console.log('statuscode:', res.statuscode);
// console.log('headers:', res.headers);
res.on('data', (d) => {
process.stdout.write(d);
});
});
req.on('error', (e) => {
console.error('ERROR: ',e);
});
// Write data to request body
req.write(postData);
req.end();
#!/usr/bin/python3
import http.client
import json
CONN = http.client.HTTPSConnection("payport.novalnet.de")
PAYLOAD = json.dumps({
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
"customer_ip": "###CUSTOMER_IP###",
"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"birth_date": "1983-07-02",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
#"shipping": {
#"same_as_billing": "1",
#"city": "Kaiserslautern",
#"company": "A.B.C. Gerüstbau GmbH",
#"country_code": "DE",
#"email": "test@novanet.de",
#"first_name": "Norbert",
#"house_no": "9",
#"last_name": "Maier",
#"mobile": "+491747781423",
#"state": "Berlin",
#"street": "Hauptstr",
#"tel": "+49 089 123456",
#"zip": "66862"
#}
},
"transaction": {
"payment_type": "GOOGLEPAY",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"test_mode": "###TEST_MODE###",
"hook_url": "###YOUR_HOOK_URL###",
"return_url": "###YOUR_RETURN_URL###",
"error_return_url": "###YOUR_ERROR_RETURN_URL###",
"create_token": "1",
"payment_data": {
"wallet_token":"###WALLET_TOKEN###"
}
},
"custom": {
"lang": "EN"
}
})
HEADERS = {
'Content-Type': 'application/json',
'Charset': 'utf-8',
'Accept': 'application/json',
'X-NN-Access-Key': '###YOUR_ENCODED_PAYMENT_ACCESS_KEY###'
}
CONN.request("POST", "/v2/payment", PAYLOAD, HEADERS)
RES = CONN.getresponse()
DATA = RES.read()
print(DATA.decode("utf-8"))
#!/usr/lib/ruby
require "uri"
require "json"
require "net/http"
url = URI("https://payport.novalnet.de/v2/payment")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Accept"] = "application/json"
request["Charset"] = "utf-8"
request["X-NN-Access-Key"] = "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###"
request.body = JSON.dump({
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
"customer_ip": "###CUSTOMER_IP###",
"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"birth_date": "1983-07-02",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
#"shipping": {
#"same_as_billing": "1",
#"city": "Kaiserslautern",
#"company": "A.B.C. Gerüstbau GmbH",
#"country_code": "DE",
#"email": "test@novanet.de",
#"first_name": "Norbert",
#"house_no": "9",
#"last_name": "Maier",
#"mobile": "+491747781423",
#"state": "Berlin",
#"street": "Hauptstr",
#"tel": "+49 089 123456",
#"zip": "66862"
#}
},
"transaction": {
"payment_type": "GOOGLEPAY",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"test_mode": "###TEST_MODE###",
"hook_url": "###YOUR_HOOK_URL###",
"return_url": "###YOUR_RETURN_URL###",
"error_return_url": "###YOUR_ERROR_RETURN_URL###",
"create_token": "1",
"payment_data": {
"wallet_token": "###WALLET_TOKEN###"
}
},
"custom": {
"lang": "EN"
}
})
response = https.request(request)
puts response.read_body
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://payport.novalnet.de/v2/payment"
method := "POST"
payload := strings.NewReader(`{
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
"customer_ip": "###CUSTOMER_IP###",
"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"birth_date": "1983-07-02",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
/*
"shipping": {
"same_as_billing": "1",
"city": "Kaiserslautern",
"company": "A.B.C. Gerüstbau GmbH",
"country_code": "DE",
"email": "test@novanet.de",
"first_name": "Norbert",
"house_no": "9",
"last_name": "Maier",
"mobile": "+491747781423",
"state": "Berlin",
"street": "Hauptstr",
"tel": "+49 089 123456",
"zip": "66862"
}
*/
},
"transaction": {
"payment_type": "GOOGLEPAY",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"test_mode": "###TEST_MODE###",
"hook_url": "###YOUR_HOOK_URL###",
"return_url": "###YOUR_RETURN_URL###",
"error_return_url": "###YOUR_ERROR_RETURN_URL###",
"create_token": "1",
"payment_data": {
"wallet_token": "###WALLET_TOKEN###"
}
},
"custom": {
"lang": "EN"
}
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
req.Header.Add("Charset", "utf-8")
req.Header.Add("X-NN-Access-Key", "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
/* List of required libraries (see also the import statements below):
- commons-logging-1.2.jar
- httpasyncclient-4.1.5.jar
- httpclient-4.3.3.jar
- httpcore-4.4.16.jar
- httpcore-nio-4.4.16.jar
- httpmime-4.5.14.jar
- json-20230227.jar
- unirest-java-3.9.00.jar
*/
import java.io.*;
import org.json.JSONArray;
import org.apache.http.auth.*;
import org.apache.http.nio.conn.*;
import org.apache.http.concurrent.*;
import org.apache.http.nio.reactor.*;
import org.apache.commons.logging.*;
import org.apache.http.entity.mime.content.*;
import kong.unirest.*;
public class DirectApi {
public static void main(String []args) throws Exception{
Unirest.config().connectTimeout(1000).socketTimeout(2000);
HttpResponse<String> response = Unirest.post("https://payport.novalnet.de/v2/payment")
.header("Content-Type", "application/json")
.header("Charset", "utf-8")
.header("Accept", "application/json")
.header("X-NN-Access-Key", "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###")
.body("{
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
//"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"birth_date": "1992-06-10",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
"customer_ip": "###CUSTOMER_IP###",
//"customer_no": "###CUSTOMER_NUMBER###",
//"tel": "+49 089 123456",
//"mobile": "+49 089 123456",
//"fax": "+49 89 654321",
/*
"shipping": {
"same_as_billing": "1",
"city": "Kaiserslautern",
"company": "A.B.C. Gerüstbau GmbH",
"country_code": "DE",
"email": "test@novanet.de",
"first_name": "Norbert",
"house_no": "9",
"last_name": "Maier",
"mobile": "+491747781423",
"state": "Berlin",
"street": "Hauptstr",
"tel": "+49 089 123456",
"zip": "66862"
},
*/
//"vat_id": "DE123456",
//"tax_id": "123/123/123",
//"reg_no": "HRB1234",
//"session": "fedgrgst5653653hdgfsvgdsf622627e",
//"no_nc": "1"
},
"transaction": {
"test_mode": "###TEST_MODE###",
"payment_type": "GOOGLEPAY",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"hook_url": "###YOUR_HOOK_URL###",
"create_token": "1",
"return_url": "###YOUR_RETURN_URL###",
"error_return_url": "###YOUR_ERROR_RETURN_URL###",
/*
"invoice_ref": "###INVOICE_REF###",
"invoice_no": "###INVOICE_NO###",
"dynamic_descriptor": "www.yourshop.com"
*/
},
"hosted_page": {
//"css_url": "https://www.demoshop.de/custom.css",
"logo": "###YOUR_SHOP_LOGO###",
/*"hide_payments": [
"CREDITCARD",
"DIRECT_DEBIT_SEPA",
"PREPAYMENT",
"IDEAL"
],*/
"display_payments": {'GOOGLEPAY'},
"hide_blocks": {'ADDRESS_FORM', 'SHOP_INFO', 'LANGUAGE_MENU', 'HEADER', 'TARIFF'},
"skip_pages": {'CONFIRMATION_PAGE', 'SUCCESS_PAGE', 'PAYMENT_PAGE'},
"url_shortener":"1",
"link_expiry":"YYYY-MM-DD HH:MM:SS",
//"link_notify":"['EMAIL']",
//"return_target":"top",
//"display_payments_mode":"['DIRECT', 'REDIRECT', 'INSTALMENT', 'SUBSCRIPTION']"
},
/*
"affiliate": {
"subvendors": {
"2261": "100",
"2271": "120"
},
//"commission_type": "amount"
},
"invoicing": {
"net_amount": 5000,
"gross_amount": 5000,
"tax_percent": 2,
"tax_amount": 2,
//"coupon_percent": 1,
//"coupon_amount": 10,
"product_details": [
{
//"code": "P001",
"name": "Product name",
//"group": "Product group",
//"description": "Product description",
"quantity": 2,
"unit": 2,
"unit_price": 100,
"total_price": 200,
"tax_amount": 1,
"tax_percent": 1,
//"discount": 0,
//"note": "Note about the product"
}
],
"notice": {
"1": "Notice 1",
"2": "Notice 2",
"3": "Notice 3"
},
//"customer_support": "Max Mustermann | Email: support@yourshop.de",
//"custom_invoice_no": "INV-32",
"send_invoice_pdf": "1"
},
*/
"custom": {
"lang": "EN"
}
}")
.asString();
System.out.println(response.getBody());
}
}
using System;
using System.Net.Http;
namespace DirectApiRequest
{
public class DirectApi {
public string check_direct_api_request() {
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://payport.novalnet.de/v2/payment");
request.Headers.Add("Charset", "utf-8");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("X-NN-Access-Key", "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###");
var content = new StringContent("{
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
//"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "test@novalnet.de",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
"customer_ip": "###CUSTOMER_IP###",
//"customer_no": "###CUSTOMER_NUMBER###",
"birth_date": "1992-06-10",
//"tel": "+49 089 123456",
//"mobile": "+49 089 123456",
//"fax": "+49 89 654321",
/*
"shipping": {
"same_as_billing": "1",
"city": "Kaiserslautern",
"company": "A.B.C. Gerüstbau GmbH",
"country_code": "DE",
"email": "test@novanet.de",
"first_name": "Norbert",
"house_no": "9",
"last_name": "Maier",
"mobile": "+491747781423",
"state": "Berlin",
"street": "Hauptstr",
"tel": "+49 089 123456",
"zip": "66862"
},
*/
//"vat_id": "DE123456",
//"tax_id": "123/123/123",
//"reg_no": "HRB1234",
//"session": "fedgrgst5653653hdgfsvgdsf622627e",
//"no_nc": "1"
},
"transaction": {
"test_mode": "###TEST_MODE###",
"payment_type": "GOOGLEPAY",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"hook_url": "###HOOK_URL###",
"create_token": "1",
/*
"invoice_ref": "###INVOICE_REF###",
"invoice_no": "###INVOICE_NO###",
"dynamic_descriptor": "www.yourshop.com",
*/
"payment_data": {
"wallet_token" : "###WALLET_TOKEN###"
}
},
/*
"subscription": {
"interval": "2m",
"trial_interval": "3m",
"trial_amount": "150",
"expiry_date": "YYYY-MM-DD"
},
"instalment": {
"interval": "2m",
"cycles": "2"
},
"marketplace": {
"tx_split": {
"2261": "100",
"2271": "120"
},
"commission_split": {
"2261": {
"percentage": "100",
"amount": "700"
},
"2271": {
"percentage": "97"
}
}
},
"affiliate": {
"subvendors": {
"2261": "100",
"2271": "120"
},
//"commission_type": "amount"
},
"invoicing": {
"net_amount": 5000,
"gross_amount": 5000,
"tax_percent": 2,
"tax_amount": 2,
//"coupon_percent": 1,
//"coupon_amount": 10,
"product_details": [
{
//"code": "P001",
"name": "Product name",
//"group": "Product group",
//"description": "Product description",
"quantity": 2,
"unit": 2,
"unit_price": 100,
"total_price": 200,
"tax_amount": 1,
"tax_percent": 1,
//"discount": 0,
//"note": "Note about the product"
}
],
"notice": {
"1": "Notice 1",
"2": "Notice 2",
"3": "Notice 3"
},
//"customer_support": "Max Mustermann | Email: support@yourshop.de",
//"custom_invoice_no": "INV-32",
"send_invoice_pdf": "1"
},
*/
"custom": {
"lang": "EN"
}
}", null, "application/json");
request.Content = content;
var response = client.SendAsync(request).Result;
response.EnsureSuccessstatuscode();
var responseText = response.Content.ReadAsStringAsync().Result;
Console.WriteLine(responseText);
return responseText;
}
public static void Main() {
var testRequest = new DirectApi();
testRequest.check_direct_api_request();
}
}
}
Affiliate 1 Configuration
Affiliate 2 Configuration
<?php
// Need to enter your payment access key value here
$payment_access_key = '###YOUR_PAYMENT_ACCESS_KEY###';
// Now, have to encode the $payment_access_key value with the base64 encode
$encoded_data = base64_encode($payment_access_key);
// Action Endpoint
$endpoint = 'https://payport.novalnet.de/v2/seamless/payment';
// Build the Headers array
$headers = [
// The Content-Type should be "application/json"
'Content-Type:application/json',
// The charset should be "utf-8"
'Charset:utf-8',
// Optional
'Accept:application/json',
// The formed authenticate value (case-sensitive)
'X-NN-Access-Key:' . $encoded_data
];
$data = [];
// Build Merchant Data
$data['merchant'] = [
// Your API signature value
'signature' => '###YOUR_API_SIGNATURE###',
// Your corresponding tariff ID
'tariff' => '###YOUR_TARIFF_ID###'
];
// Build Customer Data
$data['customer'] = [
// Shopper's first name
'first_name' => 'Max',
// Shopper's last name
'last_name' => 'Mustermann',
// Shopper's email
'email' => '###YOUR_MAIL###',
// Shopper's Ip address
'customer_ip' => '###CUSTOMER_IP###',
// Shopper's customer number from the shop
'customer_no' => '###CUSTOMER_NUMBER###',
// Shopper's Telephone number
'tel' => '+49 089 123456',
// Shopper's Mobile number
'mobile' => '+49 174 7781423',
// Shopper's birthdate value YYYY-MM-DD - Decomment it based on your usage
// 'birth_date' => '1992-06-10',
// Shopper's gender - Decomment it based on your usage
// 'gender' => 'u',
// Shopper's company vat ID value - Decomment it based on your usage
// 'vat_id' => 'DE123456',
// Shopper's company regestration number - Decomment it based on your usage
// 'reg_no' => 'HRB1234',
// Shopper's company tax ID value - Decomment it based on your usage
// 'tax_id' => '123/123/123',
// Shopper's session value - Decomment it based on your usage
// 'session' => 'fedgrgst5653653hdgfsvgdsf622627e',
// Shopper's fax number - Decomment it based on your usage
// 'fax' => '+49 89 654321',
// Use of minimal customer data
//'no_nc' => '1',
// Shopper's billing address
'billing' => [
// House number
'house_no' => '2',
// Street
'street' => 'Musterstr',
// City
'city' => 'Musterhausen',
// zip
'zip' => '12345',
// Country's ISO code
'country_code' => 'DE',
// Name of the company - Decomment it based on your usage
// 'company' => 'ABC GmbH',
// State
//'state' => 'Berlin'
],
/* Optional child object - Decomment it based on your usage
'shipping' => [
// Pass this parameter if the billing and the shipping address are identical
'same_as_billing' => '1',
// First name
'first_name' => 'Norbert',
// Last name
'last_name' => 'Maier',
// Email
'email' => 'test@novalnet.de',
// Street
'street' => 'Hauptstr',
// House number
'house_no' => '9',
// City
'city' => 'Kaiserslautern',
// zip
'zip' => '66862',
// Country's ISO code
'country_code' => 'DE',
// Telephone number
'tel' => '+49 089 123456',
// Name of the company
'company' => 'A.B.C. Ger�stbau GmbH',
// Mobile number
'mobile' => '+49 174 7781423',
// State
'state' => 'Berlin'
]
*/
];
// Build Transaction Data
$data['transaction'] = [
// The Payment type of the transaction
'payment_type' => 'CREDITCARD',
// The transaction amount in smaller currency unit
// For the predefined tariff, amount is not required to be passed explicitly
'amount' => '###TRANSACTION_AMOUNT###',
// The transaction currency's ISO code
// For the predefined tariff, currency is not required to be passed explicitly
'currency' => '###TRANSACTION_CURRENCY###',
// The mode of the transaction
'test_mode' => '###TEST_MODE###',
// The order number of the transaction
'order_no' => '###TRANSACTION_ORDER_NUMBER###',
// Need to be specify this for the Redirect payment types to which you need to redirect on SUCCESS
'return_url' => '###YOUR_RETURN_URL###',
// Need to be specify this for the Redirect payment types to which you need to redirect on FAILURE (optional)
'error_return_url' => '###YOUR_ERROR_RETURN_URL###',
// The Notify URL value for this particular transaction
'hook_url' => '###YOUR_HOOK_URL###',
// The flag to create the token for the payment data - Decomment it based on your usage
'create_token' => 1,
// The invoice number related to your customer`s invoice of the order.
//'invoice_no' => '###INVOICE_NO###',
// The reference related to your customer`s invoice of the order.
//'invoice_ref' => '###INVOICE_REF###',
// Processing the transaction with SCA authentication
//'enforce_3d' => '1',
//'verify_payment_data' => '1',
//'dynamic_descriptor' => 'www.yourshop.com',
// Build Payment Data
/*
'payment_data' => [
// Build your payment data based on your selected payment type
'token' => '###TOKEN###'
]
*/
];
// Hosted Payment page customizations
$data['hosted_page'] = [
// Change logo in the Hosted payment page
'logo' => '###YOUR_SHOP_LOGO###',
// Change the styling of the Hosted payment page - Decomment it based on your usage
// 'css_url' => '###YOUR_CSS_URL###',
// Payment types to be displayed in the Hosted Payment Page
'display_payments' => ['CREDITCARD'],
// Payment types to be hidden in the Hosted Payment Page - Used when necessary and display_payments when not in use
// 'hide_payments' => ['CREDITCARD', 'DIRECT_DEBIT_SEPA', 'INVOICE', 'IDEAL', 'PAYPAL'],
// Hide the following sections from the Hosted Payment Page
'hide_blocks' => ['ADDRESS_FORM', 'SHOP_INFO', 'LANGUAGE_MENU', 'HEADER', 'TARIFF'],
// Customize the display of the following pages
'skip_pages' => ['CONFIRMATION_PAGE', 'SUCCESS_PAGE', 'PAYMENT_PAGE'],
];
/*
// Subscription Data, used for processing Novalnet`s subscription - Optional object - Decomment it based on your usage
$data['subscription'] = [
// The interval between each cycle
'interval' => '1m',
// Subscription trial interval if applicable
'trial_interval' => '3m',
// Subscription trial interval amount if applicable
'trial_amount' => '150',
];
// Marketplace data, used for the affiliate`s marketplace model - Optional object - Decomment it based on your usage
$data['marketplace'] = [
// To submit amount for several affiliates to be booked
'tx_split' => [
'2261' => '20',
'2271' => '30',
],
];
// Affiliate Data, used for the affiliate`s revenue split model - Optional object - Decomment it based on your usage
$data['affiliate'] = [
// To submit shares for several affiliates for the same transaction
'subvendors'=> [
'2261' => '20',
'2271' => '30'
]
];
// Invoicing Data, used for the additional invoicing service - Optional data object - Decomment it based on your usage)
$data['invoicing'] = [
// Overall invoice tax percent should mentioned here
'tax_percent' => 2,
// Overall invoice tax amount should mentioned here
'tax_amount' => 2,
// Total amount (excl. tax) should mentioned here
'net_amount' => 5000,
// Total amount (incl. tax) should mentioned here
'gross_amount' => 5000,
// Individual product details should mentioned here
'product_details' => [
[
'code' => 'P001',
'name' => 'Product name',
'group' => 'Product group',
'description' => 'Product description',
'quantity' => 2,
'unit' => 2,
'unit_price' => 100,
'total_price' => 200,
'tax_amount' => 1,
'tax_percent' => 1,
'discount' => 0,
'note' => 'Note about the product'
]
],
// Customize the customer support details here
'customer_support' => 'Max Mustermann | Email: support@yourshop.de',
// Custom Invoice number
'custom_invoice_no' => 'INV-32'
];
*/
// Custom Data - Optional object - Decomment it based on your usage
$data['custom'] = [
// Shopper's selected language in shop
"lang" => "EN",
// Custom parameter's key
//'input1' => 'your internal reference parameter name',
// Custom parameter's value
//'inputval1' => 'your internal reference parameter value',
];
// Convert the array to JSON string
$json_data = json_encode($data);
// Handle Response
$response = send_request($json_data, $endpoint, $headers);
function send_request($data, $url, $headers) {
// Initiate cURL
$curl = curl_init();
// Set the url
curl_setopt($curl, CURLOPT_URL, $url);
// Set the result output to be a string
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
// Set the POST value to true (mandatory)
curl_setopt($curl, CURLOPT_POST, true);
// Set the post fields
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
// Set the headers
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
// Execute cURL
$result = curl_exec($curl);
// Handle cURL error
if (curl_errno($curl)) {
echo 'Request Error:' . curl_error($curl);
return $result;
}
// Close cURL
curl_close($curl);
// Decode the JSON string
$result = json_decode($result);
return $result;
}
?>
curl --location --request POST 'https://payport.novalnet.de/v2/seamless/payment' -H 'Content-Type: application/json' -H 'Charset:utf-8' -H 'Accept: application/json' -H 'X-NN-Access-Key: ###YOUR_ENCODED_PAYMENT_ACCESS_KEY###' -d '{"merchant":{"signature":"###YOUR_API_SIGNATURE###","tariff":"###YOUR_TARIFF_ID###"},"customer":{"first_name":"Max","last_name":"Mustermann","email":"###YOUR_MAIL###","customer_ip":"###CUSTOMER_IP###","customer_no":"###CUSTOMER_NUMBER###","tel":"+49 089 123456","mobile":"+49 174 7781423","billing":{"house_no":"2","street":"Musterstr","city":"Musterhausen","zip":"12345","country_code":"DE"}},"transaction":{"payment_type":"CREDITCARD","amount":"###TRANSACTION_AMOUNT###","currency":"###TRANSACTION_CURRENCY###","test_mode":"###TEST_MODE###","order_no":"###TRANSACTION_ORDER_NUMBER###","return_url":"###YOUR_RETURN_URL###","error_return_url":"###YOUR_ERROR_RETURN_URL###","hook_url":"###YOUR_HOOK_URL###","create_token":"1"},"hosted_page":{"logo":"###YOUR_SHOP_LOGO###","display_payments":["CREDITCARD"],"hide_blocks":["ADDRESS_FORM","SHOP_INFO","LANGUAGE_MENU","HEADER","TARIFF"],"skip_pages":["CONFIRMATION_PAGE","SUCCESS_PAGE","PAYMENT_PAGE"]}}';
#!/usr/bin/node
const https = require('https');
// data sent in the body of the request
const postData = JSON.stringify({
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
//"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"birth_date": "1992-06-10",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
"customer_ip": "###CUSTOMER_IP###",
//"customer_no": "###CUSTOMER_NUMBER###",
//"tel": "+49 089 123456",
//"mobile": "+49 089 123456",
//"fax": "+49 89 654321",
/*
"shipping": {
"same_as_billing": "1",
"city": "Kaiserslautern",
"company": "A.B.C. Ger�stbau GmbH",
"country_code": "DE",
"email": "test@novanet.de",
"first_name": "Norbert",
"house_no": "9",
"last_name": "Maier",
"mobile": "+491747781423",
"state": "Berlin",
"street": "Hauptstr",
"tel": "+49 089 123456",
"zip": "66862"
},
*/
//"vat_id": "DE123456",
//"tax_id": "123/123/123",
//"reg_no": "HRB1234",
//"session": "fedgrgst5653653hdgfsvgdsf622627e",
//"no_nc": "1"
},
"transaction": {
"payment_type": "CREDITCARD",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"test_mode": "###TEST_MODE###",
"hook_url": "###YOUR_HOOK_URL###",
"create_token": "1",
"return_url": "###YOUR_ERROR_RETURN_URL###",
"error_return_url": "###YOUR_HOOK_URL###",
/*
"invoice_ref": "###INVOICE_REF###",
"invoice_no": "###INVOICE_NO###",
'enforce_3d': '1',
'verify_payment_data': '1',
"dynamic_descriptor": "www.yourshop.com",
*/
},
"hosted_page": {
//"css_url": "https://www.demoshop.de/custom.css",
"logo": "###YOUR_SHOP_LOGO###",
/*"hide_payments": [
"CREDITCARD",
"DIRECT_DEBIT_SEPA",
"PREPAYMENT",
"IDEAL"
],*/
"display_payments":["CREDITCARD"],
"hide_blocks":["ADDRESS_FORM","SHOP_INFO","LANGUAGE_MENU","HEADER","TARIFF"],
"skip_pages":["CONFIRMATION_PAGE","SUCCESS_PAGE","PAYMENT_PAGE"],
"url_shortener":"1",
"link_expiry":"YYYY-MM-DD HH:MM:SS",
//"link_notify":"['EMAIL']",
//"return_target":"top",
//"display_payments_mode":"['DIRECT', 'REDIRECT', 'INSTALMENT', 'SUBSCRIPTION']"
},
/*
"affiliate": {
"subvendors": {
"2261": "100",
"2271": "120"
},
//"commission_type": "amount"
},
"invoicing": {
"net_amount": 5000,
"gross_amount": 5000,
"tax_percent": 2,
"tax_amount": 2,
//"coupon_percent": 1,
//"coupon_amount": 10,
"product_details": [
{
//"code": "P001",
"name": "Product name",
//"group": "Product group",
//"description": "Product description",
"quantity": 2,
"unit": 2,
"unit_price": 100,
"total_price": 200,
"tax_amount": 1,
"tax_percent": 1,
//"discount": 0,
//"note": "Note about the product"
}
],
"notice": {
"1": "Notice 1",
"2": "Notice 2",
"3": "Notice 3"
},
//"customer_support": "Max Mustermann | Email: support@yourshop.de",
//"custom_invoice_no": "INV-32",
"send_invoice_pdf": "1"
},
*/
"custom": {
"lang": "EN"
}
});
const options = {
hostname: 'payport.novalnet.de',
port: 443,
path: '/v2/seamless/payment',
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(postData),
'Charset': 'utf-8',
'Accept': 'application/json',
'X-NN-Access-Key': '###YOUR_ENCODED_PAYMENT_ACCESS_KEY###'
},
};
const req = https.request(options, (res) => {
console.log('statuscode:', res.statuscode);
// console.log('headers:', res.headers);
res.on('data', (d) => {
process.stdout.write(d);
});
});
req.on('error', (e) => {
console.error('ERROR: ',e);
});
// Write data to request body
req.write(postData);
req.end();
#!/usr/bin/python3
import http.client
import json
CONN = http.client.HTTPSConnection("payport.novalnet.de")
PAYLOAD = json.dumps({
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
#"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "test@novalnet.de",
"birth_date": "1992-06-10",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
"customer_ip": "###CUSTOMER_IP###",
#"customer_no": "###CUSTOMER_NUMBER###",
#"tel": "+49 089 123456",
#"mobile": "+49 089 123456",
#"fax": "+49 89 654321",
#"shipping": {
#"same_as_billing": "1",
#"city": "Kaiserslautern",
#"company": "A.B.C. Ger�stbau GmbH",
#"country_code": "DE",
#"email": "test@novanet.de",
#"first_name": "Norbert",
#"house_no": "9",
#"last_name": "Maier",
#"mobile": "+491747781423",
#"state": "Berlin",
#"street": "Hauptstr",
#"tel": "+49 089 123456",
#"zip": "66862"
#},
#"vat_id": "DE123456",
#"tax_id": "123/123/123",
#"reg_no": "HRB1234",
#"session": "fedgrgst5653653hdgfsvgdsf622627e",
#"no_nc": "1"
},
"transaction": {
"test_mode": "###TEST_MODE###",
"payment_type": "CREDITCARD",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"hook_url": "###HOOK_URL###",
"create_token": "1",
"return_url": "###YOUR_RETURN_URL###",
"error_return_url": "###YOUR_ERROR_RETURN_URL###",
#"invoice_ref": "###INVOICE_REF###",
#"invoice_no": "###INVOICE_NO###",
#"dynamic_descriptor": "www.yourshop.com"
},
"hosted_page": {
#"css_url": "https://www.demoshop.de/custom.css",
"logo": "###YOUR_SHOP_LOGO###",
#"hide_payments": [
#"CREDITCARD",
#"DIRECT_DEBIT_SEPA",
#"PREPAYMENT",
#"IDEAL"
#],
"display_payments":["CREDITCARD"],
"hide_blocks":["ADDRESS_FORM","SHOP_INFO","LANGUAGE_MENU","HEADER","TARIFF"],
"skip_pages":["CONFIRMATION_PAGE","SUCCESS_PAGE","PAYMENT_PAGE"],
"url_shortener": "1",
"link_expiry": "YYYY-MM-DD HH:MM:SS",
#"link_notify":"['EMAIL']",
#"return_target":"top",
#"display_payments_mode":"['DIRECT', 'REDIRECT', 'INSTALMENT', 'SUBSCRIPTION']"
},
#"affiliate": {
# "subvendors": {
# "2261": "100",
# "2271": "120"
# },
#"commission_type": "amount"
#},
#"invoicing": {
#"net_amount": 5000,
#"gross_amount": 5000,
#"tax_percent": 2,
#"tax_amount": 2,
#"coupon_percent": 1,
#"coupon_amount": 10,
#"product_details": [
#{
#"code": "P001",
#"name": "Product name",
#"group": "Product group",
#"description": "Product description",
#"quantity": 2,
#"unit": 2,
#"unit_price": 100,
#"total_price": 200,
#"tax_amount": 1,
#"tax_percent": 1,
#"discount": 0,
#"note": "Note about the product"
#}
#],
#"notice": {
# "1": "Notice 1",
# "2": "Notice 2",
# "3": "Notice 3"
# },
#"customer_support": "Max Mustermann | Email: support@yourshop.de",
#"custom_invoice_no": "INV-32",
#"send_invoice_pdf": "1"
#},
"custom": {
"lang": "EN"
}
})
HEADERS = {
'Content-Type': 'application/json',
'Charset': 'utf-8',
'Accept': 'application/json',
'X-NN-Access-Key': '###YOUR_ENCODED_PAYMENT_ACCESS_KEY###'
}
CONN.request("POST", "/v2/seamless/payment", PAYLOAD, HEADERS)
RES = CONN.getresponse()
DATA = RES.read()
print(DATA.decode("utf-8"))
#!/usr/lib/ruby
require "uri"
require "json"
require "net/http"
url = URI("https://payport.novalnet.de/v2/seamless/payment")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Accept"] = "application/json"
request["Charset"] = "utf-8"
request["X-NN-Access-Key"] = "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###"
request.body = JSON.dump({
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
#"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "test@novalnet.de",
"birth_date": "1992-06-10",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
"customer_ip": "###CUSTOMER_IP###",
#"customer_no": "###CUSTOMER_NUMBER###",
#"tel": "+49 089 123456",
#"mobile": "+49 089 123456",
#"fax": "+49 89 654321",
#"shipping": {
#"same_as_billing": "1",
#"city": "Kaiserslautern",
#"company": "A.B.C. Ger�stbau GmbH",
#"country_code": "DE",
#"email": "test@novanet.de",
#"first_name": "Norbert",
#"house_no": "9",
#"last_name": "Maier",
#"mobile": "+491747781423",
#"state": "Berlin",
#"street": "Hauptstr",
#"tel": "+49 089 123456",
#"zip": "66862"
#},
#"vat_id": "DE123456",
#"tax_id": "123/123/123",
#"reg_no": "HRB1234",
#"session": "fedgrgst5653653hdgfsvgdsf622627e",
#"no_nc": "1"
},
"transaction": {
"test_mode": "###TEST_MODE###",
"payment_type": "CREDITCARD",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"hook_url": "###HOOK_URL###",
"create_token": "1",
"return_url": "###YOUR_RETURN_URL###",
"error_return_url": "###YOUR_ERROR_RETURN_URL###",
#"invoice_ref": "###INVOICE_REF###",
#"invoice_no": "###INVOICE_NO###",
#"dynamic_descriptor": "www.yourshop.com"
},
"hosted_page": {
#"css_url": "https://www.demoshop.de/custom.css",
"logo": "###YOUR_SHOP_LOGO###",
#"hide_payments": [
#"CREDITCARD",
#"DIRECT_DEBIT_SEPA",
#"PREPAYMENT",
#"IDEAL"
#],
"display_payments":["CREDITCARD"],
"hide_blocks":["ADDRESS_FORM","SHOP_INFO","LANGUAGE_MENU","HEADER","TARIFF"],
"skip_pages":["CONFIRMATION_PAGE","SUCCESS_PAGE","PAYMENT_PAGE"],
"url_shortener": "1",
"link_expiry": "YYYY-MM-DD HH:MM:SS",
#"link_notify":"['EMAIL']",
#"return_target":"top",
#"display_payments_mode":"['DIRECT', 'REDIRECT', 'INSTALMENT', 'SUBSCRIPTION']"
},
#"affiliate": {
# "subvendors": {
# "2261": "100",
# "2271": "120"
# },
#"commission_type": "amount"
#},
#"invoicing": {
#"net_amount": 5000,
#"gross_amount": 5000,
#"tax_percent": 2,
#"tax_amount": 2,
#"coupon_percent": 1,
#"coupon_amount": 10,
#"product_details": [
#{
#"code": "P001",
#"name": "Product name",
#"group": "Product group",
#"description": "Product description",
#"quantity": 2,
#"unit": 2,
#"unit_price": 100,
#"total_price": 200,
#"tax_amount": 1,
#"tax_percent": 1,
#"discount": 0,
#"note": "Note about the product"
#}
#],
#"notice": {
# "1": "Notice 1",
# "2": "Notice 2",
# "3": "Notice 3"
# },
#"customer_support": "Max Mustermann | Email: support@yourshop.de",
#"custom_invoice_no": "INV-32",
#"send_invoice_pdf": "1"
#},
"custom": {
"lang": "EN"
}
})
response = https.request(request)
puts response.read_body
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://payport.novalnet.de/v2/seamless/payment"
method := "POST"
payload := strings.NewReader(`{
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
//"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"birth_date": "1992-06-10",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
"customer_ip": "###CUSTOMER_IP###",
//"customer_no": "###CUSTOMER_NUMBER###",
//"tel": "+49 089 123456",
//"mobile": "+49 089 123456",
//"fax": "+49 89 654321",
/*
"shipping": {
"same_as_billing": "1",
"city": "Kaiserslautern",
"company": "A.B.C. Ger�stbau GmbH",
"country_code": "DE",
"email": "test@novanet.de",
"first_name": "Norbert",
"house_no": "9",
"last_name": "Maier",
"mobile": "+491747781423",
"state": "Berlin",
"street": "Hauptstr",
"tel": "+49 089 123456",
"zip": "66862"
},
*/
//"vat_id": "DE123456",
//"tax_id": "123/123/123",
//"reg_no": "HRB1234",
//"session": "fedgrgst5653653hdgfsvgdsf622627e",
//"no_nc": "1"
},
"transaction": {
"payment_type": "CREDITCARD",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"test_mode": "###TEST_MODE###",
"hook_url": "###YOUR_HOOK_URL###",
"create_token": "1",
"return_url": "###YOUR_ERROR_RETURN_URL###",
"error_return_url": "###YOUR_HOOK_URL###",
/*
"invoice_ref": "###INVOICE_REF###",
"invoice_no": "###INVOICE_NO###",
'enforce_3d': '1',
'verify_payment_data': '1',
"dynamic_descriptor": "www.yourshop.com",
*/
},
"hosted_page": {
//"css_url": "https://www.demoshop.de/custom.css",
"logo": "###YOUR_SHOP_LOGO###",
/*"hide_payments": [
"CREDITCARD",
"DIRECT_DEBIT_SEPA",
"PREPAYMENT",
"IDEAL"
],*/
"display_payments":["CREDITCARD"],
"hide_blocks":["ADDRESS_FORM","SHOP_INFO","LANGUAGE_MENU","HEADER","TARIFF"],
"skip_pages":["CONFIRMATION_PAGE","SUCCESS_PAGE","PAYMENT_PAGE"],
"url_shortener":"1",
"link_expiry":"YYYY-MM-DD HH:MM:SS",
//"link_notify":"['EMAIL']",
//"return_target":"top",
//"display_payments_mode":"['DIRECT', 'REDIRECT', 'INSTALMENT', 'SUBSCRIPTION']"
},
/*
"affiliate": {
"subvendors": {
"2261": "100",
"2271": "120"
},
//"commission_type": "amount"
},
"invoicing": {
"net_amount": 5000,
"gross_amount": 5000,
"tax_percent": 2,
"tax_amount": 2,
//"coupon_percent": 1,
//"coupon_amount": 10,
"product_details": [
{
//"code": "P001",
"name": "Product name",
//"group": "Product group",
//"description": "Product description",
"quantity": 2,
"unit": 2,
"unit_price": 100,
"total_price": 200,
"tax_amount": 1,
"tax_percent": 1,
//"discount": 0,
//"note": "Note about the product"
}
],
"notice": {
"1": "Notice 1",
"2": "Notice 2",
"3": "Notice 3"
},
//"customer_support": "Max Mustermann | Email: support@yourshop.de",
//"custom_invoice_no": "INV-32",
"send_invoice_pdf": "1"
},
*/
"custom": {
"lang": "EN"
}
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
req.Header.Add("Charset", "utf-8")
req.Header.Add("X-NN-Access-Key", "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
/* List of required libraries (see also the import statements below):
- commons-logging-1.2.jar
- httpasyncclient-4.1.5.jar
- httpclient-4.3.3.jar
- httpcore-4.4.16.jar
- httpcore-nio-4.4.16.jar
- httpmime-4.5.14.jar
- json-20230227.jar
- unirest-java-3.9.00.jar
*/
import java.io.*;
import org.json.JSONArray;
import org.apache.http.auth.*;
import org.apache.http.nio.conn.*;
import org.apache.http.concurrent.*;
import org.apache.http.nio.reactor.*;
import org.apache.commons.logging.*;
import org.apache.http.entity.mime.content.*;
import kong.unirest.*;
public class HostedApiRequest {
public static void main(String []args) throws Exception{
Unirest.config().connectTimeout(1000).socketTimeout(2000);
HttpResponse<String> response = Unirest.post("https://payport.novalnet.de/v2/seamless/payment")
.header("Content-Type", "application/json")
.header("Charset", "utf-8")
.header("Accept", "application/json")
.header("X-NN-Access-Key", "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###")
.body("{
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
//"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"birth_date": "1992-06-10",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
"customer_ip": "###CUSTOMER_IP###",
//"customer_no": "###CUSTOMER_NUMBER###",
//"tel": "+49 089 123456",
//"mobile": "+49 089 123456",
//"fax": "+49 89 654321",
/*
"shipping": {
"same_as_billing": "1",
"city": "Kaiserslautern",
"company": "A.B.C. Ger�stbau GmbH",
"country_code": "DE",
"email": "test@novanet.de",
"first_name": "Norbert",
"house_no": "9",
"last_name": "Maier",
"mobile": "+491747781423",
"state": "Berlin",
"street": "Hauptstr",
"tel": "+49 089 123456",
"zip": "66862"
},
*/
//"vat_id": "DE123456",
//"tax_id": "123/123/123",
//"reg_no": "HRB1234",
//"session": "fedgrgst5653653hdgfsvgdsf622627e",
//"no_nc": "1"
},
"transaction": {
"payment_type": "CREDITCARD",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"test_mode": "###TEST_MODE###",
"hook_url": "###YOUR_HOOK_URL###",
"create_token": "1",
"return_url": "###YOUR_ERROR_RETURN_URL###",
"error_return_url": "###YOUR_HOOK_URL###",
/*
"invoice_ref": "###INVOICE_REF###",
"invoice_no": "###INVOICE_NO###",
'enforce_3d': '1',
'verify_payment_data': '1',
"dynamic_descriptor": "www.yourshop.com",
*/
},
"hosted_page": {
//"css_url": "https://www.demoshop.de/custom.css",
"logo": "###YOUR_SHOP_LOGO###",
/*"hide_payments": [
"CREDITCARD",
"DIRECT_DEBIT_SEPA",
"PREPAYMENT",
"IDEAL"
],*/
"display_payments":["CREDITCARD"],
"hide_blocks":["ADDRESS_FORM","SHOP_INFO","LANGUAGE_MENU","HEADER","TARIFF"],
"skip_pages":["CONFIRMATION_PAGE","SUCCESS_PAGE","PAYMENT_PAGE"],
"url_shortener":"1",
"link_expiry":"YYYY-MM-DD HH:MM:SS",
//"link_notify":"['EMAIL']",
//"return_target":"top",
//"display_payments_mode":"['DIRECT', 'REDIRECT', 'INSTALMENT', 'SUBSCRIPTION']"
},
/*
"affiliate": {
"subvendors": {
"2261": "100",
"2271": "120"
},
//"commission_type": "amount"
},
"invoicing": {
"net_amount": 5000,
"gross_amount": 5000,
"tax_percent": 2,
"tax_amount": 2,
//"coupon_percent": 1,
//"coupon_amount": 10,
"product_details": [
{
//"code": "P001",
"name": "Product name",
//"group": "Product group",
//"description": "Product description",
"quantity": 2,
"unit": 2,
"unit_price": 100,
"total_price": 200,
"tax_amount": 1,
"tax_percent": 1,
//"discount": 0,
//"note": "Note about the product"
}
],
"notice": {
"1": "Notice 1",
"2": "Notice 2",
"3": "Notice 3"
},
//"customer_support": "Max Mustermann | Email: support@yourshop.de",
//"custom_invoice_no": "INV-32",
"send_invoice_pdf": "1"
},
*/
"custom": {
"lang": "EN"
}
}")
.asString();
System.out.println(response.getBody());
}
}
using System;
using System.Net.Http;
namespace HostedApiRequest
{
public class HostedApi {
public string check_hosted_api_request() {
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://payport.novalnet.de/v2/seamless/payment");
request.Headers.Add("Charset", "utf-8");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("X-NN-Access-Key", "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###");
var content = new StringContent("{
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
//"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"birth_date": "1992-06-10",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
"customer_ip": "###CUSTOMER_IP###",
//"customer_no": "###CUSTOMER_NUMBER###",
//"tel": "+49 089 123456",
//"mobile": "+49 089 123456",
//"fax": "+49 89 654321",
/*
"shipping": {
"same_as_billing": "1",
"city": "Kaiserslautern",
"company": "A.B.C. Ger�stbau GmbH",
"country_code": "DE",
"email": "test@novanet.de",
"first_name": "Norbert",
"house_no": "9",
"last_name": "Maier",
"mobile": "+491747781423",
"state": "Berlin",
"street": "Hauptstr",
"tel": "+49 089 123456",
"zip": "66862"
},
*/
//"vat_id": "DE123456",
//"tax_id": "123/123/123",
//"reg_no": "HRB1234",
//"session": "fedgrgst5653653hdgfsvgdsf622627e",
//"no_nc": "1"
},
"transaction": {
"payment_type": "CREDITCARD",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"test_mode": "###TEST_MODE###",
"hook_url": "###YOUR_HOOK_URL###",
"create_token": "1",
"return_url": "###YOUR_ERROR_RETURN_URL###",
"error_return_url": "###YOUR_HOOK_URL###",
/*
"invoice_ref": "###INVOICE_REF###",
"invoice_no": "###INVOICE_NO###",
'enforce_3d': '1',
'verify_payment_data': '1',
"dynamic_descriptor": "www.yourshop.com",
*/
},
"hosted_page": {
//"css_url": "https://www.demoshop.de/custom.css",
"logo": "###YOUR_SHOP_LOGO###",
/*"hide_payments": [
"CREDITCARD",
"DIRECT_DEBIT_SEPA",
"PREPAYMENT",
"IDEAL"
],*/
"display_payments":["CREDITCARD"],
"hide_blocks":["ADDRESS_FORM","SHOP_INFO","LANGUAGE_MENU","HEADER","TARIFF"],
"skip_pages":["CONFIRMATION_PAGE","SUCCESS_PAGE","PAYMENT_PAGE"],
"url_shortener":"1",
"link_expiry":"YYYY-MM-DD HH:MM:SS",
//"link_notify":"['EMAIL']",
//"return_target":"top",
//"display_payments_mode":"['DIRECT', 'REDIRECT', 'INSTALMENT', 'SUBSCRIPTION']"
},
/*
"affiliate": {
"subvendors": {
"2261": "100",
"2271": "120"
},
//"commission_type": "amount"
},
"invoicing": {
"net_amount": 5000,
"gross_amount": 5000,
"tax_percent": 2,
"tax_amount": 2,
//"coupon_percent": 1,
//"coupon_amount": 10,
"product_details": [
{
//"code": "P001",
"name": "Product name",
//"group": "Product group",
//"description": "Product description",
"quantity": 2,
"unit": 2,
"unit_price": 100,
"total_price": 200,
"tax_amount": 1,
"tax_percent": 1,
//"discount": 0,
//"note": "Note about the product"
}
],
"notice": {
"1": "Notice 1",
"2": "Notice 2",
"3": "Notice 3"
},
//"customer_support": "Max Mustermann | Email: support@yourshop.de",
//"custom_invoice_no": "INV-32",
"send_invoice_pdf": "1"
},
*/
"custom": {
"lang": "EN"
}
}", null, "application/json");
request.Content = content;
var response = client.SendAsync(request).Result;
response.EnsureSuccessstatuscode();
var responseText = response.Content.ReadAsStringAsync().Result;
Console.WriteLine(responseText);
return responseText;
}
public static void Main() {
var testRequest = new HostedApi();
testRequest.check_hosted_api_request();
}
}
}
<?php
// Need to enter your payment access key value here
$payment_access_key = '###YOUR_PAYMENT_ACCESS_KEY###';
// Now, have to encode the $payment_access_key value with the base64 encode
$encoded_data = base64_encode($payment_access_key);
// Action Endpoint
$endpoint = 'https://payport.novalnet.de/v2/payment';
// Build the Headers array
$headers = [
// The Content-Type should be "application/json"
'Content-Type:application/json',
// The charset should be "utf-8"
'Charset:utf-8',
// Optional
'Accept:application/json',
// The formed authenticate value (case-sensitive)
'X-NN-Access-Key:' . $encoded_data
];
$data = [];
// Build Merchant Data
$data['merchant'] = [
// Your API signature value
'signature' => '###YOUR_API_SIGNATURE###',
// Your corresponding tariff ID
'tariff' => '###YOUR_TARIFF_ID###'
];
// Build Customer Data
$data['customer'] = [
// Shopper's first name
'first_name' => 'Max',
// Shopper's last name
'last_name' => 'Mustermann',
// Shopper's email
'email' => '###YOUR_MAIL###',
// Shopper's Ip address
'customer_ip' => '###CUSTOMER_IP###',
// Shopper's customer number from the shop
'customer_no' => '###CUSTOMER_NUMBER###',
// Shopper's Telephone number
'tel' => '+49 089 123456',
// Shopper's Mobile number
'mobile' => '+49 174 7781423',
// Shopper's birthdate value YYYY-MM-DD - Decomment it based on your usage
// 'birth_date' => '1992-06-10',
// Shopper's gender - Decomment it based on your usage
// 'gender' => 'u',
// Shopper's company vat ID value - Decomment it based on your usage
// 'vat_id' => 'DE123456',
// Shopper's company regestration number - Decomment it based on your usage
// 'reg_no' => 'HRB1234',
// Shopper's company tax ID value - Decomment it based on your usage
// 'tax_id' => '123/123/123',
// Shopper's session value - Decomment it based on your usage
// 'session' => 'fedgrgst5653653hdgfsvgdsf622627e',
// Shopper's fax number - Decomment it based on your usage
// 'fax' => '+49 89 654321',
// Use of minimal customer data
//'no_nc' => '1',
// Shopper's billing address
'billing' => [
// House number
'house_no' => '2',
// Street
'street' => 'Musterstr',
// City
'city' => 'Musterhausen',
// zip
'zip' => '12345',
// Country's ISO code
'country_code' => 'DE',
// Name of the company - Decomment it based on your usage
// 'company' => 'ABC GmbH',
// State
//'state' => 'Berlin'
],
/*
// Optional child object - Decomment it based on your usage
'shipping' => [
// Pass this parameter if the billing and the shipping address are identical
'same_as_billing' => '1',
// First name
'first_name' => 'Norbert',
// Last name
'last_name' => 'Maier',
// Email
'email' => 'test@novalnet.de',
// Street
'street' => 'Hauptstr',
// House number
'house_no' => '9',
// City
'city' => 'Kaiserslautern',
// zip
'zip' => '66862',
// Country's ISO code
'country_code' => 'DE',
// Name of the company
'company' => 'A.B.C. Gerüstbau GmbH',
// Telephone number
'tel' => '+49 089 123456',
// Mobile number
'mobile' => '+49 174 7781423',
// State
'state' => 'Berlin'
]
*/
];
// Build Transaction Data
$data['transaction'] = [
// The mode of the transaction
'test_mode' => '###TEST_MODE###',
// The Payment type of the transaction
'payment_type' => 'DIRECT_DEBIT_SEPA',
// The transaction Amount in smaller currency unit
'amount' => '###TRANSACTION_AMOUNT###',
// The transaction currency's ISO code
'currency' => '###TRANSACTION_CURRENCY###',
// Date by which the customer must settle the payment
'due_date' => '###DUE_DATE###',
// The order number of the transaction
'order_no' => '###TRANSACTION_ORDER_NUMBER###',
// The Hook URL value for this particular transaction
'hook_url' => '###YOUR_HOOK_URL###',
// The reference related to your customer`s invoice of the order.
//'invoice_ref' => '###INVOICE_REF###',
// The invoice number related to your customer`s invoice of the order.
//'invoice_no' => '###INVOICE_NO###',
// The unique mandate reference of the written SEPA mandate.
// 'mandate_ref' => '###MANDATE_REF###',
// The start date at which the end-customer allowed Novalnet or the merchant to book from his/her account.
// 'mandate_date' => '###MANDATE_DATE###',
// The debit reason defines the text on the customer's proof of payment.
// 'debit_reason_1' => '###DEBIT_REASON_1###',
// 'debit_reason_2' => '###DEBIT_REASON_2###',
// 'debit_reason_3' => '###DEBIT_REASON_3###',
// 'debit_reason_4' => '###DEBIT_REASON_4###',
//'verify_payment_data' => '1',
// The flag to create the token for the payment data - Decomment it based on your usage
'create_token' => 1,
// Build Payment Data
'payment_data' => [
'account_holder' => 'Max Mustermann',
'iban' => '###IBAN###',
'bic' => '###BIC###'
]
];
/*
// Subscription Data, used for processing Novalnet`s subscription - Optional object - Decomment it based on your usage
$data['subscription'] = [
// The interval between each cycle
'interval' => '1m',
// Subscription trial interval if applicable
'trial_interval' => '3m',
// Subscription trial interval amount if applicable
'trial_amount' => '150'
// Subscription expiry date
//'expiry_date' => 'YYYY-MM-DD'
];
*/
/*
// Marketplace data
$data['marketplace'] = [
// To submit amount for several affiliates to be booked
'tx_split' => [
'2261' => '100',
'2271' => '120'
],
// Commission type for the corresponding affiliates
'commission_split' => [
'2261' => [
'percentage' => '100',
'amount' => '700',
],
'2271' => [
'percentage' => '97'
]
]
];
// Affiliate Data
$data['affiliate'] = [
// To submit shares for several affiliates for the same transaction
'subvendors'=> [
'2261' => '100',
'2271' => '120'
],
// Commission type for several affiliates for the same transaction
//'commission_type'=> 'amount'
];
// Invoicing Data
$data['invoicing'] = [
// Total amount (excl. tax) should be mentioned here
'net_amount' => 5000,
// Total amount (incl. tax) should be mentioned here
'gross_amount' => 5000,
// Overall invoice tax percent should be mentioned here
'tax_percent' => 2,
// Overall invoice tax amount should be mentioned here
'tax_amount' => 2,
// Discount coupon percentage should be mentioned here
//'coupon_percent' => 1,
// Discount coupon amount should be mentioned here
//'coupon_amount' => 10,
// Individual product details should be mentioned here
'product_details' => [
[
//'code' => 'P001',
'name' => 'Product name',
//'group' => 'Product group',
//'description' => 'Product description',
'unit' => 2,
'quantity' => 2,
'unit_price' => 100,
'total_price' => 200,
'tax_amount' => 1,
'tax_percent' => 1,
//'discount' => 0,
//'note' => 'Note about the product'
]
],
// The notification which you wants to provide to the end-customer in invoice PDF.
'notice' => [
'1' => 'Notice 1',
'2' => 'Notice 2',
'3' => 'Notice 3'
],
// Customize the customer support details here
//'customer_support' => 'Max Mustermann | Email: support@yourshop.de',
// Custom Invoice number
//'custom_invoice_no' => 'INV-32',
// Send the invoice pdf to end customer
'send_invoice_pdf' => '1'
];
*/
// Custom Data - Optional object
$data['custom'] = [
// Shopper's selected language in shop
"lang" => "EN",
// Custom parameter's key - Optional object - Decomment it based on your usage
// 'input1' => 'your internal reference parameter name',
// Custom parameter's value - Optional object - Decomment it based on your usage
// 'inputval1' => 'your internal reference parameter value'
];
// Convert the array to JSON string
$json_data = json_encode($data);
// Handle Response
$response = send_request($json_data, $endpoint, $headers);
function send_request($data, $url, $headers) {
// Initiate cURL
$curl = curl_init();
// Set the url
curl_setopt($curl, CURLOPT_URL, $url);
// Set the result output to be a string
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
// Set the POST value to true (mandatory)
curl_setopt($curl, CURLOPT_POST, true);
// Set the post fields
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
// Set the headers
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
// Execute cURL
$result = curl_exec($curl);
// Handle cURL error
if (curl_errno($curl)) {
echo 'Request Error:' . curl_error($curl);
return $result;
}
// Close cURL
curl_close($curl);
// Decode the JSON string
$result = json_decode($result);
return $result;
}
?>
curl --location --request POST 'https://payport.novalnet.de/v2/payment' -H 'Content-Type: application/json' -H 'Charset:utf-8' -H 'Accept: application/json' -H 'X-NN-Access-Key: ###YOUR_ENCODED_PAYMENT_ACCESS_KEY###' -d '{"merchant":{"signature":"###YOUR_API_SIGNATURE###","tariff":"###YOUR_TARIFF_ID###"},"customer":{"first_name":"Max","last_name":"Mustermann","email":"###YOUR_MAIL###","customer_ip":"###CUSTOMER_IP###","customer_no":"###CUSTOMER_NUMBER###","tel":"+49 089 123456","mobile":"+49 174 7781423","billing":{"house_no":"2","street":"Musterstr","city":"Musterhausen","zip":"12345","country_code":"DE"}},"transaction":{"payment_type":"DIRECT_DEBIT_SEPA","amount":"###TRANSACTION_AMOUNT###","currency":"###TRANSACTION_CURRENCY###","test_mode":"###TEST_MODE###","due_date":"###DUE_DATE###","order_no":"###TRANSACTION_ORDER_NUMBER###","hook_url":"###YOUR_HOOK_URL###","create_token":1,"payment_data":{"account_holder":"Max Mustermann","iban":"###IBAN###","bic":"###BIC###"}},"custom":{"lang":"EN"}}';
#!/usr/bin/node
const https = require('https');
// data sent in the body of the request
const postData = JSON.stringify({
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
"customer_ip": "###CUSTOMER_IP###",
"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"birth_date": "1992-06-10",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
/*
"shipping": {
"same_as_billing": "1",
"city": "Kaiserslautern",
"company": "A.B.C. Gerüstbau GmbH",
"country_code": "DE",
"email": "test@novanet.de",
"first_name": "Norbert",
"house_no": "9",
"last_name": "Maier",
"mobile": "+491747781423",
"state": "Berlin",
"street": "Hauptstr",
"tel": "+49 089 123456",
"zip": "66862"
},
*/
},
"transaction": {
"payment_type": "DIRECT_DEBIT_SEPA",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"test_mode": "###TEST_MODE###",
"due_date":"###DUE_DATE###",
"hook_url": "###YOUR_HOOK_URL###",
"create_token": "1",
"payment_data": {
"account_holder": "Max Mustermann",
"iban": "###IBAN###",
"bic": "###BIC###"
}
},
"custom": {
"lang": "EN"
}
});
const options = {
hostname: 'payport.novalnet.de',
port: 443,
path: '/v2/payment',
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(postData),
'Charset': 'utf-8',
'Accept': 'application/json',
'X-NN-Access-Key': '###YOUR_ENCODED_PAYMENT_ACCESS_KEY###'
},
};
const req = https.request(options, (res) => {
console.log('statuscode:', res.statuscode);
// console.log('headers:', res.headers);
res.on('data', (d) => {
process.stdout.write(d);
});
});
req.on('error', (e) => {
console.error('ERROR: ',e);
});
// Write data to request body
req.write(postData);
req.end();
#!/usr/bin/python3
import http.client
import json
CONN = http.client.HTTPSConnection("payport.novalnet.de")
PAYLOAD = json.dumps({
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
"customer_ip": "###CUSTOMER_IP###",
"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"birth_date": "1983-07-02",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
#"shipping": {
#"same_as_billing": "1",
#"city": "Kaiserslautern",
#"company": "A.B.C. Gerüstbau GmbH",
#"country_code": "DE",
#"email": "test@novanet.de",
#"first_name": "Norbert",
#"house_no": "9",
#"last_name": "Maier",
#"mobile": "+491747781423",
#"state": "Berlin",
#"street": "Hauptstr",
#"tel": "+49 089 123456",
#"zip": "66862"
#}
},
"transaction": {
"payment_type": "DIRECT_DEBIT_SEPA",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "EUR",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"test_mode": "###TEST_MODE###",
"due_date": "###DUE_DATE###",
"hook_url": "###YOUR_HOOK_URL###",
"create_token": "1",
"payment_data": {
"account_holder" : "Max Mustermann",
"iban" : "###IBAN###",
"bic" : "###BIC###"
}
},
"custom": {
"lang": "EN"
}
})
HEADERS = {
'Content-Type': 'application/json',
'Charset': 'utf-8',
'Accept': 'application/json',
'X-NN-Access-Key': '###YOUR_ENCODED_PAYMENT_ACCESS_KEY###'
}
CONN.request("POST", "/v2/payment", PAYLOAD, HEADERS)
RES = CONN.getresponse()
DATA = RES.read()
print(DATA.decode("utf-8"))
#!/usr/lib/ruby
require "uri"
require "json"
require "net/http"
url = URI("https://payport.novalnet.de/v2/payment")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Accept"] = "application/json"
request["Charset"] = "utf-8"
request["X-NN-Access-Key"] = "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###"
request.body = JSON.dump({
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
"customer_ip": "###CUSTOMER_IP###",
"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"birth_date": "1983-07-02",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
#"shipping": {
#"same_as_billing": "1",
#"city": "Kaiserslautern",
#"company": "A.B.C. Gerüstbau GmbH",
#"country_code": "DE",
#"email": "test@novanet.de",
#"first_name": "Norbert",
#"house_no": "9",
#"last_name": "Maier",
#"mobile": "+491747781423",
#"state": "Berlin",
#"street": "Hauptstr",
#"tel": "+49 089 123456",
#"zip": "66862"
#}
},
"transaction": {
"payment_type": "DIRECT_DEBIT_SEPA",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "EUR",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"test_mode": "###TEST_MODE###",
"due_date": "###DUE_DATE###",
"hook_url": "###YOUR_HOOK_URL###",
"create_token": "1",
"payment_data": {
"account_holder" : "Max Mustermann",
"iban" : "###IBAN###",
"bic" : "###BIC###"
}
},
"custom": {
"lang": "EN"
}
})
response = https.request(request)
puts response.read_body
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://payport.novalnet.de/v2/payment"
method := "POST"
payload := strings.NewReader(`{
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
"customer_ip": "###CUSTOMER_IP###",
"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"birth_date": "1983-07-02",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
/*
"shipping": {
"same_as_billing": "1",
"city": "Kaiserslautern",
"company": "A.B.C. Gerüstbau GmbH",
"country_code": "DE",
"email": "test@novanet.de",
"first_name": "Norbert",
"house_no": "9",
"last_name": "Maier",
"mobile": "+491747781423",
"state": "Berlin",
"street": "Hauptstr",
"tel": "+49 089 123456",
"zip": "66862"
}
*/
},
"transaction": {
"payment_type": "DIRECT_DEBIT_SEPA",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "EUR",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"test_mode": "###TEST_MODE###",
"due_date":"###DUE_DATE###",
"hook_url": "###YOUR_HOOK_URL###",
"create_token": "1",
"payment_data": {
"account_holder": "Max Mustermann",
"iban": "###IBAN###",
"bic": "###BIC###"
}
},
"custom": {
"lang": "EN"
}
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
req.Header.Add("Charset", "utf-8")
req.Header.Add("X-NN-Access-Key", "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
/* List of required libraries (see also the import statements below):
- commons-logging-1.2.jar
- httpasyncclient-4.1.5.jar
- httpclient-4.3.3.jar
- httpcore-4.4.16.jar
- httpcore-nio-4.4.16.jar
- httpmime-4.5.14.jar
- json-20230227.jar
- unirest-java-3.9.00.jar
*/
import java.io.*;
import org.json.JSONArray;
import org.apache.http.auth.*;
import org.apache.http.nio.conn.*;
import org.apache.http.concurrent.*;
import org.apache.http.nio.reactor.*;
import org.apache.commons.logging.*;
import org.apache.http.entity.mime.content.*;
import kong.unirest.*;
public class DirectApi {
public static void main(String []args) throws Exception{
Unirest.config().connectTimeout(1000).socketTimeout(2000);
HttpResponse<String> response = Unirest.post("https://payport.novalnet.de/v2/payment")
.header("Content-Type", "application/json")
.header("Charset", "utf-8")
.header("Accept", "application/json")
.header("X-NN-Access-Key", "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###")
.body("{\"merchant\":{\"signature\":\"###YOUR_API_SIGNATURE###\", \"tariff\" : \"###YOUR_TARIFF_ID###\"},\"customer\":{\"customer_ip\":\"###CUSTOMER_IP###\",\"gender\":\"u\", \"first_name\": \"Max\", \"last_name\": \"Mustermann\", \"email\": \"###YOUR_MAIL###\", \"birth_date\":\"1983-07-02\",\"billing\":{\"street\":\"Musterstr\",\"house_no\":\"2\",\"city\":\"Musterhausen\",\"zip\":\"12345\",\"country_code\":\"DE\",\"tel\":\"+49 089 123456\"}},\"transaction\":{\"payment_type\": \"DIRECT_DEBIT_SEPA\",\"amount\":\"###TRANSACTION_AMOUNT###\",\"currency\":\"EUR\",\"order_no\":\"###TRANSACTION_ORDER_NUMBER###\",\"test_mode\":\"###TEST_MODE###\",\"due_date\":\"###DUE_DATE###\",\"hook_url\":\"###YOUR_HOOK_URL###\",\"create_token\":\"1\",\"payment_data\":{\"account_holder\":\"Max Mustermann\",\"iban\":\"###IBAN###\",\"bic\":\"###BIC###\"}},\"custom\":{\"lang\":\"EN\"}}")
.asString();
System.out.println(response.getBody());
}
}
using System;
using System.Net.Http;
namespace DirectApiRequest
{
public class DirectApi {
public string check_direct_api_request() {
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://payport.novalnet.de/v2/payment");
request.Headers.Add("Charset", "utf-8");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("X-NN-Access-Key", "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###");
var content = new StringContent("{\"merchant\":{\"signature\":\"###YOUR_API_SIGNATURE###\", \"tariff\" : \"###YOUR_TARIFF_ID###\"},\"customer\":{\"customer_ip\":\"###CUSTOMER_IP###\",\"gender\":\"u\", \"first_name\": \"Max\", \"last_name\": \"Mustermann\", \"email\": \"###YOUR_MAIL###\", \"birth_date\":\"1983-07-02\",\"billing\":{\"street\":\"Musterstr\",\"house_no\":\"2\",\"city\":\"Musterhausen\",\"zip\":\"12345\",\"country_code\":\"DE\",\"tel\":\"+49 089 123456\"}},\"transaction\":{\"payment_type\": \"DIRECT_DEBIT_SEPA\",\"amount\":\"###TRANSACTION_AMOUNT###\",\"currency\":\"EUR\",\"order_no\":\"###TRANSACTION_ORDER_NUMBER###\",\"test_mode\":\"###TEST_MODE###\",\"due_date\":\"###DUE_DATE###\",\"hook_url\":\"###YOUR_HOOK_URL###\",\"create_token\":\"1\",\"payment_data\":{\"account_holder\":\"Max Mustermann\",\"iban\":\"###IBAN###\",\"bic\":\"###BIC###\"}},\"custom\":{\"lang\":\"EN\"}}", null, "application/json");
request.Content = content;
var response = client.SendAsync(request).Result;
response.EnsureSuccessstatuscode();
var responseText = response.Content.ReadAsStringAsync().Result;
Console.WriteLine(responseText);
return responseText;
}
public static void Main() {
var testRequest = new DirectApi();
testRequest.check_direct_api_request();
}
}
}
<?php
// Need to enter your payment access key value here
$payment_access_key = "###YOUR_PAYMENT_ACCESS_KEY###";
// Now, have to encode the $payment_access_key value with the base64 encode
$encoded_data = base64_encode($payment_access_key);
// Action Endpoint
$endpoint = "https://payport.novalnet.de/v2/payment";
// Build the Headers array
$headers = [
// The Content-Type should be "application/json"
"Content-Type:application/json",
// The charset should be "utf-8"
"Charset:utf-8",
// Optional
"Accept:application/json",
// The formed authenticate value (case-sensitive)
"X-NN-Access-Key:" . $encoded_data,
];
$data = [];
// Build Merchant Data
$data["merchant"] = [
// Your API signature value
"signature" => "###YOUR_API_SIGNATURE###",
// Your corresponding tariff ID
"tariff" => "###YOUR_TARIFF_ID###",
];
// Build Customer Data
$data["customer"] = [
// Shopper's first name
"first_name" => "Max",
// Shopper's last name
"last_name" => "Mustermann",
// Shopper's email
"email" => "###YOUR_MAIL###",
// Shopper's Ip address
"customer_ip" => "###CUSTOMER_IP###",
// Shopper's customer number from the shop
"customer_no" => "###CUSTOMER_NUMBER###",
// Shopper's Telephone number
"tel" => "+49 089 123456",
// Shopper's Mobile number
"mobile" => "+49 174 7781423",
// Shopper's birthdate value YYYY-MM-DD - Decomment it based on your usage
// 'birth_date' => '1992-06-10',
// Shopper's gender - Decomment it based on your usage
// 'gender' => 'u',
// Shopper's company vat ID value - Decomment it based on your usage
// 'vat_id' => 'DE123456',
// Shopper's company regestration number - Decomment it based on your usage
// 'reg_no' => 'HRB1234',
// Shopper's company tax ID value - Decomment it based on your usage
// 'tax_id' => '123/123/123',
// Shopper's session value - Decomment it based on your usage
// 'session' => 'fedgrgst5653653hdgfsvgdsf622627e',
// Shopper's fax number - Decomment it based on your usage
// 'fax' => '+49 89 654321',
// Use of minimal customer data
//'no_nc' => '1',
// Shopper's billing address
"billing" => [
// House number
"house_no" => "2",
// Street
"street" => "Musterstr",
// City
"city" => "Musterhausen",
// zip
"zip" => "12345",
// Country's ISO code
"country_code" => "DE",
// Name of the company - Decomment it based on your usage
// 'company' => 'ABC GmbH',
// State
//'state' => 'Berlin'
],
/*
// Optional child object - Decomment it based on your usage
'shipping' => [
// Pass this parameter if the billing and the shipping address are identical
'same_as_billing' => '1',
// First name
'first_name' => 'Norbert',
// Last name
'last_name' => 'Maier',
// Email
'email' => 'test@novalnet.de',
// Street
'street' => 'Hauptstr',
// House number
'house_no' => '9',
// City
'city' => 'Kaiserslautern',
// zip
'zip' => '66862',
// Country's ISO code
'country_code' => 'DE',
// Name of the company
'company' => 'A.B.C. Ger�stbau GmbH',
// Telephone number
'tel' => '+49 089 123456',
// Mobile number
'mobile' => '+49 174 7781423',
// State
'state' => 'Berlin'
]
*/
];
// Build Transaction Data
$data["transaction"] = [
// The mode of the transaction
"test_mode" => "###TEST_MODE###",
// The Payment type of the transaction
"payment_type" => "DIRECT_DEBIT_ACH",
// The transaction Amount in smaller currency unit
"amount" => "###TRANSACTION_AMOUNT###",
// The transaction currency's ISO code
"currency" => "###TRANSACTION_CURRENCY###",
// The order number of the transaction
"order_no" => "###TRANSACTION_ORDER_NUMBER###",
// The Hook URL value for this particular transaction
"hook_url" => "###YOUR_HOOK_URL###",
// The reference related to your customer`s invoice of the order.
//'invoice_ref' => '###INVOICE_REF###',
// The invoice number related to your customer`s invoice of the order.
//'invoice_no' => '###INVOICE_NO###',
// The flag to create the token for the payment data - Decomment it based on your usage
"create_token" => 1,
// Build Payment Data
"payment_data" => [
"account_holder" => "###ACCOUNT_HOLDER###",
"account_number" => "###ACCOUNT_NUMBER###",
"routing_number" => "###ROUTING_NUMBER###",
],
];
/*
// Subscription Data, used for processing Novalnet`s subscription - Optional object - Decomment it based on your usage
$data['subscription'] = [
// The interval between each cycle
'interval' => '1m',
// Subscription trial interval if applicable
'trial_interval' => '3m',
// Subscription trial interval amount if applicable
'trial_amount' => '150'
// Subscription expiry date
//'expiry_date' => 'YYYY-MM-DD'
];
*/
/*
// Marketplace data
$data['marketplace'] = [
// To submit amount for several affiliates to be booked
'tx_split' => [
'2261' => '100',
'2271' => '120'
],
// Commission type for the corresponding affiliates
'commission_split' => [
'2261' => [
'percentage' => '100',
'amount' => '700',
],
'2271' => [
'percentage' => '97'
]
]
];
// Affiliate Data
$data['affiliate'] = [
// To submit shares for several affiliates for the same transaction
'subvendors'=> [
'2261' => '100',
'2271' => '120'
],
// Commission type for several affiliates for the same transaction
//'commission_type'=> 'amount'
];
// Invoicing Data
$data['invoicing'] = [
// Total amount (excl. tax) should be mentioned here
'net_amount' => 5000,
// Total amount (incl. tax) should be mentioned here
'gross_amount' => 5000,
// Overall invoice tax percent should be mentioned here
'tax_percent' => 2,
// Overall invoice tax amount should be mentioned here
'tax_amount' => 2,
// Discount coupon percentage should be mentioned here
//'coupon_percent' => 1,
// Discount coupon amount should be mentioned here
//'coupon_amount' => 10,
// Individual product details should be mentioned here
'product_details' => [
[
//'code' => 'P001',
'name' => 'Product name',
//'group' => 'Product group',
//'description' => 'Product description',
'unit' => 2,
'quantity' => 2,
'unit_price' => 100,
'total_price' => 200,
'tax_amount' => 1,
'tax_percent' => 1,
//'discount' => 0,
//'note' => 'Note about the product'
]
],
// The notification which you wants to provide to the end-customer in invoice PDF.
'notice' => [
'1' => 'Notice 1',
'2' => 'Notice 2',
'3' => 'Notice 3'
],
// Customize the customer support details here
//'customer_support' => 'Max Mustermann | Email: support@yourshop.de',
// Custom Invoice number
//'custom_invoice_no' => 'INV-32',
// Send the invoice pdf to end customer
'send_invoice_pdf' => '1'
];
*/
// Custom Data - Optional object
$data["custom"] = [
// Shopper's selected language in shop
"lang" => "EN",
// Custom parameter's key - Optional object - Decomment it based on your usage
// 'input1' => 'your internal reference parameter name',
// Custom parameter's value - Optional object - Decomment it based on your usage
// 'inputval1' => 'your internal reference parameter value'
];
// Convert the array to JSON string
$json_data = json_encode($data);
// Handle Response
$response = send_request($json_data, $endpoint, $headers);
function send_request($data, $url, $headers)
{
// Initiate cURL
$curl = curl_init();
// Set the url
curl_setopt($curl, CURLOPT_URL, $url);
// Set the result output to be a string
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
// Set the POST value to true (mandatory)
curl_setopt($curl, CURLOPT_POST, true);
// Set the post fields
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
// Set the headers
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
// Execute cURL
$result = curl_exec($curl);
// Handle cURL error
if (curl_errno($curl)) {
echo "Request Error:" . curl_error($curl);
return $result;
}
// Close cURL
curl_close($curl);
// Decode the JSON string
$result = json_decode($result);
return $result;
}
?>
curl --location --request POST 'https://payport.novalnet.de/v2/payment' -H 'Content-Type: application/json' -H 'Charset:utf-8' -H 'Accept: application/json' -H 'X-NN-Access-Key: ###YOUR_ENCODED_PAYMENT_ACCESS_KEY###' -d '{"merchant":{"signature":"###YOUR_API_SIGNATURE###","tariff":"###YOUR_TARIFF_ID###"},"customer":{"first_name":"Max","last_name":"Mustermann","email":"###YOUR_MAIL###","customer_ip":"###CUSTOMER_IP###","customer_no":"###CUSTOMER_NUMBER###","tel":"+49 089 123456","mobile":"+49 174 7781423","billing":{"house_no":"2","street":"Musterstr","city":"Musterhausen","zip":"12345","country_code":"DE"}},"transaction":{"payment_type":"DIRECT_DEBIT_ACH","amount":"###TRANSACTION_AMOUNT###","currency":"###TRANSACTION_CURRENCY###","test_mode":"###TEST_MODE###","order_no":"###TRANSACTION_ORDER_NUMBER###","hook_url":"###YOUR_HOOK_URL###","create_token":1,"payment_data":{"account_holder":"###ACCOUNT_HOLDER###","account_number":"###ACCOUNT_NUMBER###","routing_number":"###ROUTING_NUMBER###"}},"custom":{"lang":"EN"}}';
#!/usr/bin/node
const https = require('https');
// data sent in the body of the request
const postData = JSON.stringify({
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
"customer_ip": "###CUSTOMER_IP###",
"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"birth_date": "1992-06-10",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
/*
"shipping": {
"same_as_billing": "1",
"city": "Kaiserslautern",
"company": "A.B.C. Ger�stbau GmbH",
"country_code": "DE",
"email": "test@novanet.de",
"first_name": "Norbert",
"house_no": "9",
"last_name": "Maier",
"mobile": "+491747781423",
"state": "Berlin",
"street": "Hauptstr",
"tel": "+49 089 123456",
"zip": "66862"
},
*/
},
"transaction": {
"payment_type": "DIRECT_DEBIT_ACH",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"test_mode": "###TEST_MODE###",
"hook_url": "###YOUR_HOOK_URL###",
"create_token": "1",
"payment_data": {
"account_holder": "###ACCOUNT_HOLDER###",
"account_number": "###ACCOUNT_NUMBER###",
"routing_number": "###ROUTING_NUMBER###"
}
},
"custom": {
"lang": "EN"
}
});
const options = {
hostname: 'payport.novalnet.de',
port: 443,
path: '/v2/payment',
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(postData),
'Charset': 'utf-8',
'Accept': 'application/json',
'X-NN-Access-Key': '###YOUR_ENCODED_PAYMENT_ACCESS_KEY###'
},
};
const req = https.request(options, (res) => {
console.log('statuscode:', res.statuscode);
// console.log('headers:', res.headers);
res.on('data', (d) => {
process.stdout.write(d);
});
});
req.on('error', (e) => {
console.error('ERROR: ',e);
});
// Write data to request body
req.write(postData);
req.end();
#!/usr/bin/python3
import http.client
import json
CONN = http.client.HTTPSConnection("payport.novalnet.de")
PAYLOAD = json.dumps({
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
"customer_ip": "###CUSTOMER_IP###",
"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"birth_date": "1983-07-02",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
#"shipping": {
#"same_as_billing": "1",
#"city": "Kaiserslautern",
#"company": "A.B.C. Ger�stbau GmbH",
#"country_code": "DE",
#"email": "test@novanet.de",
#"first_name": "Norbert",
#"house_no": "9",
#"last_name": "Maier",
#"mobile": "+491747781423",
#"state": "Berlin",
#"street": "Hauptstr",
#"tel": "+49 089 123456",
#"zip": "66862"
#}
},
"transaction": {
"payment_type": "DIRECT_DEBIT_ACH",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "EUR",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"test_mode": "###TEST_MODE###",
"hook_url": "###YOUR_HOOK_URL###",
"create_token": "1",
"payment_data": {
"account_holder" : "###ACCOUNT_HOLDER###",
"account_number": "###ACCOUNT_NUMBER###",
"routing_number": "###ROUTING_NUMBER###"
}
},
"custom": {
"lang": "EN"
}
})
HEADERS = {
'Content-Type': 'application/json',
'Charset': 'utf-8',
'Accept': 'application/json',
'X-NN-Access-Key': '###YOUR_ENCODED_PAYMENT_ACCESS_KEY###'
}
CONN.request("POST", "/v2/payment", PAYLOAD, HEADERS)
RES = CONN.getresponse()
DATA = RES.read()
print(DATA.decode("utf-8"))
#!/usr/lib/ruby
require "uri"
require "json"
require "net/http"
url = URI("https://payport.novalnet.de/v2/payment")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Accept"] = "application/json"
request["Charset"] = "utf-8"
request["X-NN-Access-Key"] = "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###"
request.body = JSON.dump({
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
"customer_ip": "###CUSTOMER_IP###",
"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"birth_date": "1983-07-02",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
#"shipping": {
#"same_as_billing": "1",
#"city": "Kaiserslautern",
#"company": "A.B.C. Ger�stbau GmbH",
#"country_code": "DE",
#"email": "test@novanet.de",
#"first_name": "Norbert",
#"house_no": "9",
#"last_name": "Maier",
#"mobile": "+491747781423",
#"state": "Berlin",
#"street": "Hauptstr",
#"tel": "+49 089 123456",
#"zip": "66862"
#}
},
"transaction": {
"payment_type": "DIRECT_DEBIT_ACH",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "EUR",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"test_mode": "###TEST_MODE###",
"hook_url": "###YOUR_HOOK_URL###",
"create_token": "1",
"payment_data": {
"account_holder" : "###ACCOUNT_HOLDER###",
"account_number": "###ACCOUNT_NUMBER###",
"routing_number": "###ROUTING_NUMBER###"
}
},
"custom": {
"lang": "EN"
}
})
response = https.request(request)
puts response.read_body
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://payport.novalnet.de/v2/payment"
method := "POST"
payload := strings.NewReader(`{
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
"customer_ip": "###CUSTOMER_IP###",
"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"birth_date": "1983-07-02",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
/*
"shipping": {
"same_as_billing": "1",
"city": "Kaiserslautern",
"company": "A.B.C. Ger�stbau GmbH",
"country_code": "DE",
"email": "test@novanet.de",
"first_name": "Norbert",
"house_no": "9",
"last_name": "Maier",
"mobile": "+491747781423",
"state": "Berlin",
"street": "Hauptstr",
"tel": "+49 089 123456",
"zip": "66862"
}
*/
},
"transaction": {
"payment_type": "DIRECT_DEBIT_ACH",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "EUR",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"test_mode": "###TEST_MODE###",
"hook_url": "###YOUR_HOOK_URL###",
"create_token": "1",
"payment_data": {
"account_holder": "###ACCOUNT_HOLDER###",
"account_number": "###ACCOUNT_NUMBER###",
"routing_number": "###ROUTING_NUMBER###"
}
},
"custom": {
"lang": "EN"
}
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
req.Header.Add("Charset", "utf-8")
req.Header.Add("X-NN-Access-Key", "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
/* List of required libraries (see also the import statements below):
- commons-logging-1.2.jar
- httpasyncclient-4.1.5.jar
- httpclient-4.3.3.jar
- httpcore-4.4.16.jar
- httpcore-nio-4.4.16.jar
- httpmime-4.5.14.jar
- json-20230227.jar
- unirest-java-3.9.00.jar
*/
import java.io.*;
import org.json.JSONArray;
import org.apache.http.auth.*;
import org.apache.http.nio.conn.*;
import org.apache.http.concurrent.*;
import org.apache.http.nio.reactor.*;
import org.apache.commons.logging.*;
import org.apache.http.entity.mime.content.*;
import kong.unirest.*;
public class DirectApi {
public static void main(String []args) throws Exception{
Unirest.config().connectTimeout(1000).socketTimeout(2000);
HttpResponse<String> response = Unirest.post("https://payport.novalnet.de/v2/payment")
.header("Content-Type", "application/json")
.header("Charset", "utf-8")
.header("Accept", "application/json")
.header("X-NN-Access-Key", "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###")
.body("{\"merchant\":{\"signature\":\"###YOUR_API_SIGNATURE###\", \"tariff\" : \"###YOUR_TARIFF_ID###\"},\"customer\":{\"customer_ip\":\"###CUSTOMER_IP###\",\"gender\":\"u\", \"first_name\": \"Max\", \"last_name\": \"Mustermann\", \"email\": \"###YOUR_MAIL###\", \"birth_date\":\"1983-07-02\",\"billing\":{\"street\":\"Musterstr\",\"house_no\":\"2\",\"city\":\"Musterhausen\",\"zip\":\"12345\",\"country_code\":\"DE\",\"tel\":\"+49 089 123456\"}},\"transaction\":{\"payment_type\": \"DIRECT_DEBIT_ACH\",\"amount\":\"###TRANSACTION_AMOUNT###\",\"currency\":\"EUR\",\"order_no\":\"###TRANSACTION_ORDER_NUMBER###\",\"test_mode\":\"###TEST_MODE###\",\"hook_url\":\"###YOUR_HOOK_URL###\",\"create_token\":\"1\",\"payment_data\":{\"account_holder\":\"###ACCOUNT_HOLDER###\",\"account_number\":\"###ACCOUNT_NUMBER###\",\"routing_number\":\"###ROUTING_NUMBER###\"}},\"custom\":{\"lang\":\"EN\"}}")
.asString();
System.out.println(response.getBody());
}
}
using System;
using System.Net.Http;
namespace DirectApiRequest
{
public class DirectApi {
public string check_direct_api_request() {
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://payport.novalnet.de/v2/payment");
request.Headers.Add("Charset", "utf-8");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("X-NN-Access-Key", "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###");
var content = new StringContent("{\"merchant\":{\"signature\":\"###YOUR_API_SIGNATURE###\", \"tariff\" : \"###YOUR_TARIFF_ID###\"},\"customer\":{\"customer_ip\":\"###CUSTOMER_IP###\",\"gender\":\"u\", \"first_name\": \"Max\", \"last_name\": \"Mustermann\", \"email\": \"###YOUR_MAIL###\", \"birth_date\":\"1983-07-02\",\"billing\":{\"street\":\"Musterstr\",\"house_no\":\"2\",\"city\":\"Musterhausen\",\"zip\":\"12345\",\"country_code\":\"DE\",\"tel\":\"+49 089 123456\"}},\"transaction\":{\"payment_type\": \"DIRECT_DEBIT_ACH\",\"amount\":\"###TRANSACTION_AMOUNT###\",\"currency\":\"EUR\",\"order_no\":\"###TRANSACTION_ORDER_NUMBER###\",\"test_mode\":\"###TEST_MODE###\",\"hook_url\":\"###YOUR_HOOK_URL###\",\"create_token\":\"1\",\"payment_data\":{\"account_holder\":\"###ACCOUNT_HOLDER###\",\"account_number\":\"###ACCOUNT_NUMBER###\",\"routing_number\":\"###ROUTING_NUMBER###\"}},\"custom\":{\"lang\":\"EN\"}}", null, "application/json");
request.Content = content;
var response = client.SendAsync(request).Result;
response.EnsureSuccessstatuscode();
var responseText = response.Content.ReadAsStringAsync().Result;
Console.WriteLine(responseText);
return responseText;
}
public static void Main() {
var testRequest = new DirectApi();
testRequest.check_direct_api_request();
}
}
}
<?php
// Need to enter your payment access key value here
$payment_access_key = '###YOUR_PAYMENT_ACCESS_KEY###';
// Now, have to encode the $payment_access_key value with the base64 encode
$encoded_data = base64_encode($payment_access_key);
// Action Endpoint
$endpoint = 'https://payport.novalnet.de/v2/seamless/payment';
// Build the Headers array
$headers = [
// The Content-Type should be "application/json"
'Content-Type:application/json',
// The charset should be "utf-8"
'Charset:utf-8',
// Optional
'Accept:application/json',
// The formed authenticate value (case-sensitive)
'X-NN-Access-Key:' . $encoded_data
];
$data = [];
// Build Merchant Data
$data['merchant'] = [
// Your API signature value
'signature' => '###YOUR_API_SIGNATURE###',
// Your corresponding tariff ID
'tariff' => '###YOUR_TARIFF_ID###'
];
// Build Customer Data
$data['customer'] = [
// Shopper's first name
'first_name' => 'Norbert',
// Shopper's last name
'last_name' => 'Maier',
// Shopper's email
'email' => '###YOUR_MAIL###',
// Shopper's Ip address
'customer_ip' => '###CUSTOMER_IP###',
// Shopper's customer number from the shop
'customer_no' => '###CUSTOMER_NUMBER###',
// Shopper's Telephone number
'tel' => '+49 089 123456',
// Shopper's Mobile number
'mobile' => '+49 174 7781423',
// Shopper's birthdate value YYYY-MM-DD
'birth_date' => '###BIRTHDATE###',
// Shopper's gender - Decomment it based on your usage
// 'gender' => 'u',
// Shopper's company vat ID value - Decomment it based on your usage
// 'vat_id' => 'DE123456',
// Shopper's company regestration number - Decomment it based on your usage
// 'reg_no' => 'HRB1234',
// Shopper's company tax ID value - Decomment it based on your usage
// 'tax_id' => '123/123/123',
// Shopper's session value - Decomment it based on your usage
// 'session' => 'fedgrgst5653653hdgfsvgdsf622627e',
// Shopper's fax number - Decomment it based on your usage
// 'fax' => '+49 89 654321',
// Shopper's billing address
'billing' => [
// House number
'house_no' => '9',
// Street
'street' => 'Hauptstr',
// City
'city' => 'Kaiserslautern',
// zip
'zip' => '66862',
// Country's ISO code
'country_code' => 'DE',
// Name of the company - Decomment it based on your usage
// 'company' => 'ABC GmbH',
// State
//'state' => 'Berlin'
],
/*
// Optional child object - Decomment it based on your usage
'shipping' => [
// Pass this parameter if the billing and the shipping address are identical
'same_as_billing' => '1',
// First name
'first_name' => 'Norbert',
// Last name
'last_name' => 'Maier',
// Email
'email' => 'test@novalnet.de',
// Street
'street' => 'Hauptstr',
// House number
'house_no' => '9',
// City
'city' => 'Kaiserslautern',
// zip
'zip' => '66862',
// Country's ISO code
'country_code' => 'DE',
// Name of the company
'company' => 'A.B.C. Gerüstbau GmbH',
// Telephone number
'tel' => '+49 089 123456',
// Mobile number
'mobile' => '+49 174 7781423',
// State
'state' => 'Berlin'
]
*/
];
// Build Transaction Data
$data['transaction'] = [
// The Payment type of the transaction
'payment_type' => 'GUARANTEED_DIRECT_DEBIT_SEPA',
// The transaction Amount in smaller currency unit
'amount' => '###TRANSACTION_AMOUNT###',
// The transaction currency's ISO code
'currency' => '###TRANSACTION_CURRENCY###',
// The mode of the transaction
'test_mode' => '###TEST_MODE###',
// The order number of the transaction
'order_no' => '###TRANSACTION_ORDER_NUMBER###',
// Need to be specify this for the Redirect payment types to which you need to redirect on SUCCESS
'return_url' => '###YOUR_RETURN_URL###',
// Need to be specify this for the Redirect payment types to which you need to redirect on FAILURE (optional)
'error_return_url' => '###YOUR_ERROR_RETURN_URL###',
// The Hook URL value for this particular transaction
'hook_url' => '###YOUR_HOOK_URL###',
// The unique mandate reference of the written SEPA mandate.
// 'mandate_ref' => '###MANDATE_REF###',
// The start date at which the end-customer allowed Novalnet or the merchant to book from his/her account.
// 'mandate_date' => '###MANDATE_DATE###',
// The debit reason defines the text on the customer's proof of payment.
// 'debit_reason_1' => '###DEBIT_REASON_1###',
// 'debit_reason_2' => '###DEBIT_REASON_2###',
// 'debit_reason_3' => '###DEBIT_REASON_3###',
// 'debit_reason_4' => '###DEBIT_REASON_4###',
// The flag to create the token for the payment data - Decomment it based on your usage
'create_token' => 1,
// Build Payment Data
//'payment_data' => [
// 'account_holder' => 'Max Mustermann',
//'iban' => '###IBAN###'
// ]
];
/*
// Subscription Data, used for processing Novalnet`s subscription - Optional object - Decomment it based on your usage
$data['subscription'] = [
// The interval between each cycle
'interval' => '1m',
// Subscription trial interval if applicable
'trial_interval' => '3m',
// Subscription trial interval amount if applicable
'trial_amount' => '150'
];
*/
/*
// Marketplace data, used for the affiliate`s marketplace model - Optional object - Decomment it based on your usage
$data['marketplace'] = [
// To submit amount for several affiliates to be booked
'tx_split' => [
'2261' => '20',
'2271' => '30'
],
];
*/
/*
// Affiliate Data, used for the affiliate`s revenue split model - Optional object - Decomment it based on your usage
$data['affiliate'] = [
// To submit shares for several affiliates for the same transaction
'subvendors'=> [
'2261' => '20',
'2271' => '30'
]
];
*/
/*
// Invoicing Data
$data['invoicing'] = [
// Overall invoice tax percent should be mentioned here
'tax_percent' => 2,
// Overall invoice tax amount should be mentioned here
'tax_amount' => 2,
// Total amount (excl. tax) should be mentioned here
'net_amount' => 5000,
// Total amount (incl. tax) should be mentioned here
'gross_amount' => 5000,
// Individual product details should be mentioned here
'product_details' => [
[
'code' => 'P001',
'name' => 'Product name',
'group' => 'Product group',
'description' => 'Product description',
'quantity' => 2,
'unit' => 2,
'unit_price' => 100,
'total_price' => 200,
'tax_amount' => 1,
'tax_percent' => 1,
'discount' => 0,
'note' => 'Note about the product'
]
],
// The notification which you wants to provide to the end-customer in invoice PDF.
'notice' => [
'1' => 'Notice 1',
'2' => 'Notice 2',
'3' => 'Notice 3'
],
// Customize the customer support details here
'customer_support' => 'Max Mustermann | Email: support@yourshop.de',
// Custom Invoice number
'custom_invoice_no' => 'INV-32'
];
*/
// Hosted Payment page customizations
$data['hosted_page'] = [
// Change logo in the Hosted payment page
'logo' => '###YOUR_SHOP_LOGO###',
// Change the styling of the Hosted payment page - Decomment it based on your usage
// 'css_url' => '###YOUR_CSS_URL###',
// Payment types to be displayed in the Hosted Payment Page
'display_payments' => ['GUARANTEED_DIRECT_DEBIT_SEPA'],
// Payment types to be hidden in the Hosted Payment Page - Used when necessary and display_payments when not in use
// 'hide_payments' => ['CREDITCARD', 'DIRECT_DEBIT_SEPA', 'INVOICE', 'IDEAL', 'PAYPAL'],
// Hide the following sections from the Hosted Payment Page
'hide_blocks' => ['ADDRESS_FORM', 'SHOP_INFO', 'LANGUAGE_MENU', 'HEADER', 'TARIFF'],
// Customize the display of the following pages
'skip_pages' => ['CONFIRMATION_PAGE', 'SUCCESS_PAGE', 'PAYMENT_PAGE'],
];
// Custom Data - Optional object
$data['custom'] = [
// Shopper's selected language in shop
"lang" => "EN",
// Custom parameter's key - Optional object - Decomment it based on your usage
// 'input1' => 'your internal reference parameter name',
// Custom parameter's value - Optional object - Decomment it based on your usage
// 'inputval1' => 'your internal reference parameter value'
];
// Convert the array to JSON string
$json_data = json_encode($data);
// Handle Response
$response = send_request($json_data, $endpoint, $headers);
function send_request($data, $url, $headers) {
// Initiate cURL
$curl = curl_init();
// Set the url
curl_setopt($curl, CURLOPT_URL, $url);
// Set the result output to be a string
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
// Set the POST value to true (mandatory)
curl_setopt($curl, CURLOPT_POST, true);
// Set the post fields
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
// Set the headers
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
// Execute cURL
$result = curl_exec($curl);
// Handle cURL error
if (curl_errno($curl)) {
echo 'Request Error:' . curl_error($curl);
return $result;
}
// Close cURL
curl_close($curl);
// Decode the JSON string
$result = json_decode($result);
return $result;
}
?>
curl --location --request POST 'https://payport.novalnet.de/v2/seamless/payment' -H 'Content-Type: application/json' -H 'Charset:utf-8' -H 'Accept: application/json' -H 'X-NN-Access-Key: ###YOUR_ENCODED_PAYMENT_ACCESS_KEY###' -d '{"merchant":{"signature":"###YOUR_API_SIGNATURE###","tariff":"###YOUR_TARIFF_ID###"},"customer":{"first_name":"Norbert","last_name":"Maier","email":"###YOUR_MAIL###","customer_ip":"###CUSTOMER_IP###","customer_no":"###CUSTOMER_NUMBER###","tel":"+49 089 123456","mobile":"+49 174 7781423","birth_date":"###BIRTHDATE###","billing":{"house_no":"9","street":"Hauptstr","city":"Kaiserslautern","zip":"66862","country_code":"DE"}},"transaction":{"payment_type":"GUARANTEED_DIRECT_DEBIT_SEPA","amount":"###TRANSACTION_AMOUNT###","currency":"###TRANSACTION_CURRENCY###","test_mode":"###TEST_MODE###","order_no":"###TRANSACTION_ORDER_NUMBER###","hook_url":"###YOUR_HOOK_URL###","create_token":1,"return_url":"###YOUR_RETURN_URL###","error_return_url":"###YOUR_ERROR_RETURN_URL###"},"custom":{"lang":"EN"},"hosted_page":{"logo":"###YOUR_SHOP_LOGO###","display_payments":["GUARANTEED_DIRECT_DEBIT_SEPA"],"hide_blocks":["ADDRESS_FORM","SHOP_INFO","LANGUAGE_MENU","HEADER","TARIFF"],"skip_pages":["CONFIRMATION_PAGE","SUCCESS_PAGE","PAYMENT_PAGE"]}}';
#!/usr/bin/node
const https = require('https');
// data sent in the body of the request
const postData = JSON.stringify({
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
"first_name": "Norbert",
"last_name": "Maier",
"email": "###YOUR_MAIL###",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
/*
"shipping": {
"same_as_billing": "1",
"city": "Kaiserslautern",
"company": "A.B.C. Gerüstbau GmbH",
"country_code": "DE",
"email": "test@novanet.de",
"first_name": "Norbert",
"house_no": "9",
"last_name": "Maier",
"mobile": "+491747781423",
"state": "Berlin",
"street": "Hauptstr",
"tel": "+49 089 123456",
"zip": "66862"
}
*/
"customer_ip": "###CUSTOMER_IP###",
"customer_no": "###CUSTOMER_NUMBER###",
"birth_date": "1992-06-10",
"tel": "+49 089 123456",
"mobile": "+49 174 7781423"
},
"transaction": {
"payment_type": "GUARANTEED_DIRECT_DEBIT_SEPA",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"test_mode":"###TEST_MODE###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"hook_url":"###YOUR_HOOK_URL###",
"create_token": 1,
"return_url": "###YOUR_RETURN_URL###",
"error_return_url": "###YOUR_ERROR_RETURN_URL###"
},
"hosted_page": {
"logo": "###YOUR_SHOP_LOGO###",
"display_payments": {'GUARANTEED_DIRECT_DEBIT_SEPA'},
"hide_blocks": {'ADDRESS_FORM', 'SHOP_INFO', 'LANGUAGE_MENU', 'HEADER', 'TARIFF'},
"skip_pages": {'CONFIRMATION_PAGE', 'SUCCESS_PAGE', 'PAYMENT_PAGE'}
},
"custom": {
"lang": "EN"
}
});
const options = {
hostname: 'payport.novalnet.de',
port: 443,
path: '/v2/seamless/payment',
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(postData),
'Charset': 'utf-8',
'Accept': 'application/json',
'X-NN-Access-Key': '###YOUR_ENCODED_PAYMENT_ACCESS_KEY###'
},
};
const req = https.request(options, (res) => {
console.log('statuscode:', res.statuscode);
// console.log('headers:', res.headers);
res.on('data', (d) => {
process.stdout.write(d);
});
});
req.on('error', (e) => {
console.error('ERROR: ',e);
});
// Write data to request body
req.write(postData);
req.end();
#!/usr/bin/python3
import http.client
import json
CONN = http.client.HTTPSConnection("payport.novalnet.de")
PAYLOAD = json.dumps({
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
"first_name": "Norbert",
"last_name": "Maier",
"email": "###YOUR_MAIL###",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
#"shipping": {
#"same_as_billing": "1",
#"city": "Kaiserslautern",
#"company": "A.B.C. Gerüstbau GmbH",
#"country_code": "DE",
#"email": "test@novanet.de",
#"first_name": "Norbert",
#"house_no": "9",
#"last_name": "Maier",
#"mobile": "+491747781423",
#"state": "Berlin",
#"street": "Hauptstr",
#"tel": "+49 089 123456",
#"zip": "66862"
#},
"customer_ip": "###CUSTOMER_IP###",
"customer_no": "###CUSTOMER_NUMBER###",
"birth_date": "1992-06-10",
"tel": "+49 089 123456",
"mobile": "+49 174 7781423"
},
"transaction": {
"payment_type": "GUARANTEED_DIRECT_DEBIT_SEPA",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"test_mode":"###TEST_MODE###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"hook_url":"###YOUR_HOOK_URL###",
"create_token": 1,
"return_url": "###YOUR_RETURN_URL###",
"error_return_url": "###YOUR_ERROR_RETURN_URL###"
},
"hosted_page": {
"logo": "###YOUR_SHOP_LOGO###",
"display_payments": {'GUARANTEED_DIRECT_DEBIT_SEPA'},
"hide_blocks": {'ADDRESS_FORM', 'SHOP_INFO', 'LANGUAGE_MENU', 'HEADER', 'TARIFF'},
"skip_pages": {'CONFIRMATION_PAGE', 'SUCCESS_PAGE', 'PAYMENT_PAGE'}
},
"custom": {
"lang": "EN"
}
})
HEADERS = {
'Content-Type': 'application/json',
'Charset': 'utf-8',
'Accept': 'application/json',
'X-NN-Access-Key': '###YOUR_ENCODED_PAYMENT_ACCESS_KEY###'
}
CONN.request("POST", "/v2/seamless/payment", PAYLOAD, HEADERS)
RES = CONN.getresponse()
DATA = RES.read()
print(DATA.decode("utf-8"))
#!/usr/lib/ruby
require "uri"
require "json"
require "net/http"
url = URI("https://payport.novalnet.de/v2/seamless/payment")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Accept"] = "application/json"
request["Charset"] = "utf-8"
request["X-NN-Access-Key"] = "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###"
request.body = JSON.dump({
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
"first_name": "Norbert",
"last_name": "Maier",
"email": "###YOUR_MAIL###",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
#"shipping": {
#"same_as_billing": "1",
#"city": "Kaiserslautern",
#"company": "A.B.C. Gerüstbau GmbH",
#"country_code": "DE",
#"email": "test@novanet.de",
#"first_name": "Norbert",
#"house_no": "9",
#"last_name": "Maier",
#"mobile": "+491747781423",
#"state": "Berlin",
#"street": "Hauptstr",
#"tel": "+49 089 123456",
#"zip": "66862"
#},
"customer_ip": "###CUSTOMER_IP###",
"customer_no": "###CUSTOMER_NUMBER###",
"birth_date": "1992-06-10",
"tel": "+49 089 123456",
"mobile": "+49 174 7781423"
},
"transaction": {
"payment_type": "GUARANTEED_DIRECT_DEBIT_SEPA",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"test_mode":"###TEST_MODE###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"return_url": "###YOUR_RETURN_URL###",
"error_return_url": "###YOUR_ERROR_RETURN_URL###",
"hook_url":"###YOUR_HOOK_URL###",
"create_token": 1
},
"hosted_page": {
"logo": "###YOUR_SHOP_LOGO###",
"display_payments": {'GUARANTEED_DIRECT_DEBIT_SEPA'},
"hide_blocks": {'ADDRESS_FORM', 'SHOP_INFO', 'LANGUAGE_MENU', 'HEADER', 'TARIFF'},
"skip_pages": {'CONFIRMATION_PAGE', 'SUCCESS_PAGE', 'PAYMENT_PAGE'}
},
"custom": {
"lang": "EN"
}
})
response = https.request(request)
puts response.read_body
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://payport.novalnet.de/v2/seamless/payment"
method := "POST"
payload := strings.NewReader(`{"merchant":{"signature":"###YOUR_API_SIGNATURE###", "tariff" : "###YOUR_TARIFF_ID###"},"customer": {
"first_name": "Norbert",
"last_name": "Maier",
"email": "###YOUR_MAIL###",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
/*
"shipping": {
"same_as_billing": "1",
"city": "Kaiserslautern",
"company": "A.B.C. Gerüstbau GmbH",
"country_code": "DE",
"email": "test@novanet.de",
"first_name": "Norbert",
"house_no": "9",
"last_name": "Maier",
"mobile": "+491747781423",
"state": "Berlin",
"street": "Hauptstr",
"tel": "+49 089 123456",
"zip": "66862"
}
*/
"customer_ip": "###CUSTOMER_IP###",
"customer_no": "###CUSTOMER_NUMBER###",
"birth_date": "1992-06-10",
"tel": "+49 089 123456",
"mobile": "+49 174 7781423"
},
"transaction": {
"payment_type": "GUARANTEED_DIRECT_DEBIT_SEPA",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"test_mode":"###TEST_MODE###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"hook_url":"###YOUR_HOOK_URL###",
"create_token": 1,
"return_url": "###YOUR_RETURN_URL###",
"error_return_url": "###YOUR_ERROR_RETURN_URL###"
},
"hosted_page": {
"logo": "###YOUR_SHOP_LOGO###",
"display_payments": {'GUARANTEED_DIRECT_DEBIT_SEPA'},
"hide_blocks": {'ADDRESS_FORM', 'SHOP_INFO', 'LANGUAGE_MENU', 'HEADER', 'TARIFF'},
"skip_pages": {'CONFIRMATION_PAGE', 'SUCCESS_PAGE', 'PAYMENT_PAGE'}
},"custom":{"lang":"EN"}}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
req.Header.Add("Charset", "utf-8")
req.Header.Add("X-NN-Access-Key", "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
// request for creating a Token
/* List of required libraries (see also the import statements below):
- commons-logging-1.2.jar
- httpasyncclient-4.1.5.jar
- httpclient-4.3.3.jar
- httpcore-4.4.16.jar
- httpcore-nio-4.4.16.jar
- httpmime-4.5.14.jar
- json-20230227.jar
- unirest-java-3.9.00.jar
*/
import java.io.*;
import org.json.JSONArray;
import org.apache.http.auth.*;
import org.apache.http.nio.conn.*;
import org.apache.http.concurrent.*;
import org.apache.http.nio.reactor.*;
import org.apache.commons.logging.*;
import org.apache.http.entity.mime.content.*;
import kong.unirest.*;
public class HostedApi {
public static void main(String []args) throws Exception{
Unirest.config().connectTimeout(1000).socketTimeout(2000);
HttpResponse<String> response = Unirest.post("https://payport.novalnet.de/v2/seamless/payment")
.header("Content-Type", "application/json")
.header("Charset", "utf-8")
.header("Accept", "application/json")
.header("X-NN-Access-Key", "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###")
.body("{
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
"first_name": "Norbert",
"last_name": "Maier",
"email": "###YOUR_MAIL###",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
/*
"shipping": {
"same_as_billing": "1",
"city": "Kaiserslautern",
"company": "A.B.C. Gerüstbau GmbH",
"country_code": "DE",
"email": "test@novanet.de",
"first_name": "Norbert",
"house_no": "9",
"last_name": "Maier",
"mobile": "+491747781423",
"state": "Berlin",
"street": "Hauptstr",
"tel": "+49 089 123456",
"zip": "66862"
}
*/
"customer_ip": "###CUSTOMER_IP###",
"customer_no": "###CUSTOMER_NUMBER###",
"birth_date": "1992-06-10",
"tel": "+49 089 123456",
"mobile": "+49 174 7781423"
},
"transaction": {
"payment_type": "GUARANTEED_DIRECT_DEBIT_SEPA",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"test_mode":"###TEST_MODE###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"hook_url":"###YOUR_HOOK_URL###",
"create_token": 1,
"return_url": "###YOUR_RETURN_URL###",
"error_return_url": "###YOUR_ERROR_RETURN_URL###"
},
"hosted_page": {
"logo": "###YOUR_SHOP_LOGO###",
"display_payments": {'GUARANTEED_DIRECT_DEBIT_SEPA'},
"hide_blocks": {'ADDRESS_FORM', 'SHOP_INFO', 'LANGUAGE_MENU', 'HEADER', 'TARIFF'},
"skip_pages": {'CONFIRMATION_PAGE', 'SUCCESS_PAGE', 'PAYMENT_PAGE'}
},
"custom": {
"lang": "EN"
}
}")
.asString();
System.out.println(response.getBody());
}
}
using System;
using System.Net.Http;
namespace HostedApiRequest
{
public class HostedApi {
public string check_hosted_api_request() {
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://payport.novalnet.de/v2/seamless/payment");
request.Headers.Add("Charset", "utf-8");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("X-NN-Access-Key", "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###");
var content = new StringContent("{
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
"first_name": "Norbert",
"last_name": "Maier",
"email": "###YOUR_MAIL###",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
/*
"shipping": {
"same_as_billing": "1",
"city": "Kaiserslautern",
"company": "A.B.C. Gerüstbau GmbH",
"country_code": "DE",
"email": "test@novanet.de",
"first_name": "Norbert",
"house_no": "9",
"last_name": "Maier",
"mobile": "+491747781423",
"state": "Berlin",
"street": "Hauptstr",
"tel": "+49 089 123456",
"zip": "66862"
}
*/
"customer_ip": "###CUSTOMER_IP###",
"customer_no": "###CUSTOMER_NUMBER###",
"birth_date": "1992-06-10",
"tel": "+49 089 123456",
"mobile": "+49 174 7781423"
},
"transaction": {
"payment_type": "GUARANTEED_DIRECT_DEBIT_SEPA",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"test_mode":"###TEST_MODE###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"hook_url":"###YOUR_HOOK_URL###",
"create_token": 1,
"return_url": "###YOUR_RETURN_URL###",
"error_return_url": "###YOUR_ERROR_RETURN_URL###"
},
"hosted_page": {
"logo": "###YOUR_SHOP_LOGO###",
"display_payments": {'GUARANTEED_DIRECT_DEBIT_SEPA'},
"hide_blocks": {'ADDRESS_FORM', 'SHOP_INFO', 'LANGUAGE_MENU', 'HEADER', 'TARIFF'},
"skip_pages": {'CONFIRMATION_PAGE', 'SUCCESS_PAGE', 'PAYMENT_PAGE'}
},
"custom": {
"lang": "EN"
}
}", null, "application/json");
request.Content = content;
var response = client.SendAsync(request).Result;
response.EnsureSuccessStatuscode();
var responseText = response.Content.ReadAsStringAsync().Result;
Console.WriteLine(responseText);
return responseText;
}
public static void Main() {
var testRequest = new HostedApi();
testRequest.check_hosted_api_request();
}
}
}
<?php
// Need to enter your payment access key value here
$payment_access_key = '###YOUR_PAYMENT_ACCESS_KEY###';
// Now, have to encode the $payment_access_key value with the base64 encode
$encoded_data = base64_encode($payment_access_key);
// Action Endpoint
$endpoint = 'https://payport.novalnet.de/v2/seamless/payment';
// Build the Headers array
$headers = [
// The Content-Type should be "application/json"
'Content-Type:application/json',
// The charset should be "utf-8"
'Charset:utf-8',
// Optional
'Accept:application/json',
// The formed authenticate value (case-sensitive)
'X-NN-Access-Key:' . $encoded_data
];
$data = [];
// Build Merchant Data
$data['merchant'] = [
// Your API signature value
'signature' => '###YOUR_API_SIGNATURE###',
// Your corresponding tariff ID
'tariff' => '###YOUR_TARIFF_ID###'
];
// Build Customer Data
$data['customer'] = [
// Shopper's first name
'first_name' => 'Norbert',
// Shopper's last name
'last_name' => 'Maier',
// Shopper's email
'email' => '###YOUR_MAIL###',
// Shopper's Ip address
'customer_ip' => '###CUSTOMER_IP###',
// Shopper's customer number from the shop
'customer_no' => '###CUSTOMER_NUMBER###',
// Shopper's Telephone number
'tel' => '+49 089 123456',
// Shopper's Mobile number
'mobile' => '+49 174 7781423',
// Shopper's birthdate value YYYY-MM-DD
'birth_date' => '###BIRTHDATE###',
// Shopper's gender - Decomment it based on your usage
// 'gender' => 'u',
// Shopper's company vat ID value - Decomment it based on your usage
// 'vat_id' => 'DE123456',
// Shopper's company regestration number - Decomment it based on your usage
// 'reg_no' => 'HRB1234',
// Shopper's company tax ID value - Decomment it based on your usage
// 'tax_id' => '123/123/123',
// Shopper's session value - Decomment it based on your usage
// 'session' => 'fedgrgst5653653hdgfsvgdsf622627e',
// Shopper's fax number - Decomment it based on your usage
// 'fax' => '+49 89 654321',
// Shopper's billing address
'billing' => [
// House number
'house_no' => '9',
// Street
'street' => 'Hauptstr',
// City
'city' => 'Kaiserslautern',
// zip
'zip' => '66862',
// Country's ISO code
'country_code' => 'DE',
// Name of the company - Decomment it based on your usage
// 'company' => 'ABC GmbH'
],
/*
// Optional child object - Decomment it based on your usage
'shipping' => [
// First name
'first_name' => 'Norbert',
// Last name
'last_name' => 'Maier',
// Email
'email' => 'test@novalnet.de',
// Street
'street' => 'Hauptstr',
// House number
'house_no' => '9',
// City
'city' => 'Kaiserslautern',
// zip
'zip' => '66862',
// Country's ISO code
'country_code' => 'DE',
// Name of the company
'company' => 'A.B.C. Gerüstbau GmbH',
// Telephone number
'tel' => '+49 089 123456',
// Mobile number
'mobile' => '+49 174 7781423'
]
*/
];
// Build Transaction Data
$data['transaction'] = [
// The Payment type of the transaction
'payment_type' => 'INSTALMENT_DIRECT_DEBIT_SEPA',
// The transaction Amount in smaller currency unit
'amount' => '30000',
// The transaction currency's ISO code
'currency' => '###TRANSACTION_CURRENCY###',
// The mode of the transaction
'test_mode' => '###TEST_MODE###',
// The order number of the transaction
'order_no' => '###TRANSACTION_ORDER_NUMBER###',
// Need to be specify this for the Redirect payment types to which you need to redirect on SUCCESS
'return_url' => '###YOUR_RETURN_URL###',
// Need to be specify this for the Redirect payment types to which you need to redirect on FAILURE (optional)
'error_return_url' => '###YOUR_ERROR_RETURN_URL###',
// The Hook URL value for this particular transaction
'hook_url' => '###YOUR_HOOK_URL###',
// The unique mandate reference of the written SEPA mandate.
// 'mandate_ref' => '###MANDATE_REF###',
// The start date at which the end-customer allowed Novalnet or the merchant to book from his/her account.
// 'mandate_date' => '###MANDATE_DATE###',
// The debit reason defines the text on the customer's proof of payment.
// 'debit_reason_1' => '###DEBIT_REASON_1###',
// 'debit_reason_2' => '###DEBIT_REASON_2###',
// 'debit_reason_3' => '###DEBIT_REASON_3###',
// 'debit_reason_4' => '###DEBIT_REASON_4###',
// The flag to create the token for the payment data - Decomment it based on your usage
'create_token' => 1,
// Build Payment Data
//'payment_data' => [
//'account_holder' => 'Max Mustermann',
//'iban' => '###IBAN###'
//]
];
// Instalment data
$data['instalment'] = [
// The interval between each cycle
'interval' => '1m',
// Total number of cycles
'cycles' => '2'
];
/*
// Affiliate Data, used for the affiliate`s revenue split model - Optional object - Decomment it based on your usage
$data['affiliate'] = [
// To submit shares for several affiliates for the same transaction
'subvendors'=> [
'2261' => '20',
'2271' => '30'
]
];
*/
/*
// Invoicing Data
$data['invoicing'] = [
// Overall invoice tax percent should be mentioned here
'tax_percent' => 2,
// Overall invoice tax amount should be mentioned here
'tax_amount' => 2,
// Total amount (excl. tax) should be mentioned here
'net_amount' => 5000,
// Total amount (incl. tax) should be mentioned here
'gross_amount' => 5000,
// Individual product details should be mentioned here
'product_details' => [
[
'code' => 'P001',
'name' => 'Product name',
'group' => 'Product group',
'description' => 'Product description',
'quantity' => 2,
'unit' => 2,
'unit_price' => 100,
'total_price' => 200,
'tax_amount' => 1,
'tax_percent' => 1,
'discount' => 0,
'note' => 'Note about the product'
]
],
// The notification which you wants to provide to the end-customer in invoice PDF.
'notice' => [
'1' => 'Notice 1',
'2' => 'Notice 2',
'3' => 'Notice 3'
],
// Customize the customer support details here
'customer_support' => 'Max Mustermann | Email: support@yourshop.de',
// Custom Invoice number
'custom_invoice_no' => 'INV-32'
];
*/
// Hosted Payment page customizations
$data['hosted_page'] = [
// Change logo in the Hosted payment page
'logo' => '###YOUR_SHOP_LOGO###',
// Change the styling of the Hosted payment page - Decomment it based on your usage
// 'css_url' => '###YOUR_CSS_URL###',
// Payment types to be displayed in the Hosted Payment Page
'display_payments' => ['INSTALMENT_DIRECT_DEBIT_SEPA'],
// Payment types to be hidden in the Hosted Payment Page - Used when necessary and display_payments when not in use
// 'hide_payments' => ['CREDITCARD', 'DIRECT_DEBIT_SEPA', 'INVOICE', 'IDEAL', 'PAYPAL'],
// Hide the following sections from the Hosted Payment Page
'hide_blocks' => ['ADDRESS_FORM', 'SHOP_INFO', 'LANGUAGE_MENU', 'HEADER', 'TARIFF'],
// Customize the display of the following pages
'skip_pages' => ['CONFIRMATION_PAGE', 'SUCCESS_PAGE', 'PAYMENT_PAGE'],
];
// Custom Data - Optional object
$data['custom'] = [
// Shopper's selected language in shop
"lang" => "EN",
// Custom parameter's key - Optional object - Decomment it based on your usage
// 'input1' => 'your internal reference parameter name',
// Custom parameter's value - Optional object - Decomment it based on your usage
// 'inputval1' => 'your internal reference parameter value'
];
// Convert the array to JSON string
$json_data = json_encode($data);
// Handle Response
$response = send_request($json_data, $endpoint, $headers);
function send_request($data, $url, $headers) {
// Initiate cURL
$curl = curl_init();
// Set the url
curl_setopt($curl, CURLOPT_URL, $url);
// Set the result output to be a string
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
// Set the POST value to true (mandatory)
curl_setopt($curl, CURLOPT_POST, true);
// Set the post fields
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
// Set the headers
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
// Execute cURL
$result = curl_exec($curl);
// Handle cURL error
if (curl_errno($curl)) {
echo 'Request Error:' . curl_error($curl);
return $result;
}
// Close cURL
curl_close($curl);
// Decode the JSON string
$result = json_decode($result);
return $result;
}
?>
curl --location --request POST 'https://payport.novalnet.de/v2/seamless/payment' -H 'Content-Type: application/json' -H 'Charset:utf-8' -H 'Accept: application/json' -H 'X-NN-Access-Key: ###YOUR_ENCODED_PAYMENT_ACCESS_KEY###' -d '{"merchant":{"signature":"###YOUR_API_SIGNATURE###","tariff":"###YOUR_TARIFF_ID###"},"customer":{"first_name":"Norbert","last_name":"Maier","email":"###YOUR_MAIL###","customer_ip":"###CUSTOMER_IP###","customer_no":"###CUSTOMER_NUMBER###","tel":"+49 089 123456","mobile":"+49 174 7781423","birth_date":"###BIRTHDATE###","billing":{"house_no":"9","street":"Hauptstr","city":"Kaiserslautern","zip":"66862","country_code":"DE"}},"transaction":{"payment_type":"INSTALMENT_DIRECT_DEBIT_SEPA","amount":"30000","currency":"###TRANSACTION_CURRENCY###","test_mode":"###TEST_MODE###","order_no":"###TRANSACTION_ORDER_NUMBER###","hook_url":"###YOUR_HOOK_URL###","create_token":1,"return_url":"###YOUR_RETURN_URL###","error_return_url":"###YOUR_ERROR_RETURN_URL###","payment_data":{"account_holder":"Max Mustermann","iban":"###IBAN###"}},"instalment":{"interval":"1m","cycles":"2"},"custom":{"lang":"EN"},"hosted_page":{"logo":"###YOUR_SHOP_LOGO###","display_payments":["INSTALMENT_DIRECT_DEBIT_SEPA"],"hide_blocks":["ADDRESS_FORM","SHOP_INFO","LANGUAGE_MENU","HEADER","TARIFF"],"skip_pages":["CONFIRMATION_PAGE","SUCCESS_PAGE","PAYMENT_PAGE"]}}';
#!/usr/bin/node
const https = require('https');
// data sent in the body of the request
const postData = JSON.stringify({
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
"customer_ip": "###CUSTOMER_IP###",
"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"birth_date": "1992-06-10",
"billing": {
"street": "Musterstr",
"house_no": "2",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"tel": "+49 089 123456"
}
},
"transaction": {
"payment_type": "INSTALMENT_DIRECT_DEBIT_SEPA",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"test_mode": "###TEST_MODE###",
"hook_url": "###YOUR_HOOK_URL###",
"return_url": "###YOUR_ERROR_RETURN_URL###",
"error_return_url": "###YOUR_HOOK_URL###",
"create_token": "1"
},
"hosted_page": {
"logo": "###YOUR_SHOP_LOGO###",
"display_payments": {'INSTALMENT_DIRECT_DEBIT_SEPA'},
"hide_blocks": {'ADDRESS_FORM', 'SHOP_INFO', 'LANGUAGE_MENU', 'HEADER', 'TARIFF'},
"skip_pages": {'CONFIRMATION_PAGE', 'SUCCESS_PAGE', 'PAYMENT_PAGE'}
},
"instalment": {
"interval": "1m",
"cycles": "###INSTALMENT_CYCLES###",
},
"custom": {
"lang": "EN"
}
});
const options = {
hostname: 'payport.novalnet.de',
port: 443,
path: '/v2/seamless/payment',
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(postData),
'Charset': 'utf-8',
'Accept': 'application/json',
'X-NN-Access-Key': '###YOUR_ENCODED_PAYMENT_ACCESS_KEY###'
},
};
const req = https.request(options, (res) => {
console.log('statuscode:', res.statuscode);
// console.log('headers:', res.headers);
res.on('data', (d) => {
process.stdout.write(d);
});
});
req.on('error', (e) => {
console.error('ERROR: ',e);
});
// Write data to request body
req.write(postData);
req.end();
#!/usr/bin/python3
import http.client
import json
CONN = http.client.HTTPSConnection("payport.novalnet.de")
PAYLOAD = json.dumps({
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
"customer_ip": "###CUSTOMER_IP###",
"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"birth_date": "1983-07-02",
"billing": {
"street": "Musterstr",
"house_no": "2",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"tel": "+49 089 123456"
}
},
"transaction": {
"payment_type": "INSTALMENT_DIRECT_DEBIT_SEPA",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"test_mode": "###TEST_MODE###",
"hook_url": "###YOUR_HOOK_URL###",
"return_url": "###YOUR_ERROR_RETURN_URL###",
"error_return_url": "###YOUR_HOOK_URL###",
"create_token": "1"
},
"hosted_page": {
"logo": "###YOUR_SHOP_LOGO###",
"display_payments": {'INSTALMENT_DIRECT_DEBIT_SEPA'},
"hide_blocks": {'ADDRESS_FORM', 'SHOP_INFO', 'LANGUAGE_MENU', 'HEADER', 'TARIFF'},
"skip_pages": {'CONFIRMATION_PAGE', 'SUCCESS_PAGE', 'PAYMENT_PAGE'}
},
"instalment": {
"interval": "1m",
"cycles": "###INSTALMENT_CYCLES###",
},
"custom": {
"lang": "EN"
}
})
HEADERS = {
'Content-Type': 'application/json',
'Charset': 'utf-8',
'Accept': 'application/json',
'X-NN-Access-Key': '###YOUR_ENCODED_PAYMENT_ACCESS_KEY###'
}
CONN.request("POST", "/v2/seamless/payment", PAYLOAD, HEADERS)
RES = CONN.getresponse()
DATA = RES.read()
print(DATA.decode("utf-8"))
#!/usr/lib/ruby
require "uri"
require "json"
require "net/http"
url = URI("https://payport.novalnet.de/v2/seamless/payment")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Accept"] = "application/json"
request["Charset"] = "utf-8"
request["X-NN-Access-Key"] = "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###"
request.body = JSON.dump({
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
"customer_ip": "###CUSTOMER_IP###",
"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"birth_date": "1983-07-02",
"billing": {
"street": "Musterstr",
"house_no": "2",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"tel": "+49 089 123456"
}
},
"transaction": {
"payment_type": "INSTALMENT_DIRECT_DEBIT_SEPA",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"test_mode": "###TEST_MODE###",
"hook_url": "###YOUR_HOOK_URL###",
"return_url": "###YOUR_ERROR_RETURN_URL###",
"error_return_url": "###YOUR_HOOK_URL###",
"create_token": "1"
},
"hosted_page": {
"logo": "###YOUR_SHOP_LOGO###",
"display_payments": {'INSTALMENT_DIRECT_DEBIT_SEPA'},
"hide_blocks": {'ADDRESS_FORM', 'SHOP_INFO', 'LANGUAGE_MENU', 'HEADER', 'TARIFF'},
"skip_pages": {'CONFIRMATION_PAGE', 'SUCCESS_PAGE', 'PAYMENT_PAGE'}
},
"instalment": {
"interval": "1m",
"cycles": "###INSTALMENT_CYCLES###",
},
"custom": {
"lang": "EN"
}
})
response = https.request(request)
puts response.read_body
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://payport.novalnet.de/v2/seamless/payment"
method := "POST"
payload := strings.NewReader(`{
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
"customer_ip": "###CUSTOMER_IP###",
"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"birth_date": "1983-07-02",
"billing": {
"street": "Musterstr",
"house_no": "2",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"tel": "+49 089 123456"
}
},
"transaction": {
"payment_type": "INSTALMENT_DIRECT_DEBIT_SEPA",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"test_mode": "###TEST_MODE###",
"hook_url": "###YOUR_HOOK_URL###",
"return_url": "###YOUR_ERROR_RETURN_URL###",
"error_return_url": "###YOUR_HOOK_URL###",
"create_token": "1"
},
"hosted_page": {
"logo": "###YOUR_SHOP_LOGO###",
"display_payments": "{'INSTALMENT_DIRECT_DEBIT_SEPA'}",
"hide_blocks": "{'ADDRESS_FORM', 'SHOP_INFO', 'LANGUAGE_MENU', 'HEADER', 'TARIFF'}",
"skip_pages": "{'CONFIRMATION_PAGE', 'SUCCESS_PAGE', 'PAYMENT_PAGE'}"
},
"instalment": {
"interval": "1m",
"cycles": "###INSTALMENT_CYCLES###"
},
"custom": {
"lang": "EN"
}
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
req.Header.Add("Charset", "utf-8")
req.Header.Add("X-NN-Access-Key", "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
/* List of required libraries (see also the import statements below):
- commons-logging-1.2.jar
- httpasyncclient-4.1.5.jar
- httpclient-4.3.3.jar
- httpcore-4.4.16.jar
- httpcore-nio-4.4.16.jar
- httpmime-4.5.14.jar
- json-20230227.jar
- unirest-java-3.9.00.jar
*/
import java.io.*;
import org.json.JSONArray;
import org.apache.http.auth.*;
import org.apache.http.nio.conn.*;
import org.apache.http.concurrent.*;
import org.apache.http.nio.reactor.*;
import org.apache.commons.logging.*;
import org.apache.http.entity.mime.content.*;
import kong.unirest.*;
public class HostedApi {
public static void main(String []args) throws Exception{
Unirest.config().connectTimeout(1000).socketTimeout(2000);
HttpResponse<String> response = Unirest.post("https://payport.novalnet.de/v2/seamless/payment")
.header("Content-Type", "application/json")
.header("Charset", "utf-8")
.header("Accept", "application/json")
.header("X-NN-Access-Key", "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###")
.body("{\"merchant\":{\"signature\":\"###YOUR_API_SIGNATURE###\", \"tariff\" : \"###YOUR_TARIFF_ID###\"},\"customer\":{\"customer_ip\":\"###CUSTOMER_IP###\",\"gender\":\"u\", \"first_name\": \"Max\", \"last_name\": \"Mustermann\", \"email\": \"###YOUR_MAIL###\", \"birth_date\":\"1983-07-02\",\"billing\":{\"street\":\"Musterstr\",\"house_no\":\"2\",\"city\":\"Musterhausen\",\"zip\":\"12345\",\"country_code\":\"DE\",\"tel\":\"+49 089 123456\"}},\"transaction\":{\"payment_type\": \"INSTALMENT_DIRECT_DEBIT_SEPA\",\"amount\":\"###CUSTOMER_IP###\",\"currency\":\"EUR\",\"order_no\":\"###TRANSACTION_ORDER_NUMBER###\",\"test_mode\":\"###TEST_MODE###\",\"hook_url\":\"###YOUR_HOOK_URL###\",\"return_url\":\"###YOUR_RETURN_URL###\",\"error_return_url\":\"###YOUR_ERROR_RETURN_URL###\",\"create_token\":\"1\"},\"hosted_page\":{\"logo\":\"###YOUR_SHOP_LOGO###\",\"display_payments\":\"{\"INSTALMENT_DIRECT_DEBIT_SEPA\"}\",\"hide_blocks\":{\'ADDRESS_FORM\', \'SHOP_INFO\', \'LANGUAGE_MENU\', \'HEADER\', \'TARIFF\'},\"skip_pages\": \'CONFIRMATION_PAGE\', \'SUCCESS_PAGE\', \'PAYMENT_PAGE\'},\"instalment\":{\"interval\":\"1m\",\"cycles\":\"2\"},\"custom\":{\"lang\":\"EN\"}}")
.asString();
System.out.println(response.getBody());
}
}
using System;
using System.Net.Http;
namespace HostedApiRequest
{
public class HostedApi {
public string check_hosted_api_request() {
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://payport.novalnet.de/v2/seamless/payment");
request.Headers.Add("Charset", "utf-8");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("X-NN-Access-Key", "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###");
var content = new StringContent("{\"merchant\":{\"signature\":\"###YOUR_API_SIGNATURE###\", \"tariff\" : \"###YOUR_TARIFF_ID###\"},\"customer\":{\"customer_ip\":\"###CUSTOMER_IP###\",\"gender\":\"u\", \"first_name\": \"Max\", \"last_name\": \"Mustermann\", \"email\": \"###YOUR_MAIL###\", \"birth_date\":\"1983-07-02\",\"billing\":{\"street\":\"Musterstr\",\"house_no\":\"2\",\"city\":\"Musterhausen\",\"zip\":\"12345\",\"country_code\":\"DE\",\"tel\":\"+49 089 123456\"}},\"transaction\":{\"payment_type\": \"INSTALMENT_DIRECT_DEBIT_SEPA\",\"amount\":\"###CUSTOMER_IP###\",\"currency\":\"EUR\",\"order_no\":\"###TRANSACTION_ORDER_NUMBER###\",\"test_mode\":\"###TEST_MODE###\",\"hook_url\":\"###YOUR_HOOK_URL###\",\"return_url\":\"###YOUR_RETURN_URL###\",\"error_return_url\":\"###YOUR_ERROR_RETURN_URL###\",\"create_token\":\"1\"},\"hosted_page\":{\"logo\":\"###YOUR_SHOP_LOGO###\",\"display_payments\":\"{\"INSTALMENT_DIRECT_DEBIT_SEPA\"}\",\"hide_blocks\":{\'ADDRESS_FORM\', \'SHOP_INFO\', \'LANGUAGE_MENU\', \'HEADER\', \'TARIFF\'},\"skip_pages\": \'CONFIRMATION_PAGE\', \'SUCCESS_PAGE\', \'PAYMENT_PAGE\'},\"instalment\":{\"interval\":\"1m\",\"cycles\":\"2\"},\"custom\":{\"lang\":\"EN\"}}", null, "application/json");
request.Content = content;
var response = client.SendAsync(request).Result;
response.EnsureSuccessstatuscode();
var responseText = response.Content.ReadAsStringAsync().Result;
Console.WriteLine(responseText);
return responseText;
}
public static void Main() {
var testRequest = new HostedApi();
testRequest.check_hosted_api_request();
}
}
}
<?php
// Need to enter your payment access key value here
$payment_access_key = '###YOUR_PAYMENT_ACCESS_KEY###';
// Now, have to encode the $payment_access_key value with the base64 encode
$encoded_data = base64_encode($payment_access_key);
// Action Endpoint
$endpoint = 'https://payport.novalnet.de/v2/seamless/payment';
// Build the Headers array
$headers = [
// The Content-Type should be "application/json"
'Content-Type:application/json',
// The charset should be "utf-8"
'Charset:utf-8',
// Optional
'Accept:application/json',
// The formed authenticate value (case-sensitive)
'X-NN-Access-Key:' . $encoded_data,
];
$data = [];
// Build Merchant Data
$data['merchant'] = [
// Your API signature value
'signature' => '###YOUR_API_SIGNATURE###',
// Your corresponding tariff ID
'tariff' => '###YOUR_TARIFF_ID###',
];
// Build Customer Data
$data['customer'] = [
// Shopper's first name
'first_name' => 'Max',
// Shopper's last name
'last_name' => 'Mustermann',
// Shopper's email
'email' => '###YOUR_MAIL###',
// Shopper's Ip address
'customer_ip' => '###CUSTOMER_IP###',
// Shopper's customer number from the shop
'customer_no' => '###CUSTOMER_NUMBER###',
// Shopper's Telephone number
'tel' => '+49 089 123456',
// Shopper's Mobile number
'mobile' => '+49 174 7781423',
// Shopper's birthdate value YYYY-MM-DD
'birth_date' => '###BIRTHDATE###',
// Shopper's gender - Decomment it based on your usage
// 'gender' => 'u',
// Shopper's company vat ID value - Decomment it based on your usage
// 'vat_id' => 'DE123456',
// Shopper's company regestration number - Decomment it based on your usage
// 'reg_no' => 'HRB1234',
// Shopper's company tax ID value - Decomment it based on your usage
// 'tax_id' => '123/123/123',
// Shopper's session value - Decomment it based on your usage
// 'session' => 'fedgrgst5653653hdgfsvgdsf622627e',
// Shopper's fax number - Decomment it based on your usage
// 'fax' => '+49 89 654321',
// Shopper's billing address
'billing' => [
// House number
'house_no' => '2',
// Street
'street' => 'Musterstr',
// City
'city' => 'Musterhausen',
// zip
'zip' => '12345',
// Country's ISO code
'country_code' => 'DE',
// Name of the company - Decomment it based on your usage
// 'company' => 'ABC GmbH',
// State
//'state' => 'Berlin'
]
/*
// Shopper's shipping address (optional)
'shipping' => [
// Pass this parameter if the billing and the shipping address are identical
'same_as_billing' => '1',
// First name
'first_name' => 'Norbert',
// Last name
'last_name' => 'Maier',
// Email
'email' => 'test@novalnet.de',
// Name of the company
'company' => 'A.B.C. Gerüstbau GmbH',
// House number
'house_no' => '9',
// Street
'street' => 'Hauptstr',
// City
'city' => 'Kaiserslautern',
// zip
'zip' => '66862',
// Country's ISO code
'country_code' => 'DE',
// Telephone number
'tel' => '+49 089 123456',
// Mobile number
'mobile' => '+49 174 7781423',
// State
'state' => 'Berlin'
],
*/
];
// Build Transaction Data
$data['transaction'] = [
// The Payment type of the transaction
'payment_type' => 'APPLEPAY',
// The transaction Amount in smaller currency unit
'amount' => '###TRANSACTION_AMOUNT###',
// The transaction currency's ISO code
'currency' => '###TRANSACTION_CURRENCY###',
// The mode of the transaction
'test_mode' => '###TEST_MODE###',
// The mode of the transaction
'order_no' => '###TRANSACTION_ORDER_NUMBER###',
// The Hook URL value for this particular transaction
'hook_url' => '###YOUR_HOOK_URL###',
// The reference related to your customer`s invoice of the order.
//'invoice_ref' => '###INVOICE_REF###',
// The invoice number related to your customer`s invoice of the order.
//'invoice_no' => '###INVOICE_NO###',
// Need to be specify this for the Redirect payment types to which you need to redirect on SUCCESS
'return_url' => '###YOUR_RETURN_URL###',
// Need to be specify this for the Redirect payment types to which you need to redirect on FAILURE (optional)
'error_return_url' => '###YOUR_ERROR_RETURN_URL###',
// The flag to create the token for the payment data - Decomment it based on your usage
'create_token' => 1
];
// Hosted Payment page customizations
$data['hosted_page'] = [
// Change logo in the Hosted payment page
//'logo' => '###YOUR_SHOP_LOGO###',
//'css_url' => 'https://www.demoshop.de/custom.css',
// Payment types to be displayed in the Hosted Payment Page
'display_payments' => ['APPLEPAY'],
// Payment types to be hidden in the Hosted Payment Page - Used when necessary and display_payments when not in use
// 'hide_payments' => ['CREDITCARD', 'DIRECT_DEBIT_SEPA', 'INVOICE', 'IDEAL', 'PAYPAL'],
// Hide the following sections from the Hosted Payment Page
'hide_blocks' => ['ADDRESS_FORM', 'SHOP_INFO', 'LANGUAGE_MENU', 'HEADER', 'TARIFF'],
// Customize the display of the following pages
'skip_pages' => ['CONFIRMATION_PAGE', 'SUCCESS_PAGE', 'PAYMENT_PAGE'],
//'link_notify' => '['EMAIL']',
//'return_target' => 'top',
//'display_payments_mode' => '['DIRECT', 'REDIRECT', 'INSTALMENT', 'SUBSCRIPTION']'
];
/*
// Affiliate Data, used for the affiliate`s revenue split model - Optional object - Decomment it based on your usage
$data['affiliate'] = [
// To submit shares for several affiliates for the same transaction
'subvendors'=> [
'2261' => '100',
'2271' => '120'
],
// Commission type for several affiliates for the same transaction
//'commission_type'=> 'amount'
];
// Invoicing Data
$data['invoicing'] = [
// Total amount (excl. tax) should be mentioned here
'net_amount' => 5000,
// Total amount (incl. tax) should be mentioned here
'gross_amount' => 5000,
// Overall invoice tax percent should be mentioned here
'tax_percent' => 2,
// Overall invoice tax amount should be mentioned here
'tax_amount' => 2,
// Discount coupon percentage should be mentioned here
//'coupon_percent' => 1,
// Discount coupon amount should be mentioned here
//'coupon_amount' => 10,
// Individual product details should be mentioned here
'product_details' => [
[
//'code' => 'P001',
'name' => 'Product name',
//'group' => 'Product group',
//'description' => 'Product description',
'unit' => 2,
'quantity' => 2,
'unit_price' => 100,
'total_price' => 200,
'tax_amount' => 1,
'tax_percent' => 1,
//'discount' => 0,
//'note' => 'Note about the product'
]
],
// The notification which you wants to provide to the end-customer in invoice PDF.
'notice' => [
'1' => 'Notice 1',
'2' => 'Notice 2',
'3' => 'Notice 3'
],
// Customize the customer support details here
//'customer_support' => 'Max Mustermann | Email: support@yourshop.de',
// Custom Invoice number
//'custom_invoice_no' => 'INV-32',
// Send the invoice pdf to end customer
'send_invoice_pdf' => '1'
];
*/
// Custom Data
$data['custom'] = [
// Shopper's selected language in shop
"lang" => "EN",
// Custom parameter's key - Optional object - Decomment it based on your usage
// 'input1' => 'your internal reference parameter name',
// Custom parameter's value - Optional object - Decomment it based on your usage
// 'inputval1' => 'your internal reference parameter value'
];
// Convert the array to JSON string
$json_data = json_encode($data);
// Handle Response
$response = send_request($json_data, $endpoint, $headers);
// Printing the response back to the Javascript to complete the Apple Pay purchase
//print $response;
//exit;
function send_request($data, $url, $headers) {
// Initiate cURL
$curl = curl_init();
// Set the url
curl_setopt($curl, CURLOPT_URL, $url);
// Set the result output to be a string
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
// Set the POST value to true (mandatory)
curl_setopt($curl, CURLOPT_POST, true);
// Set the post fields
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
// Set the headers
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
// Execute cURL
$result = curl_exec($curl);
// Handle cURL error
if (curl_errno($curl)) {
echo 'Request Error:' . curl_error($curl);
return $result;
}
// Close cURL
curl_close($curl);
// Decode the JSON string
$result = json_decode($result);
return $result;
}
?>
curl --location --request POST 'https://payport.novalnet.de/v2/seamless/payment' -H 'Content-Type: application/json' -H 'Charset:utf-8' -H 'Accept: application/json' -H 'X-NN-Access-Key: ###YOUR_ENCODED_PAYMENT_ACCESS_KEY###' -d '{"merchant":{"signature":"###YOUR_API_SIGNATURE###","tariff":"###YOUR_TARIFF_ID###"},"customer":{"first_name":"Max","last_name":"Mustermann","email":"###YOUR_MAIL###","customer_ip":"###CUSTOMER_IP###","billing":{"house_no":"2","street":"Musterstr","city":"Musterhausen","zip":"12345","country_code":"DE"}},"transaction":{"payment_type":"APPLEPAY","amount":"###TRANSACTION_AMOUNT###","currency":"###TRANSACTION_CURRENCY###","test_mode":"###TEST_MODE###","order_no":"###TRANSACTION_ORDER_NUMBER###","hook_url":"###YOUR_HOOK_URL###","create_token":"1","return_url":"###YOUR_RETURN_URL###","error_return_url":"###YOUR_ERROR_RETURN_URL###"},"custom":{"lang":"EN"},"hosted_page":{"logo":"###YOUR_SHOP_LOGO###","display_payments":["APPLEPAY"],"hide_blocks":["ADDRESS_FORM","SHOP_INFO","LANGUAGE_MENU","HEADER","TARIFF"],"skip_pages":["CONFIRMATION_PAGE","SUCCESS_PAGE","PAYMENT_PAGE"]}}';
#!/usr/bin/node
const https = require('https');
// data sent in the body of the request
const postData = JSON.stringify({
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
//"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"birth_date": "1992-06-10",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
"customer_ip": "###CUSTOMER_IP###",
//"customer_no": "###CUSTOMER_NUMBER###",
//"tel": "+49 089 123456",
//"mobile": "+49 089 123456",
//"fax": "+49 89 654321",
/*
"shipping": {
"same_as_billing": "1",
"city": "Kaiserslautern",
"company": "A.B.C. Gerüstbau GmbH",
"country_code": "DE",
"email": "test@novanet.de",
"first_name": "Norbert",
"house_no": "9",
"last_name": "Maier",
"mobile": "+491747781423",
"state": "Berlin",
"street": "Hauptstr",
"tel": "+49 089 123456",
"zip": "66862"
},
*/
//"vat_id": "DE123456",
//"tax_id": "123/123/123",
//"reg_no": "HRB1234",
//"session": "fedgrgst5653653hdgfsvgdsf622627e",
//"no_nc": "1"
},
"transaction": {
"test_mode": "###TEST_MODE###",
"payment_type": "APPLEPAY",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"hook_url": "###YOUR_HOOK_URL###",
"create_token": "1",
"return_url": "###YOUR_RETURN_URL###",
"error_return_url": "###YOUR_ERROR_RETURN_URL###",
/*
"invoice_ref": "###INVOICE_REF###",
"invoice_no": "###INVOICE_NO###",
"dynamic_descriptor": "www.yourshop.com"
*/
},
"hosted_page": {
//"css_url": "https://www.demoshop.de/custom.css",
"logo": "###YOUR_SHOP_LOGO###",
/*"hide_payments": [
"CREDITCARD",
"DIRECT_DEBIT_SEPA",
"PREPAYMENT",
"IDEAL"
],*/
"display_payments":["APPLEPAY"],
"hide_blocks":["ADDRESS_FORM","SHOP_INFO","LANGUAGE_MENU","HEADER","TARIFF"],
"skip_pages":["CONFIRMATION_PAGE","SUCCESS_PAGE","PAYMENT_PAGE"],
"url_shortener":"1",
"link_expiry":"YYYY-MM-DD HH:MM:SS",
//"link_notify":"['EMAIL']",
//"return_target":"top",
//"display_payments_mode":"['DIRECT', 'REDIRECT', 'INSTALMENT', 'SUBSCRIPTION']"
},
/*
"affiliate": {
"subvendors": {
"2261": "100",
"2271": "120"
},
//"commission_type": "amount"
},
"invoicing": {
"net_amount": 5000,
"gross_amount": 5000,
"tax_percent": 2,
"tax_amount": 2,
//"coupon_percent": 1,
//"coupon_amount": 10,
"product_details": [
{
//"code": "P001",
"name": "Product name",
//"group": "Product group",
//"description": "Product description",
"quantity": 2,
"unit": 2,
"unit_price": 100,
"total_price": 200,
"tax_amount": 1,
"tax_percent": 1,
//"discount": 0,
//"note": "Note about the product"
}
],
"notice": {
"1": "Notice 1",
"2": "Notice 2",
"3": "Notice 3"
},
//"customer_support": "Max Mustermann | Email: support@yourshop.de",
//"custom_invoice_no": "INV-32",
"send_invoice_pdf": "1"
},
*/
"custom": {
"lang": "EN"
}
});
const options = {
hostname: 'payport.novalnet.de',
port: 443,
path: '/v2/seamless/payment',
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(postData),
'Charset': 'utf-8',
'Accept': 'application/json',
'X-NN-Access-Key': '###YOUR_ENCODED_PAYMENT_ACCESS_KEY###'
},
};
const req = https.request(options, (res) => {
console.log('statuscode:', res.statuscode);
// console.log('headers:', res.headers);
res.on('data', (d) => {
process.stdout.write(d);
});
});
req.on('error', (e) => {
console.error('ERROR: ',e);
});
// Write data to request body
req.write(postData);
req.end();
#!/usr/bin/python3
import http.client
import json
CONN = http.client.HTTPSConnection("payport.novalnet.de")
PAYLOAD = json.dumps({
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
#"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "test@novalnet.de",
"birth_date": "1992-06-10",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
"customer_ip": "###CUSTOMER_IP###",
#"customer_no": "###CUSTOMER_NUMBER###",
#"tel": "+49 089 123456",
#"mobile": "+49 089 123456",
#"fax": "+49 89 654321",
#"shipping": {
#"same_as_billing": "1",
#"city": "Kaiserslautern",
#"company": "A.B.C. Gerüstbau GmbH",
#"country_code": "DE",
#"email": "test@novanet.de",
#"first_name": "Norbert",
#"house_no": "9",
#"last_name": "Maier",
#"mobile": "+491747781423",
#"state": "Berlin",
#"street": "Hauptstr",
#"tel": "+49 089 123456",
#"zip": "66862"
#},
#"vat_id": "DE123456",
#"tax_id": "123/123/123",
#"reg_no": "HRB1234",
#"session": "fedgrgst5653653hdgfsvgdsf622627e",
#"no_nc": "1"
},
"transaction": {
"test_mode": "###TEST_MODE###",
"payment_type": "APPLEPAY",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"hook_url": "###HOOK_URL###",
"create_token": "1",
"return_url": "###YOUR_RETURN_URL###",
"error_return_url": "###YOUR_ERROR_RETURN_URL###",
#"invoice_ref": "###INVOICE_REF###",
#"invoice_no": "###INVOICE_NO###",
#"dynamic_descriptor": "www.yourshop.com"
},
"hosted_page": {
#"css_url": "https://www.demoshop.de/custom.css",
"logo": "###YOUR_SHOP_LOGO###",
#"hide_payments": [
#"CREDITCARD",
#"DIRECT_DEBIT_SEPA",
#"PREPAYMENT",
#"IDEAL"
#],
"display_payments":["APPLEPAY"],
"hide_blocks":["ADDRESS_FORM","SHOP_INFO","LANGUAGE_MENU","HEADER","TARIFF"],
"skip_pages":["CONFIRMATION_PAGE","SUCCESS_PAGE","PAYMENT_PAGE"],
"url_shortener": "1",
"link_expiry": "YYYY-MM-DD HH:MM:SS",
#"link_notify":"['EMAIL']",
#"return_target":"top",
#"display_payments_mode":"['DIRECT', 'REDIRECT', 'INSTALMENT', 'SUBSCRIPTION']"
},
#"affiliate": {
# "subvendors": {
# "2261": "100",
# "2271": "120"
# },
#"commission_type": "amount"
#},
#"invoicing": {
#"net_amount": 5000,
#"gross_amount": 5000,
#"tax_percent": 2,
#"tax_amount": 2,
#"coupon_percent": 1,
#"coupon_amount": 10,
#"product_details": [
#{
#"code": "P001",
#"name": "Product name",
#"group": "Product group",
#"description": "Product description",
#"quantity": 2,
#"unit": 2,
#"unit_price": 100,
#"total_price": 200,
#"tax_amount": 1,
#"tax_percent": 1,
#"discount": 0,
#"note": "Note about the product"
#}
#],
#"notice": {
# "1": "Notice 1",
# "2": "Notice 2",
# "3": "Notice 3"
# },
#"customer_support": "Max Mustermann | Email: support@yourshop.de",
#"custom_invoice_no": "INV-32",
#"send_invoice_pdf": "1"
#},
"custom": {
"lang": "EN"
}
})
HEADERS = {
'Content-Type': 'application/json',
'Charset': 'utf-8',
'Accept': 'application/json',
'X-NN-Access-Key': '###YOUR_ENCODED_PAYMENT_ACCESS_KEY###'
}
CONN.request("POST", "/v2/seamless/payment", PAYLOAD, HEADERS)
RES = CONN.getresponse()
DATA = RES.read()
print(DATA.decode("utf-8"))
#!/usr/lib/ruby
require "uri"
require "json"
require "net/http"
url = URI("https://payport.novalnet.de/v2/seamless/payment")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Accept"] = "application/json"
request["Charset"] = "utf-8"
request["X-NN-Access-Key"] = "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###"
request.body = JSON.dump({
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
#"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "test@novalnet.de",
"birth_date": "1992-06-10",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
"customer_ip": "###CUSTOMER_IP###",
#"customer_no": "###CUSTOMER_NUMBER###",
#"tel": "+49 089 123456",
#"mobile": "+49 089 123456",
#"fax": "+49 89 654321",
#"shipping": {
#"same_as_billing": "1",
#"city": "Kaiserslautern",
#"company": "A.B.C. Gerüstbau GmbH",
#"country_code": "DE",
#"email": "test@novanet.de",
#"first_name": "Norbert",
#"house_no": "9",
#"last_name": "Maier",
#"mobile": "+491747781423",
#"state": "Berlin",
#"street": "Hauptstr",
#"tel": "+49 089 123456",
#"zip": "66862"
#},
#"vat_id": "DE123456",
#"tax_id": "123/123/123",
#"reg_no": "HRB1234",
#"session": "fedgrgst5653653hdgfsvgdsf622627e",
#"no_nc": "1"
},
"transaction": {
"test_mode": "###TEST_MODE###",
"payment_type": "APPLEPAY",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"hook_url": "###HOOK_URL###",
"create_token": "1",
"return_url": "###YOUR_RETURN_URL###",
"error_return_url": "###YOUR_ERROR_RETURN_URL###",
#"invoice_ref": "###INVOICE_REF###",
#"invoice_no": "###INVOICE_NO###",
#"dynamic_descriptor": "www.yourshop.com"
},
"hosted_page": {
#"css_url": "https://www.demoshop.de/custom.css",
"logo": "###YOUR_SHOP_LOGO###",
#"hide_payments": [
#"CREDITCARD",
#"DIRECT_DEBIT_SEPA",
#"PREPAYMENT",
#"IDEAL"
#],
"display_payments":["APPLEPAY"],
"hide_blocks":["ADDRESS_FORM","SHOP_INFO","LANGUAGE_MENU","HEADER","TARIFF"],
"skip_pages":["CONFIRMATION_PAGE","SUCCESS_PAGE","PAYMENT_PAGE"],
"url_shortener": "1",
"link_expiry": "YYYY-MM-DD HH:MM:SS",
#"link_notify":"['EMAIL']",
#"return_target":"top",
#"display_payments_mode":"['DIRECT', 'REDIRECT', 'INSTALMENT', 'SUBSCRIPTION']"
},
#"affiliate": {
# "subvendors": {
# "2261": "100",
# "2271": "120"
# },
#"commission_type": "amount"
#},
#"invoicing": {
#"net_amount": 5000,
#"gross_amount": 5000,
#"tax_percent": 2,
#"tax_amount": 2,
#"coupon_percent": 1,
#"coupon_amount": 10,
#"product_details": [
#{
#"code": "P001",
#"name": "Product name",
#"group": "Product group",
#"description": "Product description",
#"quantity": 2,
#"unit": 2,
#"unit_price": 100,
#"total_price": 200,
#"tax_amount": 1,
#"tax_percent": 1,
#"discount": 0,
#"note": "Note about the product"
#}
#],
#"notice": {
# "1": "Notice 1",
# "2": "Notice 2",
# "3": "Notice 3"
# },
#"customer_support": "Max Mustermann | Email: support@yourshop.de",
#"custom_invoice_no": "INV-32",
#"send_invoice_pdf": "1"
#},
"custom": {
"lang": "EN"
}
})
response = https.request(request)
puts response.read_body
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://payport.novalnet.de/v2/seamless/payment"
method := "POST"
payload := strings.NewReader(`{
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
//"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"birth_date": "1992-06-10",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
"customer_ip": "###CUSTOMER_IP###",
//"customer_no": "###CUSTOMER_NUMBER###",
//"tel": "+49 089 123456",
//"mobile": "+49 089 123456",
//"fax": "+49 89 654321",
/*
"shipping": {
"same_as_billing": "1",
"city": "Kaiserslautern",
"company": "A.B.C. Gerüstbau GmbH",
"country_code": "DE",
"email": "test@novanet.de",
"first_name": "Norbert",
"house_no": "9",
"last_name": "Maier",
"mobile": "+491747781423",
"state": "Berlin",
"street": "Hauptstr",
"tel": "+49 089 123456",
"zip": "66862"
},
*/
//"vat_id": "DE123456",
//"tax_id": "123/123/123",
//"reg_no": "HRB1234",
//"session": "fedgrgst5653653hdgfsvgdsf622627e",
//"no_nc": "1"
},
"transaction": {
"test_mode": "###TEST_MODE###",
"payment_type": "APPLEPAY",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"hook_url": "###YOUR_HOOK_URL###",
"create_token": "1",
"return_url": "###YOUR_RETURN_URL###",
"error_return_url": "###YOUR_ERROR_RETURN_URL###",
/*
"invoice_ref": "###INVOICE_REF###",
"invoice_no": "###INVOICE_NO###",
"dynamic_descriptor": "www.yourshop.com"
*/
},
"hosted_page": {
//"css_url": "https://www.demoshop.de/custom.css",
"logo": "###YOUR_SHOP_LOGO###",
/*"hide_payments": [
"CREDITCARD",
"DIRECT_DEBIT_SEPA",
"PREPAYMENT",
"IDEAL"
],*/
"display_payments":["APPLEPAY"],
"hide_blocks":["ADDRESS_FORM","SHOP_INFO","LANGUAGE_MENU","HEADER","TARIFF"],
"skip_pages":["CONFIRMATION_PAGE","SUCCESS_PAGE","PAYMENT_PAGE"],
"url_shortener":"1",
"link_expiry":"YYYY-MM-DD HH:MM:SS",
//"link_notify":"['EMAIL']",
//"return_target":"top",
//"display_payments_mode":"['DIRECT', 'REDIRECT', 'INSTALMENT', 'SUBSCRIPTION']"
},
/*
"affiliate": {
"subvendors": {
"2261": "100",
"2271": "120"
},
//"commission_type": "amount"
},
"invoicing": {
"net_amount": 5000,
"gross_amount": 5000,
"tax_percent": 2,
"tax_amount": 2,
//"coupon_percent": 1,
//"coupon_amount": 10,
"product_details": [
{
//"code": "P001",
"name": "Product name",
//"group": "Product group",
//"description": "Product description",
"quantity": 2,
"unit": 2,
"unit_price": 100,
"total_price": 200,
"tax_amount": 1,
"tax_percent": 1,
//"discount": 0,
//"note": "Note about the product"
}
],
"notice": {
"1": "Notice 1",
"2": "Notice 2",
"3": "Notice 3"
},
//"customer_support": "Max Mustermann | Email: support@yourshop.de",
//"custom_invoice_no": "INV-32",
"send_invoice_pdf": "1"
},
*/
"custom": {
"lang": "EN"
}
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
req.Header.Add("Charset", "utf-8")
req.Header.Add("X-NN-Access-Key", "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
/* List of required libraries (see also the import statements below):
- commons-logging-1.2.jar
- httpasyncclient-4.1.5.jar
- httpclient-4.3.3.jar
- httpcore-4.4.16.jar
- httpcore-nio-4.4.16.jar
- httpmime-4.5.14.jar
- json-20230227.jar
- unirest-java-3.9.00.jar
*/
import java.io.*;
import org.json.JSONArray;
import org.apache.http.auth.*;
import org.apache.http.nio.conn.*;
import org.apache.http.concurrent.*;
import org.apache.http.nio.reactor.*;
import org.apache.commons.logging.*;
import org.apache.http.entity.mime.content.*;
import kong.unirest.*;
public class HostedApi {
public static void main(String []args) throws Exception{
Unirest.config().connectTimeout(1000).socketTimeout(2000);
HttpResponse<String> response = Unirest.post("https://payport.novalnet.de/v2/seamless/payment")
.header("Content-Type", "application/json")
.header("Charset", "utf-8")
.header("Accept", "application/json")
.header("X-NN-Access-Key", "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###")
.body("{
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
//"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"birth_date": "1992-06-10",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
"customer_ip": "###CUSTOMER_IP###",
//"customer_no": "###CUSTOMER_NUMBER###",
//"tel": "+49 089 123456",
//"mobile": "+49 089 123456",
//"fax": "+49 89 654321",
/*
"shipping": {
"same_as_billing": "1",
"city": "Kaiserslautern",
"company": "A.B.C. Gerüstbau GmbH",
"country_code": "DE",
"email": "test@novanet.de",
"first_name": "Norbert",
"house_no": "9",
"last_name": "Maier",
"mobile": "+491747781423",
"state": "Berlin",
"street": "Hauptstr",
"tel": "+49 089 123456",
"zip": "66862"
},
*/
//"vat_id": "DE123456",
//"tax_id": "123/123/123",
//"reg_no": "HRB1234",
//"session": "fedgrgst5653653hdgfsvgdsf622627e",
//"no_nc": "1"
},
"transaction": {
"test_mode": "###TEST_MODE###",
"payment_type": "APPLEPAY",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"hook_url": "###YOUR_HOOK_URL###",
"create_token": "1",
"return_url": "###YOUR_RETURN_URL###",
"error_return_url": "###YOUR_ERROR_RETURN_URL###",
/*
"invoice_ref": "###INVOICE_REF###",
"invoice_no": "###INVOICE_NO###",
"dynamic_descriptor": "www.yourshop.com"
*/
},
"hosted_page": {
//"css_url": "https://www.demoshop.de/custom.css",
"logo": "###YOUR_SHOP_LOGO###",
/*"hide_payments": [
"CREDITCARD",
"DIRECT_DEBIT_SEPA",
"PREPAYMENT",
"IDEAL"
],*/
"display_payments":["APPLEPAY"],
"hide_blocks":["ADDRESS_FORM","SHOP_INFO","LANGUAGE_MENU","HEADER","TARIFF"],
"skip_pages":["CONFIRMATION_PAGE","SUCCESS_PAGE","PAYMENT_PAGE"],
"url_shortener":"1",
"link_expiry":"YYYY-MM-DD HH:MM:SS",
//"link_notify":"['EMAIL']",
//"return_target":"top",
//"display_payments_mode":"['DIRECT', 'REDIRECT', 'INSTALMENT', 'SUBSCRIPTION']"
},
/*
"affiliate": {
"subvendors": {
"2261": "100",
"2271": "120"
},
//"commission_type": "amount"
},
"invoicing": {
"net_amount": 5000,
"gross_amount": 5000,
"tax_percent": 2,
"tax_amount": 2,
//"coupon_percent": 1,
//"coupon_amount": 10,
"product_details": [
{
//"code": "P001",
"name": "Product name",
//"group": "Product group",
//"description": "Product description",
"quantity": 2,
"unit": 2,
"unit_price": 100,
"total_price": 200,
"tax_amount": 1,
"tax_percent": 1,
//"discount": 0,
//"note": "Note about the product"
}
],
"notice": {
"1": "Notice 1",
"2": "Notice 2",
"3": "Notice 3"
},
//"customer_support": "Max Mustermann | Email: support@yourshop.de",
//"custom_invoice_no": "INV-32",
"send_invoice_pdf": "1"
},
*/
"custom": {
"lang": "EN"
}
}")
.asString();
System.out.println(response.getBody());
}
}
using System;
using System.Net.Http;
namespace HostedApiRequest
{
public class HostedApi {
public string check_hosted_api_request() {
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://payport.novalnet.de/v2/seamless/payment");
request.Headers.Add("Charset", "utf-8");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("X-NN-Access-Key", "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###");
var content = new StringContent("{
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
//"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"birth_date": "1992-06-10",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
"customer_ip": "###CUSTOMER_IP###",
//"customer_no": "###CUSTOMER_NUMBER###",
//"tel": "+49 089 123456",
//"mobile": "+49 089 123456",
//"fax": "+49 89 654321",
/*
"shipping": {
"same_as_billing": "1",
"city": "Kaiserslautern",
"company": "A.B.C. Gerüstbau GmbH",
"country_code": "DE",
"email": "test@novanet.de",
"first_name": "Norbert",
"house_no": "9",
"last_name": "Maier",
"mobile": "+491747781423",
"state": "Berlin",
"street": "Hauptstr",
"tel": "+49 089 123456",
"zip": "66862"
},
*/
//"vat_id": "DE123456",
//"tax_id": "123/123/123",
//"reg_no": "HRB1234",
//"session": "fedgrgst5653653hdgfsvgdsf622627e",
//"no_nc": "1"
},
"transaction": {
"test_mode": "###TEST_MODE###",
"payment_type": "APPLEPAY",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"hook_url": "###YOUR_HOOK_URL###",
"create_token": "1",
"return_url": "###YOUR_RETURN_URL###",
"error_return_url": "###YOUR_ERROR_RETURN_URL###",
/*
"invoice_ref": "###INVOICE_REF###",
"invoice_no": "###INVOICE_NO###",
"dynamic_descriptor": "www.yourshop.com"
*/
},
"hosted_page": {
//"css_url": "https://www.demoshop.de/custom.css",
"logo": "###YOUR_SHOP_LOGO###",
/*"hide_payments": [
"CREDITCARD",
"DIRECT_DEBIT_SEPA",
"PREPAYMENT",
"IDEAL"
],*/
"display_payments":["APPLEPAY"],
"hide_blocks":["ADDRESS_FORM","SHOP_INFO","LANGUAGE_MENU","HEADER","TARIFF"],
"skip_pages":["CONFIRMATION_PAGE","SUCCESS_PAGE","PAYMENT_PAGE"],
"url_shortener":"1",
"link_expiry":"YYYY-MM-DD HH:MM:SS",
//"link_notify":"['EMAIL']",
//"return_target":"top",
//"display_payments_mode":"['DIRECT', 'REDIRECT', 'INSTALMENT', 'SUBSCRIPTION']"
},
/*
"affiliate": {
"subvendors": {
"2261": "100",
"2271": "120"
},
//"commission_type": "amount"
},
"invoicing": {
"net_amount": 5000,
"gross_amount": 5000,
"tax_percent": 2,
"tax_amount": 2,
//"coupon_percent": 1,
//"coupon_amount": 10,
"product_details": [
{
//"code": "P001",
"name": "Product name",
//"group": "Product group",
//"description": "Product description",
"quantity": 2,
"unit": 2,
"unit_price": 100,
"total_price": 200,
"tax_amount": 1,
"tax_percent": 1,
//"discount": 0,
//"note": "Note about the product"
}
],
"notice": {
"1": "Notice 1",
"2": "Notice 2",
"3": "Notice 3"
},
//"customer_support": "Max Mustermann | Email: support@yourshop.de",
//"custom_invoice_no": "INV-32",
"send_invoice_pdf": "1"
},
*/
"custom": {
"lang": "EN"
}
}", null, "application/json");
request.Content = content;
var response = client.SendAsync(request).Result;
response.EnsureSuccessstatuscode();
var responseText = response.Content.ReadAsStringAsync().Result;
Console.WriteLine(responseText);
return responseText;
}
public static void Main() {
var testRequest = new HostedApi();
testRequest.check_hosted_api_request();
}
}
}
<?php
// Need to enter your payment access key value here
$payment_access_key = '###YOUR_PAYMENT_ACCESS_KEY###';
// Now, have to encode the $payment_access_key value with the base64 encode
$encoded_data = base64_encode($payment_access_key);
// Action Endpoint
$endpoint = 'https://payport.novalnet.de/v2/seamless/payment';
// Build the Headers array
$headers = [
// The Content-Type should be "application/json"
'Content-Type:application/json',
// The charset should be "utf-8"
'Charset:utf-8',
// Optional
'Accept:application/json',
// The formed authenticate value (case-sensitive)
'X-NN-Access-Key:' . $encoded_data,
];
$data = [];
// Build Merchant Data
$data['merchant'] = [
// Your API signature value
'signature' => '###YOUR_API_SIGNATURE###',
// Your corresponding tariff ID
'tariff' => '###YOUR_TARIFF_ID###',
];
// Build Customer Data
$data['customer'] = [
// Shopper's first name
'first_name' => 'Max',
// Shopper's last name
'last_name' => 'Mustermann',
// Shopper's email
'email' => '###YOUR_MAIL###',
// Shopper's Ip address
'customer_ip' => '###CUSTOMER_IP###',
// Shopper's customer number from the shop
'customer_no' => '###CUSTOMER_NUMBER###',
// Shopper's Telephone number
'tel' => '+49 089 123456',
// Shopper's Mobile number
'mobile' => '+49 174 7781423',
// Shopper's birthdate value YYYY-MM-DD
'birth_date' => '###BIRTHDATE###',
// Shopper's gender - Decomment it based on your usage
// 'gender' => 'u',
// Shopper's company vat ID value - Decomment it based on your usage
// 'vat_id' => 'DE123456',
// Shopper's company regestration number - Decomment it based on your usage
// 'reg_no' => 'HRB1234',
// Shopper's company tax ID value - Decomment it based on your usage
// 'tax_id' => '123/123/123',
// Shopper's session value - Decomment it based on your usage
// 'session' => 'fedgrgst5653653hdgfsvgdsf622627e',
// Shopper's fax number - Decomment it based on your usage
// 'fax' => '+49 89 654321',
// Shopper's billing address
'billing' => [
// House number
'house_no' => '2',
// Street
'street' => 'Musterstr',
// City
'city' => 'Musterhausen',
// zip
'zip' => '12345',
// Country's ISO code
'country_code' => 'DE',
// Name of the company - Decomment it based on your usage
// 'company' => 'ABC GmbH',
// State
//'state' => 'Berlin'
]
/*
// Shopper's shipping address (optional)
'shipping' => [
// Pass this parameter if the billing and the shipping address are identical
'same_as_billing' => '1',
// First name
'first_name' => 'Norbert',
// Last name
'last_name' => 'Maier',
// Email
'email' => 'test@novalnet.de',
// Name of the company
'company' => 'A.B.C. Gerüstbau GmbH',
// House number
'house_no' => '9',
// Street
'street' => 'Hauptstr',
// City
'city' => 'Kaiserslautern',
// zip
'zip' => '66862',
// Country's ISO code
'country_code' => 'DE',
// Telephone number
'tel' => '+49 089 123456',
// Mobile number
'mobile' => '+49 174 7781423',
// State
'state' => 'Berlin'
],
*/
];
// Build Transaction Data
$data['transaction'] = [
// The Payment type of the transaction
'payment_type' => 'GOOGLEPAY',
// The transaction Amount in smaller currency unit
'amount' => '###TRANSACTION_AMOUNT###',
// The transaction currency's ISO code
'currency' => '###TRANSACTION_CURRENCY###',
// The mode of the transaction
'test_mode' => '###TEST_MODE###',
// The mode of the transaction
'order_no' => '###TRANSACTION_ORDER_NUMBER###',
// The Hook URL value for this particular transaction
'hook_url' => '###YOUR_HOOK_URL###',
// The reference related to your customer`s invoice of the order.
//'invoice_ref' => '###INVOICE_REF###',
// The invoice number related to your customer`s invoice of the order.
//'invoice_no' => '###INVOICE_NO###',
// Need to be specify this for the Redirect payment types to which you need to redirect on SUCCESS
'return_url' => '###YOUR_RETURN_URL###',
// Need to be specify this for the Redirect payment types to which you need to redirect on FAILURE (optional)
'error_return_url' => '###YOUR_ERROR_RETURN_URL###',
// The flag to create the token for the payment data - Decomment it based on your usage
'create_token' => 1
];
// Hosted Payment page customizations
$data['hosted_page'] = [
// Change logo in the Hosted payment page
//'logo' => '###YOUR_SHOP_LOGO###',
//'css_url' => 'https://www.demoshop.de/custom.css',
// Payment types to be displayed in the Hosted Payment Page
'display_payments' => ['GOOGLEPAY'],
// Payment types to be hidden in the Hosted Payment Page - Used when necessary and display_payments when not in use
// 'hide_payments' => ['CREDITCARD', 'DIRECT_DEBIT_SEPA', 'INVOICE', 'IDEAL', 'PAYPAL'],
// Hide the following sections from the Hosted Payment Page
'hide_blocks' => ['ADDRESS_FORM', 'SHOP_INFO', 'LANGUAGE_MENU', 'HEADER', 'TARIFF'],
// Customize the display of the following pages
'skip_pages' => ['CONFIRMATION_PAGE', 'SUCCESS_PAGE', 'PAYMENT_PAGE'],
//'link_notify' => '['EMAIL']',
//'return_target' => 'top',
//'display_payments_mode' => '['DIRECT', 'REDIRECT', 'INSTALMENT', 'SUBSCRIPTION']'
];
/*
// Affiliate Data, used for the affiliate`s revenue split model - Optional object - Decomment it based on your usage
$data['affiliate'] = [
// To submit shares for several affiliates for the same transaction
'subvendors'=> [
'2261' => '100',
'2271' => '120'
],
// Commission type for several affiliates for the same transaction
//'commission_type'=> 'amount'
];
// Invoicing Data
$data['invoicing'] = [
// Total amount (excl. tax) should be mentioned here
'net_amount' => 5000,
// Total amount (incl. tax) should be mentioned here
'gross_amount' => 5000,
// Overall invoice tax percent should be mentioned here
'tax_percent' => 2,
// Overall invoice tax amount should be mentioned here
'tax_amount' => 2,
// Discount coupon percentage should be mentioned here
//'coupon_percent' => 1,
// Discount coupon amount should be mentioned here
//'coupon_amount' => 10,
// Individual product details should be mentioned here
'product_details' => [
[
//'code' => 'P001',
'name' => 'Product name',
//'group' => 'Product group',
//'description' => 'Product description',
'unit' => 2,
'quantity' => 2,
'unit_price' => 100,
'total_price' => 200,
'tax_amount' => 1,
'tax_percent' => 1,
//'discount' => 0,
//'note' => 'Note about the product'
]
],
// The notification which you wants to provide to the end-customer in invoice PDF.
'notice' => [
'1' => 'Notice 1',
'2' => 'Notice 2',
'3' => 'Notice 3'
],
// Customize the customer support details here
//'customer_support' => 'Max Mustermann | Email: support@yourshop.de',
// Custom Invoice number
//'custom_invoice_no' => 'INV-32',
// Send the invoice pdf to end customer
'send_invoice_pdf' => '1'
];
*/
// Custom Data
$data['custom'] = [
// Shopper's selected language in shop
"lang" => "EN",
// Custom parameter's key - Optional object - Decomment it based on your usage
// 'input1' => 'your internal reference parameter name',
// Custom parameter's value - Optional object - Decomment it based on your usage
// 'inputval1' => 'your internal reference parameter value'
];
// Convert the array to JSON string
$json_data = json_encode($data);
// Handle Response
$response = send_request($json_data, $endpoint, $headers);
// Printing the response back to the Javascript to complete the Google Pay purchase
//print $response;
//exit;
function send_request($data, $url, $headers) {
// Initiate cURL
$curl = curl_init();
// Set the url
curl_setopt($curl, CURLOPT_URL, $url);
// Set the result output to be a string
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
// Set the POST value to true (mandatory)
curl_setopt($curl, CURLOPT_POST, true);
// Set the post fields
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
// Set the headers
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
// Execute cURL
$result = curl_exec($curl);
// Handle cURL error
if (curl_errno($curl)) {
echo 'Request Error:' . curl_error($curl);
return $result;
}
// Close cURL
curl_close($curl);
// Decode the JSON string
$result = json_decode($result);
return $result;
}
?>
curl --location --request POST 'https://payport.novalnet.de/v2/seamless/payment' -H 'Content-Type: application/json' -H 'Charset:utf-8' -H 'Accept: application/json' -H 'X-NN-Access-Key: ###YOUR_ENCODED_PAYMENT_ACCESS_KEY###' -d '{"merchant":{"signature":"###YOUR_API_SIGNATURE###","tariff":"###YOUR_TARIFF_ID###"},"customer":{"first_name":"Max","last_name":"Mustermann","email":"###YOUR_MAIL###","customer_ip":"###CUSTOMER_IP###","billing":{"house_no":"2","street":"Musterstr","city":"Musterhausen","zip":"12345","country_code":"DE"}},"transaction":{"payment_type":"GOOGLEPAY","amount":"###TRANSACTION_AMOUNT###","currency":"###TRANSACTION_CURRENCY###","test_mode":"###TEST_MODE###","order_no":"###TRANSACTION_ORDER_NUMBER###","hook_url":"###YOUR_HOOK_URL###","create_token":"1","return_url":"###YOUR_RETURN_URL###","error_return_url":"###YOUR_ERROR_RETURN_URL###"},"custom":{"lang":"EN"},"hosted_page":{"logo":"###YOUR_SHOP_LOGO###","display_payments":["GOOGLEPAY"],"hide_blocks":["ADDRESS_FORM","SHOP_INFO","LANGUAGE_MENU","HEADER","TARIFF"],"skip_pages":["CONFIRMATION_PAGE","SUCCESS_PAGE","PAYMENT_PAGE"]}}';
#!/usr/bin/node
const https = require('https');
// data sent in the body of the request
const postData = JSON.stringify({
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
//"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"birth_date": "1992-06-10",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
"customer_ip": "###CUSTOMER_IP###",
//"customer_no": "###CUSTOMER_NUMBER###",
//"tel": "+49 089 123456",
//"mobile": "+49 089 123456",
//"fax": "+49 89 654321",
/*
"shipping": {
"same_as_billing": "1",
"city": "Kaiserslautern",
"company": "A.B.C. Gerüstbau GmbH",
"country_code": "DE",
"email": "test@novanet.de",
"first_name": "Norbert",
"house_no": "9",
"last_name": "Maier",
"mobile": "+491747781423",
"state": "Berlin",
"street": "Hauptstr",
"tel": "+49 089 123456",
"zip": "66862"
},
*/
//"vat_id": "DE123456",
//"tax_id": "123/123/123",
//"reg_no": "HRB1234",
//"session": "fedgrgst5653653hdgfsvgdsf622627e",
//"no_nc": "1"
},
"transaction": {
"test_mode": "###TEST_MODE###",
"payment_type": "GOOGLEPAY",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"hook_url": "###YOUR_HOOK_URL###",
"create_token": "1",
"return_url": "###YOUR_RETURN_URL###",
"error_return_url": "###YOUR_ERROR_RETURN_URL###",
/*
"invoice_ref": "###INVOICE_REF###",
"invoice_no": "###INVOICE_NO###",
"dynamic_descriptor": "www.yourshop.com"
*/
},
"hosted_page": {
//"css_url": "https://www.demoshop.de/custom.css",
"logo": "###YOUR_SHOP_LOGO###",
/*"hide_payments": [
"CREDITCARD",
"DIRECT_DEBIT_SEPA",
"PREPAYMENT",
"IDEAL"
],*/
"display_payments": {'GOOGLEPAY'},
"hide_blocks": {'ADDRESS_FORM', 'SHOP_INFO', 'LANGUAGE_MENU', 'HEADER', 'TARIFF'},
"skip_pages": {'CONFIRMATION_PAGE', 'SUCCESS_PAGE', 'PAYMENT_PAGE'},
"url_shortener":"1",
"link_expiry":"YYYY-MM-DD HH:MM:SS",
//"link_notify":"['EMAIL']",
//"return_target":"top",
//"display_payments_mode":"['DIRECT', 'REDIRECT', 'INSTALMENT', 'SUBSCRIPTION']"
},
/*
"affiliate": {
"subvendors": {
"2261": "100",
"2271": "120"
},
//"commission_type": "amount"
},
"invoicing": {
"net_amount": 5000,
"gross_amount": 5000,
"tax_percent": 2,
"tax_amount": 2,
//"coupon_percent": 1,
//"coupon_amount": 10,
"product_details": [
{
//"code": "P001",
"name": "Product name",
//"group": "Product group",
//"description": "Product description",
"quantity": 2,
"unit": 2,
"unit_price": 100,
"total_price": 200,
"tax_amount": 1,
"tax_percent": 1,
//"discount": 0,
//"note": "Note about the product"
}
],
"notice": {
"1": "Notice 1",
"2": "Notice 2",
"3": "Notice 3"
},
//"customer_support": "Max Mustermann | Email: support@yourshop.de",
//"custom_invoice_no": "INV-32",
"send_invoice_pdf": "1"
},
*/
"custom": {
"lang": "EN"
}
});
const options = {
hostname: 'payport.novalnet.de',
port: 443,
path: '/v2/seamless/payment',
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(postData),
'Charset': 'utf-8',
'Accept': 'application/json',
'X-NN-Access-Key': '###YOUR_ENCODED_PAYMENT_ACCESS_KEY###'
},
};
const req = https.request(options, (res) => {
console.log('statuscode:', res.statuscode);
// console.log('headers:', res.headers);
res.on('data', (d) => {
process.stdout.write(d);
});
});
req.on('error', (e) => {
console.error('ERROR: ',e);
});
// Write data to request body
req.write(postData);
req.end();
#!/usr/bin/python3
import http.client
import json
CONN = http.client.HTTPSConnection("payport.novalnet.de")
PAYLOAD = json.dumps({
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
#"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "test@novalnet.de",
"birth_date": "1992-06-10",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
"customer_ip": "###CUSTOMER_IP###",
#"customer_no": "###CUSTOMER_NUMBER###",
#"tel": "+49 089 123456",
#"mobile": "+49 089 123456",
#"fax": "+49 89 654321",
#"shipping": {
#"same_as_billing": "1",
#"city": "Kaiserslautern",
#"company": "A.B.C. Gerüstbau GmbH",
#"country_code": "DE",
#"email": "test@novanet.de",
#"first_name": "Norbert",
#"house_no": "9",
#"last_name": "Maier",
#"mobile": "+491747781423",
#"state": "Berlin",
#"street": "Hauptstr",
#"tel": "+49 089 123456",
#"zip": "66862"
#},
#"vat_id": "DE123456",
#"tax_id": "123/123/123",
#"reg_no": "HRB1234",
#"session": "fedgrgst5653653hdgfsvgdsf622627e",
#"no_nc": "1"
},
"transaction": {
"test_mode": "###TEST_MODE###",
"payment_type": "GOOGLEPAY",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"hook_url": "###HOOK_URL###",
"create_token": "1",
"return_url": "###YOUR_RETURN_URL###",
"error_return_url": "###YOUR_ERROR_RETURN_URL###",
#"invoice_ref": "###INVOICE_REF###",
#"invoice_no": "###INVOICE_NO###",
#"dynamic_descriptor": "www.yourshop.com"
},
"hosted_page": {
#"css_url": "https://www.demoshop.de/custom.css",
"logo": "###YOUR_SHOP_LOGO###",
#"hide_payments": [
#"CREDITCARD",
#"DIRECT_DEBIT_SEPA",
#"PREPAYMENT",
#"IDEAL"
#],
"display_payments": {'GOOGLEPAY'},
"hide_blocks": {'ADDRESS_FORM', 'SHOP_INFO', 'LANGUAGE_MENU', 'HEADER', 'TARIFF'},
"skip_pages": {'CONFIRMATION_PAGE', 'SUCCESS_PAGE', 'PAYMENT_PAGE'},
"url_shortener": "1",
"link_expiry": "YYYY-MM-DD HH:MM:SS",
#"link_notify":"['EMAIL']",
#"return_target":"top",
#"display_payments_mode":"['DIRECT', 'REDIRECT', 'INSTALMENT', 'SUBSCRIPTION']"
},
#"affiliate": {
# "subvendors": {
# "2261": "100",
# "2271": "120"
# },
#"commission_type": "amount"
#},
#"invoicing": {
#"net_amount": 5000,
#"gross_amount": 5000,
#"tax_percent": 2,
#"tax_amount": 2,
#"coupon_percent": 1,
#"coupon_amount": 10,
#"product_details": [
#{
#"code": "P001",
#"name": "Product name",
#"group": "Product group",
#"description": "Product description",
#"quantity": 2,
#"unit": 2,
#"unit_price": 100,
#"total_price": 200,
#"tax_amount": 1,
#"tax_percent": 1,
#"discount": 0,
#"note": "Note about the product"
#}
#],
#"notice": {
# "1": "Notice 1",
# "2": "Notice 2",
# "3": "Notice 3"
# },
#"customer_support": "Max Mustermann | Email: support@yourshop.de",
#"custom_invoice_no": "INV-32",
#"send_invoice_pdf": "1"
#},
"custom": {
"lang": "EN"
}
})
HEADERS = {
'Content-Type': 'application/json',
'Charset': 'utf-8',
'Accept': 'application/json',
'X-NN-Access-Key': '###YOUR_ENCODED_PAYMENT_ACCESS_KEY###'
}
CONN.request("POST", "/v2/seamless/payment", PAYLOAD, HEADERS)
RES = CONN.getresponse()
DATA = RES.read()
print(DATA.decode("utf-8"))
#!/usr/lib/ruby
require "uri"
require "json"
require "net/http"
url = URI("https://payport.novalnet.de/v2/seamless/payment")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Accept"] = "application/json"
request["Charset"] = "utf-8"
request["X-NN-Access-Key"] = "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###"
request.body = JSON.dump({
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
#"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "test@novalnet.de",
"birth_date": "1992-06-10",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
"customer_ip": "###CUSTOMER_IP###",
#"customer_no": "###CUSTOMER_NUMBER###",
#"tel": "+49 089 123456",
#"mobile": "+49 089 123456",
#"fax": "+49 89 654321",
#"shipping": {
#"same_as_billing": "1",
#"city": "Kaiserslautern",
#"company": "A.B.C. Gerüstbau GmbH",
#"country_code": "DE",
#"email": "test@novanet.de",
#"first_name": "Norbert",
#"house_no": "9",
#"last_name": "Maier",
#"mobile": "+491747781423",
#"state": "Berlin",
#"street": "Hauptstr",
#"tel": "+49 089 123456",
#"zip": "66862"
#},
#"vat_id": "DE123456",
#"tax_id": "123/123/123",
#"reg_no": "HRB1234",
#"session": "fedgrgst5653653hdgfsvgdsf622627e",
#"no_nc": "1"
},
"transaction": {
"test_mode": "###TEST_MODE###",
"payment_type": "GOOGLEPAY",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"hook_url": "###HOOK_URL###",
"create_token": "1",
"return_url": "###YOUR_RETURN_URL###",
"error_return_url": "###YOUR_ERROR_RETURN_URL###",
#"invoice_ref": "###INVOICE_REF###",
#"invoice_no": "###INVOICE_NO###",
#"dynamic_descriptor": "www.yourshop.com"
},
"hosted_page": {
#"css_url": "https://www.demoshop.de/custom.css",
"logo": "###YOUR_SHOP_LOGO###",
#"hide_payments": [
#"CREDITCARD",
#"DIRECT_DEBIT_SEPA",
#"PREPAYMENT",
#"IDEAL"
#],
"display_payments": {'GOOGLEPAY'},
"hide_blocks": {'ADDRESS_FORM', 'SHOP_INFO', 'LANGUAGE_MENU', 'HEADER', 'TARIFF'},
"skip_pages": {'CONFIRMATION_PAGE', 'SUCCESS_PAGE', 'PAYMENT_PAGE'},
"url_shortener": "1",
"link_expiry": "YYYY-MM-DD HH:MM:SS",
#"link_notify":"['EMAIL']",
#"return_target":"top",
#"display_payments_mode":"['DIRECT', 'REDIRECT', 'INSTALMENT', 'SUBSCRIPTION']"
},
#"affiliate": {
# "subvendors": {
# "2261": "100",
# "2271": "120"
# },
#"commission_type": "amount"
#},
#"invoicing": {
#"net_amount": 5000,
#"gross_amount": 5000,
#"tax_percent": 2,
#"tax_amount": 2,
#"coupon_percent": 1,
#"coupon_amount": 10,
#"product_details": [
#{
#"code": "P001",
#"name": "Product name",
#"group": "Product group",
#"description": "Product description",
#"quantity": 2,
#"unit": 2,
#"unit_price": 100,
#"total_price": 200,
#"tax_amount": 1,
#"tax_percent": 1,
#"discount": 0,
#"note": "Note about the product"
#}
#],
#"notice": {
# "1": "Notice 1",
# "2": "Notice 2",
# "3": "Notice 3"
# },
#"customer_support": "Max Mustermann | Email: support@yourshop.de",
#"custom_invoice_no": "INV-32",
#"send_invoice_pdf": "1"
#},
"custom": {
"lang": "EN"
}
})
response = https.request(request)
puts response.read_body
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://payport.novalnet.de/v2/seamless/payment"
method := "POST"
payload := strings.NewReader(`{
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
//"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"birth_date": "1992-06-10",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
"customer_ip": "###CUSTOMER_IP###",
//"customer_no": "###CUSTOMER_NUMBER###",
//"tel": "+49 089 123456",
//"mobile": "+49 089 123456",
//"fax": "+49 89 654321",
/*
"shipping": {
"same_as_billing": "1",
"city": "Kaiserslautern",
"company": "A.B.C. Gerüstbau GmbH",
"country_code": "DE",
"email": "test@novanet.de",
"first_name": "Norbert",
"house_no": "9",
"last_name": "Maier",
"mobile": "+491747781423",
"state": "Berlin",
"street": "Hauptstr",
"tel": "+49 089 123456",
"zip": "66862"
},
*/
//"vat_id": "DE123456",
//"tax_id": "123/123/123",
//"reg_no": "HRB1234",
//"session": "fedgrgst5653653hdgfsvgdsf622627e",
//"no_nc": "1"
},
"transaction": {
"test_mode": "###TEST_MODE###",
"payment_type": "GOOGLEPAY",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"hook_url": "###YOUR_HOOK_URL###",
"create_token": "1",
"return_url": "###YOUR_RETURN_URL###",
"error_return_url": "###YOUR_ERROR_RETURN_URL###",
/*
"invoice_ref": "###INVOICE_REF###",
"invoice_no": "###INVOICE_NO###",
"dynamic_descriptor": "www.yourshop.com"
*/
},
"hosted_page": {
//"css_url": "https://www.demoshop.de/custom.css",
"logo": "###YOUR_SHOP_LOGO###",
/*"hide_payments": [
"CREDITCARD",
"DIRECT_DEBIT_SEPA",
"PREPAYMENT",
"IDEAL"
],*/
"display_payments": {'GOOGLEPAY'},
"hide_blocks": {'ADDRESS_FORM', 'SHOP_INFO', 'LANGUAGE_MENU', 'HEADER', 'TARIFF'},
"skip_pages": {'CONFIRMATION_PAGE', 'SUCCESS_PAGE', 'PAYMENT_PAGE'},
"url_shortener":"1",
"link_expiry":"YYYY-MM-DD HH:MM:SS",
//"link_notify":"['EMAIL']",
//"return_target":"top",
//"display_payments_mode":"['DIRECT', 'REDIRECT', 'INSTALMENT', 'SUBSCRIPTION']"
},
/*
"affiliate": {
"subvendors": {
"2261": "100",
"2271": "120"
},
//"commission_type": "amount"
},
"invoicing": {
"net_amount": 5000,
"gross_amount": 5000,
"tax_percent": 2,
"tax_amount": 2,
//"coupon_percent": 1,
//"coupon_amount": 10,
"product_details": [
{
//"code": "P001",
"name": "Product name",
//"group": "Product group",
//"description": "Product description",
"quantity": 2,
"unit": 2,
"unit_price": 100,
"total_price": 200,
"tax_amount": 1,
"tax_percent": 1,
//"discount": 0,
//"note": "Note about the product"
}
],
"notice": {
"1": "Notice 1",
"2": "Notice 2",
"3": "Notice 3"
},
//"customer_support": "Max Mustermann | Email: support@yourshop.de",
//"custom_invoice_no": "INV-32",
"send_invoice_pdf": "1"
},
*/
"custom": {
"lang": "EN"
}
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
req.Header.Add("Charset", "utf-8")
req.Header.Add("X-NN-Access-Key", "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
/* List of required libraries (see also the import statements below):
- commons-logging-1.2.jar
- httpasyncclient-4.1.5.jar
- httpclient-4.3.3.jar
- httpcore-4.4.16.jar
- httpcore-nio-4.4.16.jar
- httpmime-4.5.14.jar
- json-20230227.jar
- unirest-java-3.9.00.jar
*/
import java.io.*;
import org.json.JSONArray;
import org.apache.http.auth.*;
import org.apache.http.nio.conn.*;
import org.apache.http.concurrent.*;
import org.apache.http.nio.reactor.*;
import org.apache.commons.logging.*;
import org.apache.http.entity.mime.content.*;
import kong.unirest.*;
public class HostedApi {
public static void main(String []args) throws Exception{
Unirest.config().connectTimeout(1000).socketTimeout(2000);
HttpResponse<String> response = Unirest.post("https://payport.novalnet.de/v2/seamless/payment")
.header("Content-Type", "application/json")
.header("Charset", "utf-8")
.header("Accept", "application/json")
.header("X-NN-Access-Key", "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###")
.body("{
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
//"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"birth_date": "1992-06-10",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
"customer_ip": "###CUSTOMER_IP###",
//"customer_no": "###CUSTOMER_NUMBER###",
//"tel": "+49 089 123456",
//"mobile": "+49 089 123456",
//"fax": "+49 89 654321",
/*
"shipping": {
"same_as_billing": "1",
"city": "Kaiserslautern",
"company": "A.B.C. Gerüstbau GmbH",
"country_code": "DE",
"email": "test@novanet.de",
"first_name": "Norbert",
"house_no": "9",
"last_name": "Maier",
"mobile": "+491747781423",
"state": "Berlin",
"street": "Hauptstr",
"tel": "+49 089 123456",
"zip": "66862"
},
*/
//"vat_id": "DE123456",
//"tax_id": "123/123/123",
//"reg_no": "HRB1234",
//"session": "fedgrgst5653653hdgfsvgdsf622627e",
//"no_nc": "1"
},
"transaction": {
"test_mode": "###TEST_MODE###",
"payment_type": "GOOGLEPAY",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"hook_url": "###YOUR_HOOK_URL###",
"create_token": "1",
"return_url": "###YOUR_RETURN_URL###",
"error_return_url": "###YOUR_ERROR_RETURN_URL###",
/*
"invoice_ref": "###INVOICE_REF###",
"invoice_no": "###INVOICE_NO###",
"dynamic_descriptor": "www.yourshop.com"
*/
},
"hosted_page": {
//"css_url": "https://www.demoshop.de/custom.css",
"logo": "###YOUR_SHOP_LOGO###",
/*"hide_payments": [
"CREDITCARD",
"DIRECT_DEBIT_SEPA",
"PREPAYMENT",
"IDEAL"
],*/
"display_payments": {'GOOGLEPAY'},
"hide_blocks": {'ADDRESS_FORM', 'SHOP_INFO', 'LANGUAGE_MENU', 'HEADER', 'TARIFF'},
"skip_pages": {'CONFIRMATION_PAGE', 'SUCCESS_PAGE', 'PAYMENT_PAGE'},
"url_shortener":"1",
"link_expiry":"YYYY-MM-DD HH:MM:SS",
//"link_notify":"['EMAIL']",
//"return_target":"top",
//"display_payments_mode":"['DIRECT', 'REDIRECT', 'INSTALMENT', 'SUBSCRIPTION']"
},
/*
"affiliate": {
"subvendors": {
"2261": "100",
"2271": "120"
},
//"commission_type": "amount"
},
"invoicing": {
"net_amount": 5000,
"gross_amount": 5000,
"tax_percent": 2,
"tax_amount": 2,
//"coupon_percent": 1,
//"coupon_amount": 10,
"product_details": [
{
//"code": "P001",
"name": "Product name",
//"group": "Product group",
//"description": "Product description",
"quantity": 2,
"unit": 2,
"unit_price": 100,
"total_price": 200,
"tax_amount": 1,
"tax_percent": 1,
//"discount": 0,
//"note": "Note about the product"
}
],
"notice": {
"1": "Notice 1",
"2": "Notice 2",
"3": "Notice 3"
},
//"customer_support": "Max Mustermann | Email: support@yourshop.de",
//"custom_invoice_no": "INV-32",
"send_invoice_pdf": "1"
},
*/
"custom": {
"lang": "EN"
}
}")
.asString();
System.out.println(response.getBody());
}
}
using System;
using System.Net.Http;
namespace HostedApiRequest
{
public class HostedApi {
public string check_hosted_api_request() {
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://payport.novalnet.de/v2/seamless/payment");
request.Headers.Add("Charset", "utf-8");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("X-NN-Access-Key", "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###");
var content = new StringContent("{
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
//"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"birth_date": "1992-06-10",
"billing": {
"company": "ABC GmbH",
"house_no": "2",
"street": "Musterstr",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"state": "Berlin"
},
"customer_ip": "###CUSTOMER_IP###",
//"customer_no": "###CUSTOMER_NUMBER###",
//"tel": "+49 089 123456",
//"mobile": "+49 089 123456",
//"fax": "+49 89 654321",
/*
"shipping": {
"same_as_billing": "1",
"city": "Kaiserslautern",
"company": "A.B.C. Gerüstbau GmbH",
"country_code": "DE",
"email": "test@novanet.de",
"first_name": "Norbert",
"house_no": "9",
"last_name": "Maier",
"mobile": "+491747781423",
"state": "Berlin",
"street": "Hauptstr",
"tel": "+49 089 123456",
"zip": "66862"
},
*/
//"vat_id": "DE123456",
//"tax_id": "123/123/123",
//"reg_no": "HRB1234",
//"session": "fedgrgst5653653hdgfsvgdsf622627e",
//"no_nc": "1"
},
"transaction": {
"test_mode": "###TEST_MODE###",
"payment_type": "GOOGLEPAY",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"hook_url": "###YOUR_HOOK_URL###",
"create_token": "1",
"return_url": "###YOUR_RETURN_URL###",
"error_return_url": "###YOUR_ERROR_RETURN_URL###",
/*
"invoice_ref": "###INVOICE_REF###",
"invoice_no": "###INVOICE_NO###",
"dynamic_descriptor": "www.yourshop.com"
*/
},
"hosted_page": {
//"css_url": "https://www.demoshop.de/custom.css",
"logo": "###YOUR_SHOP_LOGO###",
/*"hide_payments": [
"CREDITCARD",
"DIRECT_DEBIT_SEPA",
"PREPAYMENT",
"IDEAL"
],*/
"display_payments": {'GOOGLEPAY'},
"hide_blocks": {'ADDRESS_FORM', 'SHOP_INFO', 'LANGUAGE_MENU', 'HEADER', 'TARIFF'},
"skip_pages": {'CONFIRMATION_PAGE', 'SUCCESS_PAGE', 'PAYMENT_PAGE'},
"url_shortener":"1",
"link_expiry":"YYYY-MM-DD HH:MM:SS",
//"link_notify":"['EMAIL']",
//"return_target":"top",
//"display_payments_mode":"['DIRECT', 'REDIRECT', 'INSTALMENT', 'SUBSCRIPTION']"
},
/*
"affiliate": {
"subvendors": {
"2261": "100",
"2271": "120"
},
//"commission_type": "amount"
},
"invoicing": {
"net_amount": 5000,
"gross_amount": 5000,
"tax_percent": 2,
"tax_amount": 2,
//"coupon_percent": 1,
//"coupon_amount": 10,
"product_details": [
{
//"code": "P001",
"name": "Product name",
//"group": "Product group",
//"description": "Product description",
"quantity": 2,
"unit": 2,
"unit_price": 100,
"total_price": 200,
"tax_amount": 1,
"tax_percent": 1,
//"discount": 0,
//"note": "Note about the product"
}
],
"notice": {
"1": "Notice 1",
"2": "Notice 2",
"3": "Notice 3"
},
//"customer_support": "Max Mustermann | Email: support@yourshop.de",
//"custom_invoice_no": "INV-32",
"send_invoice_pdf": "1"
},
*/
"custom": {
"lang": "EN"
}
}", null, "application/json");
request.Content = content;
var response = client.SendAsync(request).Result;
response.EnsureSuccessstatuscode();
var responseText = response.Content.ReadAsStringAsync().Result;
Console.WriteLine(responseText);
return responseText;
}
public static void Main() {
var testRequest = new HostedApi();
testRequest.check_hosted_api_request();
}
}
}
Affiliate 1 Configuration
Affiliate 2 Configuration
Try running the API in supported devices and browsers
Response For the Hosted
The redirection response will give you only the minimum details about the transaction, to retrieve entire transaction details, make the /transaction/details API by using the tid returned in the redirection response. You can get the token(transaction.payment_data.token) to store only after the transaction details API call.
Executing follow up payments using tokenization (without customer interaction)
To use the token based on your business model, the token has to be created (as detailed in the step Creating Token). With the secure token already created, it is not necessary to transmit the payment details instead the token has to be passed in transaction.payment_data.token to complete the payment.
<?php
// Need to enter your payment access key value here
$payment_access_key = '###YOUR_PAYMENT_ACCESS_KEY###';
// Now, have to encode the $payment_access_key value with the base64 encode
$encoded_data = base64_encode($payment_access_key);
// Action Endpoint
$endpoint = 'https://payport.novalnet.de/v2/payment';
// Build the Headers array
$headers = [
// The Content-Type should be "application/json"
'Content-Type:application/json',
// The charset should be "utf-8"
'Charset:utf-8',
// Optional
'Accept:application/json',
// The formed authenticate value (case-sensitive)
'X-NN-Access-Key:' . $encoded_data
];
$data = [];
// Build Merchant Data
$data['merchant'] = [
// Your API signature value
'signature' => '###YOUR_API_SIGNATURE###',
// Your corresponding tariff ID
'tariff' => '###YOUR_TARIFF_ID###'
];
// Build Customer Data
$data['customer'] = [
// Shopper's first name
'first_name' => 'Norbert',
// Shopper's last name
'last_name' => 'Maier',
// Shopper's email
'email' => '###YOUR_MAIL###',
// Shopper's Ip address
'customer_ip' => '###CUSTOMER_IP###',
// Shopper's customer number from the shop
'customer_no' => '###CUSTOMER_NUMBER###',
// Shopper's Telephone number
'tel' => '+49 089 123456',
// Shopper's Mobile number
'mobile' => '+49 174 7781423',
// Shopper's birthdate value YYYY-MM-DD - Decomment it based on your usage
// 'birth_date' => '1992-06-10',
// Shopper's gender - Decomment it based on your usage
// 'gender' => 'u',
// Shopper's company vat ID value - Decomment it based on your usage
// 'vat_id' => 'DE123456',
// Shopper's company regestration number - Decomment it based on your usage
// 'reg_no' => 'HRB1234',
// Shopper's company tax ID value - Decomment it based on your usage
// 'tax_id' => '123/123/123',
// Shopper's session value - Decomment it based on your usage
// 'session' => 'fedgrgst5653653hdgfsvgdsf622627e',
// Shopper's fax number - Decomment it based on your usage
// 'fax' => '+49 89 654321',
// Shopper's billing address
'billing' => [
// House number
'house_no' => '9',
// Street
'street' => 'Hauptstr',
// City
'city' => 'Kaiserslautern',
// zip
'zip' => '66862',
// Country's ISO code
'country_code' => 'DE',
// Name of the company - Decomment it based on your usage
'company' => 'ABC GmbH'
],
/*
// Optional child object - Decomment it based on your usage
'shipping' => [
// First name
'first_name' => 'Norbert',
// Last name
'last_name' => 'Maier',
// Email
'email' => 'test@novalnet.de',
// Street
'street' => 'Hauptstr',
// House number
'house_no' => '9',
// City
'city' => 'Kaiserslautern',
// zip
'zip' => '66862',
// Country's ISO code
'country_code' => 'DE',
// Name of the company
'company' => 'A.B.C. Gerüstbau GmbH',
// Telephone number
'tel' => '+49 089 123456',
// Mobile number
'mobile' => '+49 174 7781423'
]
*/
];
// Build Transaction Data
$data['transaction'] = [
// The Payment type of the transaction
'payment_type' => '###PAYMENT_TYPE###',
// The transaction Amount in smaller currency unit
'amount' => '###TRANSACTION_AMOUNT###',
// The transaction currency's ISO code
'currency' => '###TRANSACTION_CURRENCY###',
// The mode of the transaction
'test_mode' => '###TEST_MODE###',
// The mode of the transaction
'order_no' => '###TRANSACTION_ORDER_NUMBER###',
// The Hook URL value for this particular transaction
'hook_url' => '###YOUR_HOOK_URL###',
// Build Payment Data
'payment_data' => [
// The created payment token
'token' => '###PAYMENT_TOKEN###'
]
];
// Instalment data
//$data['instalment'] = [
// The interval between each cycle
//'interval' => '1m',
// Total number of cycles
//'cycles' => '3'
//];
/*
// Subscription Data, used for processing Novalnet`s subscription - Optional object - Decomment it based on your usage
$data['subscription'] = [
// The interval between each cycle
'interval' => '1m',
// Subscription trial interval if applicable
'trial_interval' => '3m',
// Subscription trial interval amount if applicable
'trial_amount' => '150'
];
*/
/*
// Marketplace data, used for the affiliate`s marketplace model - Optional object - Decomment it based on your usage
$data['marketplace'] = [
// To submit amount for several affiliates to be booked
'tx_split' => [
'2261' => '20',
'2271' => '30'
],
];
*/
/*
// Affiliate Data, used for the affiliate`s revenue split model - Optional object - Decomment it based on your usage
$data['affiliate'] = [
// To submit shares for several affiliates for the same transaction
'subvendors'=> [
'2261' => '20',
'2271' => '30'
]
];
*/
// Custom Data - Optional object
$data['custom'] = [
// Shopper's selected language in shop
"lang" => "EN",
// Custom parameter's key - Optional object - Decomment it based on your usage
// 'input1' => 'your internal reference parameter name',
// Custom parameter's value - Optional object - Decomment it based on your usage
// 'inputval1' => 'your internal reference parameter value'
];
// Convert the array to JSON string
$json_data = json_encode($data);
// Handle Response
$response = send_request($json_data, $endpoint, $headers);
function send_request($data, $url, $headers) {
// Initiate cURL
$curl = curl_init();
// Set the url
curl_setopt($curl, CURLOPT_URL, $url);
// Set the result output to be a string
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
// Set the POST value to true (mandatory)
curl_setopt($curl, CURLOPT_POST, true);
// Set the post fields
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
// Set the headers
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
// Execute cURL
$result = curl_exec($curl);
// Handle cURL error
if (curl_errno($curl)) {
echo 'Request Error:' . curl_error($curl);
return $result;
}
// Close cURL
curl_close($curl);
// Decode the JSON string
$result = json_decode($result);
return $result;
}
?>curl --location --request POST 'https://payport.novalnet.de/v2/payment' -H 'Content-Type: application/json' -H 'Charset:utf-8' -H 'Accept: application/json' -H 'X-NN-Access-Key: ###YOUR_ENCODED_PAYMENT_ACCESS_KEY###' -d '{"merchant":{"signature":"###YOUR_API_SIGNATURE###","tariff":"###YOUR_TARIFF_ID###"},"customer":{"first_name":"Norbert","last_name":"Maier","email":"###YOUR_MAIL###","customer_ip":"###CUSTOMER_IP###","customer_no":"###CUSTOMER_NUMBER###","tel":"+49 089 123456","mobile":"+49 174 7781423","billing":{"house_no":"9","street":"Hauptstr","city":"Kaiserslautern","zip":"66862","country_code":"DE", "company": "ABC GmbH"}},"transaction":{"payment_type":"###PAYMENT_TYPE###","amount":"###TRANSACTION_AMOUNT###","currency":"###TRANSACTION_CURRENCY###","test_mode":"###TEST_MODE###","order_no":"###TRANSACTION_ORDER_NUMBER###","hook_url":"###YOUR_HOOK_URL###","payment_data":{"token":"###PAYMENT_TOKEN###"}},"custom":{"lang":"EN"}}';#!/usr/bin/node
const https = require('https');
// data sent in the body of the request
const postData = JSON.stringify({
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"customer_ip": "###CUSTOMER_IP###",
"customer_no": "###CUSTOMER_NUMBER###",
"birth_date": "1992-06-10",
"billing": {
"street": "Musterstr",
"house_no": "2",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"company": "ABC GmbH"
}
},
"transaction": {
"payment_type": "###PAYMENT_TYPE###",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"test_mode": "###TEST_MODE###",
"hook_url":"###YOUR_HOOK_URL###",
"payment_data": {
"token": "###PAYMENT_TOKEN###"
}
},
"custom": {
"lang": "EN"
}
});
const options = {
hostname: 'payport.novalnet.de',
port: 443,
path: '/v2/payment',
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(postData),
'Charset': 'utf-8',
'Accept': 'application/json',
'X-NN-Access-Key': '###YOUR_ENCODED_PAYMENT_ACCESS_KEY###'
},
};
const req = https.request(options, (res) => {
console.log('statusCode:', res.statusCode);
// console.log('headers:', res.headers);
res.on('data', (d) => {
process.stdout.write(d);
});
});
req.on('error', (e) => {
console.error('ERROR: ',e);
});
// Write data to request body
req.write(postData);
req.end();#!/usr/bin/python3
import http.client
import json
CONN = http.client.HTTPSConnection("payport.novalnet.de")
PAYLOAD = json.dumps({
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"customer_ip": "###CUSTOMER_IP###",
"customer_no": "###CUSTOMER_NUMBER###",
"birth_date": "1992-06-10",
"billing": {
"street": "Musterstr",
"house_no": "2",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"company": "ABC GmbH"
}
},
"transaction": {
"payment_type": "###PAYMENT_TYPE###",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"test_mode": "###TEST_MODE###",
"hook_url":"###YOUR_HOOK_URL###",
"payment_data": {
"token": "###PAYMENT_TOKEN###"
}
},
"custom": {
"lang": "EN"
}
})
HEADERS = {
'Content-Type': 'application/json',
'Charset': 'utf-8',
'Accept': 'application/json',
'X-NN-Access-Key': '###YOUR_ENCODED_PAYMENT_ACCESS_KEY###'
}
CONN.request("POST", "/v2/payment", PAYLOAD, HEADERS)
RES = CONN.getresponse()
DATA = RES.read()
print(DATA.decode("utf-8"))#!/usr/lib/ruby
require "uri"
require "json"
require "net/http"
url = URI("https://payport.novalnet.de/v2/payment")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Accept"] = "application/json"
request["Charset"] = "utf-8"
request["X-NN-Access-Key"] = "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###"
request.body = JSON.dump({
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"customer_ip": "###CUSTOMER_IP###",
"customer_no": "###CUSTOMER_NUMBER###",
"birth_date": "1992-06-10",
"billing": {
"street": "Musterstr",
"house_no": "2",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"company": "ABC GmbH"
}
},
"transaction": {
"payment_type": "###PAYMENT_TYPE###",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"test_mode": "###TEST_MODE###",
"hook_url":"###YOUR_HOOK_URL###",
"payment_data": {
"token": "###PAYMENT_TOKEN###"
}
},
"custom": {
"lang": "EN"
}
})
response = https.request(request)
puts response.read_bodypackage main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://payport.novalnet.de/v2/payment"
method := "POST"
payload := strings.NewReader(`{"merchant":{"signature":"###YOUR_API_SIGNATURE###", "tariff" : "###YOUR_TARIFF_ID###"},"customer": {
"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"customer_ip": "###CUSTOMER_IP###",
"customer_no": "###CUSTOMER_NUMBER###",
"birth_date": "1992-06-10",
"billing": {
"street": "Musterstr",
"house_no": "2",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"company": "ABC GmbH"
}
},
"transaction": {
"payment_type": "###PAYMENT_TYPE###",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"test_mode": "###TEST_MODE###",
"hook_url":"###YOUR_HOOK_URL###",
"payment_data": {
"token": "###PAYMENT_TOKEN###"
}
},"custom":{"lang":"EN"}}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
req.Header.Add("Charset", "utf-8")
req.Header.Add("X-NN-Access-Key", "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}/* List of required libraries (see also the import statements below):
- commons-logging-1.2.jar
- httpasyncclient-4.1.5.jar
- httpclient-4.3.3.jar
- httpcore-4.4.16.jar
- httpcore-nio-4.4.16.jar
- httpmime-4.5.14.jar
- json-20230227.jar
- unirest-java-3.9.00.jar
*/
import java.io.*;
import org.json.JSONArray;
import org.apache.http.auth.*;
import org.apache.http.nio.conn.*;
import org.apache.http.concurrent.*;
import org.apache.http.nio.reactor.*;
import org.apache.commons.logging.*;
import org.apache.http.entity.mime.content.*;
import kong.unirest.*;
public class TokenizationRequest {
public static void main(String []args) throws Exception{
Unirest.config().connectTimeout(1000).socketTimeout(2000);
HttpResponse<String> response = Unirest.post("https://payport.novalnet.de/v2/payment")
.header("Content-Type", "application/json")
.header("Charset", "utf-8")
.header("Accept", "application/json")
.header("X-NN-Access-Key", "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###")
.body("{\"merchant\":{\"signature\":\"###YOUR_API_SIGNATURE###\", \"tariff\" : \"###YOUR_TARIFF_ID###\"},\"customer\":{\"customer_ip\":\"###CUSTOMER_IP###\",\"gender\":\"u\", \"first_name\": \"Max\", \"last_name\": \"Mustermann\", \"email\": \"###YOUR_MAIL###\", \"birth_date\":\"1983-07-02\",\"billing\":{\"street\":\"Musterstr\",\"house_no\":\"2\",\"city\":\"Musterhausen\",\"zip\":\"12345\",\"country_code\":\"DE\",\"company\":\"ABC GmbH\"}},\"transaction\":{\"payment_type\": \"###PAYMENT_TYPE###\",\"amount\":\"###TRANSACTION_AMOUNT###\",\"currency\":\"EUR\",\"order_no\":\"###TRANSACTION_ORDER_NUMBER###\",\"test_mode\":\"###TEST_MODE###\",\"hook_url\":\"###YOUR_HOOK_URL###\",\"payment_data\":{\"token\":\"###PAYMENT_TOKEN###\"}},\"custom\":{\"lang\":\"EN\"}}")
.asString();
System.out.println(response.getBody());
}
}using System;
using System.Net.Http;
namespace TokenizationRequest
{
public class TokenizationRequest {
public string check_Tokenization_request() {
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://payport.novalnet.de/v2/payment");
request.Headers.Add("Charset", "utf-8");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("X-NN-Access-Key", "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###");
var content = new StringContent("{\"merchant\":{\"signature\":\"###YOUR_API_SIGNATURE###\", \"tariff\" : \"###YOUR_TARIFF_ID###\"},\"customer\":{\"customer_ip\":\"###CUSTOMER_IP###\",\"gender\":\"u\", \"first_name\": \"Max\", \"last_name\": \"Mustermann\", \"email\": \"###YOUR_MAIL###\", \"birth_date\":\"1983-07-02\",\"billing\":{\"street\":\"Musterstr\",\"house_no\":\"2\",\"city\":\"Musterhausen\",\"zip\":\"12345\",\"country_code\":\"DE\",\"company\":\"ABC GmbH\"}},\"transaction\":{\"payment_type\": \"###PAYMENT_TYPE###\",\"amount\":\"###TRANSACTION_AMOUNT###\",\"currency\":\"EUR\",\"order_no\":\"###TRANSACTION_ORDER_NUMBER###\",\"test_mode\":\"###TEST_MODE###\",\"hook_url\":\"###YOUR_HOOK_URL###\",\"payment_data\":{\"token\":\"###PAYMENT_TOKEN###\"}},\"custom\":{\"lang\":\"EN\"}}", null, "application/json");
request.Content = content;
var response = client.SendAsync(request).Result;
response.EnsureSuccessStatusCode();
var responseText = response.Content.ReadAsStringAsync().Result;
Console.WriteLine(responseText);
return responseText;
}
public static void Main() {
var testRequest = new TokenizationRequest();
testRequest.check_Tokenization_request();
}
}
}<?php
// Need to enter your payment access key value here
$payment_access_key = '###YOUR_PAYMENT_ACCESS_KEY###';
// Now, have to encode the $payment_access_key value with the base64 encode
$encoded_data = base64_encode($payment_access_key);
// Action Endpoint
$endpoint = 'https://payport.novalnet.de/v2/payment';
// Build the Headers array
$headers = [
// The Content-Type should be "application/json"
'Content-Type:application/json',
// The charset should be "utf-8"
'Charset:utf-8',
// Optional
'Accept:application/json',
// The formed authenticate value (case-sensitive)
'X-NN-Access-Key:' . $encoded_data
];
$data = [];
// Build Merchant Data
$data['merchant'] = [
// Your API signature value
'signature' => '###YOUR_API_SIGNATURE###',
// Your corresponding tariff ID
'tariff' => '###YOUR_TARIFF_ID###'
];
// Build Customer Data
$data['customer'] = [
// Shopper's first name
'first_name' => 'Norbert',
// Shopper's last name
'last_name' => 'Maier',
// Shopper's email
'email' => '###YOUR_MAIL###',
// Shopper's Ip address
'customer_ip' => '###CUSTOMER_IP###',
// Shopper's customer number from the shop
'customer_no' => '###CUSTOMER_NUMBER###',
// Shopper's Telephone number
'tel' => '+49 089 123456',
// Shopper's Mobile number
'mobile' => '+49 174 7781423',
// Shopper's birthdate value YYYY-MM-DD - Decomment it based on your usage
// 'birth_date' => '1992-06-10',
// Shopper's gender - Decomment it based on your usage
// 'gender' => 'u',
// Shopper's company vat ID value - Decomment it based on your usage
// 'vat_id' => 'DE123456',
// Shopper's company regestration number - Decomment it based on your usage
// 'reg_no' => 'HRB1234',
// Shopper's company tax ID value - Decomment it based on your usage
// 'tax_id' => '123/123/123',
// Shopper's session value - Decomment it based on your usage
// 'session' => 'fedgrgst5653653hdgfsvgdsf622627e',
// Shopper's fax number - Decomment it based on your usage
// 'fax' => '+49 89 654321',
// Shopper's billing address
'billing' => [
// House number
'house_no' => '9',
// Street
'street' => 'Hauptstr',
// City
'city' => 'Kaiserslautern',
// zip
'zip' => '66862',
// Country's ISO code
'country_code' => 'DE',
// Name of the company - Decomment it based on your usage
'company' => 'ABC GmbH'
],
/*
// Optional child object - Decomment it based on your usage
'shipping' => [
// First name
'first_name' => 'Norbert',
// Last name
'last_name' => 'Maier',
// Email
'email' => 'test@novalnet.de',
// Street
'street' => 'Hauptstr',
// House number
'house_no' => '9',
// City
'city' => 'Kaiserslautern',
// zip
'zip' => '66862',
// Country's ISO code
'country_code' => 'DE',
// Name of the company
'company' => 'A.B.C. Gerüstbau GmbH',
// Telephone number
'tel' => '+49 089 123456',
// Mobile number
'mobile' => '+49 174 7781423'
]
*/
];
// Build Transaction Data
$data['transaction'] = [
// The Payment type of the transaction
'payment_type' => '###PAYMENT_TYPE###',
// The transaction Amount in smaller currency unit
'amount' => '###TRANSACTION_AMOUNT###',
// The transaction currency's ISO code
'currency' => '###TRANSACTION_CURRENCY###',
// The mode of the transaction
'test_mode' => '###TEST_MODE###',
// The mode of the transaction
'order_no' => '###TRANSACTION_ORDER_NUMBER###',
// The date on which the purchase is initiated
'order_date' => '###TRANSACTION_ORDER_DATE###',
// The amount in which the purchase is initiated
'order_amount' => '###TRANSACTION_ORDER_AMOUNT###',
// The order reference of the initial purchase
'order_reference' => '###TRANSACTION_ORDER_REFERENCE###',
// The Hook URL value for this particular transaction
'hook_url' => '###YOUR_HOOK_URL###',
// Build Payment Data
'payment_data' => [
// The created payment token
'token' => '###PAYMENT_TOKEN###'
]
];
// Instalment data
//$data['instalment'] = [
// The interval between each cycle
//'interval' => '1m',
// Total number of cycles
//'cycles' => '3'
//];
/*
// Subscription Data, used for processing Novalnet`s subscription - Optional object - Decomment it based on your usage
$data['subscription'] = [
// The interval between each cycle
'interval' => '1m',
// Subscription trial interval if applicable
'trial_interval' => '3m',
// Subscription trial interval amount if applicable
'trial_amount' => '150'
];
*/
/*
// Marketplace data, used for the affiliate`s marketplace model - Optional object - Decomment it based on your usage
$data['marketplace'] = [
// To submit amount for several affiliates to be booked
'tx_split' => [
'2261' => '20',
'2271' => '30'
],
];
*/
/*
// Affiliate Data, used for the affiliate`s revenue split model - Optional object - Decomment it based on your usage
$data['affiliate'] = [
// To submit shares for several affiliates for the same transaction
'subvendors'=> [
'2261' => '20',
'2271' => '30'
]
];
*/
// Custom Data - Optional object
$data['custom'] = [
// Shopper's selected language in shop
"lang" => "EN",
// Custom parameter's key - Optional object - Decomment it based on your usage
// 'input1' => 'your internal reference parameter name',
// Custom parameter's value - Optional object - Decomment it based on your usage
// 'inputval1' => 'your internal reference parameter value'
];
// Convert the array to JSON string
$json_data = json_encode($data);
// Handle Response
$response = send_request($json_data, $endpoint, $headers);
function send_request($data, $url, $headers) {
// Initiate cURL
$curl = curl_init();
// Set the url
curl_setopt($curl, CURLOPT_URL, $url);
// Set the result output to be a string
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
// Set the POST value to true (mandatory)
curl_setopt($curl, CURLOPT_POST, true);
// Set the post fields
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
// Set the headers
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
// Execute cURL
$result = curl_exec($curl);
// Handle cURL error
if (curl_errno($curl)) {
echo 'Request Error:' . curl_error($curl);
return $result;
}
// Close cURL
curl_close($curl);
// Decode the JSON string
$result = json_decode($result);
return $result;
}
?>curl --location --request POST 'https://payport.novalnet.de/v2/payment' -H 'Content-Type: application/json' -H 'Charset:utf-8' -H 'Accept: application/json' -H 'X-NN-Access-Key: ###YOUR_ENCODED_PAYMENT_ACCESS_KEY###' -d '{"merchant":{"signature":"###YOUR_API_SIGNATURE###","tariff":"###YOUR_TARIFF_ID###"},"customer":{"first_name":"Norbert","last_name":"Maier","email":"###YOUR_MAIL###","customer_ip":"###CUSTOMER_IP###","customer_no":"###CUSTOMER_NUMBER###","tel":"+49 089 123456","mobile":"+49 174 7781423","billing":{"house_no":"9","street":"Hauptstr","city":"Kaiserslautern","zip":"66862","country_code":"DE", "company": "ABC GmbH"}},"transaction":{"payment_type":"###PAYMENT_TYPE###","amount":"###TRANSACTION_AMOUNT###","currency":"###TRANSACTION_CURRENCY###","test_mode":"###TEST_MODE###","order_no":"###TRANSACTION_ORDER_NUMBER###","order_date":"###TRANSACTION_ORDER_DATE###","order_amount":"###TRANSACTION_ORDER_AMOUNT###","order_reference":"###TRANSACTION_ORDER_REFERENCE###","hook_url":"###YOUR_HOOK_URL###","payment_data":{"token":"###PAYMENT_TOKEN###"}},"custom":{"lang":"EN"}}';#!/usr/bin/node
// refund request script using the standard https library
const https = require('https');
// data sent in the body of the request
const postData = JSON.stringify({
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"customer_ip": "###CUSTOMER_IP###",
"customer_no": "###CUSTOMER_NUMBER###",
"birth_date": "1992-06-10",
"billing": {
"street": "Musterstr",
"house_no": "2",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"company": "ABC GmbH"
}
},
"transaction": {
"payment_type": "###PAYMENT_TYPE###",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"order_date":"###TRANSACTION_ORDER_DATE###",
"order_amount":"###TRANSACTION_ORDER_AMOUNT###",
"order_reference":"###TRANSACTION_ORDER_REFERENCE###",
"test_mode": "###TEST_MODE###",
"hook_url":"###YOUR_HOOK_URL###",
"payment_data": {
"token": "###PAYMENT_TOKEN###"
}
},
"custom": {
"lang": "EN"
}
});
const options = {
hostname: 'payport.novalnet.de',
port: 443,
path: '/v2/payment',
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(postData),
'Charset': 'utf-8',
'Accept': 'application/json',
'X-NN-Access-Key': '###YOUR_ENCODED_PAYMENT_ACCESS_KEY###'
},
};
const req = https.request(options, (res) => {
console.log('statusCode:', res.statusCode);
// console.log('headers:', res.headers);
res.on('data', (d) => {
process.stdout.write(d);
});
});
req.on('error', (e) => {
console.error('ERROR: ',e);
});
// Write data to request body
req.write(postData);
req.end();#!/usr/bin/python3
import http.client
import json
CONN = http.client.HTTPSConnection("payport.novalnet.de")
PAYLOAD = json.dumps({
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"customer_ip": "###CUSTOMER_IP###",
"customer_no": "###CUSTOMER_NUMBER###",
"birth_date": "1992-06-10",
"billing": {
"street": "Musterstr",
"house_no": "2",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"company": "ABC GmbH"
}
},
"transaction": {
"payment_type": "###PAYMENT_TYPE###",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"order_date":"###TRANSACTION_ORDER_DATE###",
"order_amount":"###TRANSACTION_ORDER_AMOUNT###",
"order_reference":"###TRANSACTION_ORDER_REFERENCE###",
"test_mode": "###TEST_MODE###",
"hook_url":"###YOUR_HOOK_URL###",
"payment_data": {
"token": "###PAYMENT_TOKEN###"
}
},
"custom": {
"lang": "EN"
}
})
HEADERS = {
'Content-Type': 'application/json',
'Charset': 'utf-8',
'Accept': 'application/json',
'X-NN-Access-Key': '###YOUR_ENCODED_PAYMENT_ACCESS_KEY###'
}
CONN.request("POST", "/v2/payment", PAYLOAD, HEADERS)
RES = CONN.getresponse()
DATA = RES.read()
print(DATA.decode("utf-8"))#!/usr/lib/ruby
require "uri"
require "json"
require "net/http"
url = URI("https://payport.novalnet.de/v2/payment")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Accept"] = "application/json"
request["Charset"] = "utf-8"
request["X-NN-Access-Key"] = "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###"
request.body = JSON.dump({
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"customer_ip": "###CUSTOMER_IP###",
"customer_no": "###CUSTOMER_NUMBER###",
"birth_date": "1992-06-10",
"billing": {
"street": "Musterstr",
"house_no": "2",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"company": "ABC GmbH"
}
},
"transaction": {
"payment_type": "###PAYMENT_TYPE###",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"order_date":"###TRANSACTION_ORDER_DATE###",
"order_amount":"###TRANSACTION_ORDER_AMOUNT###",
"order_reference":"###TRANSACTION_ORDER_REFERENCE###",
"test_mode": "###TEST_MODE###",
"hook_url":"###YOUR_HOOK_URL###",
"payment_data": {
"token": "###PAYMENT_TOKEN###"
}
},
"custom": {
"lang": "EN"
}
})
response = https.request(request)
puts response.read_bodypackage main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://payport.novalnet.de/v2/payment"
method := "POST"
payload := strings.NewReader(`{"merchant":{"signature":"###YOUR_API_SIGNATURE###", "tariff" : "###YOUR_TARIFF_ID###"},"customer": {
"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"customer_ip": "###CUSTOMER_IP###",
"customer_no": "###CUSTOMER_NUMBER###",
"birth_date": "1992-06-10",
"billing": {
"street": "Musterstr",
"house_no": "2",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"company": "ABC GmbH"
}
},
"transaction": {
"payment_type": "###PAYMENT_TYPE###",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"order_date":"###TRANSACTION_ORDER_DATE###",
"order_amount":"###TRANSACTION_ORDER_AMOUNT###",
"order_reference":"###TRANSACTION_ORDER_REFERENCE###",
"test_mode": "###TEST_MODE###",
"hook_url":"###YOUR_HOOK_URL###",
"payment_data": {
"token": "###PAYMENT_TOKEN###"
}
},"custom":{"lang":"EN"}}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
req.Header.Add("Charset", "utf-8")
req.Header.Add("X-NN-Access-Key", "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}/* List of required libraries (see also the import statements below):
- commons-logging-1.2.jar
- httpasyncclient-4.1.5.jar
- httpclient-4.3.3.jar
- httpcore-4.4.16.jar
- httpcore-nio-4.4.16.jar
- httpmime-4.5.14.jar
- json-20230227.jar
- unirest-java-3.9.00.jar
*/
import java.io.*;
import org.json.JSONArray;
import org.apache.http.auth.*;
import org.apache.http.nio.conn.*;
import org.apache.http.concurrent.*;
import org.apache.http.nio.reactor.*;
import org.apache.commons.logging.*;
import org.apache.http.entity.mime.content.*;
import kong.unirest.*;
public class TokenizationCreate {
public static void main(String []args) throws Exception{
Unirest.config().connectTimeout(1000).socketTimeout(2000);
HttpResponse<String> response = Unirest.post("https://payport.novalnet.de/v2/payment")
.header("Content-Type", "application/json")
.header("Charset", "utf-8")
.header("Accept", "application/json")
.header("X-NN-Access-Key", "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###")
.body("{\"merchant\":{\"signature\":\"###YOUR_API_SIGNATURE###\", \"tariff\" : \"###YOUR_TARIFF_ID###\"},\"customer\":{\"customer_ip\":\"###CUSTOMER_IP###\",\"gender\":\"u\", \"first_name\": \"Max\", \"last_name\": \"Mustermann\", \"email\": \"###YOUR_MAIL###\", \"birth_date\":\"1983-07-02\",\"billing\":{\"street\":\"Musterstr\",\"house_no\":\"2\",\"city\":\"Musterhausen\",\"zip\":\"12345\",\"country_code\":\"DE\",\"company\":\"ABC GmbH\"}},\"transaction\":{\"payment_type\": \"###PAYMENT_TYPE###\",\"amount\":\"###TRANSACTION_AMOUNT###\",\"currency\":\"EUR\",\"order_no\":\"###TRANSACTION_ORDER_NUMBER###\","order_date":"###TRANSACTION_ORDER_DATE###","order_amount":"###TRANSACTION_ORDER_AMOUNT###","order_reference":"###TRANSACTION_ORDER_REFERENCE###",\"test_mode\":\"###TEST_MODE###\",\"hook_url\":\"###YOUR_HOOK_URL###\",\"payment_data\":{\"token\":\"###PAYMENT_TOKEN###\"}},\"custom\":{\"lang\":\"EN\"}}")
.asString();
System.out.println(response.getBody());
}
}using System;
using System.Net.Http;
namespace TokenizationCreateRequest
{
public class TokenizationCreate {
public string check_Tokenization_create_request() {
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://payport.novalnet.de/v2/payment");
request.Headers.Add("Charset", "utf-8");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("X-NN-Access-Key", "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###");
var content = new StringContent("{\"merchant\":{\"signature\":\"###YOUR_API_SIGNATURE###\", \"tariff\" : \"###YOUR_TARIFF_ID###\"},\"customer\":{\"customer_ip\":\"###CUSTOMER_IP###\",\"gender\":\"u\", \"first_name\": \"Max\", \"last_name\": \"Mustermann\", \"email\": \"###YOUR_MAIL###\", \"birth_date\":\"1983-07-02\",\"billing\":{\"street\":\"Musterstr\",\"house_no\":\"2\",\"city\":\"Musterhausen\",\"zip\":\"12345\",\"country_code\":\"DE\",\"company\":\"ABC GmbH\"}},\"transaction\":{\"payment_type\": \"###PAYMENT_TYPE###\",\"amount\":\"###TRANSACTION_AMOUNT###\",\"currency\":\"EUR\",\"order_no\":\"###TRANSACTION_ORDER_NUMBER###\","order_date":"###TRANSACTION_ORDER_DATE###","order_amount":"###TRANSACTION_ORDER_AMOUNT###","order_reference":"###TRANSACTION_ORDER_REFERENCE###",\"test_mode\":\"###TEST_MODE###\",\"hook_url\":\"###YOUR_HOOK_URL###\",\"payment_data\":{\"token\":\"###PAYMENT_TOKEN###\"}},\"custom\":{\"lang\":\"EN\"}}", null, "application/json");
request.Content = content;
var response = client.SendAsync(request).Result;
response.EnsureSuccessStatusCode();
var responseText = response.Content.ReadAsStringAsync().Result;
Console.WriteLine(responseText);
return responseText;
}
public static void Main() {
var testRequest = new TokenizationCreate();
testRequest.check_Tokenization_create_request();
}
}
}<?php
// Need to enter your payment access key value here
$payment_access_key = '###YOUR_PAYMENT_ACCESS_KEY###';
// Now, have to encode the $payment_access_key value with the base64 encode
$encoded_data = base64_encode($payment_access_key);
// Action Endpoint
$endpoint = 'https://payport.novalnet.de/v2/payment';
// Build the Headers array
$headers = [
// The Content-Type should be "application/json"
'Content-Type:application/json',
// The charset should be "utf-8"
'Charset:utf-8',
// Optional
'Accept:application/json',
// The formed authenticate value (case-sensitive)
'X-NN-Access-Key:' . $encoded_data
];
$data = [];
// Build Merchant Data
$data['merchant'] = [
// Your API signature value
'signature' => '###YOUR_API_SIGNATURE###',
// Your corresponding tariff ID
'tariff' => '###YOUR_TARIFF_ID###'
];
// Build Customer Data
$data['customer'] = [
// Shopper's first name
'first_name' => 'Norbert',
// Shopper's last name
'last_name' => 'Maier',
// Shopper's email
'email' => '###YOUR_MAIL###',
// Shopper's Ip address
'customer_ip' => '###CUSTOMER_IP###',
// Shopper's customer number from the shop
'customer_no' => '###CUSTOMER_NUMBER###',
// Shopper's Telephone number
'tel' => '+49 089 123456',
// Shopper's Mobile number
'mobile' => '+49 174 7781423',
// Shopper's birthdate value YYYY-MM-DD - Decomment it based on your usage
// 'birth_date' => '1992-06-10',
// Shopper's gender - Decomment it based on your usage
// 'gender' => 'u',
// Shopper's company vat ID value - Decomment it based on your usage
// 'vat_id' => 'DE123456',
// Shopper's company regestration number - Decomment it based on your usage
// 'reg_no' => 'HRB1234',
// Shopper's company tax ID value - Decomment it based on your usage
// 'tax_id' => '123/123/123',
// Shopper's session value - Decomment it based on your usage
// 'session' => 'fedgrgst5653653hdgfsvgdsf622627e',
// Shopper's fax number - Decomment it based on your usage
// 'fax' => '+49 89 654321',
// Shopper's billing address
'billing' => [
// House number
'house_no' => '9',
// Street
'street' => 'Hauptstr',
// City
'city' => 'Kaiserslautern',
// zip
'zip' => '66862',
// Country's ISO code
'country_code' => 'DE',
// Name of the company - Decomment it based on your usage
'company' => 'ABC GmbH'
],
/*
// Optional child object - Decomment it based on your usage
'shipping' => [
// First name
'first_name' => 'Norbert',
// Last name
'last_name' => 'Maier',
// Email
'email' => 'test@novalnet.de',
// Street
'street' => 'Hauptstr',
// House number
'house_no' => '9',
// City
'city' => 'Kaiserslautern',
// zip
'zip' => '66862',
// Country's ISO code
'country_code' => 'DE',
// Name of the company
'company' => 'A.B.C. Gerüstbau GmbH',
// Telephone number
'tel' => '+49 089 123456',
// Mobile number
'mobile' => '+49 174 7781423'
]
*/
];
// Build Transaction Data
$data['transaction'] = [
// The Payment type of the transaction
'payment_type' => '###PAYMENT_TYPE###',
// The transaction Amount in smaller currency unit
'amount' => '30000',
// The transaction currency's ISO code
'currency' => '###TRANSACTION_CURRENCY###',
// The mode of the transaction
'test_mode' => '###TEST_MODE###',
// The mode of the transaction
'order_no' => '###TRANSACTION_ORDER_NUMBER###',
// The Hook URL value for this particular transaction
'hook_url' => '###YOUR_HOOK_URL###',
// Build Payment Data
'payment_data' => [
// The created payment token
'token' => '###PAYMENT_TOKEN###'
]
];
// Instalment data
$data['instalment'] = [
// The interval between each cycle
'interval' => '1m',
// Total number of cycles
'cycles' => '3'
];
/*
// Subscription Data, used for processing Novalnet`s subscription - Optional object - Decomment it based on your usage
$data['subscription'] = [
// The interval between each cycle
'interval' => '1m',
// Subscription trial interval if applicable
'trial_interval' => '3m',
// Subscription trial interval amount if applicable
'trial_amount' => '150'
];
*/
/*
// Marketplace data, used for the affiliate`s marketplace model - Optional object - Decomment it based on your usage
$data['marketplace'] = [
// To submit amount for several affiliates to be booked
'tx_split' => [
'2261' => '20',
'2271' => '30'
],
];
*/
/*
// Affiliate Data, used for the affiliate`s revenue split model - Optional object - Decomment it based on your usage
$data['affiliate'] = [
// To submit shares for several affiliates for the same transaction
'subvendors'=> [
'2261' => '20',
'2271' => '30'
]
];
*/
// Custom Data - Optional object
$data['custom'] = [
// Shopper's selected language in shop
"lang" => "EN",
// Custom parameter's key - Optional object - Decomment it based on your usage
// 'input1' => 'your internal reference parameter name',
// Custom parameter's value - Optional object - Decomment it based on your usage
// 'inputval1' => 'your internal reference parameter value'
];
// Convert the array to JSON string
$json_data = json_encode($data);
// Handle Response
$response = send_request($json_data, $endpoint, $headers);
function send_request($data, $url, $headers) {
// Initiate cURL
$curl = curl_init();
// Set the url
curl_setopt($curl, CURLOPT_URL, $url);
// Set the result output to be a string
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
// Set the POST value to true (mandatory)
curl_setopt($curl, CURLOPT_POST, true);
// Set the post fields
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
// Set the headers
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
// Execute cURL
$result = curl_exec($curl);
// Handle cURL error
if (curl_errno($curl)) {
echo 'Request Error:' . curl_error($curl);
return $result;
}
// Close cURL
curl_close($curl);
// Decode the JSON string
$result = json_decode($result);
return $result;
}
?>curl --location --request POST 'https://payport.novalnet.de/v2/payment' -H 'Content-Type: application/json' -H 'Charset:utf-8' -H 'Accept: application/json' -H 'X-NN-Access-Key: ###YOUR_ENCODED_PAYMENT_ACCESS_KEY###' -d '{"merchant":{"signature":"###YOUR_API_SIGNATURE###","tariff":"###YOUR_TARIFF_ID###"},"customer":{"first_name":"Norbert","last_name":"Maier","email":"###YOUR_MAIL###","customer_ip":"###CUSTOMER_IP###","customer_no":"###CUSTOMER_NUMBER###","tel":"+49 089 123456","mobile":"+49 174 7781423","billing":{"house_no":"9","street":"Hauptstr","city":"Kaiserslautern","zip":"66862","country_code":"DE", "company": "ABC GmbH"}},"transaction":{"payment_type":"###PAYMENT_TYPE###","amount":"30000","currency":"###TRANSACTION_CURRENCY###","test_mode":"###TEST_MODE###","order_no":"###TRANSACTION_ORDER_NUMBER###","hook_url":"###YOUR_HOOK_URL###","payment_data":{"token":"###PAYMENT_TOKEN###"}} ,"instalment":{"interval":"1m" , "cycles" : "3"} ,"custom":{"lang":"EN"}}';#!/usr/bin/node
const https = require('https');
// data sent in the body of the request
const postData = JSON.stringify({
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"customer_ip": "###CUSTOMER_IP###",
"customer_no": "###CUSTOMER_NUMBER###",
"birth_date": "1992-06-10",
"billing": {
"street": "Musterstr",
"house_no": "2",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"company": "ABC GmbH"
}
},
"transaction": {
"payment_type": "###PAYMENT_TYPE###",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"test_mode": "###TEST_MODE###",
"hook_url":"###YOUR_HOOK_URL###",
"payment_data": {
"token": "###PAYMENT_TOKEN###"
}
},
"instalment":{"interval":"1m" , "cycles" : "3"},
"custom": {
"lang": "EN"
}
});
const options = {
hostname: 'payport.novalnet.de',
port: 443,
path: '/v2/payment',
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(postData),
'Charset': 'utf-8',
'Accept': 'application/json',
'X-NN-Access-Key': '###YOUR_ENCODED_PAYMENT_ACCESS_KEY###'
},
};
const req = https.request(options, (res) => {
console.log('statusCode:', res.statusCode);
// console.log('headers:', res.headers);
res.on('data', (d) => {
process.stdout.write(d);
});
});
req.on('error', (e) => {
console.error('ERROR: ',e);
});
// Write data to request body
req.write(postData);
req.end();#!/usr/bin/python3
import http.client
import json
CONN = http.client.HTTPSConnection("payport.novalnet.de")
PAYLOAD = json.dumps({
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"customer_ip": "###CUSTOMER_IP###",
"customer_no": "###CUSTOMER_NUMBER###",
"birth_date": "1992-06-10",
"billing": {
"street": "Musterstr",
"house_no": "2",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"company": "ABC GmbH"
}
},
"transaction": {
"payment_type": "###PAYMENT_TYPE###",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"test_mode": "###TEST_MODE###",
"hook_url":"###YOUR_HOOK_URL###",
"payment_data": {
"token": "###PAYMENT_TOKEN###"
}
},
"instalment":{"interval":"1m" , "cycles" : "3"},
"custom": {
"lang": "EN"
}
})
HEADERS = {
'Content-Type': 'application/json',
'Charset': 'utf-8',
'Accept': 'application/json',
'X-NN-Access-Key': '###YOUR_ENCODED_PAYMENT_ACCESS_KEY###'
}
CONN.request("POST", "/v2/payment", PAYLOAD, HEADERS)
RES = CONN.getresponse()
DATA = RES.read()
print(DATA.decode("utf-8"))#!/usr/lib/ruby
require "uri"
require "json"
require "net/http"
url = URI("https://payport.novalnet.de/v2/payment")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Accept"] = "application/json"
request["Charset"] = "utf-8"
request["X-NN-Access-Key"] = "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###"
request.body = JSON.dump({
"merchant": {
"signature": "###YOUR_API_SIGNATURE###",
"tariff": "###YOUR_TARIFF_ID###"
},
"customer": {
"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"customer_ip": "###CUSTOMER_IP###",
"customer_no": "###CUSTOMER_NUMBER###",
"birth_date": "1992-06-10",
"billing": {
"street": "Musterstr",
"house_no": "2",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"company": "ABC GmbH"
}
},
"transaction": {
"payment_type": "###PAYMENT_TYPE###",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"test_mode": "###TEST_MODE###",
"hook_url":"###YOUR_HOOK_URL###",
"payment_data": {
"token": "###PAYMENT_TOKEN###"
}
},
"instalment":{"interval":"1m" , "cycles" : "3"},
"custom": {
"lang": "EN"
}
})
response = https.request(request)
puts response.read_bodypackage main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://payport.novalnet.de/v2/payment"
method := "POST"
payload := strings.NewReader(`{"merchant":{"signature":"###YOUR_API_SIGNATURE###", "tariff" : "###YOUR_TARIFF_ID###"},"customer": {
"gender": "u",
"first_name": "Max",
"last_name": "Mustermann",
"email": "###YOUR_MAIL###",
"customer_ip": "###CUSTOMER_IP###",
"customer_no": "###CUSTOMER_NUMBER###",
"birth_date": "1992-06-10",
"billing": {
"street": "Musterstr",
"house_no": "2",
"city": "Musterhausen",
"zip": "12345",
"country_code": "DE",
"company": "ABC GmbH"
}
},
"transaction": {
"payment_type": "###PAYMENT_TYPE###",
"amount": "###TRANSACTION_AMOUNT###",
"currency": "###TRANSACTION_CURRENCY###",
"order_no": "###TRANSACTION_ORDER_NUMBER###",
"test_mode": "###TEST_MODE###",
"hook_url":"###YOUR_HOOK_URL###",
"payment_data": {
"token": "###PAYMENT_TOKEN###"
}
},
"instalment":{"interval":"1m" , "cycles" : "3"},"custom":{"lang":"EN"}}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
req.Header.Add("Charset", "utf-8")
req.Header.Add("X-NN-Access-Key", "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}/* List of required libraries (see also the import statements below):
- commons-logging-1.2.jar
- httpasyncclient-4.1.5.jar
- httpclient-4.3.3.jar
- httpcore-4.4.16.jar
- httpcore-nio-4.4.16.jar
- httpmime-4.5.14.jar
- json-20230227.jar
- unirest-java-3.9.00.jar
*/
import java.io.*;
import org.json.JSONArray;
import org.apache.http.auth.*;
import org.apache.http.nio.conn.*;
import org.apache.http.concurrent.*;
import org.apache.http.nio.reactor.*;
import org.apache.commons.logging.*;
import org.apache.http.entity.mime.content.*;
import kong.unirest.*;
public class TokenizationRequest {
public static void main(String []args) throws Exception{
Unirest.config().connectTimeout(1000).socketTimeout(2000);
HttpResponse<String> response = Unirest.post("https://payport.novalnet.de/v2/payment")
.header("Content-Type", "application/json")
.header("Charset", "utf-8")
.header("Accept", "application/json")
.header("X-NN-Access-Key", "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###")
.body("{\"merchant\":{\"signature\":\"###YOUR_API_SIGNATURE###\", \"tariff\" : \"###YOUR_TARIFF_ID###\"},\"customer\":{\"customer_ip\":\"###CUSTOMER_IP###\",\"gender\":\"u\", \"first_name\": \"Max\", \"last_name\": \"Mustermann\", \"email\": \"###YOUR_MAIL###\", \"birth_date\":\"1983-07-02\",\"billing\":{\"street\":\"Musterstr\",\"house_no\":\"2\",\"city\":\"Musterhausen\",\"zip\":\"12345\",\"country_code\":\"DE\",\"company\":\"ABC GmbH\"}},\"transaction\":{\"payment_type\": \"###PAYMENT_TYPE###\",\"amount\":\"###TRANSACTION_AMOUNT###\",\"currency\":\"EUR\",\"order_no\":\"###TRANSACTION_ORDER_NUMBER###\",\"test_mode\":\"###TEST_MODE###\",\"hook_url\":\"###YOUR_HOOK_URL###\",\"payment_data\":{\"token\":\"###PAYMENT_TOKEN###\"}}, \"instalment\":{\"interval\":\"1m\" , \"cycles\" : \"3\"},\"custom\":{\"lang\":\"EN\"}}")
.asString();
System.out.println(response.getBody());
}
}using System;
using System.Net.Http;
namespace TokenizationRequest
{
public class TokenizationRequest {
public string check_Tokenization_request() {
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://payport.novalnet.de/v2/payment");
request.Headers.Add("Charset", "utf-8");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("X-NN-Access-Key", "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###");
var content = new StringContent("{\"merchant\":{\"signature\":\"###YOUR_API_SIGNATURE###\", \"tariff\" : \"###YOUR_TARIFF_ID###\"},\"customer\":{\"customer_ip\":\"###CUSTOMER_IP###\",\"gender\":\"u\", \"first_name\": \"Max\", \"last_name\": \"Mustermann\", \"email\": \"###YOUR_MAIL###\", \"birth_date\":\"1983-07-02\",\"billing\":{\"street\":\"Musterstr\",\"house_no\":\"2\",\"city\":\"Musterhausen\",\"zip\":\"12345\",\"country_code\":\"DE\",\"company\":\"ABC GmbH\"}},\"transaction\":{\"payment_type\": \"###PAYMENT_TYPE###\",\"amount\":\"###TRANSACTION_AMOUNT###\",\"currency\":\"EUR\",\"order_no\":\"###TRANSACTION_ORDER_NUMBER###\",\"test_mode\":\"###TEST_MODE###\",\"hook_url\":\"###YOUR_HOOK_URL###\",\"payment_data\":{\"token\":\"###PAYMENT_TOKEN###\"}},\"instalment\":{\"interval\":\"1m\" , \"cycles\" : \"3\"},\"custom\":{\"lang\":\"EN\"}}", null, "application/json");
request.Content = content;
var response = client.SendAsync(request).Result;
response.EnsureSuccessStatusCode();
var responseText = response.Content.ReadAsStringAsync().Result;
Console.WriteLine(responseText);
return responseText;
}
public static void Main() {
var testRequest = new TokenizationRequest();
testRequest.check_Tokenization_request();
}
}
}