From 2e83e4949261c694277d943745c2d594af9f7671 Mon Sep 17 00:00:00 2001 From: Cutsin Date: Sat, 8 Feb 2025 19:35:51 +0800 Subject: [PATCH] feat: fix bug due to null characters in descriptor when creating a payment intent (#3567) --- pp/airwallex.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pp/airwallex.go b/pp/airwallex.go index 6a98ca3c..45ea3f6c 100644 --- a/pp/airwallex.go +++ b/pp/airwallex.go @@ -203,7 +203,7 @@ func (c *AirwallexClient) CreateIntent(r *PayReq) (*AirWallexIntentResp, error) "amount": r.Price, "merchant_order_id": orderId, "request_id": orderId, - "descriptor": string([]rune(description)[:32]), // display to the customer. + "descriptor": strings.ReplaceAll(string([]rune(description)[:32]), "\x00", ""), "metadata": map[string]interface{}{"description": description}, "order": map[string]interface{}{"products": []map[string]interface{}{{"name": r.ProductDisplayName, "quantity": 1, "desc": r.ProductDescription, "image_url": r.ProductImage}}}, "customer": map[string]interface{}{"merchant_customer_id": r.PayerId, "email": r.PayerEmail, "first_name": r.PayerName, "last_name": r.PayerName},