<?php

namespace WooCommerce\Plugin\AddonPayments\Entities;

class CardAttempts {
	public $id_attempt;
	public $customer_id;
	public $rawData;
	public $date;

	public function save() {
		global $wpdb;
		$dbPrefix         = $wpdb->prefix;
		$this->id_attempt = $wpdb->insert(
			"{$dbPrefix}epg_card_attempts",
			array(
				'customer_id' => $this->customer_id,
				'rawData'     => $this->rawData,
				'date'        => $this->date,
			)
		);

		return $this->id_attempt;
	}
}
