diff --git a/examples/example.tf b/examples/example.tf index ec0607b..fb5d103 100644 --- a/examples/example.tf +++ b/examples/example.tf @@ -1,7 +1,7 @@ terraform { required_providers { dominos = { - source = "MNThomson/dominos" + source = "MNThomson/dominos" } } } @@ -11,13 +11,6 @@ provider "dominos" { last_name = "Name" email_address = "my@name.com" phone_number = "15555555555" - - credit_card = { - number = 123456789101112 - cvv = 1314 - date = "15/16" - postal_code = "18192" - } } data "dominos_address" "addr" { diff --git a/internal/provider/provider.go b/internal/provider/provider.go index 99217c3..8fbe9d2 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -37,19 +37,10 @@ type dominosProvider struct { } type providerData struct { - FirstName types.String `tfsdk:"first_name"` - LastName types.String `tfsdk:"last_name"` - EmailAddr types.String `tfsdk:"email_address"` - PhoneNumber types.String `tfsdk:"phone_number"` - CreditCard *creditCardData `tfsdk:"credit_card"` -} - -type creditCardData struct { - CreditCardNumber types.Int64 `tfsdk:"number"` - Cvv types.Int64 `tfsdk:"cvv"` - ExprDate types.String `tfsdk:"date"` - PostalCode types.String `tfsdk:"postal_code"` - CardType types.String `tfsdk:"card_type"` + FirstName types.String `tfsdk:"first_name"` + LastName types.String `tfsdk:"last_name"` + EmailAddr types.String `tfsdk:"email_address"` + PhoneNumber types.String `tfsdk:"phone_number"` } func (p *dominosProvider) Configure(ctx context.Context, req provider.ConfigureRequest, resp *provider.ConfigureResponse) { @@ -61,8 +52,6 @@ func (p *dominosProvider) Configure(ctx context.Context, req provider.ConfigureR return } - data.CreditCard.CardType = types.String{Value: string("VISA")} - p.providerdata = data p.configured = true } @@ -86,7 +75,6 @@ func (p *dominosProvider) GetSchema(ctx context.Context) (tfsdk.Schema, diag.Dia return tfsdk.Schema{ Description: ` The Dominos provider is used to interact with resources supported by Dominos Pizza. -The provider needs to be configured with a credit card for ordering. Use the navigation to the right to read about the available resources. `, @@ -111,38 +99,6 @@ Use the navigation to the right to read about the available resources. Required: true, Type: types.StringType, }, - "credit_card": { - Description: "Your actual credit card THAT WILL GET CHARGED.", - Optional: true, - Sensitive: true, - Attributes: tfsdk.SingleNestedAttributes(map[string]tfsdk.Attribute{ - "number": { - Description: "The credit card number.", - Type: types.Int64Type, - Required: true, - }, - "cvv": { - Description: "The credit card CVV.", - Type: types.Int64Type, - Required: true, - }, - "date": { - Description: "The credit card expiration date.", - Type: types.StringType, - Required: true, - }, - "postal_code": { - Description: "The postal code attached to the credit card.", - Type: types.StringType, - Required: true, - }, - "card_type": { - Description: "The credit card type. Default: 'VISA'.", - Type: types.StringType, - Optional: true, - }, - }), - }, }, }, nil }