adnedelcu/reepay-php-api

此包已被弃用且不再维护。作者建议使用oscar-team/reepay-php-api包。

1.0.29 2024-04-22 13:44 UTC

README

REST API 管理Reepay资源

此PHP包由Swagger Codegen项目自动生成

  • API版本:1
  • 构建包:io.swagger.codegen.languages.PhpClientCodegen

关于Reepay(由reepay提供)

Reepay是一个支付网关,也是一个订阅计费平台,适用于多个在线网店和商家。Reepay也是VISA和Mastercard的收单行

这是一个由爱好者完成的非官方仓库,我们非常感激为此付出的努力。

要求

PHP 5.4.0及更高版本

安装与使用

Composer

要使用Composer安装绑定,请将以下内容添加到composer.json

{
  "require": {
    "oscar-team/reepay-php-api": "dev-master"
  }
}

然后运行composer install

手动安装

下载文件并包含autoload.php

    require_once('/path/to/code/autoload.php');

测试

要运行单元测试

composer install
./vendor/bin/phpunit

入门

请按照安装说明进行操作,然后运行以下命令

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: apiKey
Reepay\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-Token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Reepay\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-Token', 'Bearer');
// Configure HTTP basic authorization: basicAuth
Reepay\Configuration::getDefaultConfiguration()->setUsername('YOUR_USERNAME');
Reepay\Configuration::getDefaultConfiguration()->setPassword('YOUR_PASSWORD');

$apiInstance = new Reepay\Api\AccountApi();

try {
    $result = $apiInstance->createPrivateKey();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AccountApi->createPrivateKey: ', $e->getMessage(), PHP_EOL;
}

?>

API端点文档

所有URI相对于https://api.reepay.com/,除了Session,它是https://checkout-api.reepay.com/

方法 HTTP请求 描述
AccountApi createPrivateKey POST /v1/account/privkey 创建私钥
AccountApi createPublicKey POST /v1/account/pubkey 创建公钥
AccountApi expirePrivateKey POST /v1/account/privkey/{key}/expire 过期私钥
AccountApi expirePublicKey POST /v1/account/pubkey/{key}/expire 过期公钥
AccountApi generateWebhookSecret POST /v1/account/webhook_settings/secret 生成新的webhook密钥
AccountApi getCurrentAccount GET /v1/account 获取账户
AccountApi getDiscountSettings GET /v1/account/discount_settings 获取折扣设置
AccountApi getMailSettings GET /v1/account/mail_settings 获取邮件设置
AccountApi getPrivateKeys GET /v1/account/privkey 获取私钥列表
AccountApi getPublicKeys GET /v1/account/pubkey 获取公钥列表
AccountApi getWebhookSettings GET /v1/account/webhook_settings 获取webhook设置
AccountApi updateAccountJson PUT /v1/account 更新账户
AccountApi updateDiscountSettings PUT /v1/account/discount_settings 更新折扣设置
AccountApi updateMailSettingsJson PUT /v1/account/mail_settings 更新邮件设置
AccountApi updateWebhookSettingsJson PUT /v1/account/webhook_settings 更新webhook设置
AdditionalCostApi cancelAdditionalCost POST /v1/additional_cost/{handle}/cancel 取消挂起的附加费用
AdditionalCostApi createAdditionalCostJson POST /v1/additional_cost 创建附加费用
AdditionalCostApi getAdditionalCost GET /v1/additional_cost/{handle} 获取额外费用
AdditionalCostApi getAdditionalCosts GET /v1/additional_cost/subscription/{handle} 获取订阅的额外费用
AgreementApi createCardGatewayAgreement POST /v1/agreement/card_gateway 创建卡网关协议
AgreementApi deleteCardGatewayAgreement DELETE /v1/agreement/card_gateway/{id} 删除卡网关协议
AgreementApi disableCardGatewayAgreement POST /v1/agreement/card_gateway/{id}/disable 禁用卡网关协议
AgreementApi enableCardGatewayAgreement POST /v1/agreement/card_gateway/{id}/enable 启用卡网关协议
AgreementApi getCardGatewayAgreement GET /v1/agreement/card_gateway/{id} 获取卡网关协议
AgreementApi getCardGatewayAgreements GET /v1/agreement/card_gateway 获取所有卡网关协议
AgreementApi updateCardGatewayAgreement PUT /v1/agreement/card_gateway/{id} 更新卡网关协议
AuthenticateApi login POST /v1/authenticate/login 用户登录
AuthenticateApi renew POST /v1/authenticate/renew 续期用户登录
AuthenticateApi verifyAuthentication GET /v1/authenticate/verify 验证身份验证
ChargeApi cancelCharge POST /v1/charge/{handle}/cancel 取消收费
ChargeApi createCharge POST /v1/charge 创建收费
ChargeApi getCharge GET /v1/charge/{handle} 获取收费
ChargeApi getCharges GET /v1/charge 获取收费列表
ChargeApi settleCharge POST /v1/charge/{handle}/settle 结算收费
CouponApi createCoupon POST /v1/coupon 创建优惠券
CouponApi deleteCoupon DELETE /v1/coupon/{handle} 删除优惠券
CouponApi expireCoupon POST /v1/coupon/{handle}/expire 过期优惠券
CouponApi getCoupon GET /v1/coupon/{handle} 获取优惠券
CouponApi getCoupons GET /v1/coupon 获取优惠券列表
CouponApi updateCoupon PUT /v1/coupon/{handle} 更新优惠券
CouponApi validateCode GET /v1/coupon/code/validate 验证优惠券
CreditApi cancelCredit POST /v1/credit/{handle}/cancel 取消信用
CreditApi createCreditJson POST /v1/credit 创建信用
CreditApi getCredit GET /v1/credit/{handle} 获取信用
CreditApi getCredits GET /v1/credit/subscription/{handle} 获取订阅的信用
CustomerApi activatePaymentMethod POST /v1/customer/{handle}/payment_method/{method_id}/activate 激活支付方式
CustomerApi addCardJson POST /v1/customer/{handle}/payment_method/card 添加卡片支付方式
CustomerApi createCustomerInvoice POST /v1/customer/{handle}/invoice 为客户创建发票
CustomerApi createCustomerJson POST /v1/customer 创建客户
CustomerApi createCustomerNoteJson POST /v1/customer/{handle}/note 创建客户笔记
CustomerApi deleteCustomer DELETE /v1/customer/{handle} 删除客户
CustomerApi getCard GET /v1/customer/{handle}/payment_method/card/{id} 获取卡片
CustomerApi getCardDetails GET /v1/customer/{handle}/payment_method/card/{id}/details 获取网关卡片详情
CustomerApi getCustomer GET /v1/customer/{handle} 获取客户
CustomerApi getCustomerNotes GET /v1/customer/{handle}/note 获取客户笔记
CustomerApi getCustomerPaymentMethods GET /v1/customer/{handle}/payment_method 获取支付方式
CustomerApi getCustomers GET /v1/customer 获取客户列表
CustomerApi importCardJson POST /v1/customer/{handle}/payment_method/card_import 导入卡片支付方式
CustomerApi inactivatePaymentMethod POST /v1/customer/{handle}/payment_method/{method_id}/inactivate 停用支付方式
CustomerApi reactivateCard POST /v1/customer/{handle}/payment_method/{card_id}/card_reactivate 恢复失效卡片
CustomerApi updateCustomerJson PUT /v1/customer/{handle} 更新客户信息
DiscountApi createDiscount POST /v1/discount 创建折扣
DiscountApi deleteDiscount DELETE /v1/discount/{handle} 删除折扣
DiscountApi getDiscount GET /v1/discount/{handle} 获取折扣
DiscountApi getDiscounts GET /v1/discount 获取折扣列表
DiscountApi undeleteDiscount POST /v1/discount/{handle}/undelete 恢复删除的折扣
DunningPlanApi createDunningPlanJson POST /v1/dunning_plan 创建催款计划
DunningPlanApi deleteDunningPlan DELETE /v1/dunning_plan/{handle} 删除催款计划
DunningPlanApi getDunningPlan GET /v1/dunning_plan/{handle} 获取催款计划
DunningPlanApi getDunningPlans GET /v1/dunning_plan 获取催款计划列表
DunningPlanApi updateJson PUT /v1/dunning_plan/{handle} 更新催款计划
EventApi getEvent GET /v1/event/{id} 获取事件
EventApi getEvents GET /v1/event 获取事件列表
InvoiceApi cancelAllDunningPending POST /v1/invoice/cancel_all_dunning_pending/subscription/{handle} 取消所有催款和待处理
InvoiceApi cancelInvoice POST /v1/invoice/{id}/cancel 取消发票
InvoiceApi cancelSettleLater POST /v1/invoice/{id}/settle/cancel 取消延迟结算
InvoiceApi cancelTransaction POST /v1/invoice/{id}/transaction/{transaction}/cancel 取消交易
InvoiceApi detachFromSubscription POST /v1/invoice/{id}/detach 从订阅中解除绑定
InvoiceApi getInvoice GET /v1/invoice/{id} 获取发票
InvoiceApi getInvoices GET /v1/invoice 获取发票列表
InvoiceApi manualSettle POST /v1/invoice/{id}/manual_settle 手动结算
InvoiceApi reactivateInvoice POST /v1/invoice/{id}/reactivate 恢复发票
InvoiceApi settle POST /v1/invoice/{id}/settle 结算
InvoiceApi transaction GET /v1/invoice/{id}/transaction/{transaction} 获取交易
InvoiceApi transactionDetails GET /v1/invoice/{id}/transaction/{transaction}/details 获取交易详情
InvoiceApi transactionList GET /v1/invoice/{id}/transaction 获取交易列表
MailTemplateApi getSample GET /v1/mail_template/sample 获取样本数据
OrganisationApi getOrganisation GET /v1/organisation 获取组织
OrganisationApi update PUT /v1/organisation 更新组织
PlanApi createPlanJson POST /v1/plan 创建计划
PlanApi deletePlan DELETE /v1/plan/{handle} 删除计划
PlanApi getCurrentPlan GET /v1/plan/{handle}/current 获取计划
PlanApi getPlan GET /v1/plan/{handle}/{version} 获取计划版本
PlanApi getPlans GET /v1/plan/{handle} 获取计划版本列表
PlanApi getPlansList GET /v1/plan 获取计划列表
PlanApi supersedePlanJson POST /v1/plan/{handle} 替代计划
PlanApi updatePlanJson PUT /v1/plan/{handle} 更新计划
RefundApi createRefund POST /v1/refund 创建退款
RefundApi getRefund GET /v1/refund/{id} 获取退款
SessionApi createSession POST /v1/session/charge 创建收费会话
SessionApi deleteSession DELETE /v1/session/{id} 删除会话
SubscriptionApi cancelSubscription POST /v1/subscription/{handle}/cancel 取消订阅
SubscriptionApi changeNextPeriodStartJson POST /v1/subscription/{handle}/change_next_period_start 更改下次续订日期
SubscriptionApi changeSubscription PUT /v1/subscription/{handle} 更改订阅
SubscriptionApi 创建订阅折扣 POST /v1/subscription/{handle}/discount 添加订阅折扣
SubscriptionApi 创建订阅发票 POST /v1/subscription/{handle}/invoice 为订阅创建按需发票
SubscriptionApi 创建订阅JSON POST /v1/subscription 创建订阅
SubscriptionApi 删除订阅折扣 DELETE /v1/subscription/{handle}/discount/{sdHandle} 删除订阅折扣
SubscriptionApi 过期 POST /v1/subscription/{handle}/expire 使订阅过期
SubscriptionApi 获取订阅 GET /v1/subscription/{handle} 获取订阅
SubscriptionApi 获取订阅折扣 GET /v1/subscription/{handle}/discount/{sdHandle} 获取订阅折扣
SubscriptionApi 获取订阅折扣列表 GET /v1/subscription/{handle}/discount 获取订阅折扣列表
SubscriptionApi 获取订阅支付方式 GET /v1/subscription/{handle}/payment_method 获取支付方式
SubscriptionApi 获取订阅周期余额 GET /v1/subscription/{handle}/period_balance 获取订阅的周期余额
SubscriptionApi 获取订阅列表 GET /v1/subscription 获取订阅列表
SubscriptionApi 间隔金额 GET /v1/subscription/{handle}/interval_amount 计算间隔金额
SubscriptionApi 挂起 POST /v1/subscription/{handle}/on_hold 挂起订阅
SubscriptionApi 恢复订阅 POST /v1/subscription/{handle}/reactivate 恢复挂起的订阅
SubscriptionApi 兑换优惠券代码 POST /v1/subscription/{handle}/coupon 兑换订阅的优惠券代码
SubscriptionApi 删除所有支付方式 DELETE /v1/subscription/{handle}/payment_method 删除所有支付方式
SubscriptionApi 删除支付方式 DELETE /v1/subscription/{handle}/payment_method/{method_id} 删除支付方式
SubscriptionApi 设置支付方式 POST /v1/subscription/{handle}/payment_method 设置支付方式
SubscriptionApi 取消取消 POST /v1/subscription/{handle}/uncancel 取消取消订阅
用户API 删除用户 DELETE /v1/user/{id} 删除用户
用户API 获取用户 GET /v1/user/{id} 获取用户
用户API 获取用户列表 GET /v1/user 获取用户列表
用户API 邀请用户 POST /v1/user/invite 邀请用户
用户API 接受邀请 POST /v1/user/invite/{token} 接受邀请
用户API 获取邀请 GET /v1/user/invite/{token} 获取邀请
用户API 重置密码 POST /v1/user/reset_password 重置密码请求
用户API 使用令牌重置密码 POST /v1/user/reset_password/{token} 重置密码
用户API 更新认证 PUT /v1/user/{id}/groups 更新用户组
用户API 更新密码 PUT /v1/user/{id}/password 更改密码
用户API 更新用户 PUT /v1/user/{id} 更新用户
用户API 验证电子邮件 POST /v1/user/verify_email/{token} 验证电子邮件
用户API 发送验证电子邮件请求 POST /v1/user/{id}/verify_email 发送验证电子邮件
WebhookApi 禁用Webhook POST /v1/webhook/disable 禁用Webhook
WebhookApi 获取Webhook GET /v1/webhook/{id} 获取Webhook
WebhookApi 获取Webhook请求 GET /v1/webhook/{id}/request 获取Webhook请求
WebhookApi 获取Webhook列表 GET /v1/webhook 获取Webhook列表
WebhookApi 重发JSON POST /v1/webhook/resend 重新发送Webhook
WebhookApi 更新Webhook POST /v1/webhook/update 更新并重新发送Webhook

模型文档

授权文档

apiKey

  • 类型: API密钥
  • API密钥参数名: X-Auth-Token
  • 位置: HTTP头

basicAuth

  • 类型: HTTP基本认证