2020-07-14 14:50:16 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
2020-09-06 11:38:10 +02:00
|
|
|
* Invoice Ninja (https://invoiceninja.com).
|
2020-07-14 14:50:16 +02:00
|
|
|
*
|
|
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
|
|
*
|
2021-01-03 22:54:54 +01:00
|
|
|
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
2020-07-14 14:50:16 +02:00
|
|
|
*
|
|
|
|
* @license https://opensource.org/licenses/AAL
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace App\PaymentDrivers\Stripe;
|
|
|
|
|
2020-07-15 07:05:02 +02:00
|
|
|
use App\Events\Payment\PaymentWasCreated;
|
|
|
|
use App\Jobs\Util\SystemLogger;
|
2020-07-14 14:50:16 +02:00
|
|
|
use App\Models\ClientGatewayToken;
|
2020-07-15 07:05:02 +02:00
|
|
|
use App\Models\Invoice;
|
2020-09-04 00:01:17 +02:00
|
|
|
use App\Models\PaymentHash;
|
2020-07-15 07:05:02 +02:00
|
|
|
use App\Models\PaymentType;
|
|
|
|
use App\Models\SystemLog;
|
2020-07-14 14:50:16 +02:00
|
|
|
use App\PaymentDrivers\StripePaymentDriver;
|
2020-07-15 07:05:02 +02:00
|
|
|
use App\Utils\Ninja;
|
2020-10-14 12:45:26 +02:00
|
|
|
use App\Utils\Traits\MakesHash;
|
2020-10-28 11:10:49 +01:00
|
|
|
use Stripe\Exception\ApiConnectionException;
|
|
|
|
use Stripe\Exception\ApiErrorException;
|
|
|
|
use Stripe\Exception\AuthenticationException;
|
|
|
|
use Stripe\Exception\CardException;
|
|
|
|
use Stripe\Exception\InvalidRequestException;
|
|
|
|
use Stripe\Exception\RateLimitException;
|
|
|
|
use Stripe\StripeClient;
|
2020-07-14 14:50:16 +02:00
|
|
|
|
|
|
|
class Charge
|
|
|
|
{
|
2020-10-14 12:45:26 +02:00
|
|
|
use MakesHash;
|
2020-10-28 11:10:49 +01:00
|
|
|
|
2020-07-14 14:50:16 +02:00
|
|
|
/** @var StripePaymentDriver */
|
|
|
|
public $stripe;
|
|
|
|
|
|
|
|
public function __construct(StripePaymentDriver $stripe)
|
|
|
|
{
|
|
|
|
$this->stripe = $stripe;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2020-09-06 11:38:10 +02:00
|
|
|
* Create a charge against a payment method.
|
2020-10-28 11:10:49 +01:00
|
|
|
* @param ClientGatewayToken $cgt
|
|
|
|
* @param PaymentHash $payment_hash
|
2020-07-14 14:50:16 +02:00
|
|
|
* @return bool success/failure
|
2020-10-28 11:10:49 +01:00
|
|
|
* @throws \Laracasts\Presenter\Exceptions\PresenterException
|
2020-07-14 14:50:16 +02:00
|
|
|
*/
|
2020-09-04 00:01:17 +02:00
|
|
|
public function tokenBilling(ClientGatewayToken $cgt, PaymentHash $payment_hash)
|
2020-07-14 14:50:16 +02:00
|
|
|
{
|
2020-09-04 00:01:17 +02:00
|
|
|
$amount = array_sum(array_column($payment_hash->invoices(), 'amount')) + $payment_hash->fee_total;
|
2020-10-14 12:45:26 +02:00
|
|
|
$invoice = Invoice::whereIn('id', $this->transformKeys(array_column($payment_hash->invoices(), 'invoice_id')))->first();
|
2020-09-04 00:01:17 +02:00
|
|
|
|
2020-09-06 11:38:10 +02:00
|
|
|
if ($invoice) {
|
2020-07-14 14:50:16 +02:00
|
|
|
$description = "Invoice {$invoice->number} for {$amount} for client {$this->stripe->client->present()->name()}";
|
2020-09-06 11:38:10 +02:00
|
|
|
} else {
|
2020-07-14 14:50:16 +02:00
|
|
|
$description = "Payment with no invoice for amount {$amount} for client {$this->stripe->client->present()->name()}";
|
2020-09-06 11:38:10 +02:00
|
|
|
}
|
2020-07-14 14:50:16 +02:00
|
|
|
|
2020-07-15 07:05:02 +02:00
|
|
|
$this->stripe->init();
|
2020-07-14 14:50:16 +02:00
|
|
|
|
2020-07-15 07:05:02 +02:00
|
|
|
|
|
|
|
$response = null;
|
|
|
|
|
|
|
|
try {
|
2021-04-28 03:27:44 +02:00
|
|
|
|
|
|
|
$data = [
|
2020-07-15 07:05:02 +02:00
|
|
|
'amount' => $this->stripe->convertToStripeAmount($amount, $this->stripe->client->currency()->precision),
|
|
|
|
'currency' => $this->stripe->client->getCurrencyCode(),
|
|
|
|
'payment_method' => $cgt->token,
|
|
|
|
'customer' => $cgt->gateway_customer_reference,
|
|
|
|
'confirm' => true,
|
|
|
|
'description' => $description,
|
2021-04-28 03:27:44 +02:00
|
|
|
];
|
|
|
|
|
2021-05-11 23:58:18 +02:00
|
|
|
$response = $this->stripe->createPaymentIntent($data, $this->stripe->stripe_connect_auth);
|
2021-04-28 03:27:44 +02:00
|
|
|
// $response = $local_stripe->paymentIntents->create($data);
|
2021-02-01 13:41:11 +01:00
|
|
|
|
2020-07-15 07:05:02 +02:00
|
|
|
SystemLogger::dispatch($response, SystemLog::CATEGORY_GATEWAY_RESPONSE, SystemLog::EVENT_GATEWAY_SUCCESS, SystemLog::TYPE_STRIPE, $this->stripe->client);
|
2021-02-01 22:33:04 +01:00
|
|
|
} catch (\Exception $e) {
|
|
|
|
|
|
|
|
$data =[
|
|
|
|
'status' => '',
|
|
|
|
'error_type' => '',
|
|
|
|
'error_code' => '',
|
|
|
|
'param' => '',
|
|
|
|
'message' => '',
|
|
|
|
];
|
|
|
|
|
|
|
|
switch ($e) {
|
|
|
|
case ($e instanceof CardException):
|
2021-02-02 02:04:52 +01:00
|
|
|
$data['status'] = $e->getHttpStatus();
|
|
|
|
$data['error_type'] = $e->getError()->type;
|
|
|
|
$data['error_code'] = $e->getError()->code;
|
|
|
|
$data['param'] = $e->getError()->param;
|
|
|
|
$data['message'] = $e->getError()->message;
|
2021-02-01 22:33:04 +01:00
|
|
|
break;
|
|
|
|
case ($e instanceof RateLimitException):
|
2021-02-02 02:04:52 +01:00
|
|
|
$data['message'] = 'Too many requests made to the API too quickly';
|
2021-02-01 22:33:04 +01:00
|
|
|
break;
|
|
|
|
case ($e instanceof InvalidRequestException):
|
2021-02-02 02:04:52 +01:00
|
|
|
$data['message'] = 'Invalid parameters were supplied to Stripe\'s API';
|
2021-02-01 22:33:04 +01:00
|
|
|
break;
|
|
|
|
case ($e instanceof AuthenticationException):
|
2021-02-02 02:04:52 +01:00
|
|
|
$data['message'] = 'Authentication with Stripe\'s API failed';
|
2021-02-01 22:33:04 +01:00
|
|
|
break;
|
|
|
|
case ($e instanceof ApiErrorException):
|
2021-02-02 02:04:52 +01:00
|
|
|
$data['message'] = 'Network communication with Stripe failed';
|
2021-02-01 22:33:04 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2021-02-02 02:04:52 +01:00
|
|
|
$data['message'] = $e->getMessage();
|
2021-02-01 22:33:04 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$this->stripe->processInternallyFailedPayment($this->stripe, $e);
|
2020-07-15 07:05:02 +02:00
|
|
|
|
2020-09-06 11:38:10 +02:00
|
|
|
SystemLogger::dispatch($data, SystemLog::CATEGORY_GATEWAY_RESPONSE, SystemLog::EVENT_GATEWAY_FAILURE, SystemLog::TYPE_STRIPE, $this->stripe->client);
|
2021-02-01 22:33:04 +01:00
|
|
|
}
|
2020-07-15 07:05:02 +02:00
|
|
|
|
2020-09-06 11:38:10 +02:00
|
|
|
if (! $response) {
|
2020-07-15 07:05:02 +02:00
|
|
|
return false;
|
2020-09-06 11:38:10 +02:00
|
|
|
}
|
2020-07-15 07:05:02 +02:00
|
|
|
|
|
|
|
$payment_method_type = $response->charges->data[0]->payment_method_details->card->brand;
|
2020-12-29 22:10:03 +01:00
|
|
|
//nlog($payment_method_type);
|
2020-07-15 07:05:02 +02:00
|
|
|
|
|
|
|
$data = [
|
|
|
|
'gateway_type_id' => $cgt->gateway_type_id,
|
2021-01-27 11:38:28 +01:00
|
|
|
'payment_type' => $this->transformPaymentTypeToConstant($payment_method_type),
|
2020-07-15 07:05:02 +02:00
|
|
|
'transaction_reference' => $response->charges->data[0]->id,
|
2021-01-27 11:38:28 +01:00
|
|
|
'amount' => $amount,
|
2020-07-15 07:05:02 +02:00
|
|
|
];
|
|
|
|
|
2021-01-27 11:38:28 +01:00
|
|
|
$payment = $this->stripe->createPayment($data);
|
2020-09-04 00:01:17 +02:00
|
|
|
$payment->meta = $cgt->meta;
|
|
|
|
$payment->save();
|
2020-07-15 07:05:02 +02:00
|
|
|
|
2020-09-10 03:52:17 +02:00
|
|
|
$payment_hash->payment_id = $payment->id;
|
|
|
|
$payment_hash->save();
|
2020-10-28 11:10:49 +01:00
|
|
|
|
2020-07-15 07:05:02 +02:00
|
|
|
return $payment;
|
|
|
|
}
|
|
|
|
|
|
|
|
private function formatGatewayResponse($data, $vars)
|
|
|
|
{
|
|
|
|
$response = $data['response'];
|
|
|
|
|
|
|
|
return [
|
|
|
|
'transaction_reference' => $response->getTransactionResponse()->getTransId(),
|
|
|
|
'amount' => $vars['amount'],
|
|
|
|
'auth_code' => $response->getTransactionResponse()->getAuthCode(),
|
|
|
|
'code' => $response->getTransactionResponse()->getMessages()[0]->getCode(),
|
|
|
|
'description' => $response->getTransactionResponse()->getMessages()[0]->getDescription(),
|
|
|
|
'invoices' => $vars['hashed_ids'],
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
private function transformPaymentTypeToConstant($type)
|
|
|
|
{
|
|
|
|
switch ($type) {
|
|
|
|
case 'visa':
|
|
|
|
return PaymentType::VISA;
|
|
|
|
break;
|
|
|
|
case 'mastercard':
|
|
|
|
return PaymentType::MASTERCARD;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return PaymentType::CREDIT_CARD_OTHER;
|
|
|
|
break;
|
|
|
|
}
|
2020-07-14 14:50:16 +02:00
|
|
|
}
|
|
|
|
}
|
2020-07-14 15:15:59 +02:00
|
|
|
|
2020-07-15 07:05:02 +02:00
|
|
|
// const CREDIT = 1;
|
|
|
|
// const ACH = 4;
|
|
|
|
// const VISA = 5;
|
|
|
|
// const MASTERCARD = 6;
|
|
|
|
// const AMERICAN_EXPRESS = 7;
|
|
|
|
// const DISCOVER = 8;
|
|
|
|
// const DINERS = 9;
|
|
|
|
// const EUROCARD = 10;
|
|
|
|
// const NOVA = 11;
|
|
|
|
// const CREDIT_CARD_OTHER = 12;
|
|
|
|
// const PAYPAL = 13;
|
|
|
|
// const CARTE_BLANCHE = 16;
|
|
|
|
// const UNIONPAY = 17;
|
|
|
|
// const JCB = 18;
|
|
|
|
// const LASER = 19;
|
|
|
|
// const MAESTRO = 20;
|
|
|
|
// const SOLO = 21;
|
|
|
|
// const SWITCH = 22;
|
|
|
|
// const ALIPAY = 27;
|
|
|
|
// const SOFORT = 28;
|
|
|
|
// const SEPA = 29;
|
|
|
|
// const GOCARDLESS = 30;
|
|
|
|
// const CRYPTO = 31;
|
|
|
|
|
2020-07-14 15:15:59 +02:00
|
|
|
// {
|
|
|
|
// "id": "ch_1H4lp42eZvKYlo2Ch5igaUwg",
|
|
|
|
// "object": "charge",
|
|
|
|
// "amount": 2000,
|
|
|
|
// "amount_refunded": 0,
|
|
|
|
// "application": null,
|
|
|
|
// "application_fee": null,
|
|
|
|
// "application_fee_amount": null,
|
|
|
|
// "balance_transaction": "txn_19XJJ02eZvKYlo2ClwuJ1rbA",
|
|
|
|
// "billing_details": {
|
|
|
|
// "address": {
|
|
|
|
// "city": null,
|
|
|
|
// "country": null,
|
|
|
|
// "line1": null,
|
|
|
|
// "line2": null,
|
|
|
|
// "postal_code": "45465",
|
|
|
|
// "state": null
|
|
|
|
// },
|
|
|
|
// "email": null,
|
|
|
|
// "name": null,
|
|
|
|
// "phone": null
|
|
|
|
// },
|
|
|
|
// "calculated_statement_descriptor": null,
|
|
|
|
// "captured": false,
|
|
|
|
// "created": 1594724238,
|
|
|
|
// "currency": "usd",
|
|
|
|
// "customer": null,
|
|
|
|
// "description": "My First Test Charge (created for API docs)",
|
|
|
|
// "disputed": false,
|
|
|
|
// "failure_code": null,
|
|
|
|
// "failure_message": null,
|
|
|
|
// "fraud_details": {},
|
|
|
|
// "invoice": null,
|
|
|
|
// "livemode": false,
|
|
|
|
// "metadata": {},
|
|
|
|
// "on_behalf_of": null,
|
|
|
|
// "order": null,
|
|
|
|
// "outcome": null,
|
|
|
|
// "paid": true,
|
|
|
|
// "payment_intent": null,
|
|
|
|
// "payment_method": "card_1F8MLI2eZvKYlo2CvsyCzps2",
|
|
|
|
// "payment_method_details": {
|
|
|
|
// "card": {
|
|
|
|
// "brand": "visa",
|
|
|
|
// "checks": {
|
|
|
|
// "address_line1_check": null,
|
|
|
|
// "address_postal_code_check": "pass",
|
|
|
|
// "cvc_check": null
|
|
|
|
// },
|
|
|
|
// "country": "US",
|
|
|
|
// "exp_month": 12,
|
|
|
|
// "exp_year": 2023,
|
|
|
|
// "fingerprint": "Xt5EWLLDS7FJjR1c",
|
|
|
|
// "funding": "credit",
|
|
|
|
// "installments": null,
|
|
|
|
// "last4": "4242",
|
|
|
|
// "network": "visa",
|
|
|
|
// "three_d_secure": null,
|
|
|
|
// "wallet": null
|
|
|
|
// },
|
|
|
|
// "type": "card"
|
|
|
|
// },
|
|
|
|
// "receipt_email": null,
|
|
|
|
// "receipt_number": null,
|
|
|
|
// "receipt_url": "https://pay.stripe.com/receipts/acct_1032D82eZvKYlo2C/ch_1H4lp42eZvKYlo2Ch5igaUwg/rcpt_He3wuRQtzvT2Oi4OAYQSpajtmteo55J",
|
|
|
|
// "refunded": false,
|
|
|
|
// "refunds": {
|
|
|
|
// "object": "list",
|
|
|
|
// "data": [],
|
|
|
|
// "has_more": false,
|
|
|
|
// "url": "/v1/charges/ch_1H4lp42eZvKYlo2Ch5igaUwg/refunds"
|
|
|
|
// },
|
|
|
|
// "review": null,
|
|
|
|
// "shipping": null,
|
|
|
|
// "source_transfer": null,
|
|
|
|
// "statement_descriptor": null,
|
|
|
|
// "statement_descriptor_suffix": null,
|
|
|
|
// "status": "succeeded",
|
|
|
|
// "transfer_data": null,
|
|
|
|
// "transfer_group": null,
|
|
|
|
// "source": "tok_visa"
|
2020-07-15 07:05:02 +02:00
|
|
|
// }
|
2020-09-06 11:38:10 +02:00
|
|
|
//
|
|
|
|
//
|
2020-07-15 07:05:02 +02:00
|
|
|
// [2020-07-14 23:06:47] local.INFO: Stripe\PaymentIntent Object
|
|
|
|
// (
|
|
|
|
// [id] => pi_1H4xD0Kmol8YQE9DKhrvV6Nc
|
|
|
|
// [object] => payment_intent
|
|
|
|
// [allowed_source_types] => Array
|
|
|
|
// (
|
|
|
|
// [0] => card
|
|
|
|
// )
|
|
|
|
|
|
|
|
// [amount] => 1000
|
|
|
|
// [amount_capturable] => 0
|
|
|
|
// [amount_received] => 1000
|
2020-09-06 11:38:10 +02:00
|
|
|
// [application] =>
|
|
|
|
// [application_fee_amount] =>
|
|
|
|
// [canceled_at] =>
|
|
|
|
// [cancellation_reason] =>
|
2020-07-15 07:05:02 +02:00
|
|
|
// [capture_method] => automatic
|
|
|
|
// [charges] => Stripe\Collection Object
|
|
|
|
// (
|
|
|
|
// [object] => list
|
|
|
|
// [data] => Array
|
|
|
|
// (
|
|
|
|
// [0] => Stripe\Charge Object
|
|
|
|
// (
|
|
|
|
// [id] => ch_1H4xD0Kmol8YQE9Ds9b1ZWjw
|
|
|
|
// [object] => charge
|
|
|
|
// [amount] => 1000
|
|
|
|
// [amount_refunded] => 0
|
2020-09-06 11:38:10 +02:00
|
|
|
// [application] =>
|
|
|
|
// [application_fee] =>
|
|
|
|
// [application_fee_amount] =>
|
2020-07-15 07:05:02 +02:00
|
|
|
// [balance_transaction] => txn_1H4xD1Kmol8YQE9DE9qFoO0R
|
|
|
|
// [billing_details] => Stripe\StripeObject Object
|
|
|
|
// (
|
|
|
|
// [address] => Stripe\StripeObject Object
|
|
|
|
// (
|
2020-09-06 11:38:10 +02:00
|
|
|
// [city] =>
|
|
|
|
// [country] =>
|
|
|
|
// [line1] =>
|
|
|
|
// [line2] =>
|
2020-07-15 07:05:02 +02:00
|
|
|
// [postal_code] => 42334
|
2020-09-06 11:38:10 +02:00
|
|
|
// [state] =>
|
2020-07-15 07:05:02 +02:00
|
|
|
// )
|
|
|
|
|
2020-09-06 11:38:10 +02:00
|
|
|
// [email] =>
|
2020-07-15 07:05:02 +02:00
|
|
|
// [name] => sds
|
2020-09-06 11:38:10 +02:00
|
|
|
// [phone] =>
|
2020-07-15 07:05:02 +02:00
|
|
|
// )
|
|
|
|
|
|
|
|
// [calculated_statement_descriptor] => NODDY
|
|
|
|
// [captured] => 1
|
|
|
|
// [created] => 1594768006
|
|
|
|
// [currency] => usd
|
|
|
|
// [customer] => cus_He4VEiYldHJWqG
|
|
|
|
// [description] => Invoice 0023 for 10 for client Corwin Group
|
2020-09-06 11:38:10 +02:00
|
|
|
// [destination] =>
|
|
|
|
// [dispute] =>
|
|
|
|
// [disputed] =>
|
|
|
|
// [failure_code] =>
|
|
|
|
// [failure_message] =>
|
2020-07-15 07:05:02 +02:00
|
|
|
// [fraud_details] => Array
|
|
|
|
// (
|
|
|
|
// )
|
|
|
|
|
2020-09-06 11:38:10 +02:00
|
|
|
// [invoice] =>
|
|
|
|
// [livemode] =>
|
2020-07-15 07:05:02 +02:00
|
|
|
// [metadata] => Stripe\StripeObject Object
|
|
|
|
// (
|
|
|
|
// )
|
|
|
|
|
2020-09-06 11:38:10 +02:00
|
|
|
// [on_behalf_of] =>
|
|
|
|
// [order] =>
|
2020-07-15 07:05:02 +02:00
|
|
|
// [outcome] => Stripe\StripeObject Object
|
|
|
|
// (
|
|
|
|
// [network_status] => approved_by_network
|
2020-09-06 11:38:10 +02:00
|
|
|
// [reason] =>
|
2020-07-15 07:05:02 +02:00
|
|
|
// [risk_level] => normal
|
|
|
|
// [risk_score] => 13
|
|
|
|
// [seller_message] => Payment complete.
|
|
|
|
// [type] => authorized
|
|
|
|
// )
|
|
|
|
|
|
|
|
// [paid] => 1
|
|
|
|
// [payment_intent] => pi_1H4xD0Kmol8YQE9DKhrvV6Nc
|
|
|
|
// [payment_method] => pm_1H4mNAKmol8YQE9DUMRsuTXs
|
|
|
|
// [payment_method_details] => Stripe\StripeObject Object
|
|
|
|
// (
|
|
|
|
// [card] => Stripe\StripeObject Object
|
|
|
|
// (
|
|
|
|
// [brand] => visa
|
|
|
|
// [checks] => Stripe\StripeObject Object
|
|
|
|
// (
|
2020-09-06 11:38:10 +02:00
|
|
|
// [address_line1_check] =>
|
2020-07-15 07:05:02 +02:00
|
|
|
// [address_postal_code_check] => pass
|
2020-09-06 11:38:10 +02:00
|
|
|
// [cvc_check] =>
|
2020-07-15 07:05:02 +02:00
|
|
|
// )
|
|
|
|
|
|
|
|
// [country] => US
|
|
|
|
// [exp_month] => 4
|
|
|
|
// [exp_year] => 2024
|
|
|
|
// [fingerprint] => oCjEXlb4syFKwgbJ
|
|
|
|
// [funding] => credit
|
2020-09-06 11:38:10 +02:00
|
|
|
// [installments] =>
|
2020-07-15 07:05:02 +02:00
|
|
|
// [last4] => 4242
|
|
|
|
// [network] => visa
|
2020-09-06 11:38:10 +02:00
|
|
|
// [three_d_secure] =>
|
|
|
|
// [wallet] =>
|
2020-07-15 07:05:02 +02:00
|
|
|
// )
|
|
|
|
|
|
|
|
// [type] => card
|
|
|
|
// )
|
|
|
|
|
2020-09-06 11:38:10 +02:00
|
|
|
// [receipt_email] =>
|
|
|
|
// [receipt_number] =>
|
2020-07-15 07:05:02 +02:00
|
|
|
// [receipt_url] => https://pay.stripe.com/receipts/acct_19DXXPKmol8YQE9D/ch_1H4xD0Kmol8YQE9Ds9b1ZWjw/rcpt_HeFiiwzRZtnOpvHyohNN5JXtCYe8Rdc
|
2020-09-06 11:38:10 +02:00
|
|
|
// [refunded] =>
|
2020-07-15 07:05:02 +02:00
|
|
|
// [refunds] => Stripe\Collection Object
|
|
|
|
// (
|
|
|
|
// [object] => list
|
|
|
|
// [data] => Array
|
|
|
|
// (
|
|
|
|
// )
|
|
|
|
|
2020-09-06 11:38:10 +02:00
|
|
|
// [has_more] =>
|
2020-07-15 07:05:02 +02:00
|
|
|
// [total_count] => 0
|
|
|
|
// [url] => /v1/charges/ch_1H4xD0Kmol8YQE9Ds9b1ZWjw/refunds
|
|
|
|
// )
|
|
|
|
|
2020-09-06 11:38:10 +02:00
|
|
|
// [review] =>
|
|
|
|
// [shipping] =>
|
|
|
|
// [source] =>
|
|
|
|
// [source_transfer] =>
|
|
|
|
// [statement_descriptor] =>
|
|
|
|
// [statement_descriptor_suffix] =>
|
2020-07-15 07:05:02 +02:00
|
|
|
// [status] => succeeded
|
2020-09-06 11:38:10 +02:00
|
|
|
// [transfer_data] =>
|
|
|
|
// [transfer_group] =>
|
2020-07-15 07:05:02 +02:00
|
|
|
// )
|
|
|
|
|
|
|
|
// )
|
|
|
|
|
2020-09-06 11:38:10 +02:00
|
|
|
// [has_more] =>
|
2020-07-15 07:05:02 +02:00
|
|
|
// [total_count] => 1
|
|
|
|
// [url] => /v1/charges?payment_intent=pi_1H4xD0Kmol8YQE9DKhrvV6Nc
|
|
|
|
// )
|
|
|
|
|
|
|
|
// [client_secret] => pi_1H4xD0Kmol8YQE9DKhrvV6Nc_secret_TyE8n3Y3oaMqgqQvXvtKDOnYT
|
|
|
|
// [confirmation_method] => automatic
|
|
|
|
// [created] => 1594768006
|
|
|
|
// [currency] => usd
|
|
|
|
// [customer] => cus_He4VEiYldHJWqG
|
|
|
|
// [description] => Invoice 0023 for 10 for client Corwin Group
|
2020-09-06 11:38:10 +02:00
|
|
|
// [invoice] =>
|
|
|
|
// [last_payment_error] =>
|
|
|
|
// [livemode] =>
|
2020-07-15 07:05:02 +02:00
|
|
|
// [metadata] => Stripe\StripeObject Object
|
|
|
|
// (
|
|
|
|
// )
|
|
|
|
|
2020-09-06 11:38:10 +02:00
|
|
|
// [next_action] =>
|
|
|
|
// [next_source_action] =>
|
|
|
|
// [on_behalf_of] =>
|
2020-07-15 07:05:02 +02:00
|
|
|
// [payment_method] => pm_1H4mNAKmol8YQE9DUMRsuTXs
|
|
|
|
// [payment_method_options] => Stripe\StripeObject Object
|
|
|
|
// (
|
|
|
|
// [card] => Stripe\StripeObject Object
|
|
|
|
// (
|
2020-09-06 11:38:10 +02:00
|
|
|
// [installments] =>
|
|
|
|
// [network] =>
|
2020-07-15 07:05:02 +02:00
|
|
|
// [request_three_d_secure] => automatic
|
|
|
|
// )
|
|
|
|
|
|
|
|
// )
|
|
|
|
|
|
|
|
// [payment_method_types] => Array
|
|
|
|
// (
|
|
|
|
// [0] => card
|
|
|
|
// )
|
|
|
|
|
2020-09-06 11:38:10 +02:00
|
|
|
// [receipt_email] =>
|
|
|
|
// [review] =>
|
|
|
|
// [setup_future_usage] =>
|
|
|
|
// [shipping] =>
|
|
|
|
// [source] =>
|
|
|
|
// [statement_descriptor] =>
|
|
|
|
// [statement_descriptor_suffix] =>
|
2020-07-15 07:05:02 +02:00
|
|
|
// [status] => succeeded
|
2020-09-06 11:38:10 +02:00
|
|
|
// [transfer_data] =>
|
|
|
|
// [transfer_group] =>
|
|
|
|
// )
|