more
This commit is contained in:
4
main.go
4
main.go
@@ -209,6 +209,9 @@ func main() {
|
|||||||
mux.HandleFunc("/checkout", func(w http.ResponseWriter, r *http.Request) {
|
mux.HandleFunc("/checkout", func(w http.ResponseWriter, r *http.Request) {
|
||||||
orderId := r.URL.Query().Get("order_id")
|
orderId := r.URL.Query().Get("order_id")
|
||||||
order := &CheckoutOrder{}
|
order := &CheckoutOrder{}
|
||||||
|
country := "se"
|
||||||
|
log.Printf("host: %s, referer: %s", r.Host, r.Referer())
|
||||||
|
log.Printf("Checkout for country %s, method: %s, order_id: %s", country, r.Method, orderId)
|
||||||
if orderId == "" {
|
if orderId == "" {
|
||||||
cookie, err := r.Cookie("cartid")
|
cookie, err := r.Cookie("cartid")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -230,6 +233,7 @@ func main() {
|
|||||||
Confirmation: fmt.Sprintf("%s/confirmation/{checkout.order.id}", baseUrl),
|
Confirmation: fmt.Sprintf("%s/confirmation/{checkout.order.id}", baseUrl),
|
||||||
Validation: fmt.Sprintf("%s/validation", cartBaseUrl),
|
Validation: fmt.Sprintf("%s/validation", cartBaseUrl),
|
||||||
Push: fmt.Sprintf("%s/push?order_id={checkout.order.id}", cartBaseUrl),
|
Push: fmt.Sprintf("%s/push?order_id={checkout.order.id}", cartBaseUrl),
|
||||||
|
Country: country,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -752,6 +752,7 @@ type CreateCheckoutOrder struct {
|
|||||||
Confirmation string `protobuf:"bytes,3,opt,name=confirmation,proto3" json:"confirmation,omitempty"`
|
Confirmation string `protobuf:"bytes,3,opt,name=confirmation,proto3" json:"confirmation,omitempty"`
|
||||||
Push string `protobuf:"bytes,4,opt,name=push,proto3" json:"push,omitempty"`
|
Push string `protobuf:"bytes,4,opt,name=push,proto3" json:"push,omitempty"`
|
||||||
Validation string `protobuf:"bytes,5,opt,name=validation,proto3" json:"validation,omitempty"`
|
Validation string `protobuf:"bytes,5,opt,name=validation,proto3" json:"validation,omitempty"`
|
||||||
|
Country string `protobuf:"bytes,6,opt,name=country,proto3" json:"country,omitempty"`
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
}
|
}
|
||||||
@@ -821,6 +822,13 @@ func (x *CreateCheckoutOrder) GetValidation() string {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (x *CreateCheckoutOrder) GetCountry() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Country
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
type OrderCreated struct {
|
type OrderCreated struct {
|
||||||
state protoimpl.MessageState `protogen:"open.v1"`
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
OrderId string `protobuf:"bytes,1,opt,name=orderId,proto3" json:"orderId,omitempty"`
|
OrderId string `protobuf:"bytes,1,opt,name=orderId,proto3" json:"orderId,omitempty"`
|
||||||
@@ -966,7 +974,7 @@ const file_messages_proto_rawDesc = "" +
|
|||||||
"\n" +
|
"\n" +
|
||||||
"\b_country\" \n" +
|
"\b_country\" \n" +
|
||||||
"\x0eRemoveDelivery\x12\x0e\n" +
|
"\x0eRemoveDelivery\x12\x0e\n" +
|
||||||
"\x02id\x18\x01 \x01(\x03R\x02id\"\x9f\x01\n" +
|
"\x02id\x18\x01 \x01(\x03R\x02id\"\xb9\x01\n" +
|
||||||
"\x13CreateCheckoutOrder\x12\x14\n" +
|
"\x13CreateCheckoutOrder\x12\x14\n" +
|
||||||
"\x05terms\x18\x01 \x01(\tR\x05terms\x12\x1a\n" +
|
"\x05terms\x18\x01 \x01(\tR\x05terms\x12\x1a\n" +
|
||||||
"\bcheckout\x18\x02 \x01(\tR\bcheckout\x12\"\n" +
|
"\bcheckout\x18\x02 \x01(\tR\bcheckout\x12\"\n" +
|
||||||
@@ -974,7 +982,8 @@ const file_messages_proto_rawDesc = "" +
|
|||||||
"\x04push\x18\x04 \x01(\tR\x04push\x12\x1e\n" +
|
"\x04push\x18\x04 \x01(\tR\x04push\x12\x1e\n" +
|
||||||
"\n" +
|
"\n" +
|
||||||
"validation\x18\x05 \x01(\tR\n" +
|
"validation\x18\x05 \x01(\tR\n" +
|
||||||
"validation\"@\n" +
|
"validation\x12\x18\n" +
|
||||||
|
"\acountry\x18\x06 \x01(\tR\acountry\"@\n" +
|
||||||
"\fOrderCreated\x12\x18\n" +
|
"\fOrderCreated\x12\x18\n" +
|
||||||
"\aorderId\x18\x01 \x01(\tR\aorderId\x12\x16\n" +
|
"\aorderId\x18\x01 \x01(\tR\aorderId\x12\x16\n" +
|
||||||
"\x06status\x18\x02 \x01(\tR\x06statusB\fZ\n" +
|
"\x06status\x18\x02 \x01(\tR\x06statusB\fZ\n" +
|
||||||
|
|||||||
Reference in New Issue
Block a user