サイクロス3.7.3に関する知識を持っている人には、私はwebshopの支払い作業をしようとしていますが、エラーを見つけることができ、チケットを生成する際にエラーが発生しました。私は未定義のプロパティを得た後、チケットを印刷:
はstdClass ::ラインCで$リターン:\ xamppの\ htdocsに\ cyclos_ws \ prepare_payment.phpライン29
にこれは私が使用するコードです。 ありがとうございます。
<?php
// Get the web service proxy
require_once 'cyclos.php';
$cyclos = new Cyclos();
$webShopService = $cyclos->service('webshop');
if (isset($_POST['user'])) {
$user = $_POST['user'];
$description = $_POST['description'];
$amount = $_POST['amount'];
$adsip = $_POST['adsip'];
}
// Setup the payment parameters
$params = new stdclass();
$params->amount = $amount;
$params->description = '$description';
$params->clientAddress = '$adsip';
$params->toUsername = '$user';
// This should be the absolute url for the page which will process the payment
$params->returnUrl = "http://localhost/cyclos_ws/complete_payment.php";
// Generate the ticket
try {
//Ensure the input parameter is named 'params' and the output, 'return'
$ticket = $webShopService->generate(array('params' => $params))->return; //line 29
} catch (SoapFault $e) {
die("Error generating a payment ticket: $e");
}
print_r($ticket);
// With the ticket ok, redirect the client to perform the payment
//header("Location: ".Cyclos::$server_root."/do/webshop/payment?ticket=".$ticket) ;
?>
コードに何か不足している可能性があります。ドキュメントをチェックしてください。 https://www.cyclos.org/wiki/index.php?title=Web_services/WebShop_payment – Perumal
私はチェックして再学習しましたが、何もありません – user3143519
$ webShopService-> generate(array( ' params => $ params))var_dump()を使っていますか? 'return'変数がオブジェクトのルートにない可能性があります。 –