|
@@ 519-533 (lines=15) @@
|
| 516 |
|
|
| 517 |
|
$payment_added = $this->update( array( 'payment_ids' => $new_payment_ids ) ); |
| 518 |
|
|
| 519 |
|
if ( $payment_added ) { |
| 520 |
|
|
| 521 |
|
$this->payment_ids = $new_payment_ids; |
| 522 |
|
|
| 523 |
|
// We added this payment successfully, increment the stats |
| 524 |
|
if ( $update_stats ) { |
| 525 |
|
$payment_amount = give_donation_amount( $payment_id, array( 'type' => 'stats' ) ); |
| 526 |
|
|
| 527 |
|
if ( ! empty( $payment_amount ) ) { |
| 528 |
|
$this->increase_value( $payment_amount ); |
| 529 |
|
} |
| 530 |
|
|
| 531 |
|
$this->increase_purchase_count(); |
| 532 |
|
} |
| 533 |
|
} |
| 534 |
|
|
| 535 |
|
/** |
| 536 |
|
* Fires after attaching payments to the donor. |
|
@@ 604-618 (lines=15) @@
|
| 601 |
|
|
| 602 |
|
$payment_removed = $this->update( array( 'payment_ids' => $new_payment_ids ) ); |
| 603 |
|
|
| 604 |
|
if ( $payment_removed ) { |
| 605 |
|
|
| 606 |
|
$this->payment_ids = $new_payment_ids; |
| 607 |
|
|
| 608 |
|
if ( $update_stats ) { |
| 609 |
|
// We removed this payment successfully, decrement the stats |
| 610 |
|
$payment_amount = give_donation_amount( $payment_id ); |
| 611 |
|
|
| 612 |
|
if ( ! empty( $payment_amount ) ) { |
| 613 |
|
$this->decrease_value( $payment_amount ); |
| 614 |
|
} |
| 615 |
|
|
| 616 |
|
$this->decrease_donation_count(); |
| 617 |
|
} |
| 618 |
|
} |
| 619 |
|
|
| 620 |
|
/** |
| 621 |
|
* Fires after removing payments from donors. |