

# 在 AWS Glue Studio 中连接到 Stripe
<a name="connecting-to-data-stripe"></a>

 Stripe 是一个面向企业的在线支付处理和信用卡处理平台。通过 Stripe 平台，企业可以接受在线支付，为其电子商务创建订阅（定期计费），并设置收款账户以接收付款。Stripe 还支持多方支付，允许企业设置自己的市场和收取款项，然后通过“已关联”账户向卖家或服务提供商付款。

**Topics**
+ [AWS Glue 对 Stripe 的支持](stripe-support.md)
+ [包含创建和使用连接的 API 操作的策略](stripe-configuring-iam-permissions.md)
+ [配置 Stripe](stripe-configuring.md)
+ [配置 Stripe 连接](stripe-configuring-connections.md)
+ [从 Stripe 实体中读取](stripe-reading-from-entities.md)
+ [Stripe 连接选项](stripe-connection-options.md)
+ [限制](stripe-limitations.md)
+ [创建新的 Stripe 账户并配置客户端应用程序](stripe-new-account-creation.md)

# AWS Glue 对 Stripe 的支持
<a name="stripe-support"></a>

AWS Glue 对 Stripe 的支持如下：

**是否支持作为来源？**  
是。您可以使用 AWS Glue ETL 作业查询 Stripe 中的数据。

**是否支持作为目标？**  
否。

**支持的 Slack API 版本**  
 v1。

# 包含创建和使用连接的 API 操作的策略
<a name="stripe-configuring-iam-permissions"></a>

 以下示例策略描述了创建和使用连接所需的 IAM 权限。如果您要创建新角色，请创建包含以下内容的策略：

------
#### [ JSON ]

****  

```
{
  "Version":"2012-10-17",		 	 	 
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "glue:ListConnectionTypes",
        "glue:DescribeConnectionType",
        "glue:RefreshOAuth2Tokens",
        "glue:ListEntities",
        "glue:DescribeEntity"
      ],
      "Resource": "*"
    }
  ]
}
```

------

您还可以使用以下托管 IAM 策略允许访问权限：
+  [AWSGlueServiceRole](https://console.aws.amazon.com/iam/home#policies/arn:aws:iam::aws:policy/service-role/AWSGlueServiceRole)：授予对各种 AWS Glue 进程代表您运行所需的资源的访问权限。这些资源包括 AWS Glue、Amazon S3、IAM、Amazon CloudWatch Logs 和 Amazon EC2。如果您遵循此策略中指定的资源的命名约定，则 AWS Glue 进程具有所需的权限。此策略通常附加到在定义爬网程序、作业和开发终端节点时指定的角色。
+  [AWSGlueConsoleFullAccess](https://console.aws.amazon.com/iam/home#policies/arn:aws:iam::aws:policy/AWSGlueConsoleFullAccess)：当策略所附加到的身份使用 AWS 管理控制台时，授予对 AWS Glue 资源的完全访问权限。如果遵循此策略中指定的资源的命名约定，则用户具有完全控制台功能。此策略通常附加到 AWS Glue 控制台的用户。

# 配置 Stripe
<a name="stripe-configuring"></a>

您必须满足以下要求，才能使用 AWS Glue 从 Stripe 传输数据：

## 最低要求
<a name="stripe-configuring-min-requirements"></a>
+  您必须拥有一个包含电子邮件和密码的 Stripe 账户。有关更多信息，请参阅 [创建新的 Stripe 账户并配置客户端应用程序](stripe-new-account-creation.md)。
+  您的 Stripe 账户已启用 API 访问权限。Stripe API 的所有使用均无需额外付费。

 如果您满足这些要求，就可以将 AWS Glue 连接到您的 Stripe 账户。

# 配置 Stripe 连接
<a name="stripe-configuring-connections"></a>

 Stripe 支持自定义身份验证。有关生成自定义授权所需 API 密钥的更多信息，请参阅 [STRIPE REST API 文档](https://docs.stripe.com/api/authentication)。

要配置 Stripe 连接：

1.  在 AWS Secrets Manager 中，创建一个包含以下详细信息的密钥。需要为 AWS Glue 中的每个连接创建一个密钥。

   1.  对于客户托管的关联应用程序：密钥应包含关联应用程序的消费者密钥，并将 `USER_MANAGED_CLIENT_APPLICATION_CLIENT_SECRET` 作为键。

1. 在 AWS Glue Glue Studio 中，按照以下步骤在**数据连接**下创建连接：

   1. 选择**连接类型**时，请选择 Stripe。

   1.  选择 AWS Glue 可以代入并有权执行以下操作的 IAM 角色：

------
#### [ JSON ]

****  

      ```
      {
        "Version":"2012-10-17",		 	 	 
        "Statement": [
          {
            "Effect": "Allow",
            "Action": [
              "secretsmanager:DescribeSecret",
              "secretsmanager:GetSecretValue",
              "secretsmanager:PutSecretValue",
              "ec2:CreateNetworkInterface",
              "ec2:DescribeNetworkInterfaces",
              "ec2:DeleteNetworkInterface"
            ],
            "Resource": "*"
          }
        ]
      }
      ```

------

   1.  在 AWS Glue 中选择您要用于此连接的 `secretName`，然后放置令牌。

   1.  如果要使用网络，请选择网络选项。

1.  向与您的 AWS Glue 作业关联的 IAM 角色授予读取 `secretName` 的权限。

# 从 Stripe 实体中读取
<a name="stripe-reading-from-entities"></a>

 **先决条件** 
+  您要从中读取内容的 Stripe 对象。

 **支持的实体** 


| 实体 | 可以筛选 | 支持限制 | 支持排序依据 | 支持 Select \$1 | 支持分区 | 
| --- | --- | --- | --- | --- | --- | 
| 余额 | 否 | 否 | 否 | 是 | 否 | 
| 余额交易 | 支持 | 是 | 否 | 是 | 是 | 
| 收费 | 支持 | 是 | 否 | 是 | 是 | 
| 争议 | 支持 | 是 | 否 | 是 | 是 | 
| 文件链接 | 支持 | 是 | 否 | 是 | 是 | 
| 付款意图 | 支持 | 是 | 否 | 是 | 是 | 
| 设置意图 | 支持 | 是 | 否 | 是 | 是 | 
| 支出 | 支持 | 是 | 否 | 是 | 是 | 
| 退款 | 支持 | 是 | 否 | 是 | 是 | 
| 产品 | 支持 | 是 | 否 | 是 | 是 | 
| 价格 | 支持 | 是 | 否 | 是 | 是 | 
| 优惠券 | 支持 | 是 | 否 | 是 | 是 | 
| 促销代码 | 支持 | 是 | 否 | 是 | 是 | 
| 税码 | 否 | 是 | 否 | 是 | 否 | 
| 税率 | 支持 | 是 | 否 | 是 | 是 | 
| 运费 | 支持 | 是 | 否 | 是 | 是 | 
| 会话 | 支持 | 是 | 否 | 是 | 是 | 
| 信用票据 | 支持 | 是 | 否 | 是 | 是 | 
| Customer | 支持 | 是 | 否 | 是 | 是 | 
| 账单 | 支持 | 是 | 否 | 是 | 是 | 
| 发票项目 | 支持 | 是 | 否 | 是 | 否 | 
| 计划 | 支持 | 是 | 否 | 是 | 是 | 
| 报价 | 支持 | 是 | 否 | 是 | 否 | 
| 订阅 | 支持 | 是 | 否 | 是 |  | 
| 订阅项目 | 否 | 是 | 否 | 是 | 否 | 
| 订阅计划 | 支持 | 是 | 否 | 是 | 是 | 
| 账户 | 否 | 是 | 否 | 是 | 是 | 
| 申请费 | 支持 | 是 | 否 | 是 | 是 | 
| 国家/地区具体要求 | 否 | 是 | 否 | 是 | 否 | 
| 转接 | 支持 | 是 | 否 | 是 | 是 | 
| 欺诈预警 | 支持 | 是 | 否 | 是 | 是 | 
| 报告类型 | 否 | 否 | 否 | 是 | 否 | 

 **示例** 

```
stripe_read = glueContext.create_dynamic_frame.from_options(
    connection_type="stripe",
    connection_options={
        "connectionName": "connectionName",
        "ENTITY_NAME": "coupons",
        "API_VERSION": "v1"
    }
)
```

 **Stripe 实体和字段详细信息** 


| 实体 | 字段 | 数据类型 | 支持的运算符 | 
| --- | --- | --- | --- | 
| 余额 |  |  |  | 
|  | available | 列表 |  | 
|  | connect\$1reserved | 列表 |  | 
|  | 待处理 | 列表 |  | 
|  | livemode | 布尔值 |  | 
|  | object | 字符串 |  | 
|  | instant\$1available | 列表 |  | 
|  | issuing | 结构体 |  | 
| 余额交易 |  |  |  | 
|  | id | 字符串 |  | 
|  | object | 字符串 |  | 
|  | 量 | 整数 |  | 
|  | available\$1on | 日期时间 | =, >=, <=,<,> | 
|  | created | 日期时间 | =, >=, <=,<,> | 
|  | currency | 字符串 |  | 
|  | description | 字符串 |  | 
|  | exchange\$1rate | BigDecimal |  | 
|  | fee | 整数 |  | 
|  | fee\$1details | 列表 |  | 
|  | net | 整数 |  | 
|  | reporting\$1category | 字符串 |  | 
|  | 源 | 字符串 | = | 
|  | 状态 | 字符串 |  | 
|  | type | 字符串 | = | 
|  | cross\$1border\$1classification | 字符串 |  | 
| 收费 |  |  |  | 
|  | id | 字符串 |  | 
|  | object | 字符串 |  | 
|  | 量 | 整数 | =, <, > | 
|  | amount\$1captured | 整数 |  | 
|  | amount\$1refunded | 整数 |  | 
|  | 应用程序 | 字符串 |  | 
|  | application\$1fee | 字符串 |  | 
|  | application\$1fee\$1amount | 整数 |  | 
|  | balance\$1transaction | 字符串 |  | 
|  | billing\$1details | 结构体 |  | 
|  | calculated\$1statement\$1descriptor | 字符串 |  | 
|  | captured | 布尔值 |  | 
|  | created | 日期时间 | =, >=, <=,<,> | 
|  | currency | 字符串 |  | 
|  | customer | 字符串 | = | 
|  | description | 字符串 |  | 
|  | destination | 字符串 |  | 
|  | dispute | 字符串 |  | 
|  | disputed | 布尔值 | = | 
|  | failure\$1balance\$1transaction | 字符串 |  | 
|  | failure\$1code | 字符串 |  | 
|  | failure\$1message | 字符串 |  | 
|  | fraud\$1details | 结构体 |  | 
|  | 发票 | 字符串 |  | 
|  | livemode | 布尔值 |  | 
|  | metadata | 结构体 |  | 
|  | on\$1behalf\$1of | 字符串 |  | 
|  | 顺序 | 字符串 |  | 
|  | outcome | 结构体 |  | 
|  | paid | 布尔值 |  | 
|  | payment\$1intent | 字符串 | = | 
|  | payment\$1method | 字符串 |  | 
|  | payment\$1method\$1details | 结构体 |  | 
|  | receipt\$1email | 字符串 |  | 
|  | receipt\$1number | 字符串 |  | 
|  | receipt\$1url | 字符串 |  | 
|  | refunded | 布尔值 | = | 
|  | 退款 | 结构体 |  | 
|  | 审核 | 字符串 |  | 
|  | shipping | 结构体 |  | 
|  | 源 | 结构体 |  | 
|  | source\$1transfer | 字符串 |  | 
|  | statement\$1descriptor | 字符串 |  | 
|  | statement\$1descriptor\$1suffix | 字符串 |  | 
|  | 状态 | 字符串 |  | 
|  | 转移 | 字符串 |  | 
|  | transfer\$1data | 结构体 |  | 
|  | transfer\$1group | 字符串 | = | 
| 争议 |  |  |  | 
|  | id | 字符串 |  | 
|  | object | 字符串 |  | 
|  | 量 | 整数 | =, <, > | 
|  | balance\$1transaction | 字符串 |  | 
|  | balance\$1transactions | 列表 |  | 
|  | 费用 | 字符串 | = | 
|  | created | 日期时间 | =, >=, <=,<,> | 
|  | currency | 字符串 |  | 
|  | evidence | 结构体 |  | 
|  | evidence\$1details | 结构体 |  | 
|  | is\$1charge\$1refundable | 布尔值 |  | 
|  | livemode | 布尔值 |  | 
|  | metadata | 结构体 |  | 
|  | payment\$1intent | 字符串 | = | 
|  | reason | 字符串 | = | 
|  | 状态 | 字符串 |  | 
|  | payment\$1method\$1details | 结构体 |  | 
| 文件链接 |  |  |  | 
|  | id | 字符串 |  | 
|  | object | 字符串 |  | 
|  | created | 日期时间 | =, >=, <=,<,> | 
|  | expired | 布尔值 | = | 
|  | expires\$1at | 日期时间 |  | 
|  | 文件 | 字符串 | = | 
|  | livemode | 布尔值 |  | 
|  | metadata | 结构体 |  | 
|  | url | 字符串 |  | 
| 付款意图 |  |  |  | 
|  | id | 字符串 |  | 
|  | object | 字符串 |  | 
|  | 量 | 整数 |  | 
|  | amount\$1capturable | 整数 |  | 
|  | amount\$1details | 结构体 |  | 
|  | amount\$1received | 整数 |  | 
|  | 应用程序 | 字符串 |  | 
|  | application\$1fee\$1amount | 整数 |  | 
|  | automatic\$1payment\$1methods | 结构体 |  | 
|  | canceled\$1at | 日期时间 |  | 
|  | cancellation\$1reason | 字符串 |  | 
|  | capture\$1method | 字符串 |  | 
|  | client\$1secret | 字符串 |  | 
|  | confirmation\$1method | 字符串 |  | 
|  | created | 日期时间 | =, >=, <=,<,> | 
|  | currency | 字符串 |  | 
|  | customer | 字符串 | = | 
|  | description | 字符串 |  | 
|  | 发票 | 字符串 |  | 
|  | last\$1payment\$1error | 结构体 |  | 
|  | latest\$1charge | 字符串 |  | 
|  | livemode | 布尔值 |  | 
|  | metadata | 结构体 |  | 
|  | next\$1action | 结构体 |  | 
|  | on\$1behalf\$1of | 字符串 |  | 
|  | payment\$1method | 字符串 |  | 
|  | payment\$1method\$1options | 结构体 |  | 
|  | payment\$1method\$1types | 列表 |  | 
|  | payment\$1method\$1configuration\$1details | 结构体 |  | 
|  | 处理 | 结构体 |  | 
|  | receipt\$1email | 字符串 |  | 
|  | 审核 | 字符串 |  | 
|  | setup\$1future\$1usage | 字符串 |  | 
|  | shipping | 结构体 |  | 
|  | 源 | 字符串 |  | 
|  | statement\$1descriptor | 字符串 |  | 
|  | statement\$1descriptor\$1suffix | 字符串 |  | 
|  | 状态 | 字符串 |  | 
|  | transfer\$1data | 结构体 |  | 
|  | transfer\$1group | 字符串 |  | 
| 设置意图 |  |  |  | 
|  | id | 字符串 |  | 
|  | object | 字符串 |  | 
|  | 应用程序 | 字符串 |  | 
|  | cancellation\$1reason | 字符串 |  | 
|  | client\$1secret | 字符串 |  | 
|  | created | 日期时间 | =, >=, <=,<,> | 
|  | customer | 字符串 | = | 
|  | description | 字符串 |  | 
|  | flow\$1directions | 列表 |  | 
|  | last\$1setup\$1error | 结构体 |  | 
|  | latest\$1attempt | 字符串 |  | 
|  | livemode | 布尔值 |  | 
|  | mandate | 字符串 |  | 
|  | metadata | 结构体 |  | 
|  | next\$1action | 结构体 |  | 
|  | on\$1behalf\$1of | 字符串 |  | 
|  | payment\$1method | 字符串 |  | 
|  | payment\$1method\$1options | 结构体 |  | 
|  | payment\$1method\$1types | 列表 |  | 
|  | single\$1use\$1mandate | 字符串 |  | 
|  | 状态 | 字符串 |  | 
|  | 使用情况 | 字符串 |  | 
|  | automatic\$1payment\$1methods | 结构体 |  | 
| 支出 |  |  |  | 
|  | id | 字符串 |  | 
|  | object | 字符串 |  | 
|  | 量 | 整数 | =, <, > | 
|  | arrival\$1date | 日期时间 | =, >=, <=,<,> | 
|  | automatic | 布尔值 |  | 
|  | balance\$1transaction | 字符串 |  | 
|  | created | 日期时间 | =, >=, <=,<,> | 
|  | currency | 字符串 |  | 
|  | description | 字符串 | = | 
|  | destination | 字符串 |  | 
|  | failure\$1balance\$1transaction | 字符串 |  | 
|  | failure\$1code | 字符串 |  | 
|  | failure\$1message | 字符串 |  | 
|  | livemode | 布尔值 |  | 
|  | metadata | 结构体 |  | 
|  | method | 字符串 |  | 
|  | original\$1payout | 字符串 |  | 
|  | reversed\$1by | 字符串 |  | 
|  | reconciliation\$1status | 字符串 |  | 
|  | source\$1type | 字符串 |  | 
|  | statement\$1descriptor | 字符串 |  | 
|  | 状态 | 字符串 |  | 
|  | type | 字符串 |  | 
|  | application\$1fee | 字符串 |  | 
|  | application\$1fee\$1amount | 整数 |  | 
| 退款 |  |  |  | 
|  | id | 字符串 |  | 
|  | object | 字符串 |  | 
|  | 量 | 整数 |  | 
|  | balance\$1transaction | 字符串 |  | 
|  | 费用 | 字符串 | = | 
|  | created | 日期时间 | =, >=, <=,<,> | 
|  | currency | 字符串 |  | 
|  | metadata | 结构体 |  | 
|  | destination\$1details | 结构体 |  | 
|  | payment\$1intent | 字符串 | = | 
|  | reason | 字符串 |  | 
|  | receipt\$1number | 字符串 |  | 
|  | source\$1transfer\$1reversal | 字符串 |  | 
|  | 状态 | 字符串 |  | 
|  | transfer\$1reversal | 字符串 |  | 
| 产品 |  |  |  | 
|  | id | 字符串 |  | 
|  | object | 字符串 |  | 
|  | active | 布尔值 | = | 
|  | 属性 | 列表 |  | 
|  | created | 日期时间 | =, >=, <=,<,> | 
|  | default\$1price | 字符串 |  | 
|  | description | 字符串 |  | 
|  | 映像 | 列表 |  | 
|  | livemode | 布尔值 |  | 
|  | metadata | 结构体 |  | 
|  | 名称 | 字符串 |  | 
|  | package\$1dimensions | 结构体 |  | 
|  | shippable | 布尔值 |  | 
|  | statement\$1descriptor | 字符串 |  | 
|  | tax\$1code | 字符串 |  | 
|  | type | 字符串 | = | 
|  | unit\$1label | 字符串 |  | 
|  | 已更新 | 日期时间 |  | 
|  | url | 字符串 |  | 
|  | 功能 | 列表 |  | 
| 价格 |  |  |  | 
|  | id | 字符串 |  | 
|  | object | 字符串 |  | 
|  | active | 布尔值 | = | 
|  | billing\$1scheme | 字符串 |  | 
|  | created | 日期时间 | =, >=, <=,<,> | 
|  | currency | 字符串 | = | 
|  | custom\$1unit\$1amount | 结构体 |  | 
|  | livemode | 布尔值 |  | 
|  | lookup\$1key | 字符串 |  | 
|  | metadata | 结构体 |  | 
|  | nickname | 字符串 |  | 
|  | 产品 | 字符串 | = | 
|  | recurring | 结构体 |  | 
|  | tax\$1behavior | 字符串 |  | 
|  | tiers\$1mode | 字符串 |  | 
|  | transform\$1quantity | 结构体 |  | 
|  | type | 字符串 | = | 
|  | unit\$1amount | 整数 |  | 
|  | unit\$1amount\$1decimal | 字符串 |  | 
| 优惠券 |  |  |  | 
|  | Id | 字符串 |  | 
|  | object | 字符串 |  | 
|  | amount\$1off | 整数 |  | 
|  | created | 日期时间 | =, >=, <=,<,> | 
|  | currency | 字符串 | = | 
|  | duration | 字符串 | = | 
|  | duration\$1in\$1months | 整数 | =,<,> | 
|  | livemode | 布尔值 |  | 
|  | max\$1redemptions | 整数 | =, <, > | 
|  | metadata | 结构体 |  | 
|  | 名称 | 字符串 |  | 
|  | percent\$1off | 双精度 | = | 
|  | redeem\$1by | 日期时间 | =, >=, <=, <, > | 
|  | times\$1redeemed | 整数 |  | 
|  | valid | 布尔值 |  | 
| 促销代码 |  |  |  | 
|  | Id | 字符串 |  | 
|  | object | 字符串 |  | 
|  | active | 布尔值 | = | 
|  | code | 字符串 | = | 
|  | coupon | 结构体 |  | 
|  | created | 日期时间 | =,>=,<=,<,> | 
|  | customer | 字符串 |  | 
|  | expires\$1at | 日期时间 |  | 
|  | livemode | 布尔值 |  | 
|  | max\$1redemptions | 整数 |  | 
|  | metadata | 结构体 |  | 
|  | 限额 | 结构体 |  | 
|  | times\$1redeemed | 整数 |  | 
| 税码 |  |  |  | 
|  | Id | 字符串 |  | 
|  | object | 字符串 |  | 
|  | description | 字符串 |  | 
|  | 名称 | 字符串 |  | 
| 税率 |  |  |  | 
|  | Id | 字符串 |  | 
|  | object | 字符串 |  | 
|  | active | 布尔值 | = | 
|  | country | 字符串 |  | 
|  | created | 日期时间 | =, >=, <=, <, > | 
|  | description | 字符串 |  | 
|  | display\$1name | 字符串 |  | 
|  | inclusive | 布尔值 | = | 
|  | jurisdiction | 字符串 |  | 
|  | jurisdiction\$1level | 字符串 |  | 
|  | livemode | 布尔值 |  | 
|  | metadata | 结构体 |  | 
|  | percentage | 双精度 |  | 
|  | effective\$1percentage | 双精度 |  | 
|  | 状态 | 字符串 |  | 
|  | tax\$1type | 字符串 |  | 
| 运费 |  |  |  | 
|  | Id | 字符串 |  | 
|  | object | 字符串 |  | 
|  | active | 布尔值 | = | 
|  | created | 日期时间 | =, >=, <=, <, > | 
|  | delivery\$1estimate | 结构体 |  | 
|  | display\$1name | 字符串 |  | 
|  | fixed\$1amount | 结构体 |  | 
|  | livemode | 布尔值 |  | 
|  | metadata | 结构体 |  | 
|  | tax\$1behavior | 字符串 |  | 
|  | tax\$1code | 字符串 |  | 
|  | type | 字符串 |  | 
| 会话 |  |  |  | 
|  | id | 字符串 |  | 
|  | object | 字符串 |  | 
|  | after\$1expiration | 结构体 |  | 
|  | allow\$1promotion\$1codes | 布尔值 |  | 
|  | amount\$1subtotal | 整数 |  | 
|  | amount\$1total | 整数 |  | 
|  | automatic\$1tax | 结构体 |  | 
|  | billing\$1address\$1collection | 字符串 |  | 
|  | cancel\$1url | 字符串 |  | 
|  | client\$1reference\$1id | 字符串 |  | 
|  | consent | 结构体 |  | 
|  | consent\$1collection | 结构体 |  | 
|  | created | 日期时间 | =, >=, <=, <, > | 
|  | currency | 字符串 |  | 
|  | custom\$1text | 结构体 |  | 
|  | customer | 字符串 |  | 
|  | customer\$1creation | 字符串 |  | 
|  | customer\$1details | 结构体 |  | 
|  | customer\$1email | 字符串 |  | 
|  | expires\$1at | 日期时间 |  | 
|  | 发票 | 字符串 |  | 
|  | invoice\$1creation | 结构体 |  | 
|  | livemode | 布尔值 |  | 
|  | locale | 字符串 |  | 
|  | metadata | 结构体 |  | 
|  | mode | 字符串 |  | 
|  | payment\$1intent | 字符串 | = | 
|  | payment\$1link | 字符串 |  | 
|  | payment\$1method\$1collection | 字符串 |  | 
|  | payment\$1method\$1options | 结构体 |  | 
|  | payment\$1method\$1types | 列表 |  | 
|  | payment\$1status | 字符串 |  | 
|  | phone\$1number\$1collection | 结构体 |  | 
|  | recovered\$1from | 字符串 |  | 
|  | setup\$1intent | 字符串 |  | 
|  | shipping\$1address\$1collection | 结构体 |  | 
|  | shipping\$1cost | 结构体 |  | 
|  | shipping\$1details | 结构体 |  | 
|  | shipping\$1options | 列表 |  | 
|  | 状态 | 字符串 |  | 
|  | submit\$1type | 字符串 |  | 
|  | 订阅 | 字符串 |  | 
|  | success\$1url | 字符串 |  | 
|  | tax\$1id\$1collection | 结构体 |  | 
|  | total\$1details | 结构体 |  | 
|  | url | 字符串 |  | 
|  | ui\$1mode | 字符串 |  | 
| 信用票据 |  |  |  | 
|  | id | 字符串 |  | 
|  | object | 字符串 |  | 
|  | 量 | 整数 |  | 
|  | created | 日期时间 | =, >=, <=, <, > | 
|  | currency | 字符串 |  | 
|  | customer | 字符串 | = | 
|  | customer\$1balance\$1transaction | 字符串 |  | 
|  | discount\$1amount | 整数 |  | 
|  | discount\$1amounts | 列表 |  | 
|  | 发票 | 字符串 | = | 
|  | lines | 结构体 |  | 
|  | livemode | 布尔值 |  | 
|  | memo | 字符串 |  | 
|  | metadata | 结构体 |  | 
|  | 数字 | 字符串 |  | 
|  | out\$1of\$1band\$1amount | 整数 |  | 
|  | pdf | 字符串 |  | 
|  | reason | 字符串 |  | 
|  | refund | 字符串 |  | 
|  | 状态 | 字符串 |  | 
|  | subtotal | 整数 |  | 
|  | subtotal\$1excluding\$1tax | 整数 |  | 
|  | tax\$1amounts | 列表 |  | 
|  | total | 整数 |  | 
|  | total\$1excluding\$1tax | 整数 |  | 
|  | type | 字符串 |  | 
|  | voided\$1at | 日期时间 |  | 
|  | amount\$1shipping | 整数 |  | 
|  | effective\$1at | 日期时间 |  | 
|  | shipping\$1cost | 结构体 |  | 
| Customer |  |  |  | 
|  | id | 字符串 |  | 
|  | object | 字符串 |  | 
|  | 地址 | 结构体 |  | 
|  | balance | 整数 |  | 
|  | created | 日期时间 |  | 
|  | currency | 字符串 | =, >=, <=, <, > | 
|  | default\$1source | 字符串 |  | 
|  | delinquent | 布尔值 | = | 
|  | description | 字符串 |  | 
|  | discount | 结构体 |  | 
|  | 电子邮件 | 字符串 | = | 
|  | invoice\$1prefix | 字符串 |  | 
|  | invoice\$1settings | 结构体 |  | 
|  | livemode | 布尔值 |  | 
|  | metadata | 结构体 |  | 
|  | 名称 | 字符串 |  | 
|  | next\$1invoice\$1sequence | 整数 |  | 
|  | phone | 字符串 |  | 
|  | preferred\$1locales | 列表 |  | 
|  | shipping | 结构体 |  | 
|  | tax\$1exempt | 字符串 |  | 
|  | test\$1clock | 字符串 |  | 
| 账单 |  |  |  | 
|  | id | 字符串 |  | 
|  | object | 字符串 |  | 
|  | account\$1country | 字符串 |  | 
|  | account\$1name | 字符串 |  | 
|  | account\$1tax\$1ids | 列表 |  | 
|  | amount\$1due | 整数 |  | 
|  | amount\$1paid | 整数 |  | 
|  | amount\$1remaining | 整数 |  | 
|  | 应用程序 | 字符串 |  | 
|  | application\$1fee\$1amount | 整数 |  | 
|  | attempt\$1count | 整数 |  | 
|  | attempted | 布尔值 | = | 
|  | auto\$1advance | 布尔值 | = | 
|  | automatic\$1tax | 结构体 |  | 
|  | billing\$1reason | 字符串 |  | 
|  | 费用 | 字符串 |  | 
|  | collection\$1method | 字符串 | = | 
|  | created | 日期时间 | =, >=, <=, <, > | 
|  | currency | 字符串 |  | 
|  | custom\$1fields | 列表 |  | 
|  | customer | 字符串 | = | 
|  | customer\$1address | 结构体 |  | 
|  | customer\$1email | 字符串 |  | 
|  | customer\$1name | 字符串 |  | 
|  | customer\$1phone | 字符串 |  | 
|  | customer\$1shipping | 结构体 |  | 
|  | customer\$1tax\$1exempt | 字符串 |  | 
|  | customer\$1tax\$1ids | 列表 |  | 
|  | default\$1payment\$1method | 字符串 |  | 
|  | default\$1source | 字符串 |  | 
|  | default\$1tax\$1rates | 列表 |  | 
|  | description | 字符串 |  | 
|  | discount | 结构体 |  | 
|  | discounts | 列表 |  | 
|  | due\$1date | 日期时间 | =, >=, <=, <, > | 
|  | ending\$1balance | 整数 |  | 
|  | footer | 字符串 |  | 
|  | from\$1invoice | 结构体 |  | 
|  | hosted\$1invoice\$1url | 字符串 |  | 
|  | invoice\$1pdf | 字符串 |  | 
|  | last\$1finalization\$1error | 结构体 |  | 
|  | latest\$1revision | 字符串 |  | 
|  | lines | 结构体 |  | 
|  | livemode | 布尔值 |  | 
|  | metadata | 结构体 |  | 
|  | next\$1payment\$1attempt | 日期时间 |  | 
|  | 数字 | 字符串 |  | 
|  | on\$1behalf\$1of | 字符串 |  | 
|  | paid | 布尔值 | = | 
|  | paid\$1out\$1of\$1band | 布尔值 |  | 
|  | payment\$1intent | 字符串 |  | 
|  | payment\$1settings | 结构体 |  | 
|  | period\$1end | 日期时间 | =, >=, <=, <, > | 
|  | period\$1start | 日期时间 | =, >=, <=, <, > | 
|  | post\$1payment\$1credit\$1notes\$1amount | 整数 |  | 
|  | pre\$1payment\$1credit\$1notes\$1amount | 整数 |  | 
|  | quote | 字符串 |  | 
|  | receipt\$1number | 字符串 |  | 
|  | rendering | 结构体 |  | 
|  | rendering\$1options | 结构体 |  | 
|  | starting\$1balance | 整数 |  | 
|  | statement\$1descriptor | 字符串 |  | 
|  | 状态 | 字符串 | = | 
|  | status\$1transitions | 结构体 |  | 
|  | 订阅 | 字符串 |  | 
|  | subscription\$1details | 结构体 |  | 
|  | subtotal | 整数 | =, <, > | 
|  | subtotal\$1excluding\$1tax | 整数 |  | 
|  | tax | 整数 |  | 
|  | test\$1clock | 字符串 |  | 
|  | total | 整数 | =, <, > | 
|  | total\$1discount\$1amounts | 列表 |  | 
|  | total\$1excluding\$1tax | 整数 |  | 
|  | total\$1tax\$1amounts | 列表 |  | 
|  | transfer\$1data | 结构体 |  | 
|  | webhooks\$1delivered\$1at | 日期时间 |  | 
|  | automatically\$1finalizes\$1at | 日期时间 |  | 
|  | effective\$1at | 日期时间 |  | 
|  | 发布者 | 结构体 |  | 
| 发票项目 |  |  |  | 
|  | id | 字符串 |  | 
|  | object | 字符串 |  | 
|  | 量 | 整数 | =, <, > | 
|  | currency | 字符串 |  | 
|  | customer | 字符串 | = | 
|  | date | 日期时间 |  | 
|  | description | 字符串 |  | 
|  | discountable | 布尔值 |  | 
|  | discounts | 列表 |  | 
|  | 发票 | 字符串 | = | 
|  | livemode | 布尔值 |  | 
|  | metadata | 结构体 |  | 
|  | 周期 | 结构体 |  | 
|  | 计划 | 结构体 |  | 
|  | 价格 | 结构体 |  | 
|  | proration | 布尔值 | = | 
|  | quantity | 整数 |  | 
|  | 订阅 | 字符串 |  | 
|  | subscription\$1item | 字符串 |  | 
|  | tax\$1rates | 列表 |  | 
|  | test\$1clock | 字符串 |  | 
|  | unit\$1amount | 整数 |  | 
|  | unit\$1amount\$1decimal | 字符串 |  | 
| 计划 |  |  |  | 
|  | id | 字符串 |  | 
|  | object | 字符串 |  | 
|  | active | 布尔值 | = | 
|  | aggregate\$1usage | 字符串 |  | 
|  | 量 | 整数 |  | 
|  | amount\$1decimal | 字符串 |  | 
|  | billing\$1scheme | 字符串 |  | 
|  | created | 日期时间 | =, >=, <=, <, > | 
|  | currency | 字符串 | = | 
|  | interval | 字符串 | = | 
|  | interval\$1count | 整数 |  | 
|  | livemode | 布尔值 |  | 
|  | metadata | 结构体 |  | 
|  | nickname | 字符串 |  | 
|  | 产品 | 字符串 | = | 
|  | tiers\$1mode | 字符串 |  | 
|  | transform\$1usage | 结构体 |  | 
|  | trial\$1period\$1days | 整数 | =, <, > | 
|  | usage\$1type | 字符串 |  | 
|  | 计量器 | 字符串 |  | 
| 报价 |  |  |  | 
|  | id | 字符串 |  | 
|  | object | 字符串 |  | 
|  | amount\$1subtotal | 整数 |  | 
|  | amount\$1total | 整数 |  | 
|  | 应用程序 | 字符串 |  | 
|  | application\$1fee\$1amount | 整数 |  | 
|  | application\$1fee\$1percent | 双精度 |  | 
|  | automatic\$1tax | 结构体 |  | 
|  | collection\$1method | 字符串 |  | 
|  | computed | 结构体 |  | 
|  | created | 日期时间 |  | 
|  | currency | 字符串 |  | 
|  | customer | 字符串 | = | 
|  | default\$1tax\$1rates | 列表 |  | 
|  | description | 字符串 |  | 
|  | discounts | 列表 |  | 
|  | expires\$1at | 日期时间 |  | 
|  | footer | 字符串 |  | 
|  | from\$1quote | 结构体 |  | 
|  | header | 字符串 |  | 
|  | 发票 | 字符串 |  | 
|  | invoice\$1settings | 结构体 |  | 
|  | livemode | 布尔值 |  | 
|  | metadata | 结构体 |  | 
|  | 数字 | 字符串 |  | 
|  | on\$1behalf\$1of | 字符串 |  | 
|  | 状态 | 字符串 | = | 
|  | status\$1transitions | 结构体 |  | 
|  | 订阅 | 字符串 |  | 
|  | subscription\$1data | 结构体 |  | 
|  | subscription\$1schedule | 字符串 |  | 
|  | test\$1clock | 字符串 |  | 
|  | total\$1details | 结构体 |  | 
|  | transfer\$1data | 结构体 |  | 
| 订阅 |  |  |  | 
|  | id | 字符串 |  | 
|  | object | 字符串 |  | 
|  | 应用程序 | 字符串 |  | 
|  | application\$1fee\$1percent | 双精度 |  | 
|  | automatic\$1tax | 结构体 |  | 
|  | billing\$1cycle\$1anchor | 日期时间 |  | 
|  | billing\$1thresholds | 结构体 |  | 
|  | cancel\$1at | 日期时间 |  | 
|  | cancel\$1at\$1period\$1end | 布尔值 |  | 
|  | canceled\$1at | 日期时间 |  | 
|  | collection\$1method | 字符串 | = | 
|  | created | 日期时间 | =, >=, <=,<,> | 
|  | currency | 字符串 |  | 
|  | current\$1period\$1end | 日期时间 | =, >=, <= | 
|  | current\$1period\$1start | 日期时间 | =, >=, <= | 
|  | customer | 字符串 | = | 
|  | days\$1until\$1due | 整数 |  | 
|  | default\$1payment\$1method | 字符串 |  | 
|  | default\$1source | 字符串 |  | 
|  | default\$1tax\$1rates | 列表 |  | 
|  | description | 字符串 |  | 
|  | discount | 结构体 |  | 
|  | ended\$1at | 日期时间 |  | 
|  | 物品 | 结构体 |  | 
|  | latest\$1invoice | 字符串 |  | 
|  | livemode | 布尔值 |  | 
|  | metadata | 结构体 |  | 
|  | next\$1pending\$1invoice\$1item\$1invoice | 日期时间 |  | 
|  | pause\$1collection | 结构体 |  | 
|  | payment\$1settings | 结构体 |  | 
|  | pending\$1invoice\$1item\$1interval | 结构体 |  | 
|  | pending\$1setup\$1intent | 字符串 |  | 
|  | pending\$1update | 结构体 |  | 
|  | 计划 | 结构体 |  | 
|  | quantity | 整数 |  | 
|  | schedule | 字符串 |  | 
|  | start\$1date | 日期时间 |  | 
|  | 状态 | 字符串 | = | 
|  | test\$1clock | 字符串 |  | 
|  | transfer\$1data | 结构体 |  | 
|  | trial\$1end | 日期时间 |  | 
|  | trial\$1start | 日期时间 |  | 
| 订阅项目 |  |  |  | 
|  | Id | 字符串 |  | 
|  | object | 字符串 |  | 
|  | billing\$1thresholds | 结构体 |  | 
|  | created | 日期时间 | =, >=, <=, <, > | 
|  | metadata | 结构体 |  | 
|  | 计划 | 结构体 |  | 
|  | 价格 | 结构体 |  | 
|  | 订阅 | 字符串 |  | 
|  | tax\$1rates | 列表 |  | 
|  | discounts | 列表 |  | 
| 订阅计划 |  |  |  | 
|  | object | 字符串 |  | 
|  | 应用程序 | 字符串 |  | 
|  | canceled\$1at | 日期时间 |  | 
|  | completed\$1at | 日期时间 |  | 
|  | created | 日期时间 |  | 
|  | current\$1phase | 结构体 |  | 
|  | customer | 字符串 | = | 
|  | default\$1settings | 结构体 |  | 
|  | end\$1behavior | 字符串 |  | 
|  | livemode | 布尔值 |  | 
|  | metadata | 结构体 |  | 
|  | phases | 列表 |  | 
|  | released\$1at | 日期时间 |  | 
|  | released\$1subscription | 字符串 |  | 
|  | renewal\$1interval | 字符串 |  | 
|  | 状态 | 字符串 |  | 
|  | 订阅 | 字符串 |  | 
|  | test\$1clock | 字符串 |  | 
| 账户 |  |  |  | 
|  | details\$1submitted | 布尔值 |  | 
|  | tos\$1acceptance | 结构体 |  | 
|  | type | 字符串 |  | 
|  | metadata | 结构体 |  | 
|  | id | 字符串 |  | 
|  | object | 字符串 |  | 
|  | default\$1currency | 字符串 |  | 
|  | 能力 | 结构体 |  | 
|  | charges\$1enabled | 布尔值 |  | 
|  | 设置 | 结构体 |  | 
|  | 要求 | 结构体 |  | 
|  | payouts\$1enabled | 布尔值 |  | 
|  | future\$1requirements | 结构体 |  | 
|  | external\$1accounts | 结构体 |  | 
|  | 控制器 | 结构体 |  | 
|  | country | 字符串 |  | 
|  | 电子邮件 | 字符串 |  | 
|  | created | 日期时间 | =, >=, <=, <, > | 
|  | business\$1profile | 结构体 |  | 
|  | business\$1type | 字符串 |  | 
|  | company | 结构体 |  | 
| 申请费 |  |  |  | 
|  | id | 字符串 |  | 
|  | object | 字符串 |  | 
|  | 账户 | 字符串 |  | 
|  | 量 | 整数 | =, <, > | 
|  | amount\$1refunded | 整数 | =, <, > | 
|  | 应用程序 | 字符串 |  | 
|  | balance\$1transaction | 字符串 |  | 
|  | 费用 | 字符串 | = | 
|  | created | 日期时间 |  | 
|  | currency | 字符串 |  | 
|  | livemode | 布尔值 |  | 
|  | originating\$1transaction | 字符串 |  | 
|  | refunded | 布尔值 | = | 
|  | 退款 | 结构体 |  | 
|  | fee\$1source | 结构体 |  | 
| 国家/地区具体要求 |  |  |  | 
|  | id | 字符串 |  | 
|  | object | 字符串 |  | 
|  | default\$1currency | 字符串 |  | 
|  | supported\$1bank\$1account\$1currencies | 结构体 |  | 
|  | supported\$1payment\$1currencies | 列表 |  | 
|  | supported\$1payment\$1methods | 列表 |  | 
|  | supported\$1transfer\$1countries | 列表 |  | 
|  | verification\$1fields | 结构体 |  | 
| 转接 |  |  |  | 
|  | id | 字符串 |  | 
|  | object | 字符串 |  | 
|  | 量 | 整数 | =, <, > | 
|  | amount\$1reversed | 整数 |  | 
|  | balance\$1transaction | 字符串 |  | 
|  | created | 日期时间 | =, >=, <=, <, > | 
|  | currency | 字符串 | = | 
|  | description | 字符串 |  | 
|  | destination | 字符串 | = | 
|  | destination\$1payment | 字符串 |  | 
|  | livemode | 布尔值 |  | 
|  | metadata | 结构体 |  | 
|  | reversals | 结构体 |  | 
|  | reversed | 布尔值 |  | 
|  | source\$1transaction | 字符串 |  | 
|  | source\$1type | 字符串 |  | 
|  | transfer\$1group | 字符串 | = | 
| 欺诈预警 |  |  |  | 
|  | id | 字符串 |  | 
|  | object | 字符串 |  | 
|  | actionable | 布尔值 |  | 
|  | 费用 | 字符串 | = | 
|  | created | 日期时间 | =, >=, <=, <, > | 
|  | fraud\$1type | 字符串 |  | 
|  | livemode | 布尔值 |  | 
|  | payment\$1intent | 字符串 | = | 
| 报告类型 |  |  |  | 
|  | id | 字符串 |  | 
|  | object | 字符串 |  | 
|  | data\$1available\$1end | 日期时间 |  | 
|  | data\$1available\$1start | 日期时间 |  | 
|  | default\$1columns | 列表 |  | 
|  | livemode | 布尔值 |  | 
|  | 名称 | 字符串 |  | 
|  | 已更新 | 日期时间 |  | 
|  | version | 整数 |  | 

 **对查询进行分区** 

 如果您想在 Spark 中利用并发，可以提供附加 Spark 选项 `PARTITION_FIELD`、`LOWER_BOUND`、`UPPER_BOUND` 和 `NUM_PARTITIONS`。使用这些参数，原始查询将被拆分为 `NUM_PARTITIONS` 个子查询，这些子查询可以由 Spark 任务同时执行。
+  `PARTITION_FIELD`：用于对查询进行分区的字段的名称。
+  `LOWER_BOUND`：所选分区字段的包含下限值。

   对于日期，我们接受 Spark SQL 查询中使用的 Spark 日期格式。有效值示例：`"2024-07-01T00:00:00.000Z"`。
+  `UPPER_BOUND`：所选分区字段的排除上限值。
+  `NUM_PARTITIONS`：分区的数量。

 基于实体的分区字段支持详细信息如下表中所示。


| 实体名称 | 分区字段 | 数据类型 | 
| --- | --- | --- | 
| 余额交易 | created | 日期时间 | 
| 收费 | created | 日期时间 | 
| 争议 | created | 日期时间 | 
| 文件链接 | created | 日期时间 | 
| 付款意图 | created | 日期时间 | 
| 设置意图 | created | 日期时间 | 
| 支出 | created | 日期时间 | 
| 退款 | created | 日期时间 | 
| 产品 | created | 日期时间 | 
| 价格 | created | 日期时间 | 
| 优惠券 | created | 日期时间 | 
| 促销代码 | created | 日期时间 | 
| 税率 | created | 日期时间 | 
| 运费 | created | 日期时间 | 
| 会话 | created | 日期时间 | 
| 信用票据 | created | 日期时间 | 
| Customer | created | 日期时间 | 
| 账单 | created | 日期时间 | 
| 计划 | created | 日期时间 | 
| 订阅 | created | 日期时间 | 
| 订阅计划 | created | 日期时间 | 
| 账户 | created | 日期时间 | 
| 申请费 | created | 日期时间 | 
| 转接 | created | 日期时间 | 
| 欺诈预警 | created | 日期时间 | 

 **示例** 

```
stripe_read = glueContext.create_dynamic_frame.from_options(
    connection_type="stripe",
    connection_options={
        "connectionName": "connectionName",
        "ENTITY_NAME": "coupons",
        "API_VERSION": "v1",
        "PARTITION_FIELD": "created"
        "LOWER_BOUND": "2024-05-01T20:55:02.000Z"
        "UPPER_BOUND": "2024-07-11T20:55:02.000Z"
        "NUM_PARTITIONS": "10"
    }
)
```

# Stripe 连接选项
<a name="stripe-connection-options"></a>

以下是 Stripe 的连接选项：
+  `ENTITY_NAME`（字符串）–（必填）用于读/写。Stripe 中对象的名称。
+  `API_VERSION`（字符串）–（必填）用于读/写。您想要使用的 Stripe Rest API 版本。示例：v1。
+  `SELECTED_FIELDS`（列表<字符串>）–默认：empty(SELECT \$1)。用于读取。您想要为对象选择的列。
+  `FILTER_PREDICATE`（字符串）– 默认：空。用于读取。应采用 Spark SQL 格式。
+  `QUERY`（字符串）– 默认：空。用于读取。完整的 Spark SQL 查询。
+  `PARTITION_FIELD`（字符串）– 用于读取。用于分区查询的字段。
+  `LOWER_BOUND`（字符串）– 用于读取。所选分区字段的包含下限值。
+  `UPPER_BOUND`（字符串）– 用于读取。所选分区字段的排除上限值。
+  `NUM_PARTITIONS`（整数）– 默认：1。用于读取。要读取的分区数。

# 限制
<a name="stripe-limitations"></a>

以下是 Stripe 连接器的限制：
+  连接器仅支持基于字段的分区。
+  连接器不支持基于记录的分区，也没有用于检索记录总数的预置。
+  主键数据类型为字符串，因此连接器不支持基于 ID 的分区。

# 创建新的 Stripe 账户并配置客户端应用程序
<a name="stripe-new-account-creation"></a>

**创建 Stripe 账户**

1. 选择链接 **https://dashboard.stripe.com/register**。

1. 输入您的电子邮件、全名、密码，然后选择**创建账户**。

1. 使用账户登录后，选择**打开 Gmail** 以验证该账户。

1. 单击电子邮件中收到的验证链接验证该账户。

1. 单击验证电子邮件地址后，将重定向到另一个页面

1. 单击**激活付款**激活该账户后，将重定向到激活付款（**https://dashboard.stripe.com/welcome**）页面，确保填写所有有效的详细信息，然后选择**继续**按钮。



**创建 Slack 开发者应用程序**

1. 登录 [Stripe](https://dashboard.stripe.com/login)。

1. 选择**开发者**，如下图最上方所示。

1. 在开发者下选择 **API 密钥**。

1. 选择**显示测试密钥**以获取 API 密钥。