• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stripe / stripe-php / #7087

pending completion
#7087

push

php-coveralls

pakrym-stripe
Bump version to 10.14.0-beta.2

1831 of 2732 relevant lines covered (67.02%)

3.81 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

66.67
/lib/TransferReversal.php
1
<?php
2

3
// File generated from our OpenAPI spec
4

5
namespace Stripe;
6

7
/**
8
 * <a href="https://stripe.com/docs/connect">Stripe Connect</a> platforms can reverse transfers made to a
9
 * connected account, either entirely or partially, and can also specify whether
10
 * to refund any related application fees. Transfer reversals add to the
11
 * platform's balance and subtract from the destination account's balance.
12
 *
13
 * Reversing a transfer that was made for a <a href="/docs/connect/destination-charges">destination
14
 * charge</a> is allowed only up to the amount of
15
 * the charge. It is possible to reverse a
16
 * <a href="https://stripe.com/docs/connect/charges-transfers#transfer-options">transfer_group</a>
17
 * transfer only if the destination account has enough balance to cover the
18
 * reversal.
19
 *
20
 * Related guide: <a href="https://stripe.com/docs/connect/charges-transfers#reversing-transfers">Reversing transfers</a>
21
 *
22
 * @property string $id Unique identifier for the object.
23
 * @property string $object String representing the object's type. Objects of the same type share the same value.
24
 * @property int $amount Amount, in %s.
25
 * @property null|string|\Stripe\BalanceTransaction $balance_transaction Balance transaction that describes the impact on your account balance.
26
 * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
27
 * @property string $currency Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
28
 * @property null|string|\Stripe\Refund $destination_payment_refund Linked payment refund for the transfer reversal.
29
 * @property null|\Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
30
 * @property null|string|\Stripe\Refund $source_refund ID of the refund responsible for the transfer reversal.
31
 * @property string|\Stripe\Transfer $transfer ID of the transfer that was reversed.
32
 */
33
class TransferReversal extends ApiResource
34
{
35
    const OBJECT_NAME = 'transfer_reversal';
36

37
    use ApiOperations\Update {
38
        save as protected _save;
39
    }
40

41
    /**
42
     * @return string the API URL for this Stripe transfer reversal
43
     */
44
    public function instanceUrl()
45
    {
46
        $id = $this['id'];
1✔
47
        $transfer = $this['transfer'];
1✔
48
        if (!$id) {
1✔
49
            throw new Exception\UnexpectedValueException(
×
50
                'Could not determine which URL to request: ' .
×
51
                "class instance has invalid ID: {$id}",
×
52
                null
×
53
            );
×
54
        }
55
        $id = Util\Util::utf8($id);
1✔
56
        $transfer = Util\Util::utf8($transfer);
1✔
57

58
        $base = Transfer::classUrl();
1✔
59
        $transferExtn = \urlencode($transfer);
1✔
60
        $extn = \urlencode($id);
1✔
61

62
        return "{$base}/{$transferExtn}/reversals/{$extn}";
1✔
63
    }
64

65
    /**
66
     * @param null|array|string $opts
67
     *
68
     * @throws \Stripe\Exception\ApiErrorException if the request fails
69
     *
70
     * @return TransferReversal the saved reversal
71
     */
72
    public function save($opts = null)
73
    {
74
        return $this->_save($opts);
1✔
75
    }
76
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc