code
stringlengths 15
9.96M
| docstring
stringlengths 1
10.1k
| func_name
stringlengths 1
124
| language
stringclasses 1
value | repo
stringlengths 7
63
| path
stringlengths 6
186
| url
stringlengths 50
236
| license
stringclasses 4
values |
---|---|---|---|---|---|---|---|
public static function update($params = null, $opts = null)
{
self::_validateParams($params);
$url = '/v1/tax/settings';
list($response, $opts) = static::_staticRequest('post', $url, $params, $opts);
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
$obj->setLastResponse($response);
return $obj;
} | @param null|array $params
@param null|array|string $opts
@return static the updated resource
@throws \Stripe\Exception\ApiErrorException if the request fails | update | php | stripe/stripe-php | lib/Tax/Settings.php | https://github.com/stripe/stripe-php/blob/master/lib/Tax/Settings.php | MIT |
public function save($opts = null)
{
$params = $this->serializeParameters();
if (\count($params) > 0) {
$url = $this->instanceUrl();
list($response, $opts) = $this->_request('post', $url, $params, $opts, ['save']);
$this->refreshFrom($response, $opts);
}
return $this;
} | @param null|array|string $opts
@return static the saved resource
@throws \Stripe\Exception\ApiErrorException if the request fails
@deprecated The `save` method is deprecated and will be removed in a
future major version of the library. Use the static method `update`
on the resource instead. | save | php | stripe/stripe-php | lib/Tax/Settings.php | https://github.com/stripe/stripe-php/blob/master/lib/Tax/Settings.php | MIT |
public static function create($params = null, $options = null)
{
self::_validateParams($params);
$url = static::classUrl();
list($response, $opts) = static::_staticRequest('post', $url, $params, $options);
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
$obj->setLastResponse($response);
return $obj;
} | Creates a new Tax <code>Registration</code> object.
@param null|array{active_from: array|int|string, country: string, country_options: array{ae?: array{type: string}, al?: array{type: string}, am?: array{type: string}, ao?: array{type: string}, at?: array{standard?: array{place_of_supply_scheme: string}, type: string}, au?: array{type: string}, aw?: array{type: string}, az?: array{type: string}, ba?: array{type: string}, bb?: array{type: string}, bd?: array{type: string}, be?: array{standard?: array{place_of_supply_scheme: string}, type: string}, bf?: array{type: string}, bg?: array{standard?: array{place_of_supply_scheme: string}, type: string}, bh?: array{type: string}, bj?: array{type: string}, bs?: array{type: string}, by?: array{type: string}, ca?: array{province_standard?: array{province: string}, type: string}, cd?: array{type: string}, ch?: array{type: string}, cl?: array{type: string}, cm?: array{type: string}, co?: array{type: string}, cr?: array{type: string}, cv?: array{type: string}, cy?: array{standard?: array{place_of_supply_scheme: string}, type: string}, cz?: array{standard?: array{place_of_supply_scheme: string}, type: string}, de?: array{standard?: array{place_of_supply_scheme: string}, type: string}, dk?: array{standard?: array{place_of_supply_scheme: string}, type: string}, ec?: array{type: string}, ee?: array{standard?: array{place_of_supply_scheme: string}, type: string}, eg?: array{type: string}, es?: array{standard?: array{place_of_supply_scheme: string}, type: string}, et?: array{type: string}, fi?: array{standard?: array{place_of_supply_scheme: string}, type: string}, fr?: array{standard?: array{place_of_supply_scheme: string}, type: string}, gb?: array{type: string}, ge?: array{type: string}, gn?: array{type: string}, gr?: array{standard?: array{place_of_supply_scheme: string}, type: string}, hr?: array{standard?: array{place_of_supply_scheme: string}, type: string}, hu?: array{standard?: array{place_of_supply_scheme: string}, type: string}, id?: array{type: string}, ie?: array{standard?: array{place_of_supply_scheme: string}, type: string}, in?: array{type: string}, is?: array{type: string}, it?: array{standard?: array{place_of_supply_scheme: string}, type: string}, jp?: array{type: string}, ke?: array{type: string}, kg?: array{type: string}, kh?: array{type: string}, kr?: array{type: string}, kz?: array{type: string}, la?: array{type: string}, lt?: array{standard?: array{place_of_supply_scheme: string}, type: string}, lu?: array{standard?: array{place_of_supply_scheme: string}, type: string}, lv?: array{standard?: array{place_of_supply_scheme: string}, type: string}, ma?: array{type: string}, md?: array{type: string}, me?: array{type: string}, mk?: array{type: string}, mr?: array{type: string}, mt?: array{standard?: array{place_of_supply_scheme: string}, type: string}, mx?: array{type: string}, my?: array{type: string}, ng?: array{type: string}, nl?: array{standard?: array{place_of_supply_scheme: string}, type: string}, no?: array{type: string}, np?: array{type: string}, nz?: array{type: string}, om?: array{type: string}, pe?: array{type: string}, ph?: array{type: string}, pl?: array{standard?: array{place_of_supply_scheme: string}, type: string}, pt?: array{standard?: array{place_of_supply_scheme: string}, type: string}, ro?: array{standard?: array{place_of_supply_scheme: string}, type: string}, rs?: array{type: string}, ru?: array{type: string}, sa?: array{type: string}, se?: array{standard?: array{place_of_supply_scheme: string}, type: string}, sg?: array{type: string}, si?: array{standard?: array{place_of_supply_scheme: string}, type: string}, sk?: array{standard?: array{place_of_supply_scheme: string}, type: string}, sn?: array{type: string}, sr?: array{type: string}, th?: array{type: string}, tj?: array{type: string}, tr?: array{type: string}, tz?: array{type: string}, ug?: array{type: string}, us?: array{local_amusement_tax?: array{jurisdiction: string}, local_lease_tax?: array{jurisdiction: string}, state: string, state_sales_tax?: array{elections: array{jurisdiction?: string, type: string}[]}, type: string}, uy?: array{type: string}, uz?: array{type: string}, vn?: array{type: string}, za?: array{type: string}, zm?: array{type: string}, zw?: array{type: string}}, expand?: string[], expires_at?: int} $params
@param null|array|string $options
@return Registration the created resource
@throws \Stripe\Exception\ApiErrorException if the request fails | create | php | stripe/stripe-php | lib/Tax/Registration.php | https://github.com/stripe/stripe-php/blob/master/lib/Tax/Registration.php | MIT |
public static function all($params = null, $opts = null)
{
$url = static::classUrl();
return static::_requestPage($url, \Stripe\Collection::class, $params, $opts);
} | Returns a list of Tax <code>Registration</code> objects.
@param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string, status?: string} $params
@param null|array|string $opts
@return \Stripe\Collection<Registration> of ApiResources
@throws \Stripe\Exception\ApiErrorException if the request fails | all | php | stripe/stripe-php | lib/Tax/Registration.php | https://github.com/stripe/stripe-php/blob/master/lib/Tax/Registration.php | MIT |
public static function retrieve($id, $opts = null)
{
$opts = \Stripe\Util\RequestOptions::parse($opts);
$instance = new static($id, $opts);
$instance->refresh();
return $instance;
} | Returns a Tax <code>Registration</code> object.
@param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
@param null|array|string $opts
@return Registration
@throws \Stripe\Exception\ApiErrorException if the request fails | retrieve | php | stripe/stripe-php | lib/Tax/Registration.php | https://github.com/stripe/stripe-php/blob/master/lib/Tax/Registration.php | MIT |
public static function update($id, $params = null, $opts = null)
{
self::_validateParams($params);
$url = static::resourceUrl($id);
list($response, $opts) = static::_staticRequest('post', $url, $params, $opts);
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
$obj->setLastResponse($response);
return $obj;
} | Updates an existing Tax <code>Registration</code> object.
A registration cannot be deleted after it has been created. If you wish to end a
registration you may do so by setting <code>expires_at</code>.
@param string $id the ID of the resource to update
@param null|array{active_from?: array|int|string, expand?: string[], expires_at?: null|array|int|string} $params
@param null|array|string $opts
@return Registration the updated resource
@throws \Stripe\Exception\ApiErrorException if the request fails | update | php | stripe/stripe-php | lib/Tax/Registration.php | https://github.com/stripe/stripe-php/blob/master/lib/Tax/Registration.php | MIT |
public static function create($params = null, $options = null)
{
self::_validateParams($params);
$url = static::classUrl();
list($response, $opts) = static::_staticRequest('post', $url, $params, $options);
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
$obj->setLastResponse($response);
return $obj;
} | Calculates tax based on the input and returns a Tax <code>Calculation</code>
object.
@param null|array{currency: string, customer?: string, customer_details?: array{address?: array{city?: null|string, country: string, line1?: null|string, line2?: null|string, postal_code?: null|string, state?: null|string}, address_source?: string, ip_address?: string, tax_ids?: array{type: string, value: string}[], taxability_override?: string}, expand?: string[], line_items: array{amount: int, product?: string, quantity?: int, reference?: string, tax_behavior?: string, tax_code?: string}[], ship_from_details?: array{address: array{city?: null|string, country: string, line1?: null|string, line2?: null|string, postal_code?: null|string, state?: null|string}}, shipping_cost?: array{amount?: int, shipping_rate?: string, tax_behavior?: string, tax_code?: string}, tax_date?: int} $params
@param null|array|string $options
@return Calculation the created resource
@throws \Stripe\Exception\ApiErrorException if the request fails | create | php | stripe/stripe-php | lib/Tax/Calculation.php | https://github.com/stripe/stripe-php/blob/master/lib/Tax/Calculation.php | MIT |
public static function retrieve($id, $opts = null)
{
$opts = \Stripe\Util\RequestOptions::parse($opts);
$instance = new static($id, $opts);
$instance->refresh();
return $instance;
} | Retrieves a Tax <code>Calculation</code> object, if the calculation hasn’t
expired.
@param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
@param null|array|string $opts
@return Calculation
@throws \Stripe\Exception\ApiErrorException if the request fails | retrieve | php | stripe/stripe-php | lib/Tax/Calculation.php | https://github.com/stripe/stripe-php/blob/master/lib/Tax/Calculation.php | MIT |
public static function allLineItems($id, $params = null, $opts = null)
{
$url = static::resourceUrl($id) . '/line_items';
list($response, $opts) = static::_staticRequest('get', $url, $params, $opts);
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
$obj->setLastResponse($response);
return $obj;
} | @param string $id
@param null|array $params
@param null|array|string $opts
@return \Stripe\Collection<CalculationLineItem> list of calculation line items
@throws \Stripe\Exception\ApiErrorException if the request fails | allLineItems | php | stripe/stripe-php | lib/Tax/Calculation.php | https://github.com/stripe/stripe-php/blob/master/lib/Tax/Calculation.php | MIT |
public static function retrieve($id, $opts = null)
{
$opts = \Stripe\Util\RequestOptions::parse($opts);
$instance = new static($id, $opts);
$instance->refresh();
return $instance;
} | Retrieves a Tax <code>Transaction</code> object.
@param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
@param null|array|string $opts
@return Transaction
@throws \Stripe\Exception\ApiErrorException if the request fails | retrieve | php | stripe/stripe-php | lib/Tax/Transaction.php | https://github.com/stripe/stripe-php/blob/master/lib/Tax/Transaction.php | MIT |
public static function createFromCalculation($params = null, $opts = null)
{
$url = static::classUrl() . '/create_from_calculation';
list($response, $opts) = static::_staticRequest('post', $url, $params, $opts);
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
$obj->setLastResponse($response);
return $obj;
} | @param null|array $params
@param null|array|string $opts
@return Transaction the created transaction
@throws \Stripe\Exception\ApiErrorException if the request fails | createFromCalculation | php | stripe/stripe-php | lib/Tax/Transaction.php | https://github.com/stripe/stripe-php/blob/master/lib/Tax/Transaction.php | MIT |
public static function createReversal($params = null, $opts = null)
{
$url = static::classUrl() . '/create_reversal';
list($response, $opts) = static::_staticRequest('post', $url, $params, $opts);
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
$obj->setLastResponse($response);
return $obj;
} | @param null|array $params
@param null|array|string $opts
@return Transaction the created transaction
@throws \Stripe\Exception\ApiErrorException if the request fails | createReversal | php | stripe/stripe-php | lib/Tax/Transaction.php | https://github.com/stripe/stripe-php/blob/master/lib/Tax/Transaction.php | MIT |
public static function allLineItems($id, $params = null, $opts = null)
{
$url = static::resourceUrl($id) . '/line_items';
list($response, $opts) = static::_staticRequest('get', $url, $params, $opts);
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
$obj->setLastResponse($response);
return $obj;
} | @param string $id
@param null|array $params
@param null|array|string $opts
@return \Stripe\Collection<TransactionLineItem> list of transaction line items
@throws \Stripe\Exception\ApiErrorException if the request fails | allLineItems | php | stripe/stripe-php | lib/Tax/Transaction.php | https://github.com/stripe/stripe-php/blob/master/lib/Tax/Transaction.php | MIT |
public function all($params = null, $opts = null)
{
return $this->requestCollection('get', '/v1/disputes', $params, $opts);
} | Returns a list of your disputes.
@param null|array{charge?: string, created?: array|int, ending_before?: string, expand?: string[], limit?: int, payment_intent?: string, starting_after?: string} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\Collection<\Stripe\Dispute>
@throws \Stripe\Exception\ApiErrorException if the request fails | all | php | stripe/stripe-php | lib/Service/DisputeService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/DisputeService.php | MIT |
public function close($id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v1/disputes/%s/close', $id), $params, $opts);
} | Closing the dispute for a charge indicates that you do not have any evidence to
submit and are essentially dismissing the dispute, acknowledging it as lost.
The status of the dispute will change from <code>needs_response</code> to
<code>lost</code>. <em>Closing a dispute is irreversible</em>.
@param string $id
@param null|array{expand?: string[]} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\Dispute
@throws \Stripe\Exception\ApiErrorException if the request fails | close | php | stripe/stripe-php | lib/Service/DisputeService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/DisputeService.php | MIT |
public function retrieve($id, $params = null, $opts = null)
{
return $this->request('get', $this->buildPath('/v1/disputes/%s', $id), $params, $opts);
} | Retrieves the dispute with the given ID.
@param string $id
@param null|array{expand?: string[]} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\Dispute
@throws \Stripe\Exception\ApiErrorException if the request fails | retrieve | php | stripe/stripe-php | lib/Service/DisputeService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/DisputeService.php | MIT |
public function update($id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v1/disputes/%s', $id), $params, $opts);
} | When you get a dispute, contacting your customer is always the best first step.
If that doesn’t work, you can submit evidence to help us resolve the dispute in
your favor. You can do this in your <a
href="https://dashboard.stripe.com/disputes">dashboard</a>, but if you prefer,
you can use the API to submit evidence programmatically.
Depending on your dispute type, different evidence fields will give you a better
chance of winning your dispute. To figure out which evidence fields to provide,
see our <a href="/docs/disputes/categories">guide to dispute types</a>.
@param string $id
@param null|array{evidence?: array{access_activity_log?: string, billing_address?: string, cancellation_policy?: string, cancellation_policy_disclosure?: string, cancellation_rebuttal?: string, customer_communication?: string, customer_email_address?: string, customer_name?: string, customer_purchase_ip?: string, customer_signature?: string, duplicate_charge_documentation?: string, duplicate_charge_explanation?: string, duplicate_charge_id?: string, enhanced_evidence?: null|array{visa_compelling_evidence_3?: array{disputed_transaction?: array{customer_account_id?: null|string, customer_device_fingerprint?: null|string, customer_device_id?: null|string, customer_email_address?: null|string, customer_purchase_ip?: null|string, merchandise_or_services?: string, product_description?: null|string, shipping_address?: array{city?: null|string, country?: null|string, line1?: null|string, line2?: null|string, postal_code?: null|string, state?: null|string}}, prior_undisputed_transactions?: (array{charge: string, customer_account_id?: null|string, customer_device_fingerprint?: null|string, customer_device_id?: null|string, customer_email_address?: null|string, customer_purchase_ip?: null|string, product_description?: null|string, shipping_address?: array{city?: null|string, country?: null|string, line1?: null|string, line2?: null|string, postal_code?: null|string, state?: null|string}})[]}, visa_compliance?: array{fee_acknowledged?: bool}}, product_description?: string, receipt?: string, refund_policy?: string, refund_policy_disclosure?: string, refund_refusal_explanation?: string, service_date?: string, service_documentation?: string, shipping_address?: string, shipping_carrier?: string, shipping_date?: string, shipping_documentation?: string, shipping_tracking_number?: string, uncategorized_file?: string, uncategorized_text?: string}, expand?: string[], metadata?: null|\Stripe\StripeObject, submit?: bool} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\Dispute
@throws \Stripe\Exception\ApiErrorException if the request fails | update | php | stripe/stripe-php | lib/Service/DisputeService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/DisputeService.php | MIT |
public function all($params = null, $opts = null)
{
return $this->requestCollection('get', '/v1/events', $params, $opts);
} | List events, going back up to 30 days. Each event data is rendered according to
Stripe API version at its creation time, specified in <a
href="https://docs.stripe.com/api/events/object">event object</a>
<code>api_version</code> attribute (not according to your current Stripe API
version or <code>Stripe-Version</code> header).
@param null|array{created?: array|int, delivery_success?: bool, ending_before?: string, expand?: string[], limit?: int, starting_after?: string, type?: string, types?: string[]} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\Collection<\Stripe\Event>
@throws \Stripe\Exception\ApiErrorException if the request fails | all | php | stripe/stripe-php | lib/Service/EventService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/EventService.php | MIT |
public function retrieve($id, $params = null, $opts = null)
{
return $this->request('get', $this->buildPath('/v1/events/%s', $id), $params, $opts);
} | Retrieves the details of an event if it was created in the last 30 days. Supply
the unique identifier of the event, which you might have received in a webhook.
@param string $id
@param null|array{expand?: string[]} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\Event
@throws \Stripe\Exception\ApiErrorException if the request fails | retrieve | php | stripe/stripe-php | lib/Service/EventService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/EventService.php | MIT |
public function all($params = null, $opts = null)
{
return $this->requestCollection('get', '/v1/setup_intents', $params, $opts);
} | Returns a list of SetupIntents.
@param null|array{attach_to_self?: bool, created?: array|int, customer?: string, ending_before?: string, expand?: string[], limit?: int, payment_method?: string, starting_after?: string} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\Collection<\Stripe\SetupIntent>
@throws \Stripe\Exception\ApiErrorException if the request fails | all | php | stripe/stripe-php | lib/Service/SetupIntentService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/SetupIntentService.php | MIT |
public function cancel($id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v1/setup_intents/%s/cancel', $id), $params, $opts);
} | You can cancel a SetupIntent object when it’s in one of these statuses:
<code>requires_payment_method</code>, <code>requires_confirmation</code>, or
<code>requires_action</code>.
After you cancel it, setup is abandoned and any operations on the SetupIntent
fail with an error. You can’t cancel the SetupIntent for a Checkout Session. <a
href="/docs/api/checkout/sessions/expire">Expire the Checkout Session</a>
instead.
@param string $id
@param null|array{cancellation_reason?: string, expand?: string[]} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\SetupIntent
@throws \Stripe\Exception\ApiErrorException if the request fails | cancel | php | stripe/stripe-php | lib/Service/SetupIntentService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/SetupIntentService.php | MIT |
public function confirm($id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v1/setup_intents/%s/confirm', $id), $params, $opts);
} | Confirm that your customer intends to set up the current or provided payment
method. For example, you would confirm a SetupIntent when a customer hits the
“Save” button on a payment method management page on your website.
If the selected payment method does not require any additional steps from the
customer, the SetupIntent will transition to the <code>succeeded</code> status.
Otherwise, it will transition to the <code>requires_action</code> status and
suggest additional actions via <code>next_action</code>. If setup fails, the
SetupIntent will transition to the <code>requires_payment_method</code> status
or the <code>canceled</code> status if the confirmation limit is reached.
@param string $id
@param null|array{confirmation_token?: string, expand?: string[], mandate_data?: null|array{customer_acceptance?: array{accepted_at?: int, offline?: array{}, online?: array{ip_address?: string, user_agent?: string}, type: string}}, payment_method?: string, payment_method_data?: array{acss_debit?: array{account_number: string, institution_number: string, transit_number: string}, affirm?: array{}, afterpay_clearpay?: array{}, alipay?: array{}, allow_redisplay?: string, alma?: array{}, amazon_pay?: array{}, au_becs_debit?: array{account_number: string, bsb_number: string}, bacs_debit?: array{account_number?: string, sort_code?: string}, bancontact?: array{}, billie?: array{}, billing_details?: array{address?: null|array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, email?: null|string, name?: null|string, phone?: null|string, tax_id?: string}, blik?: array{}, boleto?: array{tax_id: string}, cashapp?: array{}, customer_balance?: array{}, eps?: array{bank?: string}, fpx?: array{account_holder_type?: string, bank: string}, giropay?: array{}, grabpay?: array{}, ideal?: array{bank?: string}, interac_present?: array{}, kakao_pay?: array{}, klarna?: array{dob?: array{day: int, month: int, year: int}}, konbini?: array{}, kr_card?: array{}, link?: array{}, metadata?: \Stripe\StripeObject, mobilepay?: array{}, multibanco?: array{}, naver_pay?: array{funding?: string}, nz_bank_account?: array{account_holder_name?: string, account_number: string, bank_code: string, branch_code: string, reference?: string, suffix: string}, oxxo?: array{}, p24?: array{bank?: string}, pay_by_bank?: array{}, payco?: array{}, paynow?: array{}, paypal?: array{}, pix?: array{}, promptpay?: array{}, radar_options?: array{session?: string}, revolut_pay?: array{}, samsung_pay?: array{}, satispay?: array{}, sepa_debit?: array{iban: string}, sofort?: array{country: string}, swish?: array{}, twint?: array{}, type: string, us_bank_account?: array{account_holder_type?: string, account_number?: string, account_type?: string, financial_connections_account?: string, routing_number?: string}, wechat_pay?: array{}, zip?: array{}}, payment_method_options?: array{acss_debit?: array{currency?: string, mandate_options?: array{custom_mandate_url?: null|string, default_for?: string[], interval_description?: string, payment_schedule?: string, transaction_type?: string}, verification_method?: string}, amazon_pay?: array{}, bacs_debit?: array{mandate_options?: array{reference_prefix?: null|string}}, card?: array{mandate_options?: array{amount: int, amount_type: string, currency: string, description?: string, end_date?: int, interval: string, interval_count?: int, reference: string, start_date: int, supported_types?: string[]}, moto?: bool, network?: string, request_three_d_secure?: string, three_d_secure?: array{ares_trans_status?: string, cryptogram?: string, electronic_commerce_indicator?: string, network_options?: array{cartes_bancaires?: array{cb_avalgo: string, cb_exemption?: string, cb_score?: int}}, requestor_challenge_indicator?: string, transaction_id?: string, version?: string}}, card_present?: array{}, link?: array{persistent_token?: string}, paypal?: array{billing_agreement_id?: string}, sepa_debit?: array{mandate_options?: array{reference_prefix?: null|string}}, us_bank_account?: array{financial_connections?: array{filters?: array{account_subcategories?: string[]}, permissions?: string[], prefetch?: string[], return_url?: string}, mandate_options?: array{collection_method?: null|string}, networks?: array{requested?: string[]}, verification_method?: string}}, return_url?: string, use_stripe_sdk?: bool} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\SetupIntent
@throws \Stripe\Exception\ApiErrorException if the request fails | confirm | php | stripe/stripe-php | lib/Service/SetupIntentService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/SetupIntentService.php | MIT |
public function create($params = null, $opts = null)
{
return $this->request('post', '/v1/setup_intents', $params, $opts);
} | Creates a SetupIntent object.
After you create the SetupIntent, attach a payment method and <a
href="/docs/api/setup_intents/confirm">confirm</a> it to collect any required
permissions to charge the payment method later.
@param null|array{attach_to_self?: bool, automatic_payment_methods?: array{allow_redirects?: string, enabled: bool}, confirm?: bool, confirmation_token?: string, customer?: string, description?: string, expand?: string[], flow_directions?: string[], mandate_data?: null|array{customer_acceptance: array{accepted_at?: int, offline?: array{}, online?: array{ip_address: string, user_agent: string}, type: string}}, metadata?: \Stripe\StripeObject, on_behalf_of?: string, payment_method?: string, payment_method_configuration?: string, payment_method_data?: array{acss_debit?: array{account_number: string, institution_number: string, transit_number: string}, affirm?: array{}, afterpay_clearpay?: array{}, alipay?: array{}, allow_redisplay?: string, alma?: array{}, amazon_pay?: array{}, au_becs_debit?: array{account_number: string, bsb_number: string}, bacs_debit?: array{account_number?: string, sort_code?: string}, bancontact?: array{}, billie?: array{}, billing_details?: array{address?: null|array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, email?: null|string, name?: null|string, phone?: null|string, tax_id?: string}, blik?: array{}, boleto?: array{tax_id: string}, cashapp?: array{}, customer_balance?: array{}, eps?: array{bank?: string}, fpx?: array{account_holder_type?: string, bank: string}, giropay?: array{}, grabpay?: array{}, ideal?: array{bank?: string}, interac_present?: array{}, kakao_pay?: array{}, klarna?: array{dob?: array{day: int, month: int, year: int}}, konbini?: array{}, kr_card?: array{}, link?: array{}, metadata?: \Stripe\StripeObject, mobilepay?: array{}, multibanco?: array{}, naver_pay?: array{funding?: string}, nz_bank_account?: array{account_holder_name?: string, account_number: string, bank_code: string, branch_code: string, reference?: string, suffix: string}, oxxo?: array{}, p24?: array{bank?: string}, pay_by_bank?: array{}, payco?: array{}, paynow?: array{}, paypal?: array{}, pix?: array{}, promptpay?: array{}, radar_options?: array{session?: string}, revolut_pay?: array{}, samsung_pay?: array{}, satispay?: array{}, sepa_debit?: array{iban: string}, sofort?: array{country: string}, swish?: array{}, twint?: array{}, type: string, us_bank_account?: array{account_holder_type?: string, account_number?: string, account_type?: string, financial_connections_account?: string, routing_number?: string}, wechat_pay?: array{}, zip?: array{}}, payment_method_options?: array{acss_debit?: array{currency?: string, mandate_options?: array{custom_mandate_url?: null|string, default_for?: string[], interval_description?: string, payment_schedule?: string, transaction_type?: string}, verification_method?: string}, amazon_pay?: array{}, bacs_debit?: array{mandate_options?: array{reference_prefix?: null|string}}, card?: array{mandate_options?: array{amount: int, amount_type: string, currency: string, description?: string, end_date?: int, interval: string, interval_count?: int, reference: string, start_date: int, supported_types?: string[]}, moto?: bool, network?: string, request_three_d_secure?: string, three_d_secure?: array{ares_trans_status?: string, cryptogram?: string, electronic_commerce_indicator?: string, network_options?: array{cartes_bancaires?: array{cb_avalgo: string, cb_exemption?: string, cb_score?: int}}, requestor_challenge_indicator?: string, transaction_id?: string, version?: string}}, card_present?: array{}, link?: array{persistent_token?: string}, paypal?: array{billing_agreement_id?: string}, sepa_debit?: array{mandate_options?: array{reference_prefix?: null|string}}, us_bank_account?: array{financial_connections?: array{filters?: array{account_subcategories?: string[]}, permissions?: string[], prefetch?: string[], return_url?: string}, mandate_options?: array{collection_method?: null|string}, networks?: array{requested?: string[]}, verification_method?: string}}, payment_method_types?: string[], return_url?: string, single_use?: array{amount: int, currency: string}, usage?: string, use_stripe_sdk?: bool} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\SetupIntent
@throws \Stripe\Exception\ApiErrorException if the request fails | create | php | stripe/stripe-php | lib/Service/SetupIntentService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/SetupIntentService.php | MIT |
public function retrieve($id, $params = null, $opts = null)
{
return $this->request('get', $this->buildPath('/v1/setup_intents/%s', $id), $params, $opts);
} | Retrieves the details of a SetupIntent that has previously been created.
Client-side retrieval using a publishable key is allowed when the
<code>client_secret</code> is provided in the query string.
When retrieved with a publishable key, only a subset of properties will be
returned. Please refer to the <a href="#setup_intent_object">SetupIntent</a>
object reference for more details.
@param string $id
@param null|array{client_secret?: string, expand?: string[]} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\SetupIntent
@throws \Stripe\Exception\ApiErrorException if the request fails | retrieve | php | stripe/stripe-php | lib/Service/SetupIntentService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/SetupIntentService.php | MIT |
public function update($id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v1/setup_intents/%s', $id), $params, $opts);
} | Updates a SetupIntent object.
@param string $id
@param null|array{attach_to_self?: bool, customer?: string, description?: string, expand?: string[], flow_directions?: string[], metadata?: null|\Stripe\StripeObject, payment_method?: string, payment_method_configuration?: string, payment_method_data?: array{acss_debit?: array{account_number: string, institution_number: string, transit_number: string}, affirm?: array{}, afterpay_clearpay?: array{}, alipay?: array{}, allow_redisplay?: string, alma?: array{}, amazon_pay?: array{}, au_becs_debit?: array{account_number: string, bsb_number: string}, bacs_debit?: array{account_number?: string, sort_code?: string}, bancontact?: array{}, billie?: array{}, billing_details?: array{address?: null|array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, email?: null|string, name?: null|string, phone?: null|string, tax_id?: string}, blik?: array{}, boleto?: array{tax_id: string}, cashapp?: array{}, customer_balance?: array{}, eps?: array{bank?: string}, fpx?: array{account_holder_type?: string, bank: string}, giropay?: array{}, grabpay?: array{}, ideal?: array{bank?: string}, interac_present?: array{}, kakao_pay?: array{}, klarna?: array{dob?: array{day: int, month: int, year: int}}, konbini?: array{}, kr_card?: array{}, link?: array{}, metadata?: \Stripe\StripeObject, mobilepay?: array{}, multibanco?: array{}, naver_pay?: array{funding?: string}, nz_bank_account?: array{account_holder_name?: string, account_number: string, bank_code: string, branch_code: string, reference?: string, suffix: string}, oxxo?: array{}, p24?: array{bank?: string}, pay_by_bank?: array{}, payco?: array{}, paynow?: array{}, paypal?: array{}, pix?: array{}, promptpay?: array{}, radar_options?: array{session?: string}, revolut_pay?: array{}, samsung_pay?: array{}, satispay?: array{}, sepa_debit?: array{iban: string}, sofort?: array{country: string}, swish?: array{}, twint?: array{}, type: string, us_bank_account?: array{account_holder_type?: string, account_number?: string, account_type?: string, financial_connections_account?: string, routing_number?: string}, wechat_pay?: array{}, zip?: array{}}, payment_method_options?: array{acss_debit?: array{currency?: string, mandate_options?: array{custom_mandate_url?: null|string, default_for?: string[], interval_description?: string, payment_schedule?: string, transaction_type?: string}, verification_method?: string}, amazon_pay?: array{}, bacs_debit?: array{mandate_options?: array{reference_prefix?: null|string}}, card?: array{mandate_options?: array{amount: int, amount_type: string, currency: string, description?: string, end_date?: int, interval: string, interval_count?: int, reference: string, start_date: int, supported_types?: string[]}, moto?: bool, network?: string, request_three_d_secure?: string, three_d_secure?: array{ares_trans_status?: string, cryptogram?: string, electronic_commerce_indicator?: string, network_options?: array{cartes_bancaires?: array{cb_avalgo: string, cb_exemption?: string, cb_score?: int}}, requestor_challenge_indicator?: string, transaction_id?: string, version?: string}}, card_present?: array{}, link?: array{persistent_token?: string}, paypal?: array{billing_agreement_id?: string}, sepa_debit?: array{mandate_options?: array{reference_prefix?: null|string}}, us_bank_account?: array{financial_connections?: array{filters?: array{account_subcategories?: string[]}, permissions?: string[], prefetch?: string[], return_url?: string}, mandate_options?: array{collection_method?: null|string}, networks?: array{requested?: string[]}, verification_method?: string}}, payment_method_types?: string[]} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\SetupIntent
@throws \Stripe\Exception\ApiErrorException if the request fails | update | php | stripe/stripe-php | lib/Service/SetupIntentService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/SetupIntentService.php | MIT |
public function verifyMicrodeposits($id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v1/setup_intents/%s/verify_microdeposits', $id), $params, $opts);
} | Verifies microdeposits on a SetupIntent object.
@param string $id
@param null|array{amounts?: int[], descriptor_code?: string, expand?: string[]} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\SetupIntent
@throws \Stripe\Exception\ApiErrorException if the request fails | verifyMicrodeposits | php | stripe/stripe-php | lib/Service/SetupIntentService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/SetupIntentService.php | MIT |
public function all($params = null, $opts = null)
{
return $this->requestCollection('get', '/v1/payment_methods', $params, $opts);
} | Returns a list of PaymentMethods for Treasury flows. If you want to list the
PaymentMethods attached to a Customer for payments, you should use the <a
href="/docs/api/payment_methods/customer_list">List a Customer’s
PaymentMethods</a> API instead.
@param null|array{customer?: string, ending_before?: string, expand?: string[], limit?: int, starting_after?: string, type?: string} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\Collection<\Stripe\PaymentMethod>
@throws \Stripe\Exception\ApiErrorException if the request fails | all | php | stripe/stripe-php | lib/Service/PaymentMethodService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/PaymentMethodService.php | MIT |
public function attach($id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v1/payment_methods/%s/attach', $id), $params, $opts);
} | Attaches a PaymentMethod object to a Customer.
To attach a new PaymentMethod to a customer for future payments, we recommend
you use a <a href="/docs/api/setup_intents">SetupIntent</a> or a PaymentIntent
with <a
href="/docs/api/payment_intents/create#create_payment_intent-setup_future_usage">setup_future_usage</a>.
These approaches will perform any necessary steps to set up the PaymentMethod
for future payments. Using the <code>/v1/payment_methods/:id/attach</code>
endpoint without first using a SetupIntent or PaymentIntent with
<code>setup_future_usage</code> does not optimize the PaymentMethod for future
use, which makes later declines and payment friction more likely. See <a
href="/docs/payments/payment-intents#future-usage">Optimizing cards for future
payments</a> for more information about setting up future payments.
To use this PaymentMethod as the default for invoice or subscription payments,
set <a
href="/docs/api/customers/update#update_customer-invoice_settings-default_payment_method"><code>invoice_settings.default_payment_method</code></a>,
on the Customer to the PaymentMethod’s ID.
@param string $id
@param null|array{customer: string, expand?: string[]} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\PaymentMethod
@throws \Stripe\Exception\ApiErrorException if the request fails | attach | php | stripe/stripe-php | lib/Service/PaymentMethodService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/PaymentMethodService.php | MIT |
public function create($params = null, $opts = null)
{
return $this->request('post', '/v1/payment_methods', $params, $opts);
} | Creates a PaymentMethod object. Read the <a
href="/docs/stripe-js/reference#stripe-create-payment-method">Stripe.js
reference</a> to learn how to create PaymentMethods via Stripe.js.
Instead of creating a PaymentMethod directly, we recommend using the <a
href="/docs/payments/accept-a-payment">PaymentIntents</a> API to accept a
payment immediately or the <a
href="/docs/payments/save-and-reuse">SetupIntent</a> API to collect payment
method details ahead of a future payment.
@param null|array{acss_debit?: array{account_number: string, institution_number: string, transit_number: string}, affirm?: array{}, afterpay_clearpay?: array{}, alipay?: array{}, allow_redisplay?: string, alma?: array{}, amazon_pay?: array{}, au_becs_debit?: array{account_number: string, bsb_number: string}, bacs_debit?: array{account_number?: string, sort_code?: string}, bancontact?: array{}, billie?: array{}, billing_details?: array{address?: null|array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, email?: null|string, name?: null|string, phone?: null|string, tax_id?: string}, blik?: array{}, boleto?: array{tax_id: string}, card?: array{cvc?: string, exp_month?: int, exp_year?: int, networks?: array{preferred?: string}, number?: string, token?: string}, cashapp?: array{}, customer?: string, customer_balance?: array{}, eps?: array{bank?: string}, expand?: string[], fpx?: array{account_holder_type?: string, bank: string}, giropay?: array{}, grabpay?: array{}, ideal?: array{bank?: string}, interac_present?: array{}, kakao_pay?: array{}, klarna?: array{dob?: array{day: int, month: int, year: int}}, konbini?: array{}, kr_card?: array{}, link?: array{}, metadata?: \Stripe\StripeObject, mobilepay?: array{}, multibanco?: array{}, naver_pay?: array{funding?: string}, nz_bank_account?: array{account_holder_name?: string, account_number: string, bank_code: string, branch_code: string, reference?: string, suffix: string}, oxxo?: array{}, p24?: array{bank?: string}, pay_by_bank?: array{}, payco?: array{}, payment_method?: string, paynow?: array{}, paypal?: array{}, pix?: array{}, promptpay?: array{}, radar_options?: array{session?: string}, revolut_pay?: array{}, samsung_pay?: array{}, satispay?: array{}, sepa_debit?: array{iban: string}, sofort?: array{country: string}, swish?: array{}, twint?: array{}, type?: string, us_bank_account?: array{account_holder_type?: string, account_number?: string, account_type?: string, financial_connections_account?: string, routing_number?: string}, wechat_pay?: array{}, zip?: array{}} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\PaymentMethod
@throws \Stripe\Exception\ApiErrorException if the request fails | create | php | stripe/stripe-php | lib/Service/PaymentMethodService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/PaymentMethodService.php | MIT |
public function detach($id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v1/payment_methods/%s/detach', $id), $params, $opts);
} | Detaches a PaymentMethod object from a Customer. After a PaymentMethod is
detached, it can no longer be used for a payment or re-attached to a Customer.
@param string $id
@param null|array{expand?: string[]} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\PaymentMethod
@throws \Stripe\Exception\ApiErrorException if the request fails | detach | php | stripe/stripe-php | lib/Service/PaymentMethodService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/PaymentMethodService.php | MIT |
public function retrieve($id, $params = null, $opts = null)
{
return $this->request('get', $this->buildPath('/v1/payment_methods/%s', $id), $params, $opts);
} | Retrieves a PaymentMethod object attached to the StripeAccount. To retrieve a
payment method attached to a Customer, you should use <a
href="/docs/api/payment_methods/customer">Retrieve a Customer’s
PaymentMethods</a>.
@param string $id
@param null|array{expand?: string[]} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\PaymentMethod
@throws \Stripe\Exception\ApiErrorException if the request fails | retrieve | php | stripe/stripe-php | lib/Service/PaymentMethodService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/PaymentMethodService.php | MIT |
public function update($id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v1/payment_methods/%s', $id), $params, $opts);
} | Updates a PaymentMethod object. A PaymentMethod must be attached a customer to
be updated.
@param string $id
@param null|array{allow_redisplay?: string, billing_details?: array{address?: null|array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, email?: null|string, name?: null|string, phone?: null|string, tax_id?: string}, card?: array{exp_month?: int, exp_year?: int, networks?: array{preferred?: null|string}}, expand?: string[], link?: array{}, metadata?: null|\Stripe\StripeObject, pay_by_bank?: array{}, us_bank_account?: array{account_holder_type?: string, account_type?: string}} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\PaymentMethod
@throws \Stripe\Exception\ApiErrorException if the request fails | update | php | stripe/stripe-php | lib/Service/PaymentMethodService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/PaymentMethodService.php | MIT |
public function all($params = null, $opts = null)
{
return $this->requestCollection('get', '/v1/transfers', $params, $opts);
} | Returns a list of existing transfers sent to connected accounts. The transfers
are returned in sorted order, with the most recently created transfers appearing
first.
@param null|array{created?: array|int, destination?: string, ending_before?: string, expand?: string[], limit?: int, starting_after?: string, transfer_group?: string} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\Collection<\Stripe\Transfer>
@throws \Stripe\Exception\ApiErrorException if the request fails | all | php | stripe/stripe-php | lib/Service/TransferService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/TransferService.php | MIT |
public function allReversals($parentId, $params = null, $opts = null)
{
return $this->requestCollection('get', $this->buildPath('/v1/transfers/%s/reversals', $parentId), $params, $opts);
} | You can see a list of the reversals belonging to a specific transfer. Note that
the 10 most recent reversals are always available by default on the transfer
object. If you need more than those 10, you can use this API method and the
<code>limit</code> and <code>starting_after</code> parameters to page through
additional reversals.
@param string $parentId
@param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\Collection<\Stripe\TransferReversal>
@throws \Stripe\Exception\ApiErrorException if the request fails | allReversals | php | stripe/stripe-php | lib/Service/TransferService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/TransferService.php | MIT |
public function create($params = null, $opts = null)
{
return $this->request('post', '/v1/transfers', $params, $opts);
} | To send funds from your Stripe account to a connected account, you create a new
transfer object. Your <a href="#balance">Stripe balance</a> must be able to
cover the transfer amount, or you’ll receive an “Insufficient Funds” error.
@param null|array{amount?: int, currency: string, description?: string, destination: string, expand?: string[], metadata?: \Stripe\StripeObject, source_transaction?: string, source_type?: string, transfer_group?: string} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\Transfer
@throws \Stripe\Exception\ApiErrorException if the request fails | create | php | stripe/stripe-php | lib/Service/TransferService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/TransferService.php | MIT |
public function createReversal($parentId, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v1/transfers/%s/reversals', $parentId), $params, $opts);
} | When you create a new reversal, you must specify a transfer to create it on.
When reversing transfers, you can optionally reverse part of the transfer. You
can do so as many times as you wish until the entire transfer has been reversed.
Once entirely reversed, a transfer can’t be reversed again. This method will
return an error when called on an already-reversed transfer, or when trying to
reverse more money than is left on a transfer.
@param string $parentId
@param null|array{amount?: int, description?: string, expand?: string[], metadata?: null|\Stripe\StripeObject, refund_application_fee?: bool} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\TransferReversal
@throws \Stripe\Exception\ApiErrorException if the request fails | createReversal | php | stripe/stripe-php | lib/Service/TransferService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/TransferService.php | MIT |
public function retrieve($id, $params = null, $opts = null)
{
return $this->request('get', $this->buildPath('/v1/transfers/%s', $id), $params, $opts);
} | Retrieves the details of an existing transfer. Supply the unique transfer ID
from either a transfer creation request or the transfer list, and Stripe will
return the corresponding transfer information.
@param string $id
@param null|array{expand?: string[]} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\Transfer
@throws \Stripe\Exception\ApiErrorException if the request fails | retrieve | php | stripe/stripe-php | lib/Service/TransferService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/TransferService.php | MIT |
public function retrieveReversal($parentId, $id, $params = null, $opts = null)
{
return $this->request('get', $this->buildPath('/v1/transfers/%s/reversals/%s', $parentId, $id), $params, $opts);
} | By default, you can see the 10 most recent reversals stored directly on the
transfer object, but you can also retrieve details about a specific reversal
stored on the transfer.
@param string $parentId
@param string $id
@param null|array{expand?: string[]} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\TransferReversal
@throws \Stripe\Exception\ApiErrorException if the request fails | retrieveReversal | php | stripe/stripe-php | lib/Service/TransferService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/TransferService.php | MIT |
public function update($id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v1/transfers/%s', $id), $params, $opts);
} | Updates the specified transfer by setting the values of the parameters passed.
Any parameters not provided will be left unchanged.
This request accepts only metadata as an argument.
@param string $id
@param null|array{description?: string, expand?: string[], metadata?: null|\Stripe\StripeObject} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\Transfer
@throws \Stripe\Exception\ApiErrorException if the request fails | update | php | stripe/stripe-php | lib/Service/TransferService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/TransferService.php | MIT |
public function updateReversal($parentId, $id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v1/transfers/%s/reversals/%s', $parentId, $id), $params, $opts);
} | Updates the specified reversal by setting the values of the parameters passed.
Any parameters not provided will be left unchanged.
This request only accepts metadata and description as arguments.
@param string $parentId
@param string $id
@param null|array{expand?: string[], metadata?: null|\Stripe\StripeObject} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\TransferReversal
@throws \Stripe\Exception\ApiErrorException if the request fails | updateReversal | php | stripe/stripe-php | lib/Service/TransferService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/TransferService.php | MIT |
public function all($params = null, $opts = null)
{
return $this->requestCollection('get', '/v1/invoice_rendering_templates', $params, $opts);
} | List all templates, ordered by creation date, with the most recently created
template appearing first.
@param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string, status?: string} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\Collection<\Stripe\InvoiceRenderingTemplate>
@throws \Stripe\Exception\ApiErrorException if the request fails | all | php | stripe/stripe-php | lib/Service/InvoiceRenderingTemplateService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/InvoiceRenderingTemplateService.php | MIT |
public function archive($id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v1/invoice_rendering_templates/%s/archive', $id), $params, $opts);
} | Updates the status of an invoice rendering template to ‘archived’ so no new
Stripe objects (customers, invoices, etc.) can reference it. The template can
also no longer be updated. However, if the template is already set on a Stripe
object, it will continue to be applied on invoices generated by it.
@param string $id
@param null|array{expand?: string[]} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\InvoiceRenderingTemplate
@throws \Stripe\Exception\ApiErrorException if the request fails | archive | php | stripe/stripe-php | lib/Service/InvoiceRenderingTemplateService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/InvoiceRenderingTemplateService.php | MIT |
public function retrieve($id, $params = null, $opts = null)
{
return $this->request('get', $this->buildPath('/v1/invoice_rendering_templates/%s', $id), $params, $opts);
} | Retrieves an invoice rendering template with the given ID. It by default returns
the latest version of the template. Optionally, specify a version to see
previous versions.
@param string $id
@param null|array{expand?: string[], version?: int} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\InvoiceRenderingTemplate
@throws \Stripe\Exception\ApiErrorException if the request fails | retrieve | php | stripe/stripe-php | lib/Service/InvoiceRenderingTemplateService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/InvoiceRenderingTemplateService.php | MIT |
public function unarchive($id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v1/invoice_rendering_templates/%s/unarchive', $id), $params, $opts);
} | Unarchive an invoice rendering template so it can be used on new Stripe objects
again.
@param string $id
@param null|array{expand?: string[]} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\InvoiceRenderingTemplate
@throws \Stripe\Exception\ApiErrorException if the request fails | unarchive | php | stripe/stripe-php | lib/Service/InvoiceRenderingTemplateService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/InvoiceRenderingTemplateService.php | MIT |
public function all($params = null, $opts = null)
{
return $this->requestCollection('get', '/v1/credit_notes', $params, $opts);
} | Returns a list of credit notes.
@param null|array{created?: array|int, customer?: string, ending_before?: string, expand?: string[], invoice?: string, limit?: int, starting_after?: string} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\Collection<\Stripe\CreditNote>
@throws \Stripe\Exception\ApiErrorException if the request fails | all | php | stripe/stripe-php | lib/Service/CreditNoteService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/CreditNoteService.php | MIT |
public function allLines($parentId, $params = null, $opts = null)
{
return $this->requestCollection('get', $this->buildPath('/v1/credit_notes/%s/lines', $parentId), $params, $opts);
} | When retrieving a credit note, you’ll get a <strong>lines</strong> property
containing the first handful of those items. There is also a URL where you can
retrieve the full (paginated) list of line items.
@param string $parentId
@param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\Collection<\Stripe\CreditNoteLineItem>
@throws \Stripe\Exception\ApiErrorException if the request fails | allLines | php | stripe/stripe-php | lib/Service/CreditNoteService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/CreditNoteService.php | MIT |
public function create($params = null, $opts = null)
{
return $this->request('post', '/v1/credit_notes', $params, $opts);
} | Issue a credit note to adjust the amount of a finalized invoice. For a
<code>status=open</code> invoice, a credit note reduces its
<code>amount_due</code>. For a <code>status=paid</code> invoice, a credit note
does not affect its <code>amount_due</code>. Instead, it can result in any
combination of the following:
<ul> <li>Refund: create a new refund (using <code>refund_amount</code>) or link
an existing refund (using <code>refund</code>).</li> <li>Customer balance
credit: credit the customer’s balance (using <code>credit_amount</code>) which
will be automatically applied to their next invoice when it’s finalized.</li>
<li>Outside of Stripe credit: record the amount that is or will be credited
outside of Stripe (using <code>out_of_band_amount</code>).</li> </ul>
For post-payment credit notes the sum of the refund, credit and outside of
Stripe amounts must equal the credit note total.
You may issue multiple credit notes for an invoice. Each credit note will
increment the invoice’s <code>pre_payment_credit_notes_amount</code> or
<code>post_payment_credit_notes_amount</code> depending on its
<code>status</code> at the time of credit note creation.
@param null|array{amount?: int, credit_amount?: int, effective_at?: int, email_type?: string, expand?: string[], invoice: string, lines?: (array{amount?: int, description?: string, invoice_line_item?: string, quantity?: int, tax_amounts?: null|array{amount: int, tax_rate: string, taxable_amount: int}[], tax_rates?: null|string[], type: string, unit_amount?: int, unit_amount_decimal?: string})[], memo?: string, metadata?: \Stripe\StripeObject, out_of_band_amount?: int, reason?: string, refund_amount?: int, refunds?: array{amount_refunded?: int, refund?: string}[], shipping_cost?: array{shipping_rate?: string}} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\CreditNote
@throws \Stripe\Exception\ApiErrorException if the request fails | create | php | stripe/stripe-php | lib/Service/CreditNoteService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/CreditNoteService.php | MIT |
public function preview($params = null, $opts = null)
{
return $this->request('get', '/v1/credit_notes/preview', $params, $opts);
} | Get a preview of a credit note without creating it.
@param null|array{amount?: int, credit_amount?: int, effective_at?: int, email_type?: string, expand?: string[], invoice: string, lines?: (array{amount?: int, description?: string, invoice_line_item?: string, quantity?: int, tax_amounts?: null|array{amount: int, tax_rate: string, taxable_amount: int}[], tax_rates?: null|string[], type: string, unit_amount?: int, unit_amount_decimal?: string})[], memo?: string, metadata?: \Stripe\StripeObject, out_of_band_amount?: int, reason?: string, refund_amount?: int, refunds?: array{amount_refunded?: int, refund?: string}[], shipping_cost?: array{shipping_rate?: string}} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\CreditNote
@throws \Stripe\Exception\ApiErrorException if the request fails | preview | php | stripe/stripe-php | lib/Service/CreditNoteService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/CreditNoteService.php | MIT |
public function previewLines($params = null, $opts = null)
{
return $this->requestCollection('get', '/v1/credit_notes/preview/lines', $params, $opts);
} | When retrieving a credit note preview, you’ll get a <strong>lines</strong>
property containing the first handful of those items. This URL you can retrieve
the full (paginated) list of line items.
@param null|array{amount?: int, credit_amount?: int, effective_at?: int, email_type?: string, ending_before?: string, expand?: string[], invoice: string, limit?: int, lines?: (array{amount?: int, description?: string, invoice_line_item?: string, quantity?: int, tax_amounts?: null|array{amount: int, tax_rate: string, taxable_amount: int}[], tax_rates?: null|string[], type: string, unit_amount?: int, unit_amount_decimal?: string})[], memo?: string, metadata?: \Stripe\StripeObject, out_of_band_amount?: int, reason?: string, refund_amount?: int, refunds?: array{amount_refunded?: int, refund?: string}[], shipping_cost?: array{shipping_rate?: string}, starting_after?: string} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\Collection<\Stripe\CreditNoteLineItem>
@throws \Stripe\Exception\ApiErrorException if the request fails | previewLines | php | stripe/stripe-php | lib/Service/CreditNoteService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/CreditNoteService.php | MIT |
public function retrieve($id, $params = null, $opts = null)
{
return $this->request('get', $this->buildPath('/v1/credit_notes/%s', $id), $params, $opts);
} | Retrieves the credit note object with the given identifier.
@param string $id
@param null|array{expand?: string[]} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\CreditNote
@throws \Stripe\Exception\ApiErrorException if the request fails | retrieve | php | stripe/stripe-php | lib/Service/CreditNoteService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/CreditNoteService.php | MIT |
public function update($id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v1/credit_notes/%s', $id), $params, $opts);
} | Updates an existing credit note.
@param string $id
@param null|array{expand?: string[], memo?: string, metadata?: \Stripe\StripeObject} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\CreditNote
@throws \Stripe\Exception\ApiErrorException if the request fails | update | php | stripe/stripe-php | lib/Service/CreditNoteService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/CreditNoteService.php | MIT |
public function voidCreditNote($id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v1/credit_notes/%s/void', $id), $params, $opts);
} | Marks a credit note as void. Learn more about <a
href="/docs/billing/invoices/credit-notes#voiding">voiding credit notes</a>.
@param string $id
@param null|array{expand?: string[]} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\CreditNote
@throws \Stripe\Exception\ApiErrorException if the request fails | voidCreditNote | php | stripe/stripe-php | lib/Service/CreditNoteService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/CreditNoteService.php | MIT |
public function addLines($id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v1/invoices/%s/add_lines', $id), $params, $opts);
} | Adds multiple line items to an invoice. This is only possible when an invoice is
still a draft.
@param string $id
@param null|array{expand?: string[], invoice_metadata?: null|\Stripe\StripeObject, lines: (array{amount?: int, description?: string, discountable?: bool, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], invoice_item?: string, metadata?: null|\Stripe\StripeObject, period?: array{end: int, start: int}, price_data?: array{currency: string, product?: string, product_data?: array{description?: string, images?: string[], metadata?: \Stripe\StripeObject, name: string, tax_code?: string}, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, pricing?: array{price?: string}, quantity?: int, tax_amounts?: null|array{amount: int, tax_rate_data: array{country?: string, description?: string, display_name: string, inclusive: bool, jurisdiction?: string, jurisdiction_level?: string, percentage: float, state?: string, tax_type?: string}, taxability_reason?: string, taxable_amount: int}[], tax_rates?: null|string[]})[]} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\Invoice
@throws \Stripe\Exception\ApiErrorException if the request fails | addLines | php | stripe/stripe-php | lib/Service/InvoiceService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/InvoiceService.php | MIT |
public function all($params = null, $opts = null)
{
return $this->requestCollection('get', '/v1/invoices', $params, $opts);
} | You can list all invoices, or list the invoices for a specific customer. The
invoices are returned sorted by creation date, with the most recently created
invoices appearing first.
@param null|array{collection_method?: string, created?: array|int, customer?: string, due_date?: array|int, ending_before?: string, expand?: string[], limit?: int, starting_after?: string, status?: string, subscription?: string} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\Collection<\Stripe\Invoice>
@throws \Stripe\Exception\ApiErrorException if the request fails | all | php | stripe/stripe-php | lib/Service/InvoiceService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/InvoiceService.php | MIT |
public function allLines($parentId, $params = null, $opts = null)
{
return $this->requestCollection('get', $this->buildPath('/v1/invoices/%s/lines', $parentId), $params, $opts);
} | When retrieving an invoice, you’ll get a <strong>lines</strong> property
containing the total count of line items and the first handful of those items.
There is also a URL where you can retrieve the full (paginated) list of line
items.
@param string $parentId
@param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\Collection<\Stripe\InvoiceLineItem>
@throws \Stripe\Exception\ApiErrorException if the request fails | allLines | php | stripe/stripe-php | lib/Service/InvoiceService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/InvoiceService.php | MIT |
public function create($params = null, $opts = null)
{
return $this->request('post', '/v1/invoices', $params, $opts);
} | This endpoint creates a draft invoice for a given customer. The invoice remains
a draft until you <a href="#finalize_invoice">finalize</a> the invoice, which
allows you to <a href="#pay_invoice">pay</a> or <a href="#send_invoice">send</a>
the invoice to your customers.
@param null|array{account_tax_ids?: null|string[], application_fee_amount?: int, auto_advance?: bool, automatic_tax?: array{enabled: bool, liability?: array{account?: string, type: string}}, automatically_finalizes_at?: int, collection_method?: string, currency?: string, custom_fields?: null|array{name: string, value: string}[], customer?: string, days_until_due?: int, default_payment_method?: string, default_source?: string, default_tax_rates?: string[], description?: string, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], due_date?: int, effective_at?: int, expand?: string[], footer?: string, from_invoice?: array{action: string, invoice: string}, issuer?: array{account?: string, type: string}, metadata?: null|\Stripe\StripeObject, number?: string, on_behalf_of?: string, payment_settings?: array{default_mandate?: null|string, payment_method_options?: array{acss_debit?: null|array{mandate_options?: array{transaction_type?: string}, verification_method?: string}, bancontact?: null|array{preferred_language?: string}, card?: null|array{installments?: array{enabled?: bool, plan?: null|array{count?: int, interval?: string, type: string}}, request_three_d_secure?: string}, customer_balance?: null|array{bank_transfer?: array{eu_bank_transfer?: array{country: string}, type?: string}, funding_type?: string}, konbini?: null|array{}, sepa_debit?: null|array{}, us_bank_account?: null|array{financial_connections?: array{filters?: array{account_subcategories?: string[]}, permissions?: string[], prefetch?: string[]}, verification_method?: string}}, payment_method_types?: null|string[]}, pending_invoice_items_behavior?: string, rendering?: array{amount_tax_display?: null|string, pdf?: array{page_size?: string}, template?: string, template_version?: null|int}, shipping_cost?: array{shipping_rate?: string, shipping_rate_data?: array{delivery_estimate?: array{maximum?: array{unit: string, value: int}, minimum?: array{unit: string, value: int}}, display_name: string, fixed_amount?: array{amount: int, currency: string, currency_options?: \Stripe\StripeObject}, metadata?: \Stripe\StripeObject, tax_behavior?: string, tax_code?: string, type?: string}}, shipping_details?: array{address: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, name: string, phone?: null|string}, statement_descriptor?: string, subscription?: string, transfer_data?: array{amount?: int, destination: string}} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\Invoice
@throws \Stripe\Exception\ApiErrorException if the request fails | create | php | stripe/stripe-php | lib/Service/InvoiceService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/InvoiceService.php | MIT |
public function createPreview($params = null, $opts = null)
{
return $this->request('post', '/v1/invoices/create_preview', $params, $opts);
} | At any time, you can preview the upcoming invoice for a subscription or
subscription schedule. This will show you all the charges that are pending,
including subscription renewal charges, invoice item charges, etc. It will also
show you any discounts that are applicable to the invoice.
Note that when you are viewing an upcoming invoice, you are simply viewing a
preview – the invoice has not yet been created. As such, the upcoming invoice
will not show up in invoice listing calls, and you cannot use the API to pay or
edit the invoice. If you want to change the amount that your customer will be
billed, you can add, remove, or update pending invoice items, or update the
customer’s discount.
You can preview the effects of updating a subscription, including a preview of
what proration will take place. To ensure that the actual proration is
calculated exactly the same as the previewed proration, you should pass the
<code>subscription_details.proration_date</code> parameter when doing the actual
subscription update. The recommended way to get only the prorations being
previewed is to consider only proration line items where
<code>period[start]</code> is equal to the
<code>subscription_details.proration_date</code> value passed in the request.
Note: Currency conversion calculations use the latest exchange rates. Exchange
rates may vary between the time of the preview and the time of the actual
invoice creation. <a href="https://docs.stripe.com/currencies/conversions">Learn
more</a>
@param null|array{automatic_tax?: array{enabled: bool, liability?: array{account?: string, type: string}}, currency?: string, customer?: string, customer_details?: array{address?: null|array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, shipping?: null|array{address: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, name: string, phone?: string}, tax?: array{ip_address?: null|string}, tax_exempt?: null|string, tax_ids?: array{type: string, value: string}[]}, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], expand?: string[], invoice_items?: (array{amount?: int, currency?: string, description?: string, discountable?: bool, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], invoiceitem?: string, metadata?: null|\Stripe\StripeObject, period?: array{end: int, start: int}, price?: string, price_data?: array{currency: string, product: string, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, quantity?: int, tax_behavior?: string, tax_code?: null|string, tax_rates?: null|string[], unit_amount?: int, unit_amount_decimal?: string})[], issuer?: array{account?: string, type: string}, on_behalf_of?: null|string, preview_mode?: string, schedule?: string, schedule_details?: array{end_behavior?: string, phases?: (array{add_invoice_items?: (array{discounts?: array{coupon?: string, discount?: string, promotion_code?: string}[], price?: string, price_data?: array{currency: string, product: string, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, quantity?: int, tax_rates?: null|string[]})[], application_fee_percent?: float, automatic_tax?: array{enabled: bool, liability?: array{account?: string, type: string}}, billing_cycle_anchor?: string, collection_method?: string, currency?: string, default_payment_method?: string, default_tax_rates?: null|string[], description?: null|string, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], end_date?: array|int|string, invoice_settings?: array{account_tax_ids?: null|string[], days_until_due?: int, issuer?: array{account?: string, type: string}}, items: (array{discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], metadata?: \Stripe\StripeObject, plan?: string, price?: string, price_data?: array{currency: string, product: string, recurring: array{interval: string, interval_count?: int}, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, quantity?: int, tax_rates?: null|string[]})[], iterations?: int, metadata?: \Stripe\StripeObject, on_behalf_of?: string, proration_behavior?: string, start_date?: array|int|string, transfer_data?: array{amount_percent?: float, destination: string}, trial?: bool, trial_end?: array|int|string})[], proration_behavior?: string}, subscription?: string, subscription_details?: array{billing_cycle_anchor?: array|int|string, cancel_at?: null|int, cancel_at_period_end?: bool, cancel_now?: bool, default_tax_rates?: null|string[], items?: (array{clear_usage?: bool, deleted?: bool, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], id?: string, metadata?: null|\Stripe\StripeObject, plan?: string, price?: string, price_data?: array{currency: string, product: string, recurring: array{interval: string, interval_count?: int}, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, quantity?: int, tax_rates?: null|string[]})[], proration_behavior?: string, proration_date?: int, resume_at?: string, start_date?: int, trial_end?: array|int|string}} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\Invoice
@throws \Stripe\Exception\ApiErrorException if the request fails | createPreview | php | stripe/stripe-php | lib/Service/InvoiceService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/InvoiceService.php | MIT |
public function delete($id, $params = null, $opts = null)
{
return $this->request('delete', $this->buildPath('/v1/invoices/%s', $id), $params, $opts);
} | Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to
delete invoices that are no longer in a draft state will fail; once an invoice
has been finalized or if an invoice is for a subscription, it must be <a
href="#void_invoice">voided</a>.
@param string $id
@param null|array $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\Invoice
@throws \Stripe\Exception\ApiErrorException if the request fails | delete | php | stripe/stripe-php | lib/Service/InvoiceService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/InvoiceService.php | MIT |
public function finalizeInvoice($id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v1/invoices/%s/finalize', $id), $params, $opts);
} | Stripe automatically finalizes drafts before sending and attempting payment on
invoices. However, if you’d like to finalize a draft invoice manually, you can
do so using this method.
@param string $id
@param null|array{auto_advance?: bool, expand?: string[]} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\Invoice
@throws \Stripe\Exception\ApiErrorException if the request fails | finalizeInvoice | php | stripe/stripe-php | lib/Service/InvoiceService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/InvoiceService.php | MIT |
public function markUncollectible($id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v1/invoices/%s/mark_uncollectible', $id), $params, $opts);
} | Marking an invoice as uncollectible is useful for keeping track of bad debts
that can be written off for accounting purposes.
@param string $id
@param null|array{expand?: string[]} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\Invoice
@throws \Stripe\Exception\ApiErrorException if the request fails | markUncollectible | php | stripe/stripe-php | lib/Service/InvoiceService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/InvoiceService.php | MIT |
public function pay($id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v1/invoices/%s/pay', $id), $params, $opts);
} | Stripe automatically creates and then attempts to collect payment on invoices
for customers on subscriptions according to your <a
href="https://dashboard.stripe.com/account/billing/automatic">subscriptions
settings</a>. However, if you’d like to attempt payment on an invoice out of the
normal collection schedule or for some other reason, you can do so.
@param string $id
@param null|array{expand?: string[], forgive?: bool, mandate?: null|string, off_session?: bool, paid_out_of_band?: bool, payment_method?: string, source?: string} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\Invoice
@throws \Stripe\Exception\ApiErrorException if the request fails | pay | php | stripe/stripe-php | lib/Service/InvoiceService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/InvoiceService.php | MIT |
public function removeLines($id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v1/invoices/%s/remove_lines', $id), $params, $opts);
} | Removes multiple line items from an invoice. This is only possible when an
invoice is still a draft.
@param string $id
@param null|array{expand?: string[], invoice_metadata?: null|\Stripe\StripeObject, lines: array{behavior: string, id: string}[]} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\Invoice
@throws \Stripe\Exception\ApiErrorException if the request fails | removeLines | php | stripe/stripe-php | lib/Service/InvoiceService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/InvoiceService.php | MIT |
public function retrieve($id, $params = null, $opts = null)
{
return $this->request('get', $this->buildPath('/v1/invoices/%s', $id), $params, $opts);
} | Retrieves the invoice with the given ID.
@param string $id
@param null|array{expand?: string[]} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\Invoice
@throws \Stripe\Exception\ApiErrorException if the request fails | retrieve | php | stripe/stripe-php | lib/Service/InvoiceService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/InvoiceService.php | MIT |
public function search($params = null, $opts = null)
{
return $this->requestSearchResult('get', '/v1/invoices/search', $params, $opts);
} | Search for invoices you’ve previously created using Stripe’s <a
href="/docs/search#search-query-language">Search Query Language</a>. Don’t use
search in read-after-write flows where strict consistency is necessary. Under
normal operating conditions, data is searchable in less than a minute.
Occasionally, propagation of new or updated data can be up to an hour behind
during outages. Search functionality is not available to merchants in India.
@param null|array{expand?: string[], limit?: int, page?: string, query: string} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\SearchResult<\Stripe\Invoice>
@throws \Stripe\Exception\ApiErrorException if the request fails | search | php | stripe/stripe-php | lib/Service/InvoiceService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/InvoiceService.php | MIT |
public function sendInvoice($id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v1/invoices/%s/send', $id), $params, $opts);
} | Stripe will automatically send invoices to customers according to your <a
href="https://dashboard.stripe.com/account/billing/automatic">subscriptions
settings</a>. However, if you’d like to manually send an invoice to your
customer out of the normal schedule, you can do so. When sending invoices that
have already been paid, there will be no reference to the payment in the email.
Requests made in test-mode result in no emails being sent, despite sending an
<code>invoice.sent</code> event.
@param string $id
@param null|array{expand?: string[]} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\Invoice
@throws \Stripe\Exception\ApiErrorException if the request fails | sendInvoice | php | stripe/stripe-php | lib/Service/InvoiceService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/InvoiceService.php | MIT |
public function update($id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v1/invoices/%s', $id), $params, $opts);
} | Draft invoices are fully editable. Once an invoice is <a
href="/docs/billing/invoices/workflow#finalized">finalized</a>, monetary values,
as well as <code>collection_method</code>, become uneditable.
If you would like to stop the Stripe Billing engine from automatically
finalizing, reattempting payments on, sending reminders for, or <a
href="/docs/billing/invoices/reconciliation">automatically reconciling</a>
invoices, pass <code>auto_advance=false</code>.
@param string $id
@param null|array{account_tax_ids?: null|string[], application_fee_amount?: int, auto_advance?: bool, automatic_tax?: array{enabled: bool, liability?: array{account?: string, type: string}}, automatically_finalizes_at?: int, collection_method?: string, custom_fields?: null|array{name: string, value: string}[], days_until_due?: int, default_payment_method?: string, default_source?: null|string, default_tax_rates?: null|string[], description?: string, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], due_date?: int, effective_at?: null|int, expand?: string[], footer?: string, issuer?: array{account?: string, type: string}, metadata?: null|\Stripe\StripeObject, number?: null|string, on_behalf_of?: null|string, payment_settings?: array{default_mandate?: null|string, payment_method_options?: array{acss_debit?: null|array{mandate_options?: array{transaction_type?: string}, verification_method?: string}, bancontact?: null|array{preferred_language?: string}, card?: null|array{installments?: array{enabled?: bool, plan?: null|array{count?: int, interval?: string, type: string}}, request_three_d_secure?: string}, customer_balance?: null|array{bank_transfer?: array{eu_bank_transfer?: array{country: string}, type?: string}, funding_type?: string}, konbini?: null|array{}, sepa_debit?: null|array{}, us_bank_account?: null|array{financial_connections?: array{filters?: array{account_subcategories?: string[]}, permissions?: string[], prefetch?: string[]}, verification_method?: string}}, payment_method_types?: null|string[]}, rendering?: array{amount_tax_display?: null|string, pdf?: array{page_size?: string}, template?: string, template_version?: null|int}, shipping_cost?: null|array{shipping_rate?: string, shipping_rate_data?: array{delivery_estimate?: array{maximum?: array{unit: string, value: int}, minimum?: array{unit: string, value: int}}, display_name: string, fixed_amount?: array{amount: int, currency: string, currency_options?: \Stripe\StripeObject}, metadata?: \Stripe\StripeObject, tax_behavior?: string, tax_code?: string, type?: string}}, shipping_details?: null|array{address: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, name: string, phone?: null|string}, statement_descriptor?: string, transfer_data?: null|array{amount?: int, destination: string}} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\Invoice
@throws \Stripe\Exception\ApiErrorException if the request fails | update | php | stripe/stripe-php | lib/Service/InvoiceService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/InvoiceService.php | MIT |
public function updateLine($parentId, $id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v1/invoices/%s/lines/%s', $parentId, $id), $params, $opts);
} | Updates an invoice’s line item. Some fields, such as <code>tax_amounts</code>,
only live on the invoice line item, so they can only be updated through this
endpoint. Other fields, such as <code>amount</code>, live on both the invoice
item and the invoice line item, so updates on this endpoint will propagate to
the invoice item as well. Updating an invoice’s line item is only possible
before the invoice is finalized.
@param string $parentId
@param string $id
@param null|array{amount?: int, description?: string, discountable?: bool, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], expand?: string[], metadata?: null|\Stripe\StripeObject, period?: array{end: int, start: int}, price_data?: array{currency: string, product?: string, product_data?: array{description?: string, images?: string[], metadata?: \Stripe\StripeObject, name: string, tax_code?: string}, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, pricing?: array{price?: string}, quantity?: int, tax_amounts?: null|array{amount: int, tax_rate_data: array{country?: string, description?: string, display_name: string, inclusive: bool, jurisdiction?: string, jurisdiction_level?: string, percentage: float, state?: string, tax_type?: string}, taxability_reason?: string, taxable_amount: int}[], tax_rates?: null|string[]} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\InvoiceLineItem
@throws \Stripe\Exception\ApiErrorException if the request fails | updateLine | php | stripe/stripe-php | lib/Service/InvoiceService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/InvoiceService.php | MIT |
public function updateLines($id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v1/invoices/%s/update_lines', $id), $params, $opts);
} | Updates multiple line items on an invoice. This is only possible when an invoice
is still a draft.
@param string $id
@param null|array{expand?: string[], invoice_metadata?: null|\Stripe\StripeObject, lines: (array{amount?: int, description?: string, discountable?: bool, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], id: string, metadata?: null|\Stripe\StripeObject, period?: array{end: int, start: int}, price_data?: array{currency: string, product?: string, product_data?: array{description?: string, images?: string[], metadata?: \Stripe\StripeObject, name: string, tax_code?: string}, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, pricing?: array{price?: string}, quantity?: int, tax_amounts?: null|array{amount: int, tax_rate_data: array{country?: string, description?: string, display_name: string, inclusive: bool, jurisdiction?: string, jurisdiction_level?: string, percentage: float, state?: string, tax_type?: string}, taxability_reason?: string, taxable_amount: int}[], tax_rates?: null|string[]})[]} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\Invoice
@throws \Stripe\Exception\ApiErrorException if the request fails | updateLines | php | stripe/stripe-php | lib/Service/InvoiceService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/InvoiceService.php | MIT |
public function voidInvoice($id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v1/invoices/%s/void', $id), $params, $opts);
} | Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is
similar to <a href="#delete_invoice">deletion</a>, however it only applies to
finalized invoices and maintains a papertrail where the invoice can still be
found.
Consult with local regulations to determine whether and how an invoice might be
amended, canceled, or voided in the jurisdiction you’re doing business in. You
might need to <a href="#create_invoice">issue another invoice</a> or <a
href="#create_credit_note">credit note</a> instead. Stripe recommends that you
consult with your legal counsel for advice specific to your business.
@param string $id
@param null|array{expand?: string[]} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\Invoice
@throws \Stripe\Exception\ApiErrorException if the request fails | voidInvoice | php | stripe/stripe-php | lib/Service/InvoiceService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/InvoiceService.php | MIT |
public function all($params = null, $opts = null)
{
return $this->requestCollection('get', '/v1/exchange_rates', $params, $opts);
} | Returns a list of objects that contain the rates at which foreign currencies are
converted to one another. Only shows the currencies for which Stripe supports.
@param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\Collection<\Stripe\ExchangeRate>
@throws \Stripe\Exception\ApiErrorException if the request fails | all | php | stripe/stripe-php | lib/Service/ExchangeRateService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/ExchangeRateService.php | MIT |
public function retrieve($id, $params = null, $opts = null)
{
return $this->request('get', $this->buildPath('/v1/exchange_rates/%s', $id), $params, $opts);
} | Retrieves the exchange rates from the given currency to every supported
currency.
@param string $id
@param null|array{expand?: string[]} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\ExchangeRate
@throws \Stripe\Exception\ApiErrorException if the request fails | retrieve | php | stripe/stripe-php | lib/Service/ExchangeRateService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/ExchangeRateService.php | MIT |
public function all($params = null, $opts = null)
{
return $this->requestCollection('get', '/v1/setup_attempts', $params, $opts);
} | Returns a list of SetupAttempts that associate with a provided SetupIntent.
@param null|array{created?: array|int, ending_before?: string, expand?: string[], limit?: int, setup_intent: string, starting_after?: string} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\Collection<\Stripe\SetupAttempt>
@throws \Stripe\Exception\ApiErrorException if the request fails | all | php | stripe/stripe-php | lib/Service/SetupAttemptService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/SetupAttemptService.php | MIT |
public function all($params = null, $opts = null)
{
return $this->requestCollection('get', '/v1/promotion_codes', $params, $opts);
} | Returns a list of your promotion codes.
@param null|array{active?: bool, code?: string, coupon?: string, created?: array|int, customer?: string, ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\Collection<\Stripe\PromotionCode>
@throws \Stripe\Exception\ApiErrorException if the request fails | all | php | stripe/stripe-php | lib/Service/PromotionCodeService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/PromotionCodeService.php | MIT |
public function create($params = null, $opts = null)
{
return $this->request('post', '/v1/promotion_codes', $params, $opts);
} | A promotion code points to a coupon. You can optionally restrict the code to a
specific customer, redemption limit, and expiration date.
@param null|array{active?: bool, code?: string, coupon: string, customer?: string, expand?: string[], expires_at?: int, max_redemptions?: int, metadata?: \Stripe\StripeObject, restrictions?: array{currency_options?: \Stripe\StripeObject, first_time_transaction?: bool, minimum_amount?: int, minimum_amount_currency?: string}} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\PromotionCode
@throws \Stripe\Exception\ApiErrorException if the request fails | create | php | stripe/stripe-php | lib/Service/PromotionCodeService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/PromotionCodeService.php | MIT |
public function retrieve($id, $params = null, $opts = null)
{
return $this->request('get', $this->buildPath('/v1/promotion_codes/%s', $id), $params, $opts);
} | Retrieves the promotion code with the given ID. In order to retrieve a promotion
code by the customer-facing <code>code</code> use <a
href="/docs/api/promotion_codes/list">list</a> with the desired
<code>code</code>.
@param string $id
@param null|array{expand?: string[]} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\PromotionCode
@throws \Stripe\Exception\ApiErrorException if the request fails | retrieve | php | stripe/stripe-php | lib/Service/PromotionCodeService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/PromotionCodeService.php | MIT |
public function update($id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v1/promotion_codes/%s', $id), $params, $opts);
} | Updates the specified promotion code by setting the values of the parameters
passed. Most fields are, by design, not editable.
@param string $id
@param null|array{active?: bool, expand?: string[], metadata?: null|\Stripe\StripeObject, restrictions?: array{currency_options?: \Stripe\StripeObject}} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\PromotionCode
@throws \Stripe\Exception\ApiErrorException if the request fails | update | php | stripe/stripe-php | lib/Service/PromotionCodeService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/PromotionCodeService.php | MIT |
public function all($params = null, $opts = null)
{
return $this->requestCollection('get', '/v1/invoiceitems', $params, $opts);
} | Returns a list of your invoice items. Invoice items are returned sorted by
creation date, with the most recently created invoice items appearing first.
@param null|array{created?: array|int, customer?: string, ending_before?: string, expand?: string[], invoice?: string, limit?: int, pending?: bool, starting_after?: string} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\Collection<\Stripe\InvoiceItem>
@throws \Stripe\Exception\ApiErrorException if the request fails | all | php | stripe/stripe-php | lib/Service/InvoiceItemService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/InvoiceItemService.php | MIT |
public function create($params = null, $opts = null)
{
return $this->request('post', '/v1/invoiceitems', $params, $opts);
} | Creates an item to be added to a draft invoice (up to 250 items per invoice). If
no invoice is specified, the item will be on the next invoice created for the
customer specified.
@param null|array{amount?: int, currency?: string, customer: string, description?: string, discountable?: bool, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], expand?: string[], invoice?: string, metadata?: null|\Stripe\StripeObject, period?: array{end: int, start: int}, price_data?: array{currency: string, product: string, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, pricing?: array{price?: string}, quantity?: int, subscription?: string, tax_behavior?: string, tax_code?: null|string, tax_rates?: string[], unit_amount_decimal?: string} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\InvoiceItem
@throws \Stripe\Exception\ApiErrorException if the request fails | create | php | stripe/stripe-php | lib/Service/InvoiceItemService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/InvoiceItemService.php | MIT |
public function delete($id, $params = null, $opts = null)
{
return $this->request('delete', $this->buildPath('/v1/invoiceitems/%s', $id), $params, $opts);
} | Deletes an invoice item, removing it from an invoice. Deleting invoice items is
only possible when they’re not attached to invoices, or if it’s attached to a
draft invoice.
@param string $id
@param null|array $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\InvoiceItem
@throws \Stripe\Exception\ApiErrorException if the request fails | delete | php | stripe/stripe-php | lib/Service/InvoiceItemService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/InvoiceItemService.php | MIT |
public function retrieve($id, $params = null, $opts = null)
{
return $this->request('get', $this->buildPath('/v1/invoiceitems/%s', $id), $params, $opts);
} | Retrieves the invoice item with the given ID.
@param string $id
@param null|array{expand?: string[]} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\InvoiceItem
@throws \Stripe\Exception\ApiErrorException if the request fails | retrieve | php | stripe/stripe-php | lib/Service/InvoiceItemService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/InvoiceItemService.php | MIT |
public function update($id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v1/invoiceitems/%s', $id), $params, $opts);
} | Updates the amount or description of an invoice item on an upcoming invoice.
Updating an invoice item is only possible before the invoice it’s attached to is
closed.
@param string $id
@param null|array{amount?: int, description?: string, discountable?: bool, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], expand?: string[], metadata?: null|\Stripe\StripeObject, period?: array{end: int, start: int}, price_data?: array{currency: string, product: string, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, pricing?: array{price?: string}, quantity?: int, tax_behavior?: string, tax_code?: null|string, tax_rates?: null|string[], unit_amount_decimal?: string} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\InvoiceItem
@throws \Stripe\Exception\ApiErrorException if the request fails | update | php | stripe/stripe-php | lib/Service/InvoiceItemService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/InvoiceItemService.php | MIT |
public function create($params = null, $opts = null)
{
return $this->request('post', '/v1/account_links', $params, $opts);
} | Creates an AccountLink object that includes a single-use Stripe URL that the
platform can redirect their user to in order to take them through the Connect
Onboarding flow.
@param null|array{account: string, collect?: string, collection_options?: array{fields?: string, future_requirements?: string}, expand?: string[], refresh_url?: string, return_url?: string, type: string} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\AccountLink
@throws \Stripe\Exception\ApiErrorException if the request fails | create | php | stripe/stripe-php | lib/Service/AccountLinkService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/AccountLinkService.php | MIT |
public function all($params = null, $opts = null)
{
return $this->requestCollection('get', '/v1/tax_codes', $params, $opts);
} | A list of <a href="https://stripe.com/docs/tax/tax-categories">all tax codes
available</a> to add to Products in order to allow specific tax calculations.
@param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\Collection<\Stripe\TaxCode>
@throws \Stripe\Exception\ApiErrorException if the request fails | all | php | stripe/stripe-php | lib/Service/TaxCodeService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/TaxCodeService.php | MIT |
public function retrieve($id, $params = null, $opts = null)
{
return $this->request('get', $this->buildPath('/v1/tax_codes/%s', $id), $params, $opts);
} | Retrieves the details of an existing tax code. Supply the unique tax code ID and
Stripe will return the corresponding tax code information.
@param string $id
@param null|array{expand?: string[]} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\TaxCode
@throws \Stripe\Exception\ApiErrorException if the request fails | retrieve | php | stripe/stripe-php | lib/Service/TaxCodeService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/TaxCodeService.php | MIT |
public function all($params = null, $opts = null)
{
return $this->requestCollection('get', '/v1/plans', $params, $opts);
} | Returns a list of your plans.
@param null|array{active?: bool, created?: array|int, ending_before?: string, expand?: string[], limit?: int, product?: string, starting_after?: string} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\Collection<\Stripe\Plan>
@throws \Stripe\Exception\ApiErrorException if the request fails | all | php | stripe/stripe-php | lib/Service/PlanService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/PlanService.php | MIT |
public function create($params = null, $opts = null)
{
return $this->request('post', '/v1/plans', $params, $opts);
} | You can now model subscriptions more flexibly using the <a href="#prices">Prices
API</a>. It replaces the Plans API and is backwards compatible to simplify your
migration.
@param null|array{active?: bool, amount?: int, amount_decimal?: string, billing_scheme?: string, currency: string, expand?: string[], id?: string, interval: string, interval_count?: int, metadata?: null|\Stripe\StripeObject, meter?: string, nickname?: string, product?: array|string, tiers?: (array{flat_amount?: int, flat_amount_decimal?: string, unit_amount?: int, unit_amount_decimal?: string, up_to: array|int|string})[], tiers_mode?: string, transform_usage?: array{divide_by: int, round: string}, trial_period_days?: int, usage_type?: string} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\Plan
@throws \Stripe\Exception\ApiErrorException if the request fails | create | php | stripe/stripe-php | lib/Service/PlanService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/PlanService.php | MIT |
public function delete($id, $params = null, $opts = null)
{
return $this->request('delete', $this->buildPath('/v1/plans/%s', $id), $params, $opts);
} | Deleting plans means new subscribers can’t be added. Existing subscribers aren’t
affected.
@param string $id
@param null|array $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\Plan
@throws \Stripe\Exception\ApiErrorException if the request fails | delete | php | stripe/stripe-php | lib/Service/PlanService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/PlanService.php | MIT |
public function retrieve($id, $params = null, $opts = null)
{
return $this->request('get', $this->buildPath('/v1/plans/%s', $id), $params, $opts);
} | Retrieves the plan with the given ID.
@param string $id
@param null|array{expand?: string[]} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\Plan
@throws \Stripe\Exception\ApiErrorException if the request fails | retrieve | php | stripe/stripe-php | lib/Service/PlanService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/PlanService.php | MIT |
public function update($id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v1/plans/%s', $id), $params, $opts);
} | Updates the specified plan by setting the values of the parameters passed. Any
parameters not provided are left unchanged. By design, you cannot change a
plan’s ID, amount, currency, or billing cycle.
@param string $id
@param null|array{active?: bool, expand?: string[], metadata?: null|\Stripe\StripeObject, nickname?: string, product?: string, trial_period_days?: int} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\Plan
@throws \Stripe\Exception\ApiErrorException if the request fails | update | php | stripe/stripe-php | lib/Service/PlanService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/PlanService.php | MIT |
public function accept($id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v1/quotes/%s/accept', $id), $params, $opts);
} | Accepts the specified quote.
@param string $id
@param null|array{expand?: string[]} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\Quote
@throws \Stripe\Exception\ApiErrorException if the request fails | accept | php | stripe/stripe-php | lib/Service/QuoteService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/QuoteService.php | MIT |
public function all($params = null, $opts = null)
{
return $this->requestCollection('get', '/v1/quotes', $params, $opts);
} | Returns a list of your quotes.
@param null|array{customer?: string, ending_before?: string, expand?: string[], limit?: int, starting_after?: string, status?: string, test_clock?: string} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\Collection<\Stripe\Quote>
@throws \Stripe\Exception\ApiErrorException if the request fails | all | php | stripe/stripe-php | lib/Service/QuoteService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/QuoteService.php | MIT |
public function allComputedUpfrontLineItems($id, $params = null, $opts = null)
{
return $this->requestCollection('get', $this->buildPath('/v1/quotes/%s/computed_upfront_line_items', $id), $params, $opts);
} | When retrieving a quote, there is an includable <a
href="https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items"><strong>computed.upfront.line_items</strong></a>
property containing the first handful of those items. There is also a URL where
you can retrieve the full (paginated) list of upfront line items.
@param string $id
@param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\Collection<\Stripe\LineItem>
@throws \Stripe\Exception\ApiErrorException if the request fails | allComputedUpfrontLineItems | php | stripe/stripe-php | lib/Service/QuoteService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/QuoteService.php | MIT |
public function allLineItems($id, $params = null, $opts = null)
{
return $this->requestCollection('get', $this->buildPath('/v1/quotes/%s/line_items', $id), $params, $opts);
} | When retrieving a quote, there is an includable <strong>line_items</strong>
property containing the first handful of those items. There is also a URL where
you can retrieve the full (paginated) list of line items.
@param string $id
@param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\Collection<\Stripe\LineItem>
@throws \Stripe\Exception\ApiErrorException if the request fails | allLineItems | php | stripe/stripe-php | lib/Service/QuoteService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/QuoteService.php | MIT |
public function cancel($id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v1/quotes/%s/cancel', $id), $params, $opts);
} | Cancels the quote.
@param string $id
@param null|array{expand?: string[]} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\Quote
@throws \Stripe\Exception\ApiErrorException if the request fails | cancel | php | stripe/stripe-php | lib/Service/QuoteService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/QuoteService.php | MIT |
public function create($params = null, $opts = null)
{
return $this->request('post', '/v1/quotes', $params, $opts);
} | A quote models prices and services for a customer. Default options for
<code>header</code>, <code>description</code>, <code>footer</code>, and
<code>expires_at</code> can be set in the dashboard via the <a
href="https://dashboard.stripe.com/settings/billing/quote">quote template</a>.
@param null|array{application_fee_amount?: null|int, application_fee_percent?: null|float, automatic_tax?: array{enabled: bool, liability?: array{account?: string, type: string}}, collection_method?: string, customer?: string, default_tax_rates?: null|string[], description?: null|string, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], expand?: string[], expires_at?: int, footer?: null|string, from_quote?: array{is_revision?: bool, quote: string}, header?: null|string, invoice_settings?: array{days_until_due?: int, issuer?: array{account?: string, type: string}}, line_items?: (array{discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], price?: string, price_data?: array{currency: string, product: string, recurring?: array{interval: string, interval_count?: int}, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, quantity?: int, tax_rates?: null|string[]})[], metadata?: \Stripe\StripeObject, on_behalf_of?: null|string, subscription_data?: array{description?: string, effective_date?: null|array|int|string, metadata?: \Stripe\StripeObject, trial_period_days?: null|int}, test_clock?: string, transfer_data?: null|array{amount?: int, amount_percent?: float, destination: string}} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\Quote
@throws \Stripe\Exception\ApiErrorException if the request fails | create | php | stripe/stripe-php | lib/Service/QuoteService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/QuoteService.php | MIT |
public function finalizeQuote($id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v1/quotes/%s/finalize', $id), $params, $opts);
} | Finalizes the quote.
@param string $id
@param null|array{expand?: string[], expires_at?: int} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\Quote
@throws \Stripe\Exception\ApiErrorException if the request fails | finalizeQuote | php | stripe/stripe-php | lib/Service/QuoteService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/QuoteService.php | MIT |
public function pdf($id, $readBodyChunkCallable, $params = null, $opts = null)
{
$opts = \Stripe\Util\RequestOptions::parse($opts);
if (!isset($opts->apiBase)) {
$opts->apiBase = $this->getClient()->getFilesBase();
}
return $this->requestStream('get', $this->buildPath('/v1/quotes/%s/pdf', $id), $readBodyChunkCallable, $params, $opts);
} | Download the PDF for a finalized quote. Explanation for special handling can be
found <a href="https://docs.stripe.com/quotes/overview#quote_pdf">here</a>.
@param string $id
@param callable $readBodyChunkCallable
@param null|array{expand?: string[]} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return mixed
@throws \Stripe\Exception\ApiErrorException if the request fails | pdf | php | stripe/stripe-php | lib/Service/QuoteService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/QuoteService.php | MIT |
public function retrieve($id, $params = null, $opts = null)
{
return $this->request('get', $this->buildPath('/v1/quotes/%s', $id), $params, $opts);
} | Retrieves the quote with the given ID.
@param string $id
@param null|array{expand?: string[]} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\Quote
@throws \Stripe\Exception\ApiErrorException if the request fails | retrieve | php | stripe/stripe-php | lib/Service/QuoteService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/QuoteService.php | MIT |
public function update($id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v1/quotes/%s', $id), $params, $opts);
} | A quote models prices and services for a customer.
@param string $id
@param null|array{application_fee_amount?: null|int, application_fee_percent?: null|float, automatic_tax?: array{enabled: bool, liability?: array{account?: string, type: string}}, collection_method?: string, customer?: string, default_tax_rates?: null|string[], description?: null|string, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], expand?: string[], expires_at?: int, footer?: null|string, header?: null|string, invoice_settings?: array{days_until_due?: int, issuer?: array{account?: string, type: string}}, line_items?: (array{discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], id?: string, price?: string, price_data?: array{currency: string, product: string, recurring?: array{interval: string, interval_count?: int}, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, quantity?: int, tax_rates?: null|string[]})[], metadata?: \Stripe\StripeObject, on_behalf_of?: null|string, subscription_data?: array{description?: null|string, effective_date?: null|array|int|string, metadata?: \Stripe\StripeObject, trial_period_days?: null|int}, transfer_data?: null|array{amount?: int, amount_percent?: float, destination: string}} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\Quote
@throws \Stripe\Exception\ApiErrorException if the request fails | update | php | stripe/stripe-php | lib/Service/QuoteService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/QuoteService.php | MIT |
public function all($params = null, $opts = null)
{
return $this->requestCollection('get', '/v1/refunds', $params, $opts);
} | Returns a list of all refunds you created. We return the refunds in sorted
order, with the most recent refunds appearing first. The 10 most recent refunds
are always available by default on the Charge object.
@param null|array{charge?: string, created?: array|int, ending_before?: string, expand?: string[], limit?: int, payment_intent?: string, starting_after?: string} $params
@param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
@return \Stripe\Collection<\Stripe\Refund>
@throws \Stripe\Exception\ApiErrorException if the request fails | all | php | stripe/stripe-php | lib/Service/RefundService.php | https://github.com/stripe/stripe-php/blob/master/lib/Service/RefundService.php | MIT |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.