delete_payment() public static method

Delete a payment.
Since: 1.0
public static delete_payment ( integer $payment_id )
$payment_id integer ID of the payment to delete.
Beispiel #1
0
 /**
  * Tear it Down
  */
 public function tearDown()
 {
     global $wpdb;
     parent::tearDown();
     Give_Helper_Payment::delete_payment($this->_payment_id);
     Give_Helper_Payment::delete_payment($this->_payment_id2);
     $wpdb->query("DELETE FROM {$wpdb->options} WHERE option_name LIKE 'give_stats_%'");
 }
 /**
  * Test Remove Donation Payment by Price ID
  */
 public function test_remove_with_multi_price_points_by_price_id()
 {
     Give_Helper_Payment::delete_payment($this->_payment_id);
     $form = Give_Helper_Form::create_multilevel_form();
     $payment = new Give_Payment();
     //Add a multi-level donation amount
     $payment->add_donation($form->ID, array('price_id' => 2));
     $this->assertEquals(25, $payment->total);
     $payment->status = 'complete';
     $payment->save();
     //Now remove it
     $payment->remove_donation($form->ID, array('price_id' => 2));
     $payment->save();
     $this->assertEmpty($payment->price_id);
     $this->assertEquals(0, $payment->total);
 }
Beispiel #3
0
 /**
  * Tear it Down
  */
 public function tearDown()
 {
     parent::tearDown();
     remove_action('give_api_output_override_xml', array($this, 'override_api_xml_format'));
     Give_Helper_Payment::delete_payment($this->_payment_id);
 }