Give_Helper_Payment::create_simple_payment_with_fee PHP Method

create_simple_payment_with_fee() public static method

Create Simple Donation w/ Fee
    public static function create_simple_payment_with_fee()
    {
        global $give_options;
        // Enable a few options
        $give_options['sequential_prefix'] = 'GIVE-';
        $simple_form = Give_Helper_Form::create_simple_form();
        // Generate some sales
        $user = get_userdata(1);
        $user_info = array('id' => $user->ID, 'email' => $user->user_email, 'first_name' => $user->first_name, 'last_name' => $user->last_name);
        $donation_details = array(array('id' => $simple_form->ID, 'options' => array('price_id' => 0), 'quantity' => 2));
        $total = 0;
        $simple_price = get_post_meta($simple_form->ID, 'give_price', true);
        $total += $simple_price;
        $payment_details = array(array('name' => 'Test Donation', 'id' => $simple_form->ID, 'options' => array('price_id' => 1), 'price' => $simple_price * 2, 'item_price' => $simple_price, 'quantity' => 2));
        $purchase_data = array('price' => number_format((double) $total, 2), 'date' => date('Y-m-d H:i:s', strtotime('-1 day')), 'purchase_key' => strtolower(md5(uniqid())), 'user_email' => $user_info['email'], 'user_info' => $user_info, 'currency' => 'USD', 'donations' => $donation_details, 'payment_details' => $payment_details, 'status' => 'pending');
        $fee_args = array('label' => 'Test Fee', 'type' => 'test', 'amount' => 5);
        //@TODO: Incorporate Fees
        //Give()->fees->add_fee( $fee_args );
        $_SERVER['REMOTE_ADDR'] = '127.0.0.1';
        $_SERVER['SERVER_NAME'] = 'give_virtual';
        $payment_id = give_insert_payment($purchase_data);
        $transaction_id = 'FIR3SID3';
        $payment = new Give_Payment($payment_id);
        $payment->transaction_id = $transaction_id;
        $payment->save();
        give_insert_payment_note($payment_id, sprintf(esc_html__('PayPal Transaction ID: %s', 'give'), $transaction_id));
        return $payment_id;
    }