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

Adyen Gateways resource creation issue #102

Closed
nbouchez opened this issue Sep 6, 2024 · 0 comments · Fixed by #103
Closed

Adyen Gateways resource creation issue #102

nbouchez opened this issue Sep 6, 2024 · 0 comments · Fixed by #103

Comments

@nbouchez
Copy link

nbouchez commented Sep 6, 2024

Hi,
get this error :
Error: json: cannot unmarshal number into Go struct field POSTAdyenGateways201ResponseDataAttributes.data.attributes.api_version of type string:

while creating a new adyen_gateway resource. I try with the example found in /resources/commercelayer_adyen_gateway/resource.tf

resource "commercelayer_adyen_gateway" "incentro_adyen_gateway" {
  attributes {
    name                    = "Incentro Adyen Gateway"
    merchant_account        = "xxxx-yyyy-zzzz"
    api_key                 = "xxxx-yyyy-zzzz"
    public_key              = "xxxx-yyyy-zzzz"
    live_url_prefix         = "1797a841fbb37ca7-AdyenDemo"
    api_version             = 68
    async_api               = true
    webhook_endpoint_secret = "foobar"
  }
}

in the https://data.commercelayer.app/schemas/openapi-no-ref.json
we have

"attributes": {
                            "type": "object",
                            "properties": {
                              "api_version": {
                                "type": "integer",
                                "description": "The checkout API version, supported range is from 66 to 71, default is 71.",
                                "example": 71,
                                "nullable": true
                              },

and in the commercelayer provider we have :

Attributes: commercelayer.POSTAdyenGateways201ResponseDataAttributes{
				Name:                  attributes["name"].(string),
				MerchantAccount:       attributes["merchant_account"].(string),
				ApiKey:                attributes["api_key"].(string),
				ApiVersion:            stringRef(attributes["api_version"]),
				AsyncApi:              boolRef(attributes["async_api"]),
				WebhookEndpointSecret: stringRef(attributes["webhook_endpoint_secret"]),
				PublicKey:             stringRef(attributes["public_key"]),
				LiveUrlPrefix:         attributes["live_url_prefix"].(string),
				Reference:             stringRef(attributes["reference"]),
				ReferenceOrigin:       stringRef(attributes["reference_origin"]),
				Metadata:              keyValueRef(attributes["metadata"]),
			},

Could it be linked ?

[edit]
the adyen_gateway resource is anyway created but the whole process stops and the next resources are not created...

@demeyerthom demeyerthom linked a pull request Sep 10, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant