{"id":27722596,"url":"https://github.com/quardianwolf/paytr-react","last_synced_at":"2025-07-24T18:13:41.785Z","repository":{"id":230229740,"uuid":"778819703","full_name":"quardianwolf/paytr-react","owner":"quardianwolf","description":"The integration package for PAYTR payment system provider for React and other React frameworks.","archived":false,"fork":false,"pushed_at":"2024-03-29T18:31:19.000Z","size":38,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-27T09:14:09.120Z","etag":null,"topics":["payment","payment-integration","paytr","paytr-react","react","react-paytr"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/paytr-react","language":"TypeScript","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/quardianwolf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-03-28T13:22:49.000Z","updated_at":"2025-01-06T19:05:02.000Z","dependencies_parsed_at":"2024-03-28T15:04:21.199Z","dependency_job_id":"93722372-e18f-428e-916f-3a944968061f","html_url":"https://github.com/quardianwolf/paytr-react","commit_stats":null,"previous_names":["quardianwolf/paytr-react"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quardianwolf%2Fpaytr-react","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quardianwolf%2Fpaytr-react/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quardianwolf%2Fpaytr-react/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quardianwolf%2Fpaytr-react/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/quardianwolf","download_url":"https://codeload.github.com/quardianwolf/paytr-react/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251137095,"owners_count":21541668,"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":["payment","payment-integration","paytr","paytr-react","react","react-paytr"],"created_at":"2025-04-27T12:27:21.528Z","updated_at":"2025-04-27T12:27:22.182Z","avatar_url":"https://github.com/quardianwolf.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PAYTR REACT (with Frameworks) Integration\n\nThe integration package for \u003ca href=\"https://www.paytr.com/\" target=\"_blank\" rel=\"nofollow\"\u003ePAYTR\u003c/a\u003e payment system provider for React and other React frameworks.\n\nThis package supports both iframe API and direct API payment systems.\n\n# Getting started\n\n1- Install the paytr-react package using npm or yarn.\n\n2- Import paytr in to your code.\n\n    import { PayTRClient } from \"paytr-react\";\n\n3- Create a paytr client with your merchant environments.\n\n    (*** At this step, the values you enter will change depending on your choice between iframe API and direct API. Please check the documentation according to your preference and ensure variable substitution. Here, a variable has been used for direct API. ***)\n\n    const paytr = new PayTRClient({\n\n      merchant_id: \"YOURMERCHANTID\",\n      merchant_key: `YOURMERCHANTKEY`,\n      merchant_salt: `YOURMERCHANTSALT`,\n      debug_on: true,\n      no_installment: true,\n      max_installment: 0,\n      timeout_limit: 0,\n      test_mode: false,\n      non_3d: \"1\",\n      lang: \"tr\",\n\n    });\n\n4- # Step for generating payment token\n\n    4.1 - IframeApi\n\n        const response = await paytr.getToken({\n\n            merchant_oid: 'unique product id',\n            payment_amount: 1500, // integer value | Check paytr documents\n            currency: 'TL',\n            email: 'yourmail@address.com',\n            user_ip: '0.0.0.0',  // if you working in local using external ip | Check paytr documents\n            user_name: 'customer name',\n            user_phone: 'customer phone',\n            user_address: 'customer address',\n            user_basket: [\n            {\n            name: 'product name',\n            price: '1500', // interger value | Check paytr value\n            quantity: 1,\n            }\n            ],\n            merchant_ok_url: 'https://yourdomain/success',\n            merchant_fail_url: 'https://yourdomain/fail',\n\n        });\n\n\n        This code will automatically generate a hash for your basket content, create a token using merchant information, and post it to the PayTR iframe address and you will get response from paytr api when everything okay.\n\n\n        Response:  {token:XXXAAAXXXXXX}\n\n        In the final step, you can use the token received from the PayTR API either within an iframe or redirect the user to the page. For iframe examples, you can refer to the PayTR documentation.\n\n\n\n    4.2 DirectApi\n\n        const response = await paytr.directApi({\n\n            user_ip: \"0.0.0.0\", //your ip address\n            merchant_oid: \"unique product id\",\n            payment_amount: 1500, // integer | total price | check paytr documents\n            currency: \"TL\", //  you will check documents for the other options\n            email: \"customer email\",\n            payment_type: \"card\",\n            installment_count: 0,\n            cc_owner: \"card owner name\",\n            card_number: \"card number\",\n            expiry_month: \"expiration month\",\n            expiry_year: \"expiration year\"\n            cvv: \"card security code\",\n            user_name: \"customer name and surname\",\n            user_phone: \"customer phone\",\n            user_address: \"customer address\",\n             user_basket: [\n                            {\n                                name: 'product name',\n                                price: '1500', // interger value | Check paytr value\n                                quantity: 1,\n                            }\n                        ],\n            merchant_ok_url: \"http://localhost:3000/sepetim/odeme?success=1\", // customize the url\n            merchant_fail_url: \"http://localhost:3000/sepetim/odeme?success=0\", // customize the url\n\n        });\n\n\n        This code will automatically generate a hash for your basket content, create a token using merchant information, and post it to the PayTR directApi address and you will get response from paytr api when everything okay.\n\n        Response: some scripts\n\n        It will redirect you to the 3D secure page.\n\n\n\n# WARNING\n\nThis package is not affiliated with \" PayTR Ödeme ve Elektronik Para Kuruluşu A.Ş\" It has been developed voluntarily by a software developer.\n\nContact:https://github.com/quardianwolf\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquardianwolf%2Fpaytr-react","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fquardianwolf%2Fpaytr-react","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquardianwolf%2Fpaytr-react/lists"}