这是一个深夜.我只是花了10个小时在google/stackoverflow搜索和实验.似乎我讨厌Apple推送通知.我非常沮丧,并会感激任何帮助.
谢谢.
用于发送两周前成功运行的Apple推送通知的PHP代码现在停止工作并抛出以下错误:
PHP Warning: stream_socket_client(): Failed to enable crypto in /home/...
PHP Warning: stream_socket_client(): unable to connect to ssl://gateway.push.apple.com:2195 (Unknown error) in /home/...
Run Code Online (Sandbox Code Playgroud)
它停止在两个单独的服务器上工作,这些服务器使用单独的脚本进行APN发送.
服务器:带有PHP 5.4.32的CentOS 6.5和带有PHP 5.5.9的Ubuntu 14.04.3
APN:在生产模式下
证书:使用700多个推送通知进行测试.
其中一台服务器使用https://github.com/immobiliare/ApnsPHP,其他 - https://github.com/antongorodezkiy/wp-apn,在localhost上我测试了简单文件而不使用任何第三方代码.
对于以下所有情况,我使用相同的活动设备令牌和相同的生产PEM证书.
但是,即使这个简单的代码也无法在服务器和localhost上运行,并返回与上面相同的错误:
$ctx = stream_context_create();
stream_context_set_option($ctx, 'ssl', 'local_cert', '/absolute/path/to/apn_prod.pem');
// Open a connection to the APNS server
$fp = stream_socket_client(
'ssl://gateway.push.apple.com:2195', $err,
$errstr, 60, STREAM_CLIENT_CONNECT|STREAM_CLIENT_PERSISTENT, $ctx);
Run Code Online (Sandbox Code Playgroud)
我还尝试使用stream_context_set_option()
选项,包括entrust_2048_ca.cer
等,甚至本文中的一些选项.虽然提供的代码在2015年8月之前没有任何修改.
连接使用openssl( …
我在webhooks list中没有找到一些refund
webhook 。
在这种情况下,支付 webhook可以帮助我吗https://developers.braintree payments.com/reference/general/webhooks/disbursement/php?
[编辑#1]:我已经对其进行了测试,发现在 Braintree 沙箱管理中单击退款按钮后,支付 webhook不会触发。
所以我认为没有退款网络钩子。现在,我最终完成了预定的 cron 任务,以从 Braintree API 获取退款交易:
$collection = Braintree_Transaction::search([
Braintree_TransactionSearch::createdAt()->greaterThanOrEqualTo($hourAgo),
Braintree_TransactionSearch::type()->is(Braintree_Transaction::CREDIT),
Braintree_TransactionSearch::refund()->is(true)
]);
Run Code Online (Sandbox Code Playgroud)
PS 嘿,投反对票的人,为什么不在评论中论证你的观点呢?至少对于找到该线程的人来说可能会有所帮助。