Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/wp-conte.../plugins/wpforms-.../vendor_p.../stripe/stripe-p.../lib
File: CreditNote.php
<?php
[0] Fix | Delete
[1] Fix | Delete
// File generated from our OpenAPI spec
[2] Fix | Delete
namespace WPForms\Vendor\Stripe;
[3] Fix | Delete
[4] Fix | Delete
/**
[5] Fix | Delete
* Issue a credit note to adjust an invoice's amount after the invoice is finalized.
[6] Fix | Delete
*
[7] Fix | Delete
* Related guide: <a href="https://stripe.com/docs/billing/invoices/credit-notes">Credit notes</a>
[8] Fix | Delete
*
[9] Fix | Delete
* @property string $id Unique identifier for the object.
[10] Fix | Delete
* @property string $object String representing the object's type. Objects of the same type share the same value.
[11] Fix | Delete
* @property int $amount The integer amount in cents (or local equivalent) representing the total amount of the credit note, including tax.
[12] Fix | Delete
* @property int $amount_shipping This is the sum of all the shipping amounts.
[13] Fix | Delete
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
[14] Fix | Delete
* @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>.
[15] Fix | Delete
* @property string|\Stripe\Customer $customer ID of the customer.
[16] Fix | Delete
* @property null|string|\Stripe\CustomerBalanceTransaction $customer_balance_transaction Customer balance transaction related to this credit note.
[17] Fix | Delete
* @property int $discount_amount The integer amount in cents (or local equivalent) representing the total amount of discount that was credited.
[18] Fix | Delete
* @property \Stripe\StripeObject[] $discount_amounts The aggregate amounts calculated per discount for all line items.
[19] Fix | Delete
* @property null|int $effective_at The date when this credit note is in effect. Same as <code>created</code> unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the credit note PDF.
[20] Fix | Delete
* @property string|\Stripe\Invoice $invoice ID of the invoice.
[21] Fix | Delete
* @property \Stripe\Collection<\Stripe\CreditNoteLineItem> $lines Line items that make up the credit note
[22] Fix | Delete
* @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.
[23] Fix | Delete
* @property null|string $memo Customer-facing text that appears on the credit note PDF.
[24] Fix | Delete
* @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] Fix | Delete
* @property string $number A unique number that identifies this particular credit note and appears on the PDF of the credit note and its associated invoice.
[26] Fix | Delete
* @property null|int $out_of_band_amount Amount that was credited outside of Stripe.
[27] Fix | Delete
* @property string $pdf The link to download the PDF of the credit note.
[28] Fix | Delete
* @property null|string $reason Reason for issuing this credit note, one of <code>duplicate</code>, <code>fraudulent</code>, <code>order_change</code>, or <code>product_unsatisfactory</code>
[29] Fix | Delete
* @property null|string|\Stripe\Refund $refund Refund related to this credit note.
[30] Fix | Delete
* @property null|\Stripe\StripeObject $shipping_cost The details of the cost of shipping, including the ShippingRate applied to the invoice.
[31] Fix | Delete
* @property string $status Status of this credit note, one of <code>issued</code> or <code>void</code>. Learn more about <a href="https://stripe.com/docs/billing/invoices/credit-notes#voiding">voiding credit notes</a>.
[32] Fix | Delete
* @property int $subtotal The integer amount in cents (or local equivalent) representing the amount of the credit note, excluding exclusive tax and invoice level discounts.
[33] Fix | Delete
* @property null|int $subtotal_excluding_tax The integer amount in cents (or local equivalent) representing the amount of the credit note, excluding all tax and invoice level discounts.
[34] Fix | Delete
* @property \Stripe\StripeObject[] $tax_amounts The aggregate amounts calculated per tax rate for all line items.
[35] Fix | Delete
* @property int $total The integer amount in cents (or local equivalent) representing the total amount of the credit note, including tax and all discount.
[36] Fix | Delete
* @property null|int $total_excluding_tax The integer amount in cents (or local equivalent) representing the total amount of the credit note, excluding tax, but including discounts.
[37] Fix | Delete
* @property string $type Type of this credit note, one of <code>pre_payment</code> or <code>post_payment</code>. A <code>pre_payment</code> credit note means it was issued when the invoice was open. A <code>post_payment</code> credit note means it was issued when the invoice was paid.
[38] Fix | Delete
* @property null|int $voided_at The time that the credit note was voided.
[39] Fix | Delete
*/
[40] Fix | Delete
class CreditNote extends ApiResource
[41] Fix | Delete
{
[42] Fix | Delete
const OBJECT_NAME = 'credit_note';
[43] Fix | Delete
use ApiOperations\All;
[44] Fix | Delete
use ApiOperations\Create;
[45] Fix | Delete
use ApiOperations\NestedResource;
[46] Fix | Delete
use ApiOperations\Retrieve;
[47] Fix | Delete
use ApiOperations\Update;
[48] Fix | Delete
const REASON_DUPLICATE = 'duplicate';
[49] Fix | Delete
const REASON_FRAUDULENT = 'fraudulent';
[50] Fix | Delete
const REASON_ORDER_CHANGE = 'order_change';
[51] Fix | Delete
const REASON_PRODUCT_UNSATISFACTORY = 'product_unsatisfactory';
[52] Fix | Delete
const STATUS_ISSUED = 'issued';
[53] Fix | Delete
const STATUS_VOID = 'void';
[54] Fix | Delete
const TYPE_POST_PAYMENT = 'post_payment';
[55] Fix | Delete
const TYPE_PRE_PAYMENT = 'pre_payment';
[56] Fix | Delete
/**
[57] Fix | Delete
* @param null|array $params
[58] Fix | Delete
* @param null|array|string $opts
[59] Fix | Delete
*
[60] Fix | Delete
* @throws \Stripe\Exception\ApiErrorException if the request fails
[61] Fix | Delete
*
[62] Fix | Delete
* @return \Stripe\CreditNote the previewed credit note
[63] Fix | Delete
*/
[64] Fix | Delete
public static function preview($params = null, $opts = null)
[65] Fix | Delete
{
[66] Fix | Delete
$url = static::classUrl() . '/preview';
[67] Fix | Delete
list($response, $opts) = static::_staticRequest('get', $url, $params, $opts);
[68] Fix | Delete
$obj = \WPForms\Vendor\Stripe\Util\Util::convertToStripeObject($response->json, $opts);
[69] Fix | Delete
$obj->setLastResponse($response);
[70] Fix | Delete
return $obj;
[71] Fix | Delete
}
[72] Fix | Delete
/**
[73] Fix | Delete
* @param null|array $params
[74] Fix | Delete
* @param null|array|string $opts
[75] Fix | Delete
*
[76] Fix | Delete
* @throws \Stripe\Exception\ApiErrorException if the request fails
[77] Fix | Delete
*
[78] Fix | Delete
* @return \Stripe\Collection<\Stripe\CreditNoteLineItem> list of credit note line items
[79] Fix | Delete
*/
[80] Fix | Delete
public static function previewLines($params = null, $opts = null)
[81] Fix | Delete
{
[82] Fix | Delete
$url = static::classUrl() . '/preview/lines';
[83] Fix | Delete
list($response, $opts) = static::_staticRequest('get', $url, $params, $opts);
[84] Fix | Delete
$obj = \WPForms\Vendor\Stripe\Util\Util::convertToStripeObject($response->json, $opts);
[85] Fix | Delete
$obj->setLastResponse($response);
[86] Fix | Delete
return $obj;
[87] Fix | Delete
}
[88] Fix | Delete
/**
[89] Fix | Delete
* @param null|array $params
[90] Fix | Delete
* @param null|array|string $opts
[91] Fix | Delete
*
[92] Fix | Delete
* @throws \Stripe\Exception\ApiErrorException if the request fails
[93] Fix | Delete
*
[94] Fix | Delete
* @return \Stripe\CreditNote the voided credit note
[95] Fix | Delete
*/
[96] Fix | Delete
public function voidCreditNote($params = null, $opts = null)
[97] Fix | Delete
{
[98] Fix | Delete
$url = $this->instanceUrl() . '/void';
[99] Fix | Delete
list($response, $opts) = $this->_request('post', $url, $params, $opts);
[100] Fix | Delete
$this->refreshFrom($response, $opts);
[101] Fix | Delete
return $this;
[102] Fix | Delete
}
[103] Fix | Delete
const PATH_LINES = '/lines';
[104] Fix | Delete
/**
[105] Fix | Delete
* @param string $id the ID of the credit note on which to retrieve the credit note line items
[106] Fix | Delete
* @param null|array $params
[107] Fix | Delete
* @param null|array|string $opts
[108] Fix | Delete
*
[109] Fix | Delete
* @throws \Stripe\Exception\ApiErrorException if the request fails
[110] Fix | Delete
*
[111] Fix | Delete
* @return \Stripe\Collection<\Stripe\CreditNoteLineItem> the list of credit note line items
[112] Fix | Delete
*/
[113] Fix | Delete
public static function allLines($id, $params = null, $opts = null)
[114] Fix | Delete
{
[115] Fix | Delete
return self::_allNestedResources($id, static::PATH_LINES, $params, $opts);
[116] Fix | Delete
}
[117] Fix | Delete
}
[118] Fix | Delete
[119] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function