定制 dna/dnapayments-sdk-php 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

dna/dnapayments-sdk-php

最新稳定版本:2.2.1

Composer 安装命令:

composer require dna/dnapayments-sdk-php

包简介

DNA payments library for php

README 文档

README

To run all tests, use the following command:

./vendor/bin/phpunit ./tests

Running Specific Test Methods

To run only a specific test method, use the --filter option:

# Run a specific test method ./vendor/bin/phpunit --filter test_auth_data ./tests/DNAPaymentsTest.php # Run multiple specific methods using regex pattern ./vendor/bin/phpunit --filter "test_auth_data|test_generate_url" ./tests/DNAPaymentsTest.php # Run all methods containing a specific word ./vendor/bin/phpunit --filter "transaction" ./tests/DNAPaymentsTest.php # Run a specific test class and method ./vendor/bin/phpunit --filter "DNAPaymentsTest::test_auth_data" ./tests/

Available test methods:

  • test_auth_data - Test authentication data
  • test_generate_url - Test URL generation
  • test_get_transactions_by_id - Test getting transactions by ID
  • test_get_transactions_by_invoice_id - Test getting transactions by invoice ID
  • test_refund - Test refund functionality
  • test_recurring - Test recurring payments

Configuration data

[ 'isTestMode' => true, 'scopes' => [ 'allowHosted' => true, 'allowEmbedded' => true, 'allowSeamless' => true ], 'isEnableDonation' => false, 'autoRedirectDelayInMs' => 20000, 'paymentTimeoutInSeconds' => 600, 'allowSavingCards' => true, 'cards' => [ [ 'merchantTokenId' => '3UGTOmzrP+Y8onM5wsQCc2eIjeZDpoBKqP3Mem80Re0fMQ==', 'panStar' => '***************1111', 'cardSchemeId' => 11, 'cardSchemeName' => 'VISA', 'cardName' => 'JOHN DOE', 'expiryDate' => '05/29', 'cscState' => 'required', // optional, hidden 'useStoredBillingData' => false ] ], 'disabledCardSchemes' => [ [ 'cardSchemeId' => 1, 'cardSchemeName' => 'Amex' ] ], 'locale' => [ 'targetLocale' => 'en_GB' ] ];

Payment data

[ 'invoiceId' => $invoice_id, 'description' => 'Payment description if needed', 'amount' => $amount, 'currency' => $this->currency, 'language' => 'en-gb', 'paymentSettings' => [ 'terminalId' => $this->terminal, 'returnUrl' => 'https://test-pay.dnapayments.com/checkout/success.html', 'failureReturnUrl' => 'https://test-pay.dnapayments.com/checkout/failure.html', 'callbackUrl' => 'https://pay.dnapayments.com/checkout', 'failureCallbackUrl' => 'https://testmerchant/order/1123/fail' ], 'customerDetails' => [ 'email' => 'test@dnapayments.com', 'accountDetails' => [ 'accountId' => 'uuid000001', ], 'billingAddress' => [ 'firstName' => 'John', 'lastName' => 'Doe', 'addressLine1' => 'Fulham Rd', 'postalCode' => 'SW6 1HS', 'city' => 'London', 'country' => 'GB' ], 'deliveryDetails' => [ 'deliveryAddress' => [ 'firstName' => 'John', 'lastName' => 'Doe', 'addressLine1' => 'Fulham Rd', 'addressLine2' => 'Fulham', 'postalCode' => 'SW6 1HS', 'city' => 'London', 'phone' => '0475662834', 'country' => 'GB' ], ] ], 'orderLines' => [ [ 'name' => 'Running shoe', 'quantity' => 1, 'unitPrice' => 24, 'taxRate' => 20, 'totalAmount' => 24, 'totalTaxAmount' => 4, 'imageUrl' => 'https://www.exampleobjects.com/logo.png', 'productUrl' => 'https://.../AD6654412.html' ] ] ];

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固