Spaces:
Paused
Paused
ML Intern deploy
Deploy httpSMS gateway to Hugging Face Spaces (Docker SDK): nginx :7860 -> Go API :8000, Nuxt SPA, Android APK, bootstrap-mode entrypoint
83a59ca Download api/pkg/requests/user_payment_invoice_request.go from red-kit/httpsms-gateway: direct link, hf CLI and curl.
- Browser
- Download file 1.95 kB
-
https://huggingface.co/spaces/red-kit/httpsms-gateway/resolve/6917738ca6db1603dee9e07994b4e42d5e1ae9b2/api/pkg/requests/user_payment_invoice_request.go
- Command line
-
hf download hf://spaces/red-kit/httpsms-gateway@6917738ca6db1603dee9e07994b4e42d5e1ae9b2/api/pkg/requests/user_payment_invoice_request.go
-
curl -L -o user_payment_invoice_request.go https://huggingface.co/spaces/red-kit/httpsms-gateway/resolve/6917738ca6db1603dee9e07994b4e42d5e1ae9b2/api/pkg/requests/user_payment_invoice_request.go
1.95 kB
| package requests | |
| import ( | |
| "github.com/NdoleStudio/httpsms/pkg/entities" | |
| "github.com/NdoleStudio/httpsms/pkg/services" | |
| ) | |
| // UserPaymentInvoice is the payload for generating a subscription payment invoice | |
| type UserPaymentInvoice struct { | |
| request | |
| Name string `json:"name" example:"Acme Corp"` | |
| Address string `json:"address" example:"221B Baker Street, London"` | |
| City string `json:"city" example:"Los Angeles"` | |
| State string `json:"state" example:"CA"` | |
| Country string `json:"country" example:"US"` | |
| ZipCode string `json:"zip_code" example:"9800"` | |
| Notes string `json:"notes" example:"Thank you for your business!"` | |
| SubscriptionInvoiceID string `json:"subscriptionInvoiceID" swaggerignore:"true"` // used internally for validation | |
| } | |
| // Sanitize sets defaults to MessageReceive | |
| func (input *UserPaymentInvoice) Sanitize() UserPaymentInvoice { | |
| input.Name = input.sanitizeAddress(input.Name) | |
| input.Address = input.sanitizeAddress(input.Address) | |
| input.City = input.sanitizeAddress(input.City) | |
| input.State = input.sanitizeAddress(input.State) | |
| input.Country = input.sanitizeAddress(input.Country) | |
| input.ZipCode = input.sanitizeAddress(input.ZipCode) | |
| input.Notes = input.sanitizeAddress(input.Notes) | |
| return *input | |
| } | |
| // UserInvoiceGenerateParams converts UserPaymentInvoice to services.UserInvoiceGenerateParams | |
| func (input *UserPaymentInvoice) UserInvoiceGenerateParams(userID entities.UserID) *services.UserInvoiceGenerateParams { | |
| return &services.UserInvoiceGenerateParams{ | |
| UserID: userID, | |
| SubscriptionInvoiceID: input.SubscriptionInvoiceID, | |
| Name: input.Name, | |
| Address: input.Address, | |
| City: input.City, | |
| State: input.State, | |
| Country: input.Country, | |
| Notes: input.Notes, | |
| ZipCode: input.ZipCode, | |
| } | |
| } | |