Exchange::exchange()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace JulianBustamante\Plaid\Resources;
4
5
/**
6
 * The /exchange endpoint allows developers to Exchange a Link public_token for
7
 * an API access_token. A public_token becomes invalidated once it has been
8
 * successfully exchanged for an access_token.
9
 */
10
class Exchange extends ResourceAbstract
11
{
12
    public function exchange($public_token)
13
    {
14
        return $this->handleRequest(function ($client) use ($public_token) {
15
            return $client->post('/item/public_token/exchange', [
16
                'json' => [
17
                        'public_token' => $public_token,
18
                    ] + $this->plaid->getAPIKeys()
19
            ]);
20
        });
21
    }
22
}
23