{"id":13463814,"url":"https://github.com/fawry-api/fawry","last_synced_at":"2026-01-16T15:13:39.166Z","repository":{"id":47741076,"uuid":"219041952","full_name":"fawry-api/fawry","owner":"fawry-api","description":"A plug-and-play library to interface with Fawry's payment gateway API (charge, refund, payment status, card payment, service callback v2) - (مكتبة بسيطة للتواصل مع شبكة خدمات الدفع الإلكتروني فوري (دفع٬ استرجاع٬ حالة الدفع٬ دفع بالكارت، رد السيرفر","archived":false,"fork":false,"pushed_at":"2025-09-17T18:48:50.000Z","size":158,"stargazers_count":67,"open_issues_count":0,"forks_count":11,"subscribers_count":8,"default_branch":"main","last_synced_at":"2026-01-14T10:43:13.758Z","etag":null,"topics":["api","egypt","fawry","hacktoberfest","payment","payment-gateway","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/fawry-api.png","metadata":{"files":{"readme":"README-ar.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-11-01T18:34:15.000Z","updated_at":"2026-01-08T10:03:12.000Z","dependencies_parsed_at":"2024-08-22T22:51:30.510Z","dependency_job_id":"1e0e5678-dbdc-4d10-8f63-b8e6ff1424cd","html_url":"https://github.com/fawry-api/fawry","commit_stats":{"total_commits":115,"total_committers":7,"mean_commits":"16.428571428571427","dds":0.5739130434782609,"last_synced_commit":"bd1d3a0ce054f4473703404f8e63d86f6f8c9db7"},"previous_names":["amrrbakry/fawry"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/fawry-api/fawry","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fawry-api%2Ffawry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fawry-api%2Ffawry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fawry-api%2Ffawry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fawry-api%2Ffawry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fawry-api","download_url":"https://codeload.github.com/fawry-api/fawry/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fawry-api%2Ffawry/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28479406,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["api","egypt","fawry","hacktoberfest","payment","payment-gateway","ruby"],"created_at":"2024-07-31T14:00:28.894Z","updated_at":"2026-01-16T15:13:39.133Z","avatar_url":"https://github.com/fawry-api.png","language":"Ruby","readme":"[![CircleCI](https://circleci.com/gh/fawry-api/fawry.svg?style=svg)](https://circleci.com/gh/fawry-api/fawry)\n\n# Fawry\n\n**تنويه:** نحن لسنا تابعين رسميًا لشركة فوري.\n\nمكتبة لتسهيل التعامل مع خدمات الدفع الخاصة بشبكة الدفع الإلكتروني فوري:\n\n_المكتبة تدعم النظام التجريبي لفوري ايضا_\n\n## لإضافة وتشغيل المكتبة\n\nأضف هذا السطر إلى ملف Gemfile الخاص بتطبيقك:\n\n```ruby\ngem 'fawry'\n```\n\nثم نفذ:\n\n    $ bundle\n\nأو قم بتثبيته بنفسك على النحو التالي:\n\n    $ gem install fawry\n\n## تهيئة فوري للاستخدام\n\nلبرنامجك لتهيئة المكتبة `fawry.rb` أضف مهيئ\n\n```ruby\nFawry.configure do |config|\n  config.sandbox = Rails.env.staging?\n  config.fawry_secure_key = 'fawry_secure_key'\n  config.fawry_merchant_code = 'fawry_merchant_code'\nend\n```\n\n`FAWRY_SANDBOX`, `FAWRY_SECURE_KEY`, `FAWRY_MERCHANT_CODE` _(environment variables)_ او يمكنك بدلا من ذلك، استخدام المتغيرات البيئية\n\n## طريقة الإستعمال\n\n### لإجراء عملية دفع\n\n```ruby\nparams = { \"merchant_code\": 'merchant_code',\n           \"merchant_ref_num\": 'io5jxf3jp27kfh8m719arcqgw7izo7db',\n           \"customer_profile_id\": 'ocvsydvbu2gcp528wvl64i9z5srdalg5',\n           \"customer_mobile\": '012345678901',\n           \"payment_method\": 'PAYATFAWRY',\n           \"currency_code\": 'EGP',\n           \"amount\": 20,\n           \"language\": \"ar-eg\",\n           \"fawry_secure_key\": 'fawry_secure_key',\n           \"description\": 'the charge request description',\n           \"charge_items\": [{ \"item_id\": 'fk3fn9flk8et9a5t9w3c5h3oc684ivho',\n                              \"description\": 'desc', \"price\": 20, \"quantity\": 1 }] }\n\nres = Fawry.charge(params)\n#  =\u003e #\u003cFawry::FawryResponse:0x0000564257d0ea90 @type=\"ChargeResponse\", @reference_number=\"931600239\",\n#                                               @merchant_ref_number=\"io5jxf3jp27kfh8m719arcqgw7izo7db\",\n#                                               @expiration_time=1573153206979, @status_code=200,\n#                                               @status_description=\"Operation done successfully\"\u003e\n\nres.success? # =\u003e true\nres.reference_number # =\u003e 931600239\n```\n\n### لإجراء عملية استرداد\n\n```ruby\nparams = { \"merchant_code\": 'merchant_code',\n           \"reference_number\": '931337410',\n           \"refund_amount\": 20,\n           \"fawry_secure_key\": 'fawry_secure_key' }\n\nres = Fawry.refund(params)\n#  =\u003e #\u003cFawry::FawryResponse:0x0000564257d0ea90 @type=\"ResponseDataModel\", @status_code=200,\n#                                               @status_description=\"Operation done successfully\"\u003e\n\nres.success? # =\u003e true\n```\n\n### حالة الدفع\n\n```ruby\nparams = { \"merchant_code\": 'merchant_code',\n           \"merchant_ref_number\": 'ssshxb98phmyvm434es62kage3nsm2cj',\n           \"fawry_secure_key\": 'fawry_secure_key' }\n\nres = Fawry.payment_status(params)\n # =\u003e #\u003cFawry::FawryResponse:0x0000559974056898 @type=\"PaymentStatusResponse\", @reference_number=\"931922417\",\n #                                              @merchant_ref_number=\"ssshxb98phmyvm434es62kage3nsm2cj\",\n #                                              @expiration_time=1573297736167, @status_code=200,\n #                                              @status_description=\"Operation done successfully\", @payment_amount=20,\n #                                              @payment_method=\"PAYATFAWRY\", @payment_status=\"UNPAID\"\u003e\n\nres.success? # =\u003e true\nres.payment_status # =\u003e UNPAID\n```\n\n### عرض رموز الكروت\n\n```ruby\nparams = { \"merchant_code\": 'merchant_code',\n           \"customer_profile_id\": 'customer_profile_id',\n           \"fawry_secure_key\": 'fawry_secure_key' }\n\nres = Fawry.list_tokens(params)\n\n#\u003cFawry::FawryResponse:0x0000556cb3a31798 @fawry_api_response={\"type\"=\u003e\"CustomerTokensResponse\", \"cards\"=\u003e[{\"token\"=\u003e\"b5sshhdsl98df96200f254c19b2718bfc825a0678888216c28962b3e66a393084ee9aed6\", \"creationDate\"=\u003e1599487402318, \"lastFourDigits\"=\u003e\"4242\", \"brand\"=\u003e\"Visa Card\"}, {\"token\"=\u003e\"fb98dslsksmkdds7857ed7042ce30a2a5b777e1f1ac6ac58da1c8c0199f61df7a8bc098e96\", \"creationDate\"=\u003e1599489158457, \"lastFourDigits\"=\u003e\"0001\", \"brand\"=\u003e\"Visa Card\"}, {\"token\"=\u003e\"cc03fwqaacbd94e468a1b756ac1cbb285a41a2428df9f1a727457b41f9447d0058c7c\", \"creationDate\"=\u003e1599584834346, \"lastFourDigits\"=\u003e\"2346\", \"brand\"=\u003e\"MasterCard\"}, {\"token\"=\u003e\"f04a8bc9c973f900515f4b58e52c9ff03070baf3f534bdfdad0e97679534f60ddkjk13\", \"creationDate\"=\u003e1600260415739, \"lastFourDigits\"=\u003e\"8769\", \"brand\"=\u003e\"Visa Card\"}], \"statusCode\"=\u003e200, \"statusDescription\"=\u003e\"Operation done successfully\"}, @type=\"CustomerTokensResponse\", @cards=[{\"token\"=\u003e\"b5sshhdsl98df96200f254c19b2718bfc825a0678888216c28962b3e66a393084ee9aed6\", \"creationDate\"=\u003e1599487402318, \"lastFourDigits\"=\u003e\"4242\", \"brand\"=\u003e\"Visa Card\"}, {\"token\"=\u003e\"fb98dslsksmkdds7857ed7042ce30a2a5b777e1f1ac6ac58da1c8c0199f61df7a8bc098e96\", \"creationDate\"=\u003e1599489158457, \"lastFourDigits\"=\u003e\"0001\", \"brand\"=\u003e\"Visa Card\"}, {\"token\"=\u003e\"cc03fwqaacbd94e468a1b756ac1cbb285a41a2428df9f1a727457b41f9447d0058c7c\", \"creationDate\"=\u003e1599584834346, \"lastFourDigits\"=\u003e\"2346\", \"brand\"=\u003e\"MasterCard\"}, {\"token\"=\u003e\"f04a8bc9c973f900515f4b58e52c9ff03070baf3f534bdfdad0e97679534f60ddkjk13\", \"creationDate\"=\u003e1600260415739, \"lastFourDigits\"=\u003e\"8769\", \"brand\"=\u003e\"Visa Card\"}], @status_code=200, @status_description=\"Operation done successfully\"\u003e\n\nres.success? # =\u003e true\nres.cards # =\u003e cards\n```\n\n### إضافة رمز كارت\n\n```ruby\nparams = { \"merchant_code\" : \"merchant_code\",\n            \"customer_profile_id\" : \"customer_profile_id\",\n            \"customer_mobile\" : \"customer_mobile\",\n            \"customer_email\" : \"customer_email\",\n            \"card_number\" : \"card_number\",\n            \"expiry_year\" : \"expiry_year\",\n            \"expiry_month\" : \"expiry_month\",\n            \"cvv\" : \"cvv\" }\n\nres = Fawry.create_card_token(params)\n#\u003cFawry::FawryResponse:0x0000556cb3eb0080 @fawry_api_response={\"type\"=\u003e\"CardTokenResponse\", \"card\"=\u003e{\"token\"=\u003e\"b598f96200f254c19b2718bfc825a063278888216c28962b3e66a393084ee9aed6\", \"creationDate\"=\u003e1607011562353, \"lastFourDigits\"=\u003e\"4242\"}, \"statusCode\"=\u003e200, \"statusDescription\"=\u003e\"Operation done successfully\"}, @type=\"CardTokenResponse\", @status_code=200, @status_description=\"Operation done successfully\", @card={\"token\"=\u003e\"b598f96200f254c19b2718bfc825a063278888216c28962b3e66a393084ee9aed6\", \"creationDate\"=\u003e1607011562353, \"lastFourDigits\"=\u003e\"4242\"}\u003e\n\nres.success?\nres.card\n```\n\n### حذف رمز كارت\n\n```ruby\nparams = { \"merchant_code\": 'merchant_code',\n           \"customer_profile_id\": 'customer_profile_id',\n           \"card_token\": 'card_token' }\n\nres = Fawry.delete_token(params)\n#\u003cFawry::FawryResponse:0x0000556cb57c2460 @fawry_api_response={\"type\"=\u003e\"CardTokenResponse\", \"statusCode\"=\u003e200, \"statusDescription\"=\u003e\"Operation done successfully\"}, @type=\"CardTokenResponse\", @status_code=200, @status_description=\"Operation done successfully\"\u003e\nres.success?\n\n```\n\n### رد اتصال خدمة تحليل فوري v2\n\n```ruby\n# تم إرسال المعلمات من خادم فوري\ncallback_params = { \"requestId\": 'c72827d084ea4b88949d91dd2db4996e', \"fawryRefNumber\": '970177',\n                    \"merchantRefNumber\": '9708f1cea8b5426cb57922df51b7f790',\n                    \"customerMobile\": '01004545545', \"customerMail\": 'fawry@fawry.com',\n                    \"paymentAmount\": 152.00, \"orderAmount\": 150.00, \"fawryFees\": 2.00,\n                    \"shippingFees\": '', \"orderStatus\": 'NEW', \"paymentMethod\": 'PAYATFAWRY',\n                    \"messageSignature\": 'b0175565323e464b01dc9407160368af5568196997fb6e379374a4f4fbbcf587',\n                    \"orderExpiryDate\": 1_533_554_719_314,\n                    \"orderItems\": [{ \"itemCode\": 'e6aacbd5a498487ab1a10ae71061535d', \"price\": 150.0, \"quantity\": 1 }] }\n\nfawry_callback = Fawry.parse_callback(callback_params)\n# \u003cFawry::FawryCallback:0x000056339ac43730 @request_id=\"c72827d084ea4b88949d91dd2db4996e\", @fawry_ref_number=\"970177\",\n#                                          @merchant_ref_number=\"9708f1cea8b5426cb57922df51b7f790\", @customer_mobile=\"01004545545\",\n#                                          @customer_mail=\"fawry@fawry.com\", @order_status=\"NEW\", @order_amount=150.0, @fawry_fees=2.0, ...\u003e\n\nfawry_callback.fawry_ref_number # =\u003e 970177\nfawry_callback.order_status # =\u003e NEW\n```\n\n## الخطوات القادمة المطلوب تنفيذها:\n\n- إضافة خيار لرفع الاستثناء عند فشل الطلب\n\n## تطوير المكتبة\n\nبعد التحقق من الريبو ، قم بتشغيل `bin/setup` لتثبيت التبعيات.\nثم نفذ الأمر `rake spec` لإجراء الاختبارات. يمكنك أيضا الجري `bin/console` للمطالبة التفاعلية التي تسمح لك بالتجربة.\n\nلتثبيت هذه المكتبة على جهازك ، قم بتشغيل `bundle exec rake install`. لإصدار إصدار جديد ، قم بتحديث رقم الإصدار بتنسيق `version.rb`, ثم نفذ الأمر `bundle exec rake release`, الذي سينشئ علامة git للإصدار ، ويدفع التزامات git والعلامات ، ويدفع ملف `.gem` يا صديق [rubygems.org](https://rubygems.org).\n\n## المساهمة\n\nيتم الترحيب بتقارير الأخطاء وطلبات السحب على GitHub في https://github.com/amrrbakry/fawry. يهدف هذا المشروع إلى أن يكون مساحة آمنة ومرحبة للتعاون ، ومن المتوقع أن يلتزم المساهمون بـ [Contributor Covenant](http://contributor-covenant.org) القواعد السلوكية.\n","funding_links":[],"categories":["Projects"],"sub_categories":["SDKs and Libraries"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffawry-api%2Ffawry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffawry-api%2Ffawry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffawry-api%2Ffawry/lists"}