{"id":36649907,"url":"https://github.com/steffen25/mobilepay-go","last_synced_at":"2026-01-12T10:04:21.506Z","repository":{"id":43737494,"uuid":"231950581","full_name":"steffen25/mobilepay-go","owner":"steffen25","description":"MobilePay API in Go","archived":false,"fork":false,"pushed_at":"2023-08-30T14:05:59.000Z","size":61,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-06-20T22:35:17.745Z","etag":null,"topics":["appswitch","go","hacktoberfest","mobilepay","mobilepay-api"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/steffen25.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-05T17:14:32.000Z","updated_at":"2023-09-15T10:49:04.000Z","dependencies_parsed_at":"2022-09-08T06:21:20.399Z","dependency_job_id":null,"html_url":"https://github.com/steffen25/mobilepay-go","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/steffen25/mobilepay-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steffen25%2Fmobilepay-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steffen25%2Fmobilepay-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steffen25%2Fmobilepay-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steffen25%2Fmobilepay-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/steffen25","download_url":"https://codeload.github.com/steffen25/mobilepay-go/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steffen25%2Fmobilepay-go/sbom","scorecard":{"id":850823,"data":{"date":"2025-08-11","repo":{"name":"github.com/steffen25/mobilepay-go","commit":"d7ef5ab41d19df2f8722f9ab1a8f8d188f392676"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":1,"reason":"Found 1/8 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/golangci-lint.yml:1","Warn: no topLevel permission defined: .github/workflows/test-suite.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/golangci-lint.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/steffen25/mobilepay-go/golangci-lint.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/golangci-lint.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/steffen25/mobilepay-go/golangci-lint.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-suite.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/steffen25/mobilepay-go/test-suite.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-suite.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/steffen25/mobilepay-go/test-suite.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-suite.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/steffen25/mobilepay-go/test-suite.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test-suite.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/steffen25/mobilepay-go/test-suite.yml/master?enable=pin","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":9,"reason":"1 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2022-0603 / GHSA-hp87-p4gw-j4gq"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 28 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-23T22:29:05.689Z","repository_id":43737494,"created_at":"2025-08-23T22:29:05.689Z","updated_at":"2025-08-23T22:29:05.689Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28337881,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T06:09:07.588Z","status":"ssl_error","status_checked_at":"2026-01-12T06:05:18.301Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["appswitch","go","hacktoberfest","mobilepay","mobilepay-api"],"created_at":"2026-01-12T10:04:21.396Z","updated_at":"2026-01-12T10:04:21.486Z","avatar_url":"https://github.com/steffen25.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mobilepay-go\n\nThe unofficial MobilePay Go client library.\n\n[![Build Status](https://github.com/steffen25/mobilepay-go/workflows/golangci-lint/badge.svg)](https://github.com/steffen25/mobilepay-go/actions?query=workflow%3Agolangci-lint)\n[![Test suite Status](https://github.com/steffen25/mobilepay-go/workflows/test-suite/badge.svg)](https://github.com/steffen25/mobilepay-go/actions?query=workflow%3Agolangci-lint)\n[![Go Report Card](https://goreportcard.com/badge/github.com/steffen25/mobilepay-go)](https://goreportcard.com/report/github.com/steffen25/mobilepay-go)\n[![GoDoc](http://img.shields.io/badge/godoc-reference-blue.svg)](http://godoc.org/github.com/steffen25/mobilepay-go)\n[![codecov](https://codecov.io/gh/steffen25/mobilepay-go/branch/master/graph/badge.svg)](https://codecov.io/gh/steffen25/mobilepay-go)\n\n## Installation\n```shell\n$ go get -u github.com/steffen25/mobilepay-go\n```\n\nThen, reference mobilepay-go in a Go program with `import`:\n\n``` go\nimport (\n    \"github.com/steffen25/mobilepay-go\"\n)\n```\n\n## Documentation\n\nBelow are a few simple examples:\n\n### Initialize a Mobilepay client\n\n```go\ncfg := \u0026mobilepay.Config{\n    HTTPClient: nil,\n    Logger:     nil,\n    URL:        mobilepay.DefaultBaseURL,\n}\n\nmp := mobilepay.New(\"client_id\", \"api_key\", cfg)\n```\nThe config properties allows you to use custom configured values if you would like.\nOtherwise the client will fall back to use a default value. \n\nE.g. you might want to use a HTTP client that automatically retries request if a server error occurs.\nhttps://github.com/hashicorp/go-retryablehttp\n\nThe library will default to the production base URL if not set.\nYou can use the constants defined by the mobilepay package if you would like to try out the sandbox environment (highly recommended).\nUse either the `mobilepay.DefaultBaseURL` or `mobilepay.TestBaseUrl`.\n\nAll the examples below will use the reference `mp` as a reference to the client.\n\n### Payments\n Get all payments\n\n```go\nopts := mobilepay.ListOptions{\n    PageSize:   10,\n    PageNumber: 1,\n}\n\nctx := context.TODO()\n\npayments, err := mp.Payment.Get(ctx, opts)\n```\n\nGet single payment details\n\n```go\nctx := context.TODO()\n\npayment, err := mp.Payment.Find(ctx, \"payment_id\")\n```\n\nCreate payment\n```go\nparams := \u0026mobilepay.PaymentParams{\n    Amount:         1050,\n    IdempotencyKey: \"223dbe4e-2d3b-4484-b870-6c86cff2c07b\",\n    PaymentPointId: \"8f8ed17f-f310-4f40-a7a4-df78185efbdd\",\n    RedirectUri:    \"myapp://redirect\",\n    Reference:      \"payment-1\",\n    Description:    \"test payment #1\",\n}\n\nctx := context.TODO()\n\npayment, err := mp.Payment.Create(ctx, params)\n```\n\nCapture payment\n```go\nctx := context.TODO()\n\nerr := mp.Payment.Capture(ctx, \"payment_id\", 1050)\n```\nThe amount is specified as an integer and is in cents which in danish terms is 'ører'.\n\nCancel payment\n```go\nctx := context.TODO()\n\nerr := mp.Payment.Cancel(ctx, \"payment_id\")\n```\n\nList payment refunds\n```go\nopts := \u0026mobilepay.RefundsListOptions{\n    ListOptions: mobilepay.ListOptions{\n        PageSize:   10,\n        PageNumber: 1,\n    },\n    PaymentId:      \"payment_id\",\n    PaymentPointId: \"payment_point_id\",\n    CreatedBefore:  \"2020-01-02T15:04\",\n    CreatedAfter:   \"2021-01-02T15:04\",\n}\n\nctx := context.TODO()\n\nerr := mp.Payment.Refunds(ctx, opts)\n```\n\nCreate payment refund\n```go\nparams := \u0026mobilepay.PaymentRefundParams{\n    PaymentId:      \"223dbe4e-2d3b-4484-b870-6c86cff2c07b\",\n    Amount:         550\n    IdempotencyKey: \"223dbe4e-2d3b-4484-b870-6c86cff2c07b\",\n    Reference:      \"payment-1\",\n    Description:    \"this is a test payment\",\n}\n\nctx := context.TODO()\n\nerr := mp.Payment.Refunds(ctx, params)\n```\n\n### Webhooks\n\nGet single webhook\n\n```go\nctx := context.TODO()\n\nwebhook, err := mp.Webhook.Find(ctx, \"webhook_id\")\n```\n\nGet all merchant's webhooks\n\n```go\nctx := context.TODO()\n\nwebhooks, err := mp.Webhook.Get(ctx)\n```\n\nCreate webhook\n\n```go\nctx := context.TODO()\n\n// configure these events to match your needs.\nevents := []mobilepay.WebhookEvent{\n    mobilepay.PaymentReserved.Name(),\n    mobilepay.PaymentExpired.Name(),\n}\n\n// change the base url accordingly\nparams := \u0026mobilepay.WebhookCreateParams{\n    Events: events,\n    Url:    \"https://my-api.com/webhooks\",\n}\n\nwebhook, err := mp.Webhook.Create(ctx, params)\n```\n\nUpdate webhook\n\n```go\nctx := context.TODO()\n\nevents := []mobilepay.WebhookEvent{\n    mobilepay.PaymentPointActivated.Name(),\n}\n\nparams := \u0026mobilepay.WebhookUpdateParams{\n    Events: events,\n    Url:    \"https://my-api.com/webhooks\",\n}\n\nwebhook, err := mp.Webhook.Update(ctx, \"webhook_id\", params)\n```\n\nDelete webhook\n\n```go\nctx := context.TODO()\n\nerr := mp.Webhook.Delete(ctx, \"webhook_id\")\n```\n\n### Verifying webhooks\nThis library comes with a built in webhook verifier that you can use ensure webhooks was sent by MobilePay.\n\nThe example below illustrates how you can verify incoming MobilePay webhooks using the standard library but this verifier could be used with any of the major router libraries out there.\n\n```go\nfunc main() {\n    mux := http.NewServeMux()\n    \n    successHandler := http.HandlerFunc(mobilepaySuccesHandler)\n    mux.Handle(\"/mobilepay/webhooks\", mobilepayWebhooks(successHandler, \"webhook_url\", \"webhook_signature_key\"))\n}\n\n// middleware to verify webhook was sent by MobilePay.\nfunc mobilepayWebhooks(next http.Handler, webhookUrl, webhookSignature string) http.Handler {\n    return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n        verifier, err := mobilepay.NewWebhooksVerifier(r.Header, webhookUrl, webhookSignature)\n        if err != nil {\n            // handle error\n        }\n        \n        body, err := ioutil.ReadAll(r.Body)\n        if err != nil {\n            w.WriteHeader(http.StatusInternalServerError)\n            return\n        }\n        \n        // rewind the body\n        r.Body = ioutil.NopCloser(bytes.NewBuffer(body))\n        \n        _, err = verifier.Write(body)\n        if err != nil {\n            // handle error\n        }\n        \n        err = verifier.Ensure()\n        if err != nil {\n            // could not verify mobilepay signature.\n            w.WriteHeader(http.StatusInternalServerError)\n            return\n        }\n        \n        // Signature is OK.\n        // Go to next handler in the call stack (mobilepaySuccesHandler)\n        next.ServeHTTP(w, r)\n    })\n}\n\nfunc mobilepaySuccesHandler(w http.ResponseWriter, r *http.Request) {\n    w.WriteHeader(http.StatusOK)\n    w.Write([]byte(\"Webhook OK\"))\n}\n```\n\n# Contributing\nYou are more than welcome to contribute to this project. Fork and make a Pull Request, or create an Issue if you see any problem.\n\n\n# MobilePay documentation\n- [Payments API Docs](https://mobilepaydev.github.io/MobilePay-Payments-API/docs/introduction)\n- [Webhooks API Docs](https://developer.mobilepay.dk/node/5121)\n\n# License\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteffen25%2Fmobilepay-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsteffen25%2Fmobilepay-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteffen25%2Fmobilepay-go/lists"}