与 POS 交互 - 终端设备和银行交换系统

发布于 2024-12-17 12:47:48 字数 795 浏览 8 评论 0原文

我有一个项目,需要与 POS - 终端设备和磁卡/芯片卡进行交互。 比方说,每当顾客从我的百货商店购买商品时,这家商店的工作人员就会刷卡顾客的金融卡并进行付款交易。

对于那些类似的系统,大多数论坛都说应该考虑使用第三方API,例如:

  • PayPal
  • Braintree
  • Authorize.NET。
  • Google 结帐 API。

但我认为这些 API 应该用于那些将进行国际支付处理的系统。就我而言,我认为我的系统不像国际支付处理那么大,并将开始作为国内小型系统运行。

那么我想知道哪个是最好的解决方案以及系统架构如何?

当我阅读Authorize.Net页面时,我发现了信用卡的套路处理

  • 无论我的项目是大还是小,国际运行还是国内运行,我都需要遵循整个程序吗?

  • 我真的需要按照此程序使用 POS 终端设备进行支付流程吗?

我知道的一件事是 ISO 8583 是重要的金融消息传递协议,因为大多数对于我所在的地区,银行交换软件系统仅使用这些消息格式。这意味着我无法使用其他消息格式,例如 NDC 或 D912。

I have a project in which I need to interact with POS - Terminal Devices and magnetic/chip cards.
Let's say, whenever customer buy goods from my department store, staff from this store will stripe customer's financial cards and make payment transaction.

For those similar system, most of the forums say that it should be considered to use third party API such as:

  • PayPal
  • Braintree
  • Authorize.NET.
  • Google Check-Out API.

But I think that those APIs should use for those kind of system which will go to international payment processing. As for me, I assume that my system is not as big as international payment processing and will start working as a domestic small system.

So what I would like to know is which will be the best solution and how the system architecture will be?

When I read a Authorize.Net page, I found the routine of Credit Card Processing.

  • Do i need to follow this whole procedure no matter whether my project is big or small, international running or domestic running?

  • Do I really need to follow this procedure to make payment process with POS - Terminal Devices ?

One thing I know is that ISO 8583 is the essential financial messaging protocol because most of the banking switching software system, for my region, use only these messaging format. This means that I cannot use other messaging format such us NDC or D912.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

清旖 2024-12-24 12:47:48

Authorize.net 非常容易使用。处理卡片所需要做的就是发送 XML 格式的 https 帖子。 Authorize.net 开发者网站上有几个示例。
就刷卡而言,大多数读卡器都会模拟键盘按键。刷卡看起来与此类似:

'%B5500692805076849^SMITH/STEPHEN A^12041010000000      00969000000?;5500692805076849=12041010000000969?`

然后解析卡号“5500692805076849”、名称“SMITH/STEPHEN A”和到期日期“1204”
并在 Authorize.net 上传递这些内容

Private Sub cmdCharge_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdCharge.Click
    ' By default, this sample code is designed to post to our test server for
    ' developer accounts: https://test.authorize.net/gateway/transact.dll
    ' for real accounts (even in test mode), please make sure that you are
    ' posting to: https://secure.authorize.net/gateway/transact.dll
    cmdCharge.Enabled = False
    lblResponse.Text = "Processing....."
    Application.DoEvents()
    Dim post_url
    post_url = "https://test.authorize.net/gateway/transact.dll"

    Dim post_values As New Dictionary(Of String, String)

    'the API Login ID and Transaction Key must be replaced with valid values
    post_values.Add("x_login", "XXXXXXX")
    post_values.Add("x_tran_key", "XXXXXXXXX")
    'post_values.Add("x_test_request", "TRUE")
    post_values.Add("x_delim_data", "TRUE")
    post_values.Add("x_delim_char", "|")
    post_values.Add("x_relay_response", "FALSE")

    post_values.Add("x_type", "AUTH_CAPTURE")
    post_values.Add("x_method", "CC")
    post_values.Add("x_card_num", txtCard.Text)
    post_values.Add("x_exp_date", txtExp.Text)

    post_values.Add("x_amount", txtAmount.Text)
    'post_values.Add("x_description", "Sample Transaction")

    post_values.Add("x_first_name", txtFirst.Text)
    post_values.Add("x_last_name", txtLast.Text)
    'post_values.Add("x_address", "1234 Street")
    'post_values.Add("x_state", "WA")
    post_values.Add("x_zip", txtZip.Text)
    post_values.Add("x_card_code", txt3CV.Text)

    ' Additional fields can be added here as outlined in the AIM integration
    ' guide at: http://developer.authorize.net

    ' This section takes the input fields and converts them to the proper format
    ' for an http post.  For example: "x_login=username&x_tran_key=a1B2c3D4"
    Dim post_string As String = ""
    For Each field As KeyValuePair(Of String, String) In post_values
        post_string &= field.Key & "=" & field.Value & "&"
    Next
    ' post_string = Left(post_string, Len(post_string) - 1)
    post_string = post_string.Substring(0, Len(post_string) - 1)

    ' create an HttpWebRequest object to communicate with Authorize.net
    Dim objRequest As HttpWebRequest = CType(WebRequest.Create(post_url), HttpWebRequest)
    objRequest.Method = "POST"
    objRequest.ContentLength = post_string.Length
    objRequest.ContentType = "application/x-www-form-urlencoded"

    ' post data is sent as a stream
    Dim myWriter As StreamWriter = Nothing
    myWriter = New StreamWriter(objRequest.GetRequestStream())
    myWriter.Write(post_string)
    myWriter.Close()

    ' returned values are returned as a stream, then read into a string
    Dim objResponse As HttpWebResponse = CType(objRequest.GetResponse(), HttpWebResponse)
    Dim responseStream As New StreamReader(objResponse.GetResponseStream())
    Dim post_response As String = responseStream.ReadToEnd()
    responseStream.Close()

    ' the response string is broken into an array
    Dim response_array As Array = Split(post_response, post_values("x_delim_char"), -1)

    ' the results are output to the screen in the form of an html numbered list.
    Select Case response_array(0)

        Case "1" 'Approved
            lblResponse.Text = "Transaction Approved. " & vbCrLf & response_array(4)

        Case "2" 'Declined
            lblResponse.Text = "Transaction Declined. " & vbCrLf & response_array(3)

        Case "3" 'Error
            lblResponse.Text = "Transaction Error. " & vbCrLf & response_array(3)

        Case "4" 'Held for Review
            lblResponse.Text = "Transaction Held. " & vbCrLf & response_array(3)

    End Select

    ' individual elements of the array could be accessed to read certain response
    ' fields.  For example, response_array(0) would return the Response Code,
    ' response_array(2) would return the Response Reason Code.
    ' for a list of response fields, please review the AIM Implementation Guide

    cmdCharge.Enabled = True
End Sub

Authorize.net is very easy to use. All you need to do to process cards is to send an https post in XML format. There are several examples on the Authorize.net developer site.
As far as swiping cards, most card readers emulate keyboard presses. A swiped card looks similar to this:

'%B5500692805076849^SMITH/STEPHEN A^12041010000000      00969000000?;5500692805076849=12041010000000969?`

Then parse the card number "5500692805076849", Name "SMITH/STEPHEN A" and expiration date "1204"
and pass those on the Authorize.net

Private Sub cmdCharge_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdCharge.Click
    ' By default, this sample code is designed to post to our test server for
    ' developer accounts: https://test.authorize.net/gateway/transact.dll
    ' for real accounts (even in test mode), please make sure that you are
    ' posting to: https://secure.authorize.net/gateway/transact.dll
    cmdCharge.Enabled = False
    lblResponse.Text = "Processing....."
    Application.DoEvents()
    Dim post_url
    post_url = "https://test.authorize.net/gateway/transact.dll"

    Dim post_values As New Dictionary(Of String, String)

    'the API Login ID and Transaction Key must be replaced with valid values
    post_values.Add("x_login", "XXXXXXX")
    post_values.Add("x_tran_key", "XXXXXXXXX")
    'post_values.Add("x_test_request", "TRUE")
    post_values.Add("x_delim_data", "TRUE")
    post_values.Add("x_delim_char", "|")
    post_values.Add("x_relay_response", "FALSE")

    post_values.Add("x_type", "AUTH_CAPTURE")
    post_values.Add("x_method", "CC")
    post_values.Add("x_card_num", txtCard.Text)
    post_values.Add("x_exp_date", txtExp.Text)

    post_values.Add("x_amount", txtAmount.Text)
    'post_values.Add("x_description", "Sample Transaction")

    post_values.Add("x_first_name", txtFirst.Text)
    post_values.Add("x_last_name", txtLast.Text)
    'post_values.Add("x_address", "1234 Street")
    'post_values.Add("x_state", "WA")
    post_values.Add("x_zip", txtZip.Text)
    post_values.Add("x_card_code", txt3CV.Text)

    ' Additional fields can be added here as outlined in the AIM integration
    ' guide at: http://developer.authorize.net

    ' This section takes the input fields and converts them to the proper format
    ' for an http post.  For example: "x_login=username&x_tran_key=a1B2c3D4"
    Dim post_string As String = ""
    For Each field As KeyValuePair(Of String, String) In post_values
        post_string &= field.Key & "=" & field.Value & "&"
    Next
    ' post_string = Left(post_string, Len(post_string) - 1)
    post_string = post_string.Substring(0, Len(post_string) - 1)

    ' create an HttpWebRequest object to communicate with Authorize.net
    Dim objRequest As HttpWebRequest = CType(WebRequest.Create(post_url), HttpWebRequest)
    objRequest.Method = "POST"
    objRequest.ContentLength = post_string.Length
    objRequest.ContentType = "application/x-www-form-urlencoded"

    ' post data is sent as a stream
    Dim myWriter As StreamWriter = Nothing
    myWriter = New StreamWriter(objRequest.GetRequestStream())
    myWriter.Write(post_string)
    myWriter.Close()

    ' returned values are returned as a stream, then read into a string
    Dim objResponse As HttpWebResponse = CType(objRequest.GetResponse(), HttpWebResponse)
    Dim responseStream As New StreamReader(objResponse.GetResponseStream())
    Dim post_response As String = responseStream.ReadToEnd()
    responseStream.Close()

    ' the response string is broken into an array
    Dim response_array As Array = Split(post_response, post_values("x_delim_char"), -1)

    ' the results are output to the screen in the form of an html numbered list.
    Select Case response_array(0)

        Case "1" 'Approved
            lblResponse.Text = "Transaction Approved. " & vbCrLf & response_array(4)

        Case "2" 'Declined
            lblResponse.Text = "Transaction Declined. " & vbCrLf & response_array(3)

        Case "3" 'Error
            lblResponse.Text = "Transaction Error. " & vbCrLf & response_array(3)

        Case "4" 'Held for Review
            lblResponse.Text = "Transaction Held. " & vbCrLf & response_array(3)

    End Select

    ' individual elements of the array could be accessed to read certain response
    ' fields.  For example, response_array(0) would return the Response Code,
    ' response_array(2) would return the Response Reason Code.
    ' for a list of response fields, please review the AIM Implementation Guide

    cmdCharge.Enabled = True
End Sub
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文