• 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/Forwarding/Request.php
1
<?php
2

3
// File generated from our OpenAPI spec
4

5
namespace Stripe\Forwarding;
6

7
/**
8
 * Instructs Stripe to make a request on your behalf using the destination URL. The destination URL
9
 * is activated by Stripe at the time of onboarding. Stripe verifies requests with your credentials
10
 * provided during onboarding, and injects card details from the payment_method into the request.
11
 *
12
 * Stripe redacts all sensitive fields and headers, including authentication credentials and card numbers,
13
 * before storing the request and response data in the forwarding Request object, which are subject to a
14
 * 30-day retention period.
15
 *
16
 * You can provide a Stripe idempotency key to make sure that requests with the same key result in only one
17
 * outbound request. The Stripe idempotency key provided should be unique and different from any idempotency
18
 * keys provided on the underlying third-party request.
19
 *
20
 * Forwarding Requests are synchronous requests that return a response or time out according to
21
 * Stripe’s limits.
22
 *
23
 * Related guide: <a href="https://docs.stripe.com/payments/forwarding">Forward card details to third-party API endpoints</a>.
24
 *
25
 * @property string $id Unique identifier for the object.
26
 * @property string $object String representing the object's type. Objects of the same type share the same value.
27
 * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
28
 * @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.
29
 * @property string $payment_method The PaymentMethod to insert into the forwarded request. Forwarding previously consumed PaymentMethods is allowed.
30
 * @property string[] $replacements The field kinds to be replaced in the forwarded request.
31
 * @property null|\Stripe\StripeObject $request_context Context about the request from Stripe's servers to the destination endpoint.
32
 * @property null|\Stripe\StripeObject $request_details The request that was sent to the destination endpoint. We redact any sensitive fields.
33
 * @property null|\Stripe\StripeObject $response_details The response that the destination endpoint returned to us. We redact any sensitive fields.
34
 * @property null|string $url The destination URL for the forwarded request. Must be supported by the config.
35
 */
36
class Request extends \Stripe\ApiResource
37
{
38
    const OBJECT_NAME = 'forwarding.request';
39

40
    /**
41
     * Creates a ForwardingRequest object.
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\Forwarding\Request 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
     * Lists all ForwardingRequest objects.
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\Forwarding\Request> 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 a ForwardingRequest object.
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\Forwarding\Request
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
}
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