1

strip.com は、これを私の ashx ファイルに送信します

{
"type": "charge.refunded",
"livemode": false,
"object": "event",
"created": 1326853478,
"id": "evt_00000000000000",
"data": {
 "object": {
  "livemode": false,
  "fee_details": [
    {
      "application": null,
      "type": "stripe_fee",
      "amount": 0,
      "currency": "usd",
      "description": "Stripe processing fees"
    }
  ],
  "amount_refunded": 0,
  "invoice": null,
  "failure_message": null,
  "object": "charge",
  "created": 1355641115,
  "amount": 0,
  "customer": null,
  "currency": "usd",
  "card": {
    "address_state": null,
    "exp_year": 2012,
    "type": "Visa",
    "address_country": null,
    "country": "US",
    "address_line1": null,
    "fingerprint": "thIB5TIJqKMnqdMm",
    "address_line2": null,
    "last4": "4242",
    "object": "card",
    "cvc_check": "pass",
    "address_city": null,
    "address_zip_check": null,
    "name": null,
    "address_zip": null,
    "exp_month": 12,
    "address_line1_check": null
  },
  "id": "ch_00000000000000",
  "dispute": null,
  "paid": true,
  "refunded": true,
  "fee": 0,
  "description": null
}
}
}

そして、 これを行うことを示すhttps://github.com/jaymedavis/stripe.netのコードを使用します:

var json = new StreamReader(context.Request.InputStream).ReadToEnd();
var stripeEvent = StripeEventUtility.ParseEvent(json); 
var StripeCharge = Stripe.Mapper<StripeCharge>
                   .MapFromJson(stripeEvent.Data.Object.ToString());

しかし、たとえば、stripeCharge var から amount_refunded や description を見つけるにはどうすればよいですか?

4

2 に答える 2

0

StripeCharge.CustomerId.ToString(); 私にとっての問題は、var として宣言されたときの StripeCharge が、実行時に入力される動的な式であることを理解していなかったことです。

Visual Studio で StripeCharge ドットを入力すると、プロパティが表示されませんでした。

于 2012-12-16T18:47:55.527 に答える
0

stripcharge クラスのメンバーを掘り下げます。クラスと一緒にコードを貼り付けることができれば良いでしょう (問題が未解決の場合)。ここであなたがあなたの質問に答えたことがわかりますので、この点も明確にしてください

于 2012-12-16T19:00:32.970 に答える