• 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

0.0
/lib/GiftCards/Transaction.php
1
<?php
2

3
// File generated from our OpenAPI spec
4

5
namespace Stripe\GiftCards;
6

7
/**
8
 * A gift card transaction represents a single transaction on a referenced gift card.
9
 * A transaction is in one of three states, <code>confirmed</code>, <code>held</code> or <code>canceled</code>. A <code>confirmed</code>
10
 * transaction is one that has added/deducted funds. A <code>held</code> transaction has created a
11
 * temporary hold on funds, which can then be cancelled or confirmed. A <code>held</code> transaction
12
 * can be confirmed into a <code>confirmed</code> transaction, or canceled into a <code>canceled</code> transaction.
13
 * A <code>canceled</code> transaction has no effect on a gift card's balance.
14
 *
15
 * @property string $id Unique identifier for the object.
16
 * @property string $object String representing the object's type. Objects of the same type share the same value.
17
 * @property null|int $amount The amount of this transaction. A positive value indicates that funds were added to the gift card. A negative value indicates that funds were removed from the gift card.
18
 * @property null|int $confirmed_at Time at which the transaction was confirmed. Measured in seconds since the Unix epoch.
19
 * @property null|int $created Time at which the object was created. Measured in seconds since the Unix epoch.
20
 * @property null|\Stripe\StripeObject $created_by The related Stripe objects that created this gift card transaction.
21
 * @property null|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>.
22
 * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users.
23
 * @property null|string $gift_card The gift card that this transaction occurred on
24
 * @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.
25
 * @property null|string $status Status of this transaction, one of <code>held</code>, <code>confirmed</code>, or <code>canceled</code>.
26
 * @property null|string $transfer_group A string that identifies this transaction as part of a group. See the <a href="https://stripe.com/docs/connect/charges-transfers">Connect documentation</a> for details.
27
 */
28
class Transaction extends \Stripe\ApiResource
29
{
30
    const OBJECT_NAME = 'gift_cards.transaction';
31

32
    use \Stripe\ApiOperations\All;
33
    use \Stripe\ApiOperations\Create;
34
    use \Stripe\ApiOperations\Retrieve;
35
    use \Stripe\ApiOperations\Update;
36

37
    const STATUS_CANCELED = 'canceled';
38
    const STATUS_CONFIRMED = 'confirmed';
39
    const STATUS_HELD = 'held';
40
    const STATUS_INVALID = 'invalid';
41

42
    /**
43
     * @param null|array $params
44
     * @param null|array|string $opts
45
     *
46
     * @throws \Stripe\Exception\ApiErrorException if the request fails
47
     *
48
     * @return \Stripe\GiftCards\Transaction the canceled transaction
49
     */
50
    public function cancel($params = null, $opts = null)
51
    {
52
        $url = $this->instanceUrl() . '/cancel';
×
53
        list($response, $opts) = $this->_request('post', $url, $params, $opts);
×
54
        $this->refreshFrom($response, $opts);
×
55

56
        return $this;
×
57
    }
58

59
    /**
60
     * @param null|array $params
61
     * @param null|array|string $opts
62
     *
63
     * @throws \Stripe\Exception\ApiErrorException if the request fails
64
     *
65
     * @return \Stripe\GiftCards\Transaction the confirmed transaction
66
     */
67
    public function confirm($params = null, $opts = null)
68
    {
69
        $url = $this->instanceUrl() . '/confirm';
×
70
        list($response, $opts) = $this->_request('post', $url, $params, $opts);
×
71
        $this->refreshFrom($response, $opts);
×
72

73
        return $this;
×
74
    }
75
}
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