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 DisputesActions
6
{
7
    /**
8
     * Accept customer dispute claim.
9
     *
10
     * @param string $dispute_id
11
     * @param string $dispute_note
12
     * @param array  $data
13
     *
14
     * @throws \Throwable
15
     *
16
     * @return array|\Psr\Http\Message\StreamInterface|string
17
     *
18
     * @see https://developer.paypal.com/docs/api/customer-disputes/v1/#disputes-actions_accept-claim
19
     */
20
    public function acceptDisputeClaim(string $dispute_id, string $dispute_note, array $data = [])
21
    {
22
        $this->apiEndPoint = "v1/customer/disputes/{$dispute_id}/accept-claim";
23
 
24
        $data['note'] = $dispute_note;
25
        $data['accept_claim_type'] = 'REFUND';
26
 
27
        $this->options['json'] = $data;
28
 
29
        $this->verb = 'post';
30
 
31
        return $this->doPayPalRequest();
32
    }
33
 
34
    /**
35
     * Accept offer to resolve dispute.
36
     *
37
     * @param string $dispute_id
38
     * @param string $dispute_note
39
     *
40
     * @throws \Throwable
41
     *
42
     * @return array|\Psr\Http\Message\StreamInterface|string
43
     *
44
     * @see https://developer.paypal.com/docs/api/customer-disputes/v1/#disputes-actions_accept-offer
45
     */
46
    public function acceptDisputeOfferResolution(string $dispute_id, string $dispute_note)
47
    {
48
        $this->apiEndPoint = "v1/customer/disputes/{$dispute_id}/accept-offer";
49
 
50
        $this->options['json'] = [
51
            'note'  => $dispute_note,
52
        ];
53
 
54
        $this->verb = 'post';
55
 
56
        return $this->doPayPalRequest();
57
    }
58
 
59
    /**
60
     * Acknowledge item has been returned.
61
     *
62
     * @param string $dispute_id
63
     * @param string $dispute_note
64
     * @param string $acknowledgement_type
65
     *
66
     * @throws \Throwable
67
     *
68
     * @return array|\Psr\Http\Message\StreamInterface|string
69
     *
70
     * @see https://developer.paypal.com/docs/api/customer-disputes/v1/#disputes-actions_acknowledge-return-item
71
     */
72
    public function acknowledgeItemReturned(string $dispute_id, string $dispute_note, string $acknowledgement_type)
73
    {
74
        $this->apiEndPoint = "v1/customer/disputes/{$dispute_id}/acknowledge-return-item";
75
 
76
        $this->options['json'] = [
77
            'note'                  => $dispute_note,
78
            'acknowledgement_type'  => $acknowledgement_type,
79
        ];
80
 
81
        $this->verb = 'post';
82
 
83
        return $this->doPayPalRequest();
84
    }
85
}