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

wrong type on BCATransferDetail struct #1

Closed
harymindiar opened this issue May 16, 2017 · 1 comment
Closed

wrong type on BCATransferDetail struct #1

harymindiar opened this issue May 16, 2017 · 1 comment

Comments

@harymindiar
Copy link
Contributor

harymindiar commented May 16, 2017

Hi There,

i just saw the codes on https://github.com/veritrans/go-midtrans/blob/master/request.go#L77. seems there was incorrect type

type BCABankTransferDetail struct {
    Bank Bank `json:"bank"`
    VaNumber string `json:"va_number"`
    FreeText struct {
        Inquiry []BCABankTransferDetail `json:"inquiry"`
        Payment []BCABankTransferDetail `json:"payment"`
    } `json:"free_text"`
}

it should be using BCABankTransferLangDetail instead BCABankTransferDetail

type BCABankTransferDetail struct {
    Bank Bank `json:"bank"`
    VaNumber string `json:"va_number"`
    FreeText struct {
        Inquiry []BCABankTransferLangDetail `json:"inquiry"`
        Payment []BCABankTransferLangDetail `json:"payment"`
    } `json:"free_text"`
}

if i referred from doc the payload json should be like this

"bank_transfer":{
     "bank": "bca",
     "free_text": {
          "inquiry": [
                {
                    "id": "Free Text ID Free Text ID Free Text ID",
                    "en": "Free Text EN Free Text EN Free Text EN"
                }
          ],
          "payment": [
                {
                    "id": "Free Text ID Free Text ID Free Text ID",
                    "en": "Free Text EN Free Text EN Free Text EN"
                }
          ]
    }

also this one

type BCABankTransferLangDetail struct {
    LangID string `json:"id,omitempty"`
    LangEN string `json:"id,omitempty"`
}

the second annotation should be LangEN string json:"en,omitempty"

@rizdaprasetya
Copy link
Contributor

rizdaprasetya commented Jun 5, 2017

Hi, nice one 👍
Thanks for contributing!
Issue solved with above PR. I'll close the issue now

rizdaprasetya pushed a commit that referenced this issue Jul 10, 2018
Pull request from veritrans/go-midtrans master branch
rizdaprasetya pushed a commit that referenced this issue Mar 19, 2019
Merge pull request #26 from mychaelgo/master
rizdaprasetya pushed a commit that referenced this issue Jan 3, 2020
rizdaprasetya pushed a commit that referenced this issue Jan 13, 2020
…ject

Add snap request installment object
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants