2012-12-16 36 views
0

stripe.com向我要對我的ashx文件如何訪問此StripeCharge映射器對象?

{ 
"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()); 

但是現在我如何找到例如, amount_refunded或來自stripeCharge var的描述?

回答

0

StripeCharge.CustomerId.ToString(); 這個問題對我來說並不瞭解,當聲明爲Var 時,StripeCharge是一個動態表達式,它將在運行時被填充。

因此,當我在Visual Studio中輸入StripeCharge點時,我沒有看到任何屬性。\ 所以我不認爲它工作。

0

Digg成爲stripecharge類的成員。如果您可以將代碼粘貼到類中(以防您的問題打開),那將會很好。我可以在這裏看到你已經回答了你的問題,所以請使這一點清楚