Open jpedrofigueiredo opened 9 months ago
I put together the patch below to workaround this issue, for now.
Subject: [PATCH] Avoid panic
---
Index: paypal/resource_paypal_notification_webhook.go
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/paypal/resource_paypal_notification_webhook.go b/paypal/resource_paypal_notification_webhook.go
--- a/paypal/resource_paypal_notification_webhook.go (revision cbdb20677879863a07b196194f5cf14b86746183)
+++ b/paypal/resource_paypal_notification_webhook.go (date 1707750228332)
@@ -105,7 +105,7 @@
{
Operation: "replace",
Path: "/event_types",
- Value: r.eventTypeNamesToEventTypes(d.Get("event_types").([]string)),
+ Value: r.eventTypeNamesToEventTypes(toArrString(d.Get("event_types"))),
},
})
if err != nil {
@@ -134,6 +134,16 @@
return nil
}
+func toArrString(arr interface{}) []string {
+ inArr := arr.([]interface{})
+
+ var out []string
+ for _, v := range inArr {
+ out = append(out, v.(string))
+ }
+ return out
+}
+
// eventTypeNamesToEventTypes Convert the event_types object into an array of event type names
func (r WebhookResource) eventTypeNamesToEventTypes(eventTypeNames []string) []paypalSdk.WebhookEventType {
eventTypes := []paypalSdk.WebhookEventType{}
There's currently no binary for
darwin_arm64
so, I compiled it and copied the binary file to~/.terraform.d/plugins/registry.terraform.io/ollieparsley/paypal/0.0.2/darwin_arm64/terraform-provider-paypal_v0.0.2
.I'm using
go version go1.21.6 darwin/arm64
After this, the provider became visible to terraform and I was able to run
However, when trying to apply the changes, I got this error: