From 6493dcf3a31422f854f14e52a9c86c7ab2f9f0c8 Mon Sep 17 00:00:00 2001 From: Njogu Amos <29255728+njoguamos@users.noreply.github.com> Date: Sun, 28 Jan 2024 14:42:48 +0300 Subject: [PATCH] Update readme --- README.md | 15 +++++++++++++-- config/cashapp.php | 2 ++ tests/TestCase.php | 2 +- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 030cac2..2a80bc6 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,8 @@ # A laravel package scaffolding Cash App API. ## Why Use this Package? -1. The requests are automatically signed + +1. All requests to the Network and Management APIs are automatically [signed](https://developers.cash.app/docs/api/technical-documentation/api-fundamentals/requests/signing-requests). ## Installation @@ -40,12 +41,22 @@ You can publish the config file with: php artisan vendor:publish --tag="laravel-cashapp-config" ``` -You need to understand the following keys in the config +You need to understand ande the following keys in the environment variables in your application. | Key | type | required | default | description | |----------------------|----------|----------|---------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `CASHAPP_PRODUCTION` | `boolen` | `false` | `false` | Determine if production or staging api should be used. The default is `false` to avoid tampering with production api by accident. | | `CASHAPP_REGION` | `string` | `false` | `PDX` | A character code representing the region closest to where your own services are hosted. Must be [supported regions](https://developers.cash.app/docs/api/technical-documentation/api-fundamentals/requests/regions-and-localization#supported-region--iata-airport-codes). An `InvalidRegionException` exception is thrown if an invalid code is provided. | +| `CASHAPP_CLIENT_ID` | `string` | `true` | `null` | Here you specify the associated with your cash app account. | + + +Example in your `.env` +```dotenv +CASHAPP_PRODUCTION=true +CASHAPP_REGION=ATL #Atlanta, United States +CASHAPP_CLIENT_ID=CS-CI_ACKIl7VOyOUwAg... +``` + ## Usage diff --git a/config/cashapp.php b/config/cashapp.php index e1a4e36..cbb2d37 100644 --- a/config/cashapp.php +++ b/config/cashapp.php @@ -25,6 +25,8 @@ | The is use to construct the authorisation header. The | client ID can be shared with the customers' browsers or POS. | + | Starts with `CAS-CI_` for sandbox and `CA-CI_` for production. + | | @see https://developers.cash.app/docs/api/technical-documentation%2Fapi-fundamentals%2Frequests%2Fmaking-requests#authorization | */ diff --git a/tests/TestCase.php b/tests/TestCase.php index aa60173..06fd35a 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -27,7 +27,7 @@ protected function getPackageProviders($app): array public function getEnvironmentSetUp($app): void { config()->set('database.default', 'testing'); - config()->set('cashapp.client_id', 'ACKIl7VOyOUwAgCzTYF1+B+A9sfq0kIGTy+Z43wENpw='); + config()->set('cashapp.client_id', 'CAS-CI_ACKIl7VOyOUwAgCzTYF1+B+A9sfq0kIGTy+Z43wENpw'); /* $migration = include __DIR__.'/../database/migrations/create_laravel-cashapp_table.php.stub';