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

stripe / stripe-php / 9308609267

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

push

github

web-flow
Merge pull request #1699 from stripe/latest-codegen-beta

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/InboundTransfer.php
1
<?php
2

3
// File generated from our OpenAPI spec
4

5
namespace Stripe\Treasury;
6

7
/**
8
 * Use <a href="https://stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers">InboundTransfers</a> to add funds to your <a href="https://stripe.com/docs/api#financial_accounts">FinancialAccount</a> via a PaymentMethod that is owned by you. The funds will be transferred via an ACH debit.
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 bool $cancelable Returns <code>true</code> if the InboundTransfer is able to be canceled.
14
 * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
15
 * @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>.
16
 * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users.
17
 * @property null|\Stripe\StripeObject $failure_details Details about this InboundTransfer's failure. Only set when status is <code>failed</code>.
18
 * @property string $financial_account The FinancialAccount that received the funds.
19
 * @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.
20
 * @property \Stripe\StripeObject $linked_flows
21
 * @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.
22
 * @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.
23
 * @property string $origin_payment_method The origin payment method to be debited for an InboundTransfer.
24
 * @property null|\Stripe\StripeObject $origin_payment_method_details Details about the PaymentMethod for an InboundTransfer.
25
 * @property null|bool $returned Returns <code>true</code> if the funds for an InboundTransfer were returned after the InboundTransfer went to the <code>succeeded</code> state.
26
 * @property string $statement_descriptor Statement descriptor shown when funds are debited from the source. Not all payment networks support <code>statement_descriptor</code>.
27
 * @property string $status Status of the InboundTransfer: <code>processing</code>, <code>succeeded</code>, <code>failed</code>, and <code>canceled</code>. An InboundTransfer is <code>processing</code> if it is created and pending. The status changes to <code>succeeded</code> once the funds have been &quot;confirmed&quot; and a <code>transaction</code> is created and posted. The status changes to <code>failed</code> if the transfer fails.
28
 * @property \Stripe\StripeObject $status_transitions
29
 * @property null|string|\Stripe\Treasury\Transaction $transaction The Transaction associated with this object.
30
 */
31
class InboundTransfer extends \Stripe\ApiResource
32
{
33
    const OBJECT_NAME = 'treasury.inbound_transfer';
34

35
    const STATUS_CANCELED = 'canceled';
36
    const STATUS_FAILED = 'failed';
37
    const STATUS_PROCESSING = 'processing';
38
    const STATUS_SUCCEEDED = 'succeeded';
39

40
    /**
41
     * Creates an InboundTransfer.
42
     *
43
     * @param null|array $params
44
     * @param null|array|string $options
45
     *
46
     * @throws \Stripe\Exception\ApiErrorException if the request fails
47
     *
48
     * @return \Stripe\Treasury\InboundTransfer the created resource
49
     */
NEW
50
    public static function create($params = null, $options = null)
×
51
    {
NEW
52
        self::_validateParams($params);
×
NEW
53
        $url = static::classUrl();
×
54

NEW
55
        list($response, $opts) = static::_staticRequest('post', $url, $params, $options);
×
NEW
56
        $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
×
NEW
57
        $obj->setLastResponse($response);
×
58

NEW
59
        return $obj;
×
60
    }
61

62
    /**
63
     * Returns a list of InboundTransfers sent from the specified FinancialAccount.
64
     *
65
     * @param null|array $params
66
     * @param null|array|string $opts
67
     *
68
     * @throws \Stripe\Exception\ApiErrorException if the request fails
69
     *
70
     * @return \Stripe\Collection<\Stripe\Treasury\InboundTransfer> of ApiResources
71
     */
NEW
72
    public static function all($params = null, $opts = null)
×
73
    {
NEW
74
        $url = static::classUrl();
×
75

NEW
76
        return static::_requestPage($url, \Stripe\Collection::class, $params, $opts);
×
77
    }
78

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

NEW
95
        return $instance;
×
96
    }
97

98
    /**
99
     * @param null|array $params
100
     * @param null|array|string $opts
101
     *
102
     * @throws \Stripe\Exception\ApiErrorException if the request fails
103
     *
104
     * @return \Stripe\Treasury\InboundTransfer the canceled inbound transfer
105
     */
106
    public function cancel($params = null, $opts = null)
×
107
    {
108
        $url = $this->instanceUrl() . '/cancel';
×
109
        list($response, $opts) = $this->_request('post', $url, $params, $opts);
×
110
        $this->refreshFrom($response, $opts);
×
111

112
        return $this;
×
113
    }
114
}
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