PHPackages                             sunnysideup/afterpay - 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. [API Development](/categories/api)
4. /
5. sunnysideup/afterpay

ActiveSilverstripe-vendormodule[API Development](/categories/api)

sunnysideup/afterpay
====================

Integrate easily with the api.afterpay.com API

2.1.1(2y ago)1357BSD-3-ClausePHP

Since May 17Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/sunnysideup/silverstripe-payment-afterpay)[ Packagist](https://packagist.org/packages/sunnysideup/afterpay)[ RSS](/packages/sunnysideup-afterpay/feed)WikiDiscussions main Synced yesterday

READMEChangelog (1)Dependencies (3)Versions (11)Used By (0)

silverstripe-afterpay
=====================

[](#silverstripe-afterpay)

Provides a basic implementation of afterpay as a payment method for `sunnysideup/ecommerce` - using  as a base.

installation
============

[](#installation)

Use composer

```
composer require sunnysideup/afterpay

```

setup
=====

[](#setup)

Add the following code as outlined below:

1. set up credentials

`app/_config/afterpay.yml`:

```
---
Name: Afterpay
---

Sunnysideup\Afterpay\Factory\SilverstripeMerchantApi:
  merchant_name: 'my merchant name'
  merchant_id: yyy
  secret_key: 'xxx'
  expectations_folder: 'app/afterpay/configurations'
  number_of_payments: 4
```

2. set afterpay as a payment option

`app/_config/ecommerce.yml`:

```
EcommercePayment:
  supported_methods:
    # ...
    Sunnysideup\Afterpay\Model\AfterpayEcommercePayment: "Afterpay"
```

3. add fields to EcomConfig (via data extension or otherwise)

```
    private static $db = [
        'ShowAfterpayOption' => 'Boolean',
        'AfterpayMinValue' => 'Int',
        'AfterpayMaxValue' => 'Int',
    ]
```

4. add functionality to product:

`app/src/Model/MyProduct.php`:

```
use Sunnysideup\Afterpay\Factory\SilverstripeMerchantApi;

class MyProduct extends Product
{
    public function ShowAfterpay() : bool
    {
        return return $this->myAfterpayApi()->canProcessPayment($this->CalculatedPrice());
    }

    protected function myAfterpayApi() : SilverstripeMerchantApi
    {
        return SilverstripeMerchantApi::inst()
            ->setMinAndMaxPrice(
                (float) EcommerceConfig::inst()->AfterpayMinValue,
                (float) EcommerceConfig::inst()->AfterpayMaxValue
            )
            ->setIsServerAvailable(EcommerceConfig::inst()->ShowAfterpayOption);
    }

    public function getAfterpayNumberOfPayments() : int
    {
        return $this->myAfterpayApi()
            ->getNumberOfPayments();
    }

    public function getAfterpayNumberOfPaymentsInWeeks() : int
    {
        return $this->getAfterpayNumberOfPayments() * 2;
    }

    public function getAfterpayAmountPerPayment() :float
    {
        return $this->myAfterpayApi()
            ->getAmountPerPayment($this->CalculatedPrice());
    }

    public function getAfterpayAmountPerPaymentAsMoney() : Money
    {
        return EcommerceCurrency::get_money_object_from_order_currency(
            $this->getAfterpayAmountPerPayment()
        );
    }

    public function getAfterpayAmountPerPaymentAsCurrency(): Currency
    {
        return DBField::create_field('Currency', $this->getAfterpayAmountPerPayment());
    }

}
```

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance61

Regular maintenance activity

Popularity13

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 74.3% 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 ~323 days

Recently: every ~385 days

Total

7

Last Release

37d ago

Major Versions

1.0.1 → 2.0.02023-07-25

2.1.1 → 5.x-dev2026-04-06

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/167154?v=4)[Sunny Side Up](/maintainers/sunnysideup)[@sunnysideup](https://github.com/sunnysideup)

---

Top Contributors

[![sunnysideup](https://avatars.githubusercontent.com/u/167154?v=4)](https://github.com/sunnysideup "sunnysideup (55 commits)")[![tristan-mastrodicasa](https://avatars.githubusercontent.com/u/9061589?v=4)](https://github.com/tristan-mastrodicasa "tristan-mastrodicasa (9 commits)")[![LABCAT](https://avatars.githubusercontent.com/u/9105153?v=4)](https://github.com/LABCAT "LABCAT (7 commits)")[![haseganats](https://avatars.githubusercontent.com/u/71613370?v=4)](https://github.com/haseganats "haseganats (2 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

### Embed Badge

![Health badge](/badges/sunnysideup-afterpay/health.svg)

```
[![Health](https://phpackages.com/badges/sunnysideup-afterpay/health.svg)](https://phpackages.com/packages/sunnysideup-afterpay)
```

###  Alternatives

[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[hubspot/api-client

Hubspot API client

23414.2M16](/packages/hubspot-api-client)

PHPackages © 2026

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