Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STPLegalEntityParams phone number not updating with token #1313

Closed
Kevinw14 opened this issue Aug 22, 2019 · 7 comments
Closed

STPLegalEntityParams phone number not updating with token #1313

Kevinw14 opened this issue Aug 22, 2019 · 7 comments
Labels
triaged Issue has been reviewed by Stripe and is being tracked internally

Comments

@Kevinw14
Copy link

Summary

I'm creating custom connect account's. When I go to update the accounts with the verification information. Everything gets updated except for phone number. The code below is what I'm using, creating a token, and sending it to my backend to update the account. First name, last name, SSN, all the others update like they should just not the phone number.

Code to reproduce

let entityParams: STPLegalEntityParams = STPLegalEntityParams()
        
        entityParams.phoneNumber = "1234567890"

let accountParams = STPConnectAccountParams(legalEntity: entityParams)
        
        STPAPIClient.shared().createToken(withConnectAccount: accountParams) { (token, error) in
            if let error = error {
                print("ERROR: \(error.localizedDescription)")
                return
            }
            
            if let token = token {
                print("PHONE TOKEN: \(token)")
            }
        }

iOS version

iOS 12.4

Installation method

Cocoapods

SDK version

15.0.1

@yuki-stripe
Copy link
Collaborator

Hi @Kevinw14

I tried to repro this, and everything looks okay. The call to update the Connect Account failed because the phone number was invalid (as expected). Are you seeing an error when you call https://stripe.com/docs/api/accounts/update?

@Kevinw14
Copy link
Author

I didn't want to put my phone number on here so I just put that string of numbers in the example above as a placeholder for how I'm formatting the number. When I put in my actual phone number it gives me a token, and I send that token to the backend. It returns an account object like it should but never updates it. I don't get any errors anywhere.

stripe.accounts.update(body.accountID, {
    individual: {
      phone: body.phone
    }
  }, (err, account) => {

  })

I've used this to update it too and this will work, but just phone number token doesn't. Name, SSN, Address, and the other tokens work, just not phone number.

@yuki-stripe
Copy link
Collaborator

@Kevinw14 - Understood, this is super weird..could you send me the request id of the failing update call your backend is making? I think you can find it by going to https://dashboard.stripe.com/test/logs? (or https://dashboard.stripe.com/logs for livemode) and clicking on the relevant request. The ID looks like req_yy5Fz2ez8PIJ9K. It's also sent as request-id in the header of the API response.

One thought, does the API version your backend match the client's (2015-10-12)?

@Kevinw14
Copy link
Author

The backend API version is the latest one. I think 2019-08-14. I didn't realize that the client also had an API version.

I made two calls one changing the address & one changing the phone number

Address: req_aMRLo5Ls7sfdo9
Phone Number: ct_1FAhlZKAF1MayChZjfq4djLZ

It may be the mismatch of the API Versions. How do I update my client's API?

@yuki-stripe
Copy link
Collaborator

I have a PR to bump our API version that should go out next week #1254.

My last question is misleading though, sorry - a mismatch between client and backend should be okay. I thought we're exercising some edge case here, but I can't repro it on my end.

I'm able to update the phone number of a connect account by first generating a token on the client using your code if I also include entityParams.entityTypeString = "individual", and then using curl to hit the update account endpoint.

Instead of using your backend, I'm curious if this works if you try generating a token on your client and then updating via curl like:

curl -i https://api.stripe.com/v1/accounts/acct_YOUR_ACCOUNT \
                                  -u sk_YOUR_SECRET_KEY: \
                                  -d account_token=ct_CLIENT_GENERATED_TOKEN

Unfortunately I don't have any more ideas on this, and I don't think we're quite the right folks to help. I'd recommend emailing support@ with a link to this issue (feel free to cc me).

@yuki-stripe yuki-stripe added the triaged Issue has been reviewed by Stripe and is being tracked internally label Aug 23, 2019
@Kevinw14
Copy link
Author

Weird, I wasn't able to update it from the curl either. Maybe it's something on my end that's causing it not to update.

@davidme-stripe
Copy link
Contributor

I'd like to close this out for now to clean up our GitHub issues. If you're still hitting problems with the API, we'll be better equipped to help via the support@ channel.

ramont-stripe added a commit that referenced this issue Aug 15, 2022
* Add standalone Link controller

* Add link account context

* Use shared context for getting the current user account

* Make “Pay with Link” button self-updating

* Cleanup

* Cleanup

* Refactor Link confirm options

* Default to Link if logged in

* Update image

* Remove `selectionOnly` mode

* Add PM icon

* Remove unused protocol implementation

* Cleanup

* Extract Link confirm options

* Remove unused protocol method

* Rename method

* Rename controller

* Relocate button

* Cleanup

* Fix tests

* Remember last selected wallet payment method

* Cleanup

* Bump timeout to fix flaky test

* Refactor default payment method store

* Cleanup

* Remove wallet header

* Add Link to carousel

* Automatically select last used payment method

* Remove unused code

* Cleanup

* Update Link logo color

* Simplify conditionals

* Remove extra methods

* Cleanup

* Rename Apple Pay identifier

* Add UI test

* Fix tests

* Update carousel logo

* Use current traits explicitly when resolving color

* Cleanup

* More cleanup

* Save default payment method for anonymous customers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triaged Issue has been reviewed by Stripe and is being tracked internally
Projects
None yet
Development

No branches or pull requests

3 participants