我正在使用Paypal / Braintree和PHP sdk并设置Vault流程来创建订阅。这一切在Sandbox中运行良好,但现在在产品中我收到错误代码93108,消息:Unknown paymentMethodNonce。
我的客户端代码是:
$cargs = array(
'firstName' => $entry["6.3"],
'lastName' => $entry["6.6"],
'company' => $entry["18"],
'email' => $entry["7"]
$cargs['paymentMethodNonce'] = $_SESSION['wswp_payment_token'];
file_put_contents(dirname(__FILE__)."/logbeforectry.php",print_r($cargs,true));
try {
// Configure Braintree environment
Braintree_Configuration::environment( strtolower( $settings['environment'] ) );
Braintree_Configuration::merchantId( $settings['merchant-id']);
Braintree_Configuration::publicKey( $settings['public-key'] );
Braintree_Configuration::privateKey( $settings['private-key'] );
$cresult = Braintree_Customer::create($cargs);
file_put_contents(dirname(__FILE__)."/logcresult.php",print_r($cresult,true));
}
catch( Exception $e ) {
file_put_contents(dirname(__FILE__)."/catchcresult.php",print_r($e->getMessage(),true));
// Do nothing with exception object, just fallback to generic failure
}
在Ajax请求中我保存了nonce,然后在Braintree_Customer :: create
中使用它我的服务器端代码是:
sql_get = "SELECT tblContacts.*, tblJobTitles.* FROM tblJobTitles INNER JOIN (tblContacts INNER JOIN tblTeams ON tblContacts.Team = tblTeams.ID) ON tblJobTitles.ID = tblContacts.JobTitle WHERE [tblTeams].[team]= '" & cboDepartments.Value & "'"
Me.frmstaticdatadepartments08.Form.RecordSource = sql_get
如上所述,它会带回错误响应。我检查了$ cargs的参数都应该填充,包括nonce在通过弹出窗口登录后填充了payment_method_nonce的值。奇怪的是,如果你点击按钮并再次授权就行了。请帮助我用这个撕掉我的头发。