From b0121d86046070352e023c5fca4e0a3d097a6ce1 Mon Sep 17 00:00:00 2001 From: bbiggerr Date: Tue, 7 Sep 2021 13:47:03 -0400 Subject: [PATCH 1/4] Remove google_pay type from Payment Method Add --- openapi.yaml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/openapi.yaml b/openapi.yaml index 470323c4e..524c8747b 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -1720,7 +1720,16 @@ paths: - cvv properties: type: - $ref: '#/components/schemas/PaymentMethod/properties/type' + type: string + enum: + - credit_card + description: | + The type of Payment Method. + + Alternative Payment Methods including Google Pay can be added using Linode Cloud Manager. See our + guide on [Managing Billing in the Cloud Manager](/docs/guides/manage-billing-in-cloud-manager/) + for details and instructions. + example: 'credit_card' is_default: $ref: '#/components/schemas/PaymentMethod/properties/is_default' data: From beb7bb152e6159b6e57dff25d2807eb9941ef51a Mon Sep 17 00:00:00 2001 From: bbiggerr Date: Tue, 7 Sep 2021 13:56:33 -0400 Subject: [PATCH 2/4] Update CLI settings and commands --- openapi.yaml | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index 524c8747b..c2a210a2f 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -1632,7 +1632,7 @@ paths: --data-binary "/path/to/image" https://api.linode.com/v4/account/oauth-clients/edc6790ea9db4d224c5c/thumbnail /account/payment-methods: - x-linode-cli-command: account + x-linode-cli-command: payment-methods get: servers: - url: https://api.linode.com/v4 @@ -1647,7 +1647,7 @@ paths: description: | Returns a paginated list of Payment Methods for this Account. operationId: getPaymentMethods - x-linode-cli-action: payment-methods-list + x-linode-cli-action: list security: - personalAccessToken: [] - oauth: @@ -1679,7 +1679,7 @@ paths: https://api.linode.com/v4/account/payment-methods - lang: CLI source: > - linode-cli account payment-methods-list + linode-cli payment-methods list post: servers: - url: https://api.linode.com/v4 @@ -1696,8 +1696,7 @@ paths: Prior to adding a Payment Method, ensure that your billing address information is up-to-date with a valid `zip` by using the Account Update ([PUT /account](/docs/api/account/#account-update)) endpoint. operationId: createPaymentMethod - x-linode-cli-action: payment-method-add - x-linode-cli-skip: true + x-linode-cli-action: add security: - personalAccessToken: [] - oauth: @@ -1768,8 +1767,17 @@ paths: } }' \ https://api.linode.com/v4/account/payment-methods + - lang: CLI + source: > + linode-cli payment-methods add \ + --type credit_card \ + --is_default true \ + --data.card_number 4111111111111111 \ + --data.expiry_month 11 \ + --data.expiry_year 2020 \ + --data.cvv 111 /account/payment-methods/{paymentMethodId}: - x-linode-cli-command: account + x-linode-cli-command: payment-methods parameters: - name: paymentMethodId in: path @@ -1787,7 +1795,7 @@ paths: description: | View the details of the specified Payment Method. operationId: getPaymentMethod - x-linode-cli-action: payment-method-view + x-linode-cli-action: view security: - personalAccessToken: [] - oauth: @@ -1808,7 +1816,7 @@ paths: https://api.linode.com/v4/account/payment-methods/123 - lang: CLI source: > - linode-cli account payment-method-view 123 + linode-cli payment-methods view 123 delete: x-linode-grant: read_write tags: @@ -1823,7 +1831,7 @@ paths: ([POST /account/payment-methods/{paymentMethodId}/make-default](/docs/api/account/#payment-method-make-default)) endpoint. operationId: deletePaymentMethod - x-linode-cli-action: payment-method-delete + x-linode-cli-action: delete security: - personalAccessToken: [] - oauth: @@ -1845,9 +1853,9 @@ paths: https://api.linode.com/v4/account/payment-methods/123 - lang: CLI source: > - linode-cli account payment-method-delete 123 + linode-cli payment-methods delete 123 /account/payment-methods/{paymentMethodId}/make-default: - x-linode-cli-command: account + x-linode-cli-command: payment-methods parameters: - name: paymentMethodId in: path @@ -1867,7 +1875,7 @@ paths: Removes the default status from any other Payment Method. operationId: makePaymentMethodDefault - x-linode-cli-action: payment-method-make-default + x-linode-cli-action: default security: - personalAccessToken: [] - oauth: @@ -1889,7 +1897,7 @@ paths: https://api.linode.com/v4/account/payment-methods/123/make-default - lang: CLI source: > - linode-cli account payment-method-make-default 123 + linode-cli payment-methods default 123 /account/payments: x-linode-cli-command: account get: From 12375e075d677c2d085cfec3270bdea2bd16e6f7 Mon Sep 17 00:00:00 2001 From: bbiggerr Date: Tue, 7 Sep 2021 14:22:42 -0400 Subject: [PATCH 3/4] Update Payment Make endpoint --- openapi.yaml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index c2a210a2f..88650832c 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -1949,9 +1949,10 @@ paths: tags: - Account summary: Payment Make - description: > - Makes a Payment to your Account via credit card. This will charge your - credit card the requested amount. + description: | + Makes a Payment to your Account. + + The requested amount is charged to the default Payment Method if no `payment_method_id` is specified. operationId: createPayment x-linode-cli-action: payment-create security: @@ -1971,7 +1972,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Payment' + $ref: '#/components/schemas/Payment' '202': $ref: '#/components/responses/WarningResponse' default: @@ -1983,14 +1984,16 @@ paths: -H "Authorization: Bearer $TOKEN" \ -X POST -d '{ "cvv": "123", - "usd": "120.50" + "usd": "120.50", + "payment_method_id": 123 }' \ https://api.linode.com/v4/account/payments - lang: CLI source: > linode-cli account payment-create \ --cvv 123 \ - --usd 120.50 + --usd 120.50 \ + --payment_method_id 123 /account/payments/{paymentId}: x-linode-cli-command: account parameters: @@ -21080,6 +21083,11 @@ components: The amount in US Dollars of the Payment. The maximum credit card payment that can be made is $50,000 dollars. example: '120.50' + payment_method_id: + type: integer + description: > + The ID of the Payment Method to apply to the Payment. + example: 123 PayPal: type: object required: From 707bb496b09bc5b1b78dd594311b6d5d2e8b1da1 Mon Sep 17 00:00:00 2001 From: bbiggerr Date: Tue, 7 Sep 2021 14:36:35 -0400 Subject: [PATCH 4/4] Add events --- openapi.yaml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index 88650832c..71c31e248 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -1688,13 +1688,16 @@ paths: - Account summary: Payment Method Add description: | - Adds a Payment Method to your Account with the option to set it as the default method. Adding a default - Payment Method removes the default status from any other Payment Method. + Adds a Payment Method to your Account with the option to set it as the default method. - An Account can have up to 6 active Payment Methods. + * Adding a default Payment Method removes the default status from any other Payment Method. - Prior to adding a Payment Method, ensure that your billing address information is up-to-date + * An Account can have up to 6 active Payment Methods. + + * Prior to adding a Payment Method, ensure that your billing address information is up-to-date with a valid `zip` by using the Account Update ([PUT /account](/docs/api/account/#account-update)) endpoint. + + * A `payment_method_add` event is generated when a payment is successfully submitted. operationId: createPaymentMethod x-linode-cli-action: add security: @@ -1952,7 +1955,9 @@ paths: description: | Makes a Payment to your Account. - The requested amount is charged to the default Payment Method if no `payment_method_id` is specified. + * The requested amount is charged to the default Payment Method if no `payment_method_id` is specified. + + * A `payment_submitted` event is generated when a payment is successfully submitted. operationId: createPayment x-linode-cli-action: payment-create security: @@ -1968,7 +1973,7 @@ paths: $ref: '#/components/schemas/PaymentRequest' responses: '200': - description: Payment made. + description: Payment submitted successfully. content: application/json: schema: @@ -17016,6 +17021,7 @@ components: - oauth_client_secret_reset - oauth_client_update - password_reset + - payment_method_add - payment_submitted - profile_update - stackscript_create