管理国际用户

时间:2013-10-14 14:44:16

标签: paypal

付款收集存在三个主要问题:

我们公司处理匈牙利产品,包括重音字符的产品描述。新的RestAPI可以成功管理付款以解决第一轮,但我无法通过paypal服务器重音字符。

如果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付款之前通过PayPal RestAPI(或其他方式)将客户数据发送到服务器?

感谢任何帮助!

1 个答案:

答案 0 :(得分:1)

Paypal只接受UTF-8。我没有尝试过匈牙利语,但是UTF-8将会覆盖它。确保所有通话都以这种方式编码,并且应该通过。

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

至于如何向Paypal发送数据,我发现CURL对此非常有用。