{"id":16611406,"url":"https://github.com/shufo/payjp-elixir","last_synced_at":"2025-03-21T14:31:05.899Z","repository":{"id":17666473,"uuid":"82440935","full_name":"shufo/payjp-elixir","owner":"shufo","description":"An Elixir library for working with PAY.JP.","archived":false,"fork":false,"pushed_at":"2023-12-15T08:32:21.000Z","size":94,"stargazers_count":4,"open_issues_count":9,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-15T11:11:29.749Z","etag":null,"topics":["elixir","payment"],"latest_commit_sha":null,"homepage":"https://hex.pm/packages/payjp","language":"Elixir","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/shufo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-19T06:46:51.000Z","updated_at":"2021-01-03T10:12:51.000Z","dependencies_parsed_at":"2024-10-28T10:29:54.910Z","dependency_job_id":"f9acd0b8-fa4b-459b-9e5f-52403e1f8d24","html_url":"https://github.com/shufo/payjp-elixir","commit_stats":{"total_commits":27,"total_committers":2,"mean_commits":13.5,"dds":0.03703703703703709,"last_synced_commit":"01e9d9678a1a9bf9bc0850d7c848534ef22490fa"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shufo%2Fpayjp-elixir","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shufo%2Fpayjp-elixir/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shufo%2Fpayjp-elixir/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shufo%2Fpayjp-elixir/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shufo","download_url":"https://codeload.github.com/shufo/payjp-elixir/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244815125,"owners_count":20514894,"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":["elixir","payment"],"created_at":"2024-10-12T01:37:21.676Z","updated_at":"2025-03-21T14:31:05.596Z","avatar_url":"https://github.com/shufo.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PayJP for Elixir\n\n[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/shufo/payjp-elixir/CI)](https://github.com/shufo/payjp-elixir/actions?query=workflow%3ACI)\n[![Hex.pm](https://img.shields.io/hexpm/v/payjp.svg)](https://hex.pm/packages/payjp)\n[![Hex Docs](https://img.shields.io/badge/hex-docs-9768d1.svg)](https://hexdocs.pm/payjp)\n[![Coverage Status](https://coveralls.io/repos/github/shufo/payjp-elixir/badge.svg?branch=master)](https://coveralls.io/github/shufo/payjp-elixir?branch=master)\n\nAn Elixir library for working with [PAY.JP](https://pay.jp/).\n\nFeatures:\n\n* manage accounts (your own)\n* manage customers\n* manage subscriptions\n* manage plans\n* manage tokens for credit card\n* list and retrieve events\n* manage/capture charges with or without an existing Customer\n\n### TODO\n\n- [ ] Transfer\n- [ ] OAuth\n\n## Installation\n\nInstall the dependency:\n\n```elixir\ndef deps do\n  [{:payjp, \"~\u003e 0.1.0\"}]\nend\n```\n\nNext, add to your applications:\n\n```ex\ndefp application do\n  [applications: [:payjp]]\nend\n```\n\n## Configuration\n\nTo make API calls, it is necessary to configure your PAY.JP secret key.\n\n```elixir\nuse Mix.Config\n\nconfig :payjp, secret_key: \"YOUR SECRET KEY\"\n```\n\nor add secret key to the environment variables\n\n```bash\nexport PAYJP_SECRET_KEY=\"yourkey\"\n```\n\n## Usage\n\n### Token\n\n- create a token\n\n```elixir\nparams = [\n  card: [\n    number: \"4242424242424242\",\n    exp_month: 12,\n    exp_year: 2020,\n    cvc: \"123\"\n  ]\n]\n\nPayjp.Tokens.create(params)\n```\n\n### Customer\n\n- create a customer with default card\n\n```elixir\ncustomer = [\n  email: \"test@test.com\",\n  description: \"An Elixir Test Account\",\n  metadata: [\n    app_attr1: \"xyz\"\n  ],\n  card: [\n    number: \"4242424242424242\",\n    exp_month: 01,\n    exp_year: 2020,\n    cvc: 123,\n    name: \"Joe Test User\"\n  ]\n]\n\nPayjp.Customers.create(customer)\n```\n\n### Card\n\n- create a card for customer\n\n```elixir\nnew_card = [\n  number: \"4242424242424242\",\n  cvc: 123,\n  exp_month: 12,\n  exp_year: 2020\n]\n\nPayjp.Cards.create :customer, customer.id, new_card\n```\n\n### Charge\n\n- create a charge\n\nwith card information.\n\n```elixir\nparams = [\n  card: [\n    number: \"4242424242424242\",\n    exp_month: 12,\n    exp_year: 2020,\n    cvc: \"123\"\n  ]\n]\n\nPayjp.Charges.create(1000, params)\n```\n\nwith token\n\n```elixir\nparams = [\n  card: [\n    number: \"4242424242424242\",\n    exp_month: 12,\n    exp_year: 2020,\n    cvc: \"123\"\n  ]\n]\n\n{:ok, token} = Payjp.Tokens.create(params)\nPayjp.Charges.create(1000, card: token.id)\n```\n\nwith customer id\n\n```elixir\n{:ok, customer} = Payjp.Customers.create(customer)\nPayjp.Charges.create(1000, customer: customer.id)\n```\n\nmore usage is available at [Documentation](https://hexdocs.pm/payjp/)\n\n## Options\n\nYou can override the request configuration with HTTPoison options.\n\n`config.exs`\n\n```elixir\nconfig :payjp,\n  httpoison_options: [\n    timeout: 60000, # default: 30000\n    recv_timeout: 100000, # default: 80000\n  ]\n```\n\n## Testing\nIf you start contributing and you want to run mix test, first you need to export PAYJP_SECRET_KEY environment variable in the same shell as the one you will be running mix test in.\n\n```bash\nexport PAYJP_SECRET_KEY=\"yourkey\"\nmix test\n```\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshufo%2Fpayjp-elixir","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshufo%2Fpayjp-elixir","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshufo%2Fpayjp-elixir/lists"}