所以我正在尝试做一个简单的Stripe Webhook.理想情况下,这不应该是困难的.
我正在使用这个webhook
所以这是我的代码:
<?php
require_once('lib/Stripe.php');
// Replace "xyz" with your Stripe Secret Live Key //
Stripe::setApiKey("xxx");
$body = @file_get_contents('php://input');
$event_json = json_decode($body);
// SETUP:
// 1. Customize all the settings (stripe api key, email settings, email text)
// 2. Put this code somewhere where it's accessible by a URL on your server.
// 3. Add the URL of that location to the settings at https://manage.stripe.com/#account/webhooks
// 4. Have fun!
// set your secret key: remember to change this …Run Code Online (Sandbox Code Playgroud) 有没有人知道如何将Amcharts实施到Angular2(BETA)?
我试图按照这个问题的路径/模式,但是我对chart.js非常成功,但不幸的是,我不能使用charts.js作为我的图表程序.由于看起来Angular2 Beta中的所有内容都是未知的领域,我不知道从哪里开始?我模仿上面的chart.js例子没有运气,没有错误.
/// <reference path="../DefinitelyTyped/amcharts/AmCharts.d.ts" />
Run Code Online (Sandbox Code Playgroud)
amcharts有一个DefinitelyTyped库(暂时不是plot.ly的库).
更新:这是指令:
/// <reference path="../DefinitelyTyped/amcharts/AmCharts.d.ts" />
import {Directive, ElementRef, Renderer, Input} from 'angular2/core';
@Directive({
selector: '[chart]',
})
export class amChartDirective {
var chartData = [{date: new Date(2015,2,31,0, 0, 0, 0),value:372.10,volume:2506100},{date: new Date(2015,3,1,0, 0, 0, 0),value:370.26,volume:2458100},{date: new Date(2015,3,2,0, 0, 0, 0),value:372.25,volume:1875300},{date: new Date(2015,3,6,0, 0, 0, 0),value:377.04,volume:3050700}];
var chart;
AmCharts.ready(function () {
createStockChart();
});
function createStockChart() {
chart = new AmCharts.AmStockChart();
chart.dataDateFormat = "M-D-YY";
chart.pathToImages = "http://www.strategic-options.com/trade/3_party/amcharts/images/";
var dataSet = new AmCharts.DataSet();
dataSet.dataProvider …Run Code Online (Sandbox Code Playgroud) 这应该是一个简单的问题,但是我似乎无法理解过去的语法。
object(stdClass)#15 (12) {
["im:name"]=>
object(stdClass)#14 (1) {
["label"]=>
string(15) "Balls VS Blocks"
}
Run Code Online (Sandbox Code Playgroud)
一个简单的$info->im:name->label就能提取“ Balls VS Blocks”。但是,由于:第一个键中有一个,因此它会退出我的IDE,然后会引发错误。我如何才能逃避钥匙中的这个特殊字符?