goldbach-algorithms/novalnet-ag 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

goldbach-algorithms/novalnet-ag

Composer 安装命令:

composer require goldbach-algorithms/novalnet-ag

包简介

Novalnet AG by Goldbach

README 文档

README

License: MIT

NovalnetAG by Goldbach is a PHP library developed to integrate the Novalnet payment system with Symfony and Drupal.

Installation

Use the composer to install

composer require goldbach-algorithms/novalnet-ag

Usage

Transaction

To execute a transaction it is necessary to assign the configuration keys of your Novalnet account. Then configure customer, billing address and payment data. At the end, a link will be generated to the payment page to which the customer must be redirected to complete their purchase. The payment links expire after 45 minutes.

# add use Novalnet
use GoldbachAlgorithms\Novalnet\Novalnet;

# create a instance of Novalnet
$novalnet = new Novalnet();

# set account config keys
$novalnet->setPaymentKey('YOUR_PAYMENT_KEY');
$novalnet->setSignature('YOUR_SIGNATURE');
$novalnet->setTariff('YOUR_TARIFF_CODE');

# set transaction data
$novalnet->setTransaction(
            'CREDITCARD', // payment type
            '7', // amount
            'EUR', // currency
            1, // test mode (true or false)
            '', // return url to redirect (success)
            '' // return url to redirect (error)
        );

# set customer data
$novalnet->setCustomer(
            'Max', // first name
            'Mustermann', // last name
            'test@novalnet.de', //e-mail
            '+49 174 7781423' // mobile number
            '1911-11-11', // birth date
            'm', // gender (m or f)
            '+49 (0)89 123456', // telephone number (optional)
            '' // fax (optional)
        );

# set billing data
$novalnet->setBilling(
            '2', // house number
            'Musterstr', // street
            'Musterhausen', // city
            '12345', // zipcode
            'DE', // country code
            'ABC GmbH', // company name (optional)
        );

# set hide blocks (will change the payment screen)
$novalnet->setHideBlocks(
            [
                'ADDRESS_FORM',
                'SHOP_INFO', 
                'LANGUAGE_MENU', 
                'TARIFF'
            ]
        );

# set skip pages (will change the payment screen)
$novalnet->setSkipPages(
            [
                'CONFIRMATION_PAGE',
                'SUCCESS_PAGE',
                'PAYMENT_PAGE'
            ]
        );

# generating payment link
$payment_link = $novalnet->getLink();

Transaction return

After payment, a unique code will be generated that will be returned along with the secret that is the identification of the payment page generated previously

# success returns
stdClass Object (
     [status] => "success"
     [link] => "https://paygate.novalnet.de/nn/d8884c8c299cfdd7232964e5fe788849"
     [secret] => "d8884c8c299cfdd7232964e5fe788849"
)

# error return
stdClass Object (
     [status] => "error"
     [link] => "Invalid payment type or payment type inactive"
)

Refund

In the refund process, the full amount or partial amount can be refunded. When the value of 'amount' is not filled, the full amount will be applied.

# add use Novalnet
use GoldbachAlgorithms\Novalnet\Novalnet;

# create a instance of Novalnet
$novalnet = new Novalnet();

# set account payment key
$novalnet->setPaymentKey('YOUR_PAYMENT_KEY');

# config refund data
$refund = $novalnet->refund(
            '14533600047325226', // tid
            'fail', // reason
            'EN', // language
            '200' // amount to refund (optional)
        );

Refund return

# success returns
stdClass Object (
     [status] => "success"
     [tid] => "14533600047325226"
     [refunded_amount] => "200"
)

# error return
stdClass Object (
     [status] => "error"
     [message] => "Amount larger than zero required"
)

License

MIT

Copyright © 2023 Goldbach Algorithms

统计信息

  • 总下载量: 5
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-02-23

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固