-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(customers_v2): address panics and some bugs in customers v2 …
…endpoints (#6836)
- Loading branch information
1 parent
588ce40
commit dfbfce4
Showing
56 changed files
with
906 additions
and
475 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
--- | ||
openapi: post /v2/customers | ||
--- | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
--- | ||
openapi: delete /v2/customers/{id} | ||
--- | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
--- | ||
openapi: get /v2/customers/list | ||
--- | ||
--- |
2 changes: 1 addition & 1 deletion
2
api-reference-v2/api-reference/customers/customers--retrieve.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
--- | ||
openapi: get /v2/customers/{id} | ||
--- | ||
--- |
4 changes: 2 additions & 2 deletions
4
api-reference-v2/api-reference/customers/customers--update.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
--- | ||
openapi: post /v2/customers/{id} | ||
--- | ||
openapi: put /v2/customers/{id} | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1712,7 +1712,7 @@ | |
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/CustomerRequest" | ||
"$ref": "#/components/schemas/CustomerUpdateRequest" | ||
}, | ||
"examples": { | ||
"Update name and email of a customer": { | ||
|
@@ -7253,13 +7253,20 @@ | |
"CustomerDeleteResponse": { | ||
"type": "object", | ||
"required": [ | ||
"id", | ||
"merchant_reference_id", | ||
"customer_deleted", | ||
"address_deleted", | ||
"payment_methods_deleted", | ||
"id" | ||
"payment_methods_deleted" | ||
], | ||
"properties": { | ||
"id": { | ||
"type": "string", | ||
"description": "Unique identifier for the customer", | ||
"example": "12345_cus_01926c58bc6e77c09e809964e72af8c8", | ||
"maxLength": 64, | ||
"minLength": 32 | ||
}, | ||
"merchant_reference_id": { | ||
"type": "string", | ||
"description": "The identifier for the customer object", | ||
|
@@ -7280,10 +7287,6 @@ | |
"type": "boolean", | ||
"description": "Whether payment methods deleted or not", | ||
"example": false | ||
}, | ||
"id": { | ||
"type": "string", | ||
"description": "Global id" | ||
} | ||
} | ||
}, | ||
|
@@ -7399,9 +7402,9 @@ | |
"customer_id": { | ||
"type": "string", | ||
"description": "The unique identifier of the customer.", | ||
"example": "cus_y3oqhf46pyzuxjbcn2giaqnb44", | ||
"example": "12345_cus_01926c58bc6e77c09e809964e72af8c8", | ||
"maxLength": 64, | ||
"minLength": 1 | ||
"minLength": 32 | ||
}, | ||
"payment_method_type": { | ||
"$ref": "#/components/schemas/PaymentMethod" | ||
|
@@ -7566,16 +7569,24 @@ | |
"description": "You can specify up to 50 keys, with key names up to 40 characters long and values up to 500\ncharacters long. Metadata is useful for storing additional, structured information on an\nobject.", | ||
"nullable": true | ||
} | ||
} | ||
}, | ||
"additionalProperties": false | ||
}, | ||
"CustomerResponse": { | ||
"type": "object", | ||
"required": [ | ||
"id", | ||
"merchant_reference_id", | ||
"created_at", | ||
"id" | ||
"created_at" | ||
], | ||
"properties": { | ||
"id": { | ||
"type": "string", | ||
"description": "Unique identifier for the customer", | ||
"example": "12345_cus_01926c58bc6e77c09e809964e72af8c8", | ||
"maxLength": 64, | ||
"minLength": 32 | ||
}, | ||
"merchant_reference_id": { | ||
"type": "string", | ||
"description": "The identifier for the customer object", | ||
|
@@ -7651,12 +7662,86 @@ | |
"example": "pm_djh2837dwduh890123", | ||
"nullable": true, | ||
"maxLength": 64 | ||
} | ||
} | ||
}, | ||
"CustomerUpdateRequest": { | ||
"type": "object", | ||
"required": [ | ||
"name", | ||
"email" | ||
], | ||
"properties": { | ||
"merchant_reference_id": { | ||
"type": "string", | ||
"description": "The merchant identifier for the customer object.", | ||
"example": "cus_y3oqhf46pyzuxjbcn2giaqnb44", | ||
"nullable": true, | ||
"maxLength": 64, | ||
"minLength": 1 | ||
}, | ||
"id": { | ||
"name": { | ||
"type": "string", | ||
"description": "The customer's name", | ||
"example": "Jon Test", | ||
"maxLength": 255 | ||
}, | ||
"email": { | ||
"type": "string", | ||
"description": "The customer's email address", | ||
"example": "[email protected]", | ||
"maxLength": 255 | ||
}, | ||
"phone": { | ||
"type": "string", | ||
"description": "The customer's phone number", | ||
"example": "9123456789", | ||
"nullable": true, | ||
"maxLength": 255 | ||
}, | ||
"description": { | ||
"type": "string", | ||
"description": "Global id" | ||
"description": "An arbitrary string that you can attach to a customer object.", | ||
"example": "First Customer", | ||
"nullable": true, | ||
"maxLength": 255 | ||
}, | ||
"phone_country_code": { | ||
"type": "string", | ||
"description": "The country code for the customer phone number", | ||
"example": "+65", | ||
"nullable": true, | ||
"maxLength": 255 | ||
}, | ||
"default_billing_address": { | ||
"allOf": [ | ||
{ | ||
"$ref": "#/components/schemas/AddressDetails" | ||
} | ||
], | ||
"nullable": true | ||
}, | ||
"default_shipping_address": { | ||
"allOf": [ | ||
{ | ||
"$ref": "#/components/schemas/AddressDetails" | ||
} | ||
], | ||
"nullable": true | ||
}, | ||
"metadata": { | ||
"type": "object", | ||
"description": "You can specify up to 50 keys, with key names up to 40 characters long and values up to 500\ncharacters long. Metadata is useful for storing additional, structured information on an\nobject.", | ||
"nullable": true | ||
}, | ||
"default_payment_method_id": { | ||
"type": "string", | ||
"description": "The unique identifier of the payment method", | ||
"example": "card_rGK4Vi5iSW70MY7J2mIg", | ||
"nullable": true | ||
} | ||
} | ||
}, | ||
"additionalProperties": false | ||
}, | ||
"DecoupledAuthenticationType": { | ||
"type": "string", | ||
|
@@ -13122,9 +13207,9 @@ | |
"customer_id": { | ||
"type": "string", | ||
"description": "The unique identifier of the customer.", | ||
"example": "cus_y3oqhf46pyzuxjbcn2giaqnb44", | ||
"example": "12345_cus_01926c58bc6e77c09e809964e72af8c8", | ||
"maxLength": 64, | ||
"minLength": 1 | ||
"minLength": 32 | ||
}, | ||
"payment_method_data": { | ||
"$ref": "#/components/schemas/PaymentMethodCreateData" | ||
|
@@ -13663,9 +13748,9 @@ | |
"customer_id": { | ||
"type": "string", | ||
"description": "The unique identifier of the customer.", | ||
"example": "cus_y3oqhf46pyzuxjbcn2giaqnb44", | ||
"example": "12345_cus_01926c58bc6e77c09e809964e72af8c8", | ||
"maxLength": 64, | ||
"minLength": 1 | ||
"minLength": 32 | ||
} | ||
}, | ||
"additionalProperties": false | ||
|
@@ -13854,6 +13939,7 @@ | |
"type": "object", | ||
"required": [ | ||
"merchant_id", | ||
"customer_id", | ||
"payment_method_id", | ||
"payment_method_type", | ||
"recurring_enabled" | ||
|
@@ -13867,10 +13953,9 @@ | |
"customer_id": { | ||
"type": "string", | ||
"description": "The unique identifier of the customer.", | ||
"example": "cus_y3oqhf46pyzuxjbcn2giaqnb44", | ||
"nullable": true, | ||
"example": "12345_cus_01926c58bc6e77c09e809964e72af8c8", | ||
"maxLength": 64, | ||
"minLength": 1 | ||
"minLength": 32 | ||
}, | ||
"payment_method_id": { | ||
"type": "string", | ||
|
@@ -14436,7 +14521,8 @@ | |
"PaymentsCreateIntentRequest": { | ||
"type": "object", | ||
"required": [ | ||
"amount_details" | ||
"amount_details", | ||
"customer_id" | ||
], | ||
"properties": { | ||
"amount_details": { | ||
|
@@ -14491,10 +14577,9 @@ | |
"customer_id": { | ||
"type": "string", | ||
"description": "The identifier for the customer", | ||
"example": "cus_y3oqhf46pyzuxjbcn2giaqnb44", | ||
"nullable": true, | ||
"example": "12345_cus_01926c58bc6e77c09e809964e72af8c8", | ||
"maxLength": 64, | ||
"minLength": 1 | ||
"minLength": 32 | ||
}, | ||
"customer_present": { | ||
"allOf": [ | ||
|
@@ -15328,6 +15413,7 @@ | |
"profile_id", | ||
"capture_method", | ||
"authentication_type", | ||
"customer_id", | ||
"customer_present", | ||
"setup_future_usage", | ||
"apply_mit_exemption", | ||
|
@@ -15399,10 +15485,9 @@ | |
"customer_id": { | ||
"type": "string", | ||
"description": "The identifier for the customer", | ||
"example": "cus_y3oqhf46pyzuxjbcn2giaqnb44", | ||
"nullable": true, | ||
"example": "12345_cus_01926c58bc6e77c09e809964e72af8c8", | ||
"maxLength": 64, | ||
"minLength": 1 | ||
"minLength": 32 | ||
}, | ||
"customer_present": { | ||
"$ref": "#/components/schemas/PresenceOfCustomerDuringPayment" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2266,7 +2266,7 @@ | |
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/CustomerRequest" | ||
"$ref": "#/components/schemas/CustomerUpdateRequest" | ||
}, | ||
"examples": { | ||
"Update name and email of a customer": { | ||
|
@@ -10036,6 +10036,60 @@ | |
} | ||
} | ||
}, | ||
"CustomerUpdateRequest": { | ||
"type": "object", | ||
"description": "The identifier for the customer object. If not provided the customer ID will be autogenerated.", | ||
"properties": { | ||
"name": { | ||
"type": "string", | ||
"description": "The customer's name", | ||
"example": "Jon Test", | ||
"nullable": true, | ||
"maxLength": 255 | ||
}, | ||
"email": { | ||
"type": "string", | ||
"description": "The customer's email address", | ||
"example": "[email protected]", | ||
"nullable": true, | ||
"maxLength": 255 | ||
}, | ||
"phone": { | ||
"type": "string", | ||
"description": "The customer's phone number", | ||
"example": "9123456789", | ||
"nullable": true, | ||
"maxLength": 255 | ||
}, | ||
"description": { | ||
"type": "string", | ||
"description": "An arbitrary string that you can attach to a customer object.", | ||
"example": "First Customer", | ||
"nullable": true, | ||
"maxLength": 255 | ||
}, | ||
"phone_country_code": { | ||
"type": "string", | ||
"description": "The country code for the customer phone number", | ||
"example": "+65", | ||
"nullable": true, | ||
"maxLength": 255 | ||
}, | ||
"address": { | ||
"allOf": [ | ||
{ | ||
"$ref": "#/components/schemas/AddressDetails" | ||
} | ||
], | ||
"nullable": true | ||
}, | ||
"metadata": { | ||
"type": "object", | ||
"description": "You can specify up to 50 keys, with key names up to 40 characters long and values up to 500\ncharacters long. Metadata is useful for storing additional, structured information on an\nobject.", | ||
"nullable": true | ||
} | ||
} | ||
}, | ||
"DecoupledAuthenticationType": { | ||
"type": "string", | ||
"enum": [ | ||
|
Oops, something went wrong.