akkroo/stripe-event

此包已被弃用,不再维护。未建议替代包。

Stripe webhook 集成用于 PHP

v1.0.1 2013-11-06 10:11 UTC

This package is not auto-updated.

Last update: 2020-01-20 03:32:37 UTC


README

Total Downloads Latest Stable Version

用法

<?php

use \Akkroo\StripeEvent\StripeEvent;

try {
	$stripeEvent = new StripeEvent();
} catch(\Akkroo\StripeEvent\Exceptions\StripeEventException $e) {
	StripeEvent::sendExceptionResponse($e);
	exit(1);
}

switch($stripeEvent->getType()) {
	case 'account.updated':
		// account updated
		// perform action
		break;
	case 'charge.succeeded':
		// charge succeeded
		// perform action
		break;
	default:
		echo 'Unhandled event';
		break;
}

StripeEvent::sendSuccessResponse();
exit(0);

要求

  • PHP 5.3 或更高版本
  • 使用 Xdebug 测试设置头部的方法

提交错误和功能请求

错误和功能请求在 GitHub 上跟踪

许可证

StripeEvent 根据 MIT 许可证授权 - 详细信息请参阅 LICENSE 文件