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

stripe / stripe-php / 9308533534

30 May 2024 08:07PM UTC coverage: 65.24% (-0.9%) from 66.176%
9308533534

push

github

web-flow
Added PHPDocs for `create`, `update`, `delete`, `all`, `retrieve` methods after moving them out of traits.  (#1701)

* Demagiced crudl operation

* Improvements from codegen#1452

* Updated override to fix indents

1080 of 1682 new or added lines in 106 files covered. (64.21%)

15 existing lines in 3 files now uncovered.

3444 of 5279 relevant lines covered (65.24%)

2.29 hits per line

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

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

3
// File generated from our OpenAPI spec
4

5
namespace Stripe\Treasury;
6

7
/**
8
 * Use OutboundTransfers to transfer funds from a <a href="https://stripe.com/docs/api#financial_accounts">FinancialAccount</a> to a PaymentMethod belonging to the same entity. To send funds to a different party, use <a href="https://stripe.com/docs/api#outbound_payments">OutboundPayments</a> instead. You can send funds over ACH rails or through a domestic wire transfer to a user's own external bank account.
9
 *
10
 * Simulate OutboundTransfer state changes with the <code>/v1/test_helpers/treasury/outbound_transfers</code> endpoints. These methods can only be called on test mode objects.
11
 *
12
 * @property string $id Unique identifier for the object.
13
 * @property string $object String representing the object's type. Objects of the same type share the same value.
14
 * @property int $amount Amount (in cents) transferred.
15
 * @property bool $cancelable Returns <code>true</code> if the object can be canceled, and <code>false</code> otherwise.
16
 * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
17
 * @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>.
18
 * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users.
19
 * @property null|string $destination_payment_method The PaymentMethod used as the payment instrument for an OutboundTransfer.
20
 * @property \Stripe\StripeObject $destination_payment_method_details
21
 * @property int $expected_arrival_date The date when funds are expected to arrive in the destination account.
22
 * @property string $financial_account The FinancialAccount that funds were pulled from.
23
 * @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.
24
 * @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.
25
 * @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.
26
 * @property null|\Stripe\StripeObject $returned_details Details about a returned OutboundTransfer. Only set when the status is <code>returned</code>.
27
 * @property string $statement_descriptor Information about the OutboundTransfer to be sent to the recipient account.
28
 * @property string $status Current status of the OutboundTransfer: <code>processing</code>, <code>failed</code>, <code>canceled</code>, <code>posted</code>, <code>returned</code>. An OutboundTransfer is <code>processing</code> if it has been created and is pending. The status changes to <code>posted</code> once the OutboundTransfer has been &quot;confirmed&quot; and funds have left the account, or to <code>failed</code> or <code>canceled</code>. If an OutboundTransfer fails to arrive at its destination, its status will change to <code>returned</code>.
29
 * @property \Stripe\StripeObject $status_transitions
30
 * @property null|\Stripe\StripeObject $tracking_details Details about network-specific tracking information if available.
31
 * @property string|\Stripe\Treasury\Transaction $transaction The Transaction associated with this object.
32
 */
33
class OutboundTransfer extends \Stripe\ApiResource
34
{
35
    const OBJECT_NAME = 'treasury.outbound_transfer';
36

37
    const STATUS_CANCELED = 'canceled';
38
    const STATUS_FAILED = 'failed';
39
    const STATUS_POSTED = 'posted';
40
    const STATUS_PROCESSING = 'processing';
41
    const STATUS_RETURNED = 'returned';
42

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

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

NEW
62
        return $obj;
×
63
    }
64

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

NEW
79
        return static::_requestPage($url, \Stripe\Collection::class, $params, $opts);
×
80
    }
81

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

NEW
100
        return $instance;
×
101
    }
102

103
    /**
104
     * @param null|array $params
105
     * @param null|array|string $opts
106
     *
107
     * @throws \Stripe\Exception\ApiErrorException if the request fails
108
     *
109
     * @return \Stripe\Treasury\OutboundTransfer the canceled outbound transfer
110
     */
111
    public function cancel($params = null, $opts = null)
×
112
    {
113
        $url = $this->instanceUrl() . '/cancel';
×
114
        list($response, $opts) = $this->_request('post', $url, $params, $opts);
×
115
        $this->refreshFrom($response, $opts);
×
116

117
        return $this;
×
118
    }
119
}
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