Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/wp-conte.../plugins/wpforms-.../vendor_p.../stripe/stripe-p.../lib
File: Source.php
<?php
[0] Fix | Delete
[1] Fix | Delete
// File generated from our OpenAPI spec
[2] Fix | Delete
namespace WPForms\Vendor\Stripe;
[3] Fix | Delete
[4] Fix | Delete
/**
[5] Fix | Delete
* <code>Source</code> objects allow you to accept a variety of payment methods. They
[6] Fix | Delete
* represent a customer's payment instrument, and can be used with the Stripe API
[7] Fix | Delete
* just like a <code>Card</code> object: once chargeable, they can be charged, or can be
[8] Fix | Delete
* attached to customers.
[9] Fix | Delete
*
[10] Fix | Delete
* Stripe doesn't recommend using the deprecated <a href="https://stripe.com/docs/api/sources">Sources API</a>.
[11] Fix | Delete
* We recommend that you adopt the <a href="https://stripe.com/docs/api/payment_methods">PaymentMethods API</a>.
[12] Fix | Delete
* This newer API provides access to our latest features and payment method types.
[13] Fix | Delete
*
[14] Fix | Delete
* Related guides: <a href="https://stripe.com/docs/sources">Sources API</a> and <a href="https://stripe.com/docs/sources/customers">Sources &amp; Customers</a>.
[15] Fix | Delete
*
[16] Fix | Delete
* @property string $id Unique identifier for the object.
[17] Fix | Delete
* @property string $object String representing the object's type. Objects of the same type share the same value.
[18] Fix | Delete
* @property null|\Stripe\StripeObject $ach_credit_transfer
[19] Fix | Delete
* @property null|\Stripe\StripeObject $ach_debit
[20] Fix | Delete
* @property null|\Stripe\StripeObject $acss_debit
[21] Fix | Delete
* @property null|\Stripe\StripeObject $alipay
[22] Fix | Delete
* @property null|int $amount A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount associated with the source. This is the amount for which the source will be chargeable once ready. Required for <code>single_use</code> sources.
[23] Fix | Delete
* @property null|\Stripe\StripeObject $au_becs_debit
[24] Fix | Delete
* @property null|\Stripe\StripeObject $bancontact
[25] Fix | Delete
* @property null|\Stripe\StripeObject $card
[26] Fix | Delete
* @property null|\Stripe\StripeObject $card_present
[27] Fix | Delete
* @property string $client_secret The client secret of the source. Used for client-side retrieval using a publishable key.
[28] Fix | Delete
* @property null|\Stripe\StripeObject $code_verification
[29] Fix | Delete
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
[30] Fix | Delete
* @property null|string $currency Three-letter <a href="https://stripe.com/docs/currencies">ISO code for the currency</a> associated with the source. This is the currency for which the source will be chargeable once ready. Required for <code>single_use</code> sources.
[31] Fix | Delete
* @property null|string $customer The ID of the customer to which this source is attached. This will not be present when the source has not been attached to a customer.
[32] Fix | Delete
* @property null|\Stripe\StripeObject $eps
[33] Fix | Delete
* @property string $flow The authentication <code>flow</code> of the source. <code>flow</code> is one of <code>redirect</code>, <code>receiver</code>, <code>code_verification</code>, <code>none</code>.
[34] Fix | Delete
* @property null|\Stripe\StripeObject $giropay
[35] Fix | Delete
* @property null|\Stripe\StripeObject $ideal
[36] Fix | Delete
* @property null|\Stripe\StripeObject $klarna
[37] Fix | Delete
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
[38] Fix | Delete
* @property null|\Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
[39] Fix | Delete
* @property null|\Stripe\StripeObject $multibanco
[40] Fix | Delete
* @property null|\Stripe\StripeObject $owner Information about the owner of the payment instrument that may be used or required by particular source types.
[41] Fix | Delete
* @property null|\Stripe\StripeObject $p24
[42] Fix | Delete
* @property null|\Stripe\StripeObject $receiver
[43] Fix | Delete
* @property null|\Stripe\StripeObject $redirect
[44] Fix | Delete
* @property null|\Stripe\StripeObject $sepa_credit_transfer
[45] Fix | Delete
* @property null|\Stripe\StripeObject $sepa_debit
[46] Fix | Delete
* @property null|\Stripe\StripeObject $sofort
[47] Fix | Delete
* @property null|\Stripe\StripeObject $source_order
[48] Fix | Delete
* @property null|string $statement_descriptor Extra information about a source. This will appear on your customer's statement every time you charge the source.
[49] Fix | Delete
* @property string $status The status of the source, one of <code>canceled</code>, <code>chargeable</code>, <code>consumed</code>, <code>failed</code>, or <code>pending</code>. Only <code>chargeable</code> sources can be used to create a charge.
[50] Fix | Delete
* @property null|\Stripe\StripeObject $three_d_secure
[51] Fix | Delete
* @property string $type The <code>type</code> of the source. The <code>type</code> is a payment method, one of <code>ach_credit_transfer</code>, <code>ach_debit</code>, <code>alipay</code>, <code>bancontact</code>, <code>card</code>, <code>card_present</code>, <code>eps</code>, <code>giropay</code>, <code>ideal</code>, <code>multibanco</code>, <code>klarna</code>, <code>p24</code>, <code>sepa_debit</code>, <code>sofort</code>, <code>three_d_secure</code>, or <code>wechat</code>. An additional hash is included on the source with a name matching this value. It contains additional information specific to the <a href="https://stripe.com/docs/sources">payment method</a> used.
[52] Fix | Delete
* @property null|string $usage Either <code>reusable</code> or <code>single_use</code>. Whether this source should be reusable or not. Some source types may or may not be reusable by construction, while others may leave the option at creation. If an incompatible value is passed, an error will be returned.
[53] Fix | Delete
* @property null|\Stripe\StripeObject $wechat
[54] Fix | Delete
*/
[55] Fix | Delete
class Source extends ApiResource
[56] Fix | Delete
{
[57] Fix | Delete
const OBJECT_NAME = 'source';
[58] Fix | Delete
use ApiOperations\Create;
[59] Fix | Delete
use ApiOperations\Retrieve;
[60] Fix | Delete
use ApiOperations\Update;
[61] Fix | Delete
const FLOW_CODE_VERIFICATION = 'code_verification';
[62] Fix | Delete
const FLOW_NONE = 'none';
[63] Fix | Delete
const FLOW_RECEIVER = 'receiver';
[64] Fix | Delete
const FLOW_REDIRECT = 'redirect';
[65] Fix | Delete
const STATUS_CANCELED = 'canceled';
[66] Fix | Delete
const STATUS_CHARGEABLE = 'chargeable';
[67] Fix | Delete
const STATUS_CONSUMED = 'consumed';
[68] Fix | Delete
const STATUS_FAILED = 'failed';
[69] Fix | Delete
const STATUS_PENDING = 'pending';
[70] Fix | Delete
const TYPE_ACH_CREDIT_TRANSFER = 'ach_credit_transfer';
[71] Fix | Delete
const TYPE_ACH_DEBIT = 'ach_debit';
[72] Fix | Delete
const TYPE_ACSS_DEBIT = 'acss_debit';
[73] Fix | Delete
const TYPE_ALIPAY = 'alipay';
[74] Fix | Delete
const TYPE_AU_BECS_DEBIT = 'au_becs_debit';
[75] Fix | Delete
const TYPE_BANCONTACT = 'bancontact';
[76] Fix | Delete
const TYPE_CARD = 'card';
[77] Fix | Delete
const TYPE_CARD_PRESENT = 'card_present';
[78] Fix | Delete
const TYPE_EPS = 'eps';
[79] Fix | Delete
const TYPE_GIROPAY = 'giropay';
[80] Fix | Delete
const TYPE_IDEAL = 'ideal';
[81] Fix | Delete
const TYPE_KLARNA = 'klarna';
[82] Fix | Delete
const TYPE_MULTIBANCO = 'multibanco';
[83] Fix | Delete
const TYPE_P24 = 'p24';
[84] Fix | Delete
const TYPE_SEPA_CREDIT_TRANSFER = 'sepa_credit_transfer';
[85] Fix | Delete
const TYPE_SEPA_DEBIT = 'sepa_debit';
[86] Fix | Delete
const TYPE_SOFORT = 'sofort';
[87] Fix | Delete
const TYPE_THREE_D_SECURE = 'three_d_secure';
[88] Fix | Delete
const TYPE_WECHAT = 'wechat';
[89] Fix | Delete
const USAGE_REUSABLE = 'reusable';
[90] Fix | Delete
const USAGE_SINGLE_USE = 'single_use';
[91] Fix | Delete
use ApiOperations\NestedResource;
[92] Fix | Delete
/**
[93] Fix | Delete
* @param null|array $params
[94] Fix | Delete
* @param null|array|string $opts
[95] Fix | Delete
*
[96] Fix | Delete
* @throws \Stripe\Exception\UnexpectedValueException if the source is not attached to a customer
[97] Fix | Delete
* @throws \Stripe\Exception\ApiErrorException if the request fails
[98] Fix | Delete
*
[99] Fix | Delete
* @return \Stripe\Source the detached source
[100] Fix | Delete
*/
[101] Fix | Delete
public function detach($params = null, $opts = null)
[102] Fix | Delete
{
[103] Fix | Delete
self::_validateParams($params);
[104] Fix | Delete
$id = $this['id'];
[105] Fix | Delete
if (!$id) {
[106] Fix | Delete
$class = static::class;
[107] Fix | Delete
$msg = "Could not determine which URL to request: {$class} instance " . "has invalid ID: {$id}";
[108] Fix | Delete
throw new Exception\UnexpectedValueException($msg, null);
[109] Fix | Delete
}
[110] Fix | Delete
if ($this['customer']) {
[111] Fix | Delete
$base = Customer::classUrl();
[112] Fix | Delete
$parentExtn = \urlencode(Util\Util::utf8($this['customer']));
[113] Fix | Delete
$extn = \urlencode(Util\Util::utf8($id));
[114] Fix | Delete
$url = "{$base}/{$parentExtn}/sources/{$extn}";
[115] Fix | Delete
list($response, $opts) = $this->_request('delete', $url, $params, $opts);
[116] Fix | Delete
$this->refreshFrom($response, $opts);
[117] Fix | Delete
return $this;
[118] Fix | Delete
}
[119] Fix | Delete
$message = 'This source object does not appear to be currently attached ' . 'to a customer object.';
[120] Fix | Delete
throw new Exception\UnexpectedValueException($message);
[121] Fix | Delete
}
[122] Fix | Delete
/**
[123] Fix | Delete
* @param string $id
[124] Fix | Delete
* @param null|array $params
[125] Fix | Delete
* @param null|array|string $opts
[126] Fix | Delete
*
[127] Fix | Delete
* @throws \Stripe\Exception\ApiErrorException if the request fails
[128] Fix | Delete
*
[129] Fix | Delete
* @return \Stripe\Collection<\Stripe\SourceTransaction> list of source transactions
[130] Fix | Delete
*/
[131] Fix | Delete
public static function allSourceTransactions($id, $params = null, $opts = null)
[132] Fix | Delete
{
[133] Fix | Delete
$url = static::resourceUrl($id) . '/source_transactions';
[134] Fix | Delete
list($response, $opts) = static::_staticRequest('get', $url, $params, $opts);
[135] Fix | Delete
$obj = \WPForms\Vendor\Stripe\Util\Util::convertToStripeObject($response->json, $opts);
[136] Fix | Delete
$obj->setLastResponse($response);
[137] Fix | Delete
return $obj;
[138] Fix | Delete
}
[139] Fix | Delete
/**
[140] Fix | Delete
* @param null|array $params
[141] Fix | Delete
* @param null|array|string $opts
[142] Fix | Delete
*
[143] Fix | Delete
* @throws \Stripe\Exception\ApiErrorException if the request fails
[144] Fix | Delete
*
[145] Fix | Delete
* @return \Stripe\Source the verified source
[146] Fix | Delete
*/
[147] Fix | Delete
public function verify($params = null, $opts = null)
[148] Fix | Delete
{
[149] Fix | Delete
$url = $this->instanceUrl() . '/verify';
[150] Fix | Delete
list($response, $opts) = $this->_request('post', $url, $params, $opts);
[151] Fix | Delete
$this->refreshFrom($response, $opts);
[152] Fix | Delete
return $this;
[153] Fix | Delete
}
[154] Fix | Delete
}
[155] Fix | Delete
[156] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function