Added selectable num of records on each listing page, fixed up Pagination Records UI, added new stripe library, further worked on stripe integration, fixed mispelling in client details

This commit is contained in:
johnny@pittpc.com 2021-02-10 11:21:38 -05:00
parent c748388b9a
commit 530d46a812
352 changed files with 16193 additions and 7090 deletions

View File

@ -122,11 +122,9 @@
?>
</tbody>
</table>
<?php include("pagination.php"); ?>
</table>
</div>
<?php include("pagination.php"); ?>
</div>
</div>

View File

@ -128,11 +128,9 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
?>
</tbody>
</table>
<?php include("pagination.php"); ?>
</table>
</div>
<?php include("pagination.php"); ?>
</div>
</div>

View File

@ -184,10 +184,8 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
</tbody>
</table>
<?php include("pagination.php"); ?>
</div>
<?php include("pagination.php"); ?>
</div>
</div>

View File

@ -115,10 +115,8 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
</tbody>
</table>
<?php include("pagination.php"); ?>
</div>
<?php include("pagination.php"); ?>
</div>
</div>

36
checkout.php Normal file
View File

@ -0,0 +1,36 @@
<?php
include("config.php");
include("check_login.php");
include("functions.php");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Accept a card payment</title>
<meta name="description" content="A demo of a card payment on Stripe" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="global.css" />
<script src="https://js.stripe.com/v3/"></script>
<script src="https://polyfill.io/v3/polyfill.min.js?version=3.52.1&features=fetch"></script>
<script src="client.js" defer></script>
</head>
<body>
<!-- Display a payment form -->
<form id="payment-form">
<div id="card-element"><!--Stripe.js injects the Card Element--></div>
<button id="submit">
<div class="spinner hidden" id="spinner"></div>
<span id="button-text">Pay</span>
</button>
<p id="card-error" role="alert"></p>
<p class="result-message hidden">
Payment succeeded, see the result in your
<a href="" target="_blank">Stripe dashboard.</a> Refresh the page to pay again.
</p>
</form>
</body>
</html>

118
client.js Normal file
View File

@ -0,0 +1,118 @@
// A reference to Stripe.js initialized with your real test publishable API key.
var stripe = Stripe("<?php echo $stripe_publishable; ?>");
// The items the customer wants to buy
var purchase = {
items: [{ id: "xl-tshirt" }]
};
// Disable the button until we have Stripe set up on the page
document.querySelector("button").disabled = true;
fetch("/create.php", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(purchase)
})
.then(function(result) {
return result.json();
})
.then(function(data) {
var elements = stripe.elements();
var style = {
base: {
color: "#32325d",
fontFamily: 'Courier, monospace',
fontSmoothing: "antialiased",
fontSize: "16px",
"::placeholder": {
color: "#32325d"
}
},
invalid: {
fontFamily: 'Courier, monospace',
color: "#fa755a",
iconColor: "#fa755a"
}
};
var card = elements.create("card", { style: style });
// Stripe injects an iframe into the DOM
card.mount("#card-element");
card.on("change", function (event) {
// Disable the Pay button if there are no card details in the Element
document.querySelector("button").disabled = event.empty;
document.querySelector("#card-error").textContent = event.error ? event.error.message : "";
});
var form = document.getElementById("payment-form");
form.addEventListener("submit", function(event) {
event.preventDefault();
// Complete payment when the submit button is clicked
payWithCard(stripe, card, data.clientSecret);
});
});
// Calls stripe.confirmCardPayment
// If the card requires authentication Stripe shows a pop-up modal to
// prompt the user to enter authentication details without leaving your page.
var payWithCard = function(stripe, card, clientSecret) {
loading(true);
stripe
.confirmCardPayment(clientSecret, {
payment_method: {
card: card
}
})
.then(function(result) {
if (result.error) {
// Show error to your customer
showError(result.error.message);
} else {
// The payment succeeded!
orderComplete(result.paymentIntent.id);
}
});
};
/* ------- UI helpers ------- */
// Shows a success message when the payment is complete
var orderComplete = function(paymentIntentId) {
loading(false);
document
.querySelector(".result-message a")
.setAttribute(
"href",
"https://dashboard.stripe.com/test/payments/" + paymentIntentId
);
document.querySelector(".result-message").classList.remove("hidden");
document.querySelector("button").disabled = true;
};
// Show the customer the error from Stripe if their card fails to charge
var showError = function(errorMsgText) {
loading(false);
var errorMsg = document.querySelector("#card-error");
errorMsg.textContent = errorMsgText;
setTimeout(function() {
errorMsg.textContent = "";
}, 4000);
};
// Show a spinner on payment submission
var loading = function(isLoading) {
if (isLoading) {
// Disable the button and show a spinner
document.querySelector("button").disabled = true;
document.querySelector("#spinner").classList.remove("hidden");
document.querySelector("#button-text").classList.add("hidden");
} else {
document.querySelector("button").disabled = false;
document.querySelector("#spinner").classList.add("hidden");
document.querySelector("#button-text").classList.remove("hidden");
}
};

View File

@ -97,7 +97,7 @@ if(isset($_GET['client_id'])){
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('payment_id') AS num FROM payments, invoices WHERE payments.invoice_id = invoices.invoice_id AND invoices.client_id = $client_id"));
$num_payments = $row['num'];
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('file_id') AS num FROM files WHERE file_archved_at IS NULL AND client_id = $client_id"));
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('file_id') AS num FROM files WHERE file_archived_at IS NULL AND client_id = $client_id"));
$num_files = $row['num'];
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('document_id') AS num FROM documents WHERE document_archived_at IS NULL AND client_id = $client_id"));

View File

@ -224,10 +224,8 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
</tbody>
</table>
<?php include("pagination.php"); ?>
</div>
<?php include("pagination.php"); ?>
</div>
</div>

View File

@ -119,10 +119,8 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
</tbody>
</table>
<?php include("pagination.php"); ?>
</div>
<?php include("pagination.php"); ?>
</div>
</div>

View File

@ -164,10 +164,8 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
</tbody>
</table>
<?php include("pagination.php"); ?>
</div>
<?php include("pagination.php"); ?>
</div>
</div>

View File

@ -129,10 +129,8 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
</tbody>
</table>
<?php include("pagination.php"); ?>
</div>
<?php include("pagination.php"); ?>
</div>
</div>

View File

@ -125,10 +125,8 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
</tbody>
</table>
<?php include("pagination.php"); ?>
</div>
<?php include("pagination.php"); ?>
</div>
</div>

View File

@ -162,10 +162,8 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
</tbody>
</table>
<?php include("pagination.php"); ?>
</div>
<?php include("pagination.php"); ?>
</div>
</div>

View File

@ -135,10 +135,8 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
</tbody>
</table>
<?php include("pagination.php"); ?>
</div>
<?php include("pagination.php"); ?>
</div>
</div>

View File

@ -129,10 +129,8 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
</tbody>
</table>
<?php include("pagination.php"); ?>
</div>
<?php include("pagination.php"); ?>
</div>
</div>

View File

@ -124,10 +124,8 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
</tbody>
</table>
<?php include("pagination.php"); ?>
</div>
<?php include("pagination.php"); ?>
</div>
</div>

View File

@ -117,9 +117,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
</tbody>
</table>
<?php include("pagination.php"); ?>
</div>
<?php include("pagination.php"); ?>
</div>
</div>

View File

@ -152,10 +152,8 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
</tbody>
</table>
<?php include("pagination.php"); ?>
</div>
<?php include("pagination.php"); ?>
</div>
</div>

View File

@ -153,10 +153,8 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
</tbody>
</table>
<?php include("pagination.php"); ?>
</div>
<?php include("pagination.php"); ?>
</div>
</div>

View File

@ -163,11 +163,9 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
?>
</tbody>
</table>
<?php include("pagination.php"); ?>
</table>
</div>
<?php include("pagination.php"); ?>
</div>
</div>

View File

@ -143,10 +143,8 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
</tbody>
</table>
<?php include("pagination.php"); ?>
</div>
<?php include("pagination.php"); ?>
</div>
</div>

View File

@ -141,10 +141,8 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
</tbody>
</table>
<?php include("pagination.php"); ?>
</div>
<?php include("pagination.php"); ?>
</div>
</div>

View File

@ -83,7 +83,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
<div class="row">
<div class="col-sm-4">
<div class="input-group">
<input type="search" class="form-control" name="q" value="<?php if(isset($q)){echo stripslashes($q);} ?>" placeholder="Search Clients">
<input type="search" class="form-control" name="q" value="<?php if(isset($q)){echo stripslashes($q);} ?>" placeholder="Search Clients" autofocus>
<div class="input-group-append">
<button class="btn btn-secondary" type="button" data-toggle="collapse" data-target="#advancedFilter"><i class="fas fa-filter"></i></button>
<button class="btn btn-primary"><i class="fa fa-search"></i></button>
@ -237,10 +237,8 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
</tbody>
</table>
<?php include("pagination.php"); ?>
</div>
<?php include("pagination.php"); ?>
</div>
</div>

View File

@ -63,6 +63,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
</div>
</div>
</form>
<hr>
<div class="table-responsive">
<table class="table table-striped table-borderless table-hover">
<thead class="text-dark <?php if($num_rows[0] == 0){ echo "d-none"; } ?>">
@ -139,11 +140,9 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
?>
</tbody>
</table>
<?php include("pagination.php"); ?>
</table>
</div>
<?php include("pagination.php"); ?>
</div>
</div>

42
create.php Normal file
View File

@ -0,0 +1,42 @@
<?php
include("config.php");
include("check_login.php");
include("functions.php");
?>
<?php
require 'vendor/stripe-php-7.72.0/init.php';
// This is your real test secret API key.
\Stripe\Stripe::setApiKey("$config_stripe_secret");
function calculateOrderAmount(array $items): int {
// Replace this constant with a calculation of the order's amount
// Calculate the order total on the server to prevent
// customers from directly manipulating the amount on the client
return 1400;
}
header('Content-Type: application/json');
try {
// retrieve JSON from POST body
$json_str = file_get_contents('php://input');
$json_obj = json_decode($json_str);
$paymentIntent = \Stripe\PaymentIntent::create([
'amount' => calculateOrderAmount($json_obj->items),
'currency' => 'usd',
]);
$output = [
'clientSecret' => $paymentIntent->client_secret,
];
echo json_encode($output);
} catch (Error $e) {
http_response_code(500);
echo json_encode(['error' => $e->getMessage()]);
}

View File

@ -102,7 +102,7 @@ $total_recurring_invoice_amount = $row['total_recurring_invoice_amount'];
$payment_year = date('Y');
}
?>
<option <?php if($year == $payment_year){ ?> selected <?php } ?> > <?php echo $payment_year; ?></option>
<option <?php if($year == $payment_year){ echo "selected"; } ?> > <?php echo $payment_year; ?></option>
<?php
}

View File

@ -181,10 +181,8 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
</tbody>
</table>
<?php include("pagination.php"); ?>
</div>
<?php include("pagination.php"); ?>
</div>
</div>

172
global.css Normal file
View File

@ -0,0 +1,172 @@
/* Variables */
* {
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, sans-serif;
font-size: 16px;
-webkit-font-smoothing: antialiased;
display: flex;
justify-content: center;
align-content: center;
height: 100vh;
width: 100vw;
}
form {
width: 30vw;
min-width: 500px;
align-self: center;
box-shadow: 0px 0px 0px 0.5px rgba(50, 50, 93, 0.1),
0px 2px 5px 0px rgba(50, 50, 93, 0.1), 0px 1px 1.5px 0px rgba(0, 0, 0, 0.07);
border-radius: 7px;
padding: 40px;
}
input {
border-radius: 6px;
margin-bottom: 6px;
padding: 12px;
border: 1px solid rgba(50, 50, 93, 0.1);
height: 44px;
font-size: 16px;
width: 100%;
background: white;
}
.result-message {
line-height: 22px;
font-size: 16px;
}
.result-message a {
color: rgb(89, 111, 214);
font-weight: 600;
text-decoration: none;
}
.hidden {
display: none;
}
#card-error {
color: rgb(105, 115, 134);
text-align: left;
font-size: 13px;
line-height: 17px;
margin-top: 12px;
}
#card-element {
border-radius: 4px 4px 0 0 ;
padding: 12px;
border: 1px solid rgba(50, 50, 93, 0.1);
height: 44px;
width: 100%;
background: white;
}
#payment-request-button {
margin-bottom: 32px;
}
/* Buttons and links */
button {
background: #5469d4;
color: #ffffff;
font-family: Courier, monospace;
border-radius: 0 0 4px 4px;
border: 0;
padding: 12px 16px;
font-size: 16px;
font-weight: 600;
cursor: pointer;
display: block;
transition: all 0.2s ease;
box-shadow: 0px 4px 5.5px 0px rgba(0, 0, 0, 0.07);
width: 100%;
}
button:hover {
filter: contrast(115%);
}
button:disabled {
opacity: 0.5;
cursor: default;
}
/* spinner/processing state, errors */
.spinner,
.spinner:before,
.spinner:after {
border-radius: 50%;
}
.spinner {
color: #ffffff;
font-size: 22px;
text-indent: -99999px;
margin: 0px auto;
position: relative;
width: 20px;
height: 20px;
box-shadow: inset 0 0 0 2px;
-webkit-transform: translateZ(0);
-ms-transform: translateZ(0);
transform: translateZ(0);
}
.spinner:before,
.spinner:after {
position: absolute;
content: "";
}
.spinner:before {
width: 10.4px;
height: 20.4px;
background: #5469d4;
border-radius: 20.4px 0 0 20.4px;
top: -0.2px;
left: -0.2px;
-webkit-transform-origin: 10.4px 10.2px;
transform-origin: 10.4px 10.2px;
-webkit-animation: loading 2s infinite ease 1.5s;
animation: loading 2s infinite ease 1.5s;
}
.spinner:after {
width: 10.4px;
height: 10.2px;
background: #5469d4;
border-radius: 0 10.2px 10.2px 0;
top: -0.1px;
left: 10.2px;
-webkit-transform-origin: 0px 10.2px;
transform-origin: 0px 10.2px;
-webkit-animation: loading 2s infinite ease;
animation: loading 2s infinite ease;
}
@-webkit-keyframes loading {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
@keyframes loading {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
@media only screen and (max-width: 600px) {
form {
width: 80vw;
}
}

View File

@ -312,10 +312,8 @@
</tbody>
</table>
<?php include("pagination.php"); ?>
</div>
<?php include("pagination.php"); ?>
</div>
</div>

View File

@ -151,10 +151,8 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
</tbody>
</table>
<?php include("pagination.php"); ?>
</div>
<?php include("pagination.php"); ?>
</div>
</div>

View File

@ -1,17 +0,0 @@
<?php include("header.php"); ?>
<div class="row justify-content-md-center">
<div class="col-md-5">
<div class="card mt-5">
<div class="card-body bg-light text-center">
<h2 class="mb-3">Where did everybody go?</h2>
<i class="far fa-fw fa-4x fa-frown-open mb-3"></i>
<h4 class="mb-4">why not invite someone over?</h4>
<button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#addClientModal"><i class="fas fa-fw fa-plus"></i></button>
</div>
</div>
</div>
</div>
<?php include("add_client_modal.php"); ?>
<?php include("footer.php"); ?>

View File

@ -8,65 +8,85 @@ if ($total_found_rows > 10) {
?>
<ul class="pagination justify-content-end">
<hr>
<?php
if($total_pages <= 100){
$pages_split = 10;
}
if(($total_pages <= 1000) AND ($total_pages > 100)){
$pages_split = 100;
}
if(($total_pages <= 10000) AND ($total_pages > 1000)){
$pages_split = 1000;
}
if($p > 1){
$prev_class = "";
}else{
$prev_class = "disabled";
}
if($p <> $total_pages) {
$next_class = "";
}else{
$next_class = "disabled";
}
$url_query_strings = http_build_query(array_merge($_GET,array('p' => $i)));
$prev_page = $p - 1;
$next_page = $p + 1;
if($p > 1){
echo "<li class='page-item $prev_class'><a class='page-link' href='?$url_query_strings&p=$prev_page'>Prev</a></li>";
}
while($i < $total_pages){
$i++;
if(($i == 1) OR (($p <= 3) AND ($i <= 6)) OR (($i > $total_pages - 6) AND ($p > $total_pages - 3 )) OR (is_int($i / $pages_split)) OR (($p > 3) AND ($i >= $p - 2) AND ($i <= $p + 3)) OR ($i == $total_pages)){
if($p == $i ) {
$page_class = "active";
}else{
$page_class = "";
}
echo "<li class='page-item $page_class'><a class='page-link' href='?$url_query_strings&p=$i'>$i</a></li>";
<div class="row">
<div class="col mb-3">
<form action="post.php" method="post">
<select onchange="this.form.submit()" class="input-form select2" name="change_records_per_page">
<option <?php if($config_records_per_page == 5){ echo "selected"; } ?> >5</option>
<option <?php if($config_records_per_page == 10){ echo "selected"; } ?> >10</option>
<option <?php if($config_records_per_page == 20){ echo "selected"; } ?> >20</option>
<option <?php if($config_records_per_page == 50){ echo "selected"; } ?> >50</option>
<option <?php if($config_records_per_page == 100){ echo "selected"; } ?> >100</option>
<option <?php if($config_records_per_page == 500){ echo "selected"; } ?> >500</option>
</select>
</form>
</div>
<div class="col mb-3">
<p class="text-center mt-2"><?php echo $total_found_rows; ?></p>
</div>
<div class="col mb-3">
<ul class="pagination justify-content-end">
<?php
if($total_pages <= 100){
$pages_split = 10;
}
if(($total_pages <= 1000) AND ($total_pages > 100)){
$pages_split = 100;
}
if(($total_pages <= 10000) AND ($total_pages > 1000)){
$pages_split = 1000;
}
if($p > 1){
$prev_class = "";
}else{
$prev_class = "disabled";
}
if($p <> $total_pages) {
$next_class = "";
}else{
$next_class = "disabled";
}
$url_query_strings = http_build_query(array_merge($_GET,array('p' => $i)));
$prev_page = $p - 1;
$next_page = $p + 1;
if($p > 1){
echo "<li class='page-item $prev_class'><a class='page-link' href='?$url_query_strings&p=$prev_page'>Prev</a></li>";
}
while($i < $total_pages){
$i++;
if(($i == 1) OR (($p <= 3) AND ($i <= 6)) OR (($i > $total_pages - 6) AND ($p > $total_pages - 3 )) OR (is_int($i / $pages_split)) OR (($p > 3) AND ($i >= $p - 2) AND ($i <= $p + 3)) OR ($i == $total_pages)){
if($p == $i ) {
$page_class = "active";
}else{
$page_class = "";
}
echo "<li class='page-item $page_class'><a class='page-link' href='?$url_query_strings&p=$i'>$i</a></li>";
}
}
}
if($p <> $total_pages){
echo "<li class='page_item $next_class'><a class='page-link' href='?$url_query_strings&p=$next_page'>Next</a></li>";
}
if($p <> $total_pages){
echo "<li class='page_item $next_class'><a class='page-link' href='?$url_query_strings&p=$next_page'>Next</a></li>";
}
?>
?>
</ul>
</ul>
</div>
</div>
<?php
}
if($total_found_rows == 0){
echo "<center><h3 class='text-secondary'>No Records Here</h3></center>";
}else{
echo "<div class='justify-content-start'><br><strong>Records:</strong> $total_found_rows</div>";
echo "<center><h3 class='text-secondary'><i class='fa fa-fw fa-2x fa-meh-rolling-eyes'></i><br>Records? What..</h3></center>";
}
?>

View File

@ -150,10 +150,8 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
</tbody>
</table>
<?php include("pagination.php"); ?>
</div>
<?php include("pagination.php"); ?>
</div>
</div>

View File

@ -13,6 +13,16 @@ require_once $mpdf_path . '/vendor/autoload.php';
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
if(isset($_POST['change_records_per_page'])){
$records_per_page = intval($_POST['change_records_per_page']);
mysqli_query($mysqli,"UPDATE settings SET config_records_per_page = $records_per_page WHERE company_id = $session_company_id");
header("Location: " . $_SERVER["HTTP_REFERER"]);
}
if(isset($_GET['switch_company'])){
$company_id = intval($_GET['switch_company']);
@ -475,9 +485,8 @@ if(isset($_POST['edit_default_settings'])){
$config_default_transfer_to_account = intval($_POST['config_default_transfer_to_account']);
$config_default_calendar = intval($_POST['config_default_calendar']);
$config_default_net_terms = intval($_POST['config_default_net_terms']);
$config_records_per_page = intval($_POST['config_records_per_page']);
mysqli_query($mysqli,"UPDATE settings SET config_default_expense_account = $config_default_expense_account, config_default_payment_account = $config_default_payment_account, config_default_payment_method = '$config_default_payment_method', config_default_expense_payment_method = '$config_default_expense_payment_method', config_default_transfer_from_account = $config_default_transfer_from_account, config_default_transfer_to_account = $config_default_transfer_to_account, config_default_calendar = $config_default_calendar, config_default_net_terms = $config_default_net_terms, config_records_per_page = $config_records_per_page WHERE company_id = $session_company_id");
mysqli_query($mysqli,"UPDATE settings SET config_default_expense_account = $config_default_expense_account, config_default_payment_account = $config_default_payment_account, config_default_payment_method = '$config_default_payment_method', config_default_expense_payment_method = '$config_default_expense_payment_method', config_default_transfer_from_account = $config_default_transfer_from_account, config_default_transfer_to_account = $config_default_transfer_to_account, config_default_calendar = $config_default_calendar, config_default_net_terms = $config_default_net_terms WHERE company_id = $session_company_id");
//Logging
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Settings', log_action = 'Modified', log_description = 'Defaults', log_created_at = NOW(), company_id = $session_company_id, user_id = $session_user_id");

View File

@ -125,10 +125,8 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
</tbody>
</table>
<?php include("pagination.php"); ?>
</div>
<?php include("pagination.php"); ?>
</div>
</div>

View File

@ -193,10 +193,8 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
</tbody>
</table>
<?php include("pagination.php"); ?>
</div>
<?php include("pagination.php"); ?>
</div>
</div>

View File

@ -191,10 +191,8 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
</tbody>
</table>
<?php include("pagination.php"); ?>
</div>
<?php include("pagination.php"); ?>
</div>
</div>

View File

@ -62,105 +62,102 @@ $sql_tax = mysqli_query($mysqli,"SELECT * FROM taxes WHERE company_id = $session
<?php
$tax_line_quarter_one = 0;
$tax_collected_quarter_one = 0;
for($month = 1; $month<=3; $month++) {
$sql_payments = mysqli_query($mysqli,"SELECT SUM(item_tax) AS tax_line_amount_for_month FROM taxes, invoices, invoice_items
$sql_tax_collected = mysqli_query($mysqli,"SELECT SUM(item_tax) AS tax_collected_for_month FROM taxes, invoices, invoice_items
WHERE invoice_items.invoice_id = invoices.invoice_id
AND invoices.status LIKE 'Paid'
AND invoices_items.tax_id = $tax_id
AND YEAR(invoice_date) = $year AND MONTH(invoice_date) = $month"
);
$row = mysqli_fetch_array($sql_payments);
$payment_amount_for_month = $row['payment_amount_for_month'];
$sql_revenues = mysqli_query($mysqli,"SELECT SUM(revenue_amount) AS revenue_amount_for_month FROM revenues WHERE revenues.category_id = $category_id AND YEAR(revenue_date) = $year AND MONTH(revenue_date) = $month");
$row = mysqli_fetch_array($sql_revenues);
$revenue_amount_for_month = $row['revenue_amount_for_month'];
$payment_amount_for_month = $payment_amount_for_month + $revenue_amount_for_month;
$row = mysqli_fetch_array($sql_tax_collected);
$tax_collected_for_month = $row['tax_collected_for_month'];
$payment_amount_for_quarter_one = $payment_amount_for_quarter_one + $payment_amount_for_month;
$tax_collected_quarter_one = $tax_collected_quarter_one + $tax_collected_for_month;
}
?>
<td class="text-right">$<?php echo number_format($payment_amount_for_quarter_one,2); ?></td>
<td class="text-right">$<?php echo number_format($tax_collected_quarter_one,2); ?></td>
<?php
$payment_amount_for_quarter_two = 0;
$tax_collected_quarter_two = 0;
for($month = 4; $month<=6; $month++) {
$sql_payments = mysqli_query($mysqli,"SELECT SUM(payment_amount) AS payment_amount_for_month FROM payments, invoices WHERE payments.invoice_id = invoices.invoice_id AND invoices.category_id = $category_id AND YEAR(payment_date) = $year AND MONTH(payment_date) = $month");
$row = mysqli_fetch_array($sql_payments);
$payment_amount_for_month = $row['payment_amount_for_month'];
$sql_revenues = mysqli_query($mysqli,"SELECT SUM(revenue_amount) AS revenue_amount_for_month FROM revenues WHERE revenues.category_id = $category_id AND YEAR(revenue_date) = $year AND MONTH(revenue_date) = $month");
$row = mysqli_fetch_array($sql_revenues);
$revenue_amount_for_month = $row['revenue_amount_for_month'];
$payment_amount_for_month = $payment_amount_for_month + $revenue_amount_for_month;
$payment_amount_for_quarter_two = $payment_amount_for_quarter_two + $payment_amount_for_month;
for($month = 4; $month <= 6; $month ++) {
$sql_tax_collected = mysqli_query($mysqli,"SELECT SUM(item_tax) AS tax_collected_for_month FROM taxes, invoices, invoice_items
WHERE invoice_items.invoice_id = invoices.invoice_id
AND invoices.status LIKE 'Paid'
AND invoices_items.tax_id = $tax_id
AND YEAR(invoice_date) = $year AND MONTH(invoice_date) = $month"
);
$row = mysqli_fetch_array($sql_tax_collected);
$tax_collected_for_month = $row['tax_collected_for_month'];
$tax_collected_quarter_two = $tax_collected_quarter_two + $tax_collected_for_month;
}
?>
<td class="text-right">$<?php echo number_format($payment_amount_for_quarter_two,2); ?></td>
<td class="text-right">$<?php echo number_format($tax_collected_quarter_two,2); ?></td>
<?php
$payment_amount_for_quarter_three = 0;
$tax_collected_quarter_three = 0;
for($month = 7; $month<=9; $month++) {
$sql_payments = mysqli_query($mysqli,"SELECT SUM(payment_amount) AS payment_amount_for_month FROM payments, invoices WHERE payments.invoice_id = invoices.invoice_id AND invoices.category_id = $category_id AND YEAR(payment_date) = $year AND MONTH(payment_date) = $month");
$row = mysqli_fetch_array($sql_payments);
$payment_amount_for_month = $row['payment_amount_for_month'];
$sql_revenues = mysqli_query($mysqli,"SELECT SUM(revenue_amount) AS revenue_amount_for_month FROM revenues WHERE revenues.category_id = $category_id AND YEAR(revenue_date) = $year AND MONTH(revenue_date) = $month");
$row = mysqli_fetch_array($sql_revenues);
$revenue_amount_for_month = $row['revenue_amount_for_month'];
$payment_amount_for_month = $payment_amount_for_month + $revenue_amount_for_month;
$payment_amount_for_quarter_three = $payment_amount_for_quarter_three + $payment_amount_for_month;
for($month = 7; $month <= 9; $month ++) {
$sql_tax_collected = mysqli_query($mysqli,"SELECT SUM(item_tax) AS tax_collected_for_month FROM taxes, invoices, invoice_items
WHERE invoice_items.invoice_id = invoices.invoice_id
AND invoices.status LIKE 'Paid'
AND invoices_items.tax_id = $tax_id
AND YEAR(invoice_date) = $year AND MONTH(invoice_date) = $month"
);
$row = mysqli_fetch_array($sql_tax_collected);
$tax_collected_for_month = $row['tax_collected_for_month'];
$tax_collected_quarter_three = $tax_collected_quarter_three + $tax_collected_for_month;
}
?>
<td class="text-right">$<?php echo number_format($payment_amount_for_quarter_three,2); ?></td>
<td class="text-right">$<?php echo number_format($tax_collected_quarter_three,2); ?></td>
<?php
$payment_amount_for_quarter_four = 0;
$tax_collected_quarter_four = 0;
for($month = 10; $month<=12; $month++) {
$sql_payments = mysqli_query($mysqli,"SELECT SUM(payment_amount) AS payment_amount_for_month FROM payments, invoices WHERE payments.invoice_id = invoices.invoice_id AND invoices.category_id = $category_id AND YEAR(payment_date) = $year AND MONTH(payment_date) = $month");
$row = mysqli_fetch_array($sql_payments);
$payment_amount_for_month = $row['payment_amount_for_month'];
for($month = 10; $month <= 12; $month ++) {
$sql_tax_collected = mysqli_query($mysqli,"SELECT SUM(item_tax) AS tax_collected_for_month FROM taxes, invoices, invoice_items
WHERE invoice_items.invoice_id = invoices.invoice_id
AND invoices.status LIKE 'Paid'
AND invoices_items.tax_id = $tax_id
AND YEAR(invoice_date) = $year AND MONTH(invoice_date) = $month"
);
$row = mysqli_fetch_array($sql_tax_collected);
$tax_collected_for_month = $row['tax_collected_for_month'];
$sql_revenues = mysqli_query($mysqli,"SELECT SUM(revenue_amount) AS revenue_amount_for_month FROM revenues WHERE revenues.category_id = $category_id AND YEAR(revenue_date) = $year AND MONTH(revenue_date) = $month");
$row = mysqli_fetch_array($sql_revenues);
$revenue_amount_for_month = $row['revenue_amount_for_month'];
$payment_amount_for_month = $payment_amount_for_month + $revenue_amount_for_month;
$payment_amount_for_quarter_four = $payment_amount_for_quarter_four + $payment_amount_for_month;
$tax_collected_quarter_four = $tax_collected_quarter_four + $tax_collected_for_month;
}
$total_payments_for_all_four_quarters = $payment_amount_for_quarter_one + $payment_amount_for_quarter_two + $payment_amount_for_quarter_three + $payment_amount_for_quarter_four;
$total_tax_collected_four_quarters = $tax_collected_quarter_one + $tax_collected_quarter_two + $tax_collected_quarter_three + $tax_collected_quarter_four;
?>
<td class="text-right">$<?php echo number_format($payment_amount_for_quarter_four,2); ?></td>
<td class="text-right">$<?php echo number_format($tax_collected_quarter_four,2); ?></td>
<td class="text-right">$<?php echo number_format($total_payments_for_all_four_quarters,2); ?></td>
<td class="text-right">$<?php echo number_format($total_tax_collected_four_quarters,2); ?></td>
</tr>
<?php
$total_payment_for_all_months = 0;
}
@ -170,7 +167,7 @@ $sql_tax = mysqli_query($mysqli,"SELECT * FROM taxes WHERE company_id = $session
<th>Total Taxes<br><br><br></th>
<?php
$expense_total_amount_for_quarter_one = 0;
$tax_total_for_quarter_one = 0;
for($month = 1; $month<=3; $month++) {
$sql_expenses = mysqli_query($mysqli,"SELECT SUM(expense_amount) AS expense_total_amount_for_month FROM expenses WHERE category_id > 0 AND YEAR(expense_date) = $year AND MONTH(expense_date) = $month AND vendor_id > 0 AND company_id = $session_company_id");

View File

@ -164,10 +164,8 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
</tbody>
</table>
<?php include("pagination.php"); ?>
</div>
<?php include("pagination.php"); ?>
</div>
</div>

View File

@ -196,20 +196,6 @@
</div>
</div>
<div class="form-group">
<label>Records per Page</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-sort"></i></span>
</div>
<select class="form-control select2" name="config_records_per_page">
<?php foreach($records_per_page_array as $records_per_page) { ?>
<option <?php if($config_records_per_page == $records_per_page){ echo "selected"; } ?> ><?php echo $records_per_page; ?></option>
<?php } ?>
</select>
</div>
</div>
<hr>
<button type="submit" name="edit_default_settings" class="btn btn-primary">Save</button>

View File

@ -128,10 +128,8 @@ $total_pages = ceil($total_found_rows / 10);
</tbody>
</table>
<?php include("pagination.php"); ?>
</div>
<?php include("pagination.php"); ?>
</div>
</div>

30
test_noclients.php Normal file
View File

@ -0,0 +1,30 @@
<?php include("header.php"); ?>
<div class="row justify-content-md-center">
<div class="col-md-5">
<div class="card mt-5">
<div class="card-body bg-light text-center">
<h2 class="mb-3">Hey! Wheres the party?</h2>
<i class="far fa-fw fa-4x fa-frown-open mb-3"></i>
<h4 class="mb-4">why not invite someone over?</h4>
<button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#addClientModal"><i class="fas fa-fw fa-plus"></i></button>
</div>
</div>
</div>
</div>
<div class="row justify-content-md-center">
<div class="col-md-5">
<div class="card mt-5">
<div class="card-body bg-light text-center">
<h2 class="mb-3">We don't know where we're going?</h2>
<i class="far fa-fw fa-4x fa-frown-open mb-3"></i>
<h4 class="mb-4">why not invite someone over?</h4>
<button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#addClientModal"><i class="fas fa-fw fa-plus"></i></button>
</div>
</div>
</div>
</div>
<?php include("add_client_modal.php"); ?>
<?php include("footer.php"); ?>

View File

@ -202,10 +202,8 @@
</tbody>
</table>
<?php include("pagination.php"); ?>
</div>
<?php include("pagination.php"); ?>
</div>
</div>

View File

@ -162,10 +162,8 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
</tbody>
</table>
<?php include("pagination.php"); ?>
</div>
<?php include("pagination.php"); ?>
</div>
</div>

View File

@ -172,10 +172,8 @@
</tbody>
</table>
<?php include("pagination.php"); ?>
</div>
<?php include("pagination.php"); ?>
</div>
</div>

View File

@ -167,10 +167,8 @@
</tbody>
</table>
<?php include("pagination.php"); ?>
</div>
<?php include("pagination.php"); ?>
</div>
</div>

View File

@ -1,769 +0,0 @@
# Changelog
## 7.0.2 - 2019-09-06
* [#729](https://github.com/stripe/stripe-php/pull/729) Fix usage of `SignatureVerificationException` in PHPDoc blocks
## 7.0.1 - 2019-09-05
* [#728](https://github.com/stripe/stripe-php/pull/728) Clean up Collection
## 7.0.0 - 2019-09-03
Major version release. The [migration guide](https://github.com/stripe/stripe-php/wiki/Migration-guide-for-v7) contains a detailed list of backwards-incompatible changes with upgrade instructions.
Pull requests included in this release (cf. [#552](https://github.com/stripe/stripe-php/pull/552)) (⚠️ = breaking changes):
* ⚠️ Drop support for PHP 5.4 ([#551](https://github.com/stripe/stripe-php/pull/551))
* ⚠️ Drop support for PHP 5.5 ([#554](https://github.com/stripe/stripe-php/pull/554))
* Bump dependencies ([#553](https://github.com/stripe/stripe-php/pull/553))
* Remove `CURLFile` check ([#555](https://github.com/stripe/stripe-php/pull/555))
* Update constant definitions for PHP >= 5.6 ([#556](https://github.com/stripe/stripe-php/pull/556))
* ⚠️ Remove `FileUpload` alias ([#557](https://github.com/stripe/stripe-php/pull/557))
* Remove `curl_reset` check ([#570](https://github.com/stripe/stripe-php/pull/570))
* Use `\Stripe\<class>::class` constant instead of strings ([#643](https://github.com/stripe/stripe-php/pull/643))
* Use `array_column` to flatten params ([#686](https://github.com/stripe/stripe-php/pull/686))
* ⚠️ Remove deprecated methods ([#692](https://github.com/stripe/stripe-php/pull/692))
* ⚠️ Remove `IssuerFraudRecord` ([#696](https://github.com/stripe/stripe-php/pull/696))
* Update constructors of Stripe exception classes ([#559](https://github.com/stripe/stripe-php/pull/559))
* Fix remaining TODOs ([#700](https://github.com/stripe/stripe-php/pull/700))
* Use yield for autopagination ([#703](https://github.com/stripe/stripe-php/pull/703))
* ⚠️ Rename fake magic methods and rewrite array conversion ([#704](https://github.com/stripe/stripe-php/pull/704))
* Add `ErrorObject` to Stripe exceptions ([#705](https://github.com/stripe/stripe-php/pull/705))
* Start using PHP CS Fixer ([#706](https://github.com/stripe/stripe-php/pull/706))
* Update error messages for nested resource operations ([#708](https://github.com/stripe/stripe-php/pull/708))
* Upgrade retry logic ([#707](https://github.com/stripe/stripe-php/pull/707))
* ⚠️ `Collection` improvements / fixes ([#715](https://github.com/stripe/stripe-php/pull/715))
* ⚠️ Modernize exceptions ([#709](https://github.com/stripe/stripe-php/pull/709))
* Add constants for error codes ([#716](https://github.com/stripe/stripe-php/pull/716))
* Update certificate bundle ([#717](https://github.com/stripe/stripe-php/pull/717))
* Retry requests on a 429 that's a lock timeout ([#718](https://github.com/stripe/stripe-php/pull/718))
* Fix `toArray()` calls ([#719](https://github.com/stripe/stripe-php/pull/719))
* Couple of fixes for PHP 7.4 ([#725](https://github.com/stripe/stripe-php/pull/725))
## 6.43.1 - 2019-08-29
* [#722](https://github.com/stripe/stripe-php/pull/722) Make `LoggerInterface::error` compatible with its PSR-3 counterpart
* [#714](https://github.com/stripe/stripe-php/pull/714) Add `pending_setup_intent` property in `Subscription`
* [#713](https://github.com/stripe/stripe-php/pull/713) Add typehint to `ApiResponse`
* [#712](https://github.com/stripe/stripe-php/pull/712) Fix comment
* [#701](https://github.com/stripe/stripe-php/pull/701) Start testing PHP 7.3
## 6.43.0 - 2019-08-09
* [#694](https://github.com/stripe/stripe-php/pull/694) Add `SubscriptionItem::createUsageRecord` method
## 6.42.0 - 2019-08-09
* [#688](https://github.com/stripe/stripe-php/pull/688) Remove `SubscriptionScheduleRevision`
* Note that this is technically a breaking change, however we've chosen to release it as a minor version in light of the fact that this resource and its API methods were virtually unused.
## 6.41.0 - 2019-07-31
* [#683](https://github.com/stripe/stripe-php/pull/683) Move the List Balance History API to `/v1/balance_transactions`
## 6.40.0 - 2019-06-27
* [#675](https://github.com/stripe/stripe-php/pull/675) Add support for `SetupIntent` resource and APIs
## 6.39.2 - 2019-06-26
* [#676](https://github.com/stripe/stripe-php/pull/676) Fix exception message in `CustomerBalanceTransaction::update()`
## 6.39.1 - 2019-06-25
* [#674](https://github.com/stripe/stripe-php/pull/674) Add new constants for `collection_method` on `Invoice`
## 6.39.0 - 2019-06-24
* [#673](https://github.com/stripe/stripe-php/pull/673) Enable request latency telemetry by default
## 6.38.0 - 2019-06-17
* [#649](https://github.com/stripe/stripe-php/pull/649) Add support for `CustomerBalanceTransaction` resource and APIs
## 6.37.2 - 2019-06-17
* [#671](https://github.com/stripe/stripe-php/pull/671) Add new PHPDoc
* [#672](https://github.com/stripe/stripe-php/pull/672) Add constants for `submit_type` on Checkout `Session`
## 6.37.1 - 2019-06-14
* [#670](https://github.com/stripe/stripe-php/pull/670) Add new PHPDoc
## 6.37.0 - 2019-05-23
* [#663](https://github.com/stripe/stripe-php/pull/663) Add support for `radar.early_fraud_warning` resource
## 6.36.0 - 2019-05-22
* [#661](https://github.com/stripe/stripe-php/pull/661) Add constants for new TaxId types
* [#662](https://github.com/stripe/stripe-php/pull/662) Add constants for BalanceTransaction types
## 6.35.2 - 2019-05-20
* [#655](https://github.com/stripe/stripe-php/pull/655) Add constants for payment intent statuses
* [#659](https://github.com/stripe/stripe-php/pull/659) Fix PHPDoc for various nested Account actions
* [#660](https://github.com/stripe/stripe-php/pull/660) Fix various PHPDoc
## 6.35.1 - 2019-05-20
* [#658](https://github.com/stripe/stripe-php/pull/658) Use absolute value when checking timestamp tolerance
## 6.35.0 - 2019-05-14
* [#651](https://github.com/stripe/stripe-php/pull/651) Add support for the Capability resource and APIs
## 6.34.6 - 2019-05-13
* [#654](https://github.com/stripe/stripe-php/pull/654) Fix typo in definition of `Event::PAYMENT_METHOD_ATTACHED` constant
## 6.34.5 - 2019-05-06
* [#647](https://github.com/stripe/stripe-php/pull/647) Set the return type to static for more operations
## 6.34.4 - 2019-05-06
* [#650](https://github.com/stripe/stripe-php/pull/650) Add missing constants for Event types
## 6.34.3 - 2019-05-01
* [#644](https://github.com/stripe/stripe-php/pull/644) Update return type to `static` to improve static analysis
* [#645](https://github.com/stripe/stripe-php/pull/645) Fix constant for `payment_intent.payment_failed`
## 6.34.2 - 2019-04-26
* [#642](https://github.com/stripe/stripe-php/pull/642) Fix an issue where existing idempotency keys would be overwritten when using automatic retries
## 6.34.1 - 2019-04-25
* [#640](https://github.com/stripe/stripe-php/pull/640) Add missing phpdocs
## 6.34.0 - 2019-04-24
* [#626](https://github.com/stripe/stripe-php/pull/626) Add support for the `TaxRate` resource and APIs
* [#639](https://github.com/stripe/stripe-php/pull/639) Fix multiple phpdoc issues
## 6.33.0 - 2019-04-22
* [#630](https://github.com/stripe/stripe-php/pull/630) Add support for the `TaxId` resource and APIs
## 6.32.1 - 2019-04-19
* [#636](https://github.com/stripe/stripe-php/pull/636) Correct type of `$personId` in PHPDoc
## 6.32.0 - 2019-04-18
* [#621](https://github.com/stripe/stripe-php/pull/621) Add support for `CreditNote`
## 6.31.5 - 2019-04-12
* [#628](https://github.com/stripe/stripe-php/pull/628) Add constants for `person.*` event types
* [#628](https://github.com/stripe/stripe-php/pull/628) Add missing constants for `Account` and `Person`
## 6.31.4 - 2019-04-05
* [#624](https://github.com/stripe/stripe-php/pull/624) Fix encoding of nested parameters in multipart requests
## 6.31.3 - 2019-04-02
* [#623](https://github.com/stripe/stripe-php/pull/623) Only use HTTP/2 with curl >= 7.60.0
## 6.31.2 - 2019-03-25
* [#619](https://github.com/stripe/stripe-php/pull/619) Fix PHPDoc return types for list methods for nested resources
## 6.31.1 - 2019-03-22
* [#612](https://github.com/stripe/stripe-php/pull/612) Add a lot of constants
* [#614](https://github.com/stripe/stripe-php/pull/614) Add missing subscription status constants
## 6.31.0 - 2019-03-18
* [#600](https://github.com/stripe/stripe-php/pull/600) Add support for the `PaymentMethod` resource and APIs
* [#606](https://github.com/stripe/stripe-php/pull/606) Add support for retrieving a Checkout `Session`
* [#611](https://github.com/stripe/stripe-php/pull/611) Add support for deleting a Terminal `Location` and `Reader`
## 6.30.5 - 2019-03-11
* [#607](https://github.com/stripe/stripe-php/pull/607) Correctly handle case where a metadata key is called `metadata`
## 6.30.4 - 2019-02-27
* [#602](https://github.com/stripe/stripe-php/pull/602) Add `subscription_schedule` to `Subscription` for PHPDoc.
## 6.30.3 - 2019-02-26
* [#603](https://github.com/stripe/stripe-php/pull/603) Improve PHPDoc on the `Source` object to cover all types of Sources currently supported.
## 6.30.2 - 2019-02-25
* [#601](https://github.com/stripe/stripe-php/pull/601) Fix PHPDoc across multiple resources and add support for new events.
## 6.30.1 - 2019-02-16
* [#599](https://github.com/stripe/stripe-php/pull/599) Fix PHPDoc for `SubscriptionSchedule` and `SubscriptionScheduleRevision`
## 6.30.0 - 2019-02-12
* [#590](https://github.com/stripe/stripe-php/pull/590) Add support for `SubscriptionSchedule` and `SubscriptionScheduleRevision`
## 6.29.3 - 2019-01-31
* [#592](https://github.com/stripe/stripe-php/pull/592) Some more PHPDoc fixes
## 6.29.2 - 2019-01-31
* [#591](https://github.com/stripe/stripe-php/pull/591) Fix PHPDoc for nested resources
## 6.29.1 - 2019-01-25
* [#566](https://github.com/stripe/stripe-php/pull/566) Fix dangling message contents
* [#586](https://github.com/stripe/stripe-php/pull/586) Don't overwrite `CURLOPT_HTTP_VERSION` option
## 6.29.0 - 2019-01-23
* [#579](https://github.com/stripe/stripe-php/pull/579) Rename `CheckoutSession` to `Session` and move it under the `Checkout` namespace. This is a breaking change, but we've reached out to affected merchants and all new merchants would use the new approach.
## 6.28.1 - 2019-01-21
* [#580](https://github.com/stripe/stripe-php/pull/580) Properly serialize `individual` on `Account` objects
## 6.28.0 - 2019-01-03
* [#576](https://github.com/stripe/stripe-php/pull/576) Add support for iterating directly over `Collection` instances
## 6.27.0 - 2018-12-21
* [#571](https://github.com/stripe/stripe-php/pull/571) Add support for the `CheckoutSession` resource
## 6.26.0 - 2018-12-11
* [#568](https://github.com/stripe/stripe-php/pull/568) Enable persistent connections
## 6.25.0 - 2018-12-10
* [#567](https://github.com/stripe/stripe-php/pull/567) Add support for account links
## 6.24.0 - 2018-11-28
* [#562](https://github.com/stripe/stripe-php/pull/562) Add support for the Review resource
* [#564](https://github.com/stripe/stripe-php/pull/564) Add event name constants for subscription schedule aborted/expiring
## 6.23.0 - 2018-11-27
* [#542](https://github.com/stripe/stripe-php/pull/542) Add support for `ValueList` and `ValueListItem` for Radar
## 6.22.1 - 2018-11-20
* [#561](https://github.com/stripe/stripe-php/pull/561) Add cast and some docs to telemetry introduced in 6.22.0/549
## 6.22.0 - 2018-11-15
* [#549](https://github.com/stripe/stripe-php/pull/549) Add support for client telemetry
## 6.21.1 - 2018-11-12
* [#548](https://github.com/stripe/stripe-php/pull/548) Don't mutate `Exception` class properties from `OAuthBase` error
## 6.21.0 - 2018-11-08
* [#537](https://github.com/stripe/stripe-php/pull/537) Add new API endpoints for the `Invoice` resource.
## 6.20.1 - 2018-11-07
* [#546](https://github.com/stripe/stripe-php/pull/546) Drop files from the Composer package that aren't needed in the release
## 6.20.0 - 2018-10-30
* [#536](https://github.com/stripe/stripe-php/pull/536) Add support for the `Person` resource
* [#541](https://github.com/stripe/stripe-php/pull/541) Add support for the `WebhookEndpoint` resource
## 6.19.5 - 2018-10-17
* [#539](https://github.com/stripe/stripe-php/pull/539) Fix methods on `\Stripe\PaymentIntent` to properly pass arguments to the API.
## 6.19.4 - 2018-10-11
* [#534](https://github.com/stripe/stripe-php/pull/534) Fix PSR-4 autoloading for `\Stripe\FileUpload` class alias
## 6.19.3 - 2018-10-09
* [#530](https://github.com/stripe/stripe-php/pull/530) Add constants for `flow` (`FLOW_*`), `status` (`STATUS_*`) and `usage` (`USAGE_*`) on `\Stripe\Source`
## 6.19.2 - 2018-10-08
* [#531](https://github.com/stripe/stripe-php/pull/531) Store HTTP response headers in case-insensitive array
## 6.19.1 - 2018-09-25
* [#526](https://github.com/stripe/stripe-php/pull/526) Ignore null values in request parameters
## 6.19.0 - 2018-09-24
* [#523](https://github.com/stripe/stripe-php/pull/523) Add support for Stripe Terminal
## 6.18.0 - 2018-09-24
* [#520](https://github.com/stripe/stripe-php/pull/520) Rename `\Stripe\FileUpload` to `\Stripe\File`
## 6.17.2 - 2018-09-18
* [#522](https://github.com/stripe/stripe-php/pull/522) Fix warning when adding a new additional owner to an existing array
## 6.17.1 - 2018-09-14
* [#517](https://github.com/stripe/stripe-php/pull/517) Integer-index encode all sequential arrays
## 6.17.0 - 2018-09-05
* [#514](https://github.com/stripe/stripe-php/pull/514) Add support for reporting resources
## 6.16.0 - 2018-08-23
* [#509](https://github.com/stripe/stripe-php/pull/509) Add support for usage record summaries
## 6.15.0 - 2018-08-03
* [#504](https://github.com/stripe/stripe-php/pull/504) Add cancel support for topups
## 6.14.0 - 2018-08-02
* [#505](https://github.com/stripe/stripe-php/pull/505) Add support for file links
## 6.13.0 - 2018-07-31
* [#502](https://github.com/stripe/stripe-php/pull/502) Add `isDeleted()` method to `\Stripe\StripeObject`
## 6.12.0 - 2018-07-28
* [#501](https://github.com/stripe/stripe-php/pull/501) Add support for scheduled query runs (`\Stripe\Sigma\ScheduledQueryRun`) for Sigma
## 6.11.0 - 2018-07-26
* [#500](https://github.com/stripe/stripe-php/pull/500) Add support for Stripe Issuing
## 6.10.4 - 2018-07-19
* [#498](https://github.com/stripe/stripe-php/pull/498) Internal improvements to the `\Stripe\ApiResource.classUrl()` method
## 6.10.3 - 2018-07-16
* [#497](https://github.com/stripe/stripe-php/pull/497) Use HTTP/2 only for HTTPS requests
## 6.10.2 - 2018-07-11
* [#494](https://github.com/stripe/stripe-php/pull/494) Enable HTTP/2 support
## 6.10.1 - 2018-07-10
* [#493](https://github.com/stripe/stripe-php/pull/493) Add PHPDoc for `auto_advance` on `\Stripe\Invoice`
## 6.10.0 - 2018-06-28
* [#488](https://github.com/stripe/stripe-php/pull/488) Add support for `$appPartnerId` to `Stripe::setAppInfo()`
## 6.9.0 - 2018-06-28
* [#487](https://github.com/stripe/stripe-php/pull/487) Add support for payment intents
## 6.8.2 - 2018-06-24
* [#486](https://github.com/stripe/stripe-php/pull/486) Make `Account.deauthorize()` return the `StripeObject` from the API
## 6.8.1 - 2018-06-13
* [#472](https://github.com/stripe/stripe-php/pull/472) Added phpDoc for `ApiRequestor` and others, especially regarding thrown errors
## 6.8.0 - 2018-06-13
* [#481](https://github.com/stripe/stripe-php/pull/481) Add new `\Stripe\Discount` and `\Stripe\OrderItem` classes, add more PHPDoc describing object attributes
## 6.7.4 - 2018-05-29
* [#480](https://github.com/stripe/stripe-php/pull/480) PHPDoc changes for API version 2018-05-21 and the addition of the new `CHARGE_EXPIRED` event type
## 6.7.3 - 2018-05-28
* [#479](https://github.com/stripe/stripe-php/pull/479) Fix unnecessary traits on `\Stripe\InvoiceLineItem`
## 6.7.2 - 2018-05-28
* [#471](https://github.com/stripe/stripe-php/pull/471) Add `OBJECT_NAME` constant to all API resource classes, add `\Stripe\InvoiceLineItem` class
## 6.7.1 - 2018-05-13
* [#468](https://github.com/stripe/stripe-php/pull/468) Update fields in PHP docs for accuracy
## 6.7.0 - 2018-05-09
* [#466](https://github.com/stripe/stripe-php/pull/466) Add support for issuer fraud records
## 6.6.0 - 2018-04-11
* [#460](https://github.com/stripe/stripe-php/pull/460) Add support for flexible billing primitives
## 6.5.0 - 2018-04-05
* [#461](https://github.com/stripe/stripe-php/pull/461) Don't zero keys on non-`metadata` subobjects
## 6.4.2 - 2018-03-17
* [#458](https://github.com/stripe/stripe-php/pull/458) Add PHPDoc for `account` on `\Stripe\Event`
## 6.4.1 - 2018-03-02
* [#455](https://github.com/stripe/stripe-php/pull/455) Fix namespaces in PHPDoc
* [#456](https://github.com/stripe/stripe-php/pull/456) Fix namespaces for some exceptions
## 6.4.0 - 2018-02-28
* [#453](https://github.com/stripe/stripe-php/pull/453) Add constants for `reason` (`REASON_*`) and `status` (`STATUS_*`) on `\Stripe\Dispute`
## 6.3.2 - 2018-02-27
* [#452](https://github.com/stripe/stripe-php/pull/452) Add PHPDoc for `amount_paid` and `amount_remaining` on `\Stripe\Invoice`
## 6.3.1 - 2018-02-26
* [#443](https://github.com/stripe/stripe-php/pull/443) Add event types as constants to `\Stripe\Event` class
## 6.3.0 - 2018-02-23
* [#450](https://github.com/stripe/stripe-php/pull/450) Add support for `code` attribute on all Stripe exceptions
## 6.2.0 - 2018-02-21
* [#440](https://github.com/stripe/stripe-php/pull/440) Add support for topups
* [#442](https://github.com/stripe/stripe-php/pull/442) Fix PHPDoc for `\Stripe\Error\SignatureVerification`
## 6.1.0 - 2018-02-12
* [#435](https://github.com/stripe/stripe-php/pull/435) Fix header persistence on `Collection` objects
* [#436](https://github.com/stripe/stripe-php/pull/436) Introduce new `Idempotency` error class
## 6.0.0 - 2018-02-07
Major version release. List of backwards incompatible changes to watch out for:
+ The minimum PHP version is now 5.4.0. If you're using PHP 5.3 or older, consider upgrading to a more recent version.
* `\Stripe\AttachedObject` no longer exists. Attributes that used to be instances of `\Stripe\AttachedObject` (such as `metadata`) are now instances of `\Stripe\StripeObject`.
+ Attributes that used to be PHP arrays (such as `legal_entity->additional_owners` on `\Stripe\Account` instances) are now instances of `\Stripe\StripeObject`, except when they are empty. `\Stripe\StripeObject` has array semantics so this should not be an issue unless you are actively checking types.
* `\Stripe\Collection` now derives from `\Stripe\StripeObject` rather than from `\Stripe\ApiResource`.
Pull requests included in this release:
* [#410](https://github.com/stripe/stripe-php/pull/410) Drop support for PHP 5.3
* [#411](https://github.com/stripe/stripe-php/pull/411) Use traits for common API operations
* [#414](https://github.com/stripe/stripe-php/pull/414) Use short array syntax
* [#404](https://github.com/stripe/stripe-php/pull/404) Fix serialization logic
* [#417](https://github.com/stripe/stripe-php/pull/417) Remove `ExternalAccount` class
* [#418](https://github.com/stripe/stripe-php/pull/418) Increase test coverage
* [#421](https://github.com/stripe/stripe-php/pull/421) Update CA bundle and add script for future updates
* [#422](https://github.com/stripe/stripe-php/pull/422) Use vendored CA bundle for all requests
* [#428](https://github.com/stripe/stripe-php/pull/428) Support for automatic request retries
## 5.9.2 - 2018-02-07
* [#431](https://github.com/stripe/stripe-php/pull/431) Update PHPDoc @property tags for latest API version
## 5.9.1 - 2018-02-06
* [#427](https://github.com/stripe/stripe-php/pull/427) Add and update PHPDoc @property tags on all API resources
## 5.9.0 - 2018-01-17
* [#421](https://github.com/stripe/stripe-php/pull/421) Updated bundled CA certificates
* [#423](https://github.com/stripe/stripe-php/pull/423) Escape unsanitized input in OAuth example
## 5.8.0 - 2017-12-20
* [#403](https://github.com/stripe/stripe-php/pull/403) Add `__debugInfo()` magic method to `StripeObject`
## 5.7.0 - 2017-11-28
* [#390](https://github.com/stripe/stripe-php/pull/390) Remove some unsupported API methods
* [#391](https://github.com/stripe/stripe-php/pull/391) Alphabetize the list of API resources in `Util::convertToStripeObject()` and add missing resources
* [#393](https://github.com/stripe/stripe-php/pull/393) Fix expiry date update for card sources
## 5.6.0 - 2017-10-31
* [#386](https://github.com/stripe/stripe-php/pull/386) Support for exchange rates APIs
## 5.5.1 - 2017-10-30
* [#387](https://github.com/stripe/stripe-php/pull/387) Allow `personal_address_kana` and `personal_address_kanji` to be updated on an account
## 5.5.0 - 2017-10-27
* [#385](https://github.com/stripe/stripe-php/pull/385) Support for listing source transactions
## 5.4.0 - 2017-10-24
* [#383](https://github.com/stripe/stripe-php/pull/383) Add static methods to manipulate resources from parent
* `Account` gains methods for external accounts and login links (e.g. `createExternalAccount`, `createLoginLink`)
* `ApplicationFee` gains methods for refunds
* `Customer` gains methods for sources
* `Transfer` gains methods for reversals
## 5.3.0 - 2017-10-11
* [#378](https://github.com/stripe/stripe-php/pull/378) Rename source `delete` to `detach` (and deprecate the former)
## 5.2.3 - 2017-09-27
* Add PHPDoc for `Card`
## 5.2.2 - 2017-09-20
* Fix deserialization mapping of `FileUpload` objects
## 5.2.1 - 2017-09-14
* Serialized `shipping` nested attribute
## 5.2.0 - 2017-08-29
* Add support for `InvalidClient` OAuth error
## 5.1.3 - 2017-08-14
* Allow `address_kana` and `address_kanji` to be updated for custom accounts
## 5.1.2 - 2017-08-01
* Fix documented return type of `autoPagingIterator()` (was missing namespace)
## 5.1.1 - 2017-07-03
* Fix order returns to use the right URL `/v1/order_returns`
## 5.1.0 - 2017-06-30
* Add support for OAuth
## 5.0.0 - 2017-06-27
* `pay` on invoice now takes params as well as opts
## 4.13.0 - 2017-06-19
* Add support for ephemeral keys
## 4.12.0 - 2017-06-05
* Clients can implement `getUserAgentInfo()` to add additional user agent information
## 4.11.0 - 2017-06-05
* Implement `Countable` for `AttachedObject` (`metadata` and `additional_owners`)
## 4.10.0 - 2017-05-25
* Add support for login links
## 4.9.1 - 2017-05-10
* Fix docs to include arrays on `$id` parameter for retrieve methods
## 4.9.0 - 2017-04-28
* Support for checking webhook signatures
## 4.8.1 - 2017-04-24
* Allow nested field `payout_schedule` to be updated
## 4.8.0 - 2017-04-20
* Add `\Stripe\Stripe::setLogger()` to support an external PSR-3 compatible logger
## 4.7.0 - 2017-04-10
* Add support for payouts and recipient transfers
## 4.6.0 - 2017-04-06
* Please see 4.7.0 instead (no-op release)
## 4.5.1 - 2017-03-22
* Remove hard dependency on cURL
## 4.5.0 - 2017-03-20
* Support for detaching sources from customers
## 4.4.2 - 2017-02-27
* Correct handling of `owner` parameter when updating sources
## 4.4.1 - 2017-02-24
* Correct the error check on a bad JSON decoding
## 4.4.0 - 2017-01-18
* Add support for updating sources
## 4.3.0 - 2016-11-30
* Add support for verifying sources
## 4.2.0 - 2016-11-21
* Add retrieve method for 3-D Secure resources
## 4.1.1 - 2016-10-21
* Add docblock with model properties for `Plan`
## 4.1.0 - 2016-10-18
* Support for 403 status codes (permission denied)
## 4.0.1 - 2016-10-17
* Fix transfer reversal materialization
* Fixes for some property definitions in docblocks
## 4.0.0 - 2016-09-28
* Support for subscription items
* Drop attempt to force TLS 1.2: please note that this could be breaking if you're using old OS distributions or packages and upgraded recently (so please make sure to test your integration!)
## 3.23.0 - 2016-09-15
* Add support for Apple Pay domains
## 3.22.0 - 2016-09-13
* Add `Stripe::setAppInfo` to allow plugins to register user agent information
## 3.21.0 - 2016-08-25
* Add `Source` model for generic payment sources
## 3.20.0 - 2016-08-08
* Add `getDeclineCode` to card errors
## 3.19.0 - 2016-07-29
* Opt requests directly into TLS 1.2 where OpenSSL >= 1.0.1 (see #277 for context)
## 3.18.0 - 2016-07-28
* Add new `STATUS_` constants for subscriptions
## 3.17.1 - 2016-07-28
* Fix auto-paging iterator so that it plays nicely with `iterator_to_array`
## 3.17.0 - 2016-07-14
* Add field annotations to model classes for better editor hinting
## 3.16.0 - 2016-07-12
* Add `ThreeDSecure` model for 3-D secure payments
## 3.15.0 - 2016-06-29
* Add static `update` method to all resources that can be changed.
## 3.14.3 - 2016-06-20
* Make sure that cURL never sends `Expects: 100-continue`, even on large request bodies
## 3.14.2 - 2016-06-03
* Add `inventory` under `SKU` to list of keys that have nested data and can be updated
## 3.14.1 - 2016-05-27
* Fix some inconsistencies in PHPDoc
## 3.14.0 - 2016-05-25
* Add support for returning Relay orders
## 3.13.0 - 2016-05-04
* Add `list`, `create`, `update`, `retrieve`, and `delete` methods to the Subscription class
## 3.12.1 - 2016-04-07
* Additional check on value arrays for some extra safety
## 3.12.0 - 2016-03-31
* Fix bug `refreshFrom` on `StripeObject` would not take an `$opts` array
* Fix bug where `$opts` not passed to parent `save` method in `Account`
* Fix bug where non-existent variable was referenced in `reverse` in `Transfer`
* Update CA cert bundle for compatibility with OpenSSL versions below 1.0.1
## 3.11.0 - 2016-03-22
* Allow `CurlClient` to be initialized with default `CURLOPT_*` options
## 3.10.1 - 2016-03-22
* Fix bug where request params and options were ignored in `ApplicationFee`'s `refund.`
## 3.10.0 - 2016-03-15
* Add `reject` on `Account` to support the new API feature
## 3.9.2 - 2016-03-04
* Fix error when an object's metadata is set more than once
## 3.9.1 - 2016-02-24
* Fix encoding behavior of nested arrays for requests (see #227)
## 3.9.0 - 2016-02-09
* Add automatic pagination mechanism with `autoPagingIterator()`
* Allow global account ID to be set with `Stripe::setAccountId()`
## 3.8.0 - 2016-02-08
* Add `CountrySpec` model for looking up country payment information
## 3.7.1 - 2016-02-01
* Update bundled CA certs
## 3.7.0 - 2016-01-27
* Support deleting Relay products and SKUs
## 3.6.0 - 2016-01-05
* Allow configuration of HTTP client timeouts
## 3.5.0 - 2015-12-01
* Add a verification routine for external accounts
## 3.4.0 - 2015-09-14
* Products, SKUs, and Orders -- https://stripe.com/relay
## 3.3.0 - 2015-09-11
* Add support for 429 Rate Limit response
## 3.2.0 - 2015-08-17
* Add refund listing and retrieval without an associated charge
## 3.1.0 - 2015-08-03
* Add dispute listing and retrieval
* Add support for manage account deletion
## 3.0.0 - 2015-07-28
* Rename `\Stripe\Object` to `\Stripe\StripeObject` (PHP 7 compatibility)
* Rename `getCode` and `getParam` in exceptions to `getStripeCode` and `getStripeParam`
* Add support for calling `json_encode` on Stripe objects in PHP 5.4+
* Start supporting/testing PHP 7
## 2.3.0 - 2015-07-06
* Add request ID to all Stripe exceptions
## 2.2.0 - 2015-06-01
* Add support for Alipay accounts as sources
* Add support for bank accounts as sources (private beta)
* Add support for bank accounts and cards as external_accounts on Account objects
## 2.1.4 - 2015-05-13
* Fix CA certificate file path (thanks @lphilps & @matthewarkin)
## 2.1.3 - 2015-05-12
* Fix to account updating to permit `tos_acceptance` and `personal_address` to be set properly
* Fix to Transfer reversal creation (thanks @neatness!)
* Network requests are now done through a swappable class for easier mocking
## 2.1.2 - 2015-04-10
* Remove SSL cert revokation checking (all pre-Heartbleed certs have expired)
* Bug fixes to account updating
## 2.1.1 - 2015-02-27
* Support transfer reversals
## 2.1.0 - 2015-02-19
* Support new API version (2015-02-18)
* Added Bitcoin Receiever update and delete actions
* Edited tests to prefer "source" over "card" as per new API version
## 2.0.1 - 2015-02-16
* Fix to fetching endpoints that use a non-default baseUrl (`FileUpload`)
## 2.0.0 - 2015-02-14
* Bumped minimum version to 5.3.3
* Switched to Stripe namespace instead of Stripe_ class name prefiexes (thanks @chadicus!)
* Switched tests to PHPUnit (thanks @chadicus!)
* Switched style guide to PSR2 (thanks @chadicus!)
* Added $opts hash to the end of most methods: this permits passing 'idempotency_key', 'stripe_account', or 'stripe_version'. The last 2 will persist across multiple object loads.
* Added support for retrieving Account by ID
## 1.18.0 - 2015-01-21
* Support making bitcoin charges through BitcoinReceiver source object
## 1.17.5 - 2014-12-23
* Adding support for creating file uploads.
## 1.17.4 - 2014-12-15
* Saving objects fetched with a custom key now works (thanks @JustinHook & @jpasilan)
* Added methods for reporting charges as safe or fraudulent and for specifying the reason for refunds
## 1.17.3 - 2014-11-06
* Better handling of HHVM support for SSL certificate blacklist checking.
## 1.17.2 - 2014-09-23
* Coupons now are backed by a `Stripe_Coupon` instead of `Stripe_Object`, and support updating metadata
* Running operations (`create`, `retrieve`, `all`) on upcoming invoice items now works
## 1.17.1 - 2014-07-31
* Requests now send Content-Type header
## 1.17.0 - 2014-07-29
* Application Fee refunds now a list instead of array
* HHVM now works
* Small bug fixes (thanks @bencromwell & @fastest963)
* `__toString` now returns the name of the object in addition to its JSON representation
## 1.16.0 - 2014-06-17
* Add metadata for refunds and disputes
## 1.15.0 - 2014-05-28
* Support canceling transfers
## 1.14.1 - 2014-05-21
* Support cards for recipients.
## 1.13.1 - 2014-05-15
* Fix bug in account resource where `id` wasn't in the result
## 1.13.0 - 2014-04-10
* Add support for certificate blacklisting
* Update ca bundle
* Drop support for HHVM (Temporarily)
## 1.12.0 - 2014-04-01
* Add Stripe_RateLimitError for catching rate limit errors.
* Update to Zend coding style (thanks, @jpiasetz)
## 1.11.0 - 2014-01-29
* Add support for multiple subscriptions per customer
## 1.10.1 - 2013-12-02
* Add new ApplicationFee
## 1.9.1 - 2013-11-08
* Fix a bug where a null nestable object causes warnings to fire.
## 1.9.0 - 2013-10-16
* Add support for metadata API.
## 1.8.4 - 2013-09-18
* Add support for closing disputes.
## 1.8.3 - 2013-08-13
* Add new Balance and BalanceTransaction
## 1.8.2 - 2013-08-12
* Add support for unsetting attributes by updating to NULL. Setting properties to a blank string is now an error.
## 1.8.1 - 2013-07-12
* Add support for multiple cards API (Stripe API version 2013-07-12: https://stripe.com/docs/upgrades#2013-07-05)
## 1.8.0 - 2013-04-11
* Allow Transfers to be creatable
* Add new Recipient resource
## 1.7.15 - 2013-02-21
* Add 'id' to the list of permanent object attributes
## 1.7.14 - 2013-02-20
* Don't re-encode strings that are already encoded in UTF-8. If you were previously using plan or coupon objects with UTF-8 IDs, they may have been treated as ISO-8859-1 (Latin-1) and encoded to UTF-8 a 2nd time. You may now need to pass the IDs to utf8_encode before passing them to Stripe_Plan::retrieve or Stripe_Coupon::retrieve.
* Ensure that all input is encoded in UTF-8 before submitting it to Stripe's servers. (github issue #27)
## 1.7.13 - 2013-02-01
* Add support for passing options when retrieving Stripe objects e.g., Stripe_Charge::retrieve(array("id"=>"foo", "expand" => array("customer"))); Stripe_Charge::retrieve("foo") will continue to work
## 1.7.12 - 2013-01-15
* Add support for setting a Stripe API version override
## 1.7.11 - 2012-12-30
* Version bump to cleanup constants and such (fix issue #26)
## 1.7.10 - 2012-11-08
* Add support for updating charge disputes.
* Fix bug preventing retrieval of null attributes
## 1.7.9 - 2012-11-08
* Fix usage under autoloaders such as the one generated by composer (fix issue #22)
## 1.7.8 - 2012-10-30
* Add support for creating invoices.
* Add support for new invoice lines return format
* Add support for new list objects
## 1.7.7 - 2012-09-14
* Get all of the various version numbers in the repo in sync (no other changes)
## 1.7.6 - 2012-08-31
* Add update and pay methods to Invoice resource
## 1.7.5 - 2012-08-23
* Change internal function names so that Stripe_SingletonApiRequest is E_STRICT-clean (github issue #16)
## 1.7.4 - 2012-08-21
* Bugfix so that Stripe objects (e.g. Customer, Charge objects) used in API calls are transparently converted to their object IDs
## 1.7.3 - 2012-08-15
* Add new Account resource
## 1.7.2 - 2012-06-26
* Make clearer that you should be including lib/Stripe.php, not test/Stripe.php (github issue #14)
## 1.7.1 - 2012-05-24
* Add missing argument to Stripe_InvalidRequestError constructor in Stripe_ApiResource::instanceUrl. Fixes a warning when Stripe_ApiResource::instanceUrl is called on a resource with no ID (fix issue #12)
## 1.7.0 - 2012-05-17
* Support Composer and Packagist (github issue #9)
* Add new deleteDiscount method to Stripe_Customer
* Add new Transfer resource
* Switch from using HTTP Basic auth to Bearer auth. (Note: Stripe will support Basic auth for the indefinite future, but recommends Bearer auth when possible going forward)
* Numerous test suite improvements

View File

@ -1 +0,0 @@
7.0.2

View File

@ -1,36 +0,0 @@
#!/usr/bin/env php
<?php
chdir(dirname(__FILE__));
$autoload = (int)$argv[1];
$returnStatus = null;
if (!$autoload) {
// Modify composer to not autoload Stripe
$composer = json_decode(file_get_contents('composer.json'), true);
unset($composer['autoload']);
unset($composer['require-dev']['squizlabs/php_codesniffer']);
file_put_contents('composer.json', json_encode($composer, JSON_PRETTY_PRINT));
}
passthru('composer update', $returnStatus);
if ($returnStatus !== 0) {
exit(1);
}
if ($autoload) {
// Only run CS on 1 of the 2 environments
passthru(
'./vendor/bin/phpcs --standard=PSR2 -n lib tests *.php',
$returnStatus
);
if ($returnStatus !== 0) {
exit(1);
}
}
$config = $autoload ? 'phpunit.xml' : 'phpunit.no_autoload.xml';
passthru("./vendor/bin/phpunit -c $config", $returnStatus);
if ($returnStatus !== 0) {
exit(1);
}

View File

@ -1,149 +0,0 @@
<?php
// Stripe singleton
require(dirname(__FILE__) . '/lib/Stripe.php');
// Utilities
require(dirname(__FILE__) . '/lib/Util/CaseInsensitiveArray.php');
require(dirname(__FILE__) . '/lib/Util/LoggerInterface.php');
require(dirname(__FILE__) . '/lib/Util/DefaultLogger.php');
require(dirname(__FILE__) . '/lib/Util/RandomGenerator.php');
require(dirname(__FILE__) . '/lib/Util/RequestOptions.php');
require(dirname(__FILE__) . '/lib/Util/Set.php');
require(dirname(__FILE__) . '/lib/Util/Util.php');
// HttpClient
require(dirname(__FILE__) . '/lib/HttpClient/ClientInterface.php');
require(dirname(__FILE__) . '/lib/HttpClient/CurlClient.php');
// Exceptions
require(dirname(__FILE__) . '/lib/Exception/ExceptionInterface.php');
require(dirname(__FILE__) . '/lib/Exception/ApiErrorException.php');
require(dirname(__FILE__) . '/lib/Exception/ApiConnectionException.php');
require(dirname(__FILE__) . '/lib/Exception/AuthenticationException.php');
require(dirname(__FILE__) . '/lib/Exception/BadMethodCallException.php');
require(dirname(__FILE__) . '/lib/Exception/CardException.php');
require(dirname(__FILE__) . '/lib/Exception/IdempotencyException.php');
require(dirname(__FILE__) . '/lib/Exception/InvalidArgumentException.php');
require(dirname(__FILE__) . '/lib/Exception/InvalidRequestException.php');
require(dirname(__FILE__) . '/lib/Exception/PermissionException.php');
require(dirname(__FILE__) . '/lib/Exception/RateLimitException.php');
require(dirname(__FILE__) . '/lib/Exception/SignatureVerificationException.php');
require(dirname(__FILE__) . '/lib/Exception/UnexpectedValueException.php');
require(dirname(__FILE__) . '/lib/Exception/UnknownApiErrorException.php');
// OAuth exceptions
require(dirname(__FILE__) . '/lib/Exception/OAuth/ExceptionInterface.php');
require(dirname(__FILE__) . '/lib/Exception/OAuth/OAuthErrorException.php');
require(dirname(__FILE__) . '/lib/Exception/OAuth/InvalidClientException.php');
require(dirname(__FILE__) . '/lib/Exception/OAuth/InvalidGrantException.php');
require(dirname(__FILE__) . '/lib/Exception/OAuth/InvalidRequestException.php');
require(dirname(__FILE__) . '/lib/Exception/OAuth/InvalidScopeException.php');
require(dirname(__FILE__) . '/lib/Exception/OAuth/UnknownOAuthErrorException.php');
require(dirname(__FILE__) . '/lib/Exception/OAuth/UnsupportedGrantTypeException.php');
require(dirname(__FILE__) . '/lib/Exception/OAuth/UnsupportedResponseTypeException.php');
// API operations
require(dirname(__FILE__) . '/lib/ApiOperations/All.php');
require(dirname(__FILE__) . '/lib/ApiOperations/Create.php');
require(dirname(__FILE__) . '/lib/ApiOperations/Delete.php');
require(dirname(__FILE__) . '/lib/ApiOperations/NestedResource.php');
require(dirname(__FILE__) . '/lib/ApiOperations/Request.php');
require(dirname(__FILE__) . '/lib/ApiOperations/Retrieve.php');
require(dirname(__FILE__) . '/lib/ApiOperations/Update.php');
// Plumbing
require(dirname(__FILE__) . '/lib/ApiResponse.php');
require(dirname(__FILE__) . '/lib/RequestTelemetry.php');
require(dirname(__FILE__) . '/lib/StripeObject.php');
require(dirname(__FILE__) . '/lib/ApiRequestor.php');
require(dirname(__FILE__) . '/lib/ApiResource.php');
require(dirname(__FILE__) . '/lib/SingletonApiResource.php');
// Stripe API Resources
require(dirname(__FILE__) . '/lib/Account.php');
require(dirname(__FILE__) . '/lib/AccountLink.php');
require(dirname(__FILE__) . '/lib/AlipayAccount.php');
require(dirname(__FILE__) . '/lib/ApplePayDomain.php');
require(dirname(__FILE__) . '/lib/ApplicationFee.php');
require(dirname(__FILE__) . '/lib/ApplicationFeeRefund.php');
require(dirname(__FILE__) . '/lib/Balance.php');
require(dirname(__FILE__) . '/lib/BalanceTransaction.php');
require(dirname(__FILE__) . '/lib/BankAccount.php');
require(dirname(__FILE__) . '/lib/BitcoinReceiver.php');
require(dirname(__FILE__) . '/lib/BitcoinTransaction.php');
require(dirname(__FILE__) . '/lib/Capability.php');
require(dirname(__FILE__) . '/lib/Card.php');
require(dirname(__FILE__) . '/lib/Charge.php');
require(dirname(__FILE__) . '/lib/Checkout/Session.php');
require(dirname(__FILE__) . '/lib/Collection.php');
require(dirname(__FILE__) . '/lib/CountrySpec.php');
require(dirname(__FILE__) . '/lib/Coupon.php');
require(dirname(__FILE__) . '/lib/CreditNote.php');
require(dirname(__FILE__) . '/lib/Customer.php');
require(dirname(__FILE__) . '/lib/CustomerBalanceTransaction.php');
require(dirname(__FILE__) . '/lib/Discount.php');
require(dirname(__FILE__) . '/lib/Dispute.php');
require(dirname(__FILE__) . '/lib/EphemeralKey.php');
require(dirname(__FILE__) . '/lib/ErrorObject.php');
require(dirname(__FILE__) . '/lib/Event.php');
require(dirname(__FILE__) . '/lib/ExchangeRate.php');
require(dirname(__FILE__) . '/lib/File.php');
require(dirname(__FILE__) . '/lib/FileLink.php');
require(dirname(__FILE__) . '/lib/Invoice.php');
require(dirname(__FILE__) . '/lib/InvoiceItem.php');
require(dirname(__FILE__) . '/lib/InvoiceLineItem.php');
require(dirname(__FILE__) . '/lib/Issuing/Authorization.php');
require(dirname(__FILE__) . '/lib/Issuing/Card.php');
require(dirname(__FILE__) . '/lib/Issuing/CardDetails.php');
require(dirname(__FILE__) . '/lib/Issuing/Cardholder.php');
require(dirname(__FILE__) . '/lib/Issuing/Dispute.php');
require(dirname(__FILE__) . '/lib/Issuing/Transaction.php');
require(dirname(__FILE__) . '/lib/LoginLink.php');
require(dirname(__FILE__) . '/lib/Order.php');
require(dirname(__FILE__) . '/lib/OrderItem.php');
require(dirname(__FILE__) . '/lib/OrderReturn.php');
require(dirname(__FILE__) . '/lib/PaymentIntent.php');
require(dirname(__FILE__) . '/lib/PaymentMethod.php');
require(dirname(__FILE__) . '/lib/Payout.php');
require(dirname(__FILE__) . '/lib/Person.php');
require(dirname(__FILE__) . '/lib/Plan.php');
require(dirname(__FILE__) . '/lib/Product.php');
require(dirname(__FILE__) . '/lib/Radar/EarlyFraudWarning.php');
require(dirname(__FILE__) . '/lib/Radar/ValueList.php');
require(dirname(__FILE__) . '/lib/Radar/ValueListItem.php');
require(dirname(__FILE__) . '/lib/Recipient.php');
require(dirname(__FILE__) . '/lib/RecipientTransfer.php');
require(dirname(__FILE__) . '/lib/Refund.php');
require(dirname(__FILE__) . '/lib/Reporting/ReportRun.php');
require(dirname(__FILE__) . '/lib/Reporting/ReportType.php');
require(dirname(__FILE__) . '/lib/Review.php');
require(dirname(__FILE__) . '/lib/SetupIntent.php');
require(dirname(__FILE__) . '/lib/SKU.php');
require(dirname(__FILE__) . '/lib/Sigma/ScheduledQueryRun.php');
require(dirname(__FILE__) . '/lib/Source.php');
require(dirname(__FILE__) . '/lib/SourceTransaction.php');
require(dirname(__FILE__) . '/lib/Subscription.php');
require(dirname(__FILE__) . '/lib/SubscriptionItem.php');
require(dirname(__FILE__) . '/lib/SubscriptionSchedule.php');
require(dirname(__FILE__) . '/lib/TaxId.php');
require(dirname(__FILE__) . '/lib/TaxRate.php');
require(dirname(__FILE__) . '/lib/Terminal/ConnectionToken.php');
require(dirname(__FILE__) . '/lib/Terminal/Location.php');
require(dirname(__FILE__) . '/lib/Terminal/Reader.php');
require(dirname(__FILE__) . '/lib/ThreeDSecure.php');
require(dirname(__FILE__) . '/lib/Token.php');
require(dirname(__FILE__) . '/lib/Topup.php');
require(dirname(__FILE__) . '/lib/Transfer.php');
require(dirname(__FILE__) . '/lib/TransferReversal.php');
require(dirname(__FILE__) . '/lib/UsageRecord.php');
require(dirname(__FILE__) . '/lib/UsageRecordSummary.php');
// OAuth
require(dirname(__FILE__) . '/lib/OAuth.php');
require(dirname(__FILE__) . '/lib/OAuthErrorObject.php');
// Webhooks
require(dirname(__FILE__) . '/lib/Webhook.php');
require(dirname(__FILE__) . '/lib/WebhookEndpoint.php');
require(dirname(__FILE__) . '/lib/WebhookSignature.php');

View File

@ -1,20 +0,0 @@
<?php
namespace Stripe;
/**
* Class AccountLink
*
* @property string $object
* @property int $created
* @property int $expires_at
* @property string $url
*
* @package Stripe
*/
class AccountLink extends ApiResource
{
const OBJECT_NAME = "account_link";
use ApiOperations\Create;
}

View File

@ -1,27 +0,0 @@
<?php
namespace Stripe;
/**
* Class ApplePayDomain
*
* @package Stripe
*/
class ApplePayDomain extends ApiResource
{
const OBJECT_NAME = "apple_pay_domain";
use ApiOperations\All;
use ApiOperations\Create;
use ApiOperations\Delete;
use ApiOperations\Retrieve;
/**
* @return string The class URL for this resource. It needs to be special
* cased because it doesn't fit into the standard resource pattern.
*/
public static function classUrl()
{
return '/v1/apple_pay/domains';
}
}

View File

@ -1,92 +0,0 @@
<?php
namespace Stripe;
/**
* Class ApplicationFee
*
* @property string $id
* @property string $object
* @property string $account
* @property int $amount
* @property int $amount_refunded
* @property string $application
* @property string $balance_transaction
* @property string $charge
* @property int $created
* @property string $currency
* @property bool $livemode
* @property string $originating_transaction
* @property bool $refunded
* @property Collection $refunds
*
* @package Stripe
*/
class ApplicationFee extends ApiResource
{
const OBJECT_NAME = "application_fee";
use ApiOperations\All;
use ApiOperations\NestedResource;
use ApiOperations\Retrieve;
const PATH_REFUNDS = '/refunds';
/**
* @param string|null $id The ID of the application fee on which to create the refund.
* @param array|null $params
* @param array|string|null $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return ApplicationFeeRefund
*/
public static function createRefund($id, $params = null, $opts = null)
{
return self::_createNestedResource($id, static::PATH_REFUNDS, $params, $opts);
}
/**
* @param string|null $id The ID of the application fee to which the refund belongs.
* @param array|null $refundId The ID of the refund to retrieve.
* @param array|null $params
* @param array|string|null $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return ApplicationFeeRefund
*/
public static function retrieveRefund($id, $refundId, $params = null, $opts = null)
{
return self::_retrieveNestedResource($id, static::PATH_REFUNDS, $refundId, $params, $opts);
}
/**
* @param string|null $id The ID of the application fee to which the refund belongs.
* @param array|null $refundId The ID of the refund to update.
* @param array|null $params
* @param array|string|null $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return ApplicationFeeRefund
*/
public static function updateRefund($id, $refundId, $params = null, $opts = null)
{
return self::_updateNestedResource($id, static::PATH_REFUNDS, $refundId, $params, $opts);
}
/**
* @param string|null $id The ID of the application fee on which to retrieve the refunds.
* @param array|null $params
* @param array|string|null $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return Collection The list of refunds.
*/
public static function allRefunds($id, $params = null, $opts = null)
{
return self::_allNestedResources($id, static::PATH_REFUNDS, $params, $opts);
}
}

View File

@ -1,59 +0,0 @@
<?php
namespace Stripe;
/**
* Class ApplicationFeeRefund
*
* @property string $id
* @property string $object
* @property int $amount
* @property string $balance_transaction
* @property int $created
* @property string $currency
* @property string $fee
* @property StripeObject $metadata
*
* @package Stripe
*/
class ApplicationFeeRefund extends ApiResource
{
const OBJECT_NAME = "fee_refund";
use ApiOperations\Update {
save as protected _save;
}
/**
* @return string The API URL for this Stripe refund.
*/
public function instanceUrl()
{
$id = $this['id'];
$fee = $this['fee'];
if (!$id) {
throw new Exception\UnexpectedValueException(
"Could not determine which URL to request: " .
"class instance has invalid ID: $id",
null
);
}
$id = Util\Util::utf8($id);
$fee = Util\Util::utf8($fee);
$base = ApplicationFee::classUrl();
$feeExtn = urlencode($fee);
$extn = urlencode($id);
return "$base/$feeExtn/refunds/$extn";
}
/**
* @param array|string|null $opts
*
* @return ApplicationFeeRefund The saved refund.
*/
public function save($opts = null)
{
return $this->_save($opts);
}
}

View File

@ -1,31 +0,0 @@
<?php
namespace Stripe;
/**
* Class Balance
*
* @property string $object
* @property array $available
* @property array $connect_reserved
* @property bool $livemode
* @property array $pending
*
* @package Stripe
*/
class Balance extends SingletonApiResource
{
const OBJECT_NAME = "balance";
/**
* @param array|string|null $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return Balance
*/
public static function retrieve($opts = null)
{
return self::_singletonRetrieve($opts);
}
}

View File

@ -1,65 +0,0 @@
<?php
namespace Stripe;
/**
* Class BalanceTransaction
*
* @property string $id
* @property string $object
* @property int $amount
* @property int $available_on
* @property int $created
* @property string $currency
* @property string $description
* @property float $exchange_rate
* @property int $fee
* @property mixed $fee_details
* @property int $net
* @property string $source
* @property string $status
* @property string $type
*
* @package Stripe
*/
class BalanceTransaction extends ApiResource
{
const OBJECT_NAME = "balance_transaction";
use ApiOperations\All;
use ApiOperations\Retrieve;
/**
* Possible string representations of the type of balance transaction.
* @link https://stripe.com/docs/api/balance/balance_transaction#balance_transaction_object-type
*/
const TYPE_ADJUSTMENT = 'adjustment';
const TYPE_ADVANCE = 'advance';
const TYPE_ADVANCE_FUNDING = 'advance_funding';
const TYPE_APPLICATION_FEE = 'application_fee';
const TYPE_APPLICATION_FEE_REFUND = 'application_fee_refund';
const TYPE_CHARGE = 'charge';
const TYPE_CONNECT_COLLECTION_TRANSFER = 'connect_collection_transfer';
const TYPE_ISSUING_AUTHORIZATION_HOLD = 'issuing_authorization_hold';
const TYPE_ISSUING_AUTHORIZATION_RELEASE = 'issuing_authorization_release';
const TYPE_ISSUING_TRANSACTION = 'issuing_transaction';
const TYPE_PAYMENT = 'payment';
const TYPE_PAYMENT_FAILURE_REFUND = 'payment_failure_refund';
const TYPE_PAYMENT_REFUND = 'payment_refund';
const TYPE_PAYOUT = 'payout';
const TYPE_PAYOUT_CANCEL = 'payout_cancel';
const TYPE_PAYOUT_FAILURE = 'payout_failure';
const TYPE_REFUND = 'refund';
const TYPE_REFUND_FAILURE = 'refund_failure';
const TYPE_RESERVE_TRANSACTION = 'reserve_transaction';
const TYPE_RESERVED_FUNDS = 'reserved_funds';
const TYPE_STRIPE_FEE = 'stripe_fee';
const TYPE_STRIPE_FX_FEE = 'stripe_fx_fee';
const TYPE_TAX_FEE = 'tax_fee';
const TYPE_TOPUP = 'topup';
const TYPE_TOPUP_REVERSAL = 'topup_reversal';
const TYPE_TRANSFER = 'transfer';
const TYPE_TRANSFER_CANCEL = 'transfer_cancel';
const TYPE_TRANSFER_FAILURE = 'transfer_failure';
const TYPE_TRANSFER_REFUND = 'transfer_refund';
}

View File

@ -1,114 +0,0 @@
<?php
namespace Stripe;
/**
* Class BankAccount
*
* @property string $id
* @property string $object
* @property string $account
* @property string $account_holder_name
* @property string $account_holder_type
* @property string $bank_name
* @property string $country
* @property string $currency
* @property string $customer
* @property bool $default_for_currency
* @property string $fingerprint
* @property string $last4
* @property StripeObject $metadata
* @property string $routing_number
* @property string $status
*
* @package Stripe
*/
class BankAccount extends ApiResource
{
const OBJECT_NAME = "bank_account";
use ApiOperations\Delete;
use ApiOperations\Update;
/**
* Possible string representations of the bank verification status.
* @link https://stripe.com/docs/api/external_account_bank_accounts/object#account_bank_account_object-status
*/
const STATUS_NEW = 'new';
const STATUS_VALIDATED = 'validated';
const STATUS_VERIFIED = 'verified';
const STATUS_VERIFICATION_FAILED = 'verification_failed';
const STATUS_ERRORED = 'errored';
/**
* @return string The instance URL for this resource. It needs to be special
* cased because it doesn't fit into the standard resource pattern.
*/
public function instanceUrl()
{
if ($this['customer']) {
$base = Customer::classUrl();
$parent = $this['customer'];
$path = 'sources';
} elseif ($this['account']) {
$base = Account::classUrl();
$parent = $this['account'];
$path = 'external_accounts';
} else {
$msg = "Bank accounts cannot be accessed without a customer ID or account ID.";
throw new Exception\UnexpectedValueException($msg, null);
}
$parentExtn = urlencode(Util\Util::utf8($parent));
$extn = urlencode(Util\Util::utf8($this['id']));
return "$base/$parentExtn/$path/$extn";
}
/**
* @param array|string $_id
* @param array|string|null $_opts
*
* @throws \Stripe\Exception\BadMethodCallException
*/
public static function retrieve($_id, $_opts = null)
{
$msg = "Bank accounts cannot be retrieved without a customer ID or " .
"an account ID. Retrieve a bank account using " .
"`Customer::retrieveSource('customer_id', " .
"'bank_account_id')` or `Account::retrieveExternalAccount(" .
"'account_id', 'bank_account_id')`.";
throw new Exception\BadMethodCallException($msg, null);
}
/**
* @param string $_id
* @param array|null $_params
* @param array|string|null $_options
*
* @throws \Stripe\Exception\BadMethodCallException
*/
public static function update($_id, $_params = null, $_options = null)
{
$msg = "Bank accounts cannot be updated without a customer ID or an " .
"account ID. Update a bank account using " .
"`Customer::updateSource('customer_id', 'bank_account_id', " .
"\$updateParams)` or `Account::updateExternalAccount(" .
"'account_id', 'bank_account_id', \$updateParams)`.";
throw new Exception\BadMethodCallException($msg, null);
}
/**
* @param array|null $params
* @param array|string|null $options
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return BankAccount The verified bank account.
*/
public function verify($params = null, $options = null)
{
$url = $this->instanceUrl() . '/verify';
list($response, $opts) = $this->_request('post', $url, $params, $options);
$this->refreshFrom($response, $opts);
return $this;
}
}

View File

@ -1,48 +0,0 @@
<?php
namespace Stripe;
/**
* Class BitcoinReceiver
*
* @package Stripe
*
* @deprecated Bitcoin receivers are deprecated. Please use the sources API instead.
* @link https://stripe.com/docs/sources/bitcoin
*/
class BitcoinReceiver extends ApiResource
{
const OBJECT_NAME = "bitcoin_receiver";
use ApiOperations\All;
use ApiOperations\Retrieve;
/**
* @return string The class URL for this resource. It needs to be special
* cased because it doesn't fit into the standard resource pattern.
*/
public static function classUrl()
{
return "/v1/bitcoin/receivers";
}
/**
* @return string The instance URL for this resource. It needs to be special
* cased because it doesn't fit into the standard resource pattern.
*/
public function instanceUrl()
{
if ($this['customer']) {
$base = Customer::classUrl();
$parent = $this['customer'];
$path = 'sources';
$parentExtn = urlencode(Util\Util::utf8($parent));
$extn = urlencode(Util\Util::utf8($this['id']));
return "$base/$parentExtn/$path/$extn";
} else {
$base = BitcoinReceiver::classUrl();
$extn = urlencode(Util\Util::utf8($this['id']));
return "$base/$extn";
}
}
}

View File

@ -1,13 +0,0 @@
<?php
namespace Stripe;
/**
* Class BitcoinTransaction
*
* @package Stripe
*/
class BitcoinTransaction extends ApiResource
{
const OBJECT_NAME = "bitcoin_transaction";
}

View File

@ -1,84 +0,0 @@
<?php
namespace Stripe;
/**
* Class Capability
*
* @package Stripe
*
* @property string $id
* @property string $object
* @property string $account
* @property bool $requested
* @property int $requested_at
* @property mixed $requirements
* @property string $status
*/
class Capability extends ApiResource
{
const OBJECT_NAME = "capability";
use ApiOperations\Update;
/**
* Possible string representations of a capability's status.
* @link https://stripe.com/docs/api/capabilities/object#capability_object-status
*/
const STATUS_ACTIVE = 'active';
const STATUS_INACTIVE = 'inactive';
const STATUS_PENDING = 'pending';
const STATUS_UNREQUESTED = 'unrequested';
/**
* @return string The API URL for this Stripe account reversal.
*/
public function instanceUrl()
{
$id = $this['id'];
$account = $this['account'];
if (!$id) {
throw new Exception\UnexpectedValueException(
"Could not determine which URL to request: " .
"class instance has invalid ID: $id",
null
);
}
$id = Util\Util::utf8($id);
$account = Util\Util::utf8($account);
$base = Account::classUrl();
$accountExtn = urlencode($account);
$extn = urlencode($id);
return "$base/$accountExtn/capabilities/$extn";
}
/**
* @param array|string $_id
* @param array|string|null $_opts
*
* @throws \Stripe\Exception\BadMethodCallException
*/
public static function retrieve($_id, $_opts = null)
{
$msg = "Capabilities cannot be retrieved without an account ID. " .
"Retrieve a capability using `Account::retrieveCapability(" .
"'account_id', 'capability_id')`.";
throw new Exception\BadMethodCallException($msg, null);
}
/**
* @param string $_id
* @param array|null $_params
* @param array|string|null $_options
*
* @throws \Stripe\Exception\BadMethodCallException
*/
public static function update($_id, $_params = null, $_options = null)
{
$msg = "Capabilities cannot be updated without an account ID. " .
"Update a capability using `Account::updateCapability(" .
"'account_id', 'capability_id', \$updateParams)`.";
throw new Exception\BadMethodCallException($msg, null);
}
}

View File

@ -1,130 +0,0 @@
<?php
namespace Stripe;
/**
* Class Card
*
* @property string $id
* @property string $object
* @property string $account
* @property string $address_city
* @property string $address_country
* @property string $address_line1
* @property string $address_line1_check
* @property string $address_line2
* @property string $address_state
* @property string $address_zip
* @property string $address_zip_check
* @property string[] $available_payout_methods
* @property string $brand
* @property string $country
* @property string $currency
* @property string $customer
* @property string $cvc_check
* @property bool $default_for_currency
* @property string $dynamic_last4
* @property int $exp_month
* @property int $exp_year
* @property string $fingerprint
* @property string $funding
* @property string $last4
* @property StripeObject $metadata
* @property string $name
* @property string $recipient
* @property string $tokenization_method
*
* @package Stripe
*/
class Card extends ApiResource
{
const OBJECT_NAME = "card";
use ApiOperations\Delete;
use ApiOperations\Update;
/**
* Possible string representations of the CVC check status.
* @link https://stripe.com/docs/api/cards/object#card_object-cvc_check
*/
const CVC_CHECK_FAIL = 'fail';
const CVC_CHECK_PASS = 'pass';
const CVC_CHECK_UNAVAILABLE = 'unavailable';
const CVC_CHECK_UNCHECKED = 'unchecked';
/**
* Possible string representations of the funding of the card.
* @link https://stripe.com/docs/api/cards/object#card_object-funding
*/
const FUNDING_CREDIT = 'credit';
const FUNDING_DEBIT = 'debit';
const FUNDING_PREPAID = 'prepaid';
const FUNDING_UNKNOWN = 'unknown';
/**
* Possible string representations of the tokenization method when using Apple Pay or Google Pay.
* @link https://stripe.com/docs/api/cards/object#card_object-tokenization_method
*/
const TOKENIZATION_METHOD_APPLE_PAY = 'apple_pay';
const TOKENIZATION_METHOD_GOOGLE_PAY = 'google_pay';
/**
* @return string The instance URL for this resource. It needs to be special
* cased because cards are nested resources that may belong to different
* top-level resources.
*/
public function instanceUrl()
{
if ($this['customer']) {
$base = Customer::classUrl();
$parent = $this['customer'];
$path = 'sources';
} elseif ($this['account']) {
$base = Account::classUrl();
$parent = $this['account'];
$path = 'external_accounts';
} elseif ($this['recipient']) {
$base = Recipient::classUrl();
$parent = $this['recipient'];
$path = 'cards';
} else {
$msg = "Cards cannot be accessed without a customer ID, account ID or recipient ID.";
throw new Exception\UnexpectedValueException($msg);
}
$parentExtn = urlencode(Util\Util::utf8($parent));
$extn = urlencode(Util\Util::utf8($this['id']));
return "$base/$parentExtn/$path/$extn";
}
/**
* @param array|string $_id
* @param array|string|null $_opts
*
* @throws \Stripe\Exception\BadMethodCallException
*/
public static function retrieve($_id, $_opts = null)
{
$msg = "Cards cannot be retrieved without a customer ID or an " .
"account ID. Retrieve a card using " .
"`Customer::retrieveSource('customer_id', 'card_id')` or " .
"`Account::retrieveExternalAccount('account_id', 'card_id')`.";
throw new Exception\BadMethodCallException($msg);
}
/**
* @param string $_id
* @param array|null $_params
* @param array|string|null $_options
*
* @throws \Stripe\Exception\BadMethodCallException
*/
public static function update($_id, $_params = null, $_options = null)
{
$msg = "Cards cannot be updated without a customer ID or an " .
"account ID. Update a card using " .
"`Customer::updateSource('customer_id', 'card_id', " .
"\$updateParams)` or `Account::updateExternalAccount(" .
"'account_id', 'card_id', \$updateParams)`.";
throw new Exception\BadMethodCallException($msg);
}
}

View File

@ -1,135 +0,0 @@
<?php
namespace Stripe;
/**
* Class Charge
*
* @property string $id
* @property string $object
* @property int $amount
* @property int $amount_refunded
* @property string $application
* @property string $application_fee
* @property int $application_fee_amount
* @property string $balance_transaction
* @property mixed $billing_details
* @property bool $captured
* @property int $created
* @property string $currency
* @property string $customer
* @property string $description
* @property string $destination
* @property string $dispute
* @property string $failure_code
* @property string $failure_message
* @property mixed $fraud_details
* @property string $invoice
* @property bool $livemode
* @property StripeObject $metadata
* @property string $on_behalf_of
* @property string $order
* @property mixed $outcome
* @property bool $paid
* @property string $payment_intent
* @property string $payment_method
* @property mixed $payment_method_details
* @property string $receipt_email
* @property string $receipt_number
* @property string $receipt_url
* @property bool $refunded
* @property Collection $refunds
* @property string $review
* @property mixed $shipping
* @property mixed $source
* @property string $source_transfer
* @property string $statement_descriptor
* @property string $status
* @property string $transfer
* @property mixed $transfer_data
* @property string $transfer_group
*
* @package Stripe
*/
class Charge extends ApiResource
{
const OBJECT_NAME = "charge";
use ApiOperations\All;
use ApiOperations\Create;
use ApiOperations\Retrieve;
use ApiOperations\Update;
/**
* Possible string representations of decline codes.
* These strings are applicable to the decline_code property of the \Stripe\Exception\CardException exception.
* @link https://stripe.com/docs/declines/codes
*/
const DECLINED_APPROVE_WITH_ID = 'approve_with_id';
const DECLINED_CALL_ISSUER = 'call_issuer';
const DECLINED_CARD_NOT_SUPPORTED = 'card_not_supported';
const DECLINED_CARD_VELOCITY_EXCEEDED = 'card_velocity_exceeded';
const DECLINED_CURRENCY_NOT_SUPPORTED = 'currency_not_supported';
const DECLINED_DO_NOT_HONOR = 'do_not_honor';
const DECLINED_DO_NOT_TRY_AGAIN = 'do_not_try_again';
const DECLINED_DUPLICATED_TRANSACTION = 'duplicate_transaction';
const DECLINED_EXPIRED_CARD = 'expired_card';
const DECLINED_FRAUDULENT = 'fraudulent';
const DECLINED_GENERIC_DECLINE = 'generic_decline';
const DECLINED_INCORRECT_NUMBER = 'incorrect_number';
const DECLINED_INCORRECT_CVC = 'incorrect_cvc';
const DECLINED_INCORRECT_PIN = 'incorrect_pin';
const DECLINED_INCORRECT_ZIP = 'incorrect_zip';
const DECLINED_INSUFFICIENT_FUNDS = 'insufficient_funds';
const DECLINED_INVALID_ACCOUNT = 'invalid_account';
const DECLINED_INVALID_AMOUNT = 'invalid_amount';
const DECLINED_INVALID_CVC = 'invalid_cvc';
const DECLINED_INVALID_EXPIRY_YEAR = 'invalid_expiry_year';
const DECLINED_INVALID_NUMBER = 'invalid_number';
const DECLINED_INVALID_PIN = 'invalid_pin';
const DECLINED_ISSUER_NOT_AVAILABLE = 'issuer_not_available';
const DECLINED_LOST_CARD = 'lost_card';
const DECLINED_MERCHANT_BLACKLIST = 'merchant_blacklist';
const DECLINED_NEW_ACCOUNT_INFORMATION_AVAILABLE = 'new_account_information_available';
const DECLINED_NO_ACTION_TAKEN = 'no_action_taken';
const DECLINED_NOT_PERMITTED = 'not_permitted';
const DECLINED_PICKUP_CARD = 'pickup_card';
const DECLINED_PIN_TRY_EXCEEDED = 'pin_try_exceeded';
const DECLINED_PROCESSING_ERROR = 'processing_error';
const DECLINED_REENTER_TRANSACTION = 'reenter_transaction';
const DECLINED_RESTRICTED_CARD = 'restricted_card';
const DECLINED_REVOCATION_OF_ALL_AUTHORIZATIONS = 'revocation_of_all_authorizations';
const DECLINED_REVOCATION_OF_AUTHORIZATION = 'revocation_of_authorization';
const DECLINED_SECURITY_VIOLATION = 'security_violation';
const DECLINED_SERVICE_NOT_ALLOWED = 'service_not_allowed';
const DECLINED_STOLEN_CARD = 'stolen_card';
const DECLINED_STOP_PAYMENT_ORDER = 'stop_payment_order';
const DECLINED_TESTMODE_DECLINE = 'testmode_decline';
const DECLINED_TRANSACTION_NOT_ALLOWED = 'transaction_not_allowed';
const DECLINED_TRY_AGAIN_LATER = 'try_again_later';
const DECLINED_WITHDRAWAL_COUNT_LIMIT_EXCEEDED = 'withdrawal_count_limit_exceeded';
/**
* Possible string representations of the status of the charge.
* @link https://stripe.com/docs/api/charges/object#charge_object-status
*/
const STATUS_FAILED = 'failed';
const STATUS_PENDING = 'pending';
const STATUS_SUCCEEDED = 'succeeded';
/**
* @param array|null $params
* @param array|string|null $options
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return Charge The captured charge.
*/
public function capture($params = null, $options = null)
{
$url = $this->instanceUrl() . '/capture';
list($response, $opts) = $this->_request('post', $url, $params, $options);
$this->refreshFrom($response, $opts);
return $this;
}
}

View File

@ -1,39 +0,0 @@
<?php
namespace Stripe\Checkout;
/**
* Class Session
*
* @property string $id
* @property string $object
* @property string $cancel_url
* @property string $client_reference_id
* @property string $customer
* @property string $customer_email
* @property mixed $display_items
* @property bool $livemode
* @property string $payment_intent
* @property string[] $payment_method_types
* @property string $submit_type
* @property string $subscription
* @property string $success_url
*
* @package Stripe
*/
class Session extends \Stripe\ApiResource
{
const OBJECT_NAME = "checkout.session";
use \Stripe\ApiOperations\Create;
use \Stripe\ApiOperations\Retrieve;
/**
* Possible string representations of submit type.
* @link https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-submit_type
*/
const SUBMIT_TYPE_AUTO = 'auto';
const SUBMIT_TYPE_BOOK = 'book';
const SUBMIT_TYPE_DONATE = 'donate';
const SUBMIT_TYPE_PAY = 'pay';
}

View File

@ -1,25 +0,0 @@
<?php
namespace Stripe;
/**
* Class CountrySpec
*
* @property string $id
* @property string $object
* @property string $default_currency
* @property mixed $supported_bank_account_currencies
* @property string[] $supported_payment_currencies
* @property string[] $supported_payment_methods
* @property string[] $supported_transfer_countries
* @property mixed $verification_fields
*
* @package Stripe
*/
class CountrySpec extends ApiResource
{
const OBJECT_NAME = "country_spec";
use ApiOperations\All;
use ApiOperations\Retrieve;
}

View File

@ -1,35 +0,0 @@
<?php
namespace Stripe;
/**
* Class Coupon
*
* @property string $id
* @property string $object
* @property int $amount_off
* @property int $created
* @property string $currency
* @property string $duration
* @property int $duration_in_months
* @property bool $livemode
* @property int $max_redemptions
* @property StripeObject $metadata
* @property string $name
* @property float $percent_off
* @property int $redeem_by
* @property int $times_redeemed
* @property bool $valid
*
* @package Stripe
*/
class Coupon extends ApiResource
{
const OBJECT_NAME = "coupon";
use ApiOperations\All;
use ApiOperations\Create;
use ApiOperations\Delete;
use ApiOperations\Retrieve;
use ApiOperations\Update;
}

View File

@ -1,75 +0,0 @@
<?php
namespace Stripe;
/**
* Class CreditNote
*
* @property string $id
* @property string $object
* @property int $amount
* @property string $customer_balance_transaction
* @property int $created
* @property string $currency
* @property string $customer
* @property string $invoice
* @property bool $livemode
* @property string $memo
* @property StripeObject $metadata
* @property string $number
* @property string $pdf
* @property string $reason
* @property string $refund
* @property string $status
* @property string $type
*
* @package Stripe
*/
class CreditNote extends ApiResource
{
const OBJECT_NAME = "credit_note";
use ApiOperations\All;
use ApiOperations\Create;
use ApiOperations\Retrieve;
use ApiOperations\Update;
/**
* Possible string representations of the credit note reason.
* @link https://stripe.com/docs/api/credit_notes/object#credit_note_object-reason
*/
const REASON_DUPLICATE = 'duplicate';
const REASON_FRAUDULENT = 'fraudulent';
const REASON_ORDER_CHANGE = 'order_change';
const REASON_PRODUCT_UNSATISFACTORY = 'product_unsatisfactory';
/**
* Possible string representations of the credit note status.
* @link https://stripe.com/docs/api/credit_notes/object#credit_note_object-status
*/
const STATUS_ISSUED = 'issued';
const STATUS_VOID = 'void';
/**
* Possible string representations of the credit note type.
* @link https://stripe.com/docs/api/credit_notes/object#credit_note_object-status
*/
const TYPE_POST_PAYMENT = 'post_payment';
const TYPE_PRE_PAYMENT = 'pre_payment';
/**
* @param array|null $params
* @param array|string|null $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return CreditNote The voided credit note.
*/
public function voidCreditNote($params = null, $opts = null)
{
$url = $this->instanceUrl() . '/void';
list($response, $opts) = $this->_request('post', $url, $params, $opts);
$this->refreshFrom($response, $opts);
return $this;
}
}

View File

@ -1,264 +0,0 @@
<?php
namespace Stripe;
/**
* Class Customer
*
* @property string $id
* @property string $object
* @property mixed $address
* @property int $balance
* @property string $created
* @property string $currency
* @property string $default_source
* @property bool $delinquent
* @property string $description
* @property Discount $discount
* @property string $email
* @property string $invoice_prefix
* @property mixed $invoice_settings
* @property bool $livemode
* @property StripeObject $metadata
* @property string $name
* @property string $phone
* @property string[] preferred_locales
* @property mixed $shipping
* @property Collection $sources
* @property Collection $subscriptions
* @property string $tax_exempt
* @property Collection $tax_ids
*
* @package Stripe
*/
class Customer extends ApiResource
{
const OBJECT_NAME = "customer";
use ApiOperations\All;
use ApiOperations\Create;
use ApiOperations\Delete;
use ApiOperations\NestedResource;
use ApiOperations\Retrieve;
use ApiOperations\Update;
/**
* Possible string representations of the customer's type of tax exemption.
* @link https://stripe.com/docs/api/customers/object#customer_object-tax_exempt
*/
const TAX_EXEMPT_NONE = 'none';
const TAX_EXEMPT_EXEMPT = 'exempt';
const TAX_EXEMPT_REVERSE = 'reverse';
public static function getSavedNestedResources()
{
static $savedNestedResources = null;
if ($savedNestedResources === null) {
$savedNestedResources = new Util\Set([
'source',
]);
}
return $savedNestedResources;
}
const PATH_BALANCE_TRANSACTIONS = '/balance_transactions';
const PATH_SOURCES = '/sources';
const PATH_TAX_IDS = '/tax_ids';
/**
* @return Customer The updated customer.
*/
public function deleteDiscount()
{
$url = $this->instanceUrl() . '/discount';
list($response, $opts) = $this->_request('delete', $url);
$this->refreshFrom(['discount' => null], $opts, true);
}
/**
* @param string|null $id The ID of the customer on which to create the source.
* @param array|null $params
* @param array|string|null $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return ApiResource
*/
public static function createSource($id, $params = null, $opts = null)
{
return self::_createNestedResource($id, static::PATH_SOURCES, $params, $opts);
}
/**
* @param string|null $id The ID of the customer to which the source belongs.
* @param string|null $sourceId The ID of the source to retrieve.
* @param array|null $params
* @param array|string|null $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return ApiResource
*/
public static function retrieveSource($id, $sourceId, $params = null, $opts = null)
{
return self::_retrieveNestedResource($id, static::PATH_SOURCES, $sourceId, $params, $opts);
}
/**
* @param string|null $id The ID of the customer to which the source belongs.
* @param string|null $sourceId The ID of the source to update.
* @param array|null $params
* @param array|string|null $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return ApiResource
*/
public static function updateSource($id, $sourceId, $params = null, $opts = null)
{
return self::_updateNestedResource($id, static::PATH_SOURCES, $sourceId, $params, $opts);
}
/**
* @param string|null $id The ID of the customer to which the source belongs.
* @param string|null $sourceId The ID of the source to delete.
* @param array|null $params
* @param array|string|null $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return ApiResource
*/
public static function deleteSource($id, $sourceId, $params = null, $opts = null)
{
return self::_deleteNestedResource($id, static::PATH_SOURCES, $sourceId, $params, $opts);
}
/**
* @param string|null $id The ID of the customer on which to retrieve the sources.
* @param array|null $params
* @param array|string|null $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return Collection The list of sources.
*/
public static function allSources($id, $params = null, $opts = null)
{
return self::_allNestedResources($id, static::PATH_SOURCES, $params, $opts);
}
/**
* @param string|null $id The ID of the customer on which to create the tax id.
* @param array|null $params
* @param array|string|null $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return ApiResource
*/
public static function createTaxId($id, $params = null, $opts = null)
{
return self::_createNestedResource($id, static::PATH_TAX_IDS, $params, $opts);
}
/**
* @param string|null $id The ID of the customer to which the tax id belongs.
* @param string|null $taxIdId The ID of the tax id to retrieve.
* @param array|null $params
* @param array|string|null $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return ApiResource
*/
public static function retrieveTaxId($id, $taxIdId, $params = null, $opts = null)
{
return self::_retrieveNestedResource($id, static::PATH_TAX_IDS, $taxIdId, $params, $opts);
}
/**
* @param string|null $id The ID of the customer to which the tax id belongs.
* @param string|null $taxIdId The ID of the tax id to delete.
* @param array|null $params
* @param array|string|null $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return ApiResource
*/
public static function deleteTaxId($id, $taxIdId, $params = null, $opts = null)
{
return self::_deleteNestedResource($id, static::PATH_TAX_IDS, $taxIdId, $params, $opts);
}
/**
* @param string|null $id The ID of the customer on which to retrieve the tax ids.
* @param array|null $params
* @param array|string|null $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return Collection The list of tax ids.
*/
public static function allTaxIds($id, $params = null, $opts = null)
{
return self::_allNestedResources($id, static::PATH_TAX_IDS, $params, $opts);
}
/**
* @param string|null $id The ID of the customer on which to create the balance transaction.
* @param array|null $params
* @param array|string|null $opts
*
* @return ApiResource
*/
public static function createBalanceTransaction($id, $params = null, $opts = null)
{
return self::_createNestedResource($id, static::PATH_BALANCE_TRANSACTIONS, $params, $opts);
}
/**
* @param string|null $id The ID of the customer to which the balance transaction belongs.
* @param string|null $balanceTransactionId The ID of the balance transaction to retrieve.
* @param array|null $params
* @param array|string|null $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return ApiResource
*/
public static function retrieveBalanceTransaction($id, $balanceTransactionId, $params = null, $opts = null)
{
return self::_retrieveNestedResource($id, static::PATH_BALANCE_TRANSACTIONS, $balanceTransactionId, $params, $opts);
}
/**
* @param string|null $id The ID of the customer on which to update the balance transaction.
* @param string|null $balanceTransactionId The ID of the balance transaction to update.
* @param array|null $params
* @param array|string|null $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return ApiResource
*/
public static function updateBalanceTransaction($id, $balanceTransactionId, $params = null, $opts = null)
{
return self::_updateNestedResource($id, static::PATH_BALANCE_TRANSACTIONS, $balanceTransactionId, $params, $opts);
}
/**
* @param string|null $id The ID of the customer on which to retrieve the customer balance transactions.
* @param array|null $params
* @param array|string|null $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return Collection The list of customer balance transactions.
*/
public static function allBalanceTransactions($id, $params = null, $opts = null)
{
return self::_allNestedResources($id, static::PATH_BALANCE_TRANSACTIONS, $params, $opts);
}
}

View File

@ -1,92 +0,0 @@
<?php
namespace Stripe;
/**
* Class CustomerBalanceTransaction
*
* @package Stripe
*
* @property string $id
* @property string $object
* @property int $amount
* @property string $credit_note
* @property int $created
* @property string $currency
* @property string $customer
* @property string $description
* @property int $ending_balance
* @property string $invoice
* @property bool $livemode
* @property StripeObject $metadata
* @property string $type
*/
class CustomerBalanceTransaction extends ApiResource
{
const OBJECT_NAME = "customer_balance_transaction";
/**
* Possible string representations of a balance transaction's type.
* @link https://stripe.com/docs/api/customers/customer_balance_transaction_object#customer_balance_transaction_object-type
*/
const TYPE_ADJUSTEMENT = 'adjustment';
const TYPE_APPLIED_TO_INVOICE = 'applied_to_invoice';
const TYPE_CREDIT_NOTE = 'credit_note';
const TYPE_INITIAL = 'initial';
const TYPE_INVOICE_TOO_LARGE = 'invoice_too_large';
const TYPE_INVOICE_TOO_SMALL = 'invoice_too_small';
const TYPE_UNSPENT_RECEIVER_CREDIT = 'unspent_receiver_credit';
/**
* @return string The API URL for this balance transaction.
*/
public function instanceUrl()
{
$id = $this['id'];
$customer = $this['customer'];
if (!$id) {
throw new Exception\UnexpectedValueException(
"Could not determine which URL to request: class instance has invalid ID: $id",
null
);
}
$id = Util\Util::utf8($id);
$customer = Util\Util::utf8($customer);
$base = Customer::classUrl();
$customerExtn = urlencode($customer);
$extn = urlencode($id);
return "$base/$customerExtn/balance_transactions/$extn";
}
/**
* @param array|string $_id
* @param array|string|null $_opts
*
* @throws \Stripe\Exception\BadMethodCallException
*/
public static function retrieve($_id, $_opts = null)
{
$msg = "Customer Balance Transactions cannot be retrieved without a " .
"customer ID. Retrieve a Customer Balance Transaction using " .
"`Customer::retrieveBalanceTransaction('customer_id', " .
"'balance_transaction_id')`.";
throw new Exception\BadMethodCallException($msg, null);
}
/**
* @param string $_id
* @param array|null $_params
* @param array|string|null $_options
*
* @throws \Stripe\Exception\BadMethodCallException
*/
public static function update($_id, $_params = null, $_options = null)
{
$msg = "Customer Balance Transactions cannot be updated without a " .
"customer ID. Update a Customer Balance Transaction using " .
"`Customer::updateBalanceTransaction('customer_id', " .
"'balance_transaction_id', \$updateParams)`.";
throw new Exception\BadMethodCallException($msg, null);
}
}

View File

@ -1,20 +0,0 @@
<?php
namespace Stripe;
/**
* Class Discount
*
* @property string $object
* @property Coupon $coupon
* @property string $customer
* @property int $end
* @property int $start
* @property string $subscription
*
* @package Stripe
*/
class Discount extends StripeObject
{
const OBJECT_NAME = "discount";
}

View File

@ -1,79 +0,0 @@
<?php
namespace Stripe;
/**
* Class Dispute
*
* @property string $id
* @property string $object
* @property int $amount
* @property BalanceTransaction[] $balance_transactions
* @property string $charge
* @property int $created
* @property string $currency
* @property mixed $evidence
* @property mixed $evidence_details
* @property bool $is_charge_refundable
* @property bool $livemode
* @property StripeObject $metadata
* @property string $reason
* @property string $status
*
* @package Stripe
*/
class Dispute extends ApiResource
{
const OBJECT_NAME = "dispute";
use ApiOperations\All;
use ApiOperations\Retrieve;
use ApiOperations\Update;
/**
* Possible string representations of dispute reasons.
* @link https://stripe.com/docs/api#dispute_object
*/
const REASON_BANK_CANNOT_PROCESS = 'bank_cannot_process';
const REASON_CHECK_RETURNED = 'check_returned';
const REASON_CREDIT_NOT_PROCESSED = 'credit_not_processed';
const REASON_CUSTOMER_INITIATED = 'customer_initiated';
const REASON_DEBIT_NOT_AUTHORIZED = 'debit_not_authorized';
const REASON_DUPLICATE = 'duplicate';
const REASON_FRAUDULENT = 'fraudulent';
const REASON_GENERAL = 'general';
const REASON_INCORRECT_ACCOUNT_DETAILS = 'incorrect_account_details';
const REASON_INSUFFICIENT_FUNDS = 'insufficient_funds';
const REASON_PRODUCT_NOT_RECEIVED = 'product_not_received';
const REASON_PRODUCT_UNACCEPTABLE = 'product_unacceptable';
const REASON_SUBSCRIPTION_CANCELED = 'subscription_canceled';
const REASON_UNRECOGNIZED = 'unrecognized';
/**
* Possible string representations of dispute statuses.
* @link https://stripe.com/docs/api#dispute_object
*/
const STATUS_CHARGE_REFUNDED = 'charge_refunded';
const STATUS_LOST = 'lost';
const STATUS_NEEDS_RESPONSE = 'needs_response';
const STATUS_UNDER_REVIEW = 'under_review';
const STATUS_WARNING_CLOSED = 'warning_closed';
const STATUS_WARNING_NEEDS_RESPONSE = 'warning_needs_response';
const STATUS_WARNING_UNDER_REVIEW = 'warning_under_review';
const STATUS_WON = 'won';
/**
* @param array|string|null $options
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return Dispute The closed dispute.
*/
public function close($options = null)
{
$url = $this->instanceUrl() . '/close';
list($response, $opts) = $this->_request('post', $url, null, $options);
$this->refreshFrom($response, $opts);
return $this;
}
}

View File

@ -1,43 +0,0 @@
<?php
namespace Stripe;
/**
* Class EphemeralKey
*
* @property string $id
* @property string $object
* @property int $created
* @property int $expires
* @property bool $livemode
* @property string $secret
* @property array $associated_objects
*
* @package Stripe
*/
class EphemeralKey extends ApiResource
{
const OBJECT_NAME = "ephemeral_key";
use ApiOperations\Create {
create as protected _create;
}
use ApiOperations\Delete;
/**
* @param array|null $params
* @param array|string|null $opts
*
* @throws \Stripe\Exception\InvalidArgumentException if stripe_version is missing
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return EphemeralKey The created key.
*/
public static function create($params = null, $opts = null)
{
if (!$opts || !isset($opts['stripe_version'])) {
throw new Exception\InvalidArgumentException('stripe_version must be specified to create an ephemeral key');
}
return self::_create($params, $opts);
}
}

View File

@ -1,162 +0,0 @@
<?php
namespace Stripe;
/**
* Class ErrorObject
*
* @property string $charge For card errors, the ID of the failed charge.
* @property string $code For some errors that could be handled
* programmatically, a short string indicating the error code reported.
* @property string $decline_code For card errors resulting from a card issuer
* decline, a short string indicating the card issuer's reason for the
* decline if they provide one.
* @property string $doc_url A URL to more information about the error code
* reported.
* @property string $message A human-readable message providing more details
* about the error. For card errors, these messages can be shown to your
* users.
* @property string $param If the error is parameter-specific, the parameter
* related to the error. For example, you can use this to display a message
* near the correct form field.
* @property PaymentIntent $payment_intent The PaymentIntent object for errors
* returned on a request involving a PaymentIntent.
* @property PaymentMethod $payment_method The PaymentMethod object for errors
* returned on a request involving a PaymentMethod.
* @property SetupIntent $setup_intent The SetupIntent object for errors
* returned on a request involving a SetupIntent.
* @property StripeObject $source The source object for errors returned on a
* request involving a source.
* @property string $type The type of error returned. One of
* `api_connection_error`, `api_error`, `authentication_error`,
* `card_error`, `idempotency_error`, `invalid_request_error`, or
* `rate_limit_error`.
*
* @package Stripe
*/
class ErrorObject extends StripeObject
{
/**
* Possible string representations of an error's code.
* @link https://stripe.com/docs/error-codes
*/
const CODE_ACCOUNT_ALREADY_EXISTS = 'account_already_exists';
const CODE_ACCOUNT_COUNTRY_INVALID_ADDRESS = 'account_country_invalid_address';
const CODE_ACCOUNT_INVALID = 'account_invalid';
const CODE_ACCOUNT_NUMBER_INVALID = 'account_number_invalid';
const CODE_ALIPAY_UPGRADE_REQUIRED = 'alipay_upgrade_required';
const CODE_AMOUNT_TOO_LARGE = 'amount_too_large';
const CODE_AMOUNT_TOO_SMALL = 'amount_too_small';
const CODE_API_KEY_EXPIRED = 'api_key_expired';
const CODE_BALANCE_INSUFFICIENT = 'balance_insufficient';
const CODE_BANK_ACCOUNT_EXISTS = 'bank_account_exists';
const CODE_BANK_ACCOUNT_UNUSABLE = 'bank_account_unusable';
const CODE_BANK_ACCOUNT_UNVERIFIED = 'bank_account_unverified';
const CODE_BITCOIN_UPGRADE_REQUIRED = 'bitcoin_upgrade_required';
const CODE_CARD_DECLINED = 'card_declined';
const CODE_CHARGE_ALREADY_CAPTURED = 'charge_already_captured';
const CODE_CHARGE_ALREADY_REFUNDED = 'charge_already_refunded';
const CODE_CHARGE_DISPUTED = 'charge_disputed';
const CODE_CHARGE_EXCEEDS_SOURCE_LIMIT = 'charge_exceeds_source_limit';
const CODE_CHARGE_EXPIRED_FOR_CAPTURE = 'charge_expired_for_capture';
const CODE_COUNTRY_UNSUPPORTED = 'country_unsupported';
const CODE_COUPON_EXPIRED = 'coupon_expired';
const CODE_CUSTOMER_MAX_SUBSCRIPTIONS = 'customer_max_subscriptions';
const CODE_EMAIL_INVALID = 'email_invalid';
const CODE_EXPIRED_CARD = 'expired_card';
const CODE_IDEMPOTENCY_KEY_IN_USE = 'idempotency_key_in_use';
const CODE_INCORRECT_ADDRESS = 'incorrect_address';
const CODE_INCORRECT_CVC = 'incorrect_cvc';
const CODE_INCORRECT_NUMBER = 'incorrect_number';
const CODE_INCORRECT_ZIP = 'incorrect_zip';
const CODE_INSTANT_PAYOUTS_UNSUPPORTED = 'instant_payouts_unsupported';
const CODE_INVALID_CARD_TYPE = 'invalid_card_type';
const CODE_INVALID_CHARGE_AMOUNT = 'invalid_charge_amount';
const CODE_INVALID_CVC = 'invalid_cvc';
const CODE_INVALID_EXPIRY_MONTH = 'invalid_expiry_month';
const CODE_INVALID_EXPIRY_YEAR = 'invalid_expiry_year';
const CODE_INVALID_NUMBER = 'invalid_number';
const CODE_INVALID_SOURCE_USAGE = 'invalid_source_usage';
const CODE_INVOICE_NO_CUSTOMER_LINE_ITEMS = 'invoice_no_customer_line_items';
const CODE_INVOICE_NO_SUBSCRIPTION_LINE_ITEMS = 'invoice_no_subscription_line_items';
const CODE_INVOICE_NOT_EDITABLE = 'invoice_not_editable';
const CODE_INVOICE_PAYMENT_INTENT_REQUIRES_ACTION = 'invoice_payment_intent_requires_action';
const CODE_INVOICE_UPCOMING_NONE = 'invoice_upcoming_none';
const CODE_LIVEMODE_MISMATCH = 'livemode_mismatch';
const CODE_LOCK_TIMEOUT = 'lock_timeout';
const CODE_MISSING = 'missing';
const CODE_NOT_ALLOWED_ON_STANDARD_ACCOUNT = 'not_allowed_on_standard_account';
const CODE_ORDER_CREATION_FAILED = 'order_creation_failed';
const CODE_ORDER_REQUIRED_SETTINGS = 'order_required_settings';
const CODE_ORDER_STATUS_INVALID = 'order_status_invalid';
const CODE_ORDER_UPSTREAM_TIMEOUT = 'order_upstream_timeout';
const CODE_OUT_OF_INVENTORY = 'out_of_inventory';
const CODE_PARAMETER_INVALID_EMPTY = 'parameter_invalid_empty';
const CODE_PARAMETER_INVALID_INTEGER = 'parameter_invalid_integer';
const CODE_PARAMETER_INVALID_STRING_BLANK = 'parameter_invalid_string_blank';
const CODE_PARAMETER_INVALID_STRING_EMPTY = 'parameter_invalid_string_empty';
const CODE_PARAMETER_MISSING = 'parameter_missing';
const CODE_PARAMETER_UNKNOWN = 'parameter_unknown';
const CODE_PARAMETERS_EXCLUSIVE = 'parameters_exclusive';
const CODE_PAYMENT_INTENT_AUTHENTICATION_FAILURE = 'payment_intent_authentication_failure';
const CODE_PAYMENT_INTENT_INCOMPATIBLE_PAYMENT_METHOD = 'payment_intent_incompatible_payment_method';
const CODE_PAYMENT_INTENT_INVALID_PARAMETER = 'payment_intent_invalid_parameter';
const CODE_PAYMENT_INTENT_PAYMENT_ATTEMPT_FAILED = 'payment_intent_payment_attempt_failed';
const CODE_PAYMENT_INTENT_UNEXPECTED_STATE = 'payment_intent_unexpected_state';
const CODE_PAYMENT_METHOD_UNACTIVATED = 'payment_method_unactivated';
const CODE_PAYMENT_METHOD_UNEXPECTED_STATE = 'payment_method_unexpected_state';
const CODE_PAYOUTS_NOT_ALLOWED = 'payouts_not_allowed';
const CODE_PLATFORM_API_KEY_EXPIRED = 'platform_api_key_expired';
const CODE_POSTAL_CODE_INVALID = 'postal_code_invalid';
const CODE_PROCESSING_ERROR = 'processing_error';
const CODE_PRODUCT_INACTIVE = 'product_inactive';
const CODE_RATE_LIMIT = 'rate_limit';
const CODE_RESOURCE_ALREADY_EXISTS = 'resource_already_exists';
const CODE_RESOURCE_MISSING = 'resource_missing';
const CODE_ROUTING_NUMBER_INVALID = 'routing_number_invalid';
const CODE_SECRET_KEY_REQUIRED = 'secret_key_required';
const CODE_SEPA_UNSUPPORTED_ACCOUNT = 'sepa_unsupported_account';
const CODE_SETUP_ATTEMPT_FAILED = 'setup_attempt_failed';
const CODE_SETUP_INTENT_AUTHENTICATION_FAILURE = 'setup_intent_authentication_failure';
const CODE_SETUP_INTENT_UNEXPECTED_STATE = 'setup_intent_unexpected_state';
const CODE_SHIPPING_CALCULATION_FAILED = 'shipping_calculation_failed';
const CODE_SKU_INACTIVE = 'sku_inactive';
const CODE_STATE_UNSUPPORTED = 'state_unsupported';
const CODE_TAX_ID_INVALID = 'tax_id_invalid';
const CODE_TAXES_CALCULATION_FAILED = 'taxes_calculation_failed';
const CODE_TESTMODE_CHARGES_ONLY = 'testmode_charges_only';
const CODE_TLS_VERSION_UNSUPPORTED = 'tls_version_unsupported';
const CODE_TOKEN_ALREADY_USED = 'token_already_used';
const CODE_TOKEN_IN_USE = 'token_in_use';
const CODE_TRANSFERS_NOT_ALLOWED = 'transfers_not_allowed';
const CODE_UPSTREAM_ORDER_CREATION_FAILED = 'upstream_order_creation_failed';
const CODE_URL_INVALID = 'url_invalid';
/**
* Refreshes this object using the provided values.
*
* @param array $values
* @param null|string|array|Util\RequestOptions $opts
* @param boolean $partial Defaults to false.
*/
public function refreshFrom($values, $opts, $partial = false)
{
// Unlike most other API resources, the API will omit attributes in
// error objects when they have a null value. We manually set default
// values here to facilitate generic error handling.
$values = array_merge([
'charge' => null,
'code' => null,
'decline_code' => null,
'doc_url' => null,
'message' => null,
'param' => null,
'payment_intent' => null,
'payment_method' => null,
'setup_intent' => null,
'source' => null,
'type' => null,
], $values);
parent::refreshFrom($values, $opts, $partial);
}
}

View File

@ -1,167 +0,0 @@
<?php
namespace Stripe;
/**
* Class Event
*
* @property string $id
* @property string $object
* @property string $account
* @property string $api_version
* @property int $created
* @property mixed $data
* @property bool $livemode
* @property int $pending_webhooks
* @property mixed $request
* @property string $type
*
* @package Stripe
*/
class Event extends ApiResource
{
const OBJECT_NAME = "event";
/**
* Possible string representations of event types.
* @link https://stripe.com/docs/api#event_types
*/
const ACCOUNT_UPDATED = 'account.updated';
const ACCOUNT_APPLICATION_AUTHORIZED = 'account.application.authorized';
const ACCOUNT_APPLICATION_DEAUTHORIZED = 'account.application.deauthorized';
const ACCOUNT_EXTERNAL_ACCOUNT_CREATED = 'account.external_account.created';
const ACCOUNT_EXTERNAL_ACCOUNT_DELETED = 'account.external_account.deleted';
const ACCOUNT_EXTERNAL_ACCOUNT_UPDATED = 'account.external_account.updated';
const APPLICATION_FEE_CREATED = 'application_fee.created';
const APPLICATION_FEE_REFUNDED = 'application_fee.refunded';
const APPLICATION_FEE_REFUND_UPDATED = 'application_fee.refund.updated';
const BALANCE_AVAILABLE = 'balance.available';
const CHARGE_CAPTURED = 'charge.captured';
const CHARGE_EXPIRED = 'charge.expired';
const CHARGE_FAILED = 'charge.failed';
const CHARGE_PENDING = 'charge.pending';
const CHARGE_REFUNDED = 'charge.refunded';
const CHARGE_SUCCEEDED = 'charge.succeeded';
const CHARGE_UPDATED = 'charge.updated';
const CHARGE_DISPUTE_CLOSED = 'charge.dispute.closed';
const CHARGE_DISPUTE_CREATED = 'charge.dispute.created';
const CHARGE_DISPUTE_FUNDS_REINSTATED = 'charge.dispute.funds_reinstated';
const CHARGE_DISPUTE_FUNDS_WITHDRAWN = 'charge.dispute.funds_withdrawn';
const CHARGE_DISPUTE_UPDATED = 'charge.dispute.updated';
const CHARGE_REFUND_UPDATED = 'charge.refund.updated';
const CHECKOUT_SESSION_COMPLETED = 'checkout.session.completed';
const COUPON_CREATED = 'coupon.created';
const COUPON_DELETED = 'coupon.deleted';
const COUPON_UPDATED = 'coupon.updated';
const CREDIT_NOTE_CREATED = 'credit_note.created';
const CREDIT_NOTE_UPDATED = 'credit_note.updated';
const CREDIT_NOTE_VOIDED = 'credit_note.voided';
const CUSTOMER_CREATED = 'customer.created';
const CUSTOMER_DELETED = 'customer.deleted';
const CUSTOMER_UPDATED = 'customer.updated';
const CUSTOMER_DISCOUNT_CREATED = 'customer.discount.created';
const CUSTOMER_DISCOUNT_DELETED = 'customer.discount.deleted';
const CUSTOMER_DISCOUNT_UPDATED = 'customer.discount.updated';
const CUSTOMER_SOURCE_CREATED = 'customer.source.created';
const CUSTOMER_SOURCE_DELETED = 'customer.source.deleted';
const CUSTOMER_SOURCE_EXPIRING = 'customer.source.expiring';
const CUSTOMER_SOURCE_UPDATED = 'customer.source.updated';
const CUSTOMER_SUBSCRIPTION_CREATED = 'customer.subscription.created';
const CUSTOMER_SUBSCRIPTION_DELETED = 'customer.subscription.deleted';
const CUSTOMER_SUBSCRIPTION_TRIAL_WILL_END = 'customer.subscription.trial_will_end';
const CUSTOMER_SUBSCRIPTION_UPDATED = 'customer.subscription.updated';
const FILE_CREATED = 'file.created';
const INVOICE_CREATED = 'invoice.created';
const INVOICE_DELETED = 'invoice.deleted';
const INVOICE_FINALIZED = 'invoice.finalized';
const INVOICE_MARKED_UNCOLLECTIBLE = 'invoice.marked_uncollectible';
const INVOICE_PAYMENT_ACTION_REQUIRED = 'invoice.payment_action_required';
const INVOICE_PAYMENT_FAILED = 'invoice.payment_failed';
const INVOICE_PAYMENT_SUCCEEDED = 'invoice.payment_succeeded';
const INVOICE_SENT = 'invoice.sent';
const INVOICE_UPCOMING = 'invoice.upcoming';
const INVOICE_UPDATED = 'invoice.updated';
const INVOICE_VOIDED = 'invoice.voided';
const INVOICEITEM_CREATED = 'invoiceitem.created';
const INVOICEITEM_DELETED = 'invoiceitem.deleted';
const INVOICEITEM_UPDATED = 'invoiceitem.updated';
const ISSUER_FRAUD_RECORD_CREATED = 'issuer_fraud_record.created';
const ISSUING_AUTHORIZATION_CREATED = 'issuing_authorization.created';
const ISSUING_AUTHORIZATION_REQUEST = 'issuing_authorization.request';
const ISSUING_AUTHORIZATION_UPDATED = 'issuing_authorization.updated';
const ISSUING_CARD_CREATED = 'issuing_card.created';
const ISSUING_CARD_UPDATED = 'issuing_card.updated';
const ISSUING_CARDHOLDER_CREATED = 'issuing_cardholder.created';
const ISSUING_CARDHOLDER_UPDATED = 'issuing_cardholder.updated';
const ISSUING_DISPUTE_CREATED = 'issuing_dispute.created';
const ISSUING_DISPUTE_UPDATED = 'issuing_dispute.updated';
const ISSUING_TRANSACTION_CREATED = 'issuing_transaction.created';
const ISSUING_TRANSACTION_UPDATED = 'issuing_transaction.updated';
const ORDER_CREATED = 'order.created';
const ORDER_PAYMENT_FAILED = 'order.payment_failed';
const ORDER_PAYMENT_SUCCEEDED = 'order.payment_succeeded';
const ORDER_UPDATED = 'order.updated';
const ORDER_RETURN_CREATED = 'order_return.created';
const PAYMENT_INTENT_AMOUNT_CAPTURABLE_UPDATED = 'payment_intent.amount_capturable_updated';
const PAYMENT_INTENT_CREATED = 'payment_intent.created';
const PAYMENT_INTENT_PAYMENT_FAILED = 'payment_intent.payment_failed';
const PAYMENT_INTENT_SUCCEEDED = 'payment_intent.succeeded';
const PAYMENT_METHOD_ATTACHED = 'payment_method.attached';
const PAYMENT_METHOD_CARD_AUTOMATICALLY_UPDATED = 'payment_method.card_automatically_updated';
const PAYMENT_METHOD_DETACHED = 'payment_method.detached';
const PAYMENT_METHOD_UPDATED = 'payment_method.updated';
const PAYOUT_CANCELED = 'payout.canceled';
const PAYOUT_CREATED = 'payout.created';
const PAYOUT_FAILED = 'payout.failed';
const PAYOUT_PAID = 'payout.paid';
const PAYOUT_UPDATED = 'payout.updated';
const PERSON_CREATED = 'person.created';
const PERSON_DELETED = 'person.deleted';
const PERSON_UPDATED = 'person.updated';
const PING = 'ping';
const PLAN_CREATED = 'plan.created';
const PLAN_DELETED = 'plan.deleted';
const PLAN_UPDATED = 'plan.updated';
const PRODUCT_CREATED = 'product.created';
const PRODUCT_DELETED = 'product.deleted';
const PRODUCT_UPDATED = 'product.updated';
const RECIPIENT_CREATED = 'recipient.created';
const RECIPIENT_DELETED = 'recipient.deleted';
const RECIPIENT_UPDATED = 'recipient.updated';
const REPORTING_REPORT_RUN_FAILED = 'reporting.report_run.failed';
const REPORTING_REPORT_RUN_SUCCEEDED = 'reporting.report_run.succeeded';
const REPORTING_REPORT_TYPE_UPDATED = 'reporting.report_type.updated';
const REVIEW_CLOSED = 'review.closed';
const REVIEW_OPENED = 'review.opened';
const SIGMA_SCHEDULED_QUERY_RUN_CREATED = 'sigma.scheduled_query_run.created';
const SKU_CREATED = 'sku.created';
const SKU_DELETED = 'sku.deleted';
const SKU_UPDATED = 'sku.updated';
const SOURCE_CANCELED = 'source.canceled';
const SOURCE_CHARGEABLE = 'source.chargeable';
const SOURCE_FAILED = 'source.failed';
const SOURCE_MANDATE_NOTIFICATION = 'source.mandate_notification';
const SOURCE_REFUND_ATTRIBUTES_REQUIRED = 'source.refund_attributes_required';
const SOURCE_TRANSACTION_CREATED = 'source.transaction.created';
const SOURCE_TRANSACTION_UPDATED = 'source.transaction.updated';
const SUBSCRIPTION_SCHEDULE_ABORTED = 'subscription_schedule.aborted';
const SUBSCRIPTION_SCHEDULE_CANCELED = 'subscription_schedule.canceled';
const SUBSCRIPTION_SCHEDULE_COMPLETED = 'subscription_schedule.completed';
const SUBSCRIPTION_SCHEDULE_CREATED = 'subscription_schedule.created';
const SUBSCRIPTION_SCHEDULE_EXPIRING = 'subscription_schedule.expiring';
const SUBSCRIPTION_SCHEDULE_RELEASED = 'subscription_schedule.released';
const SUBSCRIPTION_SCHEDULE_UPDATED = 'subscription_schedule.updated';
const TAX_RATE_CREATED = 'tax_rate.created';
const TAX_RATE_UPDATED = 'tax_rate.updated';
const TOPUP_CANCELED = 'topup.canceled';
const TOPUP_CREATED = 'topup.created';
const TOPUP_FAILED = 'topup.failed';
const TOPUP_REVERSED = 'topup.reversed';
const TOPUP_SUCCEEDED = 'topup.succeeded';
const TRANSFER_CREATED = 'transfer.created';
const TRANSFER_REVERSED = 'transfer.reversed';
const TRANSFER_UPDATED = 'transfer.updated';
use ApiOperations\All;
use ApiOperations\Retrieve;
}

View File

@ -1,16 +0,0 @@
<?php
namespace Stripe;
/**
* Class ExchangeRate
*
* @package Stripe
*/
class ExchangeRate extends ApiResource
{
const OBJECT_NAME = "exchange_rate";
use ApiOperations\All;
use ApiOperations\Retrieve;
}

View File

@ -1,60 +0,0 @@
<?php
namespace Stripe;
/**
* Class File
*
* @property string $id
* @property string $object
* @property int $created
* @property string $filename
* @property Collection $links
* @property string $purpose
* @property int $size
* @property string $title
* @property string $type
* @property string $url
*
* @package Stripe
*/
class File extends ApiResource
{
// This resource can have two different object names. In latter API
// versions, only `file` is used, but since stripe-php may be used with
// any API version, we need to support deserializing the older
// `file_upload` object into the same class.
const OBJECT_NAME = "file";
const OBJECT_NAME_ALT = "file_upload";
use ApiOperations\All;
use ApiOperations\Create {
create as protected _create;
}
use ApiOperations\Retrieve;
public static function classUrl()
{
return '/v1/files';
}
/**
* @param array|null $params
* @param array|string|null $options
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\File The created resource.
*/
public static function create($params = null, $options = null)
{
$opts = \Stripe\Util\RequestOptions::parse($options);
if (is_null($opts->apiBase)) {
$opts->apiBase = Stripe::$apiUploadBase;
}
// Manually flatten params, otherwise curl's multipart encoder will
// choke on nested arrays.
$flatParams = array_column(\Stripe\Util\Util::flattenParams($params), 1, 0);
return static::_create($flatParams, $opts);
}
}

View File

@ -1,28 +0,0 @@
<?php
namespace Stripe;
/**
* Class FileLink
*
* @property string $id
* @property string $object
* @property int $created
* @property bool $expired
* @property int $expires_at
* @property string $file
* @property bool $livemode
* @property StripeObject $metadata
* @property string $url
*
* @package Stripe
*/
class FileLink extends ApiResource
{
const OBJECT_NAME = "file_link";
use ApiOperations\All;
use ApiOperations\Create;
use ApiOperations\Retrieve;
use ApiOperations\Update;
}

View File

@ -1,214 +0,0 @@
<?php
namespace Stripe;
/**
* Class Invoice
*
* @property string $id
* @property string $object
* @property string $account_country
* @property string $account_name
* @property int $amount_due
* @property int $amount_paid
* @property int $amount_remaining
* @property int $application_fee_amount
* @property int $attempt_count
* @property bool $attempted
* @property bool $auto_advance
* @property string $billing
* @property string $billing_reason
* @property string $charge
* @property string $collection_method
* @property int $created
* @property string $currency
* @property array $custom_fields
* @property string $customer
* @property mixed $customer_address
* @property string $customer_email
* @property string $customer_name
* @property string $customer_phone
* @property mixed $customer_shipping
* @property string $customer_tax_exempt
* @property array $customer_tax_ids
* @property string $default_payment_method
* @property string $default_source
* @property array $default_tax_rates
* @property string $description
* @property Discount $discount
* @property int $due_date
* @property int $ending_balance
* @property string $footer
* @property string $hosted_invoice_url
* @property string $invoice_pdf
* @property Collection $lines
* @property bool $livemode
* @property StripeObject $metadata
* @property int $next_payment_attempt
* @property string $number
* @property bool $paid
* @property string $payment_intent
* @property int $period_end
* @property int $period_start
* @property int $post_payment_credit_notes_amount
* @property int $pre_payment_credit_notes_amount
* @property string $receipt_number
* @property int $starting_balance
* @property string $statement_descriptor
* @property string $status
* @property mixed $status_transitions
* @property string $subscription
* @property int $subscription_proration_date
* @property int $subtotal
* @property int $tax
* @property mixed $threshold_reason
* @property int $total
* @property array $total_tax_amounts
* @property int $webhooks_delivered_at
*
* @package Stripe
*/
class Invoice extends ApiResource
{
const OBJECT_NAME = "invoice";
use ApiOperations\All;
use ApiOperations\Create;
use ApiOperations\Delete;
use ApiOperations\Retrieve;
use ApiOperations\Update;
/**
* Possible string representations of the billing reason.
* @link https://stripe.com/docs/api/invoices/object#invoice_object-billing_reason
*/
const BILLING_REASON_MANUAL = 'manual';
const BILLING_REASON_SUBSCRIPTION = 'subscription';
const BILLING_REASON_SUBSCRIPTION_CREATE = 'subscription_create';
const BILLING_REASON_SUBSCRIPTION_CYCLE = 'subscription_cycle';
const BILLING_REASON_SUBSCRIPTION_THRESHOLD = 'subscription_threshold';
const BILLING_REASON_SUBSCRIPTION_UPDATE = 'subscription_update';
const BILLING_REASON_UPCOMING = 'upcoming';
/**
* Possible string representations of the `collection_method` property.
* @link https://stripe.com/docs/api/invoices/object#invoice_object-collection_method
*/
const COLLECTION_METHOD_CHARGE_AUTOMATICALLY = 'charge_automatically';
const COLLECTION_METHOD_SEND_INVOICE = 'send_invoice';
/**
* Possible string representations of the invoice status.
* @link https://stripe.com/docs/api/invoices/object#invoice_object-status
*/
const STATUS_DRAFT = 'draft';
const STATUS_OPEN = 'open';
const STATUS_PAID = 'paid';
const STATUS_UNCOLLECTIBLE = 'uncollectible';
const STATUS_VOID = 'void';
/**
* Possible string representations of the `billing` property.
* @deprecated Use `collection_method` instead.
* @link https://stripe.com/docs/api/invoices/object#invoice_object-billing
*/
const BILLING_CHARGE_AUTOMATICALLY = 'charge_automatically';
const BILLING_SEND_INVOICE = 'send_invoice';
/**
* @param array|null $params
* @param array|string|null $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return Invoice The finalized invoice.
*/
public function finalizeInvoice($params = null, $opts = null)
{
$url = $this->instanceUrl() . '/finalize';
list($response, $opts) = $this->_request('post', $url, $params, $opts);
$this->refreshFrom($response, $opts);
return $this;
}
/**
* @param array|null $params
* @param array|string|null $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return Invoice The uncollectible invoice.
*/
public function markUncollectible($params = null, $opts = null)
{
$url = $this->instanceUrl() . '/mark_uncollectible';
list($response, $opts) = $this->_request('post', $url, $params, $opts);
$this->refreshFrom($response, $opts);
return $this;
}
/**
* @param array|null $params
* @param array|string|null $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return Invoice The paid invoice.
*/
public function pay($params = null, $opts = null)
{
$url = $this->instanceUrl() . '/pay';
list($response, $opts) = $this->_request('post', $url, $params, $opts);
$this->refreshFrom($response, $opts);
return $this;
}
/**
* @param array|null $params
* @param array|string|null $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return Invoice The sent invoice.
*/
public function sendInvoice($params = null, $opts = null)
{
$url = $this->instanceUrl() . '/send';
list($response, $opts) = $this->_request('post', $url, $params, $opts);
$this->refreshFrom($response, $opts);
return $this;
}
/**
* @param array|null $params
* @param array|string|null $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return Invoice The upcoming invoice.
*/
public static function upcoming($params = null, $opts = null)
{
$url = static::classUrl() . '/upcoming';
list($response, $opts) = static::_staticRequest('get', $url, $params, $opts);
$obj = Util\Util::convertToStripeObject($response->json, $opts);
$obj->setLastResponse($response);
return $obj;
}
/**
* @param array|null $params
* @param array|string|null $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return Invoice The voided invoice.
*/
public function voidInvoice($params = null, $opts = null)
{
$url = $this->instanceUrl() . '/void';
list($response, $opts) = $this->_request('post', $url, $params, $opts);
$this->refreshFrom($response, $opts);
return $this;
}
}

View File

@ -1,39 +0,0 @@
<?php
namespace Stripe;
/**
* Class InvoiceItem
*
* @property string $id
* @property string $object
* @property int $amount
* @property string $currency
* @property string $customer
* @property int $date
* @property string $description
* @property bool $discountable
* @property string $invoice
* @property bool $livemode
* @property StripeObject $metadata
* @property mixed $period
* @property Plan $plan
* @property bool $proration
* @property int $quantity
* @property string $subscription
* @property string $subscription_item
* @property array $tax_rates
* @property int $unit_amount
*
* @package Stripe
*/
class InvoiceItem extends ApiResource
{
const OBJECT_NAME = "invoiceitem";
use ApiOperations\All;
use ApiOperations\Create;
use ApiOperations\Delete;
use ApiOperations\Retrieve;
use ApiOperations\Update;
}

View File

@ -1,32 +0,0 @@
<?php
namespace Stripe;
/**
* Class InvoiceLineItem
*
* @property string $id
* @property string $object
* @property int $amount
* @property string $currency
* @property string $description
* @property bool $discountable
* @property string $invoice_item
* @property bool $livemode
* @property StripeObject $metadata
* @property mixed $period
* @property Plan $plan
* @property bool $proration
* @property int $quantity
* @property string $subscription
* @property string $subscription_item
* @property array $tax_amounts
* @property array $tax_rates
* @property string $type
*
* @package Stripe
*/
class InvoiceLineItem extends ApiResource
{
const OBJECT_NAME = "line_item";
}

View File

@ -1,72 +0,0 @@
<?php
namespace Stripe\Issuing;
/**
* Class Authorization
*
* @property string $id
* @property string $object
* @property bool $approved
* @property string $authorization_method
* @property int $authorized_amount
* @property string $authorized_currency
* @property \Stripe\Collection $balance_transactions
* @property Card $card
* @property Cardholder $cardholder
* @property int $created
* @property int $held_amount
* @property string $held_currency
* @property bool $is_held_amount_controllable
* @property bool $livemode
* @property mixed $merchant_data
* @property \Stripe\StripeObject $metadata
* @property int $pending_authorized_amount
* @property int $pending_held_amount
* @property mixed $request_history
* @property string $status
* @property \Stripe\Collection $transactions
* @property mixed $verification_data
*
* @package Stripe\Issuing
*/
class Authorization extends \Stripe\ApiResource
{
const OBJECT_NAME = "issuing.authorization";
use \Stripe\ApiOperations\All;
use \Stripe\ApiOperations\Retrieve;
use \Stripe\ApiOperations\Update;
/**
* @param array|null $params
* @param array|string|null $options
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return Authorization The approved authorization.
*/
public function approve($params = null, $options = null)
{
$url = $this->instanceUrl() . '/approve';
list($response, $opts) = $this->_request('post', $url, $params, $options);
$this->refreshFrom($response, $opts);
return $this;
}
/**
* @param array|null $params
* @param array|string|null $options
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return Authorization The declined authorization.
*/
public function decline($params = null, $options = null)
{
$url = $this->instanceUrl() . '/decline';
list($response, $opts) = $this->_request('post', $url, $params, $options);
$this->refreshFrom($response, $opts);
return $this;
}
}

View File

@ -1,53 +0,0 @@
<?php
namespace Stripe\Issuing;
/**
* Class Card
*
* @property string $id
* @property string $object
* @property mixed $authorization_controls
* @property mixed $billing
* @property string $brand
* @property Cardholder $cardholder
* @property int $created
* @property string $currency
* @property int $exp_month
* @property int $exp_year
* @property string $last4
* @property bool $livemode
* @property \Stripe\StripeObject $metadata
* @property string $name
* @property mixed $shipping
* @property string $status
* @property string $type
*
* @package Stripe\Issuing
*/
class Card extends \Stripe\ApiResource
{
const OBJECT_NAME = "issuing.card";
use \Stripe\ApiOperations\All;
use \Stripe\ApiOperations\Create;
use \Stripe\ApiOperations\Retrieve;
use \Stripe\ApiOperations\Update;
/**
* @param array|null $params
* @param array|string|null $options
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return CardDetails The card details associated with that issuing card.
*/
public function details($params = null, $options = null)
{
$url = $this->instanceUrl() . '/details';
list($response, $opts) = $this->_request('get', $url, $params, $options);
$obj = \Stripe\Util\Util::convertToStripeObject($response, $opts);
$obj->setLastResponse($response);
return $obj;
}
}

View File

@ -1,30 +0,0 @@
<?php
namespace Stripe\Issuing;
/**
* Class Cardholder
*
* @property string $id
* @property string $object
* @property mixed $billing
* @property int $created
* @property string $email
* @property bool $livemode
* @property \Stripe\StripeObject $metadata
* @property string $name
* @property string $phone_number
* @property string $status
* @property string $type
*
* @package Stripe\Issuing
*/
class Cardholder extends \Stripe\ApiResource
{
const OBJECT_NAME = "issuing.cardholder";
use \Stripe\ApiOperations\All;
use \Stripe\ApiOperations\Create;
use \Stripe\ApiOperations\Retrieve;
use \Stripe\ApiOperations\Update;
}

View File

@ -1,30 +0,0 @@
<?php
namespace Stripe\Issuing;
/**
* Class Dispute
*
* @property string $id
* @property string $object
* @property int $amount
* @property int $created
* @property string $currency
* @property mixed $evidence
* @property bool $livemode
* @property \Stripe\StripeObject $metadata
* @property string $reason
* @property string $status
* @property Transaction $transaction
*
* @package Stripe\Issuing
*/
class Dispute extends \Stripe\ApiResource
{
const OBJECT_NAME = "issuing.dispute";
use \Stripe\ApiOperations\All;
use \Stripe\ApiOperations\Create;
use \Stripe\ApiOperations\Retrieve;
use \Stripe\ApiOperations\Update;
}

View File

@ -1,35 +0,0 @@
<?php
namespace Stripe\Issuing;
/**
* Class Transaction
*
* @property string $id
* @property string $object
* @property int $amount
* @property string $authorization
* @property string $balance_transaction
* @property string $card
* @property string $cardholder
* @property int $created
* @property string $currency
* @property string $dispute
* @property bool $livemode
* @property mixed $merchant_data
* @property int $merchant_amount
* @property string $merchant_currency
* @property \Stripe\StripeObject $metadata
* @property string $type
*
* @package Stripe\Issuing
*/
class Transaction extends \Stripe\ApiResource
{
const OBJECT_NAME = "issuing.transaction";
use \Stripe\ApiOperations\All;
use \Stripe\ApiOperations\Create;
use \Stripe\ApiOperations\Retrieve;
use \Stripe\ApiOperations\Update;
}

View File

@ -1,17 +0,0 @@
<?php
namespace Stripe;
/**
* Class LoginLink
*
* @property string $object
* @property int $created
* @property string $url
*
* @package Stripe
*/
class LoginLink extends ApiResource
{
const OBJECT_NAME = "login_link";
}

View File

@ -1,67 +0,0 @@
<?php
namespace Stripe;
/**
* Class Order
*
* @property string $id
* @property string $object
* @property int $amount
* @property int $amount_returned
* @property string $application
* @property int $application_fee
* @property string $charge
* @property int $created
* @property string $currency
* @property string $customer
* @property string $email
* @property string $external_coupon_code
* @property OrderItem[] $items
* @property bool $livemode
* @property StripeObject $metadata
* @property Collection $returns
* @property string $selected_shipping_method
* @property mixed $shipping
* @property array $shipping_methods
* @property string $status
* @property mixed $status_transitions
* @property int $updated
* @property string $upstream_id
*
* @package Stripe
*/
class Order extends ApiResource
{
const OBJECT_NAME = "order";
use ApiOperations\All;
use ApiOperations\Create;
use ApiOperations\Retrieve;
use ApiOperations\Update;
/**
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return Order The paid order.
*/
public function pay($params = null, $opts = null)
{
$url = $this->instanceUrl() . '/pay';
list($response, $opts) = $this->_request('post', $url, $params, $opts);
$this->refreshFrom($response, $opts);
return $this;
}
/**
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return OrderReturn The newly created return.
*/
public function returnOrder($params = null, $opts = null)
{
$url = $this->instanceUrl() . '/returns';
list($response, $opts) = $this->_request('post', $url, $params, $opts);
return Util\Util::convertToStripeObject($response, $opts);
}
}

View File

@ -1,26 +0,0 @@
<?php
namespace Stripe;
/**
* Class OrderReturn
*
* @property string $id
* @property string $object
* @property int $amount
* @property int $created
* @property string $currency
* @property OrderItem[] $items
* @property bool $livemode
* @property string $order
* @property string $refund
*
* @package Stripe
*/
class OrderReturn extends ApiResource
{
const OBJECT_NAME = "order_return";
use ApiOperations\All;
use ApiOperations\Retrieve;
}

View File

@ -1,112 +0,0 @@
<?php
namespace Stripe;
/**
* Class PaymentIntent
*
* @property string $id
* @property string $object
* @property int $amount
* @property int $amount_capturable
* @property int $amount_received
* @property string $application
* @property int $application_fee_amount
* @property int $canceled_at
* @property string $cancellation_reason
* @property string $capture_method
* @property Collection $charges
* @property string $client_secret
* @property string $confirmation_method
* @property int $created
* @property string $currency
* @property string $customer
* @property string $description
* @property mixed $last_payment_error
* @property bool $livemode
* @property StripeObject $metadata
* @property mixed $next_action
* @property string $on_behalf_of
* @property string $payment_method
* @property string[] $payment_method_types
* @property string $receipt_email
* @property string $review
* @property mixed $shipping
* @property string $source
* @property string $statement_descriptor
* @property string $status
* @property mixed $transfer_data
* @property string $transfer_group
*
* @package Stripe
*/
class PaymentIntent extends ApiResource
{
const OBJECT_NAME = "payment_intent";
use ApiOperations\All;
use ApiOperations\Create;
use ApiOperations\Retrieve;
use ApiOperations\Update;
/**
* These constants are possible representations of the status field.
*
* @link https://stripe.com/docs/api/payment_intents/object#payment_intent_object-status
*/
const STATUS_CANCELED = 'canceled';
const STATUS_PROCESSING = 'processing';
const STATUS_REQUIRES_ACTION = 'requires_action';
const STATUS_REQUIRES_CAPTURE = 'requires_capture';
const STATUS_REQUIRES_CONFIRMATION = 'requires_confirmation';
const STATUS_REQUIRES_PAYMENT_METHOD = 'requires_payment_method';
const STATUS_SUCCEEDED = 'succeeded';
/**
* @param array|null $params
* @param array|string|null $options
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return PaymentIntent The canceled payment intent.
*/
public function cancel($params = null, $options = null)
{
$url = $this->instanceUrl() . '/cancel';
list($response, $opts) = $this->_request('post', $url, $params, $options);
$this->refreshFrom($response, $opts);
return $this;
}
/**
* @param array|null $params
* @param array|string|null $options
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return PaymentIntent The captured payment intent.
*/
public function capture($params = null, $options = null)
{
$url = $this->instanceUrl() . '/capture';
list($response, $opts) = $this->_request('post', $url, $params, $options);
$this->refreshFrom($response, $opts);
return $this;
}
/**
* @param array|null $params
* @param array|string|null $options
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return PaymentIntent The confirmed payment intent.
*/
public function confirm($params = null, $options = null)
{
$url = $this->instanceUrl() . '/confirm';
list($response, $opts) = $this->_request('post', $url, $params, $options);
$this->refreshFrom($response, $opts);
return $this;
}
}

View File

@ -1,63 +0,0 @@
<?php
namespace Stripe;
/**
* Class PaymentMethod
*
* @property string $id
* @property string $object
* @property mixed $billing_details
* @property mixed $card
* @property mixed $card_present
* @property int $created
* @property string $customer
* @property mixed $ideal
* @property bool $livemode
* @property StripeObject $metadata
* @property mixed $sepa_debit
* @property string $type
*
* @package Stripe
*/
class PaymentMethod extends ApiResource
{
const OBJECT_NAME = "payment_method";
use ApiOperations\All;
use ApiOperations\Create;
use ApiOperations\Retrieve;
use ApiOperations\Update;
/**
* @param array|null $params
* @param array|string|null $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return PaymentMethod The attached payment method.
*/
public function attach($params = null, $opts = null)
{
$url = $this->instanceUrl() . '/attach';
list($response, $opts) = $this->_request('post', $url, $params, $opts);
$this->refreshFrom($response, $opts);
return $this;
}
/**
* @param array|null $params
* @param array|string|null $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return PaymentMethod The detached payment method.
*/
public function detach($params = null, $opts = null)
{
$url = $this->instanceUrl() . '/detach';
list($response, $opts) = $this->_request('post', $url, $params, $opts);
$this->refreshFrom($response, $opts);
return $this;
}
}

View File

@ -1,94 +0,0 @@
<?php
namespace Stripe;
/**
* Class Payout
*
* @property string $id
* @property string $object
* @property int $amount
* @property int $arrival_date
* @property bool $automatic
* @property string $balance_transaction
* @property int $created
* @property string $currency
* @property string $description
* @property string $destination
* @property string $failure_balance_transaction
* @property string $failure_code
* @property string $failure_message
* @property bool $livemode
* @property StripeObject $metadata
* @property string $method
* @property string $source_type
* @property string $statement_descriptor
* @property string $status
* @property string $type
*
* @package Stripe
*/
class Payout extends ApiResource
{
const OBJECT_NAME = "payout";
use ApiOperations\All;
use ApiOperations\Create;
use ApiOperations\Retrieve;
use ApiOperations\Update;
/**
* Types of payout failure codes.
* @link https://stripe.com/docs/api#payout_failures
*/
const FAILURE_ACCOUNT_CLOSED = 'account_closed';
const FAILURE_ACCOUNT_FROZEN = 'account_frozen';
const FAILURE_BANK_ACCOUNT_RESTRICTED = 'bank_account_restricted';
const FAILURE_BANK_OWNERSHIP_CHANGED = 'bank_ownership_changed';
const FAILURE_COULD_NOT_PROCESS = 'could_not_process';
const FAILURE_DEBIT_NOT_AUTHORIZED = 'debit_not_authorized';
const FAILURE_DECLINED = 'declined';
const FAILURE_INCORRECT_ACCOUNT_HOLDER_NAME = 'incorrect_account_holder_name';
const FAILURE_INSUFFICIENT_FUNDS = 'insufficient_funds';
const FAILURE_INVALID_ACCOUNT_NUMBER = 'invalid_account_number';
const FAILURE_INVALID_CURRENCY = 'invalid_currency';
const FAILURE_NO_ACCOUNT = 'no_account';
const FAILURE_UNSUPPORTED_CARD = 'unsupported_card';
/**
* Possible string representations of the payout methods.
* @link https://stripe.com/docs/api/payouts/object#payout_object-method
*/
const METHOD_STANDARD = 'standard';
const METHOD_INSTANT = 'instant';
/**
* Possible string representations of the status of the payout.
* @link https://stripe.com/docs/api/payouts/object#payout_object-status
*/
const STATUS_CANCELED = 'canceled';
const STATUS_IN_TRANSIT = 'in_transit';
const STATUS_FAILED = 'failed';
const STATUS_PAID = 'paid';
const STATUS_PENDING = 'pending';
/**
* Possible string representations of the type of payout.
* @link https://stripe.com/docs/api/payouts/object#payout_object-type
*/
const TYPE_BANK_ACCOUNT = 'bank_account';
const TYPE_CARD = 'card';
/**
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return Payout The canceled payout.
*/
public function cancel()
{
$url = $this->instanceUrl() . '/cancel';
list($response, $opts) = $this->_request('post', $url);
$this->refreshFrom($response, $opts);
return $this;
}
}

View File

@ -1,109 +0,0 @@
<?php
namespace Stripe;
/**
* Class Person
*
* @package Stripe
*
* @property string $id
* @property string $object
* @property string $account
* @property mixed $address
* @property mixed $address_kana
* @property mixed $address_kanji
* @property int $created
* @property bool $deleted
* @property mixed $dob
* @property string $email
* @property string $first_name
* @property string $first_name_kana
* @property string $first_name_kanji
* @property string $gender
* @property bool $id_number_provided
* @property string $last_name
* @property string $last_name_kana
* @property string $last_name_kanji
* @property string $maiden_name
* @property StripeObject $metadata
* @property string $phone
* @property mixed $relationship
* @property mixed $requirements
* @property bool $ssn_last_4_provided
* @property mixed $verification
*/
class Person extends ApiResource
{
const OBJECT_NAME = "person";
use ApiOperations\Delete;
use ApiOperations\Update;
/**
* Possible string representations of a person's gender.
* @link https://stripe.com/docs/api/persons/object#person_object-gender
*/
const GENDER_MALE = 'male';
const GENDER_FEMALE = 'female';
/**
* Possible string representations of a person's verification status.
* @link https://stripe.com/docs/api/persons/object#person_object-verification-status
*/
const VERIFICATION_STATUS_PENDING = 'pending';
const VERIFICATION_STATUS_UNVERIFIED = 'unverified';
const VERIFICATION_STATUS_VERIFIED = 'verified';
/**
* @return string The API URL for this Stripe account reversal.
*/
public function instanceUrl()
{
$id = $this['id'];
$account = $this['account'];
if (!$id) {
throw new Exception\UnexpectedValueException(
"Could not determine which URL to request: " .
"class instance has invalid ID: $id",
null
);
}
$id = Util\Util::utf8($id);
$account = Util\Util::utf8($account);
$base = Account::classUrl();
$accountExtn = urlencode($account);
$extn = urlencode($id);
return "$base/$accountExtn/persons/$extn";
}
/**
* @param array|string $_id
* @param array|string|null $_opts
*
* @throws \Stripe\Exception\BadMethodCallException
*/
public static function retrieve($_id, $_opts = null)
{
$msg = "Persons cannot be retrieved without an account ID. Retrieve " .
"a person using `Account::retrievePerson('account_id', " .
"'person_id')`.";
throw new Exception\BadMethodCallException($msg, null);
}
/**
* @param string $_id
* @param array|null $_params
* @param array|string|null $_options
*
* @throws \Stripe\Exception\BadMethodCallException
*/
public static function update($_id, $_params = null, $_options = null)
{
$msg = "Persons cannot be updated without an account ID. Update " .
"a person using `Account::updatePerson('account_id', " .
"'person_id', \$updateParams)`.";
throw new Exception\BadMethodCallException($msg, null);
}
}

View File

@ -1,39 +0,0 @@
<?php
namespace Stripe;
/**
* Class Plan
*
* @package Stripe
*
* @property string $id
* @property string $object
* @property bool $active
* @property string $aggregate_usage
* @property int $amount
* @property string $billing_scheme
* @property int $created
* @property string $currency
* @property string $interval
* @property int $interval_count
* @property bool $livemode
* @property StripeObject $metadata
* @property string $nickname
* @property string $product
* @property mixed $tiers
* @property string $tiers_mode
* @property mixed $transform_usage
* @property int $trial_period_days
* @property string $usage_type
*/
class Plan extends ApiResource
{
const OBJECT_NAME = "plan";
use ApiOperations\All;
use ApiOperations\Create;
use ApiOperations\Delete;
use ApiOperations\Retrieve;
use ApiOperations\Update;
}

View File

@ -1,46 +0,0 @@
<?php
namespace Stripe;
/**
* Class Product
*
* @property string $id
* @property string $object
* @property bool $active
* @property string[] $attributes
* @property string $caption
* @property int $created
* @property string[] $deactivate_on
* @property string $description
* @property string[] $images
* @property bool $livemode
* @property StripeObject $metadata
* @property string $name
* @property mixed $package_dimensions
* @property bool $shippable
* @property string $statement_descriptor
* @property string $type
* @property string $unit_label
* @property int $updated
* @property string $url
*
* @package Stripe
*/
class Product extends ApiResource
{
const OBJECT_NAME = "product";
use ApiOperations\All;
use ApiOperations\Create;
use ApiOperations\Delete;
use ApiOperations\Retrieve;
use ApiOperations\Update;
/**
* Possible string representations of the type of product.
* @link https://stripe.com/docs/api/service_products/object#service_product_object-type
*/
const TYPE_GOOD = 'good';
const TYPE_SERVICE = 'service';
}

View File

@ -1,36 +0,0 @@
<?php
namespace Stripe\Radar;
/**
* Class EarlyFraudWarning
*
* @property string $id
* @property string $object
* @property bool $actionable
* @property string $charge
* @property int $created
* @property string $fraud_type
* @property bool $livemode
*
* @package Stripe\Radar
*/
class EarlyFraudWarning extends \Stripe\ApiResource
{
const OBJECT_NAME = "radar.early_fraud_warning";
use \Stripe\ApiOperations\All;
use \Stripe\ApiOperations\Retrieve;
/**
* Possible string representations of an early fraud warning's fraud type.
* @link https://stripe.com/docs/api/early_fraud_warnings/object#early_fraud_warning_object-fraud_type
*/
const FRAUD_TYPE_CARD_NEVER_RECEIVED = 'card_never_received';
const FRAUD_TYPE_FRAUDULENT_CARD_APPLICATION = 'fraudulent_card_application';
const FRAUD_TYPE_MADE_WITH_COUNTERFEIT_CARD = 'made_with_counterfeit_card';
const FRAUD_TYPE_MADE_WITH_LOST_CARD = 'made_with_lost_card';
const FRAUD_TYPE_MADE_WITH_STOLEN_CARD = 'made_with_stolen_card';
const FRAUD_TYPE_MISC = 'misc';
const FRAUD_TYPE_UNAUTHORIZED_USE_OF_CARD = 'unauthorized_use_of_card';
}

View File

@ -1,32 +0,0 @@
<?php
namespace Stripe\Radar;
/**
* Class ValueList
*
* @property string $id
* @property string $object
* @property string $alias
* @property int $created
* @property string $created_by
* @property string $item_type
* @property Collection $list_items
* @property bool $livemode
* @property StripeObject $metadata
* @property mixed $name
* @property int $updated
* @property string $updated_by
*
* @package Stripe\Radar
*/
class ValueList extends \Stripe\ApiResource
{
const OBJECT_NAME = "radar.value_list";
use \Stripe\ApiOperations\All;
use \Stripe\ApiOperations\Create;
use \Stripe\ApiOperations\Delete;
use \Stripe\ApiOperations\Retrieve;
use \Stripe\ApiOperations\Update;
}

View File

@ -1,26 +0,0 @@
<?php
namespace Stripe\Radar;
/**
* Class ValueListItem
*
* @property string $id
* @property string $object
* @property int $created
* @property string $created_by
* @property string $list
* @property bool $livemode
* @property string $value
*
* @package Stripe\Radar
*/
class ValueListItem extends \Stripe\ApiResource
{
const OBJECT_NAME = "radar.value_list_item";
use \Stripe\ApiOperations\All;
use \Stripe\ApiOperations\Create;
use \Stripe\ApiOperations\Delete;
use \Stripe\ApiOperations\Retrieve;
}

View File

@ -1,34 +0,0 @@
<?php
namespace Stripe;
/**
* Class Recipient
*
* @package Stripe
*
* @property string $id
* @property string $object
* @property mixed $active_account
* @property Collection $cards
* @property int $created
* @property string $default_card
* @property string $description
* @property string $email
* @property bool $livemode
* @property StripeObject $metadata
* @property string $migrated_to
* @property string $name
* @property string $rolled_back_from
* @property string $type
*/
class Recipient extends ApiResource
{
const OBJECT_NAME = "recipient";
use ApiOperations\All;
use ApiOperations\Create;
use ApiOperations\Delete;
use ApiOperations\Retrieve;
use ApiOperations\Update;
}

View File

@ -1,60 +0,0 @@
<?php
namespace Stripe;
/**
* Class Refund
*
* @property string $id
* @property string $object
* @property int $amount
* @property string $balance_transaction
* @property string $charge
* @property int $created
* @property string $currency
* @property string $description
* @property string $failure_balance_transaction
* @property string $failure_reason
* @property StripeObject $metadata
* @property string $reason
* @property string $receipt_number
* @property string $source_transfer_reversal
* @property string $status
* @property string $transfer_reversal
*
* @package Stripe
*/
class Refund extends ApiResource
{
const OBJECT_NAME = "refund";
use ApiOperations\All;
use ApiOperations\Create;
use ApiOperations\Retrieve;
use ApiOperations\Update;
/**
* Possible string representations of the failure reason.
* @link https://stripe.com/docs/api/refunds/object#refund_object-failure_reason
*/
const FAILURE_REASON = 'expired_or_canceled_card';
const FAILURE_REASON_LOST_OR_STOLEN_CARD = 'lost_or_stolen_card';
const FAILURE_REASON_UNKNOWN = 'unknown';
/**
* Possible string representations of the refund reason.
* @link https://stripe.com/docs/api/refunds/object#refund_object-reason
*/
const REASON_DUPLICATE = 'duplicate';
const REASON_FRAUDULENT = 'fraudulent';
const REASON_REQUESTED_BY_CUSTOMER = 'requested_by_customer';
/**
* Possible string representations of the refund status.
* @link https://stripe.com/docs/api/refunds/object#refund_object-status
*/
const STATUS_CANCELED = 'canceled';
const STATUS_FAILED = 'failed';
const STATUS_PENDING = 'pending';
const STATUS_SUCCEEDED = 'succeeded';
}

View File

@ -1,28 +0,0 @@
<?php
namespace Stripe\Reporting;
/**
* Class ReportRun
*
* @property string $id
* @property string $object
* @property int $created
* @property string $error
* @property bool $livemode
* @property mixed $parameters
* @property string $report_type
* @property mixed $result
* @property string $status
* @property int $succeeded_at
*
* @package Stripe\Reporting
*/
class ReportRun extends \Stripe\ApiResource
{
const OBJECT_NAME = "reporting.report_run";
use \Stripe\ApiOperations\All;
use \Stripe\ApiOperations\Create;
use \Stripe\ApiOperations\Retrieve;
}

View File

@ -1,24 +0,0 @@
<?php
namespace Stripe\Reporting;
/**
* Class ReportType
*
* @property string $id
* @property string $object
* @property int $data_available_end
* @property int $data_available_start
* @property string $name
* @property int $updated
* @property string $version
*
* @package Stripe\Reporting
*/
class ReportType extends \Stripe\ApiResource
{
const OBJECT_NAME = "reporting.report_type";
use \Stripe\ApiOperations\All;
use \Stripe\ApiOperations\Retrieve;
}

Some files were not shown because too many files have changed in this diff Show More