我一直在使用快速结账API将我网站上的人员帐户转换为付款后的高级帐户.唯一的问题是它不会将用户发回网站,直到他们点击按钮返回,并在发生这种情况时更新他们的权限.大约40%的用户似乎没有这样做....所以他们的帐户永远不会在付款后得到记入.
尽管paypal在成功支付后立即回复,但我从来没有能够立即更新用户的帐户,因为我无法将其发送回某些信息,以确定刚完成付款的用户.当你被送回发送交易ID的网站时,我只能这样做,我用回发后记录.它搜索它,并在DB中找到它时授予权限.
有没有办法向paypal提交某种变量,然后它会发回给我?像&user_id = 123这样的东西,可以非常方便地更新用户的权限.
我收到了API凭据,但我需要api应用程序ID来发送Adaptive Accounts API请求.
我用他们的沙箱应用程序ID:APP-80W284485P519543T.
现在是时候上线了.
我正在使用cUrl和PHP向服务器发出请求(用于访问PayPal)
Paypal开发者网站从未提及使用PayPal访问API需要SSL证书,但是我用来请求令牌的代码如下:
$options = array(
CURLOPT_URL => $url,
CURLOPT_POST => 1,
CURLOPT_VERBOSE => 1,
CURLOPT_POSTFIELDS => $postvals,
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_SSLVERSION => 3
);
curl_setopt_array($ch, $options);
$response = curl_exec($ch);
echo curl_error($ch);
Run Code Online (Sandbox Code Playgroud)
此echo输出以下错误:
SSL certificate problem: unable to get local issuer certificate
Run Code Online (Sandbox Code Playgroud)
我的问题是:
1)如果我只需要获取用户电子邮件,是否需要SSL才能使用PayPal访问?
2)如果我不需要SSL,为什么会出现此错误?
PS:端点如下:https://www.sandbox.paypal.com/webapps/auth/protocol/openidconnect/v1/tokenservice
错误:安全标头无效数组
(
[TIMESTAMP] => 2014%2d04%2d29T07%3a24%3a29Z
[CORRELATIONID] => 6af6749c848d6
[ACK] => Failure
[VERSION] => 109%2e0
[BUILD] => 10800277
[L_ERRORCODE0] => 10002
[L_SHORTMESSAGE0] => Security%20error
[L_LONGMESSAGE0] => Security%20header%20is%20not%20valid
[L_SEVERITYCODE0] => Error
)
Run Code Online (Sandbox Code Playgroud)
我一次又一次地得到这个错误,无法继续前进.我已经检查了所有的api用户名,密码和签名,一切都是正确的,但主要的问题是,所有的东西都已存储在paypal沙盒帐户中,但它无法返回页面.我的意思是说横切显示在沙盒帐户中,但它不能发送到显示页面.我错了吗?
刚试图在新的PayPal网站上找到新的IPN历史记录链接,我无法在任何地方看到它.
他们还在支持吗?
我一直在尝试使用一些有用的Java代码来加密Paypal按钮.这不是一件容易的事!即使我从Paypal获得一些代码,我也面临着错误......
所以我到目前为止,我认为最终会有所作为.
我从Paypal的网站上下载了Java.zip文件.其中有两个类 - ClientSide.java和ButtonEncryption.java
问题 -我收到了一个InvalidKeyException : Illegal key size错误.
问题
1)如何解决此问题?2)什么行代码抛出错误?
C:\jakarta-tomcat\webapps\PlanB\WEB-INF\classes>java palmb.servlets.paypal.ButtonEncryption
java.io.IOException: exception decrypting data - java.security.InvalidKeyException: Illegal key size
at org.bouncycastle.jce.provider.JDKPKCS12KeyStore.cryptData(Unknown Source)
at org.bouncycastle.jce.provider.JDKPKCS12KeyStore.engineLoad(Unknown Source)
at java.security.KeyStore.load(Unknown Source)
at palmb.servlets.paypal.ClientSide.getButtonEncryptionValue(ClientSide.java:63)
at palmb.servlets.paypal.ButtonEncryption.main(ButtonEncryption.java:81)
Run Code Online (Sandbox Code Playgroud)
package palmb.servlets.paypal;
import java.io.ByteArrayOutputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.security.InvalidAlgorithmParameterException;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;
import java.security.PrivateKey;
import java.security.UnrecoverableKeyException;
import java.security.cert.CertStore;
import java.security.cert.CertStoreException;
import java.security.cert.CertificateException;
import java.security.cert.CertificateFactory;
import java.security.cert.CollectionCertStoreParameters;
import java.security.cert.X509Certificate;
import java.util.ArrayList;
import …Run Code Online (Sandbox Code Playgroud) 我有一个英国PayPal商业帐户.我目前正在开发一个网站支付系统,使用Express Checkout向此帐户付款.
到目前为止,我的PHP代码正在运行,我可以连接到沙箱并设置和表达结帐.下一步是将用户重定向到PayPal沙箱以进行测试付款.
就此而言,我被困住了.我不能创建一个'个人测试'帐户用作PayPal沙箱上的"客户".
我这样想:
然后我收到以下消息:
我们很抱歉,但出了点问题.请删除此帐户,然后重试.
当它说"删除此帐户"时,我不知道它实际意味着什么,因为它还没有创建一个新的个人帐户,其中包含我刚刚输入的详细信息(至少不是我可以在任何地方看到的).我甚至尝试创建一个新的企业帐户来创建这个个人帐户,这没有任何区别.
还有其他人遇到问题吗?我有点卡住了.我可以使用我的"真实"个人PayPal帐户在沙盒上进行测试,而不会有丢失任何真实资金到我设置的测试业务帐户的风险吗?
我想测试paypal订阅IPN,包括创建订阅时收到的IPN,以及稍后发送的下一次付款的IPN(如每月订阅为$ x,则为每月).
但是我宁愿不等一个月或一天才能收到第二个IPN.有没有办法使用paypal或他们的沙箱更快地发送IPN,例如每小时?
在文档中,它说您只能指定年,月,日和周作为订阅期.
某些API(如paypal API)使用JSON中的字符串类型来表示十进制数.所以"7.47"代替7.47.
为什么/何时使用json数值类型是个好主意?AFAIK数值类型允许无限精度以及科学记数法.
它在一周之前运作良好,但现在它显示以下错误.我尝试过以下的东西,但没有用.
ServicePointManager.Expect100Continue = true;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;
Run Code Online (Sandbox Code Playgroud)
所以建议我可能的解决方案
public string HttpCall(string NvpRequest) //CallNvpServer
{
string url = pendpointurl;
//To Add the credentials from the profile
string strPost = NvpRequest + "&" + buildCredentialsNVPString();
strPost = strPost + "&BUTTONSOURCE=" + HttpUtility.UrlEncode(BNCode);
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;
// allows for validation of SSL conversations
ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
HttpWebRequest objRequest = (HttpWebRequest)WebRequest.Create(url);
objRequest.Timeout = Timeout;
objRequest.Method = "POST";
objRequest.ContentLength = strPost.Length;
try
{
using (StreamWriter myWriter = new StreamWriter(objRequest.GetRequestStream()))
{
myWriter.Write(strPost); …Run Code Online (Sandbox Code Playgroud)