{"id":37001078,"url":"https://github.com/rentpost/forte-payments-php","last_synced_at":"2026-01-14T00:08:07.044Z","repository":{"id":62534921,"uuid":"150166440","full_name":"rentpost/forte-payments-php","owner":"rentpost","description":"Forte client library written in PHP for version 3 of the REST API","archived":false,"fork":false,"pushed_at":"2025-08-18T04:39:02.000Z","size":297,"stargazers_count":5,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-09-20T09:52:00.092Z","etag":null,"topics":["forte-api","forte-sandbox","php"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rentpost.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-09-24T20:46:29.000Z","updated_at":"2025-08-18T04:39:06.000Z","dependencies_parsed_at":"2024-03-27T04:37:23.657Z","dependency_job_id":"dfcb8d7b-8fed-4fd7-b4ae-56e98a1b2dd3","html_url":"https://github.com/rentpost/forte-payments-php","commit_stats":{"total_commits":172,"total_committers":2,"mean_commits":86.0,"dds":"0.029069767441860517","last_synced_commit":"78c33e9abfd52d96981b1b4beb5e5a29a4d1db92"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/rentpost/forte-payments-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rentpost%2Fforte-payments-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rentpost%2Fforte-payments-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rentpost%2Fforte-payments-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rentpost%2Fforte-payments-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rentpost","download_url":"https://codeload.github.com/rentpost/forte-payments-php/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rentpost%2Fforte-payments-php/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28406481,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T21:51:37.118Z","status":"ssl_error","status_checked_at":"2026-01-13T21:45:14.585Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["forte-api","forte-sandbox","php"],"created_at":"2026-01-14T00:08:06.358Z","updated_at":"2026-01-14T00:08:07.030Z","avatar_url":"https://github.com/rentpost.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Forte API v3 PHP Client Library\n\nForte client library written in PHP for version 3 of the REST API\n\n## Forte API Documentation\n\nhttps://restdocs.forte.net/\n\n## Installation\n\nRun the following command to include this library within your project\n\n```\ncomposer require rentpost/forte-payments-php\n```\n\n## Configuration\n\nYou'll first want to create a configuration file that defines your environments and their respective\nconfiguration settings.  As an example, we're showing a Symfony service container config.  However,\nthis is just passing an array in the following format:\n\n```php\n[\n  'environments' =\u003e [\n    'sandbox' =\u003e [\n      'access_id' =\u003e 'xxxxxxxx',\n      'secure_key' =\u003e 'xxxxxxxx',\n      ...\n    ],\n    'live' =\u003e [\n      'access_id' =\u003e 'xxxxxxxx',\n      'secure_key' =\u003e 'xxxxxxxx',\n      ...\n    ],\n  ],\n]\n```\n\n*It's important to note that Forte's sandbox is quite limited for many resources.  Therefore, it's\npossible to override which environment is used for certain \"sub resources\"\n(API resources/endpoints)*\n\n### Development Environments\n\nAn example Symfony service container yaml configuration for a development environment, using a\n\"livetest\" environemnt with specific sub resource overrides.\n\n```yaml\nparameters:\n  forte_api_client_settings:\n    environments:\n      sandbox:\n        access_id: \"%forte_api_default_access_id%\"\n        secure_key: \"%forte_api_default_secure_key%\"\n        authenticating_organization_id: \"%forte_api_default_authenticating_organization_id%\"\n        sandbox: \"%forte_api_default_sandbox%\"\n        base_uri: ~\n        debug: false\n      livetest:\n        access_id: \"%forte_api_livetest_access_id%\"\n        secure_key: \"%forte_api_livetest_secure_key%\"\n        authenticating_organization_id: \"%forte_api_livetest_authenticating_organization_id%\"\n        sandbox: \"%forte_api_livetest_sandbox%\"\n        base_uri: ~\n        debug: false\n```\n\n### Production Environments\n\nA simple Symfony service container configuration for a production environemtn without any\nnecessary overrides.\n\n```yaml\nparameters:\n  forte_api_client_settings:\n    environments:\n      live:\n        access_id: \"%forte_api_default_access_id%\"\n        secure_key: \"%forte_api_default_secure_key%\"\n        authenticating_organization_id: \"%forte_api_default_authenticating_organization_id%\"\n        sandbox: \"%forte_api_default_sandbox%\"\n        base_uri: ~\n        debug: false\n```\n\n## Usage\n\nHere is an example credit card 'sale' transaction.\n\n### PSR Logger\n\nWe first create a dummy logger.  Feel free to use any PSR compliant logger.  This is used when\ndebugging is enabled in the configuration.  Otherwise, all Exceptions will surface and must be caught.\n\n```php\nuse Psr\\Log\\LoggerInterface;\n\nnamespace Acme\\File;\n\nclass Logger implements LoggerInterface\n{\n\n  public function log($level, $message, array $context = []) {\n    // Handle logging\n  }\n\n  // Other interface methods\n}\n```\n\n### Create Transaction\n\nTo use, you'll want to call the `Rentpost\\ForteApi\\Client\\Factory::make` method which will give you\na `Rentpost\\ForteApi\\Client\\ForteClient` object.  The `ForteClient` object provides access to all\n\"sub resources\" (Forte API endpoint/resources).\n\nThe library makes use of `Model` and `Attribute` objects which assist with validation and\nserialization.  Any complex values will make use of an `Attribute`.  A `Model` is an object\nrepresentation of a Forte API resource and all required and optional parameters.\n\n```php\nuse Acme\\File\\Logger as FileLogger;\nuse Rentpost\\ForteApi\\Attribute;\nuse Rentpost\\ForteApi\\Client\\Factory as ForteApiClientFactory;\nuse Rentpost\\ForteApi\\Exception\\Request\\AbstractRequestException;\nuse Rentpost\\ForteApi\\Model;\n\n// The first parameter is our settings array.  See the \"Configuration\" section\n$settings = [\n  'environments' =\u003e [\n    'sandbox' =\u003e [\n      'access_id' =\u003e 'xxxxxxxx',\n      'secure_key' =\u003e 'xxxxxxxx',\n      ...\n    ],\n    'live' =\u003e [\n      'access_id' =\u003e 'xxxxxxxx',\n      'secure_key' =\u003e 'xxxxxxxx',\n      ...\n    ]\n  ],\n];\n\n$forteClient = new ForteApiClientFactory::make($settings, new FileLogger());\n\n$organizationId = new Attribute\\Id\\OrganizationId('org_123456');\n$locationId = new Attribute\\Id\\LocationId('loc_123456');\n\n$card = new Model\\Card();\n$card-\u003esetCardType('visa')\n  -\u003esetNameOnCard('John Doe')\n  -\u003esetAccountNumber('1234567890')\n  -\u003esetExpireMonth('01')\n  -\u003esetExpireYear('2019')\n  -\u003esetCardVerificationValue('123');\n\n$address = new Model\\PhysicalAddress();\n  -\u003esetStreetLine1('123 Foo St.')\n  -\u003esetStreetLine2('Apt. 123')\n  -\u003esetLocality('New York') // City/town/village\n  -\u003esetRegion('NY') // State or province\n  -\u003esetPostalCode(new Attribute\\PostalCode('12345'));\n\n$transaction = new Model\\Transaction();\n$transaction-\u003esetAction('sale')\n  -\u003esetCard($card) // Or setEcheck for ACH\n  -\u003esetBillingAddress($address)\n  -\u003esetOrderNumber('PO-12345')\n  -\u003esetAuthorizationAmount(new Attribute\\Money('100.00'))\n  -\u003esetCustomerIpAddress(new Attribute\\IpAddress('192.168.0.1'));\n\ntry {\n  $forteClient-\u003euseTransactions()-\u003ecreate(\n    $organizationId,\n    $locationId,\n    $transaction\n  );\n} catch (AbstractRequestException $e) {\n  $logger-\u003elog($e-\u003egetModel()-\u003egetResponse()-\u003egetResponseDesc());\n\n  throw $e;\n}\n\n```\n\n## Testing\n\nThis library makes use of `make` recipes to execute all necessary commands.  To view a list of\nrecipes just execute `make`.\n\n### Requirements\n\nRunning tests against Forte's sandbox environment will not return back any meaningful results for\nmany resources.  Therefore, an additional \"livetest\" account is needed for running various tests.\nThis is a real account.  You could use a production account in place of this (not advised).  But be\naware that, in either case, real money will be moved if used for transaction endpoints.  Forte can\nsetup a \"livetest\" account for you if needed with very low transaction limits to prevent mistakes.\n\nThe following dev composer packages are required for automated testing.\n\n- \"phpunit/phpunit\" (version 7.0+)\n- \"vladahejda/phpunit-assert-exception\" for `assertException` and related trait\n\nPHPUnit is used for both unit tests, and integration test (Testing actual API calls to Forte)\n\n### Configuration\n\nThe integration tests require some settings. This is done via the `test/settings.php` file.  See `test/settings.php.dist` as an example.\n\n### Running\n\nBefore running tests, you'll need to be sure the project is initialized and vendor packages are\ninstalled via `Composer`.  To do so, run `make init` first.  Then you can run tests as follows:\n\n```\nmake test\n```\n\n## Issues / Bugs / Questions\n\nPlease feel free to raise an issue against this repository if you have any questions or problems\n\n## Todo\n\nThere are still a few \"sub resource\" classes (read: Forte endpoints/resources)that haven't been completed/aren't supported yet.  This is simply because we aren't using these.  Feel free to submit these as a pull request, or issue ticket if necessary.\n\n## Contributing\n\nNew contributors to this project are welcome. If you are interested in contributing please\nsend a courtesy email to dev@rentpost.com\n\n## Authors and Maintainers\n\n- Jacob Thomason \u003cjacob@rentpost.com\u003e\n- Sam Anthony \u003csam@expertcoder.io\u003e\n\n## License\n\nThis library is released under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frentpost%2Fforte-payments-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frentpost%2Fforte-payments-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frentpost%2Fforte-payments-php/lists"}