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

Commit

Permalink
Fixed issue where publishable_key wasn't being sent to Commerce Layer (
Browse files Browse the repository at this point in the history
  • Loading branch information
ederoyd46 authored May 5, 2023
1 parent f452da6 commit 079c3f6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 2 additions & 0 deletions commercelayer/resource_stripe_gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package commercelayer

import (
"context"

"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
commercelayer "github.com/incentro-dc/go-commercelayer-sdk/api"
Expand Down Expand Up @@ -114,6 +115,7 @@ func resourceStripeGatewayCreateFunc(ctx context.Context, d *schema.ResourceData
Attributes: commercelayer.POSTStripeGateways201ResponseDataAttributes{
Name: attributes["name"].(string),
Login: attributes["login"].(string),
PublishableKey: stringRef(attributes["publishable_key"]),
Reference: stringRef(attributes["reference"]),
ReferenceOrigin: stringRef(attributes["reference_origin"]),
Metadata: keyValueRef(attributes["metadata"]),
Expand Down
11 changes: 7 additions & 4 deletions commercelayer/resource_stripe_gateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package commercelayer
import (
"context"
"fmt"

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
commercelayer "github.com/incentro-dc/go-commercelayer-sdk/api"
Expand Down Expand Up @@ -62,8 +63,9 @@ func testAccStripeGatewayCreate(testName string) string {
return hclTemplate(`
resource "commercelayer_stripe_gateway" "incentro_stripe_gateway" {
attributes {
name = "Incentro Stripe Gateway"
login = "xxxx-yyyy-zzzz"
name = "Incentro Stripe Gateway"
login = "xxxx-yyyy-zzzz"
publishable_key = "aaaa-bbbb-cccc"
metadata = {
foo: "bar"
Expand All @@ -78,8 +80,9 @@ func testAccStripeGatewayUpdate(testName string) string {
return hclTemplate(`
resource "commercelayer_stripe_gateway" "incentro_stripe_gateway" {
attributes {
name = "Incentro Stripe Gateway Changed"
login = "xxxx-yyyy-zzzz"
name = "Incentro Stripe Gateway Changed"
login = "xxxx-yyyy-zzzz"
publishable_key = "aaaa-bbbb-cccc"
metadata = {
bar: "foo"
Expand Down

0 comments on commit 079c3f6

Please sign in to comment.