{"id":17918012,"url":"https://github.com/bogdanp/mobilpay","last_synced_at":"2026-01-16T00:46:19.503Z","repository":{"id":62424236,"uuid":"192900952","full_name":"Bogdanp/mobilpay","owner":"Bogdanp","description":"A barebones implementation of mobilay's credit card ordering interface in Racket.","archived":false,"fork":false,"pushed_at":"2022-12-18T09:17:59.000Z","size":8,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-02T00:34:27.118Z","etag":null,"topics":["mobilpay","payment","payment-gateway","racket"],"latest_commit_sha":null,"homepage":null,"language":"Racket","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Bogdanp.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":"2019-06-20T10:35:36.000Z","updated_at":"2024-11-20T03:45:20.000Z","dependencies_parsed_at":"2023-01-29T18:45:54.473Z","dependency_job_id":null,"html_url":"https://github.com/Bogdanp/mobilpay","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bogdanp%2Fmobilpay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bogdanp%2Fmobilpay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bogdanp%2Fmobilpay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bogdanp%2Fmobilpay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Bogdanp","download_url":"https://codeload.github.com/Bogdanp/mobilpay/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246961925,"owners_count":20861177,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["mobilpay","payment","payment-gateway","racket"],"created_at":"2024-10-28T20:09:25.853Z","updated_at":"2026-01-16T00:46:19.474Z","avatar_url":"https://github.com/Bogdanp.png","language":"Racket","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mobilpay\n\nA barebones implementation of [mobilpay]'s credit card ordering\ninterface in Racket.\n\n## Setup\n\n    raco pkg install mobilpay\n\n## Usage\n\nDownload the public certificate and your private key from the Mobilpay\ndashboard and then convert the certificate into a public key:\n\n    openssl x501 -noout -pubkey -in certificate.cer \u003e certificate.pub\n\nEnsure you have `libcrypto` in your `crypto-factories`:\n\n```racket\n(require crypto\n         crypto/libcrypto)\n\n(crypto-factories (list libcrypto-factory))\n```\n\nCreate a client instance:\n\n```racket\n(define mobilpay\n  (make-mobilpay #:signature \"example\"\n                 #:pubk-path \"/path/to/certificate.pub\"\n                 #:privk-path \"/path/to/private.key\"))\n```\n\nCreate an `xexpr?` representing an order:\n\n```racket\n(define order\n  (make-order mobilpay\n              #:order-id \"unique-id\"\n              #:currency 'RON\n              #:amount 1090 ;; in cents (i.e. this represents \"10.90 RON\")\n              #:description \"Payment for widgets\"\n              #:confirmation-url \"https://example.com/confirmation\"\n              #:return-url \"https://example.com/return\"))\n```\n\nEncrypt it:\n\n```racket\n(define-values (encrypted-order-data encrypted-shared-key)\n  (order-\u003edata mobilpay order))\n```\n\nSend the order to mobilpay:\n\n```html\n\u003cform action=\"(mobilpay-endpoint 'sandbox)\" method=\"POST\"\u003e\n  \u003cinput type=\"hidden\" name=\"data\" value=\"encrypted-data\"\u003e\n  \u003cinput type=\"hidden\" name=\"env_key\" value=\"encrypted-shared-key\"\u003e\n  \u003cbutton type=\"submit\"\u003ePay now\u003c/button\u003e\n\u003c/form\u003e\n```\n\nMobilpay will send you payment notifications to the\n`confirmation-url`.  You can decrypt and turn those into `xexpr?`\nvalues using `data-\u003eorder`:\n\n```racket\n(require xml/se-path)\n\n(define (confirmation-page req)\n  (define bindings (request-bindings req))\n  (define encrypted-order-data (binding:form-value (bindings-assq #\"data\" bindings)))\n  (define encrypted-shared-key (binding:form-value (bindings-assq #\"env_key\" bindings)))\n  (define order+mobilpay-data\n    (data-\u003eorder mobilpay encrypted-order-data encrypted-shared-key))\n\n  (displayln (se-path* '(mobilpay action) order+mobilpay-data))\n  (displayln (se-path* '(mobilpay error) order+mobilpay-data)))\n```\n\nYou will get multiple payment notifications per payment, each\nrepresenting an action that was taken.\n\n\n[mobilpay]: https://www.mobilpay.ro/public/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbogdanp%2Fmobilpay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbogdanp%2Fmobilpay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbogdanp%2Fmobilpay/lists"}