Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F97259041
Customer.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Jan 3, 20:47
Size
2 KB
Mime Type
text/x-php
Expires
Sun, Jan 5, 20:47 (2 d)
Engine
blob
Format
Raw Data
Handle
23367297
Attached To
rPH Phabricator
Customer.php
View Options
<?php
class
Stripe_Customer
extends
Stripe_ApiResource
{
public
static
function
constructFrom
(
$values
,
$apiKey
=
null
)
{
$class
=
get_class
();
return
self
::
scopedConstructFrom
(
$class
,
$values
,
$apiKey
);
}
public
static
function
retrieve
(
$id
,
$apiKey
=
null
)
{
$class
=
get_class
();
return
self
::
_scopedRetrieve
(
$class
,
$id
,
$apiKey
);
}
public
static
function
all
(
$params
=
null
,
$apiKey
=
null
)
{
$class
=
get_class
();
return
self
::
_scopedAll
(
$class
,
$params
,
$apiKey
);
}
public
static
function
create
(
$params
=
null
,
$apiKey
=
null
)
{
$class
=
get_class
();
return
self
::
_scopedCreate
(
$class
,
$params
,
$apiKey
);
}
public
function
save
()
{
$class
=
get_class
();
return
self
::
_scopedSave
(
$class
);
}
public
function
delete
(
$params
=
null
)
{
$class
=
get_class
();
return
self
::
_scopedDelete
(
$class
,
$params
);
}
public
function
addInvoiceItem
(
$params
=
null
)
{
if
(!
$params
)
$params
=
array
();
$params
[
'customer'
]
=
$this
->
id
;
$ii
=
Stripe_InvoiceItem
::
create
(
$params
,
$this
->
_apiKey
);
return
$ii
;
}
public
function
invoices
(
$params
=
null
)
{
if
(!
$params
)
$params
=
array
();
$params
[
'customer'
]
=
$this
->
id
;
$invoices
=
Stripe_Invoice
::
all
(
$params
,
$this
->
_apiKey
);
return
$invoices
;
}
public
function
invoiceItems
(
$params
=
null
)
{
if
(!
$params
)
$params
=
array
();
$params
[
'customer'
]
=
$this
->
id
;
$iis
=
Stripe_InvoiceItem
::
all
(
$params
,
$this
->
_apiKey
);
return
$iis
;
}
public
function
charges
(
$params
=
null
)
{
if
(!
$params
)
$params
=
array
();
$params
[
'customer'
]
=
$this
->
id
;
$charges
=
Stripe_Charge
::
all
(
$params
,
$this
->
_apiKey
);
return
$charges
;
}
public
function
updateSubscription
(
$params
=
null
)
{
$requestor
=
new
Stripe_ApiRequestor
(
$this
->
_apiKey
);
$url
=
$this
->
instanceUrl
()
.
'/subscription'
;
list
(
$response
,
$apiKey
)
=
$requestor
->
request
(
'post'
,
$url
,
$params
);
$this
->
refreshFrom
(
array
(
'subscription'
=>
$response
),
$apiKey
,
true
);
return
$this
->
subscription
;
}
public
function
cancelSubscription
(
$params
=
null
)
{
$requestor
=
new
Stripe_ApiRequestor
(
$this
->
_apiKey
);
$url
=
$this
->
instanceUrl
()
.
'/subscription'
;
list
(
$response
,
$apiKey
)
=
$requestor
->
request
(
'delete'
,
$url
,
$params
);
$this
->
refreshFrom
(
array
(
'subscription'
=>
$response
),
$apiKey
,
true
);
return
$this
->
subscription
;
}
}
Event Timeline
Log In to Comment