Skip to content
This repository has been archived by the owner on May 30, 2024. It is now read-only.

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
njoguamos committed Jan 28, 2024
1 parent 81681b1 commit 6493dcf
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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 <client_id> 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

Expand Down
2 changes: 2 additions & 0 deletions config/cashapp.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
| The <client id> 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
|
*/
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit 6493dcf

Please sign in to comment.