### Upgrade Magento Setup (Magento CLI) Source: https://developer.novalnet.com/ecommerce/hyvacheckout This command upgrades the Magento installation, applying any necessary database schema changes and updates. It should be run after modifying or removing modules. ```bash php bin/magento setup:upgrade ``` -------------------------------- ### Install Novalnet Hyvä Checkout via Package Source: https://developer.novalnet.com/ecommerce/hyvacheckout Installs the Novalnet Hyvä Checkout module by uploading the package. This involves placing the extracted folder in the correct Magento directory and enabling the module. ```bash php bin/magento module:enable Novalnet_HyvaCheckout php bin/magento module:status php bin/magento setup:upgrade php bin/magento setup:di:compile php bin/magento setup:static-content:deploy -f ``` -------------------------------- ### Install Novalnet Addon in SAP Commerce Source: https://developer.novalnet.com/ecommerce/sapcommerceguide Command to install the Novalnet checkout addon in your SAP Commerce shop system. This command should be run from the /bin/platform directory of your SAP Commerce installation. ```bash ant addoninstall -Daddonnames=novalnetcheckoutaddon -DaddonStorefront.yacceleratorstorefront=yacceleratorstorefront ``` -------------------------------- ### Create Subscription with Novalnet (Go) Source: https://developer.novalnet.com/apireference/subscription This Go program sends a POST request to the Novalnet payment API to create a subscription. It includes setting up the request headers, constructing the payload with merchant and customer details, and handling the API response. It uses the `net/http`, `strings`, and `io/ioutil` packages. ```go 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_SUBSCRIPTION_TARIFF_ID###" }, "customer": { "customer_ip": "###CUSTOMER_IP###", "gender": "u", "first_name": "Max", "last_name": "Mustermann", "email": "###YOUR_MAIL###", "billing": { "street": "Musterstr", "house_no": "2", "city": "Musterhausen", "zip": "12345", "country_code": "DE", "tel": "+49 089 123456" } }, "transaction": { "payment_type": "EPC_QRPAY", "amount": "###TRANSACTION_AMOUNT###", "currency": "###TRANSACTION_CURRENCY###", "order_no": "###TRANSACTION_ORDER_NUMBER###", "test_mode": "###TEST_MODE###", "hook_url": "###YOUR_HOOK_URL###" }, "subscription": { "interval": "1m" }, "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)) } ``` -------------------------------- ### POST /v2/payment (Subscription Creation - C#) Source: https://developer.novalnet.com/apireference/subscription This C# example demonstrates how to make a POST request to the Novalnet payment API for creating a subscription. It includes setting up headers and constructing the JSON request body. ```APIDOC ## POST /v2/payment (Subscription Creation - C#) ### Description This endpoint facilitates the creation of a payment transaction and the setup of recurring subscriptions with Novalnet using C#. It requires authentication headers and a comprehensive JSON payload detailing the merchant, customer, transaction parameters, and subscription specifics. ### Method POST ### Endpoint `https://payport.novalnet.de/v2/payment` ### Parameters #### Headers - **Content-Type** (string) - Required - `application/json` - **Charset** (string) - Required - `utf-8` - **Accept** (string) - Required - `application/json` - **X-NN-Access-Key** (string) - Required - Your encoded payment access key. #### Request Body - **merchant** (object) - Required - Merchant details. - **signature** (string) - Required - Your API signature. - **tariff** (string) - Required - Your subscription tariff ID. - **customer** (object) - Required - Customer details. - **first_name** (string) - Required - Customer's first name. - **last_name** (string) - Required - Customer's last name. - **email** (string) - Required - Customer's email address. - **customer_ip** (string) - Required - The IP address of the customer. - **birth_date** (string) - Optional - Customer's date of birth (YYYY-MM-DD). - **customer_no** (string) - Optional - Customer number. - **tel** (string) - Optional - Customer's phone number. - **mobile** (string) - Optional - Customer's mobile number. - **gender** (string) - Optional - Customer's gender (`u` for unspecified). - **vat_id** (string) - Optional - VAT ID. - **reg_no** (string) - Optional - Registration number. - **tax_id** (string) - Optional - Tax ID. - **session** (string) - Optional - Session ID. - **fax** (string) - Optional - Customer's fax number. - **billing** (object) - Required - Billing address details. - **street** (string) - Required - Street name. - **house_no** (string) - Required - House number. - **city** (string) - Required - City name. - **zip** (string) - Required - ZIP code. - **country_code** (string) - Required - Two-letter country code (e.g., 'DE'). - **state** (string) - Optional - State or province. - **company** (string) - Optional - Company name. - **shipping** (object) - Optional - Shipping address details (defaults to billing if `same_as_billing` is '1'). - **same_as_billing** (string) - Required if shipping differs - Set to '1' if shipping is same as billing. - **first_name** (string) - Required if shipping differs - Shipping first name. - **last_name** (string) - Required if shipping differs - Shipping last name. - **email** (string) - Optional - Shipping email. - **street** (string) - Required if shipping differs - Shipping street name. - **house_no** (string) - Required if shipping differs - Shipping house number. - **city** (string) - Required if shipping differs - Shipping city name. - **zip** (string) - Required if shipping differs - Shipping ZIP code. - **country_code** (string) - Required if shipping differs - Shipping country code. - **tel** (string) - Optional - Shipping phone number. - **company** (string) - Optional - Shipping company name. - **mobile** (string) - Optional - Shipping mobile number. - **state** (string) - Optional - Shipping state or province. - **transaction** (object) - Required - Transaction details. - **payment_type** (string) - Required - The type of payment (e.g., `CC`, `SEPA_DIRECT_DEBIT`). - **amount** (string) - Required - Transaction amount. - **currency** (string) - Required - Transaction currency (e.g., 'EUR'). - **test_mode** (string) - Optional - Set to '1' for test mode. - **order_no** (string) - Required - Your unique order number. - **return_url** (string) - Optional - URL to redirect the customer after a successful transaction. - **error_return_url** (string) - Optional - URL to redirect the customer after a failed transaction. - **hook_url** (string) - Optional - URL for receiving transaction status updates. - **create_token** (integer) - Optional - Set to 1 to create a payment token. - **payment_data** (object) - Required for certain payment types. - **account_holder** (string) - Required for SEPA Direct Debit. - **iban** (string) - Required for SEPA Direct Debit. - **bic** (string) - Optional for SEPA Direct Debit. - **pan_hash** (string) - Required for card payments. - **unique_id** (string) - Required for specific payment methods. - **token** (string) - Required if using a stored token. - **wallet_token** (string) - Required for wallet payments. - **account_number** (string) - Required for some bank transfers. - **routing_number** (string) - Required for some bank transfers. - **subscription** (object) - Optional - Subscription details. - **interval** (string) - Required if subscription is enabled - Subscription interval (e.g., '3m' for quarterly). - **trial_interval** (string) - Optional - Trial period interval. - **trial_amount** (string) - Optional - Amount for the trial period. - **expiry_date** (string) - Optional - Subscription expiry date (YYYY-MM-DD). - **marketplace** (object) - Optional - Marketplace payout configuration. - **tx_split** (object) - Defines transaction splits by vendor ID. - **commission_split** (object) - Defines commission splits by vendor ID. - **affiliate** (object) - Optional - Affiliate program details. - **subvendors** (object) - Defines subvendor splits. ### Request Example ```json { "merchant": { "signature": "###YOUR_API_SIGNATURE###", "tariff": "###YOUR_SUBSCRIPTION_TARIFF_ID###" }, "customer": { "first_name": "Max", "last_name": "Mustermann", "email": "###YOUR_MAIL###", "customer_ip": "###CUSTOMER_IP###", "birth_date": "1992-06-10", "customer_no": "###CUSTOMER_NO###", "tel": "+49 089 123456", "mobile": "+491747781423", "gender": "u", "vat_id": "DE123456", "reg_no": "HRB1234", "tax_id": "123/123/123", "session": "fedgrgst5653653hdgfsvgdsf622627e", "fax": "+49 89 654321", "billing": { "street": "Musterstr", "house_no": "2", "city": "Musterhausen", "zip": "12345", "country_code": "DE", "state": "Berlin", "company": "ABC GmbH" }, "shipping": { "same_as_billing": "1", "first_name": "Max", "last_name": "Mustermann", "email": "test@novanet.de", "street": "Musterstr", "house_no": "5", "city": "Musterhausen", "zip": "12345", "country_code": "DE", "tel": "+49 089 123456", "company": "ABC GmbH", "mobile": "+491747781423", "state": "Berlin" } }, "transaction": { "payment_type": "###PAYMENT_TYPE###", "amount": "###TRANSACTION_AMOUNT###", "currency": "###TRANSACTION_CURRENCY###", "test_mode": "1", "order_no": "###TRANSACTION_ORDER_NUMBER###", "return_url": "###YOUR_RETURN_URL###", "error_return_url": "###YOUR_ERROR_RETURN_URL###", "hook_url": "###HOOK_URL###", "create_token":1, "payment_data": { "account_holder": "Max Mustermann", "iban": "###IBAN###", "bic":"###BIC###", "pan_hash" : "###PAN_HASH###", "unique_id" : "###UNIQUE_ID###", "token" : "###TOKEN###", "wallet_token" : "###WALLET_TOKEN###", "account_number":"###ACCOUNT_NUMBER###", "routing_number":"###ROUTING_NUMBER###" } }, "subscription": { "interval": "3m", "trial_interval": "3m", "trial_amount": "150", "expiry_date": "YYYY-MM-DD" }, "marketplace": { "tx_split": { "2261": "100", "2271": "120" }, "commission_split": { "2261": { "percentage": "100", "amount": "700" }, "2271": { "percentage": "97" } } }, "affiliate": { "subvendors": { "2261": "100", "2271": "120" }, "commi" : "... } } ``` ### Response #### Success Response (200) - **Result** (string) - Indicates the success or failure of the request. - **Status** (string) - Provides the status message of the transaction. - **Payment_URL** (string) - URL for payment redirection if applicable. ``` -------------------------------- ### Install Novalnet Hyvä Checkout via Composer Source: https://developer.novalnet.com/ecommerce/hyvacheckout Installs the latest Novalnet Hyvä Checkout module using Composer. This command should be run from the Magento shop's root directory. ```bash composer require novalnet/hyva-checkout php bin/magento module:enable Novalnet_HyvaCheckout php bin/magento setup:upgrade php bin/magento setup:di:compile php bin/magento setup:static-content:deploy -f ``` -------------------------------- ### POST /v2/payment (General Payment Initiation) Source: https://developer.novalnet.com/apireference/subscription This example demonstrates a general payment initiation using Ruby, showcasing various optional parameters for customer, billing, shipping, and transaction details. ```APIDOC ## POST /v2/payment (General Payment Initiation) ### Description Initiates a payment transaction with comprehensive customer and transaction details. This example uses Ruby and covers various optional fields for detailed integration. ### Method POST ### Endpoint `https://payport.novalnet.de/v2/payment` ### Parameters #### Request Body - **merchant.signature** (string) - Required - Your Novalnet API signature. - **merchant.tariff** (string) - Required - Your Novalnet subscription tariff ID. - **customer.first_name** (string) - Required - The first name of the customer. - **customer.last_name** (string) - Required - The last name of the customer. - **customer.email** (string) - Required - The email address of the customer. - **customer.customer_ip** (string) - Required - The IP address of the customer. - **customer.birth_date** (string) - Optional - The customer's birth date (YYYY-MM-DD). - **customer.customer_no** (string) - Optional - The customer number. - **customer.tel** (string) - Optional - The customer's telephone number. - **customer.mobile** (string) - Optional - The customer's mobile number. - **customer.gender** (string) - Optional - The customer's gender ('m', 'f', 'u'). - **customer.vat_id** (string) - Optional - The customer's VAT ID. - **customer.reg_no** (string) - Optional - The customer's registration number. - **customer.tax_id** (string) - Optional - The customer's tax ID. - **customer.session** (string) - Optional - Customer session ID. - **customer.fax** (string) - Optional - The customer's fax number. - **customer.billing** (object) - Required - Billing address details. - **street** (string) - Required - Street for billing address. - **house_no** (string) - Required - House number for billing address. - **city** (string) - Required - City for billing address. - **zip** (string) - Required - ZIP code for billing address. - **country_code** (string) - Required - Two-letter country code for billing address (e.g., DE). - **state** (string) - Optional - State or province for billing address. - **company** (string) - Optional - Company name for billing address. - **customer.shipping** (object) - Optional - Shipping address details. If not provided, assumed same as billing. - **same_as_billing** (string) - Set to "1" if shipping is same as billing. - **first_name** (string) - Shipping first name. - **last_name** (string) - Shipping last name. - **email** (string) - Shipping email. - **street** (string) - Shipping street. - **house_no** (string) - Shipping house number. - **city** (string) - Shipping city. - **zip** (string) - Shipping ZIP code. - **country_code** (string) - Shipping country code. - **tel** (string) - Shipping telephone number. - **company** (string) - Shipping company name. - **mobile** (string) - Shipping mobile number. - **state** (string) - Shipping state or province. - **transaction.payment_type** (string) - Required - The desired payment type (e.g., "CREDITCARD", "INVOICE"). - **transaction.amount** (string) - Required - The transaction amount. - **transaction.currency** (string) - Required - The transaction currency (e.g., EUR). - **transaction.test_mode** (string) - Required - Set to "1" for test mode, "0" for live mode. - **transaction.order_no** (string) - Required - Your internal order number. - **transaction.return_url** (string) - Optional - URL to redirect the user after successful payment. - **transaction.error_return_url** (string) - Optional - URL to redirect the user if payment fails. - **transaction.hook_url** (string) - Required - URL for receiving payment notifications. - **transaction.due_date** (string) - Optional - Due date for the transaction (YYYY-MM-DD). - **transaction.invoice_ref** (string) - Optional - Reference for invoice payments. - **transaction.mandate_ref** (string) - Optional - Reference for direct debit mandates. - **transaction.mandate_date** (string) - Optional - Date of the direct debit mandate. - **transaction.enforce_3d** (string) - Optional - Set to "1" to enforce 3D Secure. - **transaction.verify_payment_data** (string) - Optional - Set to "1" to verify payment data. - **transaction.invoice_no** (string) - Optional - Invoice number. - **transaction.dynamic_descriptor** (string) - Optional - Dynamic descriptor for the transaction. - **transaction.debit_reason_1** to **debit_reason_4** (string) - Optional - Reasons for debit. - **transaction.create_token** (integer) - Optional - Set to 1 to create a token for future use. - **transaction.payment_data** (object) - Payment-specific data (e.g., IBAN, BIC for SEPA). - **account_holder** (string) - Account holder name. - **iban** (string) - IBAN for direct debit. - **bic** (string) - BIC for direct debit. - **pan_hash** (string) - Hashed PAN for card payments. - **unique_id** (string) - Unique identifier for payment data. - **token** (string) - Payment token. - **wallet_token** (string) - Wallet payment token. - **account_number** (string) - Account number. - **routing_number** (string) - Routing number. - **subscription** (object) - Subscription details. - **interval** (string) - Subscription interval (e.g., "1m"). ### Request Example ```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_SUBSCRIPTION_TARIFF_ID###" }, "customer": { "first_name": "Max", "last_name": "Mustermann", "email": "###YOUR_MAIL###", "customer_ip": "###CUSTOMER_IP###", "birth_date": "1992-06-10", "customer_no": "###CUSTOMER_NO###", "tel": "+49 089 123456", "mobile": "+491747781423", "gender": "u", "vat_id": "DE123456", "reg_no": "HRB1234", "tax_id": "123/123/123", "session": "fedgrgst5653653hdgfsvgdsf622627e", "fax": "+49 89 654321", "billing": { "street": "Musterstr", "house_no": "2", "city": "Musterhausen", "zip": "12345", "country_code": "DE", "state": "Berlin", "company": "ABC GmbH" }, "shipping": { "same_as_billing": "1", "first_name": "Max", "last_name": "Mustermann", "email": "test@novanet.de", "street": "Musterstr", "house_no": "5", "city": "Musterhausen", "zip": "12345", "country_code": "DE", "tel": "+49 089 123456", "company": "ABC GmbH", "mobile": "+491747781423", "state": "Berlin" } }, "transaction": { "payment_type": "###PAYMENT_TYPE###", "amount": "###TRANSACTION_AMOUNT###", "currency": "###TRANSACTION_CURRENCY###", "test_mode": "1", "order_no": "###TRANSACTION_ORDER_NUMBER###", "return_url": "###YOUR_RETURN_URL###", "error_return_url": "###YOUR_ERROR_RETURN_URL###", "hook_url": "###HOOK_URL###", "create_token": 1, "payment_data": { "account_holder": "Max Mustermann", "iban": "###IBAN###", "bic": "###BIC###" } }, "subscription": { "interval": "1m" } }) res = https.request(request) puts res.body ``` ### Response #### Success Response (200) - **transaction_status** (string) - The status of the transaction. - **payment_details** (object) - Details specific to the payment method. #### Response Example ```json { "transaction_status": "SUCCESS", "payment_details": { "token": "generated_token_123" } } ``` ``` -------------------------------- ### Uninstall Novalnet Module via Composer Source: https://developer.novalnet.com/ecommerce/magentoquicksetup This command removes the Novalnet payment module from your Magento installation when it was initially installed via Composer. Ensure you are in the shop's root directory before execution. A backup is recommended before proceeding. ```bash rm -rf app/code/Novalnet ``` -------------------------------- ### PHP Novalnet Payment Gateway Configuration and Transaction Setup Source: https://developer.novalnet.com/apireference/subscription This snippet demonstrates setting up payment access keys, encoding them for authentication, defining the API endpoint, and constructing the necessary headers for the Novalnet payment gateway. It also details the structure for merchant, customer, and transaction data, including payment types, amounts, currencies, order numbers, and SEPA direct debit details. Optional parameters for test mode, hook URLs, token creation, and subscription management are also shown. ```php '###YOUR_API_SIGNATURE###', // Your corresponding tariff ID 'tariff' => '###YOUR_SUBSCRIPTION_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', // 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' => '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 mode of the transaction 'order_no' => '###TRANSACTION_ORDER_NUMBER###', // 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###', 'bic' => '###BIC###' ] ]; // Subscription data $data['subscription'] = [ // The interval between each cycle 'interval' => '1m', // Subscription trial interval - Optional object - Decomment it based on your usage // 'trial_interval' => '3m', // Subscription trial interval amount - Optional object - Decomment it based on your usage // '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 */ ?> ``` -------------------------------- ### Install Novalnet Payment Module via Composer (Magento) Source: https://developer.novalnet.com/ecommerce/magentoquicksetup Installs the Novalnet payment module using Composer. This command requires your Magento Marketplace access keys for authentication. Ensure you are in the shop's root directory before execution. ```bash composer require novalnet/module-payment ``` -------------------------------- ### PHP: Novalnet Seamless Payment Integration Setup Source: https://developer.novalnet.com/onlinepayments/aboutzeroamountbooking This PHP code snippet demonstrates the initial setup for seamless payment integration with the Novalnet payment gateway. It includes defining the payment access key, encoding it for authentication, setting the API endpoint, and constructing the necessary headers. ```php 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_SUBSCRIPTION_TARIFF_ID###\"},\"customer\":{\"customer_ip\":\"###CUSTOMER_IP###\",\"gender\":\"u\", \"first_name\": \"Max\", \"last_name\": \"Mustermann\", \"email\": \"###YOUR_MAIL###\", \"billing\":{\"street\":\"Musterstr\",\"house_no\":\"2\",\"city\":\"Musterhausen\",\"zip\":\"12345\",\"country_code\":\"DE\",\"tel\":\"+49 089 123456\"}},\"transaction\":{\"payment_type\": \"PREPAYMENT\",\"amount\":\"###CUSTOMER_IP###\",\"currency\":\"EUR\",\"order_no\":\"###TRANSACTION_ORDER_NUMBER###\",\"due_date\":\"2023-04-27\"},\"subscription\":{\"interval\":\"3m\"},\"custom\":{\"lang\":\"EN\"}}") .asString(); System.out.println(response.getBody()); } } ``` -------------------------------- ### Grant File Permissions for Magento Directories Source: https://developer.novalnet.com/ecommerce/magentoquicksetup Provides full read/write permissions to essential Magento directories to resolve potential file permission issues during command execution. This is crucial for successful module installation and updates. ```bash chmod -R 777 app generated pub var ``` -------------------------------- ### Create Affiliate API Request - GoLang Source: https://developer.novalnet.com/apireference/affiliatecreation This GoLang snippet shows how to make an API call to create a new affiliate. It demonstrates the use of `net/http` package for sending POST requests with JSON payloads. This example requires proper initialization of request body, headers, and endpoint URL. Replace placeholders with your actual API credentials. ```go package main import ( "bytes" "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://payport.novalnet.de/v2/affiliate/create" payload := map[string]interface{}{ "merchant": map[string]string{ "signature": "###YOUR_API_SIGNATURE###", }, "affiliate": map[string]interface{}{ "login": "###AFFILIATE_LOGIN###", "password": "###AFFILIATE_PASSWORD###", "reference": "Test affiliate", "gender": "u", "first_name": "Max", "last_name": "Mustermann", "email": "###AFFILIATE_EMAIL###", "company_email": "###AFFILIATE_COMPANY_EMAIL###", "address": map[string]string{ "house_no": "2", "street": "Musterstr", "city": "Musterhausen", "zip": "12345", "country_code": "DE", "company": "ABC GmbH", }, "tel": "+49 089 123456", "vat_id": "DE123456", "account_holder": "###ACCOUNT_HOLDER###", "iban": "###IBAN###", }, "custom": map[string]string{ "lang": "EN", }, } payloadBytes, err := json.Marshal(payload) if err != nil { fmt.Printf("Error marshalling JSON: %s\n", err) return } req, err := http.NewRequest("POST", url, bytes.NewBuffer(payloadBytes)) if err != nil { fmt.Printf("Error creating request: %s\n", err) return } req.Header.Set("Content-Type", "application/json") req.Header.Set("X-NN-Access-Key", "###YOUR_ENCODED_PAYMENT_ACCESS_KEY###") client := &http.Client{} resp, err := client.Do(req) if err != nil { fmt.Printf("Error sending request: %s\n", err) return } defer resp.Body.Close() body, err := ioutil.ReadAll(resp.Body) if err != nil { fmt.Printf("Error reading response body: %s\n", err) return } fmt.Println(string(body)) } ```