MCPcopy Create free account
hub / github.com/pace/bricks / Router

Function Router

http/jsonapi/generator/internal/pay/open-api_test.go:1124–1140  ·  view source on GitHub ↗

* Router implements: PACE Payment API Welcome to the PACE Payment API documentation. This API is responsible for managing payment methods for users as well as authorizing payments on behalf of PACE services. */

(service interface{}, authBackend AuthorizationBackend)

Source from the content-addressed store, hash-verified

1122This API is responsible for managing payment methods for users as well as authorizing payments on behalf of PACE services.
1123*/
1124func Router(service interface{}, authBackend AuthorizationBackend) *mux.Router {
1125 router := mux.NewRouter()
1126 authBackend.InitOAuth2(cfgOAuth2)
1127 authBackend.InitOpenID(cfgOpenID)
1128 authBackend.InitProfileKey(cfgProfileKey)
1129 // Subrouter s1 - Path: /pay
1130 s1 := router.PathPrefix("/pay").Subrouter()
1131 s1.Methods("DELETE").Path("/beta/payment-methods/{paymentMethodId}/paymentTokens/{paymentTokenId}").Name("DeletePaymentToken").Handler(DeletePaymentTokenHandlerWithFallbackHelper(service, router.NotFoundHandler, authBackend))
1132 s1.Methods("POST").Path("/beta/payment-methods/{paymentMethodId}/authorize").Name("AuthorizePaymentMethod").Handler(AuthorizePaymentMethodHandlerWithFallbackHelper(service, router.NotFoundHandler, authBackend))
1133 s1.Methods("POST").Path("/beta/payment-methods/sepa-direct-debit").Name("CreatePaymentMethodSEPA").Handler(CreatePaymentMethodSEPAHandlerWithFallbackHelper(service, router.NotFoundHandler, authBackend))
1134 s1.Methods("DELETE").Path("/beta/payment-methods/{paymentMethodId}").Name("DeletePaymentMethod").Handler(DeletePaymentMethodHandlerWithFallbackHelper(service, router.NotFoundHandler, authBackend))
1135 s1.Methods("POST").Path("/beta/transaction/{pathDecimal}").Name("ProcessPayment").Handler(ProcessPaymentHandlerWithFallbackHelper(service, router.NotFoundHandler, authBackend))
1136 s1.Methods("GET").Path("/beta/payment-methods").Queries("include", "creditCheck").Name("GetPaymentMethodsIncludingCreditCheck").Handler(GetPaymentMethodsIncludingCreditCheckHandlerWithFallbackHelper(service, router.NotFoundHandler, authBackend))
1137 s1.Methods("GET").Path("/beta/payment-methods").Queries("include", "paymentToken").Name("GetPaymentMethodsIncludingPaymentToken").Handler(GetPaymentMethodsIncludingPaymentTokenHandlerWithFallbackHelper(service, router.NotFoundHandler, authBackend))
1138 s1.Methods("GET").Path("/beta/payment-methods").Name("GetPaymentMethods").Handler(GetPaymentMethodsHandlerWithFallbackHelper(service, router.NotFoundHandler, authBackend))
1139 return router
1140}
1141
1142/*
1143Router implements: PACE Payment API

Callers 4

TestHandlerFunction · 0.70
TestHandlerDecimalFunction · 0.70
TestHandlerPanicFunction · 0.70
TestHandlerErrorFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…