Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
676 lars 1
<?php
2
 
3
namespace Srmklive\PayPal\Traits\PayPalAPI;
4
 
5
trait Disputes
6
{
7
    /**
8
     * List disputes.
9
     *
10
     * @throws \Throwable
11
     *
12
     * @return array|\Psr\Http\Message\StreamInterface|string
13
     *
14
     * @see https://developer.paypal.com/docs/api/customer-disputes/v1/#disputes_list
15
     */
16
    public function listDisputes()
17
    {
18
        $this->apiEndPoint = 'v1/customer/disputes';
19
 
20
        $this->verb = 'get';
21
 
22
        return $this->doPayPalRequest();
23
    }
24
 
25
    /**
26
     * Update a dispute.
27
     *
28
     * @param array  $data
29
     * @param string $dispute_id
30
     *
31
     * @throws \Throwable
32
     *
33
     * @return array|\Psr\Http\Message\StreamInterface|string
34
     *
35
     * @see https://developer.paypal.com/docs/api/customer-disputes/v1/#disputes_patch
36
     */
37
    public function updateDispute(array $data, string $dispute_id)
38
    {
39
        $this->apiEndPoint = "v1/customer/disputes/{$dispute_id}";
40
 
41
        $this->options['json'] = $data;
42
 
43
        $this->verb = 'patch';
44
 
45
        return $this->doPayPalRequest(false);
46
    }
47
 
48
    /**
49
     * Get dispute details.
50
     *
51
     * @param string $dispute_id
52
     *
53
     * @throws \Throwable
54
     *
55
     * @return array|\Psr\Http\Message\StreamInterface|string
56
     *
57
     * @see https://developer.paypal.com/docs/api/customer-disputes/v1/#disputes_get
58
     */
59
    public function showDisputeDetails(string $dispute_id)
60
    {
61
        $this->apiEndPoint = "v1/customer/disputes/{$dispute_id}";
62
 
63
        $this->verb = 'get';
64
 
65
        return $this->doPayPalRequest();
66
    }
67
}