From f7fb95aa4c1e374aeaf063b453b2587071c68314 Mon Sep 17 00:00:00 2001 From: Pablo Martin Date: Thu, 15 Feb 2024 16:40:37 +0100 Subject: [PATCH 01/19] sources file --- models/staging/stripe/_stripe_sources.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 models/staging/stripe/_stripe_sources.yml diff --git a/models/staging/stripe/_stripe_sources.yml b/models/staging/stripe/_stripe_sources.yml new file mode 100644 index 0000000..c13f84d --- /dev/null +++ b/models/staging/stripe/_stripe_sources.yml @@ -0,0 +1,13 @@ +version: 2 + +sources: + - name: stripe_uk + schema: sync_stripe_uk + tables: + - name: balance_transactions + identifier: balance_transactions + - name: charges + identifier: charges + - name: payment_intents + identifier: payment_intents + \ No newline at end of file From d6397b280757ad53b6b3083f505e28c984e4fba5 Mon Sep 17 00:00:00 2001 From: Pablo Martin Date: Thu, 15 Feb 2024 16:43:54 +0100 Subject: [PATCH 02/19] staging balance transactions --- .../stg_stripe__balance_transactions.sql | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 models/staging/stripe/stg_stripe__balance_transactions.sql diff --git a/models/staging/stripe/stg_stripe__balance_transactions.sql b/models/staging/stripe/stg_stripe__balance_transactions.sql new file mode 100644 index 0000000..d3bfb34 --- /dev/null +++ b/models/staging/stripe/stg_stripe__balance_transactions.sql @@ -0,0 +1,28 @@ +with + raw_balance_transactions as ( + select * from {{ source("stripe_uk", "balance_transactions") }} + ), + stg_stripe__balance_transactions as ( + select + {{ adapter.quote("id") }}, + {{ adapter.quote("fee") }}, + {{ adapter.quote("net") }}, + {{ adapter.quote("type") }}, + {{ adapter.quote("amount") }}, + {{ adapter.quote("object") }}, + {{ adapter.quote("source") }}, + {{ adapter.quote("status") }}, + {{ adapter.quote("created") }}, + {{ adapter.quote("currency") }}, + {{ adapter.quote("description") }}, + {{ adapter.quote("fee_details") }}, + {{ adapter.quote("available_on") }}, + {{ adapter.quote("exchange_rate") }}, + {{ adapter.quote("sourced_transfers") }}, + {{ adapter.quote("reporting_category") }}, + {{ adapter.quote("_airbyte_extracted_at") }} as dwh_loaded_at_date + + from raw_balance_transactions + ) +select * +from stg_stripe__balance_transactions From 44618dcc8bb2dacef60ef8b9661d8468c0188ec3 Mon Sep 17 00:00:00 2001 From: Pablo Martin Date: Thu, 15 Feb 2024 16:46:47 +0100 Subject: [PATCH 03/19] charges --- models/staging/stripe/stg_stripe__charges.sql | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 models/staging/stripe/stg_stripe__charges.sql diff --git a/models/staging/stripe/stg_stripe__charges.sql b/models/staging/stripe/stg_stripe__charges.sql new file mode 100644 index 0000000..e5fb0cc --- /dev/null +++ b/models/staging/stripe/stg_stripe__charges.sql @@ -0,0 +1,61 @@ +with + raw_charges as (select * from {{ source("stripe_uk", "charges") }}), + stg_stripe__charges as ( + select + {{ adapter.quote("id") }}, + {{ adapter.quote("card") }}, + {{ adapter.quote("paid") }}, + {{ adapter.quote("order") }}, + {{ adapter.quote("amount") }}, + {{ adapter.quote("object") }}, + {{ adapter.quote("review") }}, + {{ adapter.quote("source") }}, + {{ adapter.quote("status") }}, + {{ adapter.quote("created") }}, + {{ adapter.quote("dispute") }}, + {{ adapter.quote("invoice") }}, + {{ adapter.quote("outcome") }}, + {{ adapter.quote("refunds") }}, + {{ adapter.quote("updated") }}, + {{ adapter.quote("captured") }}, + {{ adapter.quote("currency") }}, + {{ adapter.quote("customer") }}, + {{ adapter.quote("disputed") }}, + {{ adapter.quote("livemode") }}, + {{ adapter.quote("metadata") }}, + {{ adapter.quote("refunded") }}, + {{ adapter.quote("shipping") }}, + {{ adapter.quote("application") }}, + {{ adapter.quote("description") }}, + {{ adapter.quote("destination") }}, + {{ adapter.quote("receipt_url") }}, + {{ adapter.quote("failure_code") }}, + {{ adapter.quote("on_behalf_of") }}, + {{ adapter.quote("fraud_details") }}, + {{ adapter.quote("receipt_email") }}, + {{ adapter.quote("transfer_data") }}, + {{ adapter.quote("amount_updates") }}, + {{ adapter.quote("payment_intent") }}, + {{ adapter.quote("payment_method") }}, + {{ adapter.quote("receipt_number") }}, + {{ adapter.quote("transfer_group") }}, + {{ adapter.quote("amount_captured") }}, + {{ adapter.quote("amount_refunded") }}, + {{ adapter.quote("application_fee") }}, + {{ adapter.quote("billing_details") }}, + {{ adapter.quote("failure_message") }}, + {{ adapter.quote("source_transfer") }}, + {{ adapter.quote("balance_transaction") }}, + {{ adapter.quote("statement_descriptor") }}, + {{ adapter.quote("statement_description") }}, + {{ adapter.quote("application_fee_amount") }}, + {{ adapter.quote("payment_method_details") }}, + {{ adapter.quote("failure_balance_transaction") }}, + {{ adapter.quote("statement_descriptor_suffix") }}, + {{ adapter.quote("calculated_statement_descriptor") }}, + {{ adapter.quote("_airbyte_extracted_at") }} as dwh_loaded_at_date + + from raw_charges + ) +select * +from stg_stripe__charges From d99616df5c686d85818ab2dae6238f96183abb94 Mon Sep 17 00:00:00 2001 From: Pablo Martin Date: Thu, 15 Feb 2024 16:48:29 +0100 Subject: [PATCH 04/19] add payment intents --- .../stripe/stg_stripe__payment_intents.sql | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 models/staging/stripe/stg_stripe__payment_intents.sql diff --git a/models/staging/stripe/stg_stripe__payment_intents.sql b/models/staging/stripe/stg_stripe__payment_intents.sql new file mode 100644 index 0000000..b630689 --- /dev/null +++ b/models/staging/stripe/stg_stripe__payment_intents.sql @@ -0,0 +1,53 @@ +with + raw_payment_intents as (select * from {{ source("stripe_uk", "payment_intents") }}), + stg_stripe__payment_intents as ( + select + {{ adapter.quote("id") }}, + {{ adapter.quote("amount") }}, + {{ adapter.quote("object") }}, + {{ adapter.quote("review") }}, + {{ adapter.quote("source") }}, + {{ adapter.quote("status") }}, + {{ adapter.quote("charges") }}, + {{ adapter.quote("created") }}, + {{ adapter.quote("invoice") }}, + {{ adapter.quote("updated") }}, + {{ adapter.quote("currency") }}, + {{ adapter.quote("customer") }}, + {{ adapter.quote("livemode") }}, + {{ adapter.quote("metadata") }}, + {{ adapter.quote("shipping") }}, + {{ adapter.quote("processing") }}, + {{ adapter.quote("application") }}, + {{ adapter.quote("canceled_at") }}, + {{ adapter.quote("description") }}, + {{ adapter.quote("next_action") }}, + {{ adapter.quote("on_behalf_of") }}, + {{ adapter.quote("client_secret") }}, + {{ adapter.quote("latest_charge") }}, + {{ adapter.quote("receipt_email") }}, + {{ adapter.quote("transfer_data") }}, + {{ adapter.quote("amount_details") }}, + {{ adapter.quote("capture_method") }}, + {{ adapter.quote("payment_method") }}, + {{ adapter.quote("transfer_group") }}, + {{ adapter.quote("amount_received") }}, + {{ adapter.quote("amount_capturable") }}, + {{ adapter.quote("last_payment_error") }}, + {{ adapter.quote("setup_future_usage") }}, + {{ adapter.quote("cancellation_reason") }}, + {{ adapter.quote("confirmation_method") }}, + {{ adapter.quote("payment_method_types") }}, + {{ adapter.quote("statement_descriptor") }}, + {{ adapter.quote("statement_description") }}, + {{ adapter.quote("application_fee_amount") }}, + {{ adapter.quote("payment_method_options") }}, + {{ adapter.quote("automatic_payment_methods") }}, + {{ adapter.quote("statement_descriptor_suffix") }}, + {{ adapter.quote("payment_method_configuration_details") }}, + {{ adapter.quote("_airbyte_extracted_at") }} as dwh_loaded_at_date + + from raw_payment_intents + ) +select * +from stg_stripe__payment_intents From 7c15693caf056897d764fae8f4acf16f94e351e2 Mon Sep 17 00:00:00 2001 From: Pablo Martin Date: Fri, 16 Feb 2024 11:06:42 +0100 Subject: [PATCH 05/19] a couple of stg transformations --- models/staging/stripe/stg_stripe__charges.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/staging/stripe/stg_stripe__charges.sql b/models/staging/stripe/stg_stripe__charges.sql index e5fb0cc..784df4a 100644 --- a/models/staging/stripe/stg_stripe__charges.sql +++ b/models/staging/stripe/stg_stripe__charges.sql @@ -4,14 +4,14 @@ with select {{ adapter.quote("id") }}, {{ adapter.quote("card") }}, - {{ adapter.quote("paid") }}, + {{ adapter.quote("paid") }} as is_paid, {{ adapter.quote("order") }}, {{ adapter.quote("amount") }}, {{ adapter.quote("object") }}, {{ adapter.quote("review") }}, {{ adapter.quote("source") }}, {{ adapter.quote("status") }}, - {{ adapter.quote("created") }}, + to_timestamp({{ adapter.quote("created") }}) as created_at_utc, {{ adapter.quote("dispute") }}, {{ adapter.quote("invoice") }}, {{ adapter.quote("outcome") }}, From fbe0154dd1ecdd4f2d30f63eaf6344451b585d34 Mon Sep 17 00:00:00 2001 From: Pablo Martin Date: Fri, 16 Feb 2024 16:41:52 +0100 Subject: [PATCH 06/19] more fields --- models/staging/stripe/stg_stripe__charges.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/staging/stripe/stg_stripe__charges.sql b/models/staging/stripe/stg_stripe__charges.sql index 784df4a..55192bb 100644 --- a/models/staging/stripe/stg_stripe__charges.sql +++ b/models/staging/stripe/stg_stripe__charges.sql @@ -4,9 +4,9 @@ with select {{ adapter.quote("id") }}, {{ adapter.quote("card") }}, - {{ adapter.quote("paid") }} as is_paid, + cast({{ adapter.quote("paid") }} as bool) as is_paid, {{ adapter.quote("order") }}, - {{ adapter.quote("amount") }}, + {{ adapter.quote("amount") }} / 100, {{ adapter.quote("object") }}, {{ adapter.quote("review") }}, {{ adapter.quote("source") }}, From 4f27612a1b9c622332c763960449f5aacb6fe00a Mon Sep 17 00:00:00 2001 From: Pablo Martin Date: Fri, 16 Feb 2024 16:51:39 +0100 Subject: [PATCH 07/19] charges fields finished --- models/staging/stripe/stg_stripe__charges.sql | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/models/staging/stripe/stg_stripe__charges.sql b/models/staging/stripe/stg_stripe__charges.sql index 55192bb..d56a904 100644 --- a/models/staging/stripe/stg_stripe__charges.sql +++ b/models/staging/stripe/stg_stripe__charges.sql @@ -6,7 +6,7 @@ with {{ adapter.quote("card") }}, cast({{ adapter.quote("paid") }} as bool) as is_paid, {{ adapter.quote("order") }}, - {{ adapter.quote("amount") }} / 100, + {{ adapter.quote("amount") }} / 100 as amount, {{ adapter.quote("object") }}, {{ adapter.quote("review") }}, {{ adapter.quote("source") }}, @@ -16,14 +16,14 @@ with {{ adapter.quote("invoice") }}, {{ adapter.quote("outcome") }}, {{ adapter.quote("refunds") }}, - {{ adapter.quote("updated") }}, - {{ adapter.quote("captured") }}, + to_timestamp({{ adapter.quote("updated") }}) as updated_at_utc, + cast({{ adapter.quote("captured") }} as bool) as is_captured, {{ adapter.quote("currency") }}, {{ adapter.quote("customer") }}, - {{ adapter.quote("disputed") }}, - {{ adapter.quote("livemode") }}, + cast({{ adapter.quote("disputed") }} as bool) as is_disputed, + cast({{ adapter.quote("livemode") }} as bool) as is_livemode, {{ adapter.quote("metadata") }}, - {{ adapter.quote("refunded") }}, + cast({{ adapter.quote("refunded") }} as bool) as is_refunded, {{ adapter.quote("shipping") }}, {{ adapter.quote("application") }}, {{ adapter.quote("description") }}, @@ -39,8 +39,8 @@ with {{ adapter.quote("payment_method") }}, {{ adapter.quote("receipt_number") }}, {{ adapter.quote("transfer_group") }}, - {{ adapter.quote("amount_captured") }}, - {{ adapter.quote("amount_refunded") }}, + {{ adapter.quote("amount_captured") }} / 100 as amount_captured, + {{ adapter.quote("amount_refunded") }} / 100 as amount_refunded, {{ adapter.quote("application_fee") }}, {{ adapter.quote("billing_details") }}, {{ adapter.quote("failure_message") }}, From d4e7f5ec975c3ed0c7b9b0daaaeeb5c09b3795b8 Mon Sep 17 00:00:00 2001 From: Pablo Martin Date: Fri, 16 Feb 2024 16:56:01 +0100 Subject: [PATCH 08/19] payment intent fields done --- .../staging/stripe/stg_stripe__payment_intents.sql | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/models/staging/stripe/stg_stripe__payment_intents.sql b/models/staging/stripe/stg_stripe__payment_intents.sql index b630689..588cd5e 100644 --- a/models/staging/stripe/stg_stripe__payment_intents.sql +++ b/models/staging/stripe/stg_stripe__payment_intents.sql @@ -3,23 +3,23 @@ with stg_stripe__payment_intents as ( select {{ adapter.quote("id") }}, - {{ adapter.quote("amount") }}, + {{ adapter.quote("amount") }} / 100 as amount, {{ adapter.quote("object") }}, {{ adapter.quote("review") }}, {{ adapter.quote("source") }}, {{ adapter.quote("status") }}, {{ adapter.quote("charges") }}, - {{ adapter.quote("created") }}, + to_timestamp({{ adapter.quote("created") }}) as created_at_utc, {{ adapter.quote("invoice") }}, - {{ adapter.quote("updated") }}, + to_timestamp({{ adapter.quote("updated") }}) as updated_at_utc, {{ adapter.quote("currency") }}, {{ adapter.quote("customer") }}, - {{ adapter.quote("livemode") }}, + cast({{ adapter.quote("livemode") }} as bool) as is_livemode, {{ adapter.quote("metadata") }}, {{ adapter.quote("shipping") }}, {{ adapter.quote("processing") }}, {{ adapter.quote("application") }}, - {{ adapter.quote("canceled_at") }}, + to_timestamp({{ adapter.quote("canceled_at") }}) as canceled_at_utc, {{ adapter.quote("description") }}, {{ adapter.quote("next_action") }}, {{ adapter.quote("on_behalf_of") }}, @@ -31,7 +31,7 @@ with {{ adapter.quote("capture_method") }}, {{ adapter.quote("payment_method") }}, {{ adapter.quote("transfer_group") }}, - {{ adapter.quote("amount_received") }}, + {{ adapter.quote("amount_received") }} / 100 as amount_received, {{ adapter.quote("amount_capturable") }}, {{ adapter.quote("last_payment_error") }}, {{ adapter.quote("setup_future_usage") }}, From fa413a4c6ebb0d006c34f80b800a7332a0d81bc5 Mon Sep 17 00:00:00 2001 From: Pablo Martin Date: Fri, 16 Feb 2024 16:59:50 +0100 Subject: [PATCH 09/19] balance transactions fields done --- .../stripe/stg_stripe__balance_transactions.sql | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/models/staging/stripe/stg_stripe__balance_transactions.sql b/models/staging/stripe/stg_stripe__balance_transactions.sql index d3bfb34..423ecdc 100644 --- a/models/staging/stripe/stg_stripe__balance_transactions.sql +++ b/models/staging/stripe/stg_stripe__balance_transactions.sql @@ -5,18 +5,18 @@ with stg_stripe__balance_transactions as ( select {{ adapter.quote("id") }}, - {{ adapter.quote("fee") }}, - {{ adapter.quote("net") }}, + {{ adapter.quote("fee") }} / 100 as fee, + {{ adapter.quote("net") }} / 100 as net, {{ adapter.quote("type") }}, - {{ adapter.quote("amount") }}, + {{ adapter.quote("amount") }} / 100 as amount, {{ adapter.quote("object") }}, {{ adapter.quote("source") }}, {{ adapter.quote("status") }}, - {{ adapter.quote("created") }}, + to_timestamp({{ adapter.quote("created") }}) as created_at_utc, {{ adapter.quote("currency") }}, {{ adapter.quote("description") }}, {{ adapter.quote("fee_details") }}, - {{ adapter.quote("available_on") }}, + to_timestamp({{ adapter.quote("available_on") }}) as available_at_utc, {{ adapter.quote("exchange_rate") }}, {{ adapter.quote("sourced_transfers") }}, {{ adapter.quote("reporting_category") }}, From c369482c979894f8020e0a87a77d7957eb23321f Mon Sep 17 00:00:00 2001 From: Pablo Martin Date: Fri, 16 Feb 2024 17:11:37 +0100 Subject: [PATCH 10/19] create schema for staging/stripe --- models/staging/stripe/schema.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 models/staging/stripe/schema.yml diff --git a/models/staging/stripe/schema.yml b/models/staging/stripe/schema.yml new file mode 100644 index 0000000..13ee94a --- /dev/null +++ b/models/staging/stripe/schema.yml @@ -0,0 +1,29 @@ + +version: 2 + +models: + - name: stg_stripe__balance_transactions + description: "Balance transactions from all our Stripe balance accounts." + columns: + - name: id + description: "The primary key for the transaction." + tests: + - unique + - not_null + - name: stg_stripe__charges + description: "Charges from all our Stripe accounts." + columns: + - name: id + description: "The primary key for the charge." + tests: + - unique + - not_null + - name: stg_stripe__payment_intents + description: "Payment intents from all our Stripe accounts." + columns: + - name: id + description: "The primary key for the Payment intent." + tests: + - unique + - not_null + From 579fac9ee882bda4c2b1a7ac0191fc531d70b052 Mon Sep 17 00:00:00 2001 From: Pablo Martin Date: Fri, 16 Feb 2024 17:23:57 +0100 Subject: [PATCH 11/19] add codegen --- package-lock.yml | 6 ++++++ packages.yml | 3 +++ 2 files changed, 9 insertions(+) create mode 100644 package-lock.yml create mode 100644 packages.yml diff --git a/package-lock.yml b/package-lock.yml new file mode 100644 index 0000000..8f0e8f7 --- /dev/null +++ b/package-lock.yml @@ -0,0 +1,6 @@ +packages: +- package: dbt-labs/codegen + version: 0.12.1 +- package: dbt-labs/dbt_utils + version: 1.1.1 +sha1_hash: acdde602cd2e228b1dac1cf1a7e5f98f12c16b3b diff --git a/packages.yml b/packages.yml new file mode 100644 index 0000000..c19ce96 --- /dev/null +++ b/packages.yml @@ -0,0 +1,3 @@ +packages: + - package: dbt-labs/codegen + version: 0.12.1 \ No newline at end of file From 0c24daf5ba60906c93de9c2bfce069189203e996 Mon Sep 17 00:00:00 2001 From: Pablo Martin Date: Fri, 16 Feb 2024 17:37:55 +0100 Subject: [PATCH 12/19] enable new docs panel --- .vscode/settings.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 130852f..ddb2cf2 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -10,5 +10,6 @@ } ] }, - "dbt.enableNewLineagePanel": true + "dbt.enableNewLineagePanel": true, + "dbt.enableNewDocsPanel": true } \ No newline at end of file From cc9aaadb1c2e7af861f7af7e1eb9fd81d5d5d012 Mon Sep 17 00:00:00 2001 From: Pablo Martin Date: Mon, 19 Feb 2024 11:07:37 +0100 Subject: [PATCH 13/19] add columns to sources --- models/staging/stripe/_stripe_sources.yml | 361 +++++++++++++++++++++- 1 file changed, 360 insertions(+), 1 deletion(-) diff --git a/models/staging/stripe/_stripe_sources.yml b/models/staging/stripe/_stripe_sources.yml index c13f84d..3968d75 100644 --- a/models/staging/stripe/_stripe_sources.yml +++ b/models/staging/stripe/_stripe_sources.yml @@ -6,8 +6,367 @@ sources: tables: - name: balance_transactions identifier: balance_transactions + columns: + - name: id + data_type: character varying + description: "" + - name: fee + data_type: bigint + description: "" + - name: net + data_type: bigint + description: "" + - name: type + data_type: character varying + description: "" + - name: amount + data_type: bigint + description: "" + - name: object + data_type: character varying + description: "" + - name: source + data_type: character varying + description: "" + - name: status + data_type: character varying + description: "" + - name: created + data_type: bigint + description: "" + - name: currency + data_type: character varying + description: "" + - name: description + data_type: character varying + description: "" + - name: fee_details + data_type: jsonb + description: "" + - name: available_on + data_type: bigint + description: "" + - name: exchange_rate + data_type: numeric + description: "" + - name: sourced_transfers + data_type: jsonb + description: "" + - name: reporting_category + data_type: character varying + description: "" + - name: _airbyte_raw_id + data_type: character varying + description: "" + - name: _airbyte_extracted_at + data_type: timestamp with time zone + description: "" + - name: _airbyte_meta + data_type: jsonb + description: "" - name: charges identifier: charges + columns: + - name: id + data_type: character varying + description: "" + - name: card + data_type: jsonb + description: "" + - name: paid + data_type: boolean + description: "" + - name: order + data_type: character varying + description: "" + - name: amount + data_type: bigint + description: "" + - name: object + data_type: character varying + description: "" + - name: review + data_type: character varying + description: "" + - name: source + data_type: jsonb + description: "" + - name: status + data_type: character varying + description: "" + - name: created + data_type: bigint + description: "" + - name: dispute + data_type: character varying + description: "" + - name: invoice + data_type: character varying + description: "" + - name: outcome + data_type: jsonb + description: "" + - name: refunds + data_type: jsonb + description: "" + - name: updated + data_type: bigint + description: "" + - name: captured + data_type: boolean + description: "" + - name: currency + data_type: character varying + description: "" + - name: customer + data_type: character varying + description: "" + - name: disputed + data_type: boolean + description: "" + - name: livemode + data_type: boolean + description: "" + - name: metadata + data_type: jsonb + description: "" + - name: refunded + data_type: boolean + description: "" + - name: shipping + data_type: jsonb + description: "" + - name: application + data_type: character varying + description: "" + - name: description + data_type: character varying + description: "" + - name: destination + data_type: character varying + description: "" + - name: receipt_url + data_type: character varying + description: "" + - name: failure_code + data_type: character varying + description: "" + - name: on_behalf_of + data_type: character varying + description: "" + - name: fraud_details + data_type: jsonb + description: "" + - name: receipt_email + data_type: character varying + description: "" + - name: transfer_data + data_type: jsonb + description: "" + - name: amount_updates + data_type: jsonb + description: "" + - name: payment_intent + data_type: character varying + description: "" + - name: payment_method + data_type: character varying + description: "" + - name: receipt_number + data_type: character varying + description: "" + - name: transfer_group + data_type: character varying + description: "" + - name: amount_captured + data_type: bigint + description: "" + - name: amount_refunded + data_type: bigint + description: "" + - name: application_fee + data_type: character varying + description: "" + - name: billing_details + data_type: jsonb + description: "" + - name: failure_message + data_type: character varying + description: "" + - name: source_transfer + data_type: character varying + description: "" + - name: balance_transaction + data_type: character varying + description: "" + - name: statement_descriptor + data_type: character varying + description: "" + - name: statement_description + data_type: character varying + description: "" + - name: application_fee_amount + data_type: bigint + description: "" + - name: payment_method_details + data_type: jsonb + description: "" + - name: failure_balance_transaction + data_type: character varying + description: "" + - name: statement_descriptor_suffix + data_type: character varying + description: "" + - name: calculated_statement_descriptor + data_type: character varying + description: "" + - name: _airbyte_raw_id + data_type: character varying + description: "" + - name: _airbyte_extracted_at + data_type: timestamp with time zone + description: "" + - name: _airbyte_meta + data_type: jsonb + description: "" - name: payment_intents identifier: payment_intents - \ No newline at end of file + columns: + - name: id + data_type: character varying + description: "" + - name: amount + data_type: bigint + description: "" + - name: object + data_type: character varying + description: "" + - name: review + data_type: character varying + description: "" + - name: source + data_type: character varying + description: "" + - name: status + data_type: character varying + description: "" + - name: charges + data_type: jsonb + description: "" + - name: created + data_type: bigint + description: "" + - name: invoice + data_type: character varying + description: "" + - name: updated + data_type: bigint + description: "" + - name: currency + data_type: character varying + description: "" + - name: customer + data_type: character varying + description: "" + - name: livemode + data_type: boolean + description: "" + - name: metadata + data_type: jsonb + description: "" + - name: shipping + data_type: jsonb + description: "" + - name: processing + data_type: jsonb + description: "" + - name: application + data_type: character varying + description: "" + - name: canceled_at + data_type: bigint + description: "" + - name: description + data_type: character varying + description: "" + - name: next_action + data_type: jsonb + description: "" + - name: on_behalf_of + data_type: character varying + description: "" + - name: client_secret + data_type: character varying + description: "" + - name: latest_charge + data_type: character varying + description: "" + - name: receipt_email + data_type: character varying + description: "" + - name: transfer_data + data_type: jsonb + description: "" + - name: amount_details + data_type: jsonb + description: "" + - name: capture_method + data_type: character varying + description: "" + - name: payment_method + data_type: character varying + description: "" + - name: transfer_group + data_type: character varying + description: "" + - name: amount_received + data_type: bigint + description: "" + - name: amount_capturable + data_type: bigint + description: "" + - name: last_payment_error + data_type: jsonb + description: "" + - name: setup_future_usage + data_type: character varying + description: "" + - name: cancellation_reason + data_type: character varying + description: "" + - name: confirmation_method + data_type: character varying + description: "" + - name: payment_method_types + data_type: jsonb + description: "" + - name: statement_descriptor + data_type: character varying + description: "" + - name: statement_description + data_type: character varying + description: "" + - name: application_fee_amount + data_type: bigint + description: "" + - name: payment_method_options + data_type: jsonb + description: "" + - name: automatic_payment_methods + data_type: jsonb + description: "" + - name: statement_descriptor_suffix + data_type: character varying + description: "" + - name: payment_method_configuration_details + data_type: jsonb + description: "" + - name: _airbyte_raw_id + data_type: character varying + description: "" + - name: _airbyte_extracted_at + data_type: timestamp with time zone + description: "" + - name: _airbyte_meta + data_type: jsonb + description: "" \ No newline at end of file From 0805cdb15c6cefae1a177c2b15b1a0fd9d1d2a5b Mon Sep 17 00:00:00 2001 From: Pablo Martin Date: Mon, 19 Feb 2024 11:36:10 +0100 Subject: [PATCH 14/19] balance transactions docs --- models/doc_blocks.md | 29 +++++++++++++++ models/staging/stripe/_stripe_sources.yml | 43 +++++++++++++---------- 2 files changed, 53 insertions(+), 19 deletions(-) create mode 100644 models/doc_blocks.md diff --git a/models/doc_blocks.md b/models/doc_blocks.md new file mode 100644 index 0000000..ca174c6 --- /dev/null +++ b/models/doc_blocks.md @@ -0,0 +1,29 @@ +{% docs generic_id_desc %} + +The unique ID for records in this relation. + +{% enddocs %} + +{% docs field_docs_na_desc %} + +No available documentation for this field. + +{% enddocs %} + +{% docs _airbyte_raw_id_desc %} + +A UUID assigned by Airbyte to each processed event during the sync job. + +{% enddocs %} + +{% docs _airbyte_extracted_at_desc %} + +A timestamp for when the event was pulled by Airbyte from the original data source. + +{% enddocs %} + +{% docs _airbyte_meta_desc %} + +You can query the _airbyte_meta column to see which rows failed for content reasons, and why. + +{% enddocs %} diff --git a/models/staging/stripe/_stripe_sources.yml b/models/staging/stripe/_stripe_sources.yml index 3968d75..88e6819 100644 --- a/models/staging/stripe/_stripe_sources.yml +++ b/models/staging/stripe/_stripe_sources.yml @@ -6,64 +6,69 @@ sources: tables: - name: balance_transactions identifier: balance_transactions + description: | + Individual transactions happening in our different Stripe currency accounts. + + You can read more about this object here: https://docs.stripe.com/api/balance_transactions/object. + columns: - name: id data_type: character varying - description: "" + description: "{{ doc('generic_id_desc') }}" - name: fee data_type: bigint - description: "" + description: "Fees (in cents) paid for this transaction. Represented as a positive integer when assessed." - name: net data_type: bigint - description: "" + description: "Net impact to a Stripe balance (in cents). A positive value represents incrementing a Stripe balance, and a negative value decrementing a Stripe balance. You can calculate the net impact of a transaction on a balance by amount - fee" - name: type data_type: character varying - description: "" + description: "Transaction type: adjustment, advance, advance_funding, anticipation_repayment, application_fee, application_fee_refund, charge, climate_order_purchase, climate_order_refund, connect_collection_transfer, contribution, issuing_authorization_hold, issuing_authorization_release, issuing_dispute, issuing_transaction, obligation_outbound, obligation_reversal_inbound, payment, payment_failure_refund, payment_network_reserve_hold, payment_network_reserve_release, payment_refund, payment_reversal, payment_unreconciled, payout, payout_cancel, payout_failure, refund, refund_failure, reserve_transaction, reserved_funds, stripe_fee, stripe_fx_fee, tax_fee, topup, topup_reversal, transfer, transfer_cancel, transfer_failure, or transfer_refund. Learn more about balance transaction types and what they represent. To classify transactions for accounting purposes, consider reporting_category instead." - name: amount data_type: bigint - description: "" + description: "Gross amount of this transaction (in cents). A positive value represents funds charged to another party, and a negative value represents funds sent to another party." - name: object data_type: character varying - description: "" + description: "Silly column. The value is always `balance_transaction`." - name: source data_type: character varying - description: "" + description: "This transaction relates to the Stripe object indicated here. Can be different object types (charge, refund, payment, etc)." - name: status data_type: character varying - description: "" + description: "The transaction’s net funds status in the Stripe balance, which are either available or pending." - name: created data_type: bigint - description: "" + description: "Time at which the object was created. Measured in seconds since the Unix epoch." - name: currency data_type: character varying - description: "" + description: "Three-letter ISO currency code, in lowercase. Must be a supported currency." - name: description data_type: character varying - description: "" + description: "An arbitrary string attached to the object. Often useful for displaying to users." - name: fee_details data_type: jsonb - description: "" + description: "Detailed breakdown of fees (in cents) paid for this transaction." - name: available_on data_type: bigint - description: "" + description: "The date that the transaction’s net funds become available in the Stripe balance." - name: exchange_rate data_type: numeric - description: "" + description: "If applicable, this transaction uses an exchange rate. If money converts from currency A to currency B, then the amount in currency A, multipled by the exchange_rate, equals the amount in currency B. For example, if you charge a customer 10.00 EUR, the PaymentIntent’s amount is 1000 and currency is eur. If this converts to 12.34 USD in your Stripe account, the BalanceTransaction’s amount is 1234, its currency is usd, and the exchange_rate is 1.234." - name: sourced_transfers data_type: jsonb - description: "" + description: "{{ doc('field_docs_na_desc') }}" - name: reporting_category data_type: character varying - description: "" + description: "Read more at https://stripe.com/docs/reports/reporting-categories." - name: _airbyte_raw_id data_type: character varying - description: "" + description: "{{ doc('_airbyte_raw_id_desc') }}" - name: _airbyte_extracted_at data_type: timestamp with time zone - description: "" + description: "{{ doc('_airbyte_extracted_at_desc') }}" - name: _airbyte_meta data_type: jsonb - description: "" + description: "{{ doc('_airbyte_meta_desc') }}" - name: charges identifier: charges columns: From fb13ffebb284c2521218a0ef1214c7c913946ee7 Mon Sep 17 00:00:00 2001 From: Pablo Martin Date: Mon, 19 Feb 2024 12:15:44 +0100 Subject: [PATCH 15/19] charges docs --- models/staging/stripe/_stripe_sources.yml | 116 +++++++++++---------- models/staging/stripe/stripe_doc_blocks.md | 17 +++ 2 files changed, 77 insertions(+), 56 deletions(-) create mode 100644 models/staging/stripe/stripe_doc_blocks.md diff --git a/models/staging/stripe/_stripe_sources.yml b/models/staging/stripe/_stripe_sources.yml index 88e6819..0e8bee4 100644 --- a/models/staging/stripe/_stripe_sources.yml +++ b/models/staging/stripe/_stripe_sources.yml @@ -38,10 +38,10 @@ sources: description: "The transaction’s net funds status in the Stripe balance, which are either available or pending." - name: created data_type: bigint - description: "Time at which the object was created. Measured in seconds since the Unix epoch." + description: "{{ doc('stripe_created_desc') }}" - name: currency data_type: character varying - description: "Three-letter ISO currency code, in lowercase. Must be a supported currency." + description: "{{ doc('stripe_currency_desc') }}" - name: description data_type: character varying description: "An arbitrary string attached to the object. Often useful for displaying to users." @@ -71,169 +71,173 @@ sources: description: "{{ doc('_airbyte_meta_desc') }}" - name: charges identifier: charges + description: | + The Charge object represents a single attempt to move money into your Stripe account. PaymentIntent confirmation is the most common way to create Charges, but transferring money to a different Stripe account through Connect also creates Charges. Some legacy payment flows create Charges directly, which is not recommended for new integrations. + + You can read more about this object here: https://docs.stripe.com/api/charges. columns: - name: id data_type: character varying - description: "" + description: "{{ doc('generic_id_desc') }}" - name: card data_type: jsonb - description: "" + description: "{{ doc('field_docs_na_desc') }}" - name: paid data_type: boolean - description: "" + description: "true if the charge succeeded, or was successfully authorized for later capture." - name: order data_type: character varying - description: "" + description: "{{ doc('field_docs_na_desc') }}" - name: amount data_type: bigint - description: "" + description: "Amount intended to be collected by this payment. A positive integer representing how much to charge in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or equivalent in charge currency. The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99)." - name: object data_type: character varying - description: "" + description: "Silly column. The value is always `charge`." - name: review data_type: character varying - description: "" + description: "ID of the review associated with this charge if one exists." - name: source data_type: jsonb - description: "" + description: "{{ doc('field_docs_na_desc') }}" - name: status data_type: character varying - description: "" + description: "The status of the payment is either succeeded, pending, or failed." - name: created data_type: bigint - description: "" + description: "{{ doc('stripe_created_desc') }}" - name: dispute data_type: character varying - description: "" + description: "{{ doc('field_docs_na_desc')}}" - name: invoice data_type: character varying - description: "" + description: "ID of the invoice this charge is for if one exists." - name: outcome data_type: jsonb - description: "" + description: "Details about whether the payment was accepted, and why. See understanding declines for details." - name: refunds data_type: jsonb - description: "" + description: "A list of refunds that have been applied to the charge." - name: updated data_type: bigint - description: "" + description: "{{ doc('stripe_created_desc')}}" - name: captured data_type: boolean - description: "" + description: "If the charge was created without capturing, this Boolean represents whether it is still uncaptured or has since been captured." - name: currency data_type: character varying - description: "" + description: "{{ doc('stripe_currency_desc') }}" - name: customer data_type: character varying - description: "" + description: "ID of the customer this charge is for if one exists." - name: disputed data_type: boolean - description: "" + description: "Whether the charge has been disputed." - name: livemode data_type: boolean - description: "" + description: "Has the value true if the object exists in live mode or the value false if the object exists in test mode." - name: metadata data_type: jsonb - description: "" + description: "Additional properties supplied by Superhog." - name: refunded data_type: boolean - description: "" + description: "Whether the charge has been fully refunded. If the charge is only partially refunded, this attribute will still be false." - name: shipping data_type: jsonb - description: "" + description: "Shipping information for the charge." - name: application data_type: character varying - description: "" + description: "{{ doc('field_docs_na_desc') }}" - name: description data_type: character varying - description: "" + description: "An arbitrary string attached to the object. Often useful for displaying to users." - name: destination data_type: character varying - description: "" + description: "{{ doc('field_docs_na_desc') }}" - name: receipt_url data_type: character varying - description: "" + description: "This is the URL to view the receipt for this charge. The receipt is kept up-to-date to the latest state of the charge, including any refunds. If the charge is for an Invoice, the receipt will be stylized as an Invoice receipt." - name: failure_code data_type: character varying - description: "" + description: "Error code explaining reason for charge failure if available (see the errors section for a list of codes)." - name: on_behalf_of data_type: character varying - description: "" + description: "The account (if any) the charge was made on behalf of without triggering an automatic transfer. See the Connect documentation for details." - name: fraud_details data_type: jsonb - description: "" + description: "Information on fraud assessments for the charge." - name: receipt_email data_type: character varying - description: "" + description: "This is the email address that the receipt for this charge was sent to." - name: transfer_data data_type: jsonb - description: "" + description: "An optional dictionary including the account to automatically transfer to as part of a destination charge. See the Connect documentation for details." - name: amount_updates data_type: jsonb - description: "" + description: "{{ doc('field_docs_na_desc') }}" - name: payment_intent data_type: character varying - description: "" + description: "ID of the PaymentIntent associated with this charge, if one exists." - name: payment_method data_type: character varying - description: "" + description: "ID of the payment method used in this charge." - name: receipt_number data_type: character varying - description: "" + description: "This is the transaction number that appears on email receipts sent for this charge. This attribute will be null until a receipt has been sent." - name: transfer_group data_type: character varying - description: "" + description: "A string that identifies this transaction as part of a group. See the Connect documentation for details." - name: amount_captured data_type: bigint - description: "" + description: "Amount in cents captured (can be less than the amount attribute on the charge if a partial capture was made)." - name: amount_refunded data_type: bigint - description: "" + description: "Amount in cents refunded (can be less than the amount attribute on the charge if a partial refund was issued)." - name: application_fee data_type: character varying - description: "" + description: "The application fee (if any) for the charge. See the Connect documentation for details." - name: billing_details data_type: jsonb - description: "" + description: "Billing information associated with the payment method at the time of the transaction." - name: failure_message data_type: character varying - description: "" + description: "Message to user further explaining reason for charge failure if available." - name: source_transfer data_type: character varying - description: "" + description: "The transfer ID which created this charge. Only present if the charge came from another Stripe account. See the Connect documentation for details." - name: balance_transaction data_type: character varying - description: "" + description: "ID of the balance transaction that describes the impact of this charge on your account balance (not including refunds or disputes)." - name: statement_descriptor data_type: character varying - description: "" + description: "For card charges, use statement_descriptor_suffix instead. Otherwise, you can use this value as the complete description of a charge on your customers’ statements. Must contain at least one letter, maximum 22 characters." - name: statement_description data_type: character varying - description: "" + description: "{{ doc('field_docs_na_desc') }}" - name: application_fee_amount data_type: bigint - description: "" + description: The amount of the application fee (if any) requested for the charge. See the Connect documentation for details - name: payment_method_details data_type: jsonb - description: "" + description: "Details about the payment method at the time of the transaction." - name: failure_balance_transaction data_type: character varying - description: "" + description: "ID of the balance transaction that describes the reversal of the balance on your account due to payment failure." - name: statement_descriptor_suffix data_type: character varying - description: "" + description: "Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor." - name: calculated_statement_descriptor data_type: character varying - description: "" + description: "The full statement descriptor that is passed to card networks, and that is displayed on your customers’ credit card and bank statements. Allows you to see what the statement descriptor looks like after the static and dynamic portions are combined." - name: _airbyte_raw_id data_type: character varying - description: "" + description: "{{ doc('_airbyte_raw_id_desc') }}" - name: _airbyte_extracted_at data_type: timestamp with time zone - description: "" + description: "{{ doc('_airbyte_extracted_at_desc') }}" - name: _airbyte_meta data_type: jsonb - description: "" + description: "{{ doc('_airbyte_meta_desc') }}" - name: payment_intents identifier: payment_intents columns: diff --git a/models/staging/stripe/stripe_doc_blocks.md b/models/staging/stripe/stripe_doc_blocks.md new file mode 100644 index 0000000..44a63b4 --- /dev/null +++ b/models/staging/stripe/stripe_doc_blocks.md @@ -0,0 +1,17 @@ +{% docs stripe_created_desc %} + +Time at which the object was created. Measured in seconds since the Unix epoch. + +{% enddocs %} + +{% docs stripe_updated_desc %} + +Time at which the object was last updated. Measured in seconds since the Unix epoch. + +{% enddocs %} + +{% docs stripe_currency_desc %} + +Three-letter ISO currency code, in lowercase. Must be a supported currency. + +{% enddocs %} From 8549eab863a273c3e8a2098f4e0731448b09e3e4 Mon Sep 17 00:00:00 2001 From: Pablo Martin Date: Mon, 19 Feb 2024 12:54:43 +0100 Subject: [PATCH 16/19] payment intent source docs --- models/staging/stripe/_stripe_sources.yml | 117 ++++++++++++--------- models/staging/stripe/stripe_doc_blocks.md | 12 +++ 2 files changed, 81 insertions(+), 48 deletions(-) diff --git a/models/staging/stripe/_stripe_sources.yml b/models/staging/stripe/_stripe_sources.yml index 0e8bee4..6950fed 100644 --- a/models/staging/stripe/_stripe_sources.yml +++ b/models/staging/stripe/_stripe_sources.yml @@ -135,10 +135,10 @@ sources: description: "Whether the charge has been disputed." - name: livemode data_type: boolean - description: "Has the value true if the object exists in live mode or the value false if the object exists in test mode." + description: "{{ doc('stripe_livemode_desc') }}" - name: metadata data_type: jsonb - description: "Additional properties supplied by Superhog." + description: "{{ doc('stripe_metadata_desc') }}" - name: refunded data_type: boolean description: "Whether the charge has been fully refunded. If the charge is only partially refunded, this attribute will still be false." @@ -240,142 +240,163 @@ sources: description: "{{ doc('_airbyte_meta_desc') }}" - name: payment_intents identifier: payment_intents + description: | + A PaymentIntent guides you through the process of collecting a payment from your customer. We recommend that you create exactly one PaymentIntent for each order or customer session in your system. You can reference the PaymentIntent later to see the history of payment attempts for a particular session. + + A PaymentIntent transitions through multiple statuses throughout its lifetime as it interfaces with Stripe.js to perform authentication flows and ultimately creates at most one successful charge. + + You can read more about this object here: https://docs.stripe.com/api/payment_intents. columns: - name: id data_type: character varying - description: "" + description: "{{ doc('generic_id_desc') }}" - name: amount data_type: bigint - description: "" + description: "Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or equivalent in charge currency. The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99)." - name: object data_type: character varying - description: "" + description: "Silly column. The value is always `payment_intent`." - name: review data_type: character varying - description: "" + description: "ID of the review associated with this PaymentIntent, if any." - name: source data_type: character varying - description: "" + description: "{{ doc('field_docs_na_desc') }}" - name: status data_type: character varying - description: "" + description: "Status of this PaymentIntent, one of requires_payment_method, requires_confirmation, requires_action, processing, requires_capture, canceled, or succeeded. Read more about each PaymentIntent status." - name: charges data_type: jsonb - description: "" + description: "{{ doc('field_docs_na_desc') }}" - name: created data_type: bigint - description: "" + description: "{{ doc('stripe_created_desc') }}" - name: invoice data_type: character varying - description: "" + description: "ID of the invoice that created this PaymentIntent, if it exists." - name: updated data_type: bigint - description: "" + description: "{{ doc('stripe_created_desc')}}" - name: currency data_type: character varying - description: "" + description: "{{ doc('stripe_currency_desc') }}" - name: customer data_type: character varying - description: "" + description: | + "ID of the Customer this PaymentIntent belongs to, if one exists. + + Payment methods attached to other Customers cannot be used with this PaymentIntent. + + If present in combination with setup_future_usage, this PaymentIntent’s payment method will be attached to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete." - name: livemode data_type: boolean - description: "" + description: "{{ doc('stripe_livemode_desc') }}" - name: metadata data_type: jsonb - description: "" + description: "{{ doc('stripe_metadata_desc') }}" - name: shipping data_type: jsonb - description: "" + description: "Shipping information for the charge." - name: processing data_type: jsonb - description: "" + description: "If present, this property tells you about the processing state of the payment." - name: application data_type: character varying - description: "" + description: "ID of the Connect application that created the PaymentIntent." - name: canceled_at data_type: bigint - description: "" + description: "Populated when status is canceled, this is the time at which the PaymentIntent was canceled. Measured in seconds since the Unix epoch." - name: description data_type: character varying - description: "" + description: "An arbitrary string attached to the object. Often useful for displaying to users." - name: next_action data_type: jsonb - description: "" + description: "If present, this property tells you what actions you need to take in order for your customer to fulfill a payment using the provided source." - name: on_behalf_of data_type: character varying - description: "" + description: "The account (if any) for which the funds of the PaymentIntent are intended. See the PaymentIntents use case for connected accounts for details." - name: client_secret data_type: character varying - description: "" + description: | + "The client secret of this PaymentIntent. Used for client-side retrieval using a publishable key. + + The client secret can be used to complete a payment from your frontend. It should not be stored, logged, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret. + + Refer to our docs to accept a payment and learn about how client_secret should be handled." - name: latest_charge data_type: character varying - description: "" + description: "The latest charge created by this PaymentIntent." - name: receipt_email data_type: character varying - description: "" + description: "Email address that the receipt for the resulting payment will be sent to. If receipt_email is specified for a payment in live mode, a receipt will be sent regardless of your email settings." - name: transfer_data data_type: jsonb - description: "" + description: "The data that automatically creates a Transfer after the payment finalizes. Learn more about the use case for connected accounts." - name: amount_details data_type: jsonb - description: "" + description: "Details about items that the amount includes." - name: capture_method data_type: character varying - description: "" + description: "Controls when the funds will be captured from the customer’s account. One of: automatic, automatic_async, manual." - name: payment_method data_type: character varying - description: "" + description: "ID of the payment method used in this PaymentIntent." - name: transfer_group data_type: character varying - description: "" + description: "A string that identifies the resulting payment as part of a group. Learn more about the use case for connected accounts." - name: amount_received data_type: bigint - description: "" + description: "Amount that this PaymentIntent collects." - name: amount_capturable data_type: bigint - description: "" + description: "Amount that can be captured from this PaymentIntent." - name: last_payment_error data_type: jsonb - description: "" + description: "The payment error encountered in the previous PaymentIntent confirmation. It will be cleared if the PaymentIntent is later updated for any reason." - name: setup_future_usage data_type: character varying - description: "" + description: | + "Indicates that you intend to make future payments with this PaymentIntent’s payment method. + + Providing this parameter will attach the payment method to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be attached to a Customer after the transaction completes. + + When processing card payments, Stripe also uses setup_future_usage to dynamically optimize your payment flow and comply with regional legislation and network rules, such as SCA." - name: cancellation_reason data_type: character varying - description: "" + description: "Reason for cancellation of this PaymentIntent, either user-provided (duplicate, fraudulent, requested_by_customer, or abandoned) or generated by Stripe internally (failed_invoice, void_invoice, or automatic)." - name: confirmation_method data_type: character varying - description: "" + description: "Describes whether we can confirm this PaymentIntent automatically, or if it requires customer action to confirm the payment." - name: payment_method_types data_type: jsonb - description: "" + description: "The list of payment method types (e.g. card) that this PaymentIntent is allowed to use." - name: statement_descriptor data_type: character varying - description: "" + description: "For card charges, use statement_descriptor_suffix. Otherwise, you can use this value as the complete description of a charge on your customers’ statements. It must contain at least one letter and be 1–22 characters long." - name: statement_description data_type: character varying - description: "" + description: "{{ doc('field_docs_na_desc') }}" - name: application_fee_amount data_type: bigint - description: "" + description: "The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner’s Stripe account. The amount of the application fee collected will be capped at the total payment amount. For more information, see the PaymentIntents use case for connected accounts." - name: payment_method_options data_type: jsonb - description: "" + description: "Payment method-specific configuration for this PaymentIntent." - name: automatic_payment_methods data_type: jsonb - description: "" + description: "When you enable this parameter, this PaymentIntent accepts payment methods that you enable in the Dashboard and that are compatible with this PaymentIntent’s other parameters." - name: statement_descriptor_suffix data_type: character varying - description: "" + description: "Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. The concatenated descriptor must contain 1-22 characters." - name: payment_method_configuration_details data_type: jsonb - description: "" + description: "{{ doc('field_docs_na_desc') }}" - name: _airbyte_raw_id data_type: character varying - description: "" + description: "{{ doc('_airbyte_raw_id_desc') }}" - name: _airbyte_extracted_at data_type: timestamp with time zone - description: "" + description: "{{ doc('_airbyte_extracted_at_desc') }}" - name: _airbyte_meta data_type: jsonb - description: "" \ No newline at end of file + description: "{{ doc('_airbyte_meta_desc') }}" \ No newline at end of file diff --git a/models/staging/stripe/stripe_doc_blocks.md b/models/staging/stripe/stripe_doc_blocks.md index 44a63b4..a8c073c 100644 --- a/models/staging/stripe/stripe_doc_blocks.md +++ b/models/staging/stripe/stripe_doc_blocks.md @@ -15,3 +15,15 @@ Time at which the object was last updated. Measured in seconds since the Unix ep Three-letter ISO currency code, in lowercase. Must be a supported currency. {% enddocs %} + +{% docs stripe_livemode_desc %} + +Has the value true if the object exists in live mode or the value false if the object exists in test mode." + +{% enddocs %} + +{% docs stripe_metadata_desc %} + +Additional properties supplied by Superhog. + +{% enddocs %} From 1cf1214d97d1a896142278da112dd88c06c18a9f Mon Sep 17 00:00:00 2001 From: Pablo Martin Date: Mon, 19 Feb 2024 16:07:32 +0100 Subject: [PATCH 17/19] A few field changes in stg --- .../staging/stripe/stg_stripe__balance_transactions.sql | 8 ++++---- models/staging/stripe/stg_stripe__charges.sql | 8 ++++---- models/staging/stripe/stg_stripe__payment_intents.sql | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/models/staging/stripe/stg_stripe__balance_transactions.sql b/models/staging/stripe/stg_stripe__balance_transactions.sql index 423ecdc..6a0c172 100644 --- a/models/staging/stripe/stg_stripe__balance_transactions.sql +++ b/models/staging/stripe/stg_stripe__balance_transactions.sql @@ -5,10 +5,10 @@ with stg_stripe__balance_transactions as ( select {{ adapter.quote("id") }}, - {{ adapter.quote("fee") }} / 100 as fee, - {{ adapter.quote("net") }} / 100 as net, + {{ adapter.quote("fee") }}, + {{ adapter.quote("net") }}, {{ adapter.quote("type") }}, - {{ adapter.quote("amount") }} / 100 as amount, + {{ adapter.quote("amount") }}, {{ adapter.quote("object") }}, {{ adapter.quote("source") }}, {{ adapter.quote("status") }}, @@ -20,7 +20,7 @@ with {{ adapter.quote("exchange_rate") }}, {{ adapter.quote("sourced_transfers") }}, {{ adapter.quote("reporting_category") }}, - {{ adapter.quote("_airbyte_extracted_at") }} as dwh_loaded_at_date + {{ adapter.quote("_airbyte_extracted_at") }} as dwh_extracted_at_date from raw_balance_transactions ) diff --git a/models/staging/stripe/stg_stripe__charges.sql b/models/staging/stripe/stg_stripe__charges.sql index d56a904..3267009 100644 --- a/models/staging/stripe/stg_stripe__charges.sql +++ b/models/staging/stripe/stg_stripe__charges.sql @@ -6,7 +6,7 @@ with {{ adapter.quote("card") }}, cast({{ adapter.quote("paid") }} as bool) as is_paid, {{ adapter.quote("order") }}, - {{ adapter.quote("amount") }} / 100 as amount, + {{ adapter.quote("amount") }}, {{ adapter.quote("object") }}, {{ adapter.quote("review") }}, {{ adapter.quote("source") }}, @@ -39,8 +39,8 @@ with {{ adapter.quote("payment_method") }}, {{ adapter.quote("receipt_number") }}, {{ adapter.quote("transfer_group") }}, - {{ adapter.quote("amount_captured") }} / 100 as amount_captured, - {{ adapter.quote("amount_refunded") }} / 100 as amount_refunded, + {{ adapter.quote("amount_captured") }}, + {{ adapter.quote("amount_refunded") }}, {{ adapter.quote("application_fee") }}, {{ adapter.quote("billing_details") }}, {{ adapter.quote("failure_message") }}, @@ -53,7 +53,7 @@ with {{ adapter.quote("failure_balance_transaction") }}, {{ adapter.quote("statement_descriptor_suffix") }}, {{ adapter.quote("calculated_statement_descriptor") }}, - {{ adapter.quote("_airbyte_extracted_at") }} as dwh_loaded_at_date + {{ adapter.quote("_airbyte_extracted_at") }} as dwh_extracted_at_date from raw_charges ) diff --git a/models/staging/stripe/stg_stripe__payment_intents.sql b/models/staging/stripe/stg_stripe__payment_intents.sql index 588cd5e..aedcc39 100644 --- a/models/staging/stripe/stg_stripe__payment_intents.sql +++ b/models/staging/stripe/stg_stripe__payment_intents.sql @@ -3,7 +3,7 @@ with stg_stripe__payment_intents as ( select {{ adapter.quote("id") }}, - {{ adapter.quote("amount") }} / 100 as amount, + {{ adapter.quote("amount") }}, {{ adapter.quote("object") }}, {{ adapter.quote("review") }}, {{ adapter.quote("source") }}, @@ -31,7 +31,7 @@ with {{ adapter.quote("capture_method") }}, {{ adapter.quote("payment_method") }}, {{ adapter.quote("transfer_group") }}, - {{ adapter.quote("amount_received") }} / 100 as amount_received, + {{ adapter.quote("amount_received") }}, {{ adapter.quote("amount_capturable") }}, {{ adapter.quote("last_payment_error") }}, {{ adapter.quote("setup_future_usage") }}, @@ -45,7 +45,7 @@ with {{ adapter.quote("automatic_payment_methods") }}, {{ adapter.quote("statement_descriptor_suffix") }}, {{ adapter.quote("payment_method_configuration_details") }}, - {{ adapter.quote("_airbyte_extracted_at") }} as dwh_loaded_at_date + {{ adapter.quote("_airbyte_extracted_at") }} as dwh_extracted_at_date from raw_payment_intents ) From 00e227bb5269e15dbff1735398521acca9257db9 Mon Sep 17 00:00:00 2001 From: Pablo Martin Date: Mon, 19 Feb 2024 16:23:26 +0100 Subject: [PATCH 18/19] balance transaction docs --- models/doc_blocks.md | 6 ++++ models/staging/stripe/schema.yml | 60 +++++++++++++++++++++++++++++--- 2 files changed, 61 insertions(+), 5 deletions(-) diff --git a/models/doc_blocks.md b/models/doc_blocks.md index ca174c6..beeef7c 100644 --- a/models/doc_blocks.md +++ b/models/doc_blocks.md @@ -27,3 +27,9 @@ A timestamp for when the event was pulled by Airbyte from the original data sour You can query the _airbyte_meta column to see which rows failed for content reasons, and why. {% enddocs %} + +{% docs dwh_extracted_at_date_desc %} + +A timestamp for when the event was pulled by Airbyte from the original data source. + +{% enddocs %} \ No newline at end of file diff --git a/models/staging/stripe/schema.yml b/models/staging/stripe/schema.yml index 13ee94a..8f8454e 100644 --- a/models/staging/stripe/schema.yml +++ b/models/staging/stripe/schema.yml @@ -3,13 +3,63 @@ version: 2 models: - name: stg_stripe__balance_transactions - description: "Balance transactions from all our Stripe balance accounts." + description: | + Individual transactions happening in our different Stripe currency accounts. + + You can read more about this object here: https://docs.stripe.com/api/balance_transactions/object. + columns: - name: id - description: "The primary key for the transaction." - tests: - - unique - - not_null + data_type: character varying + description: "{{ doc('generic_id_desc') }}" + - name: fee + data_type: bigint + description: "Fees (in cents) paid for this transaction. Represented as a positive integer when assessed." + - name: net + data_type: bigint + description: "Net impact to a Stripe balance (in cents). A positive value represents incrementing a Stripe balance, and a negative value decrementing a Stripe balance. You can calculate the net impact of a transaction on a balance by amount - fee" + - name: type + data_type: character varying + description: "Transaction type: adjustment, advance, advance_funding, anticipation_repayment, application_fee, application_fee_refund, charge, climate_order_purchase, climate_order_refund, connect_collection_transfer, contribution, issuing_authorization_hold, issuing_authorization_release, issuing_dispute, issuing_transaction, obligation_outbound, obligation_reversal_inbound, payment, payment_failure_refund, payment_network_reserve_hold, payment_network_reserve_release, payment_refund, payment_reversal, payment_unreconciled, payout, payout_cancel, payout_failure, refund, refund_failure, reserve_transaction, reserved_funds, stripe_fee, stripe_fx_fee, tax_fee, topup, topup_reversal, transfer, transfer_cancel, transfer_failure, or transfer_refund. Learn more about balance transaction types and what they represent. To classify transactions for accounting purposes, consider reporting_category instead." + - name: amount + data_type: bigint + description: "Gross amount of this transaction (in cents). A positive value represents funds charged to another party, and a negative value represents funds sent to another party." + - name: object + data_type: character varying + description: "Silly column. The value is always `balance_transaction`." + - name: source + data_type: character varying + description: "This transaction relates to the Stripe object indicated here. Can be different object types (charge, refund, payment, etc)." + - name: status + data_type: character varying + description: "The transaction’s net funds status in the Stripe balance, which are either available or pending." + - name: created_at_utc + data_type: bigint + description: "The timestamp at which the transaction object was created." + - name: currency + data_type: character varying + description: "{{ doc('stripe_currency_desc') }}" + - name: description + data_type: character varying + description: "An arbitrary string attached to the object. Often useful for displaying to users." + - name: fee_details + data_type: jsonb + description: "Detailed breakdown of fees (in cents) paid for this transaction." + - name: available_at_utc + data_type: bigint + description: "The timestamp at which the transaction’s net funds become available in the Stripe balance." + - name: exchange_rate + data_type: numeric + description: "If applicable, this transaction uses an exchange rate. If money converts from currency A to currency B, then the amount in currency A, multipled by the exchange_rate, equals the amount in currency B. For example, if you charge a customer 10.00 EUR, the PaymentIntent’s amount is 1000 and currency is eur. If this converts to 12.34 USD in your Stripe account, the BalanceTransaction’s amount is 1234, its currency is usd, and the exchange_rate is 1.234." + - name: sourced_transfers + data_type: jsonb + description: "{{ doc('field_docs_na_desc') }}" + - name: reporting_category + data_type: character varying + description: "Read more at https://stripe.com/docs/reports/reporting-categories." + - name: dwh_extracted_at_date + data_type: timestamp with time zone + description: "{{ doc('dwh_extracted_at_date_desc')}}" - name: stg_stripe__charges description: "Charges from all our Stripe accounts." columns: From 572cbba4ab54888251703fd5cc3eaf634339646b Mon Sep 17 00:00:00 2001 From: Pablo Martin Date: Mon, 19 Feb 2024 16:50:24 +0100 Subject: [PATCH 19/19] docs for payment intents --- models/staging/stripe/_stripe_sources.yml | 2 +- models/staging/stripe/schema.yml | 426 +++++++++++++++++++++- 2 files changed, 409 insertions(+), 19 deletions(-) diff --git a/models/staging/stripe/_stripe_sources.yml b/models/staging/stripe/_stripe_sources.yml index 6950fed..13e54bc 100644 --- a/models/staging/stripe/_stripe_sources.yml +++ b/models/staging/stripe/_stripe_sources.yml @@ -216,7 +216,7 @@ sources: description: "{{ doc('field_docs_na_desc') }}" - name: application_fee_amount data_type: bigint - description: The amount of the application fee (if any) requested for the charge. See the Connect documentation for details + description: "The amount of the application fee (if any) requested for the charge. See the Connect documentation for details." - name: payment_method_details data_type: jsonb description: "Details about the payment method at the time of the transaction." diff --git a/models/staging/stripe/schema.yml b/models/staging/stripe/schema.yml index 8f8454e..b3dccc7 100644 --- a/models/staging/stripe/schema.yml +++ b/models/staging/stripe/schema.yml @@ -1,13 +1,12 @@ - version: 2 models: - name: stg_stripe__balance_transactions - description: | + description: | Individual transactions happening in our different Stripe currency accounts. - + You can read more about this object here: https://docs.stripe.com/api/balance_transactions/object. - + columns: - name: id data_type: character varying @@ -35,7 +34,7 @@ models: description: "The transaction’s net funds status in the Stripe balance, which are either available or pending." - name: created_at_utc data_type: bigint - description: "The timestamp at which the transaction object was created." + description: "The timestamp at which the object was created." - name: currency data_type: character varying description: "{{ doc('stripe_currency_desc') }}" @@ -61,19 +60,410 @@ models: data_type: timestamp with time zone description: "{{ doc('dwh_extracted_at_date_desc')}}" - name: stg_stripe__charges - description: "Charges from all our Stripe accounts." + description: "" columns: - name: id - description: "The primary key for the charge." - tests: - - unique - - not_null - - name: stg_stripe__payment_intents - description: "Payment intents from all our Stripe accounts." - columns: - - name: id - description: "The primary key for the Payment intent." - tests: - - unique - - not_null + data_type: character varying + description: "{{ doc('generic_id_desc') }}" + - name: card + data_type: jsonb + description: "{{ doc('field_docs_na_desc') }}" + + - name: is_paid + data_type: boolean + description: "true if the charge succeeded, or was successfully authorized for later capture." + + - name: order + data_type: character varying + description: "{{ doc('field_docs_na_desc') }}" + + - name: amount + data_type: bigint + description: "Amount intended to be collected by this payment. A positive integer representing how much to charge in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or equivalent in charge currency. The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99)." + + - name: object + data_type: character varying + description: "Silly column. The value is always `charge`." + + - name: review + data_type: character varying + description: "ID of the review associated with this charge if one exists." + + - name: source + data_type: jsonb + description: "{{ doc('field_docs_na_desc') }}" + + - name: status + data_type: character varying + description: "The status of the payment is either succeeded, pending, or failed." + + - name: created_at_utc + data_type: timestamp with time zone + description: "The timestamp at which the object was created." + + - name: dispute + data_type: character varying + description: "{{ doc('field_docs_na_desc')}}" + + - name: invoice + data_type: character varying + description: "ID of the invoice this charge is for if one exists." + + - name: outcome + data_type: jsonb + description: "Details about whether the payment was accepted, and why. See understanding declines for details." + + - name: refunds + data_type: jsonb + description: "A list of refunds that have been applied to the charge." + + - name: updated_at_utc + data_type: timestamp with time zone + description: "The timestamp at which the object was last updated." + + - name: is_captured + data_type: boolean + description: "If the charge was created without capturing, this Boolean represents whether it is still uncaptured or has since been captured." + + - name: currency + data_type: character varying + description: "{{ doc('stripe_currency_desc') }}" + + - name: customer + data_type: character varying + description: "ID of the customer this charge is for if one exists." + + - name: is_disputed + data_type: boolean + description: "Whether the charge has been disputed." + + - name: is_livemode + data_type: boolean + description: "{{ doc('stripe_livemode_desc') }}" + + - name: metadata + data_type: jsonb + description: "{{ doc('stripe_metadata_desc') }}" + + - name: is_refunded + data_type: boolean + description: "Whether the charge has been fully refunded. If the charge is only partially refunded, this attribute will still be false." + + - name: shipping + data_type: jsonb + description: "Shipping information for the charge." + + - name: application + data_type: character varying + description: "{{ doc('field_docs_na_desc') }}" + + - name: description + data_type: character varying + description: "An arbitrary string attached to the object. Often useful for displaying to users." + + - name: destination + data_type: character varying + description: "{{ doc('field_docs_na_desc') }}" + + - name: receipt_url + data_type: character varying + description: "This is the URL to view the receipt for this charge. The receipt is kept up-to-date to the latest state of the charge, including any refunds. If the charge is for an Invoice, the receipt will be stylized as an Invoice receipt." + + - name: failure_code + data_type: character varying + description: "Error code explaining reason for charge failure if available (see the errors section for a list of codes)." + + - name: on_behalf_of + data_type: character varying + description: "The account (if any) the charge was made on behalf of without triggering an automatic transfer. See the Connect documentation for details." + + - name: fraud_details + data_type: jsonb + description: "Information on fraud assessments for the charge." + + - name: receipt_email + data_type: character varying + description: "This is the email address that the receipt for this charge was sent to." + + - name: transfer_data + data_type: jsonb + description: "An optional dictionary including the account to automatically transfer to as part of a destination charge. See the Connect documentation for details." + + - name: amount_updates + data_type: jsonb + description: "{{ doc('field_docs_na_desc') }}" + + - name: payment_intent + data_type: character varying + description: "ID of the PaymentIntent associated with this charge, if one exists." + + - name: payment_method + data_type: character varying + description: "ID of the payment method used in this charge." + + - name: receipt_number + data_type: character varying + description: "This is the transaction number that appears on email receipts sent for this charge. This attribute will be null until a receipt has been sent." + + - name: transfer_group + data_type: character varying + description: "A string that identifies this transaction as part of a group. See the Connect documentation for details." + + - name: amount_captured + data_type: bigint + description: "Amount in cents captured (can be less than the amount attribute on the charge if a partial capture was made)." + + - name: amount_refunded + data_type: bigint + description: "Amount in cents refunded (can be less than the amount attribute on the charge if a partial refund was issued)." + + - name: application_fee + data_type: character varying + description: "The application fee (if any) for the charge. See the Connect documentation for details." + + - name: billing_details + data_type: jsonb + description: "Billing information associated with the payment method at the time of the transaction." + + - name: failure_message + data_type: character varying + description: "Message to user further explaining reason for charge failure if available." + + - name: source_transfer + data_type: character varying + description: "The transfer ID which created this charge. Only present if the charge came from another Stripe account. See the Connect documentation for details." + + - name: balance_transaction + data_type: character varying + description: "ID of the balance transaction that describes the impact of this charge on your account balance (not including refunds or disputes)." + + - name: statement_descriptor + data_type: character varying + description: "For card charges, use statement_descriptor_suffix instead. Otherwise, you can use this value as the complete description of a charge on your customers’ statements. Must contain at least one letter, maximum 22 characters." + + - name: statement_description + data_type: character varying + description: "{{ doc('field_docs_na_desc') }}" + + - name: application_fee_amount + data_type: bigint + description: "The amount of the application fee (if any) requested for the charge. See the Connect documentation for details." + + - name: payment_method_details + data_type: jsonb + description: "Details about the payment method at the time of the transaction." + + - name: failure_balance_transaction + data_type: character varying + description: "ID of the balance transaction that describes the reversal of the balance on your account due to payment failure." + + - name: statement_descriptor_suffix + data_type: character varying + description: "Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor." + + - name: calculated_statement_descriptor + data_type: character varying + description: "The full statement descriptor that is passed to card networks, and that is displayed on your customers’ credit card and bank statements. Allows you to see what the statement descriptor looks like after the static and dynamic portions are combined." + + - name: dwh_extracted_at_date + data_type: timestamp with time zone + description: "{{ doc('dwh_extracted_at_date_desc') }}" + - name: stg_stripe__payment_intents + description: | + A PaymentIntent guides you through the process of collecting a payment from your customer. We recommend that you create exactly one PaymentIntent for each order or customer session in your system. You can reference the PaymentIntent later to see the history of payment attempts for a particular session. + + A PaymentIntent transitions through multiple statuses throughout its lifetime as it interfaces with Stripe.js to perform authentication flows and ultimately creates at most one successful charge. + + You can read more about this object here: https://docs.stripe.com/api/payment_intents. + columns: + - name: id + data_type: character varying + description: "{{ doc('generic_id_desc') }}" + + - name: amount + data_type: bigint + description: "Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or equivalent in charge currency. The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99)." + + - name: object + data_type: character varying + description: "Silly column. The value is always `payment_intent`." + + - name: review + data_type: character varying + description: "ID of the review associated with this PaymentIntent, if any." + + - name: source + data_type: character varying + description: "{{ doc('field_docs_na_desc') }}" + + - name: status + data_type: character varying + description: "Status of this PaymentIntent, one of requires_payment_method, requires_confirmation, requires_action, processing, requires_capture, canceled, or succeeded. Read more about each PaymentIntent status." + + - name: charges + data_type: jsonb + description: "{{ doc('field_docs_na_desc') }}" + + - name: created_at_utc + data_type: timestamp with time zone + description: "The timestamp at which the object was created." + + - name: invoice + data_type: character varying + description: "ID of the invoice that created this PaymentIntent, if it exists." + + - name: updated_at_utc + data_type: timestamp with time zone + description: "The timestamp at which the object was last updated." + + - name: currency + data_type: character varying + description: "{{ doc('stripe_currency_desc') }}" + + - name: customer + data_type: character varying + description: | + "ID of the Customer this PaymentIntent belongs to, if one exists. + + Payment methods attached to other Customers cannot be used with this PaymentIntent. + + If present in combination with setup_future_usage, this PaymentIntent’s payment method will be attached to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete." + + - name: is_livemode + data_type: boolean + description: "{{ doc('stripe_livemode_desc') }}" + + - name: metadata + data_type: jsonb + description: "{{ doc('stripe_metadata_desc') }}" + + - name: shipping + data_type: jsonb + description: "Shipping information for the charge." + + - name: processing + data_type: jsonb + description: "If present, this property tells you about the processing state of the payment." + + - name: application + data_type: character varying + description: "ID of the Connect application that created the PaymentIntent." + + - name: canceled_at_utc + data_type: timestamp with time zone + description: "Populated when status is canceled, this is the time at which the PaymentIntent was canceled." + + - name: description + data_type: character varying + description: "An arbitrary string attached to the object. Often useful for displaying to users." + + - name: next_action + data_type: jsonb + description: "If present, this property tells you what actions you need to take in order for your customer to fulfill a payment using the provided source." + + - name: on_behalf_of + data_type: character varying + description: "The account (if any) for which the funds of the PaymentIntent are intended. See the PaymentIntents use case for connected accounts for details." + + - name: client_secret + data_type: character varying + description: | + "The client secret of this PaymentIntent. Used for client-side retrieval using a publishable key. + + The client secret can be used to complete a payment from your frontend. It should not be stored, logged, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret. + + Refer to our docs to accept a payment and learn about how client_secret should be handled." + + - name: latest_charge + data_type: character varying + description: "The latest charge created by this PaymentIntent." + + - name: receipt_email + data_type: character varying + description: "Email address that the receipt for the resulting payment will be sent to. If receipt_email is specified for a payment in live mode, a receipt will be sent regardless of your email settings." + + - name: transfer_data + data_type: jsonb + description: "The data that automatically creates a Transfer after the payment finalizes. Learn more about the use case for connected accounts." + + - name: amount_details + data_type: jsonb + description: "Details about items that the amount includes." + + - name: capture_method + data_type: character varying + description: "Controls when the funds will be captured from the customer’s account. One of: automatic, automatic_async, manual." + + - name: payment_method + data_type: character varying + description: "ID of the payment method used in this PaymentIntent." + + - name: transfer_group + data_type: character varying + description: "A string that identifies the resulting payment as part of a group. Learn more about the use case for connected accounts." + + - name: amount_received + data_type: bigint + description: "Amount that this PaymentIntent collects." + + - name: amount_capturable + data_type: bigint + description: "Amount that can be captured from this PaymentIntent." + + - name: last_payment_error + data_type: jsonb + description: "The payment error encountered in the previous PaymentIntent confirmation. It will be cleared if the PaymentIntent is later updated for any reason." + + - name: setup_future_usage + data_type: character varying + description: | + "Indicates that you intend to make future payments with this PaymentIntent’s payment method. + + Providing this parameter will attach the payment method to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be attached to a Customer after the transaction completes. + + When processing card payments, Stripe also uses setup_future_usage to dynamically optimize your payment flow and comply with regional legislation and network rules, such as SCA." + + - name: cancellation_reason + data_type: character varying + description: "Reason for cancellation of this PaymentIntent, either user-provided (duplicate, fraudulent, requested_by_customer, or abandoned) or generated by Stripe internally (failed_invoice, void_invoice, or automatic)." + + - name: confirmation_method + data_type: character varying + description: "Describes whether we can confirm this PaymentIntent automatically, or if it requires customer action to confirm the payment." + + - name: payment_method_types + data_type: jsonb + description: "The list of payment method types (e.g. card) that this PaymentIntent is allowed to use." + + - name: statement_descriptor + data_type: character varying + description: "For card charges, use statement_descriptor_suffix. Otherwise, you can use this value as the complete description of a charge on your customers’ statements. It must contain at least one letter and be 1–22 characters long." + + - name: statement_description + data_type: character varying + description: "{{ doc('field_docs_na_desc') }}" + + - name: application_fee_amount + data_type: bigint + description: "The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner’s Stripe account. The amount of the application fee collected will be capped at the total payment amount. For more information, see the PaymentIntents use case for connected accounts." + + - name: payment_method_options + data_type: jsonb + description: "Payment method-specific configuration for this PaymentIntent." + + - name: automatic_payment_methods + data_type: jsonb + description: "When you enable this parameter, this PaymentIntent accepts payment methods that you enable in the Dashboard and that are compatible with this PaymentIntent’s other parameters." + + - name: statement_descriptor_suffix + data_type: character varying + description: "Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. The concatenated descriptor must contain 1-22 characters." + + - name: payment_method_configuration_details + data_type: jsonb + description: "{{ doc('field_docs_na_desc') }}" + + - name: dwh_extracted_at_date + data_type: timestamp with time zone + description: "{{ doc('dwh_extracted_at_date_desc') }}"