1
我有點困惑,因爲我的意圖是通過API網關將我的Lambda函數連接到Braintree的Webhooks。我知道webhooks通過api gateway和端點URL調用我的lambda函數,但我不確定如何設置我的lambda函數來正確處理這個問題,並使用webhooks在調用函數時將作爲參數傳遞的值。我有權利現在以下幾點:如何從webook通知中獲取參數到我的AWS Lambda函數中?
package com.amazonaws.lambda.submerchantapproved;
import java.util.HashMap;
import com.amazonaws.services.lambda.runtime.Context;
import com.amazonaws.services.lambda.runtime.RequestHandler;
import com.amazonaws.services.lambda.runtime.events.DynamodbEvent;
import com.braintreegateway.BraintreeGateway;
import com.braintreegateway.Environment;
import com.braintreegateway.WebhookNotification;
import com.braintreegateway.WebhookNotification.Kind;
public class SubmerchantApproved implements RequestHandler<Object, String> {
public String handleRequest(Object request, Context context) {
BraintreeGateway gateway = new BraintreeGateway(
Environment.SANDBOX,
"MyValue",
"MyValue",
"MyValue"
);
WebhookNotification webhookNotification = gateway.webhookNotification().parse(
request.queryParams("bt_signature"),
request.queryParams("bt_payload")
);
String woofer = "";
return woofer;
}
}
這不是工作或正確,雖然。我到底是如何將這些bt_signature和by_payload值放入我的lambda函數? webhooks通過相關的http-POST請求傳遞數據。
你是什麼意思「* bt_signature和by_payload值到我的lambda函數中?*」 – hagrawal