{"id":15715809,"url":"https://github.com/gnapse/twocheckout","last_synced_at":"2025-03-30T20:18:32.948Z","repository":{"id":4392665,"uuid":"5529698","full_name":"gnapse/twocheckout","owner":"gnapse","description":"Ruby wrapper for 2Checkout API","archived":false,"fork":false,"pushed_at":"2013-01-04T16:49:39.000Z","size":125,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-05T23:01:07.315Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":false,"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/gnapse.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":"2012-08-23T17:15:45.000Z","updated_at":"2014-10-23T10:25:45.000Z","dependencies_parsed_at":"2022-09-21T15:13:01.967Z","dependency_job_id":null,"html_url":"https://github.com/gnapse/twocheckout","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/gnapse%2Ftwocheckout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnapse%2Ftwocheckout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnapse%2Ftwocheckout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnapse%2Ftwocheckout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gnapse","download_url":"https://codeload.github.com/gnapse/twocheckout/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246372743,"owners_count":20766635,"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":[],"created_at":"2024-10-03T21:43:09.056Z","updated_at":"2025-03-30T20:18:32.923Z","avatar_url":"https://github.com/gnapse.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Twocheckout\n\nThis gem aims at providing an ORM-like interface to access the [2Checkout API](https://www.2checkout.com/documentation/api/) from Ruby code.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'twocheckout'\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install twocheckout\n\n## Usage\n\nThe first step is to define your credentials to access the API:\n\n    Twcocheckout::API.credentials = { :username =\u003e 'api.user', :password =\u003e 'secret' }\n\nThen you can start making things like this:\n\n    sale = Twocheckout::Sale.find(:sale_id =\u003e '4769044324')\n    puts \"#{sale.sale_id} has #{sale.invoices.count} invoices\"\n\nYou can work on child objects too, like invoices and lineitems:\n\n    last_invoice = sale.invoices.last\n    specific_invoice = sale.invoice['4769044335']\n    puts \"Invoice #{last_invoice.invoice_id} has #{last_invoice.lineitems.count} lineitems...\"\n    puts \"...and #{last_invoice.active_lineitems.count} of them are active\"\n\nYou can perform actions on them too, not just query their attributes:\n\n    last_lineitem = last_invoice.lineitems.last\n    last_lineitem.refund!\n    sale.stop_recurring!\n\nSales and invoices are not everything. You can easily query the company info and contact details:\n\n    company = Twocheckout::Company.instance\n    contact_info = company.contact_info\n    puts \"Company: #{company.vendor_name}\"\n    puts \"City: #contact_info.mailing_city\"\n\nAnd this is just the beginning. We plan to provide an interface to every single 2Checkout API call available.\n\n### Direct API calls\n\nORM-like interfaces are not a panacea. Sometimes it may be more convenient to perform low-level API calls directly:\n\n    sales = Twocheckout::API.request(:get, 'sales/list_sales')\n    first_sale = sales['sale_summary'].first\n\nIn this case, the resulting object is a hash containing the parsed JSON response obtained from the call.\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 'Added some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgnapse%2Ftwocheckout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgnapse%2Ftwocheckout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgnapse%2Ftwocheckout/lists"}