We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I still got "URL not set" in webhooks section of Xendit dashboard.
Here's my code:
package main import ( "context" "encoding/json" "fmt" "log" "os" "github.com/google/uuid" "github.com/joho/godotenv" xendit "github.com/xendit/xendit-go/v4" "github.com/xendit/xendit-go/v4/payment_request" ) func main() { err := godotenv.Load() if err != nil { log.Fatal("Error loading .env file") } xenditApiKey := os.Getenv("XENDIT_API_KEY") xenditV4 := xendit.NewClient(xenditApiKey) /* QR Code creation V4 */ callbackURL := "https://<API_ENDPOINT>/qris/callback" var amount float64 = 3000 var orderID = "order-dijd0q8je0182ej" // idempotencyKey is important to prevent double request, enabling retry var idempotencyKey = fmt.Sprintf("qr-%s", uuid.New().String()) channelProperties := payment_request.PaymentRequestParametersChannelProperties{ SuccessReturnUrl: &callbackURL, } qrCode := payment_request.QRCodeParameters{ ChannelCode: *payment_request.NewNullableQRCodeChannelCode(payment_request.QRCODECHANNELCODE_DANA.Ptr()), } paymentMethod := payment_request.PaymentMethodParameters{ ReferenceId: &orderID, Type: payment_request.PAYMENTMETHODTYPE_QR_CODE, Reusability: payment_request.PAYMENTMETHODREUSABILITY_ONE_TIME_USE, QrCode: *payment_request.NewNullableQRCodeParameters(&qrCode), } paymentRequestParameters := payment_request.PaymentRequestParameters{ Amount: &amount, Currency: "IDR", PaymentMethod: &paymentMethod, ChannelProperties: &channelProperties, } createPRResp, _, createPRErr := xenditV4.PaymentRequestApi. CreatePaymentRequest(context.Background()). PaymentRequestParameters(paymentRequestParameters). IdempotencyKey(idempotencyKey). Execute() if createPRErr != nil { fmt.Fprintf(os.Stdout, "Create QR Payment Request Err`: %v\n", createPRErr) } else { fmt.Println(jsonStr(createPRResp)) // qrString := createPRResp.PaymentMethod.QrCode.Get().ChannelProperties.QrString // expiresAt := createPRResp.PaymentMethod.QrCode.Get().ChannelProperties.QrString } } func jsonStr(data any) string { j, _ := json.Marshal(data) return string(j) }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I still got "URL not set" in webhooks section of Xendit dashboard.
Here's my code:
The text was updated successfully, but these errors were encountered: