PHPackages                             dna/dnapayments-sdk-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. dna/dnapayments-sdk-php

ActiveLibrary[Payment Processing](/categories/payments)

dna/dnapayments-sdk-php
=======================

DNA payments library for php

2.2.1(6mo ago)143.8k—0%[1 issues](https://github.com/DNA-Payments/dnapayments-sdk-php/issues)MITPHP

Since Jul 28Pushed 6mo agoCompare

[ Source](https://github.com/DNA-Payments/dnapayments-sdk-php)[ Packagist](https://packagist.org/packages/dna/dnapayments-sdk-php)[ RSS](/packages/dna-dnapayments-sdk-php/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (3)Versions (18)Used By (0)

Running Tests
-------------

[](#running-tests)

To run all tests, use the following command:

```
./vendor/bin/phpunit ./tests
```

### Running Specific Test Methods

[](#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

[](#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

[](#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'
        ]
    ]
];
```

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance48

Moderate activity, may be stable

Popularity30

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 58.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~117 days

Recently: every ~104 days

Total

17

Last Release

186d ago

Major Versions

1.1.8 → 2.0.02024-05-26

### Community

Maintainers

![](https://www.gravatar.com/avatar/db49bab8d900c4fa221109f91ca6f3f8b2a2b867b8ce4aa3aa2b5acb2ffecac7?d=identicon)[nurbol-dnapayments](/maintainers/nurbol-dnapayments)

![](https://www.gravatar.com/avatar/c58e3fea538ee0e70b3aea2226e5ce726b190006d622aa1b7ad39ae4bff96c6f?d=identicon)[AlikhanIzbergenov](/maintainers/AlikhanIzbergenov)

---

Top Contributors

[![alikhanizbergenovdna](https://avatars.githubusercontent.com/u/64907987?v=4)](https://github.com/alikhanizbergenovdna "alikhanizbergenovdna (20 commits)")[![nurbol-dnapayments](https://avatars.githubusercontent.com/u/66943363?v=4)](https://github.com/nurbol-dnapayments "nurbol-dnapayments (14 commits)")

---

Tags

dnapaymentspaymentpayment-gatewaypayment-integrationphp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/dna-dnapayments-sdk-php/health.svg)

```
[![Health](https://phpackages.com/badges/dna-dnapayments-sdk-php/health.svg)](https://phpackages.com/packages/dna-dnapayments-sdk-php)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
