update
This commit is contained in:
@@ -52,6 +52,29 @@ func (s *CheckoutPoolServer) KlarnaHtmlCheckoutHandler(w http.ResponseWriter, r
|
||||
|
||||
}
|
||||
|
||||
func (s *CheckoutPoolServer) KlarnaSessionHandler(w http.ResponseWriter, r *http.Request, checkoutId checkout.CheckoutId) error {
|
||||
|
||||
orderId := r.URL.Query().Get("order_id")
|
||||
var order *CheckoutOrder
|
||||
var err error
|
||||
if orderId == "" {
|
||||
order, err = s.CreateOrUpdateCheckout(r, checkoutId)
|
||||
if err != nil {
|
||||
logger.Error("unable to create klarna session", "error", err)
|
||||
return err
|
||||
}
|
||||
// s.ApplyKlarnaPaymentStarted(r.Context(), order, checkoutId)
|
||||
|
||||
}
|
||||
order, err = s.klarnaClient.GetOrder(r.Context(), orderId)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
w.Header().Set("Content-Type", "application/json; charset=utf-8")
|
||||
return json.NewEncoder(w).Encode(order)
|
||||
|
||||
}
|
||||
|
||||
func (s *CheckoutPoolServer) KlarnaConfirmationHandler(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
orderId := r.PathValue("order_id")
|
||||
|
||||
Reference in New Issue
Block a user