razorpay / razorpay
Razorpay PHP 客户端库
2.9.0
2023-12-18 04:19 UTC
Requires
- php: >=7.3
- ext-json: *
- rmccue/requests: ^2.0
Requires (Dev)
- phpunit/phpunit: ^9
- raveren/kint: 1.*
- dev-master
- v2.9.1.x-dev
- 2.9.0
- 2.8.7
- 2.8.6
- 2.8.5
- v2.8.4
- v2.8.3
- v2.8.2
- 2.8.1
- 2.8.0
- 2.7.1
- 2.7.0
- 2.6.1
- 2.6.0
- 2.5.0
- 2.4.0-beta
- 2.3.0
- 2.2.1
- v2.2.0
- 2.1.0
- 2.0.2
- 2.0.1
- 2.0.0
- 1.2.9
- 1.2.8
- 1.2.7
- 1.2.6
- 1.2.5
- 1.2.4
- 1.2.3
- 1.2.2
- 1.2.2-alpha1
- 1.2.1.x-dev
- 1.2.1
- 1.2.1-alpha1
- 1.2.0
- 1.2-alpha1
- 1.1.0
- 1.0.2
- 1.0.1
- 1.0.0
- dev-dependabot/composer/phpunit/phpunit-tw-11
- dev-changelog_version_correction
- dev-codecoverage_changelog
- dev-codecoverage_new_api
- dev-stale-implementation
- dev-file_upload_feature
- dev-ankitdas13-patch-1
- dev-security_akto_integration_1699637472
- dev-json_release_update
- dev-order_request_json
- dev-fix_security_issue
- dev-add_partner_changelog
- dev-revert-349-version_bump
- dev-increase_codecoverage
- dev-version_bump
- dev-gitaction_workflow
- dev-dummy_20feb
- dev-changes-in-pull_request_template
- dev-update_changelog
- dev-issue_15
- dev-version_upgrade
- dev-issue_template
- dev-webhook_edit_changes
- dev-replicate_pr_208
- dev-issue_37
- dev-issue_296
- dev-added_autoload_path
- dev-PHP-5.6
- dev-updated_travis_doc
- dev-third_party_validation
- dev-third_party_validation_payment
- dev-transfer_doc_correction
- dev-third_party_validation_token
- dev-addon_doc_correction
- dev-card_doc_correction
- dev-qrcode_doc_correction
- dev-upi_doc_correction
- dev-registernach_doc_correction
- dev-registeremandate_doc_correction
- dev-subscription_doc_correction
- dev-invoice_doc_correction
- dev-emandate_doc_correction
- dev-papernach_doc_correction
- dev-smartcollect_doc_correction
- dev-paymentlink_doc_correction
- dev-item_doc_correction
- dev-refund_doc_correction
- dev-settlement_doc_correction
- dev-payment_doc_correction
- dev-fund_doc_correction
- dev-order_doc_correction
- dev-remove_constant
- dev-add_lib
- dev-sanyalsatyaki-owasp
- dev-sanyalsatyaki-grype
- dev-otp_api
- dev-doc_update
- dev-requests_change_path
- dev-new_version
- dev-update_ver
- dev-new-methods
- dev-new_update
- dev-remove_api_cred
- dev-fix_naming_convention
- dev-semgrep_integration_1642755547
- dev-semgrep_integration_1641900519
- dev-semgrep_integration_1641830646
- dev-semgrep_integration_1641817051
- dev-transfer_doc
- dev-paymentlink_readme
- dev-item_sdk
- dev-signature_verfication_testcase
- dev-virtualAccount_upi_sdk
- dev-subscription_testcases
- dev-transfer_sdk
- dev-paymentlink_token_sdk
- dev-qrcode_refund_sdk
- dev-emandate_papernach_sdk
- dev-payment_plan_sdk
- dev-settlement_sdk
- dev-invoice_fund_testcases
- dev-customer_testcases
- dev-version_bump_2.8.0
- dev-sdk_Upi
- dev-sdk_for_order
- dev-sdk_for_refunds
- dev-sdk_for_paymentlinks
- dev-sdk_for_cards
- dev-tpv_bankaccount_add_delete
- dev-paymentSettlement
- dev-pLink_sig_verification
- dev-subscriptions_methods
- dev-sdk_for_funds
- dev-revert-243-sdk_for_upi
- dev-smartcollect_tpv_apis
- dev-sdk_for_emandate
- dev-sdkPaymentLink
- dev-sdk_for_upi
- dev-payment-link
- dev-QR_code
- dev-payment_link_endpoint
- dev-VA_close
- dev-dependabot/composer/rmccue/requests-v1.8.1
- dev-checkout-changes
- dev-add_payment_page
- dev-bump_rmccue_requests
- dev-dependabot/add-v2-config-file
- dev-VA_changes
- dev-webhook_entity_support
- dev-dependabot/composer/phpunit/phpunit-tw-9.5.1
- dev-add_transfer_via_order
- dev-add_curl_logs
- dev-verify_true
- dev-dependabot/composer/raveren/kint-3.star
- dev-phpunit-update
- dev-notes_typecast
- dev-test_cases
- dev-add_resource_class
- dev-fix_late_binding
- dev-leaner-release
- dev-version-releases
This package is auto-updated.
Last update: 2024-09-10 00:04:14 UTC
README
为 Razorpay API 提供的官方 PHP 库。
在此处阅读有关入门和了解 Razorpay 支付流程的信息:https://docs.razorpay.com/docs/getting-started
先决条件
- PHP 7.3 至 8.1 的最低版本
安装
- 如果您的项目使用 composer,请运行以下命令
composer require razorpay/razorpay:2.*
- 如果您不使用 composer,请从 发布部分 下载最新版本。**您应下载
razorpay-php.zip
文件**。之后,将Razorpay.php
包含在您的应用程序中,您就可以像往常一样使用 API 了。
##注意:此 PHP 库遵循以下实践
- 在
Razorpay\Api
下命名空间 - API 抛出异常而不是返回错误
- 尽可能以数组的形式传递选项,而不是多个参数
- 所有请求和响应都通过 JSON 通信
文档
Razorpay API 和其使用的文档可在 https://docs.razorpay.com 查找。
基本用法
使用 key_id
和 key_secret
实例化 razorpay php 实例。您可以从仪表板应用程序(https://dashboard.razorpay.com/#/app/keys)获取密钥。
use Razorpay\Api\Api; $api = new Api($api_key, $api_secret);
可以通过 $api
对象访问资源。所有方法调用都遵循以下模式
// $api->class->function() to access the API //Example $api->payment->fetch($paymentId);
支持的资源
- 账户
- 客户
- 争议
- 文件
- 令牌
- 订单
- 支付
- 结算
- 退款
- 资金
- 发票
- Iin
- 计划
- 项目
- 订阅
- 附加组件
- 支付链接
- 产品配置
- 智能收集
- 利益相关者
- 转账
- 二维码
- 电子授权
- 卡片
- 纸质 NACH
- UPI
- 注册电子授权并一起收取首次付款
- 注册 NACH 并一起收取首次付款
- 支付验证
- Webhook
开发
有关开发入门,请参阅 doc.md 文件。
发布
发布步骤
- 将新代码分支合并到 master。
- 在
src/Api.php
中提升版本。 - 在
CHANGELOG.md
中将“Unreleased”重命名为新的标签。 - 在
CHANGELOG.md
顶部添加一个新空白的“Unreleased”部分 - 修复
CHANGELOG.md
中的链接 - 提交
- 标记发布并将其推送到 GitHub
- 一旦 travis 构建通过,将自动创建发布。编辑发布以添加一些描述。
许可证
Razorpay PHP SDK 在 MIT 许可证下发布。有关更多详细信息,请参阅 LICENSE 文件。