ApiOperations
1 year ago
Apps
1 year ago
Billing
1 year ago
BillingPortal
1 year ago
Checkout
1 year ago
Climate
1 year ago
Entitlements
1 year ago
EventData
1 year ago
Events
1 year ago
Exception
1 year ago
FinancialConnections
1 year ago
Forwarding
1 year ago
HttpClient
1 year ago
Identity
1 year ago
Issuing
1 year ago
Radar
1 year ago
Reporting
1 year ago
Service
1 year ago
Sigma
1 year ago
Tax
1 year ago
Terminal
1 year ago
TestHelpers
1 year ago
Treasury
1 year ago
Util
1 year ago
V2
1 year ago
Account.php
1 year ago
AccountLink.php
1 year ago
AccountSession.php
1 year ago
ApiRequestor.php
1 year ago
ApiResource.php
2 years ago
ApiResponse.php
2 years ago
ApplePayDomain.php
1 year ago
Application.php
2 years ago
ApplicationFee.php
1 year ago
ApplicationFeeRefund.php
2 years ago
Balance.php
1 year ago
BalanceTransaction.php
1 year ago
BankAccount.php
1 year ago
BaseStripeClient.php
1 year ago
BaseStripeClientInterface.php
1 year ago
Capability.php
1 year ago
Card.php
1 year ago
CashBalance.php
2 years ago
Charge.php
1 year ago
Collection.php
1 year ago
ConfirmationToken.php
1 year ago
ConnectCollectionTransfer.php
2 years ago
CountrySpec.php
1 year ago
Coupon.php
1 year ago
CreditNote.php
1 year ago
CreditNoteLineItem.php
1 year ago
Customer.php
1 year ago
CustomerBalanceTransaction.php
2 years ago
CustomerCashBalanceTransaction.php
2 years ago
CustomerSession.php
1 year ago
Discount.php
1 year ago
Dispute.php
1 year ago
EphemeralKey.php
1 year ago
ErrorObject.php
1 year ago
Event.php
1 year ago
ExchangeRate.php
1 year ago
File.php
1 year ago
FileLink.php
1 year ago
FundingInstructions.php
2 years ago
Invoice.php
1 year ago
InvoiceItem.php
1 year ago
InvoiceLineItem.php
1 year ago
InvoiceRenderingTemplate.php
1 year ago
LineItem.php
1 year ago
LoginLink.php
1 year ago
Mandate.php
1 year ago
OAuth.php
2 years ago
OAuthErrorObject.php
1 year ago
PaymentIntent.php
1 year ago
PaymentLink.php
1 year ago
PaymentMethod.php
1 year ago
PaymentMethodConfiguration.php
1 year ago
PaymentMethodDomain.php
1 year ago
Payout.php
1 year ago
Person.php
1 year ago
Plan.php
1 year ago
Price.php
1 year ago
Product.php
1 year ago
ProductFeature.php
1 year ago
PromotionCode.php
1 year ago
Quote.php
1 year ago
Reason.php
1 year ago
RecipientTransfer.php
2 years ago
Refund.php
1 year ago
RelatedObject.php
1 year ago
RequestTelemetry.php
2 years ago
ReserveTransaction.php
2 years ago
Review.php
1 year ago
SearchResult.php
1 year ago
SetupAttempt.php
1 year ago
SetupIntent.php
1 year ago
ShippingRate.php
1 year ago
SingletonApiResource.php
2 years ago
Source.php
1 year ago
SourceMandateNotification.php
2 years ago
SourceTransaction.php
2 years ago
Stripe.php
1 year ago
StripeClient.php
1 year ago
StripeClientInterface.php
2 years ago
StripeObject.php
1 year ago
StripeStreamingClientInterface.php
2 years ago
Subscription.php
1 year ago
SubscriptionItem.php
1 year ago
SubscriptionSchedule.php
1 year ago
TaxCode.php
1 year ago
TaxDeductedAtSource.php
2 years ago
TaxId.php
1 year ago
TaxRate.php
1 year ago
ThinEvent.php
1 year ago
Token.php
1 year ago
Topup.php
1 year ago
Transfer.php
1 year ago
TransferReversal.php
1 year ago
UsageRecord.php
1 year ago
UsageRecordSummary.php
1 year ago
Webhook.php
1 year ago
WebhookEndpoint.php
1 year ago
WebhookSignature.php
2 years ago
InvoiceRenderingTemplate.php
90 lines
| 1 | <?php |
| 2 | |
| 3 | // File generated from our OpenAPI spec |
| 4 | namespace WPForms\Vendor\Stripe; |
| 5 | |
| 6 | /** |
| 7 | * Invoice Rendering Templates are used to configure how invoices are rendered on surfaces like the PDF. Invoice Rendering Templates |
| 8 | * can be created from within the Dashboard, and they can be used over the API when creating invoices. |
| 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 $created Time at which the object was created. Measured in seconds since the Unix epoch. |
| 13 | * @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. |
| 14 | * @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. |
| 15 | * @property null|string $nickname A brief description of the template, hidden from customers |
| 16 | * @property string $status The status of the template, one of <code>active</code> or <code>archived</code>. |
| 17 | * @property int $version Version of this template; version increases by one when an update on the template changes any field that controls invoice rendering |
| 18 | */ |
| 19 | class InvoiceRenderingTemplate extends ApiResource |
| 20 | { |
| 21 | const OBJECT_NAME = 'invoice_rendering_template'; |
| 22 | const STATUS_ACTIVE = 'active'; |
| 23 | const STATUS_ARCHIVED = 'archived'; |
| 24 | /** |
| 25 | * List all templates, ordered by creation date, with the most recently created |
| 26 | * template appearing first. |
| 27 | * |
| 28 | * @param null|array $params |
| 29 | * @param null|array|string $opts |
| 30 | * |
| 31 | * @throws \Stripe\Exception\ApiErrorException if the request fails |
| 32 | * |
| 33 | * @return \Stripe\Collection<\Stripe\InvoiceRenderingTemplate> of ApiResources |
| 34 | */ |
| 35 | public static function all($params = null, $opts = null) |
| 36 | { |
| 37 | $url = static::classUrl(); |
| 38 | return static::_requestPage($url, \WPForms\Vendor\Stripe\Collection::class, $params, $opts); |
| 39 | } |
| 40 | /** |
| 41 | * Retrieves an invoice rendering template with the given ID. It by default returns |
| 42 | * the latest version of the template. Optionally, specify a version to see |
| 43 | * previous versions. |
| 44 | * |
| 45 | * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key |
| 46 | * @param null|array|string $opts |
| 47 | * |
| 48 | * @throws \Stripe\Exception\ApiErrorException if the request fails |
| 49 | * |
| 50 | * @return \Stripe\InvoiceRenderingTemplate |
| 51 | */ |
| 52 | public static function retrieve($id, $opts = null) |
| 53 | { |
| 54 | $opts = \WPForms\Vendor\Stripe\Util\RequestOptions::parse($opts); |
| 55 | $instance = new static($id, $opts); |
| 56 | $instance->refresh(); |
| 57 | return $instance; |
| 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\InvoiceRenderingTemplate the archived invoice rendering template |
| 66 | */ |
| 67 | public function archive($params = null, $opts = null) |
| 68 | { |
| 69 | $url = $this->instanceUrl() . '/archive'; |
| 70 | list($response, $opts) = $this->_request('post', $url, $params, $opts); |
| 71 | $this->refreshFrom($response, $opts); |
| 72 | return $this; |
| 73 | } |
| 74 | /** |
| 75 | * @param null|array $params |
| 76 | * @param null|array|string $opts |
| 77 | * |
| 78 | * @throws \Stripe\Exception\ApiErrorException if the request fails |
| 79 | * |
| 80 | * @return \Stripe\InvoiceRenderingTemplate the unarchived invoice rendering template |
| 81 | */ |
| 82 | public function unarchive($params = null, $opts = null) |
| 83 | { |
| 84 | $url = $this->instanceUrl() . '/unarchive'; |
| 85 | list($response, $opts) = $this->_request('post', $url, $params, $opts); |
| 86 | $this->refreshFrom($response, $opts); |
| 87 | return $this; |
| 88 | } |
| 89 | } |
| 90 |