GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Product::generateLicense()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace ProtoneMedia\LaravelPaddle\Api;
4
5
class Product
6
{
7
    use HandlesCoupons;
8
9
    /**
10
     * https://developer.paddle.com/api-reference/product-api/products/getproducts
11
     */
12
    public function listProducts(array $data = [])
13
    {
14
        return new Request('/2.0/product/get_products', $data);
15
    }
16
17
    /**
18
     * https://developer.paddle.com/api-reference/product-api/licenses/createlicense
19
     */
20
    public function generateLicense(array $data = [])
21
    {
22
        return new Request('/2.0/product/generate_license', $data, [
23
            'product_id'   => 'required|numeric',
24
            'allowed_uses' => 'required|integer',
25
        ]);
26
    }
27
28
    /**
29
     * https://developer.paddle.com/api-reference/product-api/pay-links/createpaylink
30
     */
31
    public function generatePayLink(array $data = [])
32
    {
33
        return new GeneratePayLinkRequest('/2.0/product/generate_pay_link', $data, [
34
            'product_id'                => 'numeric',
35
            'title'                     => 'required_without:product_id',
36
            'webhook_url'               => 'required_without:product_id',
37
            'prices'                    => 'required_without:product_id',
38
            'custom_message'            => 'max:255',
39
            'quantity'                  => 'min:1|max:100',
40
            'recurring_affiliate_limit' => 'min:1',
41
            'customer_email'            => 'email',
42
            'return_url'                => 'url',
43
        ]);
44
    }
45
46
    /**
47
     * https://developer.paddle.com/api-reference/product-api/transactions/listtransactions
48
     */
49
    public function listTransactions($entity, $id, array $data = [])
50
    {
51
        return new Request(sprintf('/2.0/%s/%s/transactions', $entity, $id), $data);
52
    }
53
}
54