mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +08:00
check if refund reason exists
This commit is contained in:
parent
d6abaafadb
commit
f236ad67ae
1 changed files with 2 additions and 1 deletions
|
@ -42,10 +42,11 @@ class CaptureFactory {
|
||||||
*/
|
*/
|
||||||
public function from_paypal_response( \stdClass $data ) : Capture {
|
public function from_paypal_response( \stdClass $data ) : Capture {
|
||||||
|
|
||||||
|
$reason = isset ( $data->status_details->reason ) ? (string) $data->status_details->reason : '';
|
||||||
return new Capture(
|
return new Capture(
|
||||||
(string) $data->id,
|
(string) $data->id,
|
||||||
(string) $data->status,
|
(string) $data->status,
|
||||||
(string) $data->status_details->reason,
|
$reason,
|
||||||
$this->amount_factory->from_paypal_response( $data->amount ),
|
$this->amount_factory->from_paypal_response( $data->amount ),
|
||||||
(bool) $data->final_capture,
|
(bool) $data->final_capture,
|
||||||
(string) $data->seller_protection->status,
|
(string) $data->seller_protection->status,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue