0

收款存在三大问题:

我们公司经营匈牙利产品,包括重音字符的产品描述。新的 RestAPI 可以成功管理支付解决第一轮,但我不能重音字符通过贝宝服务器。

如果我正在使用 HTML.Encoding,则结帐页面上将显示的密文不会解码 Paypal 服务器。(环境:Windows、.NET、C#)

所以:

1.如何在项目名称中使用重音字符?

更新:

我尝试了 UTF8 如下:

1.1。获取访问令牌:

curl https://api.sandbox.paypal.com/v1/oauth2/token \
 -H "Accept: application/json" \
 -H "Content-Type: charset=UTF-8" \
 -H "Accept-Language: hu_HU" \
 -u "EOJ2S-Z6OoN_le_KS1d75wsZ6y0SFdVsY9183IvxFyZp:EClusMEUk8e9ihI7ZdVLF5cZ6y0SFdVsY9183IvxFyZp" \
 -d "grant_type=client_credentials"

1.2. 回答:

{"scope":"openid https://api.paypal.com/v1/payments/.* https://api.paypal.com/v1/vault/credit-card/.* https://api.paypal.com/v1/vault/credit-card 

https://api.paypal.com/v1/developer/.*",
"access_token":"5tz416Qgym8Si9RM0nBS4DNSrGRFCMu5vZ923s--hLM",
"token_type":"Bearer",
"app_id":"APP-8KK24973T6066201W",
"expires_in":28800
}

1.3. 内容 json(我用记事本保存为 UTF-8 文本文件,名称为“content-utf8.json”)

{
  "intent":"sale",
  "redirect_urls":{
    "return_url":"http://example.com/your_redirect_url/",
    "cancel_url":"http://example.com/your_cancel_url/"
  },
  "payer":{
    "payment_method":"paypal"
  },
  "transactions":[
    {
      "amount":{
        "total":"7.47",
        "currency":"USD"
      },
      "description":**"Árvíztűrő tükörfúrógépes tanfolyam"**
    }
  ]
}

1.4. 发送付款

curl -v https://api.sandbox.paypal.com/v1/payments/payment \
-H 'Content-Type:application/json; charset=utf-8' \
-H 'Authorization:Bearer 5tz416Qgym8Si9RM0nBS4DNSrGRFCMu5vZ923s--hLM' \
--data 'content-utf8.json'

1.5。答案

* Adding handle: conn: 0x1385f58
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x1385f58) send_pipe: 1, recv_pipe: 0
* About to connect() to api.sandbox.paypal.com port 443 (#0)
*   Trying 23.42.27.39...
* Connected to api.sandbox.paypal.com (23.42.27.39) port 443 (#0)
* successfully set certificate verify locations:
*   CAfile: C:\Program Files\Git\bin\curl-ca-bundle.crt
  CApath: none
* SSLv3, TLS handshake, Client hello (1):
* SSLv3, TLS handshake, Server hello (2):
* SSLv3, TLS handshake, CERT (11):
* SSLv3, TLS handshake, Request CERT (13):
* SSLv3, TLS handshake, Server finished (14):
* SSLv3, TLS handshake, CERT (11):
* SSLv3, TLS handshake, Client key exchange (16):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSL connection using RC4-SHA
* Server certificate:
*        subject: C=US; ST=CALIFORNIA; L=San Jose; O=PayPal, Inc.; OU=Partner Su
pport; CN=api.sandbox.paypal.com
*        start date: 2013-08-20 00:00:00 GMT
*        expire date: 2015-08-21 23:59:59 GMT
*        subjectAltName: api.sandbox.paypal.com matched
*        issuer: C=US; O=VeriSign, Inc.; OU=VeriSign Trust Network; OU=Terms of
use at https://www.verisign.com/rpa (c)10; CN=VeriSign Class 3 Secure Server CA
- G3
*        SSL certificate verify ok.
> POST /v1/payments/payment HTTP/1.1
> User-Agent: curl/7.30.0
> Host: api.sandbox.paypal.com
> Accept: */*
> Content-Type:application/json; charset=utf-8
> Authorization:Bearer 5tz416Qgym8Si9RM0nBS4DNSrGRFCMu5vZ923s--hLM
> Content-Length: 12
>
* upload completely sent off: 12 out of 12 bytes
< HTTP/1.1 400 Bad Request
* Server Apache-Coyote/1.1 is not blacklisted
< Server: Apache-Coyote/1.1
< PayPal-Debug-Id: eb749926be259
< Content-Type: application/json;charset=UTF-8
< Content-Length: 200
< DC: origin2-api.sandbox.paypal.com
< Date: Tue, 15 Oct 2013 09:03:52 GMT
< Connection: close
< Set-Cookie: DC=origin2-api.sandbox.paypal.com; secure
<
{"name":"MALFORMED_REQUEST",
"message":"The request JSON is not well formed.",
"information_link":"https://developer.paypal.com/webapps/developer/docs/api/#MALFORMED_REQUEST",
"debug_id":"eb749926be259"}
* Closing connection 0
* SSLv3, TLS alert, Client hello (1):

底线: **MALFORMED_REQUEST:请求 JSON 格式不正确。**

+++

我们计划为来自不同国家的客户提供服务,因此如果通过 PayPal 支付页面(如果语言支持)以他们的语言显示,那就太好了。

2. Paypal的approval_url页面返回英文/匈牙利文(或paypal支持的任何其他语言),我该如何解决?

当付款客户重定向到您可以使用信用卡付款的 PayPal 网站时,您应该填写一些字段(名字、姓氏、地址、电话等)。如果我们可以检索这些字段转发数据,Tulum 会很好。

+++

3.我如何通过PayPal RestAPI(或其他方式)在PayPal付款之前将客户端数据发送到服务器?

任何帮助表示赞赏!

4

1 回答 1

1

Paypal 仅接受 UTF-8。我没有尝试过匈牙利语,但 UTF-8 会涵盖这一点。确保您的所有呼叫都以这种方式编码,并且它们应该通过。

Paypal 可能会以最接近他们的语言向他们显示页面。我没有看到在本页列出的 LOCALECODE 中明确列出了匈牙利语。对不起,我不能在这里提供更多帮助。

至于如何向 Paypal 发送数据,我发现 CURL 非常适合这一点。

于 2013-10-15T03:15:10.563 回答