0
我目前使用Braintree付款。我能夠使用我的iOS在儀表板中創建成功的付款問題是我正在嘗試返回客戶端(iOS)的回覆,現在它返回「」,感謝您提前給予幫助。如何從Braintree付款獲得標題回覆php
我當前的PHP
<?php
require_once("../includes/braintree_init.php");
//$amount = $_POST["amount"];
//$nonce = $_POST["payment_method_nonce"];
$nonce = "fake-valid-nonce";
$amount = "10";
$result = Braintree\Transaction::sale([
'amount' => $amount,
'paymentMethodNonce' => $nonce
]);
我的客戶
URLSession.shared.dataTask(with: request as URLRequest) { (data, response, error) -> Void in
// TODO: Handle success or failure
let responseData = String(data: data!, encoding: String.Encoding.utf8)
// Log the response in console
print(responseData);
// Display the result in an alert view
DispatchQueue.main.async(execute: {
let alertResponse = UIAlertController(title: "Result", message: "\(responseData)", preferredStyle: UIAlertControllerStyle.alert)
// add an action to the alert (button)
alertResponse.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.default, handler: nil))
// show the alert
self.present(alertResponse, animated: true, completion: nil)
})
} .resume()
你能給我一個json序列化的例子爲「$ processed_result =」 – pprevalon