Skip to content
This repository has been archived by the owner on Jan 2, 2024. It is now read-only.

FR: UpdateOrganization as a part of the Client API #303

Open
davidjungermann opened this issue Jul 12, 2023 · 0 comments
Open

FR: UpdateOrganization as a part of the Client API #303

davidjungermann opened this issue Jul 12, 2023 · 0 comments
Labels
fr Feature request

Comments

@davidjungermann
Copy link

davidjungermann commented Jul 12, 2023

What are you trying to do?

I want to start a checkout, in order to save a PaymentMethod for a Customer in Stripe. I want to use the Stripe Tax API in order to automatically generate VAT for the price. This is an example of what I need to do, everything is written in Golang.

params := tier.CheckoutParams{
		RequireBillingAddress: true,
                Features: features,
		CancelURL: "http://localhost:3000/cancel",
		Tax: tier.Taxation{
			Automatic: true,
			CollectID: false,
		},
	}

url, err := client.Checkout(ctx, "org:" + organizationId, "http://localhost:3000/checkout", &params)

However, I'm getting this error:

local-db-tier-1  | tierDEBUG: 172.28.0.4:45528 POST tier:8081 /v1/checkout: checkout: stripe: req_xAVa3TLiqBgbf2 code:customer_tax_location_invalid type:invalid_request_error message:Automatic tax calculation in Checkout requires a valid address on the Customer. Add a valid address to the Customer or set either `customer_update[address]` to 'auto' or `customer_update[shipping]` to 'auto' to save the address entered in Checkout to the Customer.
local-db-app-1   | 2023/07/12 07:55:54 stdout: Error checking out: httpError{status:500 code:"internal_error" message:"Internal Server Error"}

After some digging, I have found that this works just fine, as long as the organizationId maps to an organization with a valid adress. This is entirely reasonable, but I want to be able to update this using Tier.

How should we solve this?

In the Node SDK, there's an updateOrg function, but that doesn't exist in the Go SDK. I dug through the source for both libraries, but couldn't figure out if there was an alternative way to do what I want to accomplish.

What is the impact of not solving this?

I could solve this by using the Stripe API to update a customer, but I'm using Tier to avoid having to deal with Stripe. It feels like I'm missing something, since the address update seems to be a prerequisite to the Taxation field, that's supported by the Go SDK.

Anything else?

I think Tier is a great initiative, and could be a great product moving forward! Thanks for that!

@davidjungermann davidjungermann added the fr Feature request label Jul 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
fr Feature request
Projects
None yet
Development

No branches or pull requests

1 participant