Download the PHP package consilience/starling-payments-objects without Composer

On this page you can find all versions of the php package consilience/starling-payments-objects. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package starling-payments-objects

Build Status Latest Stable Version Total Downloads Latest Unstable Version License

Starling Bank Payments API Objects

This is a package for PHP 8.1 to stuff the response body messages from requests to the Starling Payments API

This package is in development, and has initially covered just the response messages I am particularly interested in. Objects to generate the request message bodies are being added now. The intention is to extend that to include the full PSR-7 message (body, headers, relative path). To support path generation, the contextual UUIDs (e.g. account ID when creating an account address) may need to be added, so the constructors will change.

Additional objects can be submitted by Pull Request if they are something you would like to see.

The request messages are not included in this package for the moment, but they may be in due course. Again, I am happy to accept PRs to hurry this along.

The Approach

The Starling Payments API uses JSON request and response bodies. The JSON responses will decode to nested arrays of scalar values. This package provides classes that instantiate objects from that data.

To start with, the classes are just dumb value objects that take the data in properties. Over time, more logic will be added to the classes to interpret the property values in a higher business sense. In addition, the values will be parsed into more common objects such as Money and Carbon to provide further leverage with the tools and support those libraries come with.

Simple Example

The Previous Payments API can be used to fetch a single payment from an account address through this endpoint:

/api/v1/{paymentBusinessUid}/account/{accountUid}/address/{addressUid}/payment/{paymentUid}

This returns a data structure similar to this example:

Given that data structure as $data, the value object can be instantiated like this:

Each property can then be referenced in a number of ways:

The nested data will in turn be instantiated as value objects:

The instructedAmount will be a CurrencyAndAmount value object. That object supports conversion to Money\Money:

Other objects will have similar conversions. For example, the date and datetime properties can be fetched by appending the name with Carbon to return a Carbon object for the date. For example:

Datetime objects (i.e. timestamps) will be in the timezone they were supplied in. Date objects (without a time) will be returned in the UTC timezone.

That's kind of the wqay it's going, and progress will be documented here as it happens.

Supported Messages

All request messages have namespace Consilience\Starling\Payments\Request.

All response messages have namespace Consilience\Starling\Payments\Response.

The following table lists the requests you can send, and the object to hold the response.

Request Response
CreatePaymentAccount CreatePaymentAccountResponse
CreatePaymentAccountAddress CreatePaymentAccountAddressResponse
CreatePaymentDomestic DomesticPaymentInstructionResponse
CreatePaymentReturn PaymentReturnResponse
GetPayment PaymentDetails
GetPaymentAccount PaymentAccount
GetPaymentAccountAddress PaymentAccountAddress
GetPaymentAccountAddresses PaymentAccountAddressCollection
GetPaymentAccounts PaymentAccountCollection
GetPaymentServiceBusiness BusinessInformation
GetPayments PaymentDetailsCollection
GetSettlementCycle SettlementCycle
GetSettlementCycleCurrent SettlementCycle
GetSettlementCycleLast SettlementCycle
GetSettlementCyclePayments PaymentDetailsCollection
UpdatePaymentAccountAddressStatus ChangeStatusPaymentAccountAddressResponse
GetDirectDebitMandate DirectDebitMandate
GetDirectDebitMandates DirectDebitMandateCollection
ActivateMandateRequest ActivateMandateResponse
CancelMandateRequest CancelMandateResponse
TBC PaymentOriginatingOverseasInstructionResponse

To create a response object, you can instantiate it with either the response body data, or the reponse PSR-7 message. For example:

Building the request objects may include any of the following classes in Consilience\Starling\Payments\Request\Models:

The response messages may contain the following lower-level models:

Webhooks are supported:


All versions of starling-payments-objects with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
nesbot/carbon Version ~1.18|^2.0
psr/http-message Version ^1.0
moneyphp/money Version ^4.0.4
guzzlehttp/psr7 Version ^1.5|^2.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package consilience/starling-payments-objects contains the following files

Loading the files please wait ....