显示paypal错误

This commit is contained in:
Edward Yang 2022-11-22 13:59:31 +08:00
parent eb16ddf105
commit 940b82cdeb
2 changed files with 7 additions and 3 deletions

View File

@ -69,6 +69,7 @@ class PaypalController
$orderNumber = $data['orderNumber'];
$customer = current_customer();
$order = OrderRepo::getOrderByNumber($orderNumber, $customer);
$total = round($order->total, 2);
$paypalOrder = $this->paypalClient->createOrder([
"intent" => "CAPTURE",
@ -76,7 +77,7 @@ class PaypalController
[
"amount" => [
"currency_code" => $order->currency_code,
"value" => $order->total,
"value" => $total,
],
'description' => 'test'
]

View File

@ -23,10 +23,13 @@
orderNumber: "{{$order->number}}",
})
}).then(function (res) {
//res.json();
return res.json();
}).then(function (orderData) {
//console.log(orderData);
if (orderData.error) {
layer.alert(orderData.error.details[0].description, function(index){
window.location.reload();
});
}
return orderData.id;
});
},