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

stripe / stripe-php / 9308560111

30 May 2024 08:09PM UTC coverage: 60.343% (-1.0%) from 61.377%
9308560111

Pull #1699

github

web-flow
Merge 73f733810 into 3533dc330
Pull Request #1699: Update generated code for beta

1080 of 1830 new or added lines in 117 files covered. (59.02%)

15 existing lines in 3 files now uncovered.

3486 of 5777 relevant lines covered (60.34%)

2.19 hits per line

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

0.0
/lib/Treasury/CreditReversal.php
1
<?php
2

3
// File generated from our OpenAPI spec
4

5
namespace Stripe\Treasury;
6

7
/**
8
 * You can reverse some <a href="https://stripe.com/docs/api#received_credits">ReceivedCredits</a> depending on their network and source flow. Reversing a ReceivedCredit leads to the creation of a new object known as a CreditReversal.
9
 *
10
 * @property string $id Unique identifier for the object.
11
 * @property string $object String representing the object's type. Objects of the same type share the same value.
12
 * @property int $amount Amount (in cents) transferred.
13
 * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
14
 * @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>.
15
 * @property string $financial_account The FinancialAccount to reverse funds from.
16
 * @property null|string $hosted_regulatory_receipt_url A <a href="https://stripe.com/docs/treasury/moving-money/regulatory-receipts">hosted transaction receipt</a> URL that is provided when money movement is considered regulated under Stripe's money transmission licenses.
17
 * @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
18
 * @property \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.
19
 * @property string $network The rails used to reverse the funds.
20
 * @property string $received_credit The ReceivedCredit being reversed.
21
 * @property string $status Status of the CreditReversal
22
 * @property \Stripe\StripeObject $status_transitions
23
 * @property null|string|\Stripe\Treasury\Transaction $transaction The Transaction associated with this object.
24
 */
25
class CreditReversal extends \Stripe\ApiResource
26
{
27
    const OBJECT_NAME = 'treasury.credit_reversal';
28

29
    const NETWORK_ACH = 'ach';
30
    const NETWORK_STRIPE = 'stripe';
31

32
    const STATUS_CANCELED = 'canceled';
33
    const STATUS_POSTED = 'posted';
34
    const STATUS_PROCESSING = 'processing';
35

36
    /**
37
     * Reverses a ReceivedCredit and creates a CreditReversal object.
38
     *
39
     * @param null|array $params
40
     * @param null|array|string $options
41
     *
42
     * @throws \Stripe\Exception\ApiErrorException if the request fails
43
     *
44
     * @return \Stripe\Treasury\CreditReversal the created resource
45
     */
NEW
46
    public static function create($params = null, $options = null)
×
47
    {
NEW
48
        self::_validateParams($params);
×
NEW
49
        $url = static::classUrl();
×
50

NEW
51
        list($response, $opts) = static::_staticRequest('post', $url, $params, $options);
×
NEW
52
        $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
×
NEW
53
        $obj->setLastResponse($response);
×
54

NEW
55
        return $obj;
×
56
    }
57

58
    /**
59
     * Returns a list of CreditReversals.
60
     *
61
     * @param null|array $params
62
     * @param null|array|string $opts
63
     *
64
     * @throws \Stripe\Exception\ApiErrorException if the request fails
65
     *
66
     * @return \Stripe\Collection<\Stripe\Treasury\CreditReversal> of ApiResources
67
     */
NEW
68
    public static function all($params = null, $opts = null)
×
69
    {
NEW
70
        $url = static::classUrl();
×
71

NEW
72
        return static::_requestPage($url, \Stripe\Collection::class, $params, $opts);
×
73
    }
74

75
    /**
76
     * Retrieves the details of an existing CreditReversal by passing the unique
77
     * CreditReversal ID from either the CreditReversal creation request or
78
     * CreditReversal list.
79
     *
80
     * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
81
     * @param null|array|string $opts
82
     *
83
     * @throws \Stripe\Exception\ApiErrorException if the request fails
84
     *
85
     * @return \Stripe\Treasury\CreditReversal
86
     */
NEW
87
    public static function retrieve($id, $opts = null)
×
88
    {
NEW
89
        $opts = \Stripe\Util\RequestOptions::parse($opts);
×
NEW
90
        $instance = new static($id, $opts);
×
NEW
91
        $instance->refresh();
×
92

NEW
93
        return $instance;
×
94
    }
95
}
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

© 2024 Coveralls, Inc