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

Additional Document cannot sent with SDK #1833

Closed
youssefAndro opened this issue Jul 6, 2021 · 2 comments
Closed

Additional Document cannot sent with SDK #1833

youssefAndro opened this issue Jul 6, 2021 · 2 comments
Labels
triaged Issue has been reviewed by Stripe and is being tracked internally

Comments

@youssefAndro
Copy link

Summary

I tried to create a Token for an Individual Account, i filled all fields as well as "Document" and "AdditionalDocument".

When i call function "STPAPIClient.shared.createToken" i get "400 ERR" <<parameter_unknown - account[individual][verification][additionalDocument]>>

Code to reproduce

    let individualParam =  STPConnectAccountIndividualParams()
    individualParam.firstName = "firstName"
    individualParam.lastName = "lastName"
    individualParam.email = "email@gmail.com"
    individualParam.phone = "phone"
    individualParam.dateOfBirth = DateComponents(calendar: Calendar.current, year: 1990, month: 11,day: 10)

    individualParam.address = STPConnectAccountAddress()
    individualParam.address!.line1 = "address_line_1"
    individualParam.address!.city = "address_city"
    individualParam.address!.state = "address_state"
    individualParam.address!.country = "Fr"
    individualParam.address!.postalCode = "30000"

    var individualVerification = STPConnectAccountIndividualVerification()
    
    var verificationDoc = STPConnectAccountVerificationDocument()
    verificationDoc.front = "file_1J9tkXBeJFfQNTxxKS3NJacB"
    verificationDoc.back = "file_1J9tkeBeJFfQNTxxpV3sHQyk"
    individualVerification.document = verificationDoc
    
    var verificationAdditionalDoc = STPConnectAccountVerificationDocument()
    verificationAdditionalDoc.front = "file_xxxxxxxxxxxx"
    verificationAdditionalDoc.back = "file_xxxxxxxxxxxx"
    individualVerification.additionalDocument = verificationAdditionalDoc
    
    individualParam.verification = individualVerification
    
    let accountParams = STPConnectAccountParams(tosShownAndAccepted: true, individual: individualParam)

    STPAPIClient.shared.createToken(withConnectAccount: accountParams!) { (accountToken, error) in
                if let error = error {
                    // display an error to your user
                    DebugHelper.debug("Token error", error.localizedDescription)
                }else {
                    DebugHelper.debug("Token success", accountToken?.tokenId)
                }
       }

iOS version

iOS 14.1

Installation method

Cocoapods

SDK version

pod 'Stripe' , '~> 21.6.0'

Other information

This a preview of Request POST body in Stripe Log Dashboard

{
    "account": {
            "business_type": "individual",
            "individual": {
                    "address": {
                            "city": "city",
                            "country": "Fr",
                            "line1": "address_line_1",
                            "postal_code": "30000",
                            "state": "address_state"
                    },
                    "dob": {
                          "day": "**",
                          "month": "**",
                          "year": "****"
                    },
                    "email": "email@gmail.com",
                    "first_name": "first_name",
                    "last_name": "last_name",
                    "phone": "phone",
                    "verification": {
                          "additionalDocument": {
                                "back": "file_xxxxxxxxxxxx",
                                "front": "file_xxxxxxxxxxxx"
                          },
                          "document": {
                                "back": "file_xxxxxxxxxxxx",
                                "front": "file_xxxxxxxxxxxx"
                          }
                    }
             },
             "tos_shown_and_accepted": "true"
      }
}

This a response Body

{
  "error": {
    "code": "parameter_unknown",
    "doc_url": "https://stripe.com/docs/error-codes/parameter-unknown",
    "message": "Received unknown parameter: account[individual][verification][additionalDocument]. Did you mean additional_document?",
    "param": "account[individual][verification][additionalDocument]",
    "type": "invalid_request_error"
  }
}
@yuki-stripe
Copy link
Collaborator

@youssefAndro

Thank you for raising, we'll fix this in the next release.

@yuki-stripe yuki-stripe added the triaged Issue has been reviewed by Stripe and is being tracked internally label Jul 6, 2021
@davidme-stripe
Copy link
Contributor

We fixed this in version 21.7.0.

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