我是一位新的vb.net開發人員,我正在嘗試與API服務進行集成,該服務允許我存儲信用卡數據而不遵從PCI。我遇到的問題是,該示例僅適用於JavaScript,並且我無法確定如何在vb.NET中創建相同的簡單過程。我希望有人能夠幫助我這個樣本。使用VB.NET理解JavaScript API示例時遇到困難
這個想法是將POST數據從我的表單傳遞給API,然後處理成功或失敗的響應數據。
//<![CDATA[
$(document).ready(function() {
$('input:button').click(function() {
$.ajax({
type: 'post',
url: 'https://certify.i4go.com/index.cfm',
dataType: 'jsonp',
data: {
fuseaction: 'account.jsonpPostCardEntry',
i4Go_AccountID: '123123',
i4Go_SiteID: '456456',
i4Go_CardNumber: $('#i4Go_CardNumber').val(),
i4Go_ExpirationMonth: $('#i4Go_ExpirationMonth').val(),
i4Go_ExpirationYear: $('#i4Go_ExpirationYear').val()
},
cache: false
});
});
});
function parseResponse(data) {
if (data.i4go_responsecode != null) {
if (data.i4go_responsecode == 1) {
$('#response').html('i4Go_UniqueId: ' + data.i4go_uniqueid);
} else {
$('#response').html('i4Go_ResponseCode: ' + data.i4go_responsecode);
}
} else {
$('#response').html('i4Go_ResponseCode is null');
}
}
//]]>
</script>
</head>
<body>
<table cellpadding="0" cellspacing="0">
<tbody><tr>
<td>Card number:</td><td><input type="text" id="i4Go_CardNumber" value="4111111111111111"></td>
</tr>
<tr>
<td>Exp month:</td><td><input type="text" id="i4Go_ExpirationMonth" value="12"></td>
</tr>
<tr>
<td>Exp year:</td><td><input type="text" id="i4Go_ExpirationYear" value="2020"></td>
</tr>
<tr>
<td><input type="button" value="Get Token"></td>
</tr>
</tbody></table>
<div id="response"></div>
我感謝任何和所有的幫助。
乾杯,
AJ
喬,謝謝你的幫助。我目前在.NET 4.0上,我如何實現這個沒有新的HttpClient? – UserAyeJay 2013-02-22 17:43:54
用4.0示例編輯答案。 – 2013-02-22 19:08:25