{"id":29020279,"url":"https://github.com/webdna/commerce-affirm","last_synced_at":"2025-06-26T01:05:08.243Z","repository":{"id":62594683,"uuid":"555276961","full_name":"webdna/commerce-affirm","owner":"webdna","description":null,"archived":false,"fork":false,"pushed_at":"2024-05-16T12:29:24.000Z","size":36,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-24T22:03:24.372Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/webdna.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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":"2022-10-21T09:10:06.000Z","updated_at":"2024-05-16T12:29:14.000Z","dependencies_parsed_at":"2024-05-16T13:42:01.918Z","dependency_job_id":"8b6db6d4-c2ca-4514-a26e-604eddcd34a7","html_url":"https://github.com/webdna/commerce-affirm","commit_stats":{"total_commits":6,"total_committers":1,"mean_commits":6.0,"dds":0.0,"last_synced_commit":"f04b806aae41ede65ab96b028cea89d6d4155f2d"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/webdna/commerce-affirm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webdna%2Fcommerce-affirm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webdna%2Fcommerce-affirm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webdna%2Fcommerce-affirm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webdna%2Fcommerce-affirm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webdna","download_url":"https://codeload.github.com/webdna/commerce-affirm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webdna%2Fcommerce-affirm/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261978912,"owners_count":23239417,"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":"2025-06-26T01:05:00.454Z","updated_at":"2025-06-26T01:05:08.218Z","avatar_url":"https://github.com/webdna.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\u003cimg src=\"./src/icon.svg\" width=\"100\" height=\"100\" alt=\"icon\"\u003e\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003eAffirm for Craft Commerce\u003c/h1\u003e\n\n\n\n## Requirements\n\nThis plugin requests Craft 4.x and Craft Commerce 4.x\n\n## Installation\n\nYou can install this plugin from the Plugin Store or with Composer.\n\n#### From the Plugin Store\n\nGo to the Plugin Store in your project’s Control Panel and search for “Affirm”. Then click on the “Install” button in its modal window.\n\n#### With Composer\n\nOpen your terminal and run the following commands:\n\n```bash\n# go to the project directory\ncd /path/to/my-project\n\n# tell Composer to load the plugin\ncomposer require webdna/commerce-affirm\n\n# tell Craft to install the plugin\n./craft install/plugin commerce-affirm\n```\n\n## Setup\n\nTo add an Affirm payment gateway, go to Commerce → Settings → Gateways, create a new gateway.\n\nEnter the Public \u0026 Private API keys (environmental variable are recommended) and a product key if you have one.\n\n\n## Usage\n\nOn the payment page, use the getPaymentFormHtml method passing in a few parameters.\n\n```twig\n{% set params = {\n  cancelUrl: siteUrl('/shop/checkout/payment'),\n  confirmationUrl: siteUrl('/shop/checkout/order', {number: cart.number, success:'true'}),\n  mode: 'modal',\n} %}\n{% namespace cart.gateway.handle|commercePaymentFormNamespace %}\n\t{{ cart.gateway.getPaymentFormHtml(params)|raw }}\n{% endnamespace %}\n```\n\n### Parameters\n\n`automatic` : automatically launches the payment modal otherwise show a button to launch it. (default: 'true')\n\n`cancelUrl` : the url to return to if the process is cancelled. (only used in 'redirect' mode)\n\n`confirmationUrl` : the url to return to on a successful application. (only used in 'redirect' mode)\n\n`mode` : 'modal' or 'redirect' (default: 'modal')\n\n`showStatus` : show the status updates, processing etc. (default: false)\n\n#### Modal callbacks:\n\n`onFail`, `onSuccess`, `onOpen`, `onValidationError`\n\nif you pass in the `onSuccess` callback, you will need to handle setting the token input with the received `e.checkout_token` and submitting the form.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebdna%2Fcommerce-affirm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebdna%2Fcommerce-affirm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebdna%2Fcommerce-affirm/lists"}