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.
![image](https://private-user-images.githubusercontent.com/65109548/302169251-05aa45a8-d4e3-45f7-bf5c-1522bc0ffb5e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQxNDc3NDAsIm5iZiI6MTcyNDE0NzQ0MCwicGF0aCI6Ii82NTEwOTU0OC8zMDIxNjkyNTEtMDVhYTQ1YTgtZDRlMy00NWY3LWJmNWMtMTUyMmJjMGZmYjVlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODIwVDA5NTA0MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTIxZjhhMTRhMzRhMTdjMzI4NTM1NzY5OWZiNGRhMDMyYjU1N2VmMTJkM2IwZmUzYzdhODUxYjY1ZWVlY2UxYjgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.bEWyBmFvJeoaGHMIDkcuaw0_MA-C2XnYopfuTGmFsTs)
Here's my code:
The text was updated successfully, but these errors were encountered: