Skip to content

Commit ce4f40f

Browse files
authored
[2.x] Use proper API Key naming (#233)
* Use proper API Key naming * wip
1 parent 8200399 commit ce4f40f

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Copy the default file using `cp phpunit.xml.dist phpunit.xml` and add the follow
1010

1111
<env name="PADDLE_SANDBOX" value="true"/>
1212
<env name="PADDLE_SELLER_ID" value="Your Paddle seller ID"/>
13-
<env name="PADDLE_AUTH_CODE" value="Your Paddle auth code"/>
13+
<env name="PADDLE_API_KEY" value="Your Paddle api key"/>
1414
<env name="PADDLE_TEST_PRICE" value="Identifier for a random one off price"/>
1515

1616
After setting these variables, you can run your tests by executing the `vendor/bin/phpunit` command.

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@ jobs:
4343
run: vendor/bin/phpunit
4444
env:
4545
PADDLE_SELLER_ID: ${{ secrets.PADDLE_SELLER_ID }}
46-
PADDLE_AUTH_CODE: ${{ secrets.PADDLE_AUTH_CODE }}
46+
PADDLE_API_KEY: ${{ secrets.PADDLE_API_KEY }}
4747
PADDLE_WEBHOOK_SECRET: ${{ secrets.PADDLE_WEBHOOK_SECRET }}
4848
PADDLE_TEST_PRICE: ${{ secrets.PADDLE_TEST_PRICE }}

config/cashier.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
| Paddle Keys
88
|--------------------------------------------------------------------------
99
|
10-
| The Paddle seller ID and auth code will allow your application to call
11-
| the Paddle API. The "public" key is typically used when interacting
12-
| with Paddle.js while the "secret" key accesses private endpoints.
10+
| The Paddle seller ID and API key will allow your application to call
11+
| the Paddle API. The seller key is typically used when interacting
12+
| with Paddle.js, while the "API" key accesses private endpoints.
1313
|
1414
*/
1515

1616
'seller_id' => env('PADDLE_SELLER_ID'),
1717

18-
'auth_code' => env('PADDLE_AUTH_CODE'),
18+
'api_key' => env('PADDLE_AUTH_CODE') ?? env('PADDLE_API_KEY'),
1919

2020
'retain_key' => env('PADDLE_RETAIN_KEY'),
2121

phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
</testsuites>
1919
<php>
2020
<env name="DB_CONNECTION" value="testing"/>
21-
<env name="PADDLE_AUTH_CODE" value="fake"/>
21+
<env name="PADDLE_API_KEY" value="fake"/>
2222
<env name="PADDLE_SANDBOX" value="true"/>
2323
</php>
2424
</phpunit>

src/Cashier.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public static function webhookUrl()
115115
*/
116116
public static function api($method, $uri, array $payload = [])
117117
{
118-
if (empty($apiKey = config('cashier.auth_code'))) {
118+
if (empty($apiKey = config('cashier.api_key', config('cashier.auth_code')))) {
119119
throw new Exception('Paddle API key not set.');
120120
}
121121

0 commit comments

Comments
 (0)