mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +08:00
Fix null access
This commit is contained in:
parent
92eef9ceb9
commit
d91131cb06
2 changed files with 10 additions and 7 deletions
|
@ -173,8 +173,9 @@ class Capture {
|
|||
'invoice_id' => $this->invoice_id(),
|
||||
'custom_id' => $this->custom_id(),
|
||||
);
|
||||
if ( $this->status()->details() ) {
|
||||
$data['status_details'] = array( 'reason' => $this->status()->details()->reason() );
|
||||
$details = $this->status()->details();
|
||||
if ( $details ) {
|
||||
$data['status_details'] = array( 'reason' => $details->reason() );
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
|
|
@ -55,8 +55,9 @@ trait PaymentsStatusHandlingTrait {
|
|||
): void {
|
||||
$status = $capture->status();
|
||||
|
||||
if ( $status->details() ) {
|
||||
$this->add_status_details_note( $wc_order, $status->name(), $status->details()->text() );
|
||||
$details = $status->details();
|
||||
if ( $details ) {
|
||||
$this->add_status_details_note( $wc_order, $status->name(), $details->text() );
|
||||
}
|
||||
|
||||
switch ( $status->name() ) {
|
||||
|
@ -95,8 +96,9 @@ trait PaymentsStatusHandlingTrait {
|
|||
): void {
|
||||
$status = $authorization->status();
|
||||
|
||||
if ( $status->details() ) {
|
||||
$this->add_status_details_note( $wc_order, $status->name(), $status->details()->text() );
|
||||
$details = $status->details();
|
||||
if ( $details ) {
|
||||
$this->add_status_details_note( $wc_order, $status->name(), $details->text() );
|
||||
}
|
||||
|
||||
switch ( $status->name() ) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue