diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..ef96f6a --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,4 @@ +##iyzico Payment Moodle Plugin Change Log + +1.0 (2021011404) + * This plugin cloned from stripepayment plugin (by Dualcube Team) and implemented iyzico \ No newline at end of file diff --git a/callback.php b/callback.php new file mode 100644 index 0000000..16c4b57 --- /dev/null +++ b/callback.php @@ -0,0 +1,262 @@ +. + +/** + * Listens payment result callback from iyzico + * + * @package enrol_iyzicopayment + * @copyright 2019 Dualcube Team + * @copyright 2021 Made by Sense + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +// Disable moodle specific debug messages and any errors in output, +// comment out when debugging or better look into error log! +define('NO_DEBUG_DISPLAY', true); + +require("../../config.php"); +require_once("lib.php"); +require_once($CFG->libdir . '/enrollib.php'); +require_once($CFG->libdir . '/filelib.php'); + +require_login(); + + +/** + * Send payment error message to the admin. + * + * @param string $subject + * @param stdClass $data + */ +function message_iyzicopayment_error_to_admin($subject, $data) +{ + die($subject); + $admin = get_admin(); + $site = get_site(); + + $message = "$site->fullname: Transaction failed.\n\n$subject\n\n"; + + foreach ($data as $key => $value) { + $message .= s($key) . " => " . s($value) . "\n"; + } + + $subject = "iyzico PAYMENT ERROR: " . $subject; + $fullmessage = $message; + $fullmessagehtml = html_to_text('

' . $message . '

'); + + // Send test email. + ob_start(); + $success = email_to_user($admin, $admin, $subject, $fullmessage, $fullmessagehtml); + $smtplog = ob_get_contents(); + ob_end_clean(); +} + +$data = []; + +// Iyzico iyzipay START + +$plugin = enrol_get_plugin('iyzicopayment'); + +$token = required_param('token', PARAM_RAW); + +require_once "iyzipay/IyzipayBootstrap.php"; +IyzipayBootstrap::init(); + +# create request class +$request = new \Iyzipay\Request\RetrieveCheckoutFormRequest(); +$request->setLocale(\Iyzipay\Model\Locale::TR); +$request->setToken($token); + +$iyzipayOptions = new \Iyzipay\Options(); +$iyzipayOptions->setApiKey($plugin->get_config('publishablekey')); +$iyzipayOptions->setSecretKey($plugin->get_config('secretkey')); +if ($plugin->get_config('sandboxmode')) { + $iyzipayOptions->setBaseUrl('https://sandbox-api.iyzipay.com'); +} else { + $iyzipayOptions->setBaseUrl('https://api.iyzipay.com'); +} + +# make request +$checkoutForm = \Iyzipay\Model\CheckoutForm::retrieve($request, $iyzipayOptions); + +if ($checkoutForm->getStatus() != "success") { + echo "

" . $checkoutForm->getErrorMessage() . "

"; +} else { + // iyzico ile haberleşme işlemi başarılıysa + + $basketId = $checkoutForm->getBasketId(); + $parts = explode("-", $basketId); + $userId = $parts[1]; + $courseId = $parts[2]; + $instanceId = $parts[3]; + + if (!$user = $DB->get_record("user", array("id" => $userId))) { + message_iyzicopayment_error_to_admin("Not a valid user id", $data); + redirect($CFG->wwwroot); + } + + if (!$course = $DB->get_record("course", array("id" => $courseId))) { + message_iyzicopayment_error_to_admin("Not a valid course id", $data); + redirect($CFG->wwwroot); + } + + if (!$context = context_course::instance( + $course->id, + IGNORE_MISSING + )) { + message_iyzicopayment_error_to_admin("Not a valid context id", $data); + redirect($CFG->wwwroot); + } + + $PAGE->set_context($context); + + if (!$plugininstance = $DB->get_record("enrol", array("id" => $instanceId, "status" => 0))) { + message_iyzicopayment_error_to_admin("Not a valid instance id", $data); + redirect($CFG->wwwroot); + } + + // If currency is incorrectly set then someone maybe trying to cheat the system. + + if ($courseId != $plugininstance->courseid) { + message_iyzicopayment_error_to_admin("Course Id does not match to the course settings, received: " . $data->courseid, $data); + redirect($CFG->wwwroot); + } + + + if ($checkoutForm->getPaymentStatus() != "SUCCESS") { + echo "

" . $checkoutForm->getErrorMessage() . "

"; + } else { + // ALL CLEAR ! + + $paymentData = new stdClass; + $paymentData->payment_id = $checkoutForm->getPaymentId(); + $paymentData->course_id = $courseId; + $paymentData->user_id = $userId; + $paymentData->instance_id = $instanceId; + $paymentData->price = $checkoutForm->getPrice(); + $paymentData->paid_price = $checkoutForm->getPaidPrice(); + $paymentData->currency = $checkoutForm->getCurrency(); + $paymentData->payment_status = $checkoutForm->getPaymentStatus(); + $paymentData->pending_reason = $checkoutForm->getErrorMessage(); + $paymentData->reason_code = $checkoutForm->getErrorCode(); + $paymentData->time_updated = time(); + + $DB->insert_record("enrol_iyzicopayment", $paymentData); + + if ($plugininstance->enrolperiod) { + $timestart = time(); + $timeend = $timestart + $plugininstance->enrolperiod; + } else { + $timestart = 0; + $timeend = 0; + } + + // Enrol user. + $plugin->enrol_user($plugininstance, $user->id, $plugininstance->roleid, $timestart, $timeend); + + // Pass $view=true to filter hidden caps if the user cannot see them. + if ($users = get_users_by_capability( + $context, + 'moodle/course:update', + 'u.*', + 'u.id ASC', + '', + '', + '', + '', + false, + true + )) { + $users = sort_by_roleassignment_authority($users, $context); + $teacher = array_shift($users); + } else { + $teacher = false; + } + + $mailstudents = $plugin->get_config('mailstudents'); + $mailteachers = $plugin->get_config('mailteachers'); + $mailadmins = $plugin->get_config('mailadmins'); + $shortname = format_string($course->shortname, true, array('context' => $context)); + + $coursecontext = context_course::instance($course->id); + + if (!empty($mailstudents)) { + $a = new stdClass(); + $a->coursename = format_string($course->fullname, true, array('context' => $coursecontext)); + $a->profileurl = "$CFG->wwwroot/user/view.php?id=$user->id"; + + $userfrom = empty($teacher) ? core_user::get_support_user() : $teacher; + $subject = get_string("enrolmentnew", 'enrol', $shortname); + $fullmessage = get_string('welcometocoursetext', '', $a); + $fullmessagehtml = html_to_text('

' . get_string('welcometocoursetext', '', $a) . '

'); + + // Send test email. + ob_start(); + $success = email_to_user($user, $userfrom, $subject, $fullmessage, $fullmessagehtml); + $smtplog = ob_get_contents(); + ob_end_clean(); + } + + if (!empty($mailteachers) && !empty($teacher)) { + $a->course = format_string($course->fullname, true, array('context' => $coursecontext)); + $a->user = fullname($user); + + $subject = get_string("enrolmentnew", 'enrol', $shortname); + $fullmessage = get_string('enrolmentnewuser', 'enrol', $a); + $fullmessagehtml = html_to_text('

' . get_string('enrolmentnewuser', 'enrol', $a) . '

'); + + // Send test email. + ob_start(); + $success = email_to_user($teacher, $user, $subject, $fullmessage, $fullmessagehtml); + $smtplog = ob_get_contents(); + ob_end_clean(); + } + + if (!empty($mailadmins)) { + $a->course = format_string($course->fullname, true, array('context' => $coursecontext)); + $a->user = fullname($user); + $admins = get_admins(); + foreach ($admins as $admin) { + $subject = get_string("enrolmentnew", 'enrol', $shortname); + $fullmessage = get_string('enrolmentnewuser', 'enrol', $a); + $fullmessagehtml = html_to_text('

' . get_string('enrolmentnewuser', 'enrol', $a) . '

'); + + // Send test email. + ob_start(); + $success = email_to_user($admin, $user, $subject, $fullmessage, $fullmessagehtml); + $smtplog = ob_get_contents(); + ob_end_clean(); + } + } + + $destination = "$CFG->wwwroot/course/view.php?id=$course->id"; + + $fullname = format_string($course->fullname, true, array('context' => $context)); + + if (is_enrolled($context, null, '', true)) { // TODO: use real iyzico check. + redirect($destination, get_string('paymentthanks', '', $fullname)); + } else { // Somehow they aren't enrolled yet! + $PAGE->set_url($destination); + echo $OUTPUT->header(); + $a = new stdClass(); + $a->teacher = get_string('defaultcourseteacher'); + $a->fullname = $fullname; + notice(get_string('paymentsorry', '', $a), $destination); + } + } +} + +// Iyzico iyzipay END \ No newline at end of file diff --git a/db/access.php b/db/access.php new file mode 100644 index 0000000..e15fb5b --- /dev/null +++ b/db/access.php @@ -0,0 +1,61 @@ +. + +/** + * Capabilities for iyzico enrolment plugin. + * + * @package enrol_iyzicopayment + * @copyright 2019 Dualcube Team + * @copyright 2021 Made by Sense + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$capabilities = array( + + 'enrol/iyzicopayment:config' => array( + 'captype' => 'write', + 'contextlevel' => CONTEXT_COURSE, + 'archetypes' => array( + 'manager' => CAP_ALLOW, + ) + ), + + 'enrol/iyzicopayment:manage' => array( + 'captype' => 'write', + 'contextlevel' => CONTEXT_COURSE, + 'archetypes' => array( + 'manager' => CAP_ALLOW, + 'editingteacher' => CAP_ALLOW, + ) + ), + + 'enrol/iyzicopayment:unenrol' => array( + 'captype' => 'write', + 'contextlevel' => CONTEXT_COURSE, + 'archetypes' => array( + 'manager' => CAP_ALLOW, + ) + ), + + 'enrol/iyzicopayment:unenrolself' => array( + 'captype' => 'write', + 'contextlevel' => CONTEXT_COURSE, + 'archetypes' => array() + ), + +); diff --git a/db/install.xml b/db/install.xml new file mode 100644 index 0000000..108872e --- /dev/null +++ b/db/install.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + +
+
+
\ No newline at end of file diff --git a/db/messages.php b/db/messages.php new file mode 100644 index 0000000..d70ffca --- /dev/null +++ b/db/messages.php @@ -0,0 +1,30 @@ +. + +/** + * Defines message providers (types of message sent) for the iyzico enrolment plugin. + * + * @package enrol_iyzicopayment + * @copyright 2019 Dualcube Team + * @copyright 2021 Made by Sense + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$messageproviders = array( + 'iyzicopayment_enrolment' => array(), +); diff --git a/edit.php b/edit.php new file mode 100644 index 0000000..376ec72 --- /dev/null +++ b/edit.php @@ -0,0 +1,120 @@ +. + +/** + * Course wise edit settings. + * + * Adds new instance of enrol_iyzicopayment to specified course + * or edits current instance. + * + * @package enrol_iyzicopayment + * @copyright 2019 Dualcube Team + * @copyright 2021 Made by Sense + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +require('../../config.php'); +require_once('edit_form.php'); + +$courseid = required_param('courseid', PARAM_INT); +$instanceid = optional_param('id', 0, PARAM_INT); // Instanceid. +$course = $DB->get_record('course', array('id' => $courseid), '*', MUST_EXIST); +$context = context_course::instance($course->id, MUST_EXIST); + +require_login($course); +require_capability('enrol/iyzicopayment:config', $context); + +$PAGE->set_url('/enrol/iyzicopayment/edit.php', array('courseid' => $course->id, 'id' => $instanceid)); +$PAGE->set_pagelayout('admin'); + +$return = new moodle_url('/enrol/instances.php', array('id' => $course->id)); +if (!enrol_is_enabled('iyzicopayment')) { + redirect($return); +} + +$plugin = enrol_get_plugin('iyzicopayment'); + +if ($instanceid) { + $instance = $DB->get_record( + 'enrol', + array('courseid' => $course->id, 'enrol' => 'iyzicopayment', 'id' => $instanceid), + '*', + MUST_EXIST + ); + $instance->cost = format_float($instance->cost, 2, true); +} else { + require_capability('moodle/course:enrolconfig', $context); + // No instance yet, we have to add new instance. + navigation_node::override_active_url(new moodle_url('/enrol/instances.php', array('id' => $course->id))); + $instance = new stdClass(); + $instance->id = null; + $instance->courseid = $course->id; +} + +$mform = new enrol_iyzicopayment_edit_form(null, array($instance, $plugin, $context)); + +if ($mform->is_cancelled()) { + redirect($return); +} else if ($data = $mform->get_data()) { + if ($instance->id) { + $reset = ($instance->status != $data->status); + + $instance->status = $data->status; + $instance->name = $data->name; + $instance->cost = unformat_float($data->cost); + $instance->currency = $DB->get_field( + 'config_plugins', + 'value', + array('plugin' => 'enrol_iyzicopayment', 'name' => 'currency') + ); + $instance->roleid = $data->roleid; + $instance->customint3 = $data->customint3; + $instance->enrolperiod = $data->enrolperiod; + $instance->enrolstartdate = $data->enrolstartdate; + $instance->enrolenddate = $data->enrolenddate; + $instance->timemodified = time(); + $DB->update_record('enrol', $instance); + + if ($reset) { + $context->mark_dirty(); + } + } else { + $fields = array( + 'status' => $data->status, 'name' => $data->name, 'cost' => unformat_float($data->cost), + 'currency' => $DB->get_field( + 'config_plugins', + 'value', + array('plugin' => 'enrol_iyzicopayment', 'name' => 'currency') + ), + 'roleid' => $data->roleid, + 'enrolperiod' => $data->enrolperiod, + 'customint3' => $data->customint3, + 'enrolstartdate' => $data->enrolstartdate, + 'enrolenddate' => $data->enrolenddate + ); + $plugin->add_instance($course, $fields); + } + + redirect($return); +} + +$PAGE->set_heading($course->fullname); +$PAGE->set_title(get_string('pluginname', 'enrol_iyzicopayment')); + +echo $OUTPUT->header(); +echo $OUTPUT->heading(get_string('pluginname', 'enrol_iyzicopayment')); +$mform->display(); +echo $OUTPUT->footer(); diff --git a/edit_form.php b/edit_form.php new file mode 100644 index 0000000..22f8a1d --- /dev/null +++ b/edit_form.php @@ -0,0 +1,154 @@ +. + +/** + * Course wise edit form. + * + * Adds new instance of enrol_iyzicopayment to specified course + * or edits current instance. + * + * @package enrol_iyzicopayment + * @copyright 2019 Dualcube Team + * @copyright 2021 Made by Sense + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +require_once($CFG->libdir . '/formslib.php'); +require_once('lib.php'); +/** + * Sets up moodle edit form class methods. + * @copyright 2019 Dualcube Team + * @copyright 2021 Made by Sense + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +class enrol_iyzicopayment_edit_form extends moodleform +{ + /** + * Sets up moodle form. + * @return void + */ + public function definition() + { + $mform = $this->_form; + + list($instance, $plugin, $context) = $this->_customdata; + + $mform->addElement('header', 'header', get_string('pluginname', 'enrol_iyzicopayment')); + + $mform->addElement('text', 'name', get_string('custominstancename', 'enrol')); + $mform->setType('name', PARAM_TEXT); + + $options = array( + ENROL_INSTANCE_ENABLED => get_string('yes'), + ENROL_INSTANCE_DISABLED => get_string('no') + ); + $mform->addElement('select', 'status', get_string('status', 'enrol_iyzicopayment'), $options); + $mform->setDefault('status', $plugin->get_config('status')); + + $costarray = array(); + $costarray[] = &$mform->createElement('text', 'cost', get_string('cost', 'enrol_iyzicopayment'), array('size' => 4)); + $mform->setDefault('cost', format_float($plugin->get_config('cost'), 2, true)); + + $costarray[] = &$mform->createElement('static', 'currency', get_string('currency', 'enrol_iyzicopayment')); + $mform->setDefault('currency', '  ' . $plugin->get_config('currency')); + $mform->addGroup($costarray, 'costar', get_string('cost', 'enrol_iyzicopayment'), array(' '), false); + + if ($instance->id) { + $roles = get_default_enrol_roles($context, $instance->roleid); + } else { + $roles = get_default_enrol_roles($context, $plugin->get_config('roleid')); + } + $mform->addElement('select', 'roleid', get_string('assignrole', 'enrol_iyzicopayment'), $roles); + $mform->setDefault('roleid', $plugin->get_config('roleid')); + + $mform->addElement('text', 'customint3', get_string('maxenrolled', 'enrol_iyzicopayment')); + $mform->setDefault('maxenrolled', 'customint3'); + $mform->addHelpButton('customint3', 'maxenrolled', 'enrol_iyzicopayment'); + $mform->setType('customint3', PARAM_INT); + + $mform->addElement( + 'duration', + 'enrolperiod', + get_string('enrolperiod', 'enrol_iyzicopayment'), + array('optional' => true, 'defaultunit' => 86400) + ); + $mform->setDefault('enrolperiod', $plugin->get_config('enrolperiod')); + $mform->addHelpButton('enrolperiod', 'enrolperiod', 'enrol_iyzicopayment'); + + $mform->addElement( + 'date_time_selector', + 'enrolstartdate', + get_string('enrolstartdate', 'enrol_iyzicopayment'), + array('optional' => true) + ); + $mform->setDefault('enrolstartdate', 0); + $mform->addHelpButton('enrolstartdate', 'enrolstartdate', 'enrol_iyzicopayment'); + + $mform->addElement( + 'date_time_selector', + 'enrolenddate', + get_string('enrolenddate', 'enrol_iyzicopayment'), + array('optional' => true) + ); + $mform->setDefault('enrolenddate', 0); + $mform->addHelpButton('enrolenddate', 'enrolenddate', 'enrol_iyzicopayment'); + + $mform->addElement('hidden', 'id'); + $mform->setType('id', PARAM_INT); + + $mform->addElement('hidden', 'courseid'); + $mform->setType('courseid', PARAM_INT); + + if (enrol_accessing_via_instance($instance)) { + $mform->addElement( + 'static', + 'selfwarn', + get_string('instanceeditselfwarning', 'core_enrol'), + get_string('instanceeditselfwarningtext', 'core_enrol') + ); + } + + $this->add_action_buttons(true, ($instance->id ? null : get_string('addinstance', 'enrol'))); + + $this->set_data($instance); + } + /** + * Sets up moodle form validation. + * @param stdClass $data + * @param stdClass $files + * @return $error error list + */ + public function validation($data, $files) + { + global $DB, $CFG; + $errors = parent::validation($data, $files); + + list($instance, $plugin, $context) = $this->_customdata; + + if (!empty($data['enrolenddate']) and $data['enrolenddate'] < $data['enrolstartdate']) { + $errors['enrolenddate'] = get_string('enrolenddaterror', 'enrol_iyzicopayment'); + } + + $cost = str_replace(get_string('decsep', 'langconfig'), '.', $data['cost']); + if (!is_numeric($cost)) { + $errors['cost'] = get_string('costerror', 'enrol_iyzicopayment'); + } + + return $errors; + } +} diff --git a/enrol.php b/enrol.php new file mode 100644 index 0000000..2b66f55 --- /dev/null +++ b/enrol.php @@ -0,0 +1,138 @@ +. + +/** + * Creates a iyzico payment form and show it on course enrolment page + * + * This script creates a payment form for iyzico + * let user to pay and enrol to course. + * + * @package enrol_iyzicopayment + * @copyright 2019 Dualcube Team + * @copyright 2021 Made by Sense + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +// Disable moodle specific debug messages and any errors in output, +// comment out when debugging or better look into error log! +defined('MOODLE_INTERNAL') || die(); +global $CFG, $USER; + +/** + * Generate a random string, using a cryptographically secure + * pseudorandom number generator (random_int) + * + * This function uses type hints now (PHP 7+ only), but it was originally + * written for PHP 5 as well. + * + * For PHP 7, random_int is a PHP core function + * For PHP 5.x, depends on https://github.com/paragonie/random_compat + * + * @param int $length How many characters do we want? + * @param string $keyspace A string of all possible characters + * to select from + * @return string + */ +function random_str( + int $length = 64, + string $keyspace = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' +): string { + if ($length < 1) { + throw new \RangeException("Length must be a positive integer"); + } + $pieces = []; + $max = mb_strlen($keyspace, '8bit') - 1; + for ($i = 0; $i < $length; ++$i) { + $pieces[] = $keyspace[random_int(0, $max)]; + } + return implode('', $pieces); +} + +// iyzipay testcode START + +require_once "iyzipay/IyzipayBootstrap.php"; +IyzipayBootstrap::init(); + +$iyzipayOptions = new \Iyzipay\Options(); +$iyzipayOptions->setApiKey($this->get_config('publishablekey')); +$iyzipayOptions->setSecretKey($this->get_config('secretkey')); +if ($this->get_config('sandboxmode')) { + $iyzipayOptions->setBaseUrl('https://sandbox-api.iyzipay.com'); +} else { + $iyzipayOptions->setBaseUrl('https://api.iyzipay.com'); +} + +# create request class +$request = new \Iyzipay\Request\CreateCheckoutFormInitializeRequest(); +$request->setLocale(\Iyzipay\Model\Locale::TR); +$request->setConversationId(random_str(9) . "-" . $USER->id . "-" . $course->id . "-" . $instance->id); +$request->setBasketId(random_str(9) . "-" . $USER->id . "-" . $course->id . "-" . $instance->id); +$request->setPrice($cost); +$request->setPaidPrice($cost); +$request->setCurrency($instance->currency); +$request->setCallbackUrl($CFG->wwwroot . "/enrol/iyzicopayment/callback.php"); +$request->setEnabledInstallments(array(1)); + +$buyer = new \Iyzipay\Model\Buyer(); +$buyer->setId($USER->id); +$buyer->setName($USER->firstname); +$buyer->setSurname($USER->lastname); +$buyer->setEmail($USER->email); +$buyer->setIdentityNumber("11111111111"); +$buyer->setRegistrationAddress($USER->address . "."); +$buyer->setIp($USER->lastip); +$buyer->setCity($USER->city . "."); +$buyer->setCountry($USER->country . "."); +$buyer->setZipCode("34000"); + +$request->setBuyer($buyer); + +$userAddress = new \Iyzipay\Model\Address(); +$userAddress->setContactName(fullname($USER)); +$userAddress->setCity($USER->city . "."); +$userAddress->setCountry($USER->country . "."); +$userAddress->setAddress($USER->address . "."); +$userAddress->setZipCode("34000"); + +$request->setShippingAddress($userAddress); +$request->setBillingAddress($userAddress); + +$courseAsBasketItem = new \Iyzipay\Model\BasketItem(); +$courseAsBasketItem->setId($course->id); +$courseAsBasketItem->setName($coursefullname); +$courseAsBasketItem->setCategory1("Courses"); +$courseAsBasketItem->setCategory2($courseshortname); +$courseAsBasketItem->setItemType(\Iyzipay\Model\BasketItemType::VIRTUAL); +$courseAsBasketItem->setPrice($cost); + +$request->setBasketItems([$courseAsBasketItem]); + +# make request +$checkoutFormInitialize = \Iyzipay\Model\CheckoutFormInitialize::create($request, $iyzipayOptions); +// iyzipay testcode END + +?> +
+

+ getStatus() == "success") : ?> + getCheckoutFormContent(); ?> +
+ +

+ getErrorCode(); ?> - getErrorMessage(); ?> +

+ +
\ No newline at end of file diff --git a/error_log b/error_log new file mode 100644 index 0000000..e69de29 diff --git a/iyzipay/IyzipayBootstrap.php b/iyzipay/IyzipayBootstrap.php new file mode 100644 index 0000000..a12c40a --- /dev/null +++ b/iyzipay/IyzipayBootstrap.php @@ -0,0 +1,184 @@ +register(); + } +} + +/* + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * This software consists of voluntary contributions made by many individuals + * and is licensed under the MIT license. For more information, see + * . + */ + +/** + * SplClassLoader implementation that implements the technical interoperability + * standards for PHP 5.3 namespaces and class names. + * + * http://groups.google.com/group/php-standards/web/psr-0-final-proposal?pli=1 + * + * // Example which loads classes for the Doctrine Common package in the + * // Doctrine\Common namespace. + * $classLoader = new SplClassLoader('Doctrine\Common', '/path/to/doctrine'); + * $classLoader->register(); + * + * @license http://www.opensource.org/licenses/mit-license.html MIT License + * @author Jonathan H. Wage + * @author Roman S. Borschel + * @author Matthew Weier O'Phinney + * @author Kris Wallsmith + * @author Fabien Potencier + */ +class SplClassLoader +{ + private $_fileExtension = '.php'; + private $_namespace; + private $_includePath; + private $_namespaceSeparator = '\\'; + + /** + * Creates a new SplClassLoader that loads classes of the + * specified namespace. + * + * @param string $ns + * The namespace to use. + * @param string $includePath + * The base path. + */ + public function __construct($ns = null, $includePath = null) + { + $this->_namespace = $ns; + $this->_includePath = $includePath; + } + + /** + * Sets the namespace separator used by classes in the namespace of this class loader. + * + * @param string $sep + * The separator to use. + */ + public function setNamespaceSeparator($sep) + { + $this->_namespaceSeparator = $sep; + } + + /** + * Gets the namespace separator used by classes in the namespace of this class loader. + * + * @return string $_namespaceSeparator + */ + public function getNamespaceSeparator() + { + return $this->_namespaceSeparator; + } + + /** + * Sets the base include path for all class files in the namespace of this class loader. + * + * @param string $includePath + */ + public function setIncludePath($includePath) + { + $this->_includePath = $includePath; + } + + /** + * Gets the base include path for all class files in the namespace of this class loader. + * + * @return string $includePath + */ + public function getIncludePath() + { + return $this->_includePath; + } + + /** + * Sets the file extension of class files in the namespace of this class loader. + * + * @param string $fileExtension + */ + public function setFileExtension($fileExtension) + { + $this->_fileExtension = $fileExtension; + } + + /** + * Gets the file extension of class files in the namespace of this class loader. + * + * @return string $fileExtension + */ + public function getFileExtension() + { + return $this->_fileExtension; + } + + /** + * Installs this class loader on the SPL autoload stack. + */ + public function register() + { + spl_autoload_register(array( + $this, + 'loadClass' + )); + } + + /** + * Uninstalls this class loader from the SPL autoloader stack. + */ + public function unregister() + { + spl_autoload_unregister(array( + $this, + 'loadClass' + )); + } + + /** + * Loads the given class or interface. + * + * @param string $className + * The name of the class to load. + * @return void + */ + public function loadClass($className) + { + if (null === $this->_namespace || $this->_namespace . $this->_namespaceSeparator === substr($className, 0, strlen($this->_namespace . $this->_namespaceSeparator))) { + $fileName = ''; + if (false !== ($lastNsPos = strripos($className, $this->_namespaceSeparator))) { + $namespace = substr($className, 0, $lastNsPos); + $className = substr($className, $lastNsPos + 1); + $fileName = str_replace($this->_namespaceSeparator, DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR; + } + $fileName .= str_replace('_', DIRECTORY_SEPARATOR, $className) . $this->_fileExtension; + + require ($this->_includePath !== null ? $this->_includePath . DIRECTORY_SEPARATOR : '') . $fileName; + } + } +} \ No newline at end of file diff --git a/iyzipay/LICENSE b/iyzipay/LICENSE new file mode 100644 index 0000000..3f513ac --- /dev/null +++ b/iyzipay/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 - iyzico Ödeme Hizmetleri A.Ş. (https://iyzico.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/iyzipay/README.md b/iyzipay/README.md new file mode 100644 index 0000000..7ac6b15 --- /dev/null +++ b/iyzipay/README.md @@ -0,0 +1,222 @@ +# iyzipay-php + +[![Build Status](https://travis-ci.org/iyzico/iyzipay-php.svg?branch=master)](https://travis-ci.org/iyzico/iyzipay-php) +[![Latest Stable Version](https://poser.pugx.org/iyzico/iyzipay-php/version)](https://packagist.org/packages/iyzico/iyzipay-php) +[![Coverage Status](https://coveralls.io/repos/github/iyzico/iyzipay-php/badge.svg?branch=master)](https://coveralls.io/github/iyzico/iyzipay-php?branch=master) + +You can sign up for an iyzico account at https://iyzico.com + +# Requirements + +PHP 5.3 and later. + +### Note + +Minimum TLS v1.2 will be supported after March 2018. Please upgrade your openssl version to minimum 1.0.1. If you have any questions, please open an issue on Github or contact us at integration@iyzico.com. + +# Installation + +### Composer + +You can install the bindings via [Composer](http://getcomposer.org/). Run the following command: + +```bash +composer require iyzico/iyzipay-php +``` + +To use the bindings, use Composer's [autoload](https://getcomposer.org/doc/00-intro.md#autoloading): + +```php +require_once('vendor/autoload.php'); +``` + +### Manual Installation + +If you do not wish to use Composer, you can download the [latest release](https://github.com/iyzico/iyzipay-php/releases). Then, to use the bindings, include the `IyzipayBootstrap.php` file. + +```php +require_once('/path/to/iyzipay-php/IyzipayBootstrap.php'); +``` + +# Usage + +```php +$options = new \Iyzipay\Options(); +$options->setApiKey("your api key"); +$options->setSecretKey("your secret key"); +$options->setBaseUrl("https://sandbox-api.iyzipay.com"); + +$request = new \Iyzipay\Request\CreatePaymentRequest(); +$request->setLocale(\Iyzipay\Model\Locale::TR); +$request->setConversationId("123456789"); +$request->setPrice("1"); +$request->setPaidPrice("1.2"); +$request->setCurrency(\Iyzipay\Model\Currency::TL); +$request->setInstallment(1); +$request->setBasketId("B67832"); +$request->setPaymentChannel(\Iyzipay\Model\PaymentChannel::WEB); +$request->setPaymentGroup(\Iyzipay\Model\PaymentGroup::PRODUCT); + +$paymentCard = new \Iyzipay\Model\PaymentCard(); +$paymentCard->setCardHolderName("John Doe"); +$paymentCard->setCardNumber("5528790000000008"); +$paymentCard->setExpireMonth("12"); +$paymentCard->setExpireYear("2030"); +$paymentCard->setCvc("123"); +$paymentCard->setRegisterCard(0); +$request->setPaymentCard($paymentCard); + +$buyer = new \Iyzipay\Model\Buyer(); +$buyer->setId("BY789"); +$buyer->setName("John"); +$buyer->setSurname("Doe"); +$buyer->setGsmNumber("+905350000000"); +$buyer->setEmail("email@email.com"); +$buyer->setIdentityNumber("74300864791"); +$buyer->setLastLoginDate("2015-10-05 12:43:35"); +$buyer->setRegistrationDate("2013-04-21 15:12:09"); +$buyer->setRegistrationAddress("Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1"); +$buyer->setIp("85.34.78.112"); +$buyer->setCity("Istanbul"); +$buyer->setCountry("Turkey"); +$buyer->setZipCode("34732"); +$request->setBuyer($buyer); + +$shippingAddress = new \Iyzipay\Model\Address(); +$shippingAddress->setContactName("Jane Doe"); +$shippingAddress->setCity("Istanbul"); +$shippingAddress->setCountry("Turkey"); +$shippingAddress->setAddress("Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1"); +$shippingAddress->setZipCode("34742"); +$request->setShippingAddress($shippingAddress); + +$billingAddress = new \Iyzipay\Model\Address(); +$billingAddress->setContactName("Jane Doe"); +$billingAddress->setCity("Istanbul"); +$billingAddress->setCountry("Turkey"); +$billingAddress->setAddress("Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1"); +$billingAddress->setZipCode("34742"); +$request->setBillingAddress($billingAddress); + +$basketItems = array(); +$firstBasketItem = new \Iyzipay\Model\BasketItem(); +$firstBasketItem->setId("BI101"); +$firstBasketItem->setName("Binocular"); +$firstBasketItem->setCategory1("Collectibles"); +$firstBasketItem->setCategory2("Accessories"); +$firstBasketItem->setItemType(\Iyzipay\Model\BasketItemType::PHYSICAL); +$firstBasketItem->setPrice("0.3"); +$basketItems[0] = $firstBasketItem; + +$secondBasketItem = new \Iyzipay\Model\BasketItem(); +$secondBasketItem->setId("BI102"); +$secondBasketItem->setName("Game code"); +$secondBasketItem->setCategory1("Game"); +$secondBasketItem->setCategory2("Online Game Items"); +$secondBasketItem->setItemType(\Iyzipay\Model\BasketItemType::VIRTUAL); +$secondBasketItem->setPrice("0.5"); +$basketItems[1] = $secondBasketItem; + +$thirdBasketItem = new \Iyzipay\Model\BasketItem(); +$thirdBasketItem->setId("BI103"); +$thirdBasketItem->setName("Usb"); +$thirdBasketItem->setCategory1("Electronics"); +$thirdBasketItem->setCategory2("Usb / Cable"); +$thirdBasketItem->setItemType(\Iyzipay\Model\BasketItemType::PHYSICAL); +$thirdBasketItem->setPrice("0.2"); +$basketItems[2] = $thirdBasketItem; +$request->setBasketItems($basketItems); + +$payment = \Iyzipay\Model\Payment::create($request, $options); +``` +See other samples under samples directory. + +## Development + +Install dependencies: + +``` bash +composer install +``` + +### Mock test cards + +Test cards that can be used to simulate a *successful* payment: + +Card Number | Bank | Card Type +----------- | ---- | --------- +5890040000000016 | Akbank | Master Card (Debit) +5526080000000006 | Akbank | Master Card (Credit) +4766620000000001 | Denizbank | Visa (Debit) +4603450000000000 | Denizbank | Visa (Credit) +4729150000000005 | Denizbank Bonus | Visa (Credit) +4987490000000002 | Finansbank | Visa (Debit) +5311570000000005 | Finansbank | Master Card (Credit) +9792020000000001 | Finansbank | Troy (Debit) +9792030000000000 | Finansbank | Troy (Credit) +5170410000000004 | Garanti Bankası | Master Card (Debit) +5400360000000003 | Garanti Bankası | Master Card (Credit) +374427000000003 | Garanti Bankası | American Express +4475050000000003 | Halkbank | Visa (Debit) +5528790000000008 | Halkbank | Master Card (Credit) +4059030000000009 | HSBC Bank | Visa (Debit) +5504720000000003 | HSBC Bank | Master Card (Credit) +5892830000000000 | Türkiye İş Bankası | Master Card (Debit) +4543590000000006 | Türkiye İş Bankası | Visa (Credit) +4910050000000006 | Vakıfbank | Visa (Debit) +4157920000000002 | Vakıfbank | Visa (Credit) +5168880000000002 | Yapı ve Kredi Bankası | Master Card (Debit) +5451030000000000 | Yapı ve Kredi Bankası | Master Card (Credit) + +*Cross border* test cards: + +Card Number | Country +----------- | ------- +4054180000000007 | Non-Turkish (Debit) +5400010000000004 | Non-Turkish (Credit) +6221060000000004 | Iran + +Test cards to get specific *error* codes: + +Card Number | Description +----------- | ----------- +5406670000000009 | Success but cannot be cancelled, refund or post auth +4111111111111129 | Not sufficient funds +4129111111111111 | Do not honour +4128111111111112 | Invalid transaction +4127111111111113 | Lost card +4126111111111114 | Stolen card +4125111111111115 | Expired card +4124111111111116 | Invalid cvc2 +4123111111111117 | Not permitted to card holder +4122111111111118 | Not permitted to terminal +4121111111111119 | Fraud suspect +4120111111111110 | Pickup card +4130111111111118 | General error +4131111111111117 | Success but mdStatus is 0 +4141111111111115 | Success but mdStatus is 4 +4151111111111112 | 3dsecure initialize failed + +### Mock APM Accounts + +Mock APM Accounts that can be used to simulate a payment with alternative payment method: + +Account Holder Name | Description +------------------- | ----------- +success | Succeeded payment after succeeded initialize +fail-after-init | Failed payment after succeeded initialize +error | Failed initialize + +# Testing + +Install dependencies as mentioned above (which will resolve [PHPUnit](http://packagist.org/packages/phpunit/phpunit)), then you can run the test suite: + +```bash +./vendor/bin/phpunit +``` + +Or to run an individual test file: + +```bash +./vendor/bin/phpunit tests/Iyzipay/Tests/Model/PaymentTest.php +``` diff --git a/iyzipay/composer.json b/iyzipay/composer.json new file mode 100644 index 0000000..c829ea4 --- /dev/null +++ b/iyzipay/composer.json @@ -0,0 +1,44 @@ +{ + "name": "iyzico/iyzipay-php", + "type": "library", + "description": "iyzipay api php client", + "homepage": "https://www.iyzico.com", + "keywords": [ + "iyzico", + "iyzipay", + "iyzico.com", + "iyzipay php", + "iyzipay api", + "iyzipay api php client", + "iyzipay api php", + "payment processing" + ], + "license": "MIT", + "authors": [ + { + "name": "iyzico and contributors", + "homepage": "https://github.com/iyzico/iyzipay-php/contributors" + } + ], + "require": { + "php": ">=5.3.0", + "ext-curl": "*" + }, + "require-dev": { + "phpunit/phpunit": "~4.0", + "satooshi/php-coveralls": "~0.6.1" + }, + "autoload": { + "psr-4": { + "Iyzipay\\": "src/Iyzipay/" + } + }, + "autoload-dev": { + "psr-4": { + "": "tests/" + } + }, + "scripts": { + "test": "vendor/bin/phpunit --colors" + } +} diff --git a/iyzipay/src/Iyzipay/ApiResource.php b/iyzipay/src/Iyzipay/ApiResource.php new file mode 100644 index 0000000..df8b1fd --- /dev/null +++ b/iyzipay/src/Iyzipay/ApiResource.php @@ -0,0 +1,32 @@ +rawResult; + } + + public function setRawResult($rawResult) + { + $this->rawResult = $rawResult; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/BaseModel.php b/iyzipay/src/Iyzipay/BaseModel.php new file mode 100644 index 0000000..5d5ae15 --- /dev/null +++ b/iyzipay/src/Iyzipay/BaseModel.php @@ -0,0 +1,11 @@ +getJsonObject()); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Constants.php b/iyzipay/src/Iyzipay/Constants.php new file mode 100644 index 0000000..7d279af --- /dev/null +++ b/iyzipay/src/Iyzipay/Constants.php @@ -0,0 +1,8 @@ +curl = $curl; + } + + public static function create($curl = null) + { + return new DefaultHttpClient($curl); + } + + public function get($url) + { + return $this->curl->exec($url, array( + CURLOPT_CUSTOMREQUEST => "GET", + CURLOPT_RETURNTRANSFER => true, + CURLOPT_VERBOSE => false, + CURLOPT_HEADER => false + )); + } + + public function getV2($url, $header) + { + return $this->curl->exec($url, array( + CURLOPT_CUSTOMREQUEST => "GET", + CURLOPT_RETURNTRANSFER => true, + CURLOPT_VERBOSE => false, + CURLOPT_HEADER => false, + CURLOPT_HTTPHEADER => $header + )); + } + + public function post($url, $header, $content) + { + return $this->curl->exec($url, array( + CURLOPT_CUSTOMREQUEST => "POST", + CURLOPT_POST => true, + CURLOPT_POSTFIELDS => $content, + CURLOPT_RETURNTRANSFER => true, + CURLOPT_VERBOSE => false, + CURLOPT_HEADER => false, + CURLOPT_HTTPHEADER => $header + )); + } + + public function put($url, $header, $content) + { + return $this->curl->exec($url, array( + CURLOPT_CUSTOMREQUEST => "PUT", + CURLOPT_POSTFIELDS => $content, + CURLOPT_RETURNTRANSFER => true, + CURLOPT_VERBOSE => false, + CURLOPT_HEADER => false, + CURLOPT_HTTPHEADER => $header + )); + } + + public function delete($url, $header, $content = null) + { + return $this->curl->exec($url, array( + CURLOPT_CUSTOMREQUEST => "DELETE", + CURLOPT_POSTFIELDS => $content, + CURLOPT_RETURNTRANSFER => true, + CURLOPT_VERBOSE => false, + CURLOPT_HEADER => false, + CURLOPT_HTTPHEADER => $header + )); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/FileBase64Encoder.php b/iyzipay/src/Iyzipay/FileBase64Encoder.php new file mode 100644 index 0000000..99a1ea5 --- /dev/null +++ b/iyzipay/src/Iyzipay/FileBase64Encoder.php @@ -0,0 +1,16 @@ +toPKIRequestString(); + return base64_encode(sha1($hashStr, true)); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/HttpClient.php b/iyzipay/src/Iyzipay/HttpClient.php new file mode 100644 index 0000000..7c35a41 --- /dev/null +++ b/iyzipay/src/Iyzipay/HttpClient.php @@ -0,0 +1,16 @@ +toJsonString() != '[]') + $uriPath = $uriPath.$request->toJsonString(); + + return $uriPath; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/IyzipayResource.php b/iyzipay/src/Iyzipay/IyzipayResource.php new file mode 100644 index 0000000..e2eb847 --- /dev/null +++ b/iyzipay/src/Iyzipay/IyzipayResource.php @@ -0,0 +1,126 @@ +getApiKey(), $options->getSecretKey(), $rnd, $request); + return vsprintf("IYZWS %s:%s", array($options->getApiKey(), $authContent)); + } + + protected static function prepareAuthorizationStringV2($uri, Request $request = null, Options $options, $rnd) + { + $hash = IyziAuthV2Generator::generateAuthContent($uri, $options->getApiKey(), $options->getSecretKey(), $rnd, $request); + + return 'IYZWSv2'.' '.$hash; + } + + public function getStatus() + { + return $this->status; + } + + public function setStatus($status) + { + $this->status = $status; + } + + public function getErrorCode() + { + return $this->errorCode; + } + + public function setErrorCode($errorCode) + { + $this->errorCode = $errorCode; + } + + public function getErrorMessage() + { + return $this->errorMessage; + } + + public function setErrorMessage($errorMessage) + { + $this->errorMessage = $errorMessage; + } + + public function getErrorGroup() + { + return $this->errorGroup; + } + + public function setErrorGroup($errorGroup) + { + $this->errorGroup = $errorGroup; + } + + public function getLocale() + { + return $this->locale; + } + + public function setLocale($locale) + { + $this->locale = $locale; + } + + public function getSystemTime() + { + return $this->systemTime; + } + + public function setSystemTime($systemTime) + { + $this->systemTime = $systemTime; + } + + public function getConversationId() + { + return $this->conversationId; + } + + public function setConversationId($conversationId) + { + $this->conversationId = $conversationId; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/JsonBuilder.php b/iyzipay/src/Iyzipay/JsonBuilder.php new file mode 100644 index 0000000..5af6dd1 --- /dev/null +++ b/iyzipay/src/Iyzipay/JsonBuilder.php @@ -0,0 +1,87 @@ +json = $json; + } + + public static function create() + { + return new JsonBuilder(array()); + } + + public static function fromJsonObject($json) + { + return new JsonBuilder($json); + } + + /** + * @param $key + * @param $value + * @return JsonBuilder + */ + public function add($key, $value = null) + { + if (isset($value)) { + if ($value instanceof JsonConvertible) { + $this->json[$key] = $value->getJsonObject(); + } else { + $this->json[$key] = $value; + } + } + return $this; + } + + /** + * @param $key + * @param $value + * @return JsonBuilder + */ + public function addPrice($key, $value = null) + { + if (isset($value)) { + $this->json[$key] = RequestFormatter::formatPrice($value); + } + return $this; + } + + /** + * @param $key + * @param array $array + * @return JsonBuilder + */ + public function addArray($key, array $array = null) + { + if (isset($array)) { + foreach ($array as $index => $value) { + if ($value instanceof JsonConvertible) { + $this->json[$key][$index] = $value->getJsonObject(); + } else { + $this->json[$key][$index] = $value; + } + } + } + return $this; + } + + public function getObject() + { + return $this->json; + } + + public static function jsonEncode($jsonObject) + { + return json_encode($jsonObject); + } + + public static function jsonDecode($rawResult) + { + return json_decode($rawResult); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/JsonConvertible.php b/iyzipay/src/Iyzipay/JsonConvertible.php new file mode 100644 index 0000000..9c5180f --- /dev/null +++ b/iyzipay/src/Iyzipay/JsonConvertible.php @@ -0,0 +1,10 @@ +address; + } + + public function setAddress($address) + { + $this->address = $address; + } + + public function getZipCode() + { + return $this->zipCode; + } + + public function setZipCode($zipCode) + { + $this->zipCode = $zipCode; + } + + public function getContactName() + { + return $this->contactName; + } + + public function setContactName($contactName) + { + $this->contactName = $contactName; + } + + public function getCity() + { + return $this->city; + } + + public function setCity($city) + { + $this->city = $city; + } + + public function getCountry() + { + return $this->country; + } + + public function setCountry($country) + { + $this->country = $country; + } + + public function getJsonObject() + { + return JsonBuilder::create() + ->add("address", $this->getAddress()) + ->add("zipCode", $this->getZipCode()) + ->add("contactName", $this->getContactName()) + ->add("city", $this->getCity()) + ->add("country", $this->getCountry()) + ->getObject(); + } + + public function toPKIRequestString() + { + return RequestStringBuilder::create() + ->append("address", $this->getAddress()) + ->append("zipCode", $this->getZipCode()) + ->append("contactName", $this->getContactName()) + ->append("city", $this->getCity()) + ->append("country", $this->getCountry()) + ->getRequestString(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/ApiTest.php b/iyzipay/src/Iyzipay/Model/ApiTest.php new file mode 100644 index 0000000..998a7aa --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/ApiTest.php @@ -0,0 +1,16 @@ +get($options->getBaseUrl() . "/payment/test"); + return IyzipayResourceMapper::create($rawResult)->jsonDecode()->mapResource(new IyzipayResource()); + } +} diff --git a/iyzipay/src/Iyzipay/Model/Apm.php b/iyzipay/src/Iyzipay/Model/Apm.php new file mode 100644 index 0000000..bd763ef --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Apm.php @@ -0,0 +1,23 @@ +post($options->getBaseUrl() . "/payment/apm/initialize", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return ApmMapper::create($rawResult)->jsonDecode()->mapApm(new Apm()); + } + + public static function retrieve(RetrieveApmRequest $request, Options $options) + { + $rawResult = parent::httpClient()->post($options->getBaseUrl() . "/payment/apm/retrieve", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return ApmMapper::create($rawResult)->jsonDecode()->mapApm(new Apm()); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/ApmResource.php b/iyzipay/src/Iyzipay/Model/ApmResource.php new file mode 100644 index 0000000..85333c0 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/ApmResource.php @@ -0,0 +1,262 @@ +redirectUrl; + } + + public function setRedirectUrl($redirectUrl) + { + $this->redirectUrl = $redirectUrl; + } + + public function getPrice() + { + return $this->price; + } + + public function setPrice($price) + { + $this->price = $price; + } + + public function getPaidPrice() + { + return $this->paidPrice; + } + + public function setPaidPrice($paidPrice) + { + $this->paidPrice = $paidPrice; + } + + public function getPaymentId() + { + return $this->paymentId; + } + + public function setPaymentId($paymentId) + { + $this->paymentId = $paymentId; + } + + public function getMerchantCommissionRate() + { + return $this->merchantCommissionRate; + } + + public function setMerchantCommissionRate($merchantCommissionRate) + { + $this->merchantCommissionRate = $merchantCommissionRate; + } + + public function getMerchantCommissionRateAmount() + { + return $this->merchantCommissionRateAmount; + } + + public function setMerchantCommissionRateAmount($merchantCommissionRateAmount) + { + $this->merchantCommissionRateAmount = $merchantCommissionRateAmount; + } + + public function getIyziCommissionRateAmount() + { + return $this->iyziCommissionRateAmount; + } + + public function setIyziCommissionRateAmount($iyziCommissionRateAmount) + { + $this->iyziCommissionRateAmount = $iyziCommissionRateAmount; + } + + public function getIyziCommissionFee() + { + return $this->iyziCommissionFee; + } + + public function setIyziCommissionFee($iyziCommissionFee) + { + $this->iyziCommissionFee = $iyziCommissionFee; + } + + public function getBasketId() + { + return $this->basketId; + } + + public function setBasketId($basketId) + { + $this->basketId = $basketId; + } + + public function getCurrency() + { + return $this->currency; + } + + public function setCurrency($currency) + { + $this->currency = $currency; + } + + public function getPaymentItems() + { + return $this->paymentItems; + } + + public function setPaymentItems($paymentItems) + { + $this->paymentItems = $paymentItems; + } + + public function getPhase() + { + return $this->phase; + } + + public function setPhase($phase) + { + $this->phase = $phase; + } + + public function getAccountHolderName() + { + return $this->accountHolderName; + } + + public function setAccountHolderName($accountHolderName) + { + $this->accountHolderName = $accountHolderName; + } + + public function getAccountNumber() + { + return $this->accountNumber; + } + + public function setAccountNumber($accountNumber) + { + $this->accountNumber = $accountNumber; + } + + public function getBankName() + { + return $this->bankName; + } + + public function setBankName($bankName) + { + $this->bankName = $bankName; + } + + public function getBankCode() + { + return $this->bankCode; + } + + public function setBankCode($bankCode) + { + $this->bankCode = $bankCode; + } + + public function getBic() + { + return $this->bic; + } + + public function setBic($bic) + { + $this->bic = $bic; + } + + public function getPaymentPurpose() + { + return $this->paymentPurpose; + } + + public function setPaymentPurpose($paymentPurpose) + { + $this->paymentPurpose = $paymentPurpose; + } + + public function getIban() + { + return $this->iban; + } + + public function setIban($iban) + { + $this->iban = $iban; + } + + public function getCountryCode() + { + return $this->countryCode; + } + + public function setCountryCode($countryCode) + { + $this->countryCode = $countryCode; + } + + public function getApm() + { + return $this->apm; + } + + public function setApm($apm) + { + $this->apm = $apm; + } + + public function getMobilePhone() + { + return $this->mobilePhone; + } + + public function setMobilePhone($mobilePhone) + { + $this->mobilePhone = $mobilePhone; + } + + public function getPaymentStatus() + { + return $this->paymentStatus; + } + + public function setPaymentStatus($paymentStatus) + { + $this->paymentStatus = $paymentStatus; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/ApmType.php b/iyzipay/src/Iyzipay/Model/ApmType.php new file mode 100644 index 0000000..b93a6fd --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/ApmType.php @@ -0,0 +1,11 @@ +post($options->getBaseUrl() . "/payment/iyzipos/item/approve", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return ApprovalMapper::create($rawResult)->jsonDecode()->mapApproval(new Approval()); + } + + public function getPaymentTransactionId() + { + return $this->paymentTransactionId; + } + + public function setPaymentTransactionId($paymentTransactionId) + { + $this->paymentTransactionId = $paymentTransactionId; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/BankTransfer.php b/iyzipay/src/Iyzipay/Model/BankTransfer.php new file mode 100644 index 0000000..32c4c63 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/BankTransfer.php @@ -0,0 +1,73 @@ +subMerchantKey; + } + + public function setSubMerchantKey($subMerchantKey) + { + $this->subMerchantKey = $subMerchantKey; + } + + public function getIban() + { + return $this->iban; + } + + public function setIban($iban) + { + $this->iban = $iban; + } + + public function getContactName() + { + return $this->contactName; + } + + public function setContactName($contactName) + { + $this->contactName = $contactName; + } + + public function getContactSurname() + { + return $this->contactSurname; + } + + public function setContactSurname($contactSurname) + { + $this->contactSurname = $contactSurname; + } + + public function getLegalCompanyTitle() + { + return $this->legalCompanyTitle; + } + + public function setLegalCompanyTitle($legalCompanyTitle) + { + $this->legalCompanyTitle = $legalCompanyTitle; + } + + public function getMarketplaceSubMerchantType() + { + return $this->marketplaceSubMerchantType; + } + + public function setMarketplaceSubMerchantType($marketplaceSubMerchantType) + { + $this->marketplaceSubMerchantType = $marketplaceSubMerchantType; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/BasicBkm.php b/iyzipay/src/Iyzipay/Model/BasicBkm.php new file mode 100644 index 0000000..08f40c6 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/BasicBkm.php @@ -0,0 +1,50 @@ +post($options->getBaseUrl() . "/payment/bkm/auth/detail/basic", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return BasicBkmMapper::create($rawResult)->jsonDecode()->mapBasicBkm(new BasicBkm()); + } + + public function getToken() + { + return $this->token; + } + + public function setToken($token) + { + $this->token = $token; + } + + public function getCallbackUrl() + { + return $this->callbackUrl; + } + + public function setCallbackUrl($callbackUrl) + { + $this->callbackUrl = $callbackUrl; + } + + public function getPaymentStatus() + { + return $this->paymentStatus; + } + + public function setPaymentStatus($paymentStatus) + { + $this->paymentStatus = $paymentStatus; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/BasicBkmInitialize.php b/iyzipay/src/Iyzipay/Model/BasicBkmInitialize.php new file mode 100644 index 0000000..e660a75 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/BasicBkmInitialize.php @@ -0,0 +1,40 @@ +post($options->getBaseUrl() . "/payment/bkm/initialize/basic", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return BasicBkmInitializeMapper::create($rawResult)->jsonDecode()->mapBasicBkmInitialize(new BasicBkmInitialize()); + } + + public function getHtmlContent() + { + return $this->htmlContent; + } + + public function setHtmlContent($htmlContent) + { + $this->htmlContent = $htmlContent; + } + + public function getToken() + { + return $this->token; + } + + public function setToken($token) + { + $this->token = $token; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/BasicPayment.php b/iyzipay/src/Iyzipay/Model/BasicPayment.php new file mode 100644 index 0000000..622cbbd --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/BasicPayment.php @@ -0,0 +1,16 @@ +post($options->getBaseUrl() . "/payment/auth/basic", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return BasicPaymentMapper::create($rawResult)->jsonDecode()->mapBasicPayment(new BasicPayment()); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/BasicPaymentPostAuth.php b/iyzipay/src/Iyzipay/Model/BasicPaymentPostAuth.php new file mode 100644 index 0000000..5281379 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/BasicPaymentPostAuth.php @@ -0,0 +1,16 @@ +post($options->getBaseUrl() . "/payment/postauth/basic", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return BasicPaymentPostAuthMapper::create($rawResult)->jsonDecode()->mapBasicPaymentPostAuth(new BasicPaymentPostAuth()); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/BasicPaymentPreAuth.php b/iyzipay/src/Iyzipay/Model/BasicPaymentPreAuth.php new file mode 100644 index 0000000..a5bb787 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/BasicPaymentPreAuth.php @@ -0,0 +1,16 @@ +post($options->getBaseUrl() . "/payment/preauth/basic", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return BasicPaymentPreAuthMapper::create($rawResult)->jsonDecode()->mapBasicPaymentPreAuth(new BasicPaymentPreAuth()); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/BasicPaymentResource.php b/iyzipay/src/Iyzipay/Model/BasicPaymentResource.php new file mode 100644 index 0000000..0da2cdb --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/BasicPaymentResource.php @@ -0,0 +1,207 @@ +price; + } + + public function setPrice($price) + { + $this->price = $price; + } + + public function getPaidPrice() + { + return $this->paidPrice; + } + + public function setPaidPrice($paidPrice) + { + $this->paidPrice = $paidPrice; + } + + public function getInstallment() + { + return $this->installment; + } + + public function setInstallment($installment) + { + $this->installment = $installment; + } + + public function getCurrency() + { + return $this->currency; + } + + public function setCurrency($currency) + { + $this->currency = $currency; + } + + public function getPaymentId() + { + return $this->paymentId; + } + + public function setPaymentId($paymentId) + { + $this->paymentId = $paymentId; + } + + public function getMerchantCommissionRate() + { + return $this->merchantCommissionRate; + } + + public function setMerchantCommissionRate($merchantCommissionRate) + { + $this->merchantCommissionRate = $merchantCommissionRate; + } + + public function getMerchantCommissionRateAmount() + { + return $this->merchantCommissionRateAmount; + } + + public function setMerchantCommissionRateAmount($merchantCommissionRateAmount) + { + $this->merchantCommissionRateAmount = $merchantCommissionRateAmount; + } + + public function getIyziCommissionFee() + { + return $this->iyziCommissionFee; + } + + public function setIyziCommissionFee($iyziCommissionFee) + { + $this->iyziCommissionFee = $iyziCommissionFee; + } + + public function getCardType() + { + return $this->cardType; + } + + public function setCardType($cardType) + { + $this->cardType = $cardType; + } + + public function getCardAssociation() + { + return $this->cardAssociation; + } + + public function setCardAssociation($cardAssociation) + { + $this->cardAssociation = $cardAssociation; + } + + public function getCardFamily() + { + return $this->cardFamily; + } + + public function setCardFamily($cardFamily) + { + $this->cardFamily = $cardFamily; + } + + public function getCardToken() + { + return $this->cardToken; + } + + public function setCardToken($cardToken) + { + $this->cardToken = $cardToken; + } + + public function getCardUserKey() + { + return $this->cardUserKey; + } + + public function setCardUserKey($cardUserKey) + { + $this->cardUserKey = $cardUserKey; + } + + public function getBinNumber() + { + return $this->binNumber; + } + + public function setBinNumber($binNumber) + { + $this->binNumber = $binNumber; + } + + public function getPaymentTransactionId() + { + return $this->paymentTransactionId; + } + + public function setPaymentTransactionId($paymentTransactionId) + { + $this->paymentTransactionId = $paymentTransactionId; + } + + public function getAuthCode() + { + return $this->authCode; + } + + public function setAuthCode($authCode) + { + $this->authCode = $authCode; + } + + public function getConnectorName() + { + return $this->connectorName; + } + + public function setConnectorName($connectorName) + { + $this->connectorName = $connectorName; + } + + public function getPhase() + { + return $this->phase; + } + + public function setPhase($phase) + { + $this->phase = $phase; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/BasicThreedsInitialize.php b/iyzipay/src/Iyzipay/Model/BasicThreedsInitialize.php new file mode 100644 index 0000000..4e84230 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/BasicThreedsInitialize.php @@ -0,0 +1,29 @@ +post($options->getBaseUrl() . "/payment/3dsecure/initialize/basic", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return BasicThreedsInitializeMapper::create($rawResult)->jsonDecode()->mapBasicThreedsInitialize(new BasicThreedsInitialize()); + } + + public function getHtmlContent() + { + return $this->htmlContent; + } + + public function setHtmlContent($htmlContent) + { + $this->htmlContent = $htmlContent; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/BasicThreedsInitializePreAuth.php b/iyzipay/src/Iyzipay/Model/BasicThreedsInitializePreAuth.php new file mode 100644 index 0000000..84b4e39 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/BasicThreedsInitializePreAuth.php @@ -0,0 +1,29 @@ +post($options->getBaseUrl() . "/payment/3dsecure/initialize/preauth/basic", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return BasicThreedsInitializePreAuthMapper::create($rawResult)->jsonDecode()->mapBasicThreedsInitializePreAuth(new BasicThreedsInitializePreAuth()); + } + + public function getHtmlContent() + { + return $this->htmlContent; + } + + public function setHtmlContent($htmlContent) + { + $this->htmlContent = $htmlContent; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/BasicThreedsPayment.php b/iyzipay/src/Iyzipay/Model/BasicThreedsPayment.php new file mode 100644 index 0000000..de71bb8 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/BasicThreedsPayment.php @@ -0,0 +1,16 @@ +post($options->getBaseUrl() . "/payment/3dsecure/auth/basic", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return BasicThreedsPaymentMapper::create($rawResult)->jsonDecode()->mapBasicThreedsPayment(new BasicThreedsPayment()); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/BasketItem.php b/iyzipay/src/Iyzipay/Model/BasketItem.php new file mode 100644 index 0000000..e1990ca --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/BasketItem.php @@ -0,0 +1,127 @@ +id; + } + + public function setId($id) + { + $this->id = $id; + } + + public function getPrice() + { + return $this->price; + } + + public function setPrice($price) + { + $this->price = $price; + } + + public function getName() + { + return $this->name; + } + + public function setName($name) + { + $this->name = $name; + } + + public function getCategory1() + { + return $this->category1; + } + + public function setCategory1($category1) + { + $this->category1 = $category1; + } + + public function getCategory2() + { + return $this->category2; + } + + public function setCategory2($category2) + { + $this->category2 = $category2; + } + + public function getItemType() + { + return $this->itemType; + } + + public function setItemType($itemType) + { + $this->itemType = $itemType; + } + + public function getSubMerchantKey() + { + return $this->subMerchantKey; + } + + public function setSubMerchantKey($subMerchantKey) + { + $this->subMerchantKey = $subMerchantKey; + } + + public function getSubMerchantPrice() + { + return $this->subMerchantPrice; + } + + public function setSubMerchantPrice($subMerchantPrice) + { + $this->subMerchantPrice = $subMerchantPrice; + } + + public function getJsonObject() + { + return JsonBuilder::create() + ->add("id", $this->getId()) + ->addPrice("price", $this->getPrice()) + ->add("name", $this->getName()) + ->add("category1", $this->getCategory1()) + ->add("category2", $this->getCategory2()) + ->add("itemType", $this->getItemType()) + ->add("subMerchantKey", $this->getSubMerchantKey()) + ->addPrice("subMerchantPrice", $this->getSubMerchantPrice()) + ->getObject(); + } + + public function toPKIRequestString() + { + return RequestStringBuilder::create() + ->append("id", $this->getId()) + ->appendPrice("price", $this->getPrice()) + ->append("name", $this->getName()) + ->append("category1", $this->getCategory1()) + ->append("category2", $this->getCategory2()) + ->append("itemType", $this->getItemType()) + ->append("subMerchantKey", $this->getSubMerchantKey()) + ->appendPrice("subMerchantPrice", $this->getSubMerchantPrice()) + ->getRequestString(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/BasketItemType.php b/iyzipay/src/Iyzipay/Model/BasketItemType.php new file mode 100644 index 0000000..08163ea --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/BasketItemType.php @@ -0,0 +1,9 @@ +post($options->getBaseUrl() . "/payment/bin/check", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return BinNumberMapper::create($rawResult)->jsonDecode()->mapBinNumber(new BinNumber()); + } + + public function getBinNumber() + { + return $this->binNumber; + } + + public function setBinNumber($binNumber) + { + $this->binNumber = $binNumber; + } + + public function getCardType() + { + return $this->cardType; + } + + public function setCardType($cardType) + { + $this->cardType = $cardType; + } + + public function getCardAssociation() + { + return $this->cardAssociation; + } + + public function setCardAssociation($cardAssociation) + { + $this->cardAssociation = $cardAssociation; + } + + public function getCardFamily() + { + return $this->cardFamily; + } + + public function setCardFamily($cardFamily) + { + $this->cardFamily = $cardFamily; + } + + public function getBankName() + { + return $this->bankName; + } + + public function setBankName($bankName) + { + $this->bankName = $bankName; + } + + public function getBankCode() + { + return $this->bankCode; + } + + public function setBankCode($bankCode) + { + $this->bankCode = $bankCode; + } + + public function getCommercial() + { + return $this->commercial; + } + + public function setCommercial($commercial) + { + $this->commercial = $commercial; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Bkm.php b/iyzipay/src/Iyzipay/Model/Bkm.php new file mode 100644 index 0000000..87908a2 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Bkm.php @@ -0,0 +1,39 @@ +post($options->getBaseUrl() . "/payment/bkm/auth/detail", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return BkmMapper::create($rawResult)->jsonDecode()->mapBkm(new Bkm()); + } + + public function getToken() + { + return $this->token; + } + + public function setToken($token) + { + $this->token = $token; + } + + public function getCallbackUrl() + { + return $this->callbackUrl; + } + + public function setCallbackUrl($callbackUrl) + { + $this->callbackUrl = $callbackUrl; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/BkmInitialize.php b/iyzipay/src/Iyzipay/Model/BkmInitialize.php new file mode 100644 index 0000000..4ec83d1 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/BkmInitialize.php @@ -0,0 +1,40 @@ +post($options->getBaseUrl() . "/payment/bkm/initialize", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return BkmInitializeMapper::create($rawResult)->jsonDecode()->mapBkmInitialize(new BkmInitialize()); + } + + public function getHtmlContent() + { + return $this->htmlContent; + } + + public function setHtmlContent($htmlContent) + { + $this->htmlContent = $htmlContent; + } + + public function getToken() + { + return $this->token; + } + + public function setToken($token) + { + $this->token = $token; + } +} diff --git a/iyzipay/src/Iyzipay/Model/BkmInstallment.php b/iyzipay/src/Iyzipay/Model/BkmInstallment.php new file mode 100644 index 0000000..3b6accc --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/BkmInstallment.php @@ -0,0 +1,49 @@ +bankId; + } + + public function setBankId($bankId) + { + $this->bankId = $bankId; + } + + public function getInstallmentPrices() + { + return $this->installmentPrices; + } + + public function setInstallmentPrices($installmentPrices) + { + $this->installmentPrices = $installmentPrices; + } + + public function getJsonObject() + { + return JsonBuilder::create() + ->add("bankId", $this->getBankId()) + ->addArray("installmentPrices", $this->getInstallmentPrices()) + ->getObject(); + } + + public function toPKIRequestString() + { + return RequestStringBuilder::create() + ->append("bankId", $this->getBankId()) + ->appendArray("installmentPrices", $this->getInstallmentPrices()) + ->getRequestString(); + } +} diff --git a/iyzipay/src/Iyzipay/Model/BkmInstallmentPrice.php b/iyzipay/src/Iyzipay/Model/BkmInstallmentPrice.php new file mode 100644 index 0000000..de3a11b --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/BkmInstallmentPrice.php @@ -0,0 +1,49 @@ +installmentNumber; + } + + public function setInstallmentNumber($installmentNumber) + { + $this->installmentNumber = $installmentNumber; + } + + public function getTotalPrice() + { + return $this->totalPrice; + } + + public function setTotalPrice($totalPrice) + { + $this->totalPrice = $totalPrice; + } + + public function getJsonObject() + { + return JsonBuilder::create() + ->add("installmentNumber", $this->getInstallmentNumber()) + ->addPrice("totalPrice", $this->getTotalPrice()) + ->getObject(); + } + + public function toPKIRequestString() + { + return RequestStringBuilder::create() + ->append("installmentNumber", $this->getInstallmentNumber()) + ->appendPrice("totalPrice", $this->getTotalPrice()) + ->getRequestString(); + } +} diff --git a/iyzipay/src/Iyzipay/Model/BouncedBankTransferList.php b/iyzipay/src/Iyzipay/Model/BouncedBankTransferList.php new file mode 100644 index 0000000..fb0c34e --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/BouncedBankTransferList.php @@ -0,0 +1,29 @@ +post($options->getBaseUrl() . "/reporting/settlement/bounced", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return BouncedBankTransferListMapper::create($rawResult)->jsonDecode()->mapBouncedBankTransferList(new BouncedBankTransferList()); + } + + public function getBankTransfers() + { + return $this->bankTransfers; + } + + public function setBankTransfers($bankTransfers) + { + $this->bankTransfers = $bankTransfers; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Buyer.php b/iyzipay/src/Iyzipay/Model/Buyer.php new file mode 100644 index 0000000..e62a043 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Buyer.php @@ -0,0 +1,192 @@ +id; + } + + public function setId($id) + { + $this->id = $id; + } + + public function getName() + { + return $this->name; + } + + public function setName($name) + { + $this->name = $name; + } + + public function getSurname() + { + return $this->surname; + } + + public function setSurname($surname) + { + $this->surname = $surname; + } + + public function getIdentityNumber() + { + return $this->identityNumber; + } + + public function setIdentityNumber($identityNumber) + { + $this->identityNumber = $identityNumber; + } + + public function getEmail() + { + return $this->email; + } + + public function setEmail($email) + { + $this->email = $email; + } + + public function getGsmNumber() + { + return $this->gsmNumber; + } + + public function setGsmNumber($gsmNumber) + { + $this->gsmNumber = $gsmNumber; + } + + public function getRegistrationDate() + { + return $this->registrationDate; + } + + public function setRegistrationDate($registrationDate) + { + $this->registrationDate = $registrationDate; + } + + public function getLastLoginDate() + { + return $this->lastLoginDate; + } + + public function setLastLoginDate($lastLoginDate) + { + $this->lastLoginDate = $lastLoginDate; + } + + public function getRegistrationAddress() + { + return $this->registrationAddress; + } + + public function setRegistrationAddress($registrationAddress) + { + $this->registrationAddress = $registrationAddress; + } + + public function getCity() + { + return $this->city; + } + + public function setCity($city) + { + $this->city = $city; + } + + public function getCountry() + { + return $this->country; + } + + public function setCountry($country) + { + $this->country = $country; + } + + public function getZipCode() + { + return $this->zipCode; + } + + public function setZipCode($zipCode) + { + $this->zipCode = $zipCode; + } + + public function getIp() + { + return $this->ip; + } + + public function setIp($ip) + { + $this->ip = $ip; + } + + public function getJsonObject() + { + return JsonBuilder::create() + ->add("id", $this->getId()) + ->add("name", $this->getName()) + ->add("surname", $this->getSurname()) + ->add("identityNumber", $this->getIdentityNumber()) + ->add("email", $this->getEmail()) + ->add("gsmNumber", $this->getGsmNumber()) + ->add("registrationDate", $this->getRegistrationDate()) + ->add("lastLoginDate", $this->getLastLoginDate()) + ->add("registrationAddress", $this->getRegistrationAddress()) + ->add("city", $this->getCity()) + ->add("country", $this->getCountry()) + ->add("zipCode", $this->getZipCode()) + ->add("ip", $this->getIp()) + ->getObject(); + } + + public function toPKIRequestString() + { + return RequestStringBuilder::create() + ->append("id", $this->getId()) + ->append("name", $this->getName()) + ->append("surname", $this->getSurname()) + ->append("identityNumber", $this->getIdentityNumber()) + ->append("email", $this->getEmail()) + ->append("gsmNumber", $this->getGsmNumber()) + ->append("registrationDate", $this->getRegistrationDate()) + ->append("lastLoginDate", $this->getLastLoginDate()) + ->append("registrationAddress", $this->getRegistrationAddress()) + ->append("city", $this->getCity()) + ->append("country", $this->getCountry()) + ->append("zipCode", $this->getZipCode()) + ->append("ip", $this->getIp()) + ->getRequestString(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Cancel.php b/iyzipay/src/Iyzipay/Model/Cancel.php new file mode 100644 index 0000000..d51eb59 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Cancel.php @@ -0,0 +1,73 @@ +post($options->getBaseUrl() . "/payment/cancel", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return CancelMapper::create($rawResult)->jsonDecode()->mapCancel(new Cancel()); + } + + public function getPaymentId() + { + return $this->paymentId; + } + + public function setPaymentId($paymentId) + { + $this->paymentId = $paymentId; + } + + public function getPrice() + { + return $this->price; + } + + public function setPrice($price) + { + $this->price = $price; + } + + public function getCurrency() + { + return $this->currency; + } + + public function setCurrency($currency) + { + $this->currency = $currency; + } + + public function getConnectorName() + { + return $this->connectorName; + } + + public function setConnectorName($connectorName) + { + $this->connectorName = $connectorName; + } + + public function getAuthCode() + { + return $this->authCode; + } + + public function setAuthCode($authCode) + { + $this->authCode = $authCode; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Card.php b/iyzipay/src/Iyzipay/Model/Card.php new file mode 100644 index 0000000..d8940ab --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Card.php @@ -0,0 +1,146 @@ +post($options->getBaseUrl() . "/cardstorage/card", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return CardMapper::create($rawResult)->jsonDecode()->mapCard(new Card()); + } + + public static function delete(DeleteCardRequest $request, Options $options) + { + $rawResult = parent::httpClient()->delete($options->getBaseUrl() . "/cardstorage/card", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return CardMapper::create($rawResult)->jsonDecode()->mapCard(new Card()); + } + + public function getExternalId() + { + return $this->externalId; + } + + public function setExternalId($externalId) + { + $this->externalId = $externalId; + } + + public function getEmail() + { + return $this->email; + } + + public function setEmail($email) + { + $this->email = $email; + } + + public function getCardUserKey() + { + return $this->cardUserKey; + } + + public function setCardUserKey($cardUserKey) + { + $this->cardUserKey = $cardUserKey; + } + + public function getCardToken() + { + return $this->cardToken; + } + + public function setCardToken($cardToken) + { + $this->cardToken = $cardToken; + } + + public function getCardAlias() + { + return $this->cardAlias; + } + + public function setCardAlias($cardAlias) + { + $this->cardAlias = $cardAlias; + } + + public function getBinNumber() + { + return $this->binNumber; + } + + public function setBinNumber($binNumber) + { + $this->binNumber = $binNumber; + } + + public function getCardType() + { + return $this->cardType; + } + + public function setCardType($cardType) + { + $this->cardType = $cardType; + } + + public function getCardAssociation() + { + return $this->cardAssociation; + } + + public function setCardAssociation($cardAssociation) + { + $this->cardAssociation = $cardAssociation; + } + + public function getCardFamily() + { + return $this->cardFamily; + } + + public function setCardFamily($cardFamily) + { + $this->cardFamily = $cardFamily; + } + + public function getCardBankCode() + { + return $this->cardBankCode; + } + + public function setCardBankCode($cardBankCode) + { + $this->cardBankCode = $cardBankCode; + } + + public function getCardBankName() + { + return $this->cardBankName; + } + + public function setCardBankName($cardBankName) + { + $this->cardBankName = $cardBankName; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/CardInformation.php b/iyzipay/src/Iyzipay/Model/CardInformation.php new file mode 100644 index 0000000..3ad3747 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/CardInformation.php @@ -0,0 +1,88 @@ +cardAlias; + } + + public function setCardAlias($cardAlias) + { + $this->cardAlias = $cardAlias; + } + + public function getCardNumber() + { + return $this->cardNumber; + } + + public function setCardNumber($cardNumber) + { + $this->cardNumber = $cardNumber; + } + + public function getExpireYear() + { + return $this->expireYear; + } + + public function setExpireYear($expireYear) + { + $this->expireYear = $expireYear; + } + + public function getExpireMonth() + { + return $this->expireMonth; + } + + public function setExpireMonth($expireMonth) + { + $this->expireMonth = $expireMonth; + } + + public function getCardHolderName() + { + return $this->cardHolderName; + } + + public function setCardHolderName($cardHolderName) + { + $this->cardHolderName = $cardHolderName; + } + + public function getJsonObject() + { + return JsonBuilder::create() + ->add("cardAlias", $this->getCardAlias()) + ->add("cardNumber", $this->getCardNumber()) + ->add("expireYear", $this->getExpireYear()) + ->add("expireMonth", $this->getExpireMonth()) + ->add("cardHolderName", $this->getCardHolderName()) + ->getObject(); + } + + public function toPKIRequestString() + { + return RequestStringBuilder::create() + ->append("cardAlias", $this->getCardAlias()) + ->append("cardNumber", $this->getCardNumber()) + ->append("expireYear", $this->getExpireYear()) + ->append("expireMonth", $this->getExpireMonth()) + ->append("cardHolderName", $this->getCardHolderName()) + ->getRequestString(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/CardList.php b/iyzipay/src/Iyzipay/Model/CardList.php new file mode 100644 index 0000000..2434cc1 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/CardList.php @@ -0,0 +1,40 @@ +post($options->getBaseUrl() . "/cardstorage/cards", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return CardListMapper::create($rawResult)->jsonDecode()->mapCardList(new CardList()); + } + + public function getCardUserKey() + { + return $this->cardUserKey; + } + + public function setCardUserKey($cardUserKey) + { + $this->cardUserKey = $cardUserKey; + } + + public function getCardDetails() + { + return $this->cardDetails; + } + + public function setCardDetails($cardDetails) + { + $this->cardDetails = $cardDetails; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/CheckoutForm.php b/iyzipay/src/Iyzipay/Model/CheckoutForm.php new file mode 100644 index 0000000..9216020 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/CheckoutForm.php @@ -0,0 +1,39 @@ +post($options->getBaseUrl() . "/payment/iyzipos/checkoutform/auth/ecom/detail", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return CheckoutFormMapper::create($rawResult)->jsonDecode()->mapCheckoutForm(new CheckoutForm()); + } + + public function getToken() + { + return $this->token; + } + + public function setToken($token) + { + $this->token = $token; + } + + public function getCallbackUrl() + { + return $this->callbackUrl; + } + + public function setCallbackUrl($callbackUrl) + { + $this->callbackUrl = $callbackUrl; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/CheckoutFormInitialize.php b/iyzipay/src/Iyzipay/Model/CheckoutFormInitialize.php new file mode 100644 index 0000000..9f50136 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/CheckoutFormInitialize.php @@ -0,0 +1,16 @@ +post($options->getBaseUrl() . "/payment/iyzipos/checkoutform/initialize/auth/ecom", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return CheckoutFormInitializeMapper::create($rawResult)->jsonDecode()->mapCheckoutFormInitialize(new CheckoutFormInitialize()); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/CheckoutFormInitializePreAuth.php b/iyzipay/src/Iyzipay/Model/CheckoutFormInitializePreAuth.php new file mode 100644 index 0000000..af7dac1 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/CheckoutFormInitializePreAuth.php @@ -0,0 +1,16 @@ +post($options->getBaseUrl() . "/payment/iyzipos/checkoutform/initialize/preauth/ecom", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return CheckoutFormInitializePreAuthMapper::create($rawResult)->jsonDecode()->mapCheckoutFormInitializePreAuth(new CheckoutFormInitializePreAuth()); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/CheckoutFormInitializeResource.php b/iyzipay/src/Iyzipay/Model/CheckoutFormInitializeResource.php new file mode 100644 index 0000000..47b6fbb --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/CheckoutFormInitializeResource.php @@ -0,0 +1,53 @@ +token; + } + + public function setToken($token) + { + $this->token = $token; + } + + public function getCheckoutFormContent() + { + return $this->checkoutFormContent; + } + + public function setCheckoutFormContent($checkoutFormContent) + { + $this->checkoutFormContent = $checkoutFormContent; + } + + public function getTokenExpireTime() + { + return $this->tokenExpireTime; + } + + public function setTokenExpireTime($tokenExpireTime) + { + $this->tokenExpireTime = $tokenExpireTime; + } + + public function getPaymentPageUrl() + { + return $this->paymentPageUrl; + } + + public function setPaymentPageUrl($paymentPageUrl) + { + $this->paymentPageUrl = $paymentPageUrl; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Consumer.php b/iyzipay/src/Iyzipay/Model/Consumer.php new file mode 100644 index 0000000..d4b2a43 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Consumer.php @@ -0,0 +1,62 @@ +name; + } + + public function setName($name) + { + $this->name = $name; + } + + public function getSurname() + { + return $this->surname; + } + + public function setSurname($surname) + { + $this->surname = $surname; + } + + public function getIdentityNumber() + { + return $this->identityNumber; + } + + public function setIdentityNumber($identityNumber) + { + $this->identityNumber = $identityNumber; + } + + public function getEmail() + { + return $this->email; + } + + public function setEmail($email) + { + $this->email = $email; + } + + public function getGsmNumber() + { + return $this->gsmNumber; + } + + public function setGsmNumber($gsmNumber) + { + $this->gsmNumber = $gsmNumber; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/ConvertedPayout.php b/iyzipay/src/Iyzipay/Model/ConvertedPayout.php new file mode 100644 index 0000000..06bd8c3 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/ConvertedPayout.php @@ -0,0 +1,117 @@ +paidPrice; + } + + public function setPaidPrice($paidPrice) + { + $this->paidPrice = $paidPrice; + } + + public function getIyziCommissionRateAmount() + { + return $this->iyziCommissionRateAmount; + } + + public function setIyziCommissionRateAmount($iyziCommissionRateAmount) + { + $this->iyziCommissionRateAmount = $iyziCommissionRateAmount; + } + + public function getIyziCommissionFee() + { + return $this->iyziCommissionFee; + } + + public function setIyziCommissionFee($iyziCommissionFee) + { + $this->iyziCommissionFee = $iyziCommissionFee; + } + + public function getBlockageRateAmountMerchant() + { + return $this->blockageRateAmountMerchant; + } + + public function setBlockageRateAmountMerchant($blockageRateAmountMerchant) + { + $this->blockageRateAmountMerchant = $blockageRateAmountMerchant; + } + + public function getBlockageRateAmountSubMerchant() + { + return $this->blockageRateAmountSubMerchant; + } + + public function setBlockageRateAmountSubMerchant($blockageRateAmountSubMerchant) + { + $this->blockageRateAmountSubMerchant = $blockageRateAmountSubMerchant; + } + + public function getSubMerchantPayoutAmount() + { + return $this->subMerchantPayoutAmount; + } + + public function setSubMerchantPayoutAmount($subMerchantPayoutAmount) + { + $this->subMerchantPayoutAmount = $subMerchantPayoutAmount; + } + + public function getMerchantPayoutAmount() + { + return $this->merchantPayoutAmount; + } + + public function setMerchantPayoutAmount($merchantPayoutAmount) + { + $this->merchantPayoutAmount = $merchantPayoutAmount; + } + + public function getIyziConversionRate() + { + return $this->iyziConversionRate; + } + + public function setIyziConversionRate($iyziConversionRate) + { + $this->iyziConversionRate = $iyziConversionRate; + } + + public function getIyziConversionRateAmount() + { + return $this->iyziConversionRateAmount; + } + + public function setIyziConversionRateAmount($iyziConversionRateAmount) + { + $this->iyziConversionRateAmount = $iyziConversionRateAmount; + } + + public function getCurrency() + { + return $this->currency; + } + + public function setCurrency($currency) + { + $this->currency = $currency; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/CrossBookingFromSubMerchant.php b/iyzipay/src/Iyzipay/Model/CrossBookingFromSubMerchant.php new file mode 100644 index 0000000..ebd8f6c --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/CrossBookingFromSubMerchant.php @@ -0,0 +1,17 @@ +post($options->getBaseUrl() . "/crossbooking/receive", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return CrossBookingFromSubMerchantMapper::create($rawResult)->jsonDecode()->mapCrossBookingFromSubMerchant(new CrossBookingFromSubMerchant()); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/CrossBookingToSubMerchant.php b/iyzipay/src/Iyzipay/Model/CrossBookingToSubMerchant.php new file mode 100644 index 0000000..6a1622d --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/CrossBookingToSubMerchant.php @@ -0,0 +1,17 @@ +post($options->getBaseUrl() . "/crossbooking/send", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return CrossBookingToSubMerchantMapper::create($rawResult)->jsonDecode()->mapCrossBookingToSubMerchant(new CrossBookingToSubMerchant()); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Currency.php b/iyzipay/src/Iyzipay/Model/Currency.php new file mode 100644 index 0000000..e05781c --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Currency.php @@ -0,0 +1,15 @@ +name; + } + + public function setName($name) + { + $this->name = $name; + } + + public function getSurname() + { + return $this->surname; + } + + public function setSurname($surname) + { + $this->surname = $surname; + } + + public function getIdentityNumber() + { + return $this->identityNumber; + } + + public function setIdentityNumber($identityNumber) + { + $this->identityNumber = $identityNumber; + } + + public function getEmail() + { + return $this->email; + } + + public function setEmail($email) + { + $this->email = $email; + } + + public function getGsmNumber() + { + return $this->gsmNumber; + } + + public function setGsmNumber($gsmNumber) + { + $this->gsmNumber = $gsmNumber; + } + + public function getShippingContactName(){ + + return $this->shippingContactName; + } + + public function setShippingContactName($shippingContactName){ + + return $this->shippingContactName = $shippingContactName; + } + + public function getShippingCity(){ + + return $this->shippingCity; + } + + public function setShippingCity($shippingCity){ + + return $this->shippingCity = $shippingCity; + } + + public function getShippingCountry(){ + + return $this->shippingCountry; + } + + public function setShippingCountry($shippingCountry){ + + return $this->shippingCountry = $shippingCountry; + } + + public function getShippingAddress(){ + + return $this->shippingAddress; + } + + public function setShippingAddress($shippingAddress){ + + return $this->shippingAddress = $shippingAddress; + } + + public function getShippingZipCode(){ + + return $this->shippingZipCode; + } + + public function setShippingZipCode($shippingZipCode){ + + return $this->shippingZipCode = $shippingZipCode; + } + + public function getBillingContactName(){ + + return $this->billingContactName; + } + + public function setBillingContactName($billingContactName){ + + return $this->billingContactName = $billingContactName; + } + + public function getBillingCity(){ + + return $this->billingCity; + } + + public function setBillingCity($billingCity){ + + return $this->billingCity = $billingCity; + } + + public function getBillingCountry(){ + + return $this->billingCountry; + } + + public function setBillingCountry($billingCountry){ + + return $this->billingCountry = $billingCountry; + } + + public function getBillingAddress(){ + + return $this->billingAddress; + } + + public function setBillingAddress($billingAddress){ + + return $this->billingAddress = $billingAddress; + } + + public function getBillingZipCode(){ + + return $this->billingZipCode; + } + + public function setBillingZipCode($billingZipCode){ + + return $this->billingZipCode = $billingZipCode; + } + + public function getShippingDistrict() + { + return $this->shippingDistrict; + } + + public function setShippingDistrict($shippingDistrict) + { + $this->shippingDistrict = $shippingDistrict; + } + + public function getBillingDistrict() + { + return $this->billingDistrict; + } + + public function setBillingDistrict($billingDistrict) + { + $this->billingDistrict = $billingDistrict; + } + + public function getJsonObject($locale = null,$conversationId = null,$customerReferenceCode = null) + { + return JsonBuilder::create() + ->add("locale", $locale) + ->add("conversationId", $conversationId) + ->add("customerReferenceCode", $customerReferenceCode) + ->add("name", $this->getName()) + ->add("surname", $this->getSurname()) + ->add("identityNumber", $this->getIdentityNumber()) + ->add("email", $this->getEmail()) + ->add("gsmNumber", $this->getGsmNumber()) + ->add("billingAddress", + JsonBuilder::create() + ->add("contactName", $this->getBillingContactName()) + ->add("city", $this->getBillingCity()) + ->add("district", $this->getBillingDistrict()) + ->add("country", $this->getBillingCountry()) + ->add("address", $this->getBillingAddress()) + ->add("zipCode", $this->getBillingZipCode()) + ->getObject() + ) + ->add("shippingAddress", + JsonBuilder::create() + ->add("contactName", $this->getShippingContactName()) + ->add("city", $this->getShippingCity()) + ->add("district", $this->getShippingDistrict()) + ->add("country", $this->getShippingCountry()) + ->add("address", $this->getShippingAddress()) + ->add("zipCode", $this->getShippingZipCode()) + ->getObject() + ) + ->getObject(); + } + + public function toPKIRequestString() + { + return RequestStringBuilder::create() + ->append("name", $this->getName()) + ->append("surname", $this->getSurname()) + ->append("identityNumber", $this->getIdentityNumber()) + ->append("email", $this->getEmail()) + ->append("gsmNumber", $this->getGsmNumber()) + ->append("billingAddress", + RequestStringBuilder::create() + ->append("contactName", $this->getBillingContactName()) + ->append("city", $this->getBillingCity()) + ->append("district", $this->getBillingDistrict()) + ->append("country", $this->getBillingCountry()) + ->append("address", $this->getBillingAddress()) + ->append("zipCode", $this->getBillingZipCode()) + ->getRequestString() + ) + ->append("shippingAddress", + RequestStringBuilder::create() + ->append("contactName", $this->getShippingContactName()) + ->append("city", $this->getShippingCity()) + ->append("district", $this->getShippingDistrict()) + ->append("country", $this->getShippingCountry()) + ->append("address", $this->getShippingAddress()) + ->append("zipCode", $this->getShippingZipCode()) + ->getRequestString() + ) + ->getRequestString(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Disapproval.php b/iyzipay/src/Iyzipay/Model/Disapproval.php new file mode 100644 index 0000000..e2821a5 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Disapproval.php @@ -0,0 +1,29 @@ +post($options->getBaseUrl() . "/payment/iyzipos/item/disapprove", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return DisapprovalMapper::create($rawResult)->jsonDecode()->mapDisapproval(new Disapproval()); + } + + public function getPaymentTransactionId() + { + return $this->paymentTransactionId; + } + + public function setPaymentTransactionId($paymentTransactionId) + { + $this->paymentTransactionId = $paymentTransactionId; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/InitialConsumer.php b/iyzipay/src/Iyzipay/Model/InitialConsumer.php new file mode 100644 index 0000000..22e7bc8 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/InitialConsumer.php @@ -0,0 +1,88 @@ +name; + } + + public function setName($name) + { + $this->name = $name; + } + + public function getSurname() + { + return $this->surname; + } + + public function setSurname($surname) + { + $this->surname = $surname; + } + + public function getEmail() + { + return $this->email; + } + + public function setEmail($email) + { + $this->email = $email; + } + + public function getGsmNumber() + { + return $this->gsmNumber; + } + + public function setGsmNumber($gsmNumber) + { + $this->gsmNumber = $gsmNumber; + } + + public function getAddressList() + { + return $this->addressList; + } + + public function setAddressList($addressList) + { + $this->addressList = $addressList; + } + + public function getJsonObject() + { + return JsonBuilder::create() + ->add("name", $this->getName()) + ->add("surname", $this->getSurname()) + ->add("email", $this->getEmail()) + ->add("gsmNumber", $this->getGsmNumber()) + ->addArray("addressList", $this->getAddressList()) + ->getObject(); + } + + public function toPKIRequestString() + { + return RequestStringBuilder::create() + ->append("name", $this->getName()) + ->append("surname", $this->getSurname()) + ->append("email", $this->getEmail()) + ->append("gsmNumber", $this->getGsmNumber()) + ->appendArray("addressList", $this->getAddressList()) + ->getRequestString(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/InstallmentDetail.php b/iyzipay/src/Iyzipay/Model/InstallmentDetail.php new file mode 100644 index 0000000..7334690 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/InstallmentDetail.php @@ -0,0 +1,128 @@ +binNumber; + } + + public function setBinNumber($binNumber) + { + $this->binNumber = $binNumber; + } + + public function getPrice() + { + return $this->price; + } + + public function setPrice($price) + { + $this->price = $price; + } + + public function getCardType() + { + return $this->cardType; + } + + public function setCardType($cardType) + { + $this->cardType = $cardType; + } + + public function getCardAssociation() + { + return $this->cardAssociation; + } + + public function setCardAssociation($cardAssociation) + { + $this->cardAssociation = $cardAssociation; + } + + public function getCardFamilyName() + { + return $this->cardFamilyName; + } + + public function setCardFamilyName($cardFamilyName) + { + $this->cardFamilyName = $cardFamilyName; + } + + public function getForce3ds() + { + return $this->force3ds; + } + + public function setForce3ds($force3ds) + { + $this->force3ds = $force3ds; + } + + public function getBankCode() + { + return $this->bankCode; + } + + public function setBankCode($bankCode) + { + $this->bankCode = $bankCode; + } + + public function getBankName() + { + return $this->bankName; + } + + public function setBankName($bankName) + { + $this->bankName = $bankName; + } + + public function getForceCvc() + { + return $this->forceCvc; + } + + public function setForceCvc($forceCvc) + { + $this->forceCvc = $forceCvc; + } + + public function getCommercial() + { + return $this->commercial; + } + + public function setCommercial($commercial) + { + $this->commercial = $commercial; + } + + public function getInstallmentPrices() + { + return $this->installmentPrices; + } + + public function setInstallmentPrices($installmentPrices) + { + $this->installmentPrices = $installmentPrices; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/InstallmentHtml.php b/iyzipay/src/Iyzipay/Model/InstallmentHtml.php new file mode 100644 index 0000000..4fcae17 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/InstallmentHtml.php @@ -0,0 +1,29 @@ +post($options->getBaseUrl() . "/payment/iyzipos/installment/html/horizontal", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return InstallmentHtmlMapper::create($rawResult)->jsonDecode()->mapInstallmentHtml(new InstallmentHtml()); + } + + public function getHtmlContent() + { + return $this->htmlContent; + } + + public function setHtmlContent($htmlContent) + { + $this->htmlContent = $htmlContent; + } +} diff --git a/iyzipay/src/Iyzipay/Model/InstallmentInfo.php b/iyzipay/src/Iyzipay/Model/InstallmentInfo.php new file mode 100644 index 0000000..26b22cb --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/InstallmentInfo.php @@ -0,0 +1,29 @@ +post($options->getBaseUrl() . "/payment/iyzipos/installment", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return InstallmentInfoMapper::create($rawResult)->jsonDecode()->mapInstallmentInfo(new InstallmentInfo()); + } + + public function getInstallmentDetails() + { + return $this->installmentDetails; + } + + public function setInstallmentDetails($installmentDetails) + { + $this->installmentDetails = $installmentDetails; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/InstallmentPrice.php b/iyzipay/src/Iyzipay/Model/InstallmentPrice.php new file mode 100644 index 0000000..d203e75 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/InstallmentPrice.php @@ -0,0 +1,40 @@ +installmentPrice; + } + + public function setInstallmentPrice($installmentPrice) + { + $this->installmentPrice = $installmentPrice; + } + + public function getTotalPrice() + { + return $this->totalPrice; + } + + public function setTotalPrice($totalPrice) + { + $this->totalPrice = $totalPrice; + } + + public function getInstallmentNumber() + { + return $this->installmentNumber; + } + + public function setInstallmentNumber($installmentNumber) + { + $this->installmentNumber = $installmentNumber; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Iyzilink/IyziLinkDeleteProduct.php b/iyzipay/src/Iyzipay/Model/Iyzilink/IyziLinkDeleteProduct.php new file mode 100644 index 0000000..66f0079 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Iyzilink/IyziLinkDeleteProduct.php @@ -0,0 +1,19 @@ +getBaseUrl() . "/v2/iyzilink/products/" . $token . RequestStringBuilder::requestToStringQuery($request, null); + $rawResult = parent::httpClient()->delete($uri, parent::getHttpHeadersV2($uri, null, $options)); + return IyziLinkDeleteProductMapper::create($rawResult)->jsonDecode()->mapIyziLinkDeleteProduct(new IyziLinkDeleteProduct()); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Iyzilink/IyziLinkDeleteProductResource.php b/iyzipay/src/Iyzipay/Model/Iyzilink/IyziLinkDeleteProductResource.php new file mode 100644 index 0000000..1bcfd92 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Iyzilink/IyziLinkDeleteProductResource.php @@ -0,0 +1,10 @@ +getBaseUrl() . "/v2/iyzilink/products" . RequestStringBuilder::requestToStringQuery($request, 'pages'); + $rawResult = parent::httpClient()->getV2($uri, parent::getHttpHeadersV2($uri, null, $options)); + return IyziLinkRetrieveAllProductMapper::create($rawResult)->jsonDecode()->mapIyziLinkRetriveAllProduct(new IyziLinkRetrieveAllProduct()); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Iyzilink/IyziLinkRetrieveAllProductResource.php b/iyzipay/src/Iyzipay/Model/Iyzilink/IyziLinkRetrieveAllProductResource.php new file mode 100644 index 0000000..ad7271f --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Iyzilink/IyziLinkRetrieveAllProductResource.php @@ -0,0 +1,64 @@ +listingReviewed; + } + + public function setListingReviewed($listingReviewed) + { + $this->listingReviewed = $listingReviewed; + } + + public function getTotalCount() + { + return $this->totalCount; + } + + public function setTotalCount($totalCount) + { + $this->totalCount = $totalCount; + } + + public function getCurrentPage() + { + return $this->currentPage; + } + + public function setCurrentPage($currentPage) + { + $this->currentPage = $currentPage; + } + + public function getPageCount() + { + return $this->pageCount; + } + + public function setPageCount($pageCount) + { + $this->pageCount = $pageCount; + } + + public function getItems() + { + return $this->items; + } + + public function setItems($items) + { + $this->items = $items; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Iyzilink/IyziLinkRetrieveProduct.php b/iyzipay/src/Iyzipay/Model/Iyzilink/IyziLinkRetrieveProduct.php new file mode 100644 index 0000000..2cd93c1 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Iyzilink/IyziLinkRetrieveProduct.php @@ -0,0 +1,18 @@ +getBaseUrl() . "/v2/iyzilink/products/" . $token. RequestStringBuilder::requestToStringQuery($request, null); + $rawResult = parent::httpClient()->getV2($uri, parent::getHttpHeadersV2($uri, null, $options)); + return IyziLinkRetrieveProductMapper::create($rawResult)->jsonDecode()->mapIyziLinkRetriveProduct(new IyziLinkRetrieveProduct()); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Iyzilink/IyziLinkRetrieveProductResource.php b/iyzipay/src/Iyzipay/Model/Iyzilink/IyziLinkRetrieveProductResource.php new file mode 100644 index 0000000..b8e5c9e --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Iyzilink/IyziLinkRetrieveProductResource.php @@ -0,0 +1,20 @@ +item; + } + + public function setItem($item) + { + $this->item = $item; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Iyzilink/IyziLinkSaveProduct.php b/iyzipay/src/Iyzipay/Model/Iyzilink/IyziLinkSaveProduct.php new file mode 100644 index 0000000..a31611a --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Iyzilink/IyziLinkSaveProduct.php @@ -0,0 +1,18 @@ +getBaseUrl() . "/v2/iyzilink/products/". RequestStringBuilder::requestToStringQuery($request, null); + $rawResult = parent::httpClient()->post($uri, parent::getHttpHeadersV2($uri, $request, $options), $request->toJsonString()); + return IyziLinkSaveProductMapper::create($rawResult)->jsonDecode()->mapIyziLinkSaveProduct(new IyziLinkSaveProduct()); + } +} diff --git a/iyzipay/src/Iyzipay/Model/Iyzilink/IyziLinkSaveProductResource.php b/iyzipay/src/Iyzipay/Model/Iyzilink/IyziLinkSaveProductResource.php new file mode 100644 index 0000000..9869129 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Iyzilink/IyziLinkSaveProductResource.php @@ -0,0 +1,74 @@ +base64EncodedImage; + } + + public function getPrice() + { + return $this->price; + } + + + public function getCurrency() + { + return $this->currency; + } + + public function getAddressIgnorable() + { + return $this->addressIgnorable; + } + + public function getSoldLimit() + { + return $this->soldLimit; + } + + public function getToken() + { + return $this->token; + } + + public function setToken($token) + { + $this->token = $token; + } + + public function getUrl() + { + return $this->url; + } + + public function setUrl($url) + { + $this->url = $url; + } + + public function getImageUrl() + { + return $this->imageUrl; + } + + public function setImageUrl($imageUrl) + { + $this->imageUrl = $imageUrl; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Iyzilink/IyziLinkUpdateProduct.php b/iyzipay/src/Iyzipay/Model/Iyzilink/IyziLinkUpdateProduct.php new file mode 100644 index 0000000..433a5b1 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Iyzilink/IyziLinkUpdateProduct.php @@ -0,0 +1,18 @@ +getBaseUrl() . "/v2/iyzilink/products/" . $token . RequestStringBuilder::requestToStringQuery($request, null); + $rawResult = parent::httpClient()->put($uri, parent::getHttpHeadersV2($uri, $request, $options), $request->toJsonString()); + return IyziLinkSaveProductMapper::create($rawResult)->jsonDecode()->mapIyziLinkSaveProduct(new IyziLinkSaveProduct()); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/IyziupAddress.php b/iyzipay/src/Iyzipay/Model/IyziupAddress.php new file mode 100644 index 0000000..df021cb --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/IyziupAddress.php @@ -0,0 +1,114 @@ +alias; + } + + public function setAlias($alias) + { + $this->alias = $alias; + } + + public function getAddressLine1() + { + return $this->addressLine1; + } + + public function setAddressLine1($addressLine1) + { + $this->addressLine1 = $addressLine1; + } + + public function getAddressLine2() + { + return $this->addressLine2; + } + + public function setAddressLine2($addressLine2) + { + $this->addressLine2 = $addressLine2; + } + + public function getZipCode() + { + return $this->zipCode; + } + + public function setZipCode($zipCode) + { + $this->zipCode = $zipCode; + } + + public function getContactName() + { + return $this->contactName; + } + + public function setContactName($contactName) + { + $this->contactName = $contactName; + } + + public function getCity() + { + return $this->city; + } + + public function setCity($city) + { + $this->city = $city; + } + + public function getCountry() + { + return $this->country; + } + + public function setCountry($country) + { + $this->country = $country; + } + + public function getJsonObject() + { + return JsonBuilder::create() + ->add("alias", $this->getAlias()) + ->add("addressLine1", $this->getAddressLine1()) + ->add("addressLine2", $this->getAddressLine2()) + ->add("zipCode", $this->getZipCode()) + ->add("contactName", $this->getContactName()) + ->add("city", $this->getCity()) + ->add("country", $this->getCountry()) + ->getObject(); + } + + public function toPKIRequestString() + { + return RequestStringBuilder::create() + ->append("alias", $this->getAlias()) + ->append("addressLine1", $this->getAddressLine1()) + ->append("addressLine2", $this->getAddressLine2()) + ->append("zipCode", $this->getZipCode()) + ->append("contactName", $this->getContactName()) + ->append("city", $this->getCity()) + ->append("country", $this->getCountry()) + ->getRequestString(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/IyziupForm.php b/iyzipay/src/Iyzipay/Model/IyziupForm.php new file mode 100644 index 0000000..cf7c421 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/IyziupForm.php @@ -0,0 +1,96 @@ +post($options->getBaseUrl() . "/v1/iyziup/form/order/retrieve", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return IyziupFormMapper::create($rawResult)->jsonDecode()->mapIyziupForm(new IyziupForm()); + } + + public function getOrderResponseStatus() + { + return $this->orderResponseStatus; + } + + public function setOrderResponseStatus($orderResponseStatus) + { + $this->orderResponseStatus = $orderResponseStatus; + } + + public function getToken() + { + return $this->token; + } + + public function setToken($token) + { + $this->token = $token; + } + + public function getCallbackUrl() + { + return $this->callbackUrl; + } + + public function setCallbackUrl($callbackUrl) + { + $this->callbackUrl = $callbackUrl; + } + + public function getConsumer() + { + return $this->consumer; + } + + public function setConsumer($consumer) + { + $this->consumer = $consumer; + } + + public function getShippingAddress() + { + return $this->shippingAddress; + } + + public function setShippingAddress($shippingAddress) + { + $this->shippingAddress = $shippingAddress; + } + + public function getBillingAddress() + { + return $this->billingAddress; + } + + public function setBillingAddress($billingAddress) + { + $this->billingAddress = $billingAddress; + } + + public function getPaymentDetail() + { + return $this->paymentDetail; + } + + public function setPaymentDetail($paymentDetail) + { + $this->paymentDetail = $paymentDetail; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/IyziupFormInitialize.php b/iyzipay/src/Iyzipay/Model/IyziupFormInitialize.php new file mode 100644 index 0000000..c86769c --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/IyziupFormInitialize.php @@ -0,0 +1,16 @@ +post($options->getBaseUrl() . "/v1/iyziup/form/initialize", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return IyziupFormInitializeMapper::create($rawResult)->jsonDecode()->mapIyziupFormInitialize(new IyziupFormInitialize()); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/IyziupFormInitializeResource.php b/iyzipay/src/Iyzipay/Model/IyziupFormInitializeResource.php new file mode 100644 index 0000000..73057da --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/IyziupFormInitializeResource.php @@ -0,0 +1,42 @@ +token; + } + + public function setToken($token) + { + $this->token = $token; + } + + public function getContent() + { + return $this->content; + } + + public function setContent($content) + { + $this->content = $content; + } + + public function getTokenExpireTime() + { + return $this->tokenExpireTime; + } + + public function setTokenExpireTime($tokenExpireTime) + { + $this->tokenExpireTime = $tokenExpireTime; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Locale.php b/iyzipay/src/Iyzipay/Model/Locale.php new file mode 100644 index 0000000..229bb81 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Locale.php @@ -0,0 +1,9 @@ +address)) { + $address->setAddress($jsonObject->address); + } + if (isset($jsonObject->zipCode)) { + $address->setZipCode($jsonObject->zipCode); + } + if (isset($jsonObject->contactName)) { + $address->setContactName($jsonObject->contactName); + } + if (isset($jsonObject->city)) { + $address->setCity($jsonObject->city); + } + if (isset($jsonObject->country)) { + $address->setCountry($jsonObject->country); + } + return $address; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/ApmMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/ApmMapper.php new file mode 100644 index 0000000..9509258 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/ApmMapper.php @@ -0,0 +1,24 @@ +mapApmFrom($apm, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/ApmResourceMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/ApmResourceMapper.php new file mode 100644 index 0000000..3c915c5 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/ApmResourceMapper.php @@ -0,0 +1,94 @@ +redirectUrl)) { + $apmResource->setRedirectUrl($jsonObject->redirectUrl); + } + if (isset($jsonObject->price)) { + $apmResource->setPrice($jsonObject->price); + } + if (isset($jsonObject->paidPrice)) { + $apmResource->setPaidPrice($jsonObject->paidPrice); + } + if (isset($jsonObject->paymentId)) { + $apmResource->setPaymentId($jsonObject->paymentId); + } + if (isset($jsonObject->merchantCommissionRate)) { + $apmResource->setMerchantCommissionRate($jsonObject->merchantCommissionRate); + } + if (isset($jsonObject->merchantCommissionRateAmount)) { + $apmResource->setMerchantCommissionRateAmount($jsonObject->merchantCommissionRateAmount); + } + if (isset($jsonObject->iyziCommissionRateAmount)) { + $apmResource->setIyziCommissionRateAmount($jsonObject->iyziCommissionRateAmount); + } + if (isset($jsonObject->iyziCommissionFee)) { + $apmResource->setIyziCommissionFee($jsonObject->iyziCommissionFee); + } + if (isset($jsonObject->basketId)) { + $apmResource->setBasketId($jsonObject->basketId); + } + if (isset($jsonObject->currency)) { + $apmResource->setCurrency($jsonObject->currency); + } + if (isset($jsonObject->itemTransactions)) { + $apmResource->setPaymentItems(PaymentItemMapper::create()->mapPaymentItems($jsonObject->itemTransactions)); + } + if (isset($jsonObject->phase)) { + $apmResource->setPhase($jsonObject->phase); + } + if (isset($jsonObject->accountHolderName)) { + $apmResource->setAccountHolderName($jsonObject->accountHolderName); + } + if (isset($jsonObject->accountNumber)) { + $apmResource->setAccountNumber($jsonObject->accountNumber); + } + if (isset($jsonObject->bankName)) { + $apmResource->setBankName($jsonObject->bankName); + } + if (isset($jsonObject->bankCode)) { + $apmResource->setBankCode($jsonObject->bankCode); + } + if (isset($jsonObject->bic)) { + $apmResource->setBic($jsonObject->bic); + } + if (isset($jsonObject->paymentPurpose)) { + $apmResource->setPaymentPurpose($jsonObject->paymentPurpose); + } + if (isset($jsonObject->iban)) { + $apmResource->setIban($jsonObject->iban); + } + if (isset($jsonObject->countryCode)) { + $apmResource->setCountryCode($jsonObject->countryCode); + } + if (isset($jsonObject->apm)) { + $apmResource->setApm($jsonObject->apm); + } + if (isset($jsonObject->mobilePhone)) { + $apmResource->setMobilePhone($jsonObject->mobilePhone); + } + if (isset($jsonObject->paymentStatus)) { + $apmResource->setPaymentStatus($jsonObject->paymentStatus); + } + return $apmResource; + } + + public function mapApmResource(ApmResource $apmResource) + { + return $this->mapApmResourceFrom($apmResource, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/ApprovalMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/ApprovalMapper.php new file mode 100644 index 0000000..1b8cf97 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/ApprovalMapper.php @@ -0,0 +1,28 @@ +paymentTransactionId)) { + $approval->setPaymentTransactionId($jsonObject->paymentTransactionId); + } + return $approval; + } + + public function mapApproval(Approval $approval) + { + return $this->mapApprovalFrom($approval, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/BasicBkmInitializeMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/BasicBkmInitializeMapper.php new file mode 100644 index 0000000..827b181 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/BasicBkmInitializeMapper.php @@ -0,0 +1,31 @@ +htmlContent)) { + $initialize->setHtmlContent(base64_decode($jsonObject->htmlContent)); + } + if (isset($jsonObject->token)) { + $initialize->setToken($jsonObject->token); + } + return $initialize; + } + + public function mapBasicBkmInitialize(BasicBkmInitialize $initialize) + { + return $this->mapBasicBkmInitializeFrom($initialize, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/BasicBkmMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/BasicBkmMapper.php new file mode 100644 index 0000000..d2047f8 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/BasicBkmMapper.php @@ -0,0 +1,34 @@ +token)) { + $auth->setToken($jsonObject->token); + } + if (isset($jsonObject->callbackUrl)) { + $auth->setCallbackUrl($jsonObject->callbackUrl); + } + if (isset($jsonObject->paymentStatus)) { + $auth->setPaymentStatus($jsonObject->paymentStatus); + } + return $auth; + } + + public function mapBasicBkm(BasicBkm $auth) + { + return $this->mapBasicBkmFrom($auth, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/BasicPaymentMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/BasicPaymentMapper.php new file mode 100644 index 0000000..a607477 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/BasicPaymentMapper.php @@ -0,0 +1,24 @@ +mapBasicPaymentFrom($payment, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/BasicPaymentPostAuthMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/BasicPaymentPostAuthMapper.php new file mode 100644 index 0000000..beeb8ef --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/BasicPaymentPostAuthMapper.php @@ -0,0 +1,24 @@ +mapBasicPaymentPostAuthFrom($postAuth, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/BasicPaymentPreAuthMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/BasicPaymentPreAuthMapper.php new file mode 100644 index 0000000..7b60c99 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/BasicPaymentPreAuthMapper.php @@ -0,0 +1,24 @@ +mapBasicPaymentPreAuthFrom($preAuth, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/BasicPaymentResourceMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/BasicPaymentResourceMapper.php new file mode 100644 index 0000000..0fee55a --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/BasicPaymentResourceMapper.php @@ -0,0 +1,79 @@ +price)) { + $payment->setPrice($jsonObject->price); + } + if (isset($jsonObject->paidPrice)) { + $payment->setPaidPrice($jsonObject->paidPrice); + } + if (isset($jsonObject->installment)) { + $payment->setInstallment($jsonObject->installment); + } + if (isset($jsonObject->paymentId)) { + $payment->setPaymentId($jsonObject->paymentId); + } + if (isset($jsonObject->merchantCommissionRate)) { + $payment->setMerchantCommissionRate($jsonObject->merchantCommissionRate); + } + if (isset($jsonObject->merchantCommissionRateAmount)) { + $payment->setMerchantCommissionRateAmount($jsonObject->merchantCommissionRateAmount); + } + if (isset($jsonObject->iyziCommissionFee)) { + $payment->setIyziCommissionFee($jsonObject->iyziCommissionFee); + } + if (isset($jsonObject->cardType)) { + $payment->setCardType($jsonObject->cardType); + } + if (isset($jsonObject->cardAssociation)) { + $payment->setCardAssociation($jsonObject->cardAssociation); + } + if (isset($jsonObject->cardFamily)) { + $payment->setCardFamily($jsonObject->cardFamily); + } + if (isset($jsonObject->cardToken)) { + $payment->setCardToken($jsonObject->cardToken); + } + if (isset($jsonObject->cardUserKey)) { + $payment->setCardUserKey($jsonObject->cardUserKey); + } + if (isset($jsonObject->binNumber)) { + $payment->setBinNumber($jsonObject->binNumber); + } + if (isset($jsonObject->paymentTransactionId)) { + $payment->setPaymentTransactionId($jsonObject->paymentTransactionId); + } + if (isset($jsonObject->authCode)) { + $payment->setAuthCode($jsonObject->authCode); + } + if (isset($jsonObject->connectorName)) { + $payment->setConnectorName($jsonObject->connectorName); + } + if (isset($jsonObject->currency)) { + $payment->setCurrency($jsonObject->currency); + } + if (isset($jsonObject->phase)) { + $payment->setPhase($jsonObject->phase); + } + return $payment; + } + + public function mapBasicPaymentResource(BasicPaymentResource $payment) + { + return $this->mapBasicPaymentResourceFrom($payment, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/BasicThreedsInitializeMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/BasicThreedsInitializeMapper.php new file mode 100644 index 0000000..bdca52e --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/BasicThreedsInitializeMapper.php @@ -0,0 +1,28 @@ +threeDSHtmlContent)) { + $initialize->setHtmlContent(base64_decode($jsonObject->threeDSHtmlContent)); + } + return $initialize; + } + + public function mapBasicThreedsInitialize(BasicThreedsInitialize $initialize) + { + return $this->mapBasicThreedsInitializeFrom($initialize, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/BasicThreedsInitializePreAuthMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/BasicThreedsInitializePreAuthMapper.php new file mode 100644 index 0000000..985cdc8 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/BasicThreedsInitializePreAuthMapper.php @@ -0,0 +1,28 @@ +threeDSHtmlContent)) { + $initializePreAuth->setHtmlContent(base64_decode($jsonObject->threeDSHtmlContent)); + } + return $initializePreAuth; + } + + public function mapBasicThreedsInitializePreAuth(BasicThreedsInitializePreAuth $initializePreAuth) + { + return $this->mapBasicThreedsInitializePreAuthFrom($initializePreAuth, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/BasicThreedsPaymentMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/BasicThreedsPaymentMapper.php new file mode 100644 index 0000000..24980ef --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/BasicThreedsPaymentMapper.php @@ -0,0 +1,24 @@ +mapBasicThreedsPaymentFrom($auth, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/BinNumberMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/BinNumberMapper.php new file mode 100644 index 0000000..5d4e805 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/BinNumberMapper.php @@ -0,0 +1,46 @@ +binNumber)) { + $binNumber->setBinNumber($jsonObject->binNumber); + } + if (isset($jsonObject->cardType)) { + $binNumber->setCardType($jsonObject->cardType); + } + if (isset($jsonObject->cardAssociation)) { + $binNumber->setCardAssociation($jsonObject->cardAssociation); + } + if (isset($jsonObject->cardFamily)) { + $binNumber->setCardFamily($jsonObject->cardFamily); + } + if (isset($jsonObject->bankName)) { + $binNumber->setBankName($jsonObject->bankName); + } + if (isset($jsonObject->bankCode)) { + $binNumber->setBankCode($jsonObject->bankCode); + } + if (isset($jsonObject->commercial)) { + $binNumber->setCommercial($jsonObject->commercial); + } + return $binNumber; + } + + public function mapBinNumber(BinNumber $binNumber) + { + return $this->mapBinNumberFrom($binNumber, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/BkmInitializeMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/BkmInitializeMapper.php new file mode 100644 index 0000000..37e146e --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/BkmInitializeMapper.php @@ -0,0 +1,31 @@ +htmlContent)) { + $initialize->setHtmlContent(base64_decode($jsonObject->htmlContent)); + } + if (isset($jsonObject->token)) { + $initialize->setToken($jsonObject->token); + } + return $initialize; + } + + public function mapBkmInitialize(BkmInitialize $initialize) + { + return $this->mapBkmInitializeFrom($initialize, $this->jsonObject); + } +} diff --git a/iyzipay/src/Iyzipay/Model/Mapper/BkmMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/BkmMapper.php new file mode 100644 index 0000000..807fd03 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/BkmMapper.php @@ -0,0 +1,31 @@ +token)) { + $auth->setToken($jsonObject->token); + } + if (isset($jsonObject->callbackUrl)) { + $auth->setCallbackUrl($jsonObject->callbackUrl); + } + return $auth; + } + + public function mapBkm(Bkm $auth) + { + return $this->mapBkmFrom($auth, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/BouncedBankTransferListMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/BouncedBankTransferListMapper.php new file mode 100644 index 0000000..2dfe066 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/BouncedBankTransferListMapper.php @@ -0,0 +1,59 @@ +bouncedRows)) { + $transferList->setBankTransfers($this->mapBankTransfers($jsonObject->bouncedRows)); + } + return $transferList; + } + + public function mapBouncedBankTransferList(BouncedBankTransferList $transferList) + { + return $this->mapBouncedBankTransferListFrom($transferList, $this->jsonObject); + } + + private function mapBankTransfers($bouncedRows) + { + $bankTransfers = array(); + + foreach ($bouncedRows as $index => $bouncedRow) { + $bankTransfer = new BankTransfer(); + + if (isset($bouncedRow->subMerchantKey)) { + $bankTransfer->setSubMerchantKey($bouncedRow->subMerchantKey); + } + if (isset($bouncedRow->iban)) { + $bankTransfer->setIban($bouncedRow->iban); + } + if (isset($bouncedRow->contactName)) { + $bankTransfer->setContactName($bouncedRow->contactName); + } + if (isset($bouncedRow->contactSurname)) { + $bankTransfer->setContactSurname($bouncedRow->contactSurname); + } + if (isset($bouncedRow->legalCompanyTitle)) { + $bankTransfer->setLegalCompanyTitle($bouncedRow->legalCompanyTitle); + } + if (isset($bouncedRow->marketplaceSubmerchantType)) { + $bankTransfer->setMarketplaceSubMerchantType($bouncedRow->marketplaceSubmerchantType); + } + $bankTransfers[$index] = $bankTransfer; + } + return $bankTransfers; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/CancelMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/CancelMapper.php new file mode 100644 index 0000000..c6a33d1 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/CancelMapper.php @@ -0,0 +1,40 @@ +paymentId)) { + $cancel->setPaymentId($jsonObject->paymentId); + } + if (isset($jsonObject->price)) { + $cancel->setPrice($jsonObject->price); + } + if (isset($jsonObject->currency)) { + $cancel->setCurrency($jsonObject->currency); + } + if (isset($jsonObject->connectorName)) { + $cancel->setConnectorName($jsonObject->connectorName); + } + if (isset($jsonObject->authCode)) { + $cancel->setAuthCode($jsonObject->authCode); + } + return $cancel; + } + + public function mapCancel(Cancel $cancel) + { + return $this->mapCancelFrom($cancel, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/CardListMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/CardListMapper.php new file mode 100644 index 0000000..e37588b --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/CardListMapper.php @@ -0,0 +1,42 @@ +cardUserKey)) { + $cardList->setCardUserKey($jsonObject->cardUserKey); + } + if (isset($jsonObject->cardDetails)) { + $cardList->setCardDetails($this->mapCardDetails($jsonObject->cardDetails)); + } + return $cardList; + } + + public function mapCardList(CardList $cardList) + { + return $this->mapCardListFrom($cardList, $this->jsonObject); + } + + private function mapCardDetails($cardDetails) + { + $cards = array(); + + foreach ($cardDetails as $index => $cardDetail) { + $cards[$index] = CardMapper::create()->mapCardFrom(new Card(), $cardDetail); + } + return $cards; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/CardMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/CardMapper.php new file mode 100644 index 0000000..2a33280 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/CardMapper.php @@ -0,0 +1,58 @@ +externalId)) { + $card->setExternalId($jsonObject->externalId); + } + if (isset($jsonObject->email)) { + $card->setEmail($jsonObject->email); + } + if (isset($jsonObject->cardUserKey)) { + $card->setCardUserKey($jsonObject->cardUserKey); + } + if (isset($jsonObject->cardToken)) { + $card->setCardToken($jsonObject->cardToken); + } + if (isset($jsonObject->cardAlias)) { + $card->setCardAlias($jsonObject->cardAlias); + } + if (isset($jsonObject->binNumber)) { + $card->setBinNumber($jsonObject->binNumber); + } + if (isset($jsonObject->cardType)) { + $card->setCardType($jsonObject->cardType); + } + if (isset($jsonObject->cardAssociation)) { + $card->setCardAssociation($jsonObject->cardAssociation); + } + if (isset($jsonObject->cardFamily)) { + $card->setCardFamily($jsonObject->cardFamily); + } + if (isset($jsonObject->cardBankCode)) { + $card->setCardBankCode($jsonObject->cardBankCode); + } + if (isset($jsonObject->cardBankName)) { + $card->setCardBankName($jsonObject->cardBankName); + } + return $card; + } + + public function mapCard(Card $card) + { + return $this->mapCardFrom($card, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/CheckoutFormInitializeMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/CheckoutFormInitializeMapper.php new file mode 100644 index 0000000..97bb630 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/CheckoutFormInitializeMapper.php @@ -0,0 +1,24 @@ +mapCheckoutFormInitializeFrom($initialize, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/CheckoutFormInitializePreAuthMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/CheckoutFormInitializePreAuthMapper.php new file mode 100644 index 0000000..a4d91bd --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/CheckoutFormInitializePreAuthMapper.php @@ -0,0 +1,24 @@ +mapCheckoutFormInitializePreAuthFrom($initialize, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/CheckoutFormInitializeResourceMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/CheckoutFormInitializeResourceMapper.php new file mode 100644 index 0000000..f2458ff --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/CheckoutFormInitializeResourceMapper.php @@ -0,0 +1,37 @@ +token)) { + $initialize->setToken($jsonObject->token); + } + if (isset($jsonObject->checkoutFormContent)) { + $initialize->setCheckoutFormContent($jsonObject->checkoutFormContent); + } + if (isset($jsonObject->tokenExpireTime)) { + $initialize->setTokenExpireTime($jsonObject->tokenExpireTime); + } + if (isset($jsonObject->paymentPageUrl)) { + $initialize->setPaymentPageUrl($jsonObject->paymentPageUrl); + } + return $initialize; + } + + public function mapCheckoutFormInitializeResource(CheckoutFormInitializeResource $initialize) + { + return $this->mapCheckoutFormInitializeResourceFrom($initialize, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/CheckoutFormMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/CheckoutFormMapper.php new file mode 100644 index 0000000..92e34f0 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/CheckoutFormMapper.php @@ -0,0 +1,31 @@ +token)) { + $auth->setToken($jsonObject->token); + } + if (isset($jsonObject->callbackUrl)) { + $auth->setCallbackUrl($jsonObject->callbackUrl); + } + return $auth; + } + + public function mapCheckoutForm(CheckoutForm $auth) + { + return $this->mapCheckoutFormFrom($auth, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/ConsumerMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/ConsumerMapper.php new file mode 100644 index 0000000..2671130 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/ConsumerMapper.php @@ -0,0 +1,33 @@ +name)) { + $consumer->setName($jsonObject->name); + } + if (isset($jsonObject->surname)) { + $consumer->setSurname($jsonObject->surname); + } + if (isset($jsonObject->identityNumber)) { + $consumer->setIdentityNumber($jsonObject->identityNumber); + } + if (isset($jsonObject->email)) { + $consumer->setEmail($jsonObject->email); + } + if (isset($jsonObject->gsmNumber)) { + $consumer->setGsmNumber($jsonObject->gsmNumber); + } + return $consumer; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/CrossBookingFromSubMerchantMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/CrossBookingFromSubMerchantMapper.php new file mode 100644 index 0000000..9a86b0f --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/CrossBookingFromSubMerchantMapper.php @@ -0,0 +1,24 @@ +mapCrossBookingFromSubMerchantFrom($booking, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/CrossBookingToSubMerchantMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/CrossBookingToSubMerchantMapper.php new file mode 100644 index 0000000..65ddcf0 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/CrossBookingToSubMerchantMapper.php @@ -0,0 +1,24 @@ +mapCrossBookingToSubMerchantFrom($booking, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/DisapprovalMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/DisapprovalMapper.php new file mode 100644 index 0000000..dd57ddd --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/DisapprovalMapper.php @@ -0,0 +1,28 @@ +paymentTransactionId)) { + $disapproval->setPaymentTransactionId($jsonObject->paymentTransactionId); + } + return $disapproval; + } + + public function mapDisapproval(Disapproval $disapproval) + { + return $this->mapDisapprovalFrom($disapproval, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/InstallmentHtmlMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/InstallmentHtmlMapper.php new file mode 100644 index 0000000..a3f648a --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/InstallmentHtmlMapper.php @@ -0,0 +1,28 @@ +htmlContent)) { + $installmentHtml->setHtmlContent($jsonObject->htmlContent); + } + return $installmentHtml; + } + + public function mapInstallmentHtml(InstallmentHtml $installmentHtml) + { + return $this->mapInstallmentHtmlFrom($installmentHtml, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/InstallmentInfoMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/InstallmentInfoMapper.php new file mode 100644 index 0000000..5c755d9 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/InstallmentInfoMapper.php @@ -0,0 +1,96 @@ +installmentDetails)) { + $installment->setInstallmentDetails($this->mapInstallmentDetails($jsonObject->installmentDetails)); + } + return $installment; + } + + public function mapInstallmentInfo(InstallmentInfo $installment) + { + return $this->mapInstallmentInfoFrom($installment, $this->jsonObject); + } + + private function mapInstallmentDetails($installmentDetails) + { + $details = array(); + + foreach ($installmentDetails as $index => $installmentDetail) { + $detail = new InstallmentDetail(); + + if (isset($installmentDetail->binNumber)) { + $detail->setBinNumber($installmentDetail->binNumber); + } + if (isset($installmentDetail->price)) { + $detail->setPrice($installmentDetail->price); + } + if (isset($installmentDetail->cardType)) { + $detail->setCardType($installmentDetail->cardType); + } + if (isset($installmentDetail->cardAssociation)) { + $detail->setCardAssociation($installmentDetail->cardAssociation); + } + if (isset($installmentDetail->cardFamilyName)) { + $detail->setCardFamilyName($installmentDetail->cardFamilyName); + } + if (isset($installmentDetail->force3ds)) { + $detail->setForce3ds($installmentDetail->force3ds); + } + if (isset($installmentDetail->bankCode)) { + $detail->setBankCode($installmentDetail->bankCode); + } + if (isset($installmentDetail->bankName)) { + $detail->setBankName($installmentDetail->bankName); + } + if (isset($installmentDetail->forceCvc)) { + $detail->setForceCvc($installmentDetail->forceCvc); + } + if (isset($installmentDetail->commercial)) { + $detail->setCommercial($installmentDetail->commercial); + } + if (isset($installmentDetail->installmentPrices)) { + $detail->setInstallmentPrices($this->mapInstallmentPrices($installmentDetail->installmentPrices)); + } + $details[$index] = $detail; + } + return $details; + } + + private function mapInstallmentPrices($installmentPrices) + { + $prices = array(); + + foreach ($installmentPrices as $index => $installmentPrice) { + $price = new InstallmentPrice(); + + if (isset($installmentPrice->installmentPrice)) { + $price->setInstallmentPrice($installmentPrice->installmentPrice); + } + if (isset($installmentPrice->totalPrice)) { + $price->setTotalPrice($installmentPrice->totalPrice); + } + if (isset($installmentPrice->installmentNumber)) { + $price->setInstallmentNumber($installmentPrice->installmentNumber); + } + $prices[$index] = $price; + } + return $prices; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/Iyzilink/IyziLinkDeleteProductMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/Iyzilink/IyziLinkDeleteProductMapper.php new file mode 100644 index 0000000..1bf9d68 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/Iyzilink/IyziLinkDeleteProductMapper.php @@ -0,0 +1,24 @@ +mapIyziLinkDeleteProductFrom($create, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/Iyzilink/IyziLinkDeleteProductResourceMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/Iyzilink/IyziLinkDeleteProductResourceMapper.php new file mode 100644 index 0000000..2ee5e17 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/Iyzilink/IyziLinkDeleteProductResourceMapper.php @@ -0,0 +1,26 @@ +mapIyziLinkDeleteProductResourceFrom($create, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/Iyzilink/IyziLinkRetrieveAllProductMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/Iyzilink/IyziLinkRetrieveAllProductMapper.php new file mode 100644 index 0000000..1b4097b --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/Iyzilink/IyziLinkRetrieveAllProductMapper.php @@ -0,0 +1,25 @@ +mapIyziLinkRetriveAllProductFrom($create, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/Iyzilink/IyziLinkRetrieveAllProductResourceMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/Iyzilink/IyziLinkRetrieveAllProductResourceMapper.php new file mode 100644 index 0000000..62ab203 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/Iyzilink/IyziLinkRetrieveAllProductResourceMapper.php @@ -0,0 +1,37 @@ +data->listingReviewed)) { + $create->setListingReviewed($jsonObject->data->listingReviewed); + } + if (isset($jsonObject->data->totalCount)) { + $create->setTotalCount($jsonObject->data->totalCount); + } + if (isset($jsonObject->data->currentPage)) { + $create->setCurrentPage($jsonObject->data->currentPage); + } + if (isset($jsonObject->data->pageCount)) { + $create->setPageCount($jsonObject->data->pageCount); + } + if (isset($jsonObject->data->items)) { + $create->setItems($jsonObject->data->items); + } + + return $create; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/Iyzilink/IyziLinkRetrieveProductMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/Iyzilink/IyziLinkRetrieveProductMapper.php new file mode 100644 index 0000000..ecc8e82 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/Iyzilink/IyziLinkRetrieveProductMapper.php @@ -0,0 +1,29 @@ +data)) { + $create->setItem($jsonObject->data); + } + + return $create; + } + + public function mapIyziLinkRetriveProduct(IyziLinkRetrieveProduct $create) + { + return $this->mapIyziLinkRetriveProductFrom($create, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/Iyzilink/IyziLinkRetrieveProductResourceMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/Iyzilink/IyziLinkRetrieveProductResourceMapper.php new file mode 100644 index 0000000..d555bf2 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/Iyzilink/IyziLinkRetrieveProductResourceMapper.php @@ -0,0 +1,24 @@ +data)) { + $create->setItem($jsonObject->data); + } + return $create; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/Iyzilink/IyziLinkSaveProductMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/Iyzilink/IyziLinkSaveProductMapper.php new file mode 100644 index 0000000..276bd9a --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/Iyzilink/IyziLinkSaveProductMapper.php @@ -0,0 +1,25 @@ +mapIyziLinkSaveProductFrom($create, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/Iyzilink/IyziLinkSaveProductResourceMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/Iyzilink/IyziLinkSaveProductResourceMapper.php new file mode 100644 index 0000000..b2d4907 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/Iyzilink/IyziLinkSaveProductResourceMapper.php @@ -0,0 +1,31 @@ +data->token)) { + $create->setToken($jsonObject->data->token); + } + if (isset($jsonObject->data->url)) { + $create->setUrl($jsonObject->data->url); + } + if (isset($jsonObject->data->imageUrl)) { + $create->setImageUrl($jsonObject->data->imageUrl); + } + + return $create; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/IyzipayResourceMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/IyzipayResourceMapper.php new file mode 100644 index 0000000..9cdb02e --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/IyzipayResourceMapper.php @@ -0,0 +1,62 @@ +rawResult = $rawResult; + } + + public static function create($rawResult = null) + { + return new IyzipayResourceMapper($rawResult); + } + + public function jsonDecode() + { + $this->jsonObject = JsonBuilder::jsonDecode($this->rawResult); + return $this; + } + + public function mapResourceFrom(IyzipayResource $resource, $jsonObject) + { + if (isset($jsonObject->status)) { + $resource->setStatus($jsonObject->status); + } + if (isset($jsonObject->conversationId)) { + $resource->setConversationId($jsonObject->conversationId); + } + if (isset($jsonObject->errorCode)) { + $resource->setErrorCode($jsonObject->errorCode); + } + if (isset($jsonObject->errorMessage)) { + $resource->setErrorMessage($jsonObject->errorMessage); + } + if (isset($jsonObject->errorGroup)) { + $resource->setErrorGroup($jsonObject->errorGroup); + } + if (isset($jsonObject->locale)) { + $resource->setLocale($jsonObject->locale); + } + if (isset($jsonObject->systemTime)) { + $resource->setSystemTime($jsonObject->systemTime); + } + if (isset($this->rawResult)) { + $resource->setRawResult($this->rawResult); + } + return $resource; + } + + public function mapResource(IyzipayResource $resource) + { + return $this->mapResourceFrom($resource, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/IyziupFormInitializeMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/IyziupFormInitializeMapper.php new file mode 100644 index 0000000..d1b3af6 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/IyziupFormInitializeMapper.php @@ -0,0 +1,24 @@ +mapIyziupFormInitializeFrom($initialize, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/IyziupFormInitializeResourceMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/IyziupFormInitializeResourceMapper.php new file mode 100644 index 0000000..5a03122 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/IyziupFormInitializeResourceMapper.php @@ -0,0 +1,34 @@ +token)) { + $initialize->setToken($jsonObject->token); + } + if (isset($jsonObject->content)) { + $initialize->setContent($jsonObject->content); + } + if (isset($jsonObject->tokenExpireTime)) { + $initialize->setTokenExpireTime($jsonObject->tokenExpireTime); + } + return $initialize; + } + + public function mapIyziupFormInitializeResource(IyziupFormInitializeResource $initialize) + { + return $this->mapIyziupFormInitializeResourceFrom($initialize, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/IyziupFormMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/IyziupFormMapper.php new file mode 100644 index 0000000..9d229da --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/IyziupFormMapper.php @@ -0,0 +1,54 @@ +orderResponseStatus)) { + $iyziupForm->setOrderResponseStatus($jsonObject->orderResponseStatus); + } + if (isset($jsonObject->token)) { + $iyziupForm->setToken($jsonObject->token); + } + if (isset($jsonObject->callbackUrl)) { + $iyziupForm->setCallbackUrl($jsonObject->callbackUrl); + } + + if (isset($jsonObject->consumer)) { + $iyziupForm->setConsumer(ConsumerMapper::create($jsonObject->consumer)->mapConsumerFrom(new Consumer(), $jsonObject->consumer)); + } + + if (isset($jsonObject->shippingAddress)) { + $iyziupForm->setShippingAddress(AddressMapper::create($jsonObject->shippingAddress)->mapAddressFrom(new Address(), $jsonObject->shippingAddress)); + } + + if (isset($jsonObject->billingAddress)) { + $iyziupForm->setBillingAddress(AddressMapper::create($jsonObject->billingAddress)->mapAddressFrom(new Address(), $jsonObject->billingAddress)); + } + + if (isset($jsonObject->paymentDetail)) { + $iyziupForm->setPaymentDetail(PaymentResourceMapper::create($jsonObject->paymentDetail)->mapPaymentResourceFrom(new PaymentResource(), $jsonObject->paymentDetail)); + } + + return $iyziupForm; + } + + public function mapIyziupForm(IyziupForm $iyziupForm) + { + return $this->mapIyziupFormFrom($iyziupForm, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/PayWithIyzicoInitializeMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/PayWithIyzicoInitializeMapper.php new file mode 100755 index 0000000..75a0b3b --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/PayWithIyzicoInitializeMapper.php @@ -0,0 +1,24 @@ +mapPayWithIyzicoInitializeFrom($initialize, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/PayWithIyzicoInitializeResourceMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/PayWithIyzicoInitializeResourceMapper.php new file mode 100755 index 0000000..bc02af4 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/PayWithIyzicoInitializeResourceMapper.php @@ -0,0 +1,37 @@ +token)) { + $initialize->setToken($jsonObject->token); + } + if (isset($jsonObject->payWithIyzicoContent)) { + $initialize->setPayWithIyzicoContent($jsonObject->payWithIyzicoContent); + } + if (isset($jsonObject->tokenExpireTime)) { + $initialize->setTokenExpireTime($jsonObject->tokenExpireTime); + } + if (isset($jsonObject->payWithIyzicoPageUrl)) { + $initialize->setPaymentPageUrl($jsonObject->payWithIyzicoPageUrl); + } + return $initialize; + } + + public function mapPayWithIyzicoInitializeResource(PayWithIyzicoInitializeResource $initialize) + { + return $this->mapPayWithIyzicoInitializeResourceFrom($initialize, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/PayWithIyzicoMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/PayWithIyzicoMapper.php new file mode 100755 index 0000000..009b09a --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/PayWithIyzicoMapper.php @@ -0,0 +1,31 @@ +token)) { + $auth->setToken($jsonObject->token); + } + if (isset($jsonObject->callbackUrl)) { + $auth->setCallbackUrl($jsonObject->callbackUrl); + } + return $auth; + } + + public function mapPayWithIyzico(PayWithIyzico $auth) + { + return $this->mapPayWithIyzicoFrom($auth, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/PaymentItemMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/PaymentItemMapper.php new file mode 100644 index 0000000..0a2a13b --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/PaymentItemMapper.php @@ -0,0 +1,120 @@ + $itemTransaction) { + $paymentItem = new PaymentItem(); + + if (isset($itemTransaction->itemId)) { + $paymentItem->setItemId($itemTransaction->itemId); + } + if (isset($itemTransaction->paymentTransactionId)) { + $paymentItem->setPaymentTransactionId($itemTransaction->paymentTransactionId); + } + if (isset($itemTransaction->transactionStatus)) { + $paymentItem->setTransactionStatus($itemTransaction->transactionStatus); + } + if (isset($itemTransaction->price)) { + $paymentItem->setPrice($itemTransaction->price); + } + if (isset($itemTransaction->paidPrice)) { + $paymentItem->setPaidPrice($itemTransaction->paidPrice); + } + if (isset($itemTransaction->merchantCommissionRate)) { + $paymentItem->setMerchantCommissionRate($itemTransaction->merchantCommissionRate); + } + if (isset($itemTransaction->merchantCommissionRateAmount)) { + $paymentItem->setMerchantCommissionRateAmount($itemTransaction->merchantCommissionRateAmount); + } + if (isset($itemTransaction->iyziCommissionRateAmount)) { + $paymentItem->setIyziCommissionRateAmount($itemTransaction->iyziCommissionRateAmount); + } + if (isset($itemTransaction->iyziCommissionFee)) { + $paymentItem->setIyziCommissionFee($itemTransaction->iyziCommissionFee); + } + if (isset($itemTransaction->blockageRate)) { + $paymentItem->setBlockageRate($itemTransaction->blockageRate); + } + if (isset($itemTransaction->blockageRateAmountMerchant)) { + $paymentItem->setBlockageRateAmountMerchant($itemTransaction->blockageRateAmountMerchant); + } + if (isset($itemTransaction->blockageRateAmountSubMerchant)) { + $paymentItem->setBlockageRateAmountSubMerchant($itemTransaction->blockageRateAmountSubMerchant); + } + if (isset($itemTransaction->blockageResolvedDate)) { + $paymentItem->setBlockageResolvedDate($itemTransaction->blockageResolvedDate); + } + if (isset($itemTransaction->subMerchantKey)) { + $paymentItem->setSubMerchantKey($itemTransaction->subMerchantKey); + } + if (isset($itemTransaction->subMerchantPrice)) { + $paymentItem->setSubMerchantPrice($itemTransaction->subMerchantPrice); + } + if (isset($itemTransaction->subMerchantPayoutRate)) { + $paymentItem->setSubMerchantPayoutRate($itemTransaction->subMerchantPayoutRate); + } + if (isset($itemTransaction->subMerchantPayoutAmount)) { + $paymentItem->setSubMerchantPayoutAmount($itemTransaction->subMerchantPayoutAmount); + } + if (isset($itemTransaction->merchantPayoutAmount)) { + $paymentItem->setMerchantPayoutAmount($itemTransaction->merchantPayoutAmount); + } + if (isset($itemTransaction->convertedPayout)) { + $paymentItem->setConvertedPayout($this->mapConvertedPayout($itemTransaction->convertedPayout)); + } + $paymentItems[$index] = $paymentItem; + } + return $paymentItems; + } + + private function mapConvertedPayout($payout) + { + $convertedPayout = new ConvertedPayout(); + + if (isset($payout->paidPrice)) { + $convertedPayout->setPaidPrice($payout->paidPrice); + } + if (isset($payout->iyziCommissionRateAmount)) { + $convertedPayout->setIyziCommissionRateAmount($payout->iyziCommissionRateAmount); + } + if (isset($payout->iyziCommissionFee)) { + $convertedPayout->setIyziCommissionFee($payout->iyziCommissionFee); + } + if (isset($payout->blockageRateAmountMerchant)) { + $convertedPayout->setBlockageRateAmountMerchant($payout->blockageRateAmountMerchant); + } + if (isset($payout->blockageRateAmountSubMerchant)) { + $convertedPayout->setBlockageRateAmountSubMerchant($payout->blockageRateAmountSubMerchant); + } + if (isset($payout->subMerchantPayoutAmount)) { + $convertedPayout->setSubMerchantPayoutAmount($payout->subMerchantPayoutAmount); + } + if (isset($payout->merchantPayoutAmount)) { + $convertedPayout->setMerchantPayoutAmount($payout->merchantPayoutAmount); + } + if (isset($payout->iyziConversionRate)) { + $convertedPayout->setIyziConversionRate($payout->iyziConversionRate); + } + if (isset($payout->iyziConversionRateAmount)) { + $convertedPayout->setIyziConversionRateAmount($payout->iyziConversionRateAmount); + } + if (isset($payout->currency)) { + $convertedPayout->setCurrency($payout->currency); + } + return $convertedPayout; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/PaymentMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/PaymentMapper.php new file mode 100644 index 0000000..9f201f9 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/PaymentMapper.php @@ -0,0 +1,24 @@ +mapPaymentFrom($payment, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/PaymentPostAuthMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/PaymentPostAuthMapper.php new file mode 100644 index 0000000..0f9701b --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/PaymentPostAuthMapper.php @@ -0,0 +1,24 @@ +mapPaymentPostAuthFrom($postAuth, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/PaymentPreAuthMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/PaymentPreAuthMapper.php new file mode 100644 index 0000000..c491edd --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/PaymentPreAuthMapper.php @@ -0,0 +1,24 @@ +mapPaymentPreAuthFrom($paymentPreAuth, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/PaymentResourceMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/PaymentResourceMapper.php new file mode 100644 index 0000000..2bb4809 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/PaymentResourceMapper.php @@ -0,0 +1,97 @@ +price)) { + $paymentResource->setPrice($jsonObject->price); + } + if (isset($jsonObject->paidPrice)) { + $paymentResource->setPaidPrice($jsonObject->paidPrice); + } + if (isset($jsonObject->installment)) { + $paymentResource->setInstallment($jsonObject->installment); + } + if (isset($jsonObject->paymentId)) { + $paymentResource->setPaymentId($jsonObject->paymentId); + } + if (isset($jsonObject->paymentStatus)) { + $paymentResource->setPaymentStatus($jsonObject->paymentStatus); + } + if (isset($jsonObject->fraudStatus)) { + $paymentResource->setFraudStatus($jsonObject->fraudStatus); + } + if (isset($jsonObject->merchantCommissionRate)) { + $paymentResource->setMerchantCommissionRate($jsonObject->merchantCommissionRate); + } + if (isset($jsonObject->merchantCommissionRateAmount)) { + $paymentResource->setMerchantCommissionRateAmount($jsonObject->merchantCommissionRateAmount); + } + if (isset($jsonObject->iyziCommissionRateAmount)) { + $paymentResource->setIyziCommissionRateAmount($jsonObject->iyziCommissionRateAmount); + } + if (isset($jsonObject->iyziCommissionFee)) { + $paymentResource->setIyziCommissionFee($jsonObject->iyziCommissionFee); + } + if (isset($jsonObject->cardType)) { + $paymentResource->setCardType($jsonObject->cardType); + } + if (isset($jsonObject->cardAssociation)) { + $paymentResource->setCardAssociation($jsonObject->cardAssociation); + } + if (isset($jsonObject->cardFamily)) { + $paymentResource->setCardFamily($jsonObject->cardFamily); + } + if (isset($jsonObject->cardUserKey)) { + $paymentResource->setCardUserKey($jsonObject->cardUserKey); + } + if (isset($jsonObject->cardToken)) { + $paymentResource->setCardToken($jsonObject->cardToken); + } + if (isset($jsonObject->binNumber)) { + $paymentResource->setBinNumber($jsonObject->binNumber); + } + if (isset($jsonObject->basketId)) { + $paymentResource->setBasketId($jsonObject->basketId); + } + if (isset($jsonObject->currency)) { + $paymentResource->setCurrency($jsonObject->currency); + } + if (isset($jsonObject->itemTransactions)) { + $paymentResource->setPaymentItems(PaymentItemMapper::create()->mapPaymentItems($jsonObject->itemTransactions)); + } + if (isset($jsonObject->connectorName)) { + $paymentResource->setConnectorName($jsonObject->connectorName); + } + if (isset($jsonObject->authCode)) { + $paymentResource->setAuthCode($jsonObject->authCode); + } + if (isset($jsonObject->phase)) { + $paymentResource->setPhase($jsonObject->phase); + } + if (isset($jsonObject->lastFourDigits)) { + $paymentResource->setLastFourDigits($jsonObject->lastFourDigits); + } + if (isset($jsonObject->posOrderId)) { + $paymentResource->setPosOrderId($jsonObject->posOrderId); + } + return $paymentResource; + } + + public function mapPaymentResource(PaymentResource $paymentResource) + { + return $this->mapPaymentResourceFrom($paymentResource, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/PayoutCompletedTransactionListMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/PayoutCompletedTransactionListMapper.php new file mode 100644 index 0000000..8d3d48f --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/PayoutCompletedTransactionListMapper.php @@ -0,0 +1,56 @@ +payoutCompletedTransactions)) { + $transactionList->setPayoutCompletedTransactions($this->mapPayoutCompletedTransactions($jsonObject->payoutCompletedTransactions)); + } + return $transactionList; + } + + public function mapPayoutCompletedTransactionList(PayoutCompletedTransactionList $transactionList) + { + return $this->mapPayoutCompletedTransactionListFrom($transactionList, $this->jsonObject); + } + + private function mapPayoutCompletedTransactions($payoutCompletedTransactions) + { + $transactions = array(); + + foreach ($payoutCompletedTransactions as $index => $payoutCompletedTransaction) { + $transaction = new PayoutCompletedTransaction(); + + if (isset($payoutCompletedTransaction->paymentTransactionId)) { + $transaction->setPaymentTransactionId($payoutCompletedTransaction->paymentTransactionId); + } + if (isset($payoutCompletedTransaction->payoutAmount)) { + $transaction->setPayoutAmount($payoutCompletedTransaction->payoutAmount); + } + if (isset($payoutCompletedTransaction->payoutType)) { + $transaction->setPayoutType($payoutCompletedTransaction->payoutType); + } + if (isset($payoutCompletedTransaction->subMerchantKey)) { + $transaction->setSubMerchantKey($payoutCompletedTransaction->subMerchantKey); + } + if (isset($payoutCompletedTransaction->currency)) { + $transaction->setCurrency($payoutCompletedTransaction->currency); + } + $transactions[$index] = $transaction; + } + return $transactions; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/PeccoInitializeMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/PeccoInitializeMapper.php new file mode 100644 index 0000000..4bdbfa6 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/PeccoInitializeMapper.php @@ -0,0 +1,37 @@ +token)) { + $peccoInitialize->setToken($jsonObject->token); + } + if (isset($jsonObject->htmlContent)) { + $peccoInitialize->setHtmlContent($jsonObject->htmlContent); + } + if (isset($jsonObject->tokenExpireTime)) { + $peccoInitialize->setTokenExpireTime($jsonObject->tokenExpireTime); + } + if (isset($jsonObject->redirectUrl)) { + $peccoInitialize->setRedirectUrl($jsonObject->redirectUrl); + } + return $peccoInitialize; + } + + public function mapPeccoInitialize(PeccoInitialize $peccoInitialize) + { + return $this->mapPeccoInitializeFrom($peccoInitialize, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/PeccoPaymentMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/PeccoPaymentMapper.php new file mode 100644 index 0000000..ebc9ff6 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/PeccoPaymentMapper.php @@ -0,0 +1,28 @@ +token)) { + $payment->setToken($jsonObject->token); + } + return $payment; + } + + public function mapPeccoPayment(PeccoPayment $auth) + { + return $this->mapPeccoPaymentFrom($auth, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/ProtectedOverleyScriptMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/ProtectedOverleyScriptMapper.php new file mode 100644 index 0000000..3950ef7 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/ProtectedOverleyScriptMapper.php @@ -0,0 +1,31 @@ +protectedShopId)) { + $protectedOverleyScript->setProtectedShopId($jsonObject->protectedShopId); + } + if (isset($jsonObject->overlayScript)) { + $protectedOverleyScript->setOverlayScript($jsonObject->overlayScript); + } + return $protectedOverleyScript; + } + + public function mapProtectedOverleyScript(ProtectedOverleyScript $protectedOverleyScript) + { + return $this->mapProtectedOverleyScriptFrom($protectedOverleyScript, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/RefundChargedFromMerchantMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/RefundChargedFromMerchantMapper.php new file mode 100644 index 0000000..414c585 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/RefundChargedFromMerchantMapper.php @@ -0,0 +1,24 @@ +mapRefundChargedFromMerchantFrom($refund, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/RefundMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/RefundMapper.php new file mode 100644 index 0000000..1e4b1d0 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/RefundMapper.php @@ -0,0 +1,24 @@ +mapRefundFrom($refund, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/RefundResourceMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/RefundResourceMapper.php new file mode 100644 index 0000000..805f1db --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/RefundResourceMapper.php @@ -0,0 +1,43 @@ +paymentId)) { + $refundResource->setPaymentId($jsonObject->paymentId); + } + if (isset($jsonObject->paymentTransactionId)) { + $refundResource->setPaymentTransactionId($jsonObject->paymentTransactionId); + } + if (isset($jsonObject->price)) { + $refundResource->setPrice($jsonObject->price); + } + if (isset($jsonObject->currency)) { + $refundResource->setCurrency($jsonObject->currency); + } + if (isset($jsonObject->connectorName)) { + $refundResource->setConnectorName($jsonObject->connectorName); + } + if (isset($jsonObject->authCode)) { + $refundResource->setAuthCode($jsonObject->authCode); + } + return $refundResource; + } + + public function mapRefundResource(RefundResource $refundResource) + { + return $this->mapRefundResourceFrom($refundResource, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/RefundToBalanceMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/RefundToBalanceMapper.php new file mode 100644 index 0000000..56be489 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/RefundToBalanceMapper.php @@ -0,0 +1,25 @@ +mapRefundToBalanceFrom($refundToBalance, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/RefundToBalanceResourceMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/RefundToBalanceResourceMapper.php new file mode 100644 index 0000000..0c4d7c0 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/RefundToBalanceResourceMapper.php @@ -0,0 +1,32 @@ +token)) { + $refundToBalanceResource->setToken($jsonObject->token); + } + if (isset($jsonObject->url)) { + $refundToBalanceResource->setUrl($jsonObject->url); + } + + return $refundToBalanceResource; + } + + public function mapRefundToBalanceResource(RefundToBalanceResource $refundToBalanceResource) + { + return $this->mapRefundToBalanceResourceFrom($refundToBalanceResource, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/ReportingPaymentDetailMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/ReportingPaymentDetailMapper.php new file mode 100644 index 0000000..729226b --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/ReportingPaymentDetailMapper.php @@ -0,0 +1,25 @@ +mapReportingPaymentDetailFrom($create, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/ReportingPaymentDetailResourceMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/ReportingPaymentDetailResourceMapper.php new file mode 100644 index 0000000..6f40e70 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/ReportingPaymentDetailResourceMapper.php @@ -0,0 +1,29 @@ +payments)) { + $create->setPayments($jsonObject->payments); + } + + return $create; + } + + public function mapReportingPaymentDetailResource(ReportingPaymentDetailResource $create) + { + return $this->mapReportingPaymentDetailResourceFrom($create, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/ReportingPaymentTransactionMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/ReportingPaymentTransactionMapper.php new file mode 100644 index 0000000..45d40fa --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/ReportingPaymentTransactionMapper.php @@ -0,0 +1,25 @@ +mapReportingPaymentTransactionFrom($create, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/ReportingPaymentTransactionResourceMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/ReportingPaymentTransactionResourceMapper.php new file mode 100644 index 0000000..28356de --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/ReportingPaymentTransactionResourceMapper.php @@ -0,0 +1,38 @@ +transactions)) { + + $create->setTransactions($jsonObject->transactions); + } + + if (isset($jsonObject->currentPage)) { + $create->setCurrentPage($jsonObject->currentPage); + } + + if (isset($jsonObject->totalPageCount)) { + $create->setTotalPageCount($jsonObject->totalPageCount); + } + + return $create; + } + + public function mapReportingPaymentTransactionResource(ReportingPaymentTransactionResource $create) + { + return $this->mapReportingPaymentTransactionResourceFrom($create, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/SettlementToBalanceMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/SettlementToBalanceMapper.php new file mode 100644 index 0000000..7467447 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/SettlementToBalanceMapper.php @@ -0,0 +1,25 @@ +mapSettlementToBalanceFrom($settlementToBalance, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/SettlementToBalanceResourceMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/SettlementToBalanceResourceMapper.php new file mode 100644 index 0000000..2a2e5a6 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/SettlementToBalanceResourceMapper.php @@ -0,0 +1,35 @@ +url)) { + $settlementToBalanceResource->setUrl($jsonObject->url); + } + if (isset($jsonObject->token)) { + $settlementToBalanceResource->setToken($jsonObject->token); + } + if (isset($jsonObject->settingsAllTime)) { + $settlementToBalanceResource->setSettingsAllTime($jsonObject->settingsAllTime); + } + + return $settlementToBalanceResource; + } + + public function mapSettlementToBalanceResource(SettlementToBalanceResource $settlementToBalanceResource) + { + return $this->mapSettlementToBalanceResourceFrom($settlementToBalanceResource, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/SubMerchantMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/SubMerchantMapper.php new file mode 100644 index 0000000..23cbe86 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/SubMerchantMapper.php @@ -0,0 +1,73 @@ +name)) { + $subMerchant->setName($jsonObject->name); + } + if (isset($jsonObject->email)) { + $subMerchant->setEmail($jsonObject->email); + } + if (isset($jsonObject->gsmNumber)) { + $subMerchant->setGsmNumber($jsonObject->gsmNumber); + } + if (isset($jsonObject->address)) { + $subMerchant->setAddress($jsonObject->address); + } + if (isset($jsonObject->iban)) { + $subMerchant->setIban($jsonObject->iban); + } + if (isset($jsonObject->taxOffice)) { + $subMerchant->setTaxOffice($jsonObject->taxOffice); + } + if (isset($jsonObject->contactName)) { + $subMerchant->setContactName($jsonObject->contactName); + } + if (isset($jsonObject->contactSurname)) { + $subMerchant->setContactSurname($jsonObject->contactSurname); + } + if (isset($jsonObject->legalCompanyTitle)) { + $subMerchant->setLegalCompanyTitle($jsonObject->legalCompanyTitle); + } + if (isset($jsonObject->subMerchantExternalId)) { + $subMerchant->setSubMerchantExternalId($jsonObject->subMerchantExternalId); + } + if (isset($jsonObject->identityNumber)) { + $subMerchant->setIdentityNumber($jsonObject->identityNumber); + } + if (isset($jsonObject->taxNumber)) { + $subMerchant->setTaxNumber($jsonObject->taxNumber); + } + if (isset($jsonObject->subMerchantType)) { + $subMerchant->setSubMerchantType($jsonObject->subMerchantType); + } + if (isset($jsonObject->subMerchantKey)) { + $subMerchant->setSubMerchantKey($jsonObject->subMerchantKey); + } + if (isset($jsonObject->swiftCode)) { + $subMerchant->setSwiftCode($jsonObject->swiftCode); + } + if (isset($jsonObject->currency)) { + $subMerchant->setCurrency($jsonObject->currency); + } + return $subMerchant; + } + + public function mapSubMerchant(SubMerchant $subMerchant) + { + return $this->mapSubMerchantFrom($subMerchant, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/SubMerchantPaymentItemMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/SubMerchantPaymentItemMapper.php new file mode 100644 index 0000000..f7a3d1f --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/SubMerchantPaymentItemMapper.php @@ -0,0 +1,25 @@ +mapSubMerchantPaymentItemFrom($create, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/SubMerchantPaymentItemResourceMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/SubMerchantPaymentItemResourceMapper.php new file mode 100644 index 0000000..44ff70f --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/SubMerchantPaymentItemResourceMapper.php @@ -0,0 +1,37 @@ +subMerchantKey)) { + $create->setSubMerchantKey($jsonObject->subMerchantKey); + } + + if (isset($jsonObject->paymentTransactionId)) { + $create->setPaymentTransactionId($jsonObject->paymentTransactionId); + } + + if (isset($jsonObject->subMerchantPrice)) { + $create->setSubMerchantPrice($jsonObject->subMerchantPrice); + } + + return $create; + } + + public function mapSubMerchantPaymentItemResource(SubMerchantPaymentItemUpdate $create) + { + return $this->mapSubMerchantPaymentItemResourceFrom($create, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/Subscription/RetrieveListMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/Subscription/RetrieveListMapper.php new file mode 100644 index 0000000..20a03aa --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/Subscription/RetrieveListMapper.php @@ -0,0 +1,25 @@ +mapRetrieveListFrom($create, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/Subscription/RetrieveListResourceMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/Subscription/RetrieveListResourceMapper.php new file mode 100644 index 0000000..7449fd6 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/Subscription/RetrieveListResourceMapper.php @@ -0,0 +1,40 @@ +data->totalCount)) { + $create->setTotalCount($jsonObject->data->totalCount); + } + if (isset($jsonObject->data->currentPage)) { + $create->setCurrentPage($jsonObject->data->currentPage); + } + if (isset($jsonObject->data->pageCount)) { + $create->setPageCount($jsonObject->data->pageCount); + } + if (isset($jsonObject->data->items)) { + $create->setItems($jsonObject->data->items); + } + + return $create; + } + + public function mapRetrieveList(RetrieveList $retrieveList) + { + return $this->mapRetrieveListResourceFrom($retrieveList, $this->jsonObject); + } + +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/Subscription/RetrieveSubscriptionCheckoutFormMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/Subscription/RetrieveSubscriptionCheckoutFormMapper.php new file mode 100644 index 0000000..520b927 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/Subscription/RetrieveSubscriptionCheckoutFormMapper.php @@ -0,0 +1,25 @@ +mapRetrieveSubscriptionCheckoutFormFrom($create, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/Subscription/RetrieveSubscriptionCheckoutFormResourceMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/Subscription/RetrieveSubscriptionCheckoutFormResourceMapper.php new file mode 100644 index 0000000..dc73cd2 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/Subscription/RetrieveSubscriptionCheckoutFormResourceMapper.php @@ -0,0 +1,60 @@ +data->referenceCode)) { + $create->setReferenceCode($jsonObject->data->referenceCode); + } + if (isset($jsonObject->data->parentReferenceCode)){ + $create->setParentReferenceCode($jsonObject->data->parentReferenceCode); + } + if(isset($jsonObject->data->pricingPlanReferenceCode)){ + $create->setPricingPlanReferenceCode($jsonObject->data->pricingPlanReferenceCode); + } + if(isset($jsonObject->data->customerReferenceCode)){ + $create->setCustomerReferenceCode($jsonObject->data->customerReferenceCode); + } + if(isset($jsonObject->data->subscriptionStatus)){ + $create->setSubscriptionStatus($jsonObject->data->subscriptionStatus); + } + if(isset($jsonObject->data->trialDays)){ + $create->setTrialDays($jsonObject->data->trialDays); + } + if(isset($jsonObject->data->trialStartDate)){ + $create->setTrialStartDate($jsonObject->data->trialStartDate); + } + if(isset($jsonObject->data->trialEndDate)){ + $create->setTrialEndDate($jsonObject->data->trialEndDate); + } + if(isset($jsonObject->data->createdDate)){ + $create->setCreatedDate($jsonObject->data->createdDate); + } + if(isset($jsonObject->data->startDate)){ + $create->setStartDate($jsonObject->data->startDate); + } + if(isset($jsonObject->data->endDate)){ + $create->setEndDate($jsonObject->data->endDate); + } + + return $create; + } + + public function mapRetrieveSubscriptionCheckoutForm(RetrieveSubscriptionCheckoutForm $retrieveCheckoutForm) + { + return $this->mapRetrieveSubscriptionCheckoutFormResourceFrom($retrieveCheckoutForm, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/Subscription/SubscriptionActionMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/Subscription/SubscriptionActionMapper.php new file mode 100644 index 0000000..8277249 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/Subscription/SubscriptionActionMapper.php @@ -0,0 +1,23 @@ +mapSubscriptionActionFrom($create, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/Subscription/SubscriptionActionResourceMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/Subscription/SubscriptionActionResourceMapper.php new file mode 100644 index 0000000..5ea4889 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/Subscription/SubscriptionActionResourceMapper.php @@ -0,0 +1,23 @@ +mapSubscriptionActionResourceFrom($create, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/Subscription/SubscriptionCardUpdateMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/Subscription/SubscriptionCardUpdateMapper.php new file mode 100644 index 0000000..3a8cfd5 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/Subscription/SubscriptionCardUpdateMapper.php @@ -0,0 +1,25 @@ +mapSubscriptionCardUpdateFrom($create, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/Subscription/SubscriptionCardUpdateResourceMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/Subscription/SubscriptionCardUpdateResourceMapper.php new file mode 100644 index 0000000..4242df8 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/Subscription/SubscriptionCardUpdateResourceMapper.php @@ -0,0 +1,36 @@ +token)) { + $create->setToken($jsonObject->token); + } + if (isset($jsonObject->checkoutFormContent)) { + $create->setCheckoutFormContent($jsonObject->checkoutFormContent); + } + if (isset($jsonObject->tokenExpireTime)) { + $create->setTokenExpireTime($jsonObject->tokenExpireTime); + } + + return $create; + } + + public function mapSubscriptionCardUpdate(SubscriptionCardUpdate $subscriptionCardUpdate) + { + return $this->mapSubscriptionCardUpdateResourceFrom($subscriptionCardUpdate, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/Subscription/SubscriptionCreateCheckoutFormMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/Subscription/SubscriptionCreateCheckoutFormMapper.php new file mode 100644 index 0000000..ce64ff5 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/Subscription/SubscriptionCreateCheckoutFormMapper.php @@ -0,0 +1,25 @@ +mapSubscriptionCreateCheckoutFormFrom($create, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/Subscription/SubscriptionCreateCheckoutFormResourceMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/Subscription/SubscriptionCreateCheckoutFormResourceMapper.php new file mode 100644 index 0000000..046b550 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/Subscription/SubscriptionCreateCheckoutFormResourceMapper.php @@ -0,0 +1,36 @@ +token)) { + $create->setToken($jsonObject->token); + } + if (isset($jsonObject->checkoutFormContent)) { + $create->setCheckoutFormContent($jsonObject->checkoutFormContent); + } + if (isset($jsonObject->tokenExpireTime)) { + $create->setTokenExpireTime($jsonObject->tokenExpireTime); + } + + return $create; + } + + public function mapSubscriptionCreateCheckoutForm(SubscriptionCreateCheckoutForm $subscriptionCreateCheckoutForm) + { + return $this->mapSubscriptionCreateCheckoutFormResourceFrom($subscriptionCreateCheckoutForm, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/Subscription/SubscriptionCreateMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/Subscription/SubscriptionCreateMapper.php new file mode 100644 index 0000000..7f21ef1 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/Subscription/SubscriptionCreateMapper.php @@ -0,0 +1,25 @@ +mapSubscriptionCreateFrom($create, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/Subscription/SubscriptionCreateResourceMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/Subscription/SubscriptionCreateResourceMapper.php new file mode 100644 index 0000000..bf2ebc9 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/Subscription/SubscriptionCreateResourceMapper.php @@ -0,0 +1,60 @@ +data->referenceCode)) { + $create->setReferenceCode($jsonObject->data->referenceCode); + } + if (isset($jsonObject->data->parentReferenceCode)){ + $create->setParentReferenceCode($jsonObject->data->parentReferenceCode); + } + if(isset($jsonObject->data->pricingPlanReferenceCode)){ + $create->setPricingPlanReferenceCode($jsonObject->data->pricingPlanReferenceCode); + } + if(isset($jsonObject->data->customerReferenceCode)){ + $create->setCustomerReferenceCode($jsonObject->data->customerReferenceCode); + } + if(isset($jsonObject->data->subscriptionStatus)){ + $create->setSubscriptionStatus($jsonObject->data->subscriptionStatus); + } + if(isset($jsonObject->data->trialDays)){ + $create->setTrialDays($jsonObject->data->trialDays); + } + if(isset($jsonObject->data->trialStartDate)){ + $create->setTrialStartDate($jsonObject->data->trialStartDate); + } + if(isset($jsonObject->data->trialEndDate)){ + $create->setTrialEndDate($jsonObject->data->trialEndDate); + } + if(isset($jsonObject->data->createdDate)){ + $create->setCreatedDate($jsonObject->data->createdDate); + } + if(isset($jsonObject->data->startDate)){ + $create->setStartDate($jsonObject->data->startDate); + } + if(isset($jsonObject->data->endDate)){ + $create->setEndDate($jsonObject->data->endDate); + } + + return $create; + } + + public function mapSubscriptionCreate($subscriptionCreate) + { + return $this->mapSubscriptionCreateResourceFrom($subscriptionCreate, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/Subscription/SubscriptionCustomerMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/Subscription/SubscriptionCustomerMapper.php new file mode 100644 index 0000000..6eeb45f --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/Subscription/SubscriptionCustomerMapper.php @@ -0,0 +1,25 @@ +mapSubscriptionCustomerFrom($create, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/Subscription/SubscriptionCustomerResourceMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/Subscription/SubscriptionCustomerResourceMapper.php new file mode 100644 index 0000000..cfe95e3 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/Subscription/SubscriptionCustomerResourceMapper.php @@ -0,0 +1,95 @@ +data->referenceCode)) { + $create->setReferenceCode($jsonObject->data->referenceCode); + } + if (isset($jsonObject->data->status)) { + $create->setCustomerStatus($jsonObject->data->status); + } + if (isset($jsonObject->data->name)) { + $create->setName($jsonObject->data->name); + } + if (isset($jsonObject->data->surname)) { + $create->setSurname($jsonObject->data->surname); + } + if (isset($jsonObject->data->identityNumber)) { + $create->setIdentityNumber($jsonObject->data->identityNumber); + } + if (isset($jsonObject->data->email)) { + $create->setEmail($jsonObject->data->email); + } + if (isset($jsonObject->data->gsmNumber)) { + $create->setGsmNumber($jsonObject->data->gsmNumber); + } + if (isset($jsonObject->data->contactEmail)) { + $create->setContactEmail($jsonObject->data->contactEmail); + } + if (isset($jsonObject->data->contactGsmNumber)) { + $create->setContactGsmNumber($jsonObject->data->contactGsmNumber); + } + if (isset($jsonObject->data->billingAddress->contactName)) { + $create->setBillingContactName($jsonObject->data->billingAddress->contactName); + } + if (isset($jsonObject->data->billingAddress->city)) { + $create->setBillingCity($jsonObject->data->billingAddress->city); + } + if (isset($jsonObject->data->billingAddress->district)) { + $create->setBillingDistrict($jsonObject->data->billingAddress->district); + } + if (isset($jsonObject->data->billingAddress->country)) { + $create->setBillingCountry($jsonObject->data->billingAddress->country); + } + if (isset($jsonObject->data->billingAddress->address)) { + $create->setBillingAddress($jsonObject->data->billingAddress->address); + } + if (isset($jsonObject->data->billingAddress->zipCode)) { + $create->setBillingZipCode($jsonObject->data->billingAddress->zipCode); + } + + if (isset($jsonObject->data->shippingAddress->contactName)) { + $create->setShippingContactName($jsonObject->data->shippingAddress->contactName); + } + if (isset($jsonObject->data->shippingAddress->city)) { + $create->setShippingCity($jsonObject->data->shippingAddress->city); + } + if (isset($jsonObject->data->shippingAddress->district)) { + $create->setShippingDistrict($jsonObject->data->shippingAddress->district); + } + if (isset($jsonObject->data->shippingAddress->country)) { + $create->setShippingCountry($jsonObject->data->shippingAddress->country); + } + if (isset($jsonObject->data->shippingAddress->address)) { + $create->setShippingAddress($jsonObject->data->shippingAddress->address); + } + if (isset($jsonObject->data->shippingAddress->zipCode)) { + $create->setShippingZipCode($jsonObject->data->shippingAddress->zipCode); + } + + if (isset($jsonObject->data->createdDate)) { + $create->setCreatedDate($jsonObject->data->createdDate); + } + return $create; + } + + public function mapSubscriptionCustomer(SubscriptionCustomer $subscriptionCustomer) + { + return $this->mapSubscriptionCustomerResourceFrom($subscriptionCustomer, $this->jsonObject); + } + +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/Subscription/SubscriptionDetailsMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/Subscription/SubscriptionDetailsMapper.php new file mode 100644 index 0000000..ee86694 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/Subscription/SubscriptionDetailsMapper.php @@ -0,0 +1,25 @@ +mapSubscriptionDetailsFrom($create, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/Subscription/SubscriptionDetailsResourceMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/Subscription/SubscriptionDetailsResourceMapper.php new file mode 100644 index 0000000..c8d5cf0 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/Subscription/SubscriptionDetailsResourceMapper.php @@ -0,0 +1,74 @@ +data->referenceCode)) { + $create->setReferenceCode($jsonObject->data->referenceCode); + } + if (isset($jsonObject->data->parentReferenceCode)){ + $create->setParentReferenceCode($jsonObject->data->parentReferenceCode); + } + if(isset($jsonObject->data->pricingPlanReferenceCode)){ + $create->setPricingPlanReferenceCode($jsonObject->data->pricingPlanReferenceCode); + } + if(isset($jsonObject->data->customerReferenceCode)){ + $create->setCustomerReferenceCode($jsonObject->data->customerReferenceCode); + } + if(isset($jsonObject->data->subscriptionStatus)){ + $create->setSubscriptionStatus($jsonObject->data->subscriptionStatus); + } + if(isset($jsonObject->data->trialDays)){ + $create->setTrialDays($jsonObject->data->trialDays); + } + if(isset($jsonObject->data->trialStartDate)){ + $create->setTrialStartDate($jsonObject->data->trialStartDate); + } + if(isset($jsonObject->data->trialEndDate)){ + $create->setTrialEndDate($jsonObject->data->trialEndDate); + } + if(isset($jsonObject->data->createdDate)){ + $create->setCreatedDate($jsonObject->data->createdDate); + } + if(isset($jsonObject->data->startDate)){ + $create->setStartDate($jsonObject->data->startDate); + } + if(isset($jsonObject->data->endDate)){ + $create->setEndDate($jsonObject->data->endDate); + } + if(isset($jsonObject->data->orders)){ + $create->setOrders($jsonObject->data->orders); + } + if(isset($jsonObject->data->customerEmail)){ + $create->setCustomerEmail($jsonObject->data->customerEmail); + } + if(isset($jsonObject->data->pricingPlanName)){ + $create->setPricingPlanName($jsonObject->data->pricingPlanName); + } + if(isset($jsonObject->data->productName)){ + $create->setProductName($jsonObject->data->productName); + } + if(isset($jsonObject->data->productReferenceCode)){ + $create->setProductReferenceCode($jsonObject->data->productReferenceCode); + } + return $create; + } + + public function mapSubscriptionDetails(SubscriptionDetails $subscriptionDetails) + { + return $this->mapSubscriptionDetailsResourceFrom($subscriptionDetails, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/Subscription/SubscriptionPricingPlanMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/Subscription/SubscriptionPricingPlanMapper.php new file mode 100644 index 0000000..a1f7141 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/Subscription/SubscriptionPricingPlanMapper.php @@ -0,0 +1,25 @@ +mapSubscriptionPricingPlanFrom($create, $this->jsonObject); + } +} diff --git a/iyzipay/src/Iyzipay/Model/Mapper/Subscription/SubscriptionPricingPlanResourceMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/Subscription/SubscriptionPricingPlanResourceMapper.php new file mode 100644 index 0000000..8d85387 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/Subscription/SubscriptionPricingPlanResourceMapper.php @@ -0,0 +1,63 @@ +data->status)) { + $create->setPricingPlanStatus($jsonObject->data->status); + } + if (isset($jsonObject->data->name)) { + $create->setName($jsonObject->data->name); + } + if (isset($jsonObject->data->productReferenceCode)) { + $create->setProductReferenceCode($jsonObject->data->productReferenceCode); + } + if (isset($jsonObject->data->price)) { + $create->setPrice($jsonObject->data->price); + } + if (isset($jsonObject->data->currencyCode)) { + $create->setCurrencyCode($jsonObject->data->currencyCode); + } + if (isset($jsonObject->data->paymentInterval)) { + $create->setPaymentInterval($jsonObject->data->paymentInterval); + } + if (isset($jsonObject->data->paymentIntervalCount)) { + $create->setPaymentIntervalCount($jsonObject->data->paymentIntervalCount); + } + if (isset($jsonObject->data->trialPeriodDays)) { + $create->setTrialPeriodDays($jsonObject->data->trialPeriodDays); + } + if (isset($jsonObject->data->planPaymentType)) { + $create->setPlanPaymentType($jsonObject->data->planPaymentType); + } + if (isset($jsonObject->data->recurrenceCount)) { + $create->setRecurrenceCount($jsonObject->data->recurrenceCount); + } + if (isset($jsonObject->data->referenceCode)) { + $create->setReferenceCode($jsonObject->data->referenceCode); + } + if (isset($jsonObject->data->createdDate)) { + $create->setCreatedDate($jsonObject->data->createdDate); + } + return $create; + } + + public function mapSubscriptionPricingPlan(SubscriptionPricingPlan $subscriptionPricingPlan) + { + return $this->mapSubscriptionPricingPlanResourceFrom($subscriptionPricingPlan, $this->jsonObject); + } + +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/Subscription/SubscriptionProductMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/Subscription/SubscriptionProductMapper.php new file mode 100644 index 0000000..53cd05b --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/Subscription/SubscriptionProductMapper.php @@ -0,0 +1,25 @@ +mapSubscriptionProductFrom($create, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/Subscription/SubscriptionProductResourceMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/Subscription/SubscriptionProductResourceMapper.php new file mode 100644 index 0000000..f7394fd --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/Subscription/SubscriptionProductResourceMapper.php @@ -0,0 +1,51 @@ +status)) { + $create->setStatus($jsonObject->status); + } + if (isset($jsonObject->data->name)) { + $create->setName($jsonObject->data->name); + } + if (isset($jsonObject->data->description)) { + $create->setDescription($jsonObject->data->description); + } + if (isset($jsonObject->data->status)) { + $create->setProductStatus($jsonObject->data->status); + } + + if (isset($jsonObject->data->referenceCode)) { + $create->setReferenceCode($jsonObject->data->referenceCode); + } + + if (isset($jsonObject->data->pricingPlans)) { + $create->setPricingPlans($jsonObject->data->pricingPlans); + } + + if (isset($jsonObject->data->createdDate)) { + $create->setCreatedDate($jsonObject->data->createdDate); + } + return $create; + } + + public function mapSubscriptionProduct(SubscriptionProduct $subscriptionProduct) + { + return $this->mapSubscriptionProductResourceFrom($subscriptionProduct, $this->jsonObject); + } + +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/Subscription/SubscriptionUpgradeMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/Subscription/SubscriptionUpgradeMapper.php new file mode 100644 index 0000000..528fff3 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/Subscription/SubscriptionUpgradeMapper.php @@ -0,0 +1,25 @@ +mapSubscriptionUpgradeFrom($create, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/Subscription/SubscriptionUpgradeResourceMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/Subscription/SubscriptionUpgradeResourceMapper.php new file mode 100644 index 0000000..685d344 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/Subscription/SubscriptionUpgradeResourceMapper.php @@ -0,0 +1,60 @@ +data->referenceCode)) { + $create->setReferenceCode($jsonObject->data->referenceCode); + } + if (isset($jsonObject->data->parentReferenceCode)){ + $create->setParentReferenceCode($jsonObject->data->parentReferenceCode); + } + if(isset($jsonObject->data->pricingPlanReferenceCode)){ + $create->setPricingPlanReferenceCode($jsonObject->data->pricingPlanReferenceCode); + } + if(isset($jsonObject->data->customerReferenceCode)){ + $create->setCustomerReferenceCode($jsonObject->data->customerReferenceCode); + } + if(isset($jsonObject->data->subscriptionStatus)){ + $create->setSubscriptionStatus($jsonObject->data->subscriptionStatus); + } + if(isset($jsonObject->data->trialDays)){ + $create->setTrialDays($jsonObject->data->trialDays); + } + if(isset($jsonObject->data->trialStartDate)){ + $create->setTrialStartDate($jsonObject->data->trialStartDate); + } + if(isset($jsonObject->data->trialEndDate)){ + $create->setTrialEndDate($jsonObject->data->trialEndDate); + } + if(isset($jsonObject->data->createdDate)){ + $create->setCreatedDate($jsonObject->data->createdDate); + } + if(isset($jsonObject->data->startDate)){ + $create->setStartDate($jsonObject->data->startDate); + } + if(isset($jsonObject->data->endDate)){ + $create->setEndDate($jsonObject->data->endDate); + } + + return $create; + } + + public function mapSubscriptionUpgrade(SubscriptionUpgrade $subscriptionUpgrade) + { + return $this->mapSubscriptionUpgradeResourceFrom($subscriptionUpgrade, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/ThreedsInitializeMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/ThreedsInitializeMapper.php new file mode 100644 index 0000000..23fc045 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/ThreedsInitializeMapper.php @@ -0,0 +1,28 @@ +threeDSHtmlContent)) { + $initialize->setHtmlContent(base64_decode($jsonObject->threeDSHtmlContent)); + } + return $initialize; + } + + public function mapThreedsInitialize(ThreedsInitialize $initialize) + { + return $this->mapThreedsInitializeFrom($initialize, $this->jsonObject); + } +} diff --git a/iyzipay/src/Iyzipay/Model/Mapper/ThreedsInitializePreAuthMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/ThreedsInitializePreAuthMapper.php new file mode 100644 index 0000000..e979f28 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/ThreedsInitializePreAuthMapper.php @@ -0,0 +1,28 @@ +threeDSHtmlContent)) { + $initializePreAuth->setHtmlContent(base64_decode($jsonObject->threeDSHtmlContent)); + } + return $initializePreAuth; + } + + public function mapThreedsInitializePreAuth(ThreedsInitializePreAuth $initializePreAuth) + { + return $this->mapThreedsInitializePreAuthFrom($initializePreAuth, $this->jsonObject); + } +} diff --git a/iyzipay/src/Iyzipay/Model/Mapper/ThreedsPaymentMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/ThreedsPaymentMapper.php new file mode 100644 index 0000000..a7ecd6c --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/ThreedsPaymentMapper.php @@ -0,0 +1,24 @@ +mapThreedsPaymentFrom($auth, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/UCSInitializeMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/UCSInitializeMapper.php new file mode 100644 index 0000000..6ed5f20 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/UCSInitializeMapper.php @@ -0,0 +1,24 @@ +mapUCSInitializeFrom($initialize, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Mapper/UCSInitializeResourceMapper.php b/iyzipay/src/Iyzipay/Model/Mapper/UCSInitializeResourceMapper.php new file mode 100644 index 0000000..53c8e2d --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Mapper/UCSInitializeResourceMapper.php @@ -0,0 +1,49 @@ +ucsToken)) { + $initialize->setUcsToken($jsonObject->ucsToken); + } + if (isset($jsonObject->buyerProtectedConsumer)) { + $initialize->setBuyerProtectedConsumer($jsonObject->buyerProtectedConsumer); + } + if (isset($jsonObject->buyerProtectedMerchant)) { + $initialize->setBuyerProtectedMerchant($jsonObject->buyerProtectedMerchant); + } + if (isset($jsonObject->gsmNumber)) { + $initialize->setGsmNumber($jsonObject->gsmNumber); + } + if (isset($jsonObject->maskedGsmNumber)) { + $initialize->setMaskedGsmNumber($jsonObject->maskedGsmNumber); + } + if (isset($jsonObject->merchantName)) { + $initialize->setMerchantName($jsonObject->merchantName); + } + if (isset($jsonObject->script)) { + $initialize->setScript($jsonObject->script); + } + if (isset($jsonObject->scriptType)) { + $initialize->setScriptType($jsonObject->scriptType); + } + return $initialize; + } + + public function mapUCSInitializeResource(UCSInitializeResource $initialize) + { + return $this->mapUCSInitializeResourceFrom($initialize, $this->jsonObject); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/OrderItem.php b/iyzipay/src/Iyzipay/Model/OrderItem.php new file mode 100644 index 0000000..64fb50d --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/OrderItem.php @@ -0,0 +1,127 @@ +id; + } + + public function setId($id) + { + $this->id = $id; + } + + public function getPrice() + { + return $this->price; + } + + public function setPrice($price) + { + $this->price = $price; + } + + public function getName() + { + return $this->name; + } + + public function setName($name) + { + $this->name = $name; + } + + public function getCategory1() + { + return $this->category1; + } + + public function setCategory1($category1) + { + $this->category1 = $category1; + } + + public function getCategory2() + { + return $this->category2; + } + + public function setCategory2($category2) + { + $this->category2 = $category2; + } + + public function getItemType() + { + return $this->itemType; + } + + public function setItemType($itemType) + { + $this->itemType = $itemType; + } + + public function getItemUrl() + { + return $this->itemUrl; + } + + public function setItemUrl($itemUrl) + { + $this->itemUrl = $itemUrl; + } + + public function getItemDescription() + { + return $this->itemDescription; + } + + public function setItemDescription($itemDescription) + { + $this->itemDescription = $itemDescription; + } + + public function getJsonObject() + { + return JsonBuilder::create() + ->add("id", $this->getId()) + ->addPrice("price", $this->getPrice()) + ->add("name", $this->getName()) + ->add("category1", $this->getCategory1()) + ->add("category2", $this->getCategory2()) + ->add("itemType", $this->getItemType()) + ->add("itemUrl", $this->getItemUrl()) + ->add("itemDescription", $this->getItemDescription()) + ->getObject(); + } + + public function toPKIRequestString() + { + return RequestStringBuilder::create() + ->append("id", $this->getId()) + ->appendPrice("price", $this->getPrice()) + ->append("name", $this->getName()) + ->append("category1", $this->getCategory1()) + ->append("category2", $this->getCategory2()) + ->append("itemType", $this->getItemType()) + ->append("itemUrl", $this->getItemUrl()) + ->append("itemDescription", $this->getItemDescription()) + ->getRequestString(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/OrderItemType.php b/iyzipay/src/Iyzipay/Model/OrderItemType.php new file mode 100644 index 0000000..ae9fae3 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/OrderItemType.php @@ -0,0 +1,9 @@ +post($options->getBaseUrl() . "/payment/iyzipos/checkoutform/auth/ecom/detail", parent::getHttpHeaders($request, $options), $request->toJsonString()); + + return PayWithIyzicoMapper::create($rawResult)->jsonDecode()->mapPayWithIyzico(new PayWithIyzico()); + } + + public function getToken() + { + return $this->token; + } + + public function setToken($token) + { + $this->token = $token; + } + + public function getCallbackUrl() + { + return $this->callbackUrl; + } + + public function setCallbackUrl($callbackUrl) + { + $this->callbackUrl = $callbackUrl; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/PayWithIyzicoInitialize.php b/iyzipay/src/Iyzipay/Model/PayWithIyzicoInitialize.php new file mode 100755 index 0000000..bc4e145 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/PayWithIyzicoInitialize.php @@ -0,0 +1,18 @@ +post($options->getBaseUrl() . "/payment/pay-with-iyzico/initialize", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return PayWithIyzicoInitializeMapper::create($rawResult)->jsonDecode()->mapPayWithIyzicoInitialize(new PayWithIyzicoInitialize()); + + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/PayWithIyzicoInitializeResource.php b/iyzipay/src/Iyzipay/Model/PayWithIyzicoInitializeResource.php new file mode 100755 index 0000000..e551e45 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/PayWithIyzicoInitializeResource.php @@ -0,0 +1,53 @@ +token; + } + + public function setToken($token) + { + $this->token = $token; + } + + public function getPayWithIyzicoContent() + { + return $this->payWithIyzicoContent; + } + + public function setPayWithIyzicoContent($payWithIyzicoContent) + { + $this->payWithIyzicoContent = $payWithIyzicoContent; + } + + public function getTokenExpireTime() + { + return $this->tokenExpireTime; + } + + public function setTokenExpireTime($tokenExpireTime) + { + $this->tokenExpireTime = $tokenExpireTime; + } + + public function getPayWithIyzicoPageUrl() + { + return $this->payWithIyzicoPageUrl; + } + + public function setPaymentPageUrl($payWithIyzicoPageUrl) + { + $this->payWithIyzicoPageUrl = $payWithIyzicoPageUrl; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Payment.php b/iyzipay/src/Iyzipay/Model/Payment.php new file mode 100644 index 0000000..d2c855e --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Payment.php @@ -0,0 +1,23 @@ +post($options->getBaseUrl() . "/payment/auth", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return PaymentMapper::create($rawResult)->jsonDecode()->mapPayment(new Payment()); + } + + public static function retrieve(RetrievePaymentRequest $request, Options $options) + { + $rawResult = parent::httpClient()->post($options->getBaseUrl() . "/payment/detail", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return PaymentMapper::create($rawResult)->jsonDecode()->mapPayment(new Payment()); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/PaymentCard.php b/iyzipay/src/Iyzipay/Model/PaymentCard.php new file mode 100644 index 0000000..ab9d6e8 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/PaymentCard.php @@ -0,0 +1,179 @@ +cardHolderName; + } + + public function setCardHolderName($cardHolderName) + { + $this->cardHolderName = $cardHolderName; + } + + public function getCardNumber() + { + return $this->cardNumber; + } + + public function setCardNumber($cardNumber) + { + $this->cardNumber = $cardNumber; + } + + public function getExpireYear() + { + return $this->expireYear; + } + + public function setExpireYear($expireYear) + { + $this->expireYear = $expireYear; + } + + public function getExpireMonth() + { + return $this->expireMonth; + } + + public function setExpireMonth($expireMonth) + { + $this->expireMonth = $expireMonth; + } + + public function getCvc() + { + return $this->cvc; + } + + public function setCvc($cvc) + { + $this->cvc = $cvc; + } + + public function getRegisterCard() + { + return $this->registerCard; + } + + public function setRegisterCard($registerCard) + { + $this->registerCard = $registerCard; + } + + public function getCardAlias() + { + return $this->cardAlias; + } + + public function setCardAlias($cardAlias) + { + $this->cardAlias = $cardAlias; + } + + public function getCardToken() + { + return $this->cardToken; + } + + public function setCardToken($cardToken) + { + $this->cardToken = $cardToken; + } + + public function getCardUserKey() + { + return $this->cardUserKey; + } + + public function setCardUserKey($cardUserKey) + { + $this->cardUserKey = $cardUserKey; + } + + public function getRegisterConsumerCard() + { + return $this->registerConsumerCard; + } + + public function setRegisterConsumerCard($registerConsumerCard) + { + $this->registerConsumerCard = $registerConsumerCard; + } + + public function getUcsToken() + { + return $this->ucsToken; + } + + public function setUcsToken($ucsToken) + { + $this->ucsToken = $ucsToken; + } + + public function setConsumerToken($consumerToken) + { + $this->consumerToken = $consumerToken; + } + + public function getConsumerToken() + { + return $this->consumerToken; + } + + public function getJsonObject() + { + return JsonBuilder::create() + ->add("cardHolderName", $this->getCardHolderName()) + ->add("cardNumber", $this->getCardNumber()) + ->add("expireYear", $this->getExpireYear()) + ->add("expireMonth", $this->getExpireMonth()) + ->add("cvc", $this->getCvc()) + ->add("registerCard", $this->getRegisterCard()) + ->add("cardAlias", $this->getCardAlias()) + ->add("cardToken", $this->getCardToken()) + ->add("cardUserKey", $this->getCardUserKey()) + ->add("registerConsumerCard", $this->getRegisterConsumerCard()) + ->add("consumerToken", $this->getConsumerToken()) + ->add("ucsToken", $this->getUcsToken()) + ->getObject(); + } + + public function toPKIRequestString() + { + return RequestStringBuilder::create() + ->append("cardHolderName", $this->getCardHolderName()) + ->append("cardNumber", $this->getCardNumber()) + ->append("expireYear", $this->getExpireYear()) + ->append("expireMonth", $this->getExpireMonth()) + ->append("cvc", $this->getCvc()) + ->append("registerCard", $this->getRegisterCard()) + ->append("cardAlias", $this->getCardAlias()) + ->append("cardToken", $this->getCardToken()) + ->append("cardUserKey", $this->getCardUserKey()) + ->append("registerConsumerCard", $this->getRegisterConsumerCard()) + ->append("consumerToken", $this->getConsumerToken()) + ->append("ucsToken", $this->getUcsToken()) + ->getRequestString(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/PaymentChannel.php b/iyzipay/src/Iyzipay/Model/PaymentChannel.php new file mode 100644 index 0000000..0f1241f --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/PaymentChannel.php @@ -0,0 +1,15 @@ +itemId; + } + + public function setItemId($itemId) + { + $this->itemId = $itemId; + } + + public function getPaymentTransactionId() + { + return $this->paymentTransactionId; + } + + public function setPaymentTransactionId($paymentTransactionId) + { + $this->paymentTransactionId = $paymentTransactionId; + } + + public function getTransactionStatus() + { + return $this->transactionStatus; + } + + public function setTransactionStatus($transactionStatus) + { + $this->transactionStatus = $transactionStatus; + } + + public function getPrice() + { + return $this->price; + } + + public function setPrice($price) + { + $this->price = $price; + } + + public function getPaidPrice() + { + return $this->paidPrice; + } + + public function setPaidPrice($paidPrice) + { + $this->paidPrice = $paidPrice; + } + + public function getMerchantCommissionRate() + { + return $this->merchantCommissionRate; + } + + public function setMerchantCommissionRate($merchantCommissionRate) + { + $this->merchantCommissionRate = $merchantCommissionRate; + } + + public function getMerchantCommissionRateAmount() + { + return $this->merchantCommissionRateAmount; + } + + public function setMerchantCommissionRateAmount($merchantCommissionRateAmount) + { + $this->merchantCommissionRateAmount = $merchantCommissionRateAmount; + } + + public function getIyziCommissionRateAmount() + { + return $this->iyziCommissionRateAmount; + } + + public function setIyziCommissionRateAmount($iyziCommissionRateAmount) + { + $this->iyziCommissionRateAmount = $iyziCommissionRateAmount; + } + + public function getIyziCommissionFee() + { + return $this->iyziCommissionFee; + } + + public function setIyziCommissionFee($iyziCommissionFee) + { + $this->iyziCommissionFee = $iyziCommissionFee; + } + + public function getBlockageRate() + { + return $this->blockageRate; + } + + public function setBlockageRate($blockageRate) + { + $this->blockageRate = $blockageRate; + } + + public function getBlockageRateAmountMerchant() + { + return $this->blockageRateAmountMerchant; + } + + public function setBlockageRateAmountMerchant($blockageRateAmountMerchant) + { + $this->blockageRateAmountMerchant = $blockageRateAmountMerchant; + } + + public function getBlockageRateAmountSubMerchant() + { + return $this->blockageRateAmountSubMerchant; + } + + public function setBlockageRateAmountSubMerchant($blockageRateAmountSubMerchant) + { + $this->blockageRateAmountSubMerchant = $blockageRateAmountSubMerchant; + } + + public function getBlockageResolvedDate() + { + return $this->blockageResolvedDate; + } + + public function setBlockageResolvedDate($blockageResolvedDate) + { + $this->blockageResolvedDate = $blockageResolvedDate; + } + + public function getSubMerchantKey() + { + return $this->subMerchantKey; + } + + public function setSubMerchantKey($subMerchantKey) + { + $this->subMerchantKey = $subMerchantKey; + } + + public function getSubMerchantPrice() + { + return $this->subMerchantPrice; + } + + public function setSubMerchantPrice($subMerchantPrice) + { + $this->subMerchantPrice = $subMerchantPrice; + } + + public function getSubMerchantPayoutRate() + { + return $this->subMerchantPayoutRate; + } + + public function setSubMerchantPayoutRate($subMerchantPayoutRate) + { + $this->subMerchantPayoutRate = $subMerchantPayoutRate; + } + + public function getSubMerchantPayoutAmount() + { + return $this->subMerchantPayoutAmount; + } + + public function setSubMerchantPayoutAmount($subMerchantPayoutAmount) + { + $this->subMerchantPayoutAmount = $subMerchantPayoutAmount; + } + + public function getMerchantPayoutAmount() + { + return $this->merchantPayoutAmount; + } + + public function setMerchantPayoutAmount($merchantPayoutAmount) + { + $this->merchantPayoutAmount = $merchantPayoutAmount; + } + + public function getConvertedPayout() + { + return $this->convertedPayout; + } + + public function setConvertedPayout($convertedPayout) + { + $this->convertedPayout = $convertedPayout; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/PaymentPostAuth.php b/iyzipay/src/Iyzipay/Model/PaymentPostAuth.php new file mode 100644 index 0000000..24b7f9a --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/PaymentPostAuth.php @@ -0,0 +1,16 @@ +post($options->getBaseUrl() . "/payment/postauth", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return PaymentPostAuthMapper::create($rawResult)->jsonDecode()->mapPaymentPostAuth(new PaymentPostAuth()); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/PaymentPreAuth.php b/iyzipay/src/Iyzipay/Model/PaymentPreAuth.php new file mode 100644 index 0000000..a1639d1 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/PaymentPreAuth.php @@ -0,0 +1,23 @@ +post($options->getBaseUrl() . "/payment/preauth", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return PaymentPreAuthMapper::create($rawResult)->jsonDecode()->mapPaymentPreAuth(new PaymentPreAuth()); + } + + public static function retrieve(RetrievePaymentRequest $request, Options $options) + { + $rawResult = parent::httpClient()->post($options->getBaseUrl() . "/payment/detail", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return PaymentPreAuthMapper::create($rawResult)->jsonDecode()->mapPaymentPreAuth(new PaymentPreAuth()); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/PaymentResource.php b/iyzipay/src/Iyzipay/Model/PaymentResource.php new file mode 100644 index 0000000..b22b79b --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/PaymentResource.php @@ -0,0 +1,273 @@ +price; + } + + public function setPrice($price) + { + $this->price = $price; + } + + public function getPaidPrice() + { + return $this->paidPrice; + } + + public function setPaidPrice($paidPrice) + { + $this->paidPrice = $paidPrice; + } + + public function getInstallment() + { + return $this->installment; + } + + public function setInstallment($installment) + { + $this->installment = $installment; + } + + public function getCurrency() + { + return $this->currency; + } + + public function setCurrency($currency) + { + $this->currency = $currency; + } + + public function getPaymentId() + { + return $this->paymentId; + } + + public function setPaymentId($paymentId) + { + $this->paymentId = $paymentId; + } + + public function getPaymentStatus() + { + return $this->paymentStatus; + } + + public function setPaymentStatus($paymentStatus) + { + $this->paymentStatus = $paymentStatus; + } + + public function getFraudStatus() + { + return $this->fraudStatus; + } + + public function setFraudStatus($fraudStatus) + { + $this->fraudStatus = $fraudStatus; + } + + public function getMerchantCommissionRate() + { + return $this->merchantCommissionRate; + } + + public function setMerchantCommissionRate($merchantCommissionRate) + { + $this->merchantCommissionRate = $merchantCommissionRate; + } + + public function getMerchantCommissionRateAmount() + { + return $this->merchantCommissionRateAmount; + } + + public function setMerchantCommissionRateAmount($merchantCommissionRateAmount) + { + $this->merchantCommissionRateAmount = $merchantCommissionRateAmount; + } + + public function getIyziCommissionRateAmount() + { + return $this->iyziCommissionRateAmount; + } + + public function setIyziCommissionRateAmount($iyziCommissionRateAmount) + { + $this->iyziCommissionRateAmount = $iyziCommissionRateAmount; + } + + public function getIyziCommissionFee() + { + return $this->iyziCommissionFee; + } + + public function setIyziCommissionFee($iyziCommissionFee) + { + $this->iyziCommissionFee = $iyziCommissionFee; + } + + public function getCardType() + { + return $this->cardType; + } + + public function setCardType($cardType) + { + $this->cardType = $cardType; + } + + public function getCardAssociation() + { + return $this->cardAssociation; + } + + public function setCardAssociation($cardAssociation) + { + $this->cardAssociation = $cardAssociation; + } + + public function getCardFamily() + { + return $this->cardFamily; + } + + public function setCardFamily($cardFamily) + { + $this->cardFamily = $cardFamily; + } + + public function getCardToken() + { + return $this->cardToken; + } + + public function setCardToken($cardToken) + { + $this->cardToken = $cardToken; + } + + public function getCardUserKey() + { + return $this->cardUserKey; + } + + public function setCardUserKey($cardUserKey) + { + $this->cardUserKey = $cardUserKey; + } + + public function getBinNumber() + { + return $this->binNumber; + } + + public function setBinNumber($binNumber) + { + $this->binNumber = $binNumber; + } + + public function getBasketId() + { + return $this->basketId; + } + + public function setBasketId($basketId) + { + $this->basketId = $basketId; + } + + public function getPaymentItems() + { + return $this->paymentItems; + } + + public function setPaymentItems($paymentItems) + { + $this->paymentItems = $paymentItems; + } + + public function getConnectorName() + { + return $this->connectorName; + } + + public function setConnectorName($connectorName) + { + $this->connectorName = $connectorName; + } + + public function getAuthCode() + { + return $this->authCode; + } + + public function setAuthCode($authCode) + { + $this->authCode = $authCode; + } + + public function getPhase() + { + return $this->phase; + } + + public function setPhase($phase) + { + $this->phase = $phase; + } + + public function getLastFourDigits() + { + return $this->lastFourDigits; + } + + public function setLastFourDigits($lastFourDigits) + { + $this->lastFourDigits = $lastFourDigits; + } + + public function getPosOrderId() + { + return $this->posOrderId; + } + + public function setPosOrderId($posOrderId) + { + $this->posOrderId = $posOrderId; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/PayoutCompletedTransaction.php b/iyzipay/src/Iyzipay/Model/PayoutCompletedTransaction.php new file mode 100644 index 0000000..eed8cb5 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/PayoutCompletedTransaction.php @@ -0,0 +1,62 @@ +paymentTransactionId; + } + + public function setPaymentTransactionId($paymentTransactionId) + { + $this->paymentTransactionId = $paymentTransactionId; + } + + public function getPayoutAmount() + { + return $this->payoutAmount; + } + + public function setPayoutAmount($payoutAmount) + { + $this->payoutAmount = $payoutAmount; + } + + public function getPayoutType() + { + return $this->payoutType; + } + + public function setPayoutType($payoutType) + { + $this->payoutType = $payoutType; + } + + public function getSubMerchantKey() + { + return $this->subMerchantKey; + } + + public function setSubMerchantKey($subMerchantKey) + { + $this->subMerchantKey = $subMerchantKey; + } + + public function getCurrency() + { + return $this->currency; + } + + public function setCurrency($currency) + { + $this->currency = $currency; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/PayoutCompletedTransactionList.php b/iyzipay/src/Iyzipay/Model/PayoutCompletedTransactionList.php new file mode 100644 index 0000000..ba6fb87 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/PayoutCompletedTransactionList.php @@ -0,0 +1,29 @@ +post($options->getBaseUrl() . "/reporting/settlement/payoutcompleted", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return PayoutCompletedTransactionListMapper::create($rawResult)->jsonDecode()->mapPayoutCompletedTransactionList(new PayoutCompletedTransactionList()); + } + + public function getPayoutCompletedTransactions() + { + return $this->payoutCompletedTransactions; + } + + public function setPayoutCompletedTransactions($payoutCompletedTransactions) + { + $this->payoutCompletedTransactions = $payoutCompletedTransactions; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/PeccoInitialize.php b/iyzipay/src/Iyzipay/Model/PeccoInitialize.php new file mode 100644 index 0000000..0ed6cbb --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/PeccoInitialize.php @@ -0,0 +1,62 @@ +post($options->getBaseUrl() . "/payment/pecco/initialize", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return PeccoInitializeMapper::create($rawResult)->jsonDecode()->mapPeccoInitialize(new PeccoInitialize()); + } + + public function getHtmlContent() + { + return $this->htmlContent; + } + + public function setHtmlContent($htmlContent) + { + $this->htmlContent = $htmlContent; + } + + public function getRedirectUrl() + { + return $this->redirectUrl; + } + + public function setRedirectUrl($redirectUrl) + { + $this->redirectUrl = $redirectUrl; + } + + public function getToken() + { + return $this->token; + } + + public function setToken($token) + { + $this->token = $token; + } + + public function getTokenExpireTime() + { + return $this->tokenExpireTime; + } + + public function setTokenExpireTime($tokenExpireTime) + { + $this->tokenExpireTime = $tokenExpireTime; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/PeccoPayment.php b/iyzipay/src/Iyzipay/Model/PeccoPayment.php new file mode 100644 index 0000000..e1f18ec --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/PeccoPayment.php @@ -0,0 +1,28 @@ +post($options->getBaseUrl() . "/payment/pecco/auth", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return PeccoPaymentMapper::create($rawResult)->jsonDecode()->mapPeccoPayment(new PeccoPayment()); + } + + public function getToken() + { + return $this->token; + } + + public function setToken($token) + { + $this->token = $token; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/ProtectedOverleyScript.php b/iyzipay/src/Iyzipay/Model/ProtectedOverleyScript.php new file mode 100644 index 0000000..8da8c52 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/ProtectedOverleyScript.php @@ -0,0 +1,40 @@ +post($options->getBaseUrl() . "/v1/iyziup/protected/shop/detail/overlay-script", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return ProtectedOverleyScriptMapper::create($rawResult)->jsonDecode()->mapProtectedOverleyScript(new ProtectedOverleyScript()); + } + + public function getProtectedShopId() + { + return $this->protectedShopId; + } + + public function setProtectedShopId($protectedShopId) + { + $this->protectedShopId = $protectedShopId; + } + + public function getOverlayScript() + { + return $this->overlayScript; + } + + public function setOverlayScript($overlayScript) + { + $this->overlayScript = $overlayScript; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Refund.php b/iyzipay/src/Iyzipay/Model/Refund.php new file mode 100644 index 0000000..fb9a7be --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Refund.php @@ -0,0 +1,16 @@ +post($options->getBaseUrl() . "/payment/refund", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return RefundMapper::create($rawResult)->jsonDecode()->mapRefund(new Refund()); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/RefundChargedFromMerchant.php b/iyzipay/src/Iyzipay/Model/RefundChargedFromMerchant.php new file mode 100644 index 0000000..7713bb4 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/RefundChargedFromMerchant.php @@ -0,0 +1,16 @@ +post($options->getBaseUrl() . "/payment/iyzipos/refund/merchant/charge", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return RefundChargedFromMerchantMapper::create($rawResult)->jsonDecode()->mapRefundChargedFromMerchant(new RefundChargedFromMerchant()); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/RefundReason.php b/iyzipay/src/Iyzipay/Model/RefundReason.php new file mode 100644 index 0000000..80f7e8d --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/RefundReason.php @@ -0,0 +1,11 @@ +paymentId; + } + + public function setPaymentId($paymentId) + { + $this->paymentId = $paymentId; + } + + public function getPaymentTransactionId() + { + return $this->paymentTransactionId; + } + + public function setPaymentTransactionId($paymentTransactionId) + { + $this->paymentTransactionId = $paymentTransactionId; + } + + public function getPrice() + { + return $this->price; + } + + public function setPrice($price) + { + $this->price = $price; + } + + public function getCurrency() + { + return $this->currency; + } + + public function setCurrency($currency) + { + $this->currency = $currency; + } + + public function getConnectorName() + { + return $this->connectorName; + } + + public function setConnectorName($connectorName) + { + $this->connectorName = $connectorName; + } + + public function getAuthCode() + { + return $this->authCode; + } + + public function setAuthCode($authCode) + { + $this->authCode = $authCode; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/RefundToBalance.php b/iyzipay/src/Iyzipay/Model/RefundToBalance.php new file mode 100644 index 0000000..cc48f9d --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/RefundToBalance.php @@ -0,0 +1,17 @@ +post($options->getBaseUrl() . "/payment/refund-to-balance/init", parent::getHttpHeaders($request, $options), $request->toJsonString()); + + return RefundToBalanceMapper::create($rawResult)->jsonDecode()->mapRefundToBalance(new RefundToBalance()); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/RefundToBalanceResource.php b/iyzipay/src/Iyzipay/Model/RefundToBalanceResource.php new file mode 100644 index 0000000..c3d1328 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/RefundToBalanceResource.php @@ -0,0 +1,31 @@ +token; + } + + public function setToken($token) + { + $this->token = $token; + } + + public function getUrl() + { + return $this->url; + } + + public function setUrl($url) + { + $this->url = $url; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/ReportingPaymentDetail.php b/iyzipay/src/Iyzipay/Model/ReportingPaymentDetail.php new file mode 100644 index 0000000..23de878 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/ReportingPaymentDetail.php @@ -0,0 +1,19 @@ +getBaseUrl() . "/v2/reporting/payment/details" . RequestStringBuilder::requestToStringQuery($request, 'reporting'); + $rawResult = parent::httpClient()->getV2($uri, parent::getHttpHeadersV2($uri, null, $options)); + return ReportingPaymentDetailMapper::create($rawResult)->jsonDecode()->mapReportingPaymentDetail(new ReportingPaymentDetail()); + + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/ReportingPaymentDetailResource.php b/iyzipay/src/Iyzipay/Model/ReportingPaymentDetailResource.php new file mode 100644 index 0000000..7cf40f1 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/ReportingPaymentDetailResource.php @@ -0,0 +1,20 @@ +payments; + } + + public function setPayments($payments) + { + $this->payments = $payments; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/ReportingPaymentTransaction.php b/iyzipay/src/Iyzipay/Model/ReportingPaymentTransaction.php new file mode 100644 index 0000000..754ccee --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/ReportingPaymentTransaction.php @@ -0,0 +1,19 @@ +getBaseUrl() . "/v2/reporting/payment/transactions" . RequestStringBuilder::requestToStringQuery($request, 'reportingTransaction'); + $rawResult = parent::httpClient()->getV2($uri, parent::getHttpHeadersV2($uri, null, $options)); + return ReportingPaymentTransactionMapper::create($rawResult)->jsonDecode()->mapReportingPaymentTransaction(new ReportingPaymentTransaction()); + + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/ReportingPaymentTransactionResource.php b/iyzipay/src/Iyzipay/Model/ReportingPaymentTransactionResource.php new file mode 100644 index 0000000..fad309d --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/ReportingPaymentTransactionResource.php @@ -0,0 +1,43 @@ +transactions; + } + + public function setTransactions($transactions) + { + $this->transactions = $transactions; + } + + public function getCurrentPage() + { + return $this->currentPage; + } + + public function setCurrentPage($currentPage) + { + $this->currentPage = $currentPage; + + } + + public function getTotalPageCount() + { + return $this->totalPageCount; + } + + public function setTotalPageCount($totalPageCount) + { + $this->totalPageCount = $totalPageCount; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/SettlementToBalance.php b/iyzipay/src/Iyzipay/Model/SettlementToBalance.php new file mode 100644 index 0000000..582040a --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/SettlementToBalance.php @@ -0,0 +1,17 @@ +post($options->getBaseUrl() . "/payment/settlement-to-balance/init", parent::getHttpHeaders($request, $options), $request->toJsonString()); + + return SettlementToBalanceMapper::create($rawResult)->jsonDecode()->mapSettlementToBalance(new SettlementToBalance()); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/SettlementToBalanceResource.php b/iyzipay/src/Iyzipay/Model/SettlementToBalanceResource.php new file mode 100644 index 0000000..c835ede --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/SettlementToBalanceResource.php @@ -0,0 +1,42 @@ +url; + } + + public function setUrl($url) + { + $this->url = $url; + } + + public function getToken() + { + return $this->token; + } + + public function setToken($token) + { + $this->token = $token; + } + + public function getSettingsAllTime() + { + return $this->settingsAllTime; + } + + public function setSettingsAllTime($settingsAllTime) + { + $this->settingsAllTime = $settingsAllTime; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Status.php b/iyzipay/src/Iyzipay/Model/Status.php new file mode 100644 index 0000000..0616a17 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Status.php @@ -0,0 +1,9 @@ +post($options->getBaseUrl() . "/onboarding/submerchant", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return SubMerchantMapper::create($rawResult)->jsonDecode()->mapSubMerchant(new SubMerchant()); + } + + public static function update(UpdateSubMerchantRequest $request, Options $options) + { + $rawResult = parent::httpClient()->put($options->getBaseUrl() . "/onboarding/submerchant", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return SubMerchantMapper::create($rawResult)->jsonDecode()->mapSubMerchant(new SubMerchant()); + } + + public static function retrieve(RetrieveSubMerchantRequest $request, Options $options) + { + $rawResult = parent::httpClient()->post($options->getBaseUrl() . "/onboarding/submerchant/detail", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return SubMerchantMapper::create($rawResult)->jsonDecode()->mapSubMerchant(new SubMerchant()); + } + + public function getName() + { + return $this->name; + } + + public function setName($name) + { + $this->name = $name; + } + + public function getEmail() + { + return $this->email; + } + + public function setEmail($email) + { + $this->email = $email; + } + + public function getGsmNumber() + { + return $this->gsmNumber; + } + + public function setGsmNumber($gsmNumber) + { + $this->gsmNumber = $gsmNumber; + } + + public function getAddress() + { + return $this->address; + } + + public function setAddress($address) + { + $this->address = $address; + } + + public function getIban() + { + return $this->iban; + } + + public function setIban($iban) + { + $this->iban = $iban; + } + + public function getSwiftCode() + { + return $this->swiftCode; + } + + public function setSwiftCode($swiftCode) + { + $this->swiftCode = $swiftCode; + } + + public function getCurrency() + { + return $this->currency; + } + + public function setCurrency($currency) + { + $this->currency = $currency; + } + + public function getTaxOffice() + { + return $this->taxOffice; + } + + public function setTaxOffice($taxOffice) + { + $this->taxOffice = $taxOffice; + } + + public function getContactName() + { + return $this->contactName; + } + + public function setContactName($contactName) + { + $this->contactName = $contactName; + } + + public function getContactSurname() + { + return $this->contactSurname; + } + + public function setContactSurname($contactSurname) + { + $this->contactSurname = $contactSurname; + } + + public function getLegalCompanyTitle() + { + return $this->legalCompanyTitle; + } + + public function setLegalCompanyTitle($legalCompanyTitle) + { + $this->legalCompanyTitle = $legalCompanyTitle; + } + + public function getSubMerchantExternalId() + { + return $this->subMerchantExternalId; + } + + public function setSubMerchantExternalId($subMerchantExternalId) + { + $this->subMerchantExternalId = $subMerchantExternalId; + } + + public function getIdentityNumber() + { + return $this->identityNumber; + } + + public function setIdentityNumber($identityNumber) + { + $this->identityNumber = $identityNumber; + } + + public function getTaxNumber() + { + return $this->taxNumber; + } + + public function setTaxNumber($taxNumber) + { + $this->taxNumber = $taxNumber; + } + + public function getSubMerchantType() + { + return $this->subMerchantType; + } + + public function setSubMerchantType($subMerchantType) + { + $this->subMerchantType = $subMerchantType; + } + + public function getSubMerchantKey() + { + return $this->subMerchantKey; + } + + public function setSubMerchantKey($subMerchantKey) + { + $this->subMerchantKey = $subMerchantKey; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/SubMerchantPaymentItemResource.php b/iyzipay/src/Iyzipay/Model/SubMerchantPaymentItemResource.php new file mode 100644 index 0000000..8478c44 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/SubMerchantPaymentItemResource.php @@ -0,0 +1,43 @@ +subMerchantKey; + } + + public function setSubMerchantKey($subMerchantKey) + { + $this->subMerchantKey = $subMerchantKey; + } + + public function getPaymentTransactionId() + { + return $this->paymentTransactionId; + } + + public function setPaymentTransactionId($paymentTransactionId) + { + $this->paymentTransactionId = $paymentTransactionId; + } + + public function getSubMerchantPrice() + { + return $this->subMerchantPrice; + } + + public function setSubMerchantPrice($subMerchantPrice) + { + $this->subMerchantPrice = $subMerchantPrice; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/SubMerchantPaymentItemUpdate.php b/iyzipay/src/Iyzipay/Model/SubMerchantPaymentItemUpdate.php new file mode 100644 index 0000000..ceaf636 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/SubMerchantPaymentItemUpdate.php @@ -0,0 +1,16 @@ +put($options->getBaseUrl() . "/payment/item", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return SubMerchantPaymentItemMapper::create($rawResult)->jsonDecode()->mapSubMerchantPaymentItem(new SubMerchantPaymentItemUpdate()); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/SubMerchantType.php b/iyzipay/src/Iyzipay/Model/SubMerchantType.php new file mode 100644 index 0000000..0240d30 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/SubMerchantType.php @@ -0,0 +1,10 @@ +getBaseUrl() . "/v2/subscription/products".RequestStringBuilder::requestToStringQuery($request, 'subscriptionItems'); + $rawResult = parent::httpClient()->getV2($uri, parent::getHttpHeadersV2($uri, null, $options), $request->toJsonString()); + return RetrieveListMapper::create($rawResult)->jsonDecode()->mapRetrieveList(new RetrieveList()); + } + + public static function pricingPlan(SubscriptionListPricingPlanRequest $request, Options $options) + { + $uri = $options->getBaseUrl() . "/v2/subscription/products/".$request->getProductReferenceCode()."/pricing-plans".RequestStringBuilder::requestToStringQuery($request, 'subscriptionItems'); + $rawResult = parent::httpClient()->getV2($uri, parent::getHttpHeadersV2($uri, null, $options), $request->toJsonString()); + return RetrieveListMapper::create($rawResult)->jsonDecode()->mapRetrieveList(new RetrieveList()); + } + + public static function customers(SubscriptionListCustomersRequest $request, Options $options) + { + $uri = $options->getBaseUrl() . "/v2/subscription/customers".RequestStringBuilder::requestToStringQuery($request, 'subscriptionItems'); + $rawResult = parent::httpClient()->getV2($uri, parent::getHttpHeadersV2($uri, null, $options), $request->toJsonString()); + return RetrieveListMapper::create($rawResult)->jsonDecode()->mapRetrieveList(new RetrieveList()); + } + + + public static function subscriptions(SubscriptionSearchRequest $request, Options $options) + { + $uri = $options->getBaseUrl() . "/v2/subscription/subscriptions".RequestStringBuilder::requestToStringQuery($request, 'searchSubscription'); + $rawResult = parent::httpClient()->getV2($uri, parent::getHttpHeadersV2($uri, null, $options), $request->toJsonString()); + return RetrieveListMapper::create($rawResult)->jsonDecode()->mapRetrieveList(new RetrieveList()); + } + + public function getTotalCount() + { + return $this->totalCount; + } + + public function setTotalCount($totalCount) + { + $this->totalCount = $totalCount; + } + + public function getCurrentPage() + { + return $this->currentPage; + } + + public function setCurrentPage($currentPage) + { + $this->currentPage = $currentPage; + } + + public function getPageCount() + { + return $this->pageCount; + } + + public function setPageCount($pageCount) + { + $this->pageCount = $pageCount; + } + + public function getItems() + { + return $this->items; + } + + public function setItems($items) + { + $this->items = $items; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Subscription/RetrieveSubscriptionCheckoutForm.php b/iyzipay/src/Iyzipay/Model/Subscription/RetrieveSubscriptionCheckoutForm.php new file mode 100644 index 0000000..c350c95 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Subscription/RetrieveSubscriptionCheckoutForm.php @@ -0,0 +1,98 @@ +getBaseUrl() . "/v2/subscription/checkoutform/".$request->getCheckoutFormToken(); + $rawResult = parent::httpClient()->getV2($uri, parent::getHttpHeadersV2($uri, $request, $options), $request->toJsonString()); + return RetrieveSubscriptionCheckoutFormMapper::create($rawResult)->jsonDecode()->mapSubscriptionCreateCheckoutForm(new RetrieveSubscriptionCheckoutForm()); + } + + public function getReferenceCode(){ + return $this->referenceCode; + } + public function setReferenceCode($referenceCode){ + $this->referenceCode = $referenceCode; + } + public function getParentReferenceCode(){ + return $this->parentReferenceCode; + } + public function setParentReferenceCode($parentReferenceCode){ + $this->parentReferenceCode = $parentReferenceCode; + } + public function getPricingPlanReferenceCode(){ + return $this->pricingPlanReferenceCode; + } + public function setPricingPlanReferenceCode($pricingPlanReferenceCode){ + $this->pricingPlanReferenceCode = $pricingPlanReferenceCode; + } + public function getCustomerReferenceCode(){ + return $this->customerReferenceCode; + } + public function setCustomerReferenceCode($customerReferenceCode){ + $this->customerReferenceCode= $customerReferenceCode; + } + public function getSubscriptionStatus(){ + return $this->subscriptionStatus; + } + public function setSubscriptionStatus($subscriptionStatus){ + $this->subscriptionStatus = $subscriptionStatus; + } + public function getTrialDays(){ + return $this->trialDays; + } + public function setTrialDays($trialDays){ + $this->trialDays = $trialDays; + } + public function getTrialStartDate(){ + return $this->trialStartDate; + } + public function setTrialStartDate($trialStartDate){ + $this->trialStartDate = $trialStartDate; + } + public function getTrialEndDate(){ + return $this->trialEndDate; + } + public function setTrialEndDate($trialEndDate){ + $this->trialEndDate = $trialEndDate; + } + public function getCreatedDate(){ + return $this->createdDate; + } + public function setCreatedDate($createdDate){ + $this->createdDate = $createdDate; + } + public function getStartDate(){ + return $this->startDate; + } + public function setStartDate($startDate){ + $this->startDate = $startDate; + } + public function getEndDate(){ + return $this->endDate; + } + public function setEndDate($endDate){ + $this->endDate = $endDate; + } +} diff --git a/iyzipay/src/Iyzipay/Model/Subscription/SubscriptionActivate.php b/iyzipay/src/Iyzipay/Model/Subscription/SubscriptionActivate.php new file mode 100644 index 0000000..600a78c --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Subscription/SubscriptionActivate.php @@ -0,0 +1,19 @@ +getBaseUrl() . "/v2/subscription/subscriptions/" . $request->getSubscriptionReferenceCode()."/activate"; + $rawResult = parent::httpClient()->post($uri, parent::getHttpHeadersV2($uri, $request, $options), $request->toJsonString()); + return SubscriptionActionMapper::create($rawResult)->jsonDecode()->mapSubscriptionAction(new SubscriptionActivate()); + } + +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Subscription/SubscriptionCancel.php b/iyzipay/src/Iyzipay/Model/Subscription/SubscriptionCancel.php new file mode 100644 index 0000000..81066b7 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Subscription/SubscriptionCancel.php @@ -0,0 +1,22 @@ +getBaseUrl() . "/v2/subscription/subscriptions/" . $request->getSubscriptionReferenceCode()."/cancel"; + $rawResult = parent::httpClient()->post($uri, parent::getHttpHeadersV2($uri, $request, $options), $request->toJsonString()); + return SubscriptionActionMapper::create($rawResult)->jsonDecode()->mapSubscriptionAction(new SubscriptionCancel()); + + } + +} diff --git a/iyzipay/src/Iyzipay/Model/Subscription/SubscriptionCardUpdate.php b/iyzipay/src/Iyzipay/Model/Subscription/SubscriptionCardUpdate.php new file mode 100644 index 0000000..531ea47 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Subscription/SubscriptionCardUpdate.php @@ -0,0 +1,61 @@ +getBaseUrl() . "/v2/subscription/card-update/checkoutform/initialize"; + $rawResult = parent::httpClient()->post($uri, parent::getHttpHeadersV2($uri, $request, $options), $request->toJsonString()); + return SubscriptionCardUpdateMapper::create($rawResult)->jsonDecode()->mapSubscriptionCardUpdate(new SubscriptionCardUpdate()); + } + + public static function updateWithSubscriptionReferenceCode(SubscriptionCardUpdateWithSubscriptionReferenceCodeRequest $request, Options $options) + { + $uri = $options->getBaseUrl() . "/v2/subscription/card-update/checkoutform/initialize/with-subscription"; + $rawResult = parent::httpClient()->post($uri, parent::getHttpHeadersV2($uri, $request, $options), $request->toJsonString()); + return SubscriptionCardUpdateMapper::create($rawResult)->jsonDecode()->mapSubscriptionCardUpdate(new SubscriptionCardUpdate()); + } + + public function getToken() + { + return $this->token; + } + + public function setToken($token) + { + $this->token = $token; + } + + public function getCheckoutFormContent() + { + return $this->checkoutFormContent; + } + + public function setCheckoutFormContent($checkoutFormContent) + { + $this->checkoutFormContent = $checkoutFormContent; + } + + public function getTokenExpireTime() + { + return $this->tokenExpireTime; + } + + public function setTokenExpireTime($tokenExpireTime) + { + $this->tokenExpireTime = $tokenExpireTime; + } +} diff --git a/iyzipay/src/Iyzipay/Model/Subscription/SubscriptionCreate.php b/iyzipay/src/Iyzipay/Model/Subscription/SubscriptionCreate.php new file mode 100644 index 0000000..ce68230 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Subscription/SubscriptionCreate.php @@ -0,0 +1,98 @@ +getBaseUrl() . "/v2/subscription/initialize"; + $rawResult = parent::httpClient()->post($uri, parent::getHttpHeadersV2($uri, $request, $options), $request->toJsonString()); + return SubscriptionCreateMapper::create($rawResult)->jsonDecode()->mapSubscriptionCreate(new SubscriptionCreate()); + } + + public function getReferenceCode(){ + return $this->referenceCode; + } + public function setReferenceCode($referenceCode){ + $this->referenceCode = $referenceCode; + } + public function getParentReferenceCode(){ + return $this->parentReferenceCode; + } + public function setParentReferenceCode($parentReferenceCode){ + $this->parentReferenceCode = $parentReferenceCode; + } + public function getPricingPlanReferenceCode(){ + return $this->pricingPlanReferenceCode; + } + public function setPricingPlanReferenceCode($pricingPlanReferenceCode){ + $this->pricingPlanReferenceCode = $pricingPlanReferenceCode; + } + public function getCustomerReferenceCode(){ + return $this->customerReferenceCode; + } + public function setCustomerReferenceCode($customerReferenceCode){ + $this->customerReferenceCode= $customerReferenceCode; + } + public function getSubscriptionStatus(){ + return $this->subscriptionStatus; + } + public function setSubscriptionStatus($subscriptionStatus){ + $this->subscriptionStatus = $subscriptionStatus; + } + public function getTrialDays(){ + return $this->trialDays; + } + public function setTrialDays($trialDays){ + $this->trialDays = $trialDays; + } + public function getTrialStartDate(){ + return $this->trialStartDate; + } + public function setTrialStartDate($trialStartDate){ + $this->trialStartDate = $trialStartDate; + } + public function getTrialEndDate(){ + return $this->trialEndDate; + } + public function setTrialEndDate($trialEndDate){ + $this->trialEndDate = $trialEndDate; + } + public function getCreatedDate(){ + return $this->createdDate; + } + public function setCreatedDate($createdDate){ + $this->createdDate = $createdDate; + } + public function getStartDate(){ + return $this->startDate; + } + public function setStartDate($startDate){ + $this->startDate = $startDate; + } + public function getEndDate(){ + return $this->endDate; + } + public function setEndDate($endDate){ + $this->endDate = $endDate; + } +} diff --git a/iyzipay/src/Iyzipay/Model/Subscription/SubscriptionCreateCheckoutForm.php b/iyzipay/src/Iyzipay/Model/Subscription/SubscriptionCreateCheckoutForm.php new file mode 100644 index 0000000..0a14a50 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Subscription/SubscriptionCreateCheckoutForm.php @@ -0,0 +1,53 @@ +getBaseUrl() . "/v2/subscription/checkoutform/initialize"; + $rawResult = parent::httpClient()->post($uri, parent::getHttpHeadersV2($uri, $request, $options), $request->toJsonString()); + return SubscriptionCreateCheckoutFormMapper::create($rawResult)->jsonDecode()->mapSubscriptionCreateCheckoutForm(new SubscriptionCreateCheckoutForm()); + } + + public function getToken() + { + return $this->token; + } + + public function setToken($token) + { + $this->token = $token; + } + + public function getCheckoutFormContent() + { + return $this->checkoutFormContent; + } + + public function setCheckoutFormContent($checkoutFormContent) + { + $this->checkoutFormContent = $checkoutFormContent; + } + + public function getTokenExpireTime() + { + return $this->tokenExpireTime; + } + + public function setTokenExpireTime($tokenExpireTime) + { + $this->tokenExpireTime = $tokenExpireTime; + } +} diff --git a/iyzipay/src/Iyzipay/Model/Subscription/SubscriptionCreateWithCustomer.php b/iyzipay/src/Iyzipay/Model/Subscription/SubscriptionCreateWithCustomer.php new file mode 100644 index 0000000..6202fa6 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Subscription/SubscriptionCreateWithCustomer.php @@ -0,0 +1,98 @@ +getBaseUrl() . "/v2/subscription/initialize/with-customer"; + $rawResult = parent::httpClient()->post($uri, parent::getHttpHeadersV2($uri, $request, $options), $request->toJsonString()); + return SubscriptionCreateMapper::create($rawResult)->jsonDecode()->mapSubscriptionCreate(new SubscriptionCreate()); + } + + public function getReferenceCode(){ + return $this->referenceCode; + } + public function setReferenceCode($referenceCode){ + $this->referenceCode = $referenceCode; + } + public function getParentReferenceCode(){ + return $this->parentReferenceCode; + } + public function setParentReferenceCode($parentReferenceCode){ + $this->parentReferenceCode = $parentReferenceCode; + } + public function getPricingPlanReferenceCode(){ + return $this->pricingPlanReferenceCode; + } + public function setPricingPlanReferenceCode($pricingPlanReferenceCode){ + $this->pricingPlanReferenceCode = $pricingPlanReferenceCode; + } + public function getCustomerReferenceCode(){ + return $this->customerReferenceCode; + } + public function setCustomerReferenceCode($customerReferenceCode){ + $this->customerReferenceCode= $customerReferenceCode; + } + public function getSubscriptionStatus(){ + return $this->subscriptionStatus; + } + public function setSubscriptionStatus($subscriptionStatus){ + $this->subscriptionStatus = $subscriptionStatus; + } + public function getTrialDays(){ + return $this->trialDays; + } + public function setTrialDays($trialDays){ + $this->trialDays = $trialDays; + } + public function getTrialStartDate(){ + return $this->trialStartDate; + } + public function setTrialStartDate($trialStartDate){ + $this->trialStartDate = $trialStartDate; + } + public function getTrialEndDate(){ + return $this->trialEndDate; + } + public function setTrialEndDate($trialEndDate){ + $this->trialEndDate = $trialEndDate; + } + public function getCreatedDate(){ + return $this->createdDate; + } + public function setCreatedDate($createdDate){ + $this->createdDate = $createdDate; + } + public function getStartDate(){ + return $this->startDate; + } + public function setStartDate($startDate){ + $this->startDate = $startDate; + } + public function getEndDate(){ + return $this->endDate; + } + public function setEndDate($endDate){ + $this->endDate = $endDate; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Subscription/SubscriptionCustomer.php b/iyzipay/src/Iyzipay/Model/Subscription/SubscriptionCustomer.php new file mode 100644 index 0000000..5546728 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Subscription/SubscriptionCustomer.php @@ -0,0 +1,275 @@ +getBaseUrl() . "/v2/subscription/customers"; + $rawResult = parent::httpClient()->post($uri, parent::getHttpHeadersV2($uri, $request, $options), $request->toJsonString()); + return SubscriptionCustomerMapper::create($rawResult)->jsonDecode()->mapSubscriptionCustomer(new SubscriptionCustomer()); + } + + public static function retrieve(SubscriptionRetrieveCustomerRequest $request, $options) + { + $uri = $options->getBaseUrl() . "/v2/subscription/customers/".$request->getCustomerReferenceCode().RequestStringBuilder::requestToStringQuery($request, 'defaultParams'); + $rawResult = parent::httpClient()->getV2($uri, parent::getHttpHeadersV2($uri, null, $options), $request->toJsonString()); + return SubscriptionCustomerMapper::create($rawResult)->jsonDecode()->mapSubscriptionCustomer(new SubscriptionCustomer()); + } + + public static function update(SubscriptionUpdateCustomerRequest $request, $options) + { + $uri = $options->getBaseUrl() . "/v2/subscription/customers/".$request->getCustomerReferenceCode(); + $rawResult = parent::httpClient()->post($uri, parent::getHttpHeadersV2($uri, $request, $options), $request->toJsonString()); + return SubscriptionCustomerMapper::create($rawResult)->jsonDecode()->mapSubscriptionCustomer(new SubscriptionCustomer()); + } + + public function setReferenceCode($referenceCode) + { + $this->referenceCode = $referenceCode; + } + + public function getReferenceCode() + { + return $this->referenceCode; + } + public function setCustomerStatus($customerStatus) + { + $this->customerStatus = $customerStatus; + } + + public function getCustomerStatus() + { + return $this->customerStatus; + } + + public function getName() + { + return $this->name; + } + + public function setName($name) + { + $this->name = $name; + } + + public function getSurname() + { + return $this->surname; + } + + public function setSurname($surname) + { + $this->surname = $surname; + } + + public function getIdentityNumber() + { + return $this->identityNumber; + } + + public function setIdentityNumber($identityNumber) + { + $this->identityNumber = $identityNumber; + } + + public function getEmail() + { + return $this->email; + } + + public function setEmail($email) + { + $this->email = $email; + } + + public function getGsmNumber() + { + return $this->gsmNumber; + } + + public function setGsmNumber($gsmNumber) + { + $this->gsmNumber = $gsmNumber; + } + + public function getCreatedDate() + { + return $this->createdDate; + } + + public function setCreatedDate($createdDate) + { + $this->createdDate = $createdDate; + } + public function getShippingContactName(){ + + return $this->shippingContactName; + } + + public function setShippingContactName($shippingContactName){ + + return $this->shippingContactName = $shippingContactName; + } + + public function getShippingCity(){ + + return $this->shippingCity; + } + + public function setShippingCity($shippingCity){ + + return $this->shippingCity = $shippingCity; + } + + public function getShippingCountry(){ + + return $this->shippingCountry; + } + + public function setShippingCountry($shippingCountry){ + + return $this->shippingCountry = $shippingCountry; + } + + public function getShippingAddress(){ + + return $this->shippingAddress; + } + + public function setShippingAddress($shippingAddress){ + + return $this->shippingAddress = $shippingAddress; + } + + public function getShippingZipCode(){ + + return $this->shippingZipCode; + } + + public function setShippingZipCode($shippingZipCode){ + + return $this->shippingZipCode = $shippingZipCode; + } + + public function getBillingContactName(){ + + return $this->billingContactName; + } + + public function setBillingContactName($billingContactName){ + + return $this->billingContactName = $billingContactName; + } + + public function getBillingCity(){ + + return $this->billingCity; + } + + public function setBillingCity($billingCity){ + + return $this->billingCity = $billingCity; + } + + public function getBillingCountry(){ + + return $this->billingCountry; + } + + public function setBillingCountry($billingCountry){ + + return $this->billingCountry = $billingCountry; + } + + public function getBillingAddress(){ + + return $this->billingAddress; + } + + public function setBillingAddress($billingAddress){ + + return $this->billingAddress = $billingAddress; + } + + public function getBillingZipCode(){ + + return $this->billingZipCode; + } + + public function setBillingZipCode($billingZipCode){ + + return $this->billingZipCode = $billingZipCode; + } + + public function getBillingDistrict() + { + return $this->billingDistrict; + } + + public function setBillingDistrict($billingDistrict) + { + $this->billingDistrict = $billingDistrict; + } + + public function getShippingDistrict() + { + return $this->shippingDistrict; + } + + public function setShippingDistrict($shippingDistrict) + { + $this->shippingDistrict = $shippingDistrict; + } + + public function getContactEmail() + { + return $this->contactEmail; + } + + public function setContactEmail($contactEmail) + { + $this->contactEmail = $contactEmail; + } + public function getContactGsmNumber() + { + return $this->contactGsmNumber; + } + public function setContactGsmNumber($contactGsmNumber) + { + $this->contactGsmNumber = $contactGsmNumber; + } +} diff --git a/iyzipay/src/Iyzipay/Model/Subscription/SubscriptionDetails.php b/iyzipay/src/Iyzipay/Model/Subscription/SubscriptionDetails.php new file mode 100644 index 0000000..7b946ea --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Subscription/SubscriptionDetails.php @@ -0,0 +1,165 @@ +getBaseUrl() . "/v2/subscription/subscriptions/".$request->getSubscriptionReferenceCode().RequestStringBuilder::requestToStringQuery($request, 'defaultParams');; + $rawResult = parent::httpClient()->getV2($uri, parent::getHttpHeadersV2($uri, null, $options), $request->toJsonString()); + return SubscriptionDetailsMapper::create($rawResult)->jsonDecode()->mapSubscriptionDetails(new SubscriptionDetails()); + } + + + public function getProductReferenceCode() + { + return $this->productReferenceCode; + } + public function setProductReferenceCode($productReferenceCode) + { + $this->productReferenceCode = $productReferenceCode; + } + public function getProductName() + { + return $this->productName; + } + public function setProductName($productName) + { + $this->productName = $productName; + } + public function getPricingPlanName() + { + return $this->pricingPlanName; + } + public function setPricingPlanName($pricingPlanName) + { + $this->pricingPlanName = $pricingPlanName; + } + public function getCustomerEmail() + { + return $this->customerEmail; + } + public function setCustomerEmail($customerEmail) + { + $this->customerEmail = $customerEmail; + } + public function getOrders() + { + return $this->orders; + } + public function setOrders($orders) + { + $this->orders = $orders; + } + public function getReferenceCode() + { + return $this->referenceCode; + } + public function setReferenceCode($referenceCode) + { + $this->referenceCode = $referenceCode; + } + public function getParentReferenceCode() + { + return $this->parentReferenceCode; + } + public function setParentReferenceCode($parentReferenceCode) + { + $this->parentReferenceCode = $parentReferenceCode; + } + public function getPricingPlanReferenceCode() + { + return $this->pricingPlanReferenceCode; + } + public function setPricingPlanReferenceCode($pricingPlanReferenceCode) + { + $this->pricingPlanReferenceCode = $pricingPlanReferenceCode; + } + public function getCustomerReferenceCode() + { + return $this->customerReferenceCode; + } + public function setCustomerReferenceCode($customerReferenceCode) + { + $this->customerReferenceCode= $customerReferenceCode; + } + public function getSubscriptionStatus() + { + return $this->subscriptionStatus; + } + public function setSubscriptionStatus($subscriptionStatus) + { + $this->subscriptionStatus = $subscriptionStatus; + } + public function getTrialDays() + { + return $this->trialDays; + } + public function setTrialDays($trialDays) + { + $this->trialDays = $trialDays; + } + public function getTrialStartDate() + { + return $this->trialStartDate; + } + public function setTrialStartDate($trialStartDate) + { + $this->trialStartDate = $trialStartDate; + } + public function getTrialEndDate() + { + return $this->trialEndDate; + } + public function setTrialEndDate($trialEndDate) + { + $this->trialEndDate = $trialEndDate; + } + public function getCreatedDate() + { + return $this->createdDate; + } + public function setCreatedDate($createdDate) + { + $this->createdDate = $createdDate; + } + public function getStartDate() + { + return $this->startDate; + } + public function setStartDate($startDate) + { + $this->startDate = $startDate; + } + public function getEndDate(){ + return $this->endDate; + } + public function setEndDate($endDate){ + $this->endDate = $endDate; + } +} diff --git a/iyzipay/src/Iyzipay/Model/Subscription/SubscriptionPricingPlan.php b/iyzipay/src/Iyzipay/Model/Subscription/SubscriptionPricingPlan.php new file mode 100644 index 0000000..29562b9 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Subscription/SubscriptionPricingPlan.php @@ -0,0 +1,174 @@ +getBaseUrl() . "/v2/subscription/products/".$request->getProductReferenceCode()."/pricing-plans"; + $rawResult = parent::httpClient()->post($uri, parent::getHttpHeadersV2($uri, $request, $options), $request->toJsonString()); + return SubscriptionPricingPlanMapper::create($rawResult)->jsonDecode()->mapSubscriptionPricingPlan(new SubscriptionPricingPlan()); + } + + public static function retrieve(SubscriptionRetrievePricingPlanRequest $request, $options) + { + $uri = $options->getBaseUrl() . "/v2/subscription/pricing-plans/".$request->getPricingPlanReferenceCode().RequestStringBuilder::requestToStringQuery($request, 'defaultParams'); + $rawResult = parent::httpClient()->getV2($uri, parent::getHttpHeadersV2($uri, null, $options), $request->toJsonString()); + return SubscriptionPricingPlanMapper::create($rawResult)->jsonDecode()->mapSubscriptionPricingPlan(new SubscriptionPricingPlan()); + } + + public static function update(SubscriptionUpdatePricingPlanRequest $request, $options) + { + $uri = $options->getBaseUrl() . "/v2/subscription/pricing-plans/".$request->getPricingPlanReferenceCode(); + $rawResult = parent::httpClient()->post($uri, parent::getHttpHeadersV2($uri, $request, $options), $request->toJsonString()); + return SubscriptionPricingPlanMapper::create($rawResult)->jsonDecode()->mapSubscriptionPricingPlan(new SubscriptionPricingPlan()); + } + + public static function delete(SubscriptionDeletePricingPlanRequest $request, $options) + { + $uri = $options->getBaseUrl() . "/v2/subscription/pricing-plans/".$request->getPricingPlanReferenceCode().RequestStringBuilder::requestToStringQuery($request, 'defaultParams'); + $rawResult = parent::httpClient()->delete($uri, parent::getHttpHeadersV2($uri, $request, $options), $request->toJsonString()); + return SubscriptionPricingPlanMapper::create($rawResult)->jsonDecode()->mapSubscriptionPricingPlan(new SubscriptionPricingPlan()); + } + + public function getPricingPlanStatus() + { + return $this->pricingPlanStatus; + } + + public function setPricingPlanStatus($pricingPlanStatus) + { + $this->pricingPlanStatus = $pricingPlanStatus; + } + public function getName() + { + return $this->name; + } + + public function setName($name) + { + $this->name = $name; + } + + public function getProductReferenceCode() + { + return $this->productReferenceCode; + } + + public function setProductReferenceCode($productReferenceCode) + { + $this->productReferenceCode = $productReferenceCode; + } + public function getReferenceCode() + { + return $this->referenceCode; + } + + public function setReferenceCode($referenceCode) + { + $this->referenceCode = $referenceCode; + } + + + public function getPrice() + { + return $this->price; + } + + public function SetPrice($price) + { + $this->price = $price; + } + + public function getCurrencyCode() + { + return $this->currencyCode; + } + + public function setCurrencyCode($currencyCode) + { + $this->currencyCode = $currencyCode; + } + + public function getPaymentInterval() + { + return $this->paymentInterval; + } + + public function setPaymentInterval($paymentInterval) + { + $this->paymentInterval = $paymentInterval; + } + + public function getPaymentIntervalCount() + { + return $this->paymentIntervalCount; + } + + public function setPaymentIntervalCount($paymentIntervalCount) + { + $this->paymentIntervalCount = $paymentIntervalCount; + } + public function getTrialPeriodDays () + { + return $this->trialPeriodDays ; + } + + public function setTrialPeriodDays ($trialPeriodDays) + { + $this->trialPeriodDays = $trialPeriodDays; + } + public function getPlanPaymentType() + { + return $this->planPaymentType; + } + + public function setPlanPaymentType($planPaymentType) + { + $this->planPaymentType = $planPaymentType; + } + + public function getRecurrenceCount() + { + return $this->recurrenceCount; + } + + public function setRecurrenceCount($recurrenceCount) + { + $this->recurrenceCount = $recurrenceCount; + } + + public function getCreatedDate() + { + return $this->createdDate; + } + + public function setCreatedDate($createdDate) + { + $this->createdDate = $createdDate; + } +} diff --git a/iyzipay/src/Iyzipay/Model/Subscription/SubscriptionProduct.php b/iyzipay/src/Iyzipay/Model/Subscription/SubscriptionProduct.php new file mode 100644 index 0000000..546b0b4 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Subscription/SubscriptionProduct.php @@ -0,0 +1,111 @@ +getBaseUrl() . "/v2/subscription/products"; + $rawResult = parent::httpClient()->post($uri, parent::getHttpHeadersV2($uri, $request, $options), $request->toJsonString()); + return SubscriptionProductMapper::create($rawResult)->jsonDecode()->mapSubscriptionProduct(new SubscriptionProduct()); + } + + public static function retrieve(SubscriptionRetrieveProductRequest $request, $options) + { + $uri = $options->getBaseUrl() . "/v2/subscription/products/".$request->getProductReferenceCode().RequestStringBuilder::requestToStringQuery($request, 'defaultParams'); + $rawResult = parent::httpClient()->getV2($uri, parent::getHttpHeadersV2($uri, null, $options), $request->toJsonString()); + return SubscriptionProductMapper::create($rawResult)->jsonDecode()->mapSubscriptionProduct(new SubscriptionProduct()); + } + + public static function update(SubscriptionUpdateProductRequest $request, $options) + { + $uri = $options->getBaseUrl() . "/v2/subscription/products/".$request->getProductReferenceCode(); + $rawResult = parent::httpClient()->post($uri, parent::getHttpHeadersV2($uri, $request, $options), $request->toJsonString()); + return SubscriptionProductMapper::create($rawResult)->jsonDecode()->mapSubscriptionProduct(new SubscriptionProduct()); + } + + public static function delete(SubscriptionDeleteProductRequest $request, $options) + { + $uri = $options->getBaseUrl() . "/v2/subscription/products/".$request->getProductReferenceCode().RequestStringBuilder::requestToStringQuery($request, 'defaultParams'); + $rawResult = parent::httpClient()->delete($uri, parent::getHttpHeadersV2($uri, $request, $options), $request->toJsonString()); + return SubscriptionProductMapper::create($rawResult)->jsonDecode()->mapSubscriptionProduct(new SubscriptionProduct()); + } + + public function getName() + { + return $this->name; + } + + public function setName($name) + { + $this->name = $name; + } + + public function getProductStatus() + { + return $this->productStatus; + } + + public function setProductStatus($productStatus) + { + $this->productStatus = $productStatus; + } + + public function getDescription() + { + return $this->description; + } + + public function setDescription($description) + { + $this->description = $description; + } + + public function getReferenceCode() + { + return $this->referenceCode; + } + + public function setReferenceCode($referenceCode) + { + $this->referenceCode = $referenceCode; + } + + public function getCreatedDate() + { + return $this->createdDate; + } + + public function setCreatedDate($createdDate) + { + $this->createdDate = $createdDate; + } + + public function getPricingPlans() + { + return $this->pricingPlans; + } + + public function setPricingPlans($pricingPlans) + { + $this->pricingPlans = $pricingPlans; + } +} diff --git a/iyzipay/src/Iyzipay/Model/Subscription/SubscriptionRetry.php b/iyzipay/src/Iyzipay/Model/Subscription/SubscriptionRetry.php new file mode 100644 index 0000000..cdf42fa --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Subscription/SubscriptionRetry.php @@ -0,0 +1,18 @@ +getBaseUrl() . "/v2/subscription/operation/retry"; + $rawResult = parent::httpClient()->post($uri, parent::getHttpHeadersV2($uri, $request, $options), $request->toJsonString()); + return SubscriptionActionMapper::create($rawResult)->jsonDecode()->mapSubscriptionAction(new SubscriptionRetry()); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/Subscription/SubscriptionUpgrade.php b/iyzipay/src/Iyzipay/Model/Subscription/SubscriptionUpgrade.php new file mode 100644 index 0000000..e54cd21 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/Subscription/SubscriptionUpgrade.php @@ -0,0 +1,98 @@ +getBaseUrl() . "/v2/subscription/subscriptions/" . $request->getSubscriptionReferenceCode() . "/upgrade"; + $rawResult = parent::httpClient()->post($uri, parent::getHttpHeadersV2($uri, $request, $options), $request->toJsonString()); + return SubscriptionUpgradeMapper::create($rawResult)->jsonDecode()->mapSubscriptionUpgrade(new SubscriptionUpgrade()); + } + + public function getReferenceCode(){ + return $this->referenceCode; + } + public function setReferenceCode($referenceCode){ + $this->referenceCode = $referenceCode; + } + public function getParentReferenceCode(){ + return $this->parentReferenceCode; + } + public function setParentReferenceCode($parentReferenceCode){ + $this->parentReferenceCode = $parentReferenceCode; + } + public function getPricingPlanReferenceCode(){ + return $this->pricingPlanReferenceCode; + } + public function setPricingPlanReferenceCode($pricingPlanReferenceCode){ + $this->pricingPlanReferenceCode = $pricingPlanReferenceCode; + } + public function getCustomerReferenceCode(){ + return $this->customerReferenceCode; + } + public function setCustomerReferenceCode($customerReferenceCode){ + $this->customerReferenceCode= $customerReferenceCode; + } + public function getSubscriptionStatus(){ + return $this->subscriptionStatus; + } + public function setSubscriptionStatus($subscriptionStatus){ + $this->subscriptionStatus = $subscriptionStatus; + } + public function getTrialDays(){ + return $this->trialDays; + } + public function setTrialDays($trialDays){ + $this->trialDays = $trialDays; + } + public function getTrialStartDate(){ + return $this->trialStartDate; + } + public function setTrialStartDate($trialStartDate){ + $this->trialStartDate = $trialStartDate; + } + public function getTrialEndDate(){ + return $this->trialEndDate; + } + public function setTrialEndDate($trialEndDate){ + $this->trialEndDate = $trialEndDate; + } + public function getCreatedDate(){ + return $this->createdDate; + } + public function setCreatedDate($createdDate){ + $this->createdDate = $createdDate; + } + public function getStartDate(){ + return $this->startDate; + } + public function setStartDate($startDate){ + $this->startDate = $startDate; + } + public function getEndDate(){ + return $this->endDate; + } + public function setEndDate($endDate){ + $this->endDate = $endDate; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/ThreedsInitialize.php b/iyzipay/src/Iyzipay/Model/ThreedsInitialize.php new file mode 100644 index 0000000..dca3853 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/ThreedsInitialize.php @@ -0,0 +1,29 @@ +post($options->getBaseUrl() . "/payment/3dsecure/initialize", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return ThreedsInitializeMapper::create($rawResult)->jsonDecode()->mapThreedsInitialize(new ThreedsInitialize()); + } + + public function getHtmlContent() + { + return $this->htmlContent; + } + + public function setHtmlContent($htmlContent) + { + $this->htmlContent = $htmlContent; + } +} diff --git a/iyzipay/src/Iyzipay/Model/ThreedsInitializePreAuth.php b/iyzipay/src/Iyzipay/Model/ThreedsInitializePreAuth.php new file mode 100644 index 0000000..c90321b --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/ThreedsInitializePreAuth.php @@ -0,0 +1,29 @@ +post($options->getBaseUrl() . "/payment/3dsecure/initialize/preauth", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return ThreedsInitializePreAuthMapper::create($rawResult)->jsonDecode()->mapThreedsInitializePreAuth(new ThreedsInitializePreAuth()); + } + + public function getHtmlContent() + { + return $this->htmlContent; + } + + public function setHtmlContent($htmlContent) + { + $this->htmlContent = $htmlContent; + } +} diff --git a/iyzipay/src/Iyzipay/Model/ThreedsPayment.php b/iyzipay/src/Iyzipay/Model/ThreedsPayment.php new file mode 100644 index 0000000..11260c7 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/ThreedsPayment.php @@ -0,0 +1,23 @@ +post($options->getBaseUrl() . "/payment/3dsecure/auth", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return ThreedsPaymentMapper::create($rawResult)->jsonDecode()->mapThreedsPayment(new ThreedsPayment()); + } + + public static function retrieve(RetrievePaymentRequest $request, Options $options) + { + $rawResult = parent::httpClient()->post($options->getBaseUrl() . "/payment/detail", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return ThreedsPaymentMapper::create($rawResult)->jsonDecode()->mapThreedsPayment(new ThreedsPayment()); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/UCSInitialize.php b/iyzipay/src/Iyzipay/Model/UCSInitialize.php new file mode 100644 index 0000000..00c65f8 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/UCSInitialize.php @@ -0,0 +1,17 @@ +getBaseUrl() . "/v2/ucs/init"; + $rawResult = parent::httpClient()->post($uri, parent::getHttpHeadersV2($uri, $request, $options), $request->toJsonString()); + return UCSInitializeMapper::create($rawResult)->jsonDecode()->mapUCSInitialize(new UCSInitialize()); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Model/UCSInitializeResource.php b/iyzipay/src/Iyzipay/Model/UCSInitializeResource.php new file mode 100644 index 0000000..cae53d2 --- /dev/null +++ b/iyzipay/src/Iyzipay/Model/UCSInitializeResource.php @@ -0,0 +1,89 @@ +ucsToken; + } + public function setUcsToken($ucsToken) + { + $this->ucsToken = $ucsToken; + } + + public function getBuyerProtectedConsumer() + { + return $this->buyerProtectedConsumer; + } + public function setBuyerProtectedConsumer($buyerProtectedConsumer) + { + $this->buyerProtectedConsumer = $buyerProtectedConsumer; + } + + public function setBuyerProtectedMerchant($buyerProtectedMerchant) + { + $this->buyerProtectedMerchant = $buyerProtectedMerchant; + } + public function getBuyerProtectedMerchant() + { + return $this->buyerProtectedMerchant; + } + + public function setGsmNumber($gsmNumber) + { + $this->gsmNumber = $gsmNumber; + } + public function getGsmNumber() + { + return $this->gsmNumber; + } + + public function setMaskedGsmNumber($maskedGsmNumber) + { + $this->maskedGsmNumber = $maskedGsmNumber; + } + public function getMaskedGsmNumber() + { + return $this->maskedGsmNumber; + } + + public function setMerchantName($merchantName) + { + $this->merchantName = $merchantName; + } + public function getMerchantName() + { + return $this->merchantName; + } + + public function setScript($script) + { + $this->script = $script; + } + public function getScript() + { + return $this->script; + } + + public function setScriptType($scriptType) + { + $this->scriptType = $scriptType; + } + public function getScriptType() + { + return $this->scriptType; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Options.php b/iyzipay/src/Iyzipay/Options.php new file mode 100644 index 0000000..33ff578 --- /dev/null +++ b/iyzipay/src/Iyzipay/Options.php @@ -0,0 +1,40 @@ +apiKey; + } + + public function setApiKey($apiKey) + { + $this->apiKey = $apiKey; + } + + public function getSecretKey() + { + return $this->secretKey; + } + + public function setSecretKey($secretKey) + { + $this->secretKey = $secretKey; + } + + public function getBaseUrl() + { + return $this->baseUrl; + } + + public function setBaseUrl($baseUrl) + { + $this->baseUrl = $baseUrl; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request.php b/iyzipay/src/Iyzipay/Request.php new file mode 100644 index 0000000..2689b88 --- /dev/null +++ b/iyzipay/src/Iyzipay/Request.php @@ -0,0 +1,45 @@ +locale; + } + + public function setLocale($locale) + { + $this->locale = $locale; + } + + public function getConversationId() + { + return $this->conversationId; + } + + public function setConversationId($conversationId) + { + $this->conversationId = $conversationId; + } + + public function getJsonObject() + { + return JsonBuilder::create() + ->add("locale", $this->getLocale()) + ->add("conversationId", $this->getConversationId()) + ->getObject(); + } + + public function toPKIRequestString() + { + return RequestStringBuilder::create() + ->append("locale", $this->getLocale()) + ->append("conversationId", $this->getConversationId()) + ->getRequestString(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/CreateApmInitializeRequest.php b/iyzipay/src/Iyzipay/Request/CreateApmInitializeRequest.php new file mode 100644 index 0000000..a1c7ddd --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/CreateApmInitializeRequest.php @@ -0,0 +1,258 @@ +price; + } + + public function setPrice($price) + { + $this->price = $price; + } + + public function getPaidPrice() + { + return $this->paidPrice; + } + + public function setPaidPrice($paidPrice) + { + $this->paidPrice = $paidPrice; + } + + public function getPaymentChannel() + { + return $this->paymentChannel; + } + + public function setPaymentChannel($paymentChannel) + { + $this->paymentChannel = $paymentChannel; + } + + public function getPaymentGroup() + { + return $this->paymentGroup; + } + + public function setPaymentGroup($paymentGroup) + { + $this->paymentGroup = $paymentGroup; + } + + public function getPaymentSource() + { + return $this->paymentSource; + } + + public function setPaymentSource($paymentSource) + { + $this->paymentSource = $paymentSource; + } + + public function getCurrency() + { + return $this->currency; + } + + public function setCurrency($currency) + { + $this->currency = $currency; + } + + public function getMerchantOrderId() + { + return $this->merchantOrderId; + } + + public function setMerchantOrderId($merchantOrderId) + { + $this->merchantOrderId = $merchantOrderId; + } + + public function getCountryCode() + { + return $this->countryCode; + } + + public function setCountryCode($countryCode) + { + $this->countryCode = $countryCode; + } + + public function getAccountHolderName() + { + return $this->accountHolderName; + } + + public function setAccountHolderName($accountHolderName) + { + $this->accountHolderName = $accountHolderName; + } + + public function getMerchantCallbackUrl() + { + return $this->merchantCallbackUrl; + } + + public function setMerchantCallbackUrl($merchantCallbackUrl) + { + $this->merchantCallbackUrl = $merchantCallbackUrl; + } + + public function getMerchantErrorUrl() + { + return $this->merchantErrorUrl; + } + + public function setMerchantErrorUrl($merchantErrorUrl) + { + $this->merchantErrorUrl = $merchantErrorUrl; + } + + public function getMerchantNotificationUrl() + { + return $this->merchantNotificationUrl; + } + + public function setMerchantNotificationUrl($merchantNotificationUrl) + { + $this->merchantNotificationUrl = $merchantNotificationUrl; + } + + public function getApmType() + { + return $this->apmType; + } + + public function setApmType($apmType) + { + $this->apmType = $apmType; + } + + public function getBasketId() + { + return $this->basketId; + } + + public function setBasketId($basketId) + { + $this->basketId = $basketId; + } + + public function getBuyer() + { + return $this->buyer; + } + + public function setBuyer($buyer) + { + $this->buyer = $buyer; + } + + public function getShippingAddress() + { + return $this->shippingAddress; + } + + public function setShippingAddress($shippingAddress) + { + $this->shippingAddress = $shippingAddress; + } + + public function getBillingAddress() + { + return $this->billingAddress; + } + + public function setBillingAddress($billingAddress) + { + $this->billingAddress = $billingAddress; + } + + public function getBasketItems() + { + return $this->basketItems; + } + + public function setBasketItems($basketItems) + { + $this->basketItems = $basketItems; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->addPrice("price", $this->getPrice()) + ->addPrice("paidPrice", $this->getPaidPrice()) + ->add("paymentChannel", $this->getPaymentChannel()) + ->add("paymentGroup", $this->getPaymentGroup()) + ->add("paymentSource", $this->getPaymentSource()) + ->add("currency", $this->getCurrency()) + ->add("merchantOrderId", $this->getMerchantOrderId()) + ->add("countryCode", $this->getCountryCode()) + ->add("accountHolderName", $this->getAccountHolderName()) + ->add("merchantCallbackUrl", $this->getMerchantCallbackUrl()) + ->add("merchantErrorUrl", $this->getMerchantErrorUrl()) + ->add("merchantNotificationUrl", $this->getMerchantNotificationUrl()) + ->add("apmType", $this->getApmType()) + ->add("basketId", $this->getBasketId()) + ->add("buyer", $this->getBuyer()) + ->add("shippingAddress", $this->getShippingAddress()) + ->add("billingAddress", $this->getBillingAddress()) + ->addArray("basketItems", $this->getBasketItems()) + ->getObject(); + } + + public function toPKIRequestString() + { + return RequestStringBuilder::create() + ->appendSuper(parent::toPKIRequestString()) + ->appendPrice("price", $this->getPrice()) + ->appendPrice("paidPrice", $this->getPaidPrice()) + ->append("paymentChannel", $this->getPaymentChannel()) + ->append("paymentGroup", $this->getPaymentGroup()) + ->append("paymentSource", $this->getPaymentSource()) + ->append("currency", $this->getCurrency()) + ->append("merchantOrderId", $this->getMerchantOrderId()) + ->append("countryCode", $this->getCountryCode()) + ->append("accountHolderName", $this->getAccountHolderName()) + ->append("merchantCallbackUrl", $this->getMerchantCallbackUrl()) + ->append("merchantErrorUrl", $this->getMerchantErrorUrl()) + ->append("merchantNotificationUrl", $this->getMerchantNotificationUrl()) + ->append("apmType", $this->getApmType()) + ->append("basketId", $this->getBasketId()) + ->append("buyer", $this->getBuyer()) + ->append("shippingAddress", $this->getShippingAddress()) + ->append("billingAddress", $this->getBillingAddress()) + ->appendArray("basketItems", $this->getBasketItems()) + ->getRequestString(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/CreateApprovalRequest.php b/iyzipay/src/Iyzipay/Request/CreateApprovalRequest.php new file mode 100644 index 0000000..81aa3dc --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/CreateApprovalRequest.php @@ -0,0 +1,37 @@ +paymentTransactionId; + } + + public function setPaymentTransactionId($paymentTransactionId) + { + $this->paymentTransactionId = $paymentTransactionId; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->add("paymentTransactionId", $this->getPaymentTransactionId()) + ->getObject(); + } + + public function toPKIRequestString() + { + return RequestStringBuilder::create() + ->appendSuper(parent::toPKIRequestString()) + ->append("paymentTransactionId", $this->getPaymentTransactionId()) + ->getRequestString(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/CreateBasicBkmInitializeRequest.php b/iyzipay/src/Iyzipay/Request/CreateBasicBkmInitializeRequest.php new file mode 100644 index 0000000..0584f37 --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/CreateBasicBkmInitializeRequest.php @@ -0,0 +1,128 @@ +connectorName; + } + + public function setConnectorName($connectorName) + { + $this->connectorName = $connectorName; + } + + public function getPrice() + { + return $this->price; + } + + public function setPrice($price) + { + $this->price = $price; + } + + public function getCallbackUrl() + { + return $this->callbackUrl; + } + + public function setCallbackUrl($callbackUrl) + { + $this->callbackUrl = $callbackUrl; + } + + public function getBuyerEmail() + { + return $this->buyerEmail; + } + + public function setBuyerEmail($buyerEmail) + { + $this->buyerEmail = $buyerEmail; + } + + public function getBuyerId() + { + return $this->buyerId; + } + + public function setBuyerId($buyerId) + { + $this->buyerId = $buyerId; + } + + public function getBuyerIp() + { + return $this->buyerIp; + } + + public function setBuyerIp($buyerIp) + { + $this->buyerIp = $buyerIp; + } + + public function getPosOrderId() + { + return $this->posOrderId; + } + + public function setPosOrderId($posOrderId) + { + $this->posOrderId = $posOrderId; + } + + public function getInstallmentDetails() + { + return $this->installmentDetails; + } + + public function setInstallmentDetails($installmentDetails) + { + $this->installmentDetails = $installmentDetails; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->add("connectorName", $this->getConnectorName()) + ->addPrice("price", $this->getPrice()) + ->add("callbackUrl", $this->getCallbackUrl()) + ->add("buyerEmail", $this->getBuyerEmail()) + ->add("buyerId", $this->getBuyerId()) + ->add("buyerIp", $this->getBuyerIp()) + ->add("posOrderId", $this->getPosOrderId()) + ->addArray("installmentDetails", $this->getInstallmentDetails()) + ->getObject(); + } + + public function toPKIRequestString() + { + return RequestStringBuilder::create() + ->appendSuper(parent::toPKIRequestString()) + ->append("connectorName", $this->getConnectorName()) + ->appendPrice("price", $this->getPrice()) + ->append("callbackUrl", $this->getCallbackUrl()) + ->append("buyerEmail", $this->getBuyerEmail()) + ->append("buyerId", $this->getBuyerId()) + ->append("buyerIp", $this->getBuyerIp()) + ->append("posOrderId", $this->getPosOrderId()) + ->appendArray("installmentDetails", $this->getInstallmentDetails()) + ->getRequestString(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/CreateBasicPaymentRequest.php b/iyzipay/src/Iyzipay/Request/CreateBasicPaymentRequest.php new file mode 100644 index 0000000..b78cc2a --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/CreateBasicPaymentRequest.php @@ -0,0 +1,173 @@ +setInstallment(Constants::SINGLE_INSTALLMENT); + } + + public function getPrice() + { + return $this->price; + } + + public function setPrice($price) + { + $this->price = $price; + } + + public function getPaidPrice() + { + return $this->paidPrice; + } + + public function setPaidPrice($paidPrice) + { + $this->paidPrice = $paidPrice; + } + + public function getInstallment() + { + return $this->installment; + } + + public function setInstallment($installment) + { + $this->installment = $installment; + } + + public function getBuyerEmail() + { + return $this->buyerEmail; + } + + public function setBuyerEmail($buyerEmail) + { + $this->buyerEmail = $buyerEmail; + } + + public function getBuyerId() + { + return $this->buyerId; + } + + public function setBuyerId($buyerId) + { + $this->buyerId = $buyerId; + } + + public function getBuyerIp() + { + return $this->buyerIp; + } + + public function setBuyerIp($buyerIp) + { + $this->buyerIp = $buyerIp; + } + + public function getPosOrderId() + { + return $this->posOrderId; + } + + public function setPosOrderId($posOrderId) + { + $this->posOrderId = $posOrderId; + } + + public function getPaymentCard() + { + return $this->paymentCard; + } + + public function setPaymentCard($paymentCard) + { + $this->paymentCard = $paymentCard; + } + + public function getCurrency() + { + return $this->currency; + } + + public function setCurrency($currency) + { + $this->currency = $currency; + } + + public function getConnectorName() + { + return $this->connectorName; + } + + public function setConnectorName($connectorName) + { + $this->connectorName = $connectorName; + } + + public function getCallbackUrl() + { + return $this->callbackUrl; + } + + public function setCallbackUrl($callbackUrl) + { + $this->callbackUrl = $callbackUrl; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->addPrice("price", $this->getPrice()) + ->addPrice("paidPrice", $this->getPaidPrice()) + ->add("installment", $this->getInstallment()) + ->add("buyerEmail", $this->getBuyerEmail()) + ->add("buyerId", $this->getBuyerId()) + ->add("buyerIp", $this->getBuyerIp()) + ->add("posOrderId", $this->getPosOrderId()) + ->add("paymentCard", $this->getPaymentCard()) + ->add("currency", $this->getCurrency()) + ->add("connectorName", $this->getConnectorName()) + ->add("callbackUrl", $this->getCallbackUrl()) + ->getObject(); + } + + public function toPKIRequestString() + { + return RequestStringBuilder::create() + ->appendSuper(parent::toPKIRequestString()) + ->appendPrice("price", $this->getPrice()) + ->appendPrice("paidPrice", $this->getPaidPrice()) + ->append("installment", $this->getInstallment()) + ->append("buyerEmail", $this->getBuyerEmail()) + ->append("buyerId", $this->getBuyerId()) + ->append("buyerIp", $this->getBuyerIp()) + ->append("posOrderId", $this->getPosOrderId()) + ->append("paymentCard", $this->getPaymentCard()) + ->append("currency", $this->getCurrency()) + ->append("connectorName", $this->getConnectorName()) + ->append("callbackUrl", $this->getCallbackUrl()) + ->getRequestString(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/CreateBkmInitializeRequest.php b/iyzipay/src/Iyzipay/Request/CreateBkmInitializeRequest.php new file mode 100644 index 0000000..5f69116 --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/CreateBkmInitializeRequest.php @@ -0,0 +1,167 @@ +price; + } + + public function setPrice($price) + { + $this->price = $price; + } + + public function getBasketId() + { + return $this->basketId; + } + + public function setBasketId($basketId) + { + $this->basketId = $basketId; + } + + public function getPaymentGroup() + { + return $this->paymentGroup; + } + + public function setPaymentGroup($paymentGroup) + { + $this->paymentGroup = $paymentGroup; + } + + public function getBuyer() + { + return $this->buyer; + } + + public function setBuyer($buyer) + { + $this->buyer = $buyer; + } + + public function getShippingAddress() + { + return $this->shippingAddress; + } + + public function setShippingAddress($shippingAddress) + { + $this->shippingAddress = $shippingAddress; + } + + public function getBillingAddress() + { + return $this->billingAddress; + } + + public function setBillingAddress($billingAddress) + { + $this->billingAddress = $billingAddress; + } + + public function getBasketItems() + { + return $this->basketItems; + } + + public function setBasketItems($basketItems) + { + $this->basketItems = $basketItems; + } + + public function getCallbackUrl() + { + return $this->callbackUrl; + } + + public function setCallbackUrl($callbackUrl) + { + $this->callbackUrl = $callbackUrl; + } + + public function getPaymentSource() + { + return $this->paymentSource; + } + + public function setPaymentSource($paymentSource) + { + $this->paymentSource = $paymentSource; + } + + public function getCurrency() + { + return $this->currency; + } + + public function setCurrency($currency) + { + $this->currency = $currency; + } + + public function setEnabledInstallments($enabledInstallments) + { + $this->enabledInstallments = $enabledInstallments; + } + + public function getEnabledInstallments() + { + return $this->enabledInstallments; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->addPrice("price", $this->getPrice()) + ->add("basketId", $this->getBasketId()) + ->add("paymentGroup", $this->getPaymentGroup()) + ->add("buyer", $this->getBuyer()) + ->add("shippingAddress", $this->getShippingAddress()) + ->add("billingAddress", $this->getBillingAddress()) + ->addArray("basketItems", $this->getBasketItems()) + ->add("callbackUrl", $this->getCallbackUrl()) + ->add("paymentSource", $this->getPaymentSource()) + ->add("currency", $this->getCurrency()) + ->addArray("enabledInstallments", $this->getEnabledInstallments()) + ->getObject(); + } + + public function toPKIRequestString() + { + return RequestStringBuilder::create() + ->appendSuper(parent::toPKIRequestString()) + ->appendPrice("price", $this->getPrice()) + ->append("basketId", $this->getBasketId()) + ->append("paymentGroup", $this->getPaymentGroup()) + ->append("buyer", $this->getBuyer()) + ->append("shippingAddress", $this->getShippingAddress()) + ->append("billingAddress", $this->getBillingAddress()) + ->appendArray("basketItems", $this->getBasketItems()) + ->append("callbackUrl", $this->getCallbackUrl()) + ->append("paymentSource", $this->getPaymentSource()) + ->append("currency", $this->getCurrency()) + ->appendArray("enabledInstallments", $this->getEnabledInstallments()) + ->getRequestString(); + } +} diff --git a/iyzipay/src/Iyzipay/Request/CreateCancelRequest.php b/iyzipay/src/Iyzipay/Request/CreateCancelRequest.php new file mode 100644 index 0000000..6d30146 --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/CreateCancelRequest.php @@ -0,0 +1,76 @@ +ip; + } + + public function setIp($ip) + { + $this->ip = $ip; + } + + public function getPaymentId() + { + return $this->paymentId; + } + + public function setPaymentId($paymentId) + { + $this->paymentId = $paymentId; + } + + public function getReason() + { + return $this->reason; + } + + public function setReason($reason) + { + $this->reason = $reason; + } + + public function getDescription() + { + return $this->description; + } + + public function setDescription($description) + { + $this->description = $description; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->add("paymentId", $this->getPaymentId()) + ->add("ip", $this->getIp()) + ->add("reason", $this->getReason()) + ->add("description", $this->getDescription()) + ->getObject(); + } + + public function toPKIRequestString() + { + return RequestStringBuilder::create() + ->appendSuper(parent::toPKIRequestString()) + ->append("paymentId", $this->getPaymentId()) + ->append("ip", $this->getIp()) + ->append("reason", $this->getReason()) + ->append("description", $this->getDescription()) + ->getRequestString(); + } +} diff --git a/iyzipay/src/Iyzipay/Request/CreateCardRequest.php b/iyzipay/src/Iyzipay/Request/CreateCardRequest.php new file mode 100644 index 0000000..a941ad1 --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/CreateCardRequest.php @@ -0,0 +1,76 @@ +externalId; + } + + public function setExternalId($externalId) + { + $this->externalId = $externalId; + } + + public function getEmail() + { + return $this->email; + } + + public function setEmail($email) + { + $this->email = $email; + } + + public function getCardUserKey() + { + return $this->cardUserKey; + } + + public function setCardUserKey($cardUserKey) + { + $this->cardUserKey = $cardUserKey; + } + + public function getCard() + { + return $this->card; + } + + public function setCard($card) + { + $this->card = $card; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->add("externalId", $this->getExternalId()) + ->add("email", $this->getEmail()) + ->add("cardUserKey", $this->getCardUserKey()) + ->add("card", $this->getCard()) + ->getObject(); + } + + public function toPKIRequestString() + { + return RequestStringBuilder::create() + ->appendSuper(parent::toPKIRequestString()) + ->append("externalId", $this->getExternalId()) + ->append("email", $this->getEmail()) + ->append("cardUserKey", $this->getCardUserKey()) + ->append("card", $this->getCard()) + ->getRequestString(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/CreateCheckoutFormInitializeRequest.php b/iyzipay/src/Iyzipay/Request/CreateCheckoutFormInitializeRequest.php new file mode 100644 index 0000000..75ad059 --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/CreateCheckoutFormInitializeRequest.php @@ -0,0 +1,232 @@ +price; + } + + public function setPrice($price) + { + $this->price = $price; + } + + public function getPaidPrice() + { + return $this->paidPrice; + } + + public function setPaidPrice($paidPrice) + { + $this->paidPrice = $paidPrice; + } + + public function getBasketId() + { + return $this->basketId; + } + + public function setBasketId($basketId) + { + $this->basketId = $basketId; + } + + public function getPaymentGroup() + { + return $this->paymentGroup; + } + + public function setPaymentGroup($paymentGroup) + { + $this->paymentGroup = $paymentGroup; + } + + public function getPaymentSource() + { + return $this->paymentSource; + } + + public function setPaymentSource($paymentSource) + { + $this->paymentSource = $paymentSource; + } + + public function getCurrency() + { + return $this->currency; + } + + public function setCurrency($currency) + { + $this->currency = $currency; + } + + public function getBuyer() + { + return $this->buyer; + } + + public function setBuyer($buyer) + { + $this->buyer = $buyer; + } + + public function getShippingAddress() + { + return $this->shippingAddress; + } + + public function setShippingAddress($shippingAddress) + { + $this->shippingAddress = $shippingAddress; + } + + public function getBillingAddress() + { + return $this->billingAddress; + } + + public function setBillingAddress($billingAddress) + { + $this->billingAddress = $billingAddress; + } + + public function getBasketItems() + { + return $this->basketItems; + } + + public function setBasketItems($basketItems) + { + $this->basketItems = $basketItems; + } + + public function getCallbackUrl() + { + return $this->callbackUrl; + } + + public function setCallbackUrl($callbackUrl) + { + $this->callbackUrl = $callbackUrl; + } + + public function getForceThreeDS() + { + return $this->forceThreeDS; + } + + public function setForceThreeDS($forceThreeDS) + { + $this->forceThreeDS = $forceThreeDS; + } + + public function getCardUserKey() + { + return $this->cardUserKey; + } + + public function setCardUserKey($cardUserKey) + { + $this->cardUserKey = $cardUserKey; + } + + public function getPosOrderId() + { + return $this->posOrderId; + } + + public function setPosOrderId($posOrderId) + { + $this->posOrderId = $posOrderId; + } + + public function setEnabledInstallments($enabledInstallments) + { + $this->enabledInstallments = $enabledInstallments; + } + + public function getEnabledInstallments() + { + return $this->enabledInstallments; + } + + public function setDebitCardAllowed($debitCardAllowed) + { + $this->debitCardAllowed = $debitCardAllowed; + } + + public function getDebitCardAllowed() + { + return $this->debitCardAllowed; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->addPrice("price", $this->getPrice()) + ->add("basketId", $this->getBasketId()) + ->add("paymentGroup", $this->getPaymentGroup()) + ->add("buyer", $this->getBuyer()) + ->add("shippingAddress", $this->getShippingAddress()) + ->add("billingAddress", $this->getBillingAddress()) + ->addArray("basketItems", $this->getBasketItems()) + ->add("callbackUrl", $this->getCallbackUrl()) + ->add("paymentSource", $this->getPaymentSource()) + ->add("currency", $this->getCurrency()) + ->add("posOrderId", $this->getPosOrderId()) + ->addPrice("paidPrice", $this->getPaidPrice()) + ->add("forceThreeDS", $this->getForceThreeDS()) + ->add("cardUserKey", $this->getCardUserKey()) + ->addArray("enabledInstallments", $this->getEnabledInstallments()) + ->add("debitCardAllowed", $this->getDebitCardAllowed()) + ->getObject(); + } + + public function toPKIRequestString() + { + return RequestStringBuilder::create() + ->appendSuper(parent::toPKIRequestString()) + ->appendPrice("price", $this->getPrice()) + ->append("basketId", $this->getBasketId()) + ->append("paymentGroup", $this->getPaymentGroup()) + ->append("buyer", $this->getBuyer()) + ->append("shippingAddress", $this->getShippingAddress()) + ->append("billingAddress", $this->getBillingAddress()) + ->appendArray("basketItems", $this->getBasketItems()) + ->append("callbackUrl", $this->getCallbackUrl()) + ->append("paymentSource", $this->getPaymentSource()) + ->append("currency", $this->getCurrency()) + ->append("posOrderId", $this->getPosOrderId()) + ->appendPrice("paidPrice", $this->getPaidPrice()) + ->append("forceThreeDS", $this->getForceThreeDS()) + ->append("cardUserKey", $this->getCardUserKey()) + ->appendArray("enabledInstallments", $this->getEnabledInstallments()) + ->append("debitCardAllowed", $this->getDebitCardAllowed()) + ->getRequestString(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/CreateCrossBookingRequest.php b/iyzipay/src/Iyzipay/Request/CreateCrossBookingRequest.php new file mode 100644 index 0000000..da0dedb --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/CreateCrossBookingRequest.php @@ -0,0 +1,76 @@ +subMerchantKey; + } + + public function setSubMerchantKey($subMerchantKey) + { + $this->subMerchantKey = $subMerchantKey; + } + + public function getPrice() + { + return $this->price; + } + + public function setPrice($price) + { + $this->price = $price; + } + + public function getReason() + { + return $this->reason; + } + + public function setReason($reason) + { + $this->reason = $reason; + } + + public function getCurrency() + { + return $this->currency; + } + + public function setCurrency($currency) + { + $this->currency = $currency; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->add("subMerchantKey", $this->getSubMerchantKey()) + ->addPrice("price", $this->getPrice()) + ->add("reason", $this->getReason()) + ->add("currency", $this->getCurrency()) + ->getObject(); + } + + public function toPKIRequestString() + { + return RequestStringBuilder::create() + ->appendSuper(parent::toPKIRequestString()) + ->append("subMerchantKey", $this->getSubMerchantKey()) + ->appendPrice("price", $this->getPrice()) + ->append("reason", $this->getReason()) + ->append("currency", $this->getCurrency()) + ->getRequestString(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/CreateIyziupFormInitializeRequest.php b/iyzipay/src/Iyzipay/Request/CreateIyziupFormInitializeRequest.php new file mode 100644 index 0000000..ea1da04 --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/CreateIyziupFormInitializeRequest.php @@ -0,0 +1,219 @@ +price; + } + + public function setPrice($price) + { + $this->price = $price; + } + + public function getPaidPrice() + { + return $this->paidPrice; + } + + public function setPaidPrice($paidPrice) + { + $this->paidPrice = $paidPrice; + } + + public function getShippingPrice() + { + return $this->shippingPrice; + } + + public function setShippingPrice($shippingPrice) + { + $this->shippingPrice = $shippingPrice; + } + + public function getPaymentGroup() + { + return $this->paymentGroup; + } + + public function setPaymentGroup($paymentGroup) + { + $this->paymentGroup = $paymentGroup; + } + + public function getPaymentSource() + { + return $this->paymentSource; + } + + public function setPaymentSource($paymentSource) + { + $this->paymentSource = $paymentSource; + } + + public function getCurrency() + { + return $this->currency; + } + + public function setCurrency($currency) + { + $this->currency = $currency; + } + + public function getOrderItems() + { + return $this->orderItems; + } + + public function setOrderItems($orderItems) + { + $this->orderItems = $orderItems; + } + + public function getCallbackUrl() + { + return $this->callbackUrl; + } + + public function setCallbackUrl($callbackUrl) + { + $this->callbackUrl = $callbackUrl; + } + + public function getTermsUrl() + { + return $this->termsUrl; + } + + public function setTermsUrl($termsUrl) + { + $this->termsUrl = $termsUrl; + } + + public function getPreSalesContractUrl() + { + return $this->preSalesContractUrl; + } + + public function setPreSalesContractUrl($preSalesContractUrl) + { + $this->preSalesContractUrl = $preSalesContractUrl; + } + + public function getForceThreeDS() + { + return $this->forceThreeDS; + } + + public function setForceThreeDS($forceThreeDS) + { + $this->forceThreeDS = $forceThreeDS; + } + + public function getMerchantOrderId() + { + return $this->merchantOrderId; + } + + public function setMerchantOrderId($merchantOrderId) + { + $this->merchantOrderId = $merchantOrderId; + } + + public function setEnabledInstallments($enabledInstallments) + { + $this->enabledInstallments = $enabledInstallments; + } + + public function getEnabledInstallments() + { + return $this->enabledInstallments; + } + + public function getEnabledCardFamily() + { + return $this->enabledCardFamily; + } + + public function setEnabledCardFamily($enabledCardFamily) + { + $this->enabledCardFamily = $enabledCardFamily; + } + + public function getInitialConsumer() + { + return $this->initialConsumer; + } + + public function setInitialConsumer($initialConsumer) + { + $this->initialConsumer = $initialConsumer; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->add("merchantOrderId", $this->getMerchantOrderId()) + ->add("paymentGroup", $this->getPaymentGroup()) + ->add("paymentSource", $this->getPaymentSource()) + ->add("forceThreeDS", $this->getForceThreeDS()) + ->addArray("enabledInstallments", $this->getEnabledInstallments()) + ->add("enabledCardFamily", $this->getEnabledCardFamily()) + ->add("currency", $this->getCurrency()) + ->addPrice("price", $this->getPrice()) + ->addPrice("paidPrice", $this->getPaidPrice()) + ->addPrice("shippingPrice", $this->getShippingPrice()) + ->add("callbackUrl", $this->getCallbackUrl()) + ->add("termsUrl", $this->getTermsUrl()) + ->add("preSalesContractUrl", $this->getPreSalesContractUrl()) + ->addArray("orderItems", $this->getOrderItems()) + ->add("initialConsumer", $this->getInitialConsumer()) + ->getObject(); + } + + public function toPKIRequestString() + { + return RequestStringBuilder::create() + ->appendSuper(parent::toPKIRequestString()) + ->append("merchantOrderId", $this->getMerchantOrderId()) + ->append("paymentGroup", $this->getPaymentGroup()) + ->append("paymentSource", $this->getPaymentSource()) + ->append("forceThreeDS", $this->getForceThreeDS()) + ->appendArray("enabledInstallments", $this->getEnabledInstallments()) + ->append("enabledCardFamily", $this->getEnabledCardFamily()) + ->append("currency", $this->getCurrency()) + ->appendPrice("price", $this->getPrice()) + ->appendPrice("paidPrice", $this->getPaidPrice()) + ->appendPrice("shippingPrice", $this->getShippingPrice()) + ->append("callbackUrl", $this->getCallbackUrl()) + ->append("termsUrl", $this->getTermsUrl()) + ->append("preSalesContractUrl", $this->getPreSalesContractUrl()) + ->appendArray("orderItems", $this->getOrderItems()) + ->append("initialConsumer", $this->getInitialConsumer()) + ->getRequestString(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/CreatePayWithIyzicoInitializeRequest.php b/iyzipay/src/Iyzipay/Request/CreatePayWithIyzicoInitializeRequest.php new file mode 100755 index 0000000..58b4651 --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/CreatePayWithIyzicoInitializeRequest.php @@ -0,0 +1,195 @@ +price; + } + + public function setPrice($price) + { + $this->price = $price; + } + + public function getPaidPrice() + { + return $this->paidPrice; + } + + public function setPaidPrice($paidPrice) + { + $this->paidPrice = $paidPrice; + } + + public function getBasketId() + { + return $this->basketId; + } + + public function setBasketId($basketId) + { + $this->basketId = $basketId; + } + + public function getPaymentGroup() + { + return $this->paymentGroup; + } + + public function setPaymentGroup($paymentGroup) + { + $this->paymentGroup = $paymentGroup; + } + + public function getPaymentSource() + { + return $this->paymentSource; + } + + public function setPaymentSource($paymentSource) + { + $this->paymentSource = $paymentSource; + } + + public function getCurrency() + { + return $this->currency; + } + + public function setCurrency($currency) + { + $this->currency = $currency; + } + + public function getBuyer() + { + return $this->buyer; + } + + public function setBuyer($buyer) + { + $this->buyer = $buyer; + } + + public function getShippingAddress() + { + return $this->shippingAddress; + } + + public function setShippingAddress($shippingAddress) + { + $this->shippingAddress = $shippingAddress; + } + + public function getBillingAddress() + { + return $this->billingAddress; + } + + public function setBillingAddress($billingAddress) + { + $this->billingAddress = $billingAddress; + } + + public function getBasketItems() + { + return $this->basketItems; + } + + public function setBasketItems($basketItems) + { + $this->basketItems = $basketItems; + } + + public function getCallbackUrl() + { + return $this->callbackUrl; + } + + public function setCallbackUrl($callbackUrl) + { + $this->callbackUrl = $callbackUrl; + } + + public function getPosOrderId() + { + return $this->posOrderId; + } + + public function setPosOrderId($posOrderId) + { + $this->posOrderId = $posOrderId; + } + + public function setEnabledInstallments($enabledInstallments) + { + $this->enabledInstallments = $enabledInstallments; + } + + public function getEnabledInstallments() + { + return $this->enabledInstallments; + } + + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->addPrice("price", $this->getPrice()) + ->add("basketId", $this->getBasketId()) + ->add("paymentGroup", $this->getPaymentGroup()) + ->add("buyer", $this->getBuyer()) + ->add("shippingAddress", $this->getShippingAddress()) + ->add("billingAddress", $this->getBillingAddress()) + ->addArray("basketItems", $this->getBasketItems()) + ->add("callbackUrl", $this->getCallbackUrl()) + ->add("paymentSource", $this->getPaymentSource()) + ->add("currency", $this->getCurrency()) + ->add("posOrderId", $this->getPosOrderId()) + ->addPrice("paidPrice", $this->getPaidPrice()) + ->addArray("enabledInstallments", $this->getEnabledInstallments()) + ->getObject(); + } + + public function toPKIRequestString() + { + return RequestStringBuilder::create() + ->appendSuper(parent::toPKIRequestString()) + ->appendPrice("price", $this->getPrice()) + ->append("basketId", $this->getBasketId()) + ->append("paymentGroup", $this->getPaymentGroup()) + ->append("buyer", $this->getBuyer()) + ->append("shippingAddress", $this->getShippingAddress()) + ->append("billingAddress", $this->getBillingAddress()) + ->appendArray("basketItems", $this->getBasketItems()) + ->append("callbackUrl", $this->getCallbackUrl()) + ->append("paymentSource", $this->getPaymentSource()) + ->append("currency", $this->getCurrency()) + ->append("posOrderId", $this->getPosOrderId()) + ->appendPrice("paidPrice", $this->getPaidPrice()) + ->appendArray("enabledInstallments", $this->getEnabledInstallments()) + ->getRequestString(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/CreatePaymentPostAuthRequest.php b/iyzipay/src/Iyzipay/Request/CreatePaymentPostAuthRequest.php new file mode 100644 index 0000000..4f7405a --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/CreatePaymentPostAuthRequest.php @@ -0,0 +1,76 @@ +paymentId; + } + + public function setPaymentId($paymentId) + { + $this->paymentId = $paymentId; + } + + public function getPaidPrice() + { + return $this->paidPrice; + } + + public function setPaidPrice($paidPrice) + { + $this->paidPrice = $paidPrice; + } + + public function getIp() + { + return $this->ip; + } + + public function setIp($ip) + { + $this->ip = $ip; + } + + public function getCurrency() + { + return $this->currency; + } + + public function setCurrency($currency) + { + $this->currency = $currency; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->add("paymentId", $this->getPaymentId()) + ->add("ip", $this->getIp()) + ->addPrice("paidPrice", $this->getPaidPrice()) + ->add("currency", $this->getCurrency()) + ->getObject(); + } + + public function toPKIRequestString() + { + return RequestStringBuilder::create() + ->appendSuper(parent::toPKIRequestString()) + ->append("paymentId", $this->getPaymentId()) + ->append("ip", $this->getIp()) + ->appendPrice("paidPrice", $this->getPaidPrice()) + ->append("currency", $this->getCurrency()) + ->getRequestString(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/CreatePaymentRequest.php b/iyzipay/src/Iyzipay/Request/CreatePaymentRequest.php new file mode 100644 index 0000000..2cc9649 --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/CreatePaymentRequest.php @@ -0,0 +1,238 @@ +setInstallment(Constants::SINGLE_INSTALLMENT); + } + + public function getPrice() + { + return $this->price; + } + + public function setPrice($price) + { + $this->price = $price; + } + + public function getPaidPrice() + { + return $this->paidPrice; + } + + public function setPaidPrice($paidPrice) + { + $this->paidPrice = $paidPrice; + } + + public function getInstallment() + { + return $this->installment; + } + + public function setInstallment($installment) + { + $this->installment = $installment; + } + + public function getPaymentChannel() + { + return $this->paymentChannel; + } + + public function setPaymentChannel($paymentChannel) + { + $this->paymentChannel = $paymentChannel; + } + + public function getBasketId() + { + return $this->basketId; + } + + public function setBasketId($basketId) + { + $this->basketId = $basketId; + } + + public function getPaymentGroup() + { + return $this->paymentGroup; + } + + public function setPaymentGroup($paymentGroup) + { + $this->paymentGroup = $paymentGroup; + } + + public function getPaymentCard() + { + return $this->paymentCard; + } + + public function setPaymentCard($paymentCard) + { + $this->paymentCard = $paymentCard; + } + + public function getBuyer() + { + return $this->buyer; + } + + public function setBuyer($buyer) + { + $this->buyer = $buyer; + } + + public function getShippingAddress() + { + return $this->shippingAddress; + } + + public function setShippingAddress($shippingAddress) + { + $this->shippingAddress = $shippingAddress; + } + + public function getBillingAddress() + { + return $this->billingAddress; + } + + public function setBillingAddress($billingAddress) + { + $this->billingAddress = $billingAddress; + } + + public function getBasketItems() + { + return $this->basketItems; + } + + public function setBasketItems($basketItems) + { + $this->basketItems = $basketItems; + } + + public function getPaymentSource() + { + return $this->paymentSource; + } + + public function setPaymentSource($paymentSource) + { + $this->paymentSource = $paymentSource; + } + + public function getCurrency() + { + return $this->currency; + } + + public function setCurrency($currency) + { + $this->currency = $currency; + } + + public function getPosOrderId() + { + return $this->posOrderId; + } + + public function setPosOrderId($posOrderId) + { + $this->posOrderId = $posOrderId; + } + + public function getConnectorName() + { + return $this->connectorName; + } + + public function setConnectorName($connectorName) + { + $this->connectorName = $connectorName; + } + + public function getCallbackUrl() + { + return $this->callbackUrl; + } + + public function setCallbackUrl($callbackUrl) + { + $this->callbackUrl = $callbackUrl; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->addPrice("price", $this->getPrice()) + ->addPrice("paidPrice", $this->getPaidPrice()) + ->add("installment", $this->getInstallment()) + ->add("paymentChannel", $this->getPaymentChannel()) + ->add("basketId", $this->getBasketId()) + ->add("paymentGroup", $this->getPaymentGroup()) + ->add("paymentCard", $this->getPaymentCard()) + ->add("buyer", $this->getBuyer()) + ->add("shippingAddress", $this->getShippingAddress()) + ->add("billingAddress", $this->getBillingAddress()) + ->addArray("basketItems", $this->getBasketItems()) + ->add("paymentSource", $this->getPaymentSource()) + ->add("currency", $this->getCurrency()) + ->add("posOrderId", $this->getPosOrderId()) + ->add("connectorName", $this->getConnectorName()) + ->add("callbackUrl", $this->getCallbackUrl()) + ->getObject(); + } + + public function toPKIRequestString() + { + return RequestStringBuilder::create() + ->appendSuper(parent::toPKIRequestString()) + ->appendPrice("price", $this->getPrice()) + ->appendPrice("paidPrice", $this->getPaidPrice()) + ->append("installment", $this->getInstallment()) + ->append("paymentChannel", $this->getPaymentChannel()) + ->append("basketId", $this->getBasketId()) + ->append("paymentGroup", $this->getPaymentGroup()) + ->append("paymentCard", $this->getPaymentCard()) + ->append("buyer", $this->getBuyer()) + ->append("shippingAddress", $this->getShippingAddress()) + ->append("billingAddress", $this->getBillingAddress()) + ->appendArray("basketItems", $this->getBasketItems()) + ->append("paymentSource", $this->getPaymentSource()) + ->append("currency", $this->getCurrency()) + ->append("posOrderId", $this->getPosOrderId()) + ->append("connectorName", $this->getConnectorName()) + ->append("callbackUrl", $this->getCallbackUrl()) + ->getRequestString(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/CreatePeccoInitializeRequest.php b/iyzipay/src/Iyzipay/Request/CreatePeccoInitializeRequest.php new file mode 100644 index 0000000..581dd6c --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/CreatePeccoInitializeRequest.php @@ -0,0 +1,167 @@ +price; + } + + public function setPrice($price) + { + $this->price = $price; + } + + public function getPaidPrice() + { + return $this->paidPrice; + } + + public function setPaidPrice($paidPrice) + { + $this->paidPrice = $paidPrice; + } + + public function getBasketId() + { + return $this->basketId; + } + + public function setBasketId($basketId) + { + $this->basketId = $basketId; + } + + public function getPaymentGroup() + { + return $this->paymentGroup; + } + + public function setPaymentGroup($paymentGroup) + { + $this->paymentGroup = $paymentGroup; + } + + public function getPaymentSource() + { + return $this->paymentSource; + } + + public function setPaymentSource($paymentSource) + { + $this->paymentSource = $paymentSource; + } + + public function getCurrency() + { + return $this->currency; + } + + public function setCurrency($currency) + { + $this->currency = $currency; + } + + public function getBuyer() + { + return $this->buyer; + } + + public function setBuyer($buyer) + { + $this->buyer = $buyer; + } + + public function getShippingAddress() + { + return $this->shippingAddress; + } + + public function setShippingAddress($shippingAddress) + { + $this->shippingAddress = $shippingAddress; + } + + public function getBillingAddress() + { + return $this->billingAddress; + } + + public function setBillingAddress($billingAddress) + { + $this->billingAddress = $billingAddress; + } + + public function getBasketItems() + { + return $this->basketItems; + } + + public function setBasketItems($basketItems) + { + $this->basketItems = $basketItems; + } + + public function getCallbackUrl() + { + return $this->callbackUrl; + } + + public function setCallbackUrl($callbackUrl) + { + $this->callbackUrl = $callbackUrl; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->addPrice("price", $this->getPrice()) + ->add("basketId", $this->getBasketId()) + ->add("paymentGroup", $this->getPaymentGroup()) + ->add("buyer", $this->getBuyer()) + ->add("shippingAddress", $this->getShippingAddress()) + ->add("billingAddress", $this->getBillingAddress()) + ->addArray("basketItems", $this->getBasketItems()) + ->add("callbackUrl", $this->getCallbackUrl()) + ->add("paymentSource", $this->getPaymentSource()) + ->add("currency", $this->getCurrency()) + ->addPrice("paidPrice", $this->getPaidPrice()) + ->getObject(); + } + + public function toPKIRequestString() + { + return RequestStringBuilder::create() + ->appendSuper(parent::toPKIRequestString()) + ->appendPrice("price", $this->getPrice()) + ->append("basketId", $this->getBasketId()) + ->append("paymentGroup", $this->getPaymentGroup()) + ->append("buyer", $this->getBuyer()) + ->append("shippingAddress", $this->getShippingAddress()) + ->append("billingAddress", $this->getBillingAddress()) + ->appendArray("basketItems", $this->getBasketItems()) + ->append("callbackUrl", $this->getCallbackUrl()) + ->append("paymentSource", $this->getPaymentSource()) + ->append("currency", $this->getCurrency()) + ->appendPrice("paidPrice", $this->getPaidPrice()) + ->getRequestString(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/CreatePeccoPaymentRequest.php b/iyzipay/src/Iyzipay/Request/CreatePeccoPaymentRequest.php new file mode 100644 index 0000000..06c5429 --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/CreatePeccoPaymentRequest.php @@ -0,0 +1,37 @@ +token; + } + + public function setToken($token) + { + $this->token = $token; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->add("token", $this->getToken()) + ->getObject(); + } + + public function toPKIRequestString() + { + return RequestStringBuilder::create() + ->appendSuper(parent::toPKIRequestString()) + ->append("token", $this->getToken()) + ->getRequestString(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/CreateRefundRequest.php b/iyzipay/src/Iyzipay/Request/CreateRefundRequest.php new file mode 100644 index 0000000..bac95a5 --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/CreateRefundRequest.php @@ -0,0 +1,102 @@ +paymentTransactionId; + } + + public function setPaymentTransactionId($paymentTransactionId) + { + $this->paymentTransactionId = $paymentTransactionId; + } + + public function getPrice() + { + return $this->price; + } + + public function setPrice($price) + { + $this->price = $price; + } + + public function getIp() + { + return $this->ip; + } + + public function setIp($ip) + { + $this->ip = $ip; + } + + public function getCurrency() + { + return $this->currency; + } + + public function setCurrency($currency) + { + $this->currency = $currency; + } + + public function getReason() + { + return $this->reason; + } + + public function setReason($reason) + { + $this->reason = $reason; + } + + public function getDescription() + { + return $this->description; + } + + public function setDescription($description) + { + $this->description = $description; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->add("paymentTransactionId", $this->getPaymentTransactionId()) + ->addPrice("price", $this->getPrice()) + ->add("ip", $this->getIp()) + ->add("currency", $this->getCurrency()) + ->add("reason", $this->getReason()) + ->add("description", $this->getDescription()) + ->getObject(); + } + + public function toPKIRequestString() + { + return RequestStringBuilder::create() + ->appendSuper(parent::toPKIRequestString()) + ->append("paymentTransactionId", $this->getPaymentTransactionId()) + ->appendPrice("price", $this->getPrice()) + ->append("ip", $this->getIp()) + ->append("currency", $this->getCurrency()) + ->append("reason", $this->getReason()) + ->append("description", $this->getDescription()) + ->getRequestString(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/CreateRefundToBalanceRequest.php b/iyzipay/src/Iyzipay/Request/CreateRefundToBalanceRequest.php new file mode 100644 index 0000000..5de8eb2 --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/CreateRefundToBalanceRequest.php @@ -0,0 +1,50 @@ +paymentId; + } + + public function setPaymentId($paymentId) + { + $this->paymentId = $paymentId; + } + + public function getCallbackUrl() + { + return $this->callbackUrl; + } + + public function setCallbackUrl($callbackUrl) + { + $this->callbackUrl = $callbackUrl; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->add("paymentId", $this->getPaymentId()) + ->add("callbackUrl", $this->getCallbackUrl()) + ->getObject(); + } + + public function toPKIRequestString() + { + return RequestStringBuilder::create() + ->appendSuper(parent::toPKIRequestString()) + ->append("paymentId", $this->getPaymentId()) + ->append("callbackUrl", $this->getCallbackUrl()) + ->getRequestString(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/CreateSettlementToBalanceRequest.php b/iyzipay/src/Iyzipay/Request/CreateSettlementToBalanceRequest.php new file mode 100644 index 0000000..1b6f766 --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/CreateSettlementToBalanceRequest.php @@ -0,0 +1,63 @@ +subMerchantKey; + } + + public function setSubMerchantKey($subMerchantKey) + { + $this->subMerchantKey = $subMerchantKey; + } + + public function getCallbackUrl() + { + return $this->callbackUrl; + } + + public function setCallbackUrl($callbackUrl) + { + $this->callbackUrl = $callbackUrl; + } + + public function getPrice() + { + return $this->price; + } + + public function setPrice($price) + { + $this->price = $price; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->add("subMerchantKey", $this->getSubMerchantKey()) + ->add("callbackUrl", $this->getCallbackUrl()) + ->addPrice("price", $this->getPrice()) + ->getObject(); + } + + public function toPKIRequestString() + { + return RequestStringBuilder::create() + ->appendSuper(parent::toPKIRequestString()) + ->append("subMerchantKey", $this->getSubMerchantKey()) + ->append("callbackUrl", $this->getCallbackUrl()) + ->appendPrice("price", $this->getPrice()) + ->getRequestString(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/CreateSubMerchantRequest.php b/iyzipay/src/Iyzipay/Request/CreateSubMerchantRequest.php new file mode 100644 index 0000000..73e80d3 --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/CreateSubMerchantRequest.php @@ -0,0 +1,219 @@ +name; + } + + public function setName($name) + { + $this->name = $name; + } + + public function getEmail() + { + return $this->email; + } + + public function setEmail($email) + { + $this->email = $email; + } + + public function getGsmNumber() + { + return $this->gsmNumber; + } + + public function setGsmNumber($gsmNumber) + { + $this->gsmNumber = $gsmNumber; + } + + public function getAddress() + { + return $this->address; + } + + public function setAddress($address) + { + $this->address = $address; + } + + public function getIban() + { + return $this->iban; + } + + public function setIban($iban) + { + $this->iban = $iban; + } + + public function getTaxOffice() + { + return $this->taxOffice; + } + + public function setTaxOffice($taxOffice) + { + $this->taxOffice = $taxOffice; + } + + public function getContactName() + { + return $this->contactName; + } + + public function setContactName($contactName) + { + $this->contactName = $contactName; + } + + public function getContactSurname() + { + return $this->contactSurname; + } + + public function setContactSurname($contactSurname) + { + $this->contactSurname = $contactSurname; + } + + public function getLegalCompanyTitle() + { + return $this->legalCompanyTitle; + } + + public function setLegalCompanyTitle($legalCompanyTitle) + { + $this->legalCompanyTitle = $legalCompanyTitle; + } + + public function getSwiftCode() + { + return $this->swiftCode; + } + + public function setSwiftCode($swiftCode) + { + $this->swiftCode = $swiftCode; + } + + public function getCurrency() + { + return $this->currency; + } + + public function setCurrency($currency) + { + $this->currency = $currency; + } + + public function getIdentityNumber() + { + return $this->identityNumber; + } + + public function setIdentityNumber($identityNumber) + { + $this->identityNumber = $identityNumber; + } + + public function getTaxNumber() + { + return $this->taxNumber; + } + + public function setTaxNumber($taxNumber) + { + $this->taxNumber = $taxNumber; + } + + public function getSubMerchantExternalId() + { + return $this->subMerchantExternalId; + } + + public function setSubMerchantExternalId($subMerchantExternalId) + { + $this->subMerchantExternalId = $subMerchantExternalId; + } + + public function getSubMerchantType() + { + return $this->subMerchantType; + } + + public function setSubMerchantType($subMerchantType) + { + $this->subMerchantType = $subMerchantType; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->add("name", $this->getName()) + ->add("email", $this->getEmail()) + ->add("gsmNumber", $this->getGsmNumber()) + ->add("address", $this->getAddress()) + ->add("iban", $this->getIban()) + ->add("taxOffice", $this->getTaxOffice()) + ->add("contactName", $this->getContactName()) + ->add("contactSurname", $this->getContactSurname()) + ->add("legalCompanyTitle", $this->getLegalCompanyTitle()) + ->add("swiftCode", $this->getSwiftCode()) + ->add("currency", $this->getCurrency()) + ->add("subMerchantExternalId", $this->getSubMerchantExternalId()) + ->add("identityNumber", $this->getIdentityNumber()) + ->add("taxNumber", $this->getTaxNumber()) + ->add("subMerchantType", $this->getSubMerchantType()) + ->getObject(); + } + + public function toPKIRequestString() + { + return RequestStringBuilder::create() + ->appendSuper(parent::toPKIRequestString()) + ->append("name", $this->getName()) + ->append("email", $this->getEmail()) + ->append("gsmNumber", $this->getGsmNumber()) + ->append("address", $this->getAddress()) + ->append("iban", $this->getIban()) + ->append("taxOffice", $this->getTaxOffice()) + ->append("contactName", $this->getContactName()) + ->append("contactSurname", $this->getContactSurname()) + ->append("legalCompanyTitle", $this->getLegalCompanyTitle()) + ->append("swiftCode", $this->getSwiftCode()) + ->append("currency", $this->getCurrency()) + ->append("subMerchantExternalId", $this->getSubMerchantExternalId()) + ->append("identityNumber", $this->getIdentityNumber()) + ->append("taxNumber", $this->getTaxNumber()) + ->append("subMerchantType", $this->getSubMerchantType()) + ->getRequestString(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/CreateThreedsPaymentRequest.php b/iyzipay/src/Iyzipay/Request/CreateThreedsPaymentRequest.php new file mode 100644 index 0000000..4e920de --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/CreateThreedsPaymentRequest.php @@ -0,0 +1,50 @@ +paymentId; + } + + public function setPaymentId($paymentId) + { + $this->paymentId = $paymentId; + } + + public function getConversationData() + { + return $this->conversationData; + } + + public function setConversationData($conversationData) + { + $this->conversationData = $conversationData; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->add("paymentId", $this->getPaymentId()) + ->add("conversationData", $this->getConversationData()) + ->getObject(); + } + + public function toPKIRequestString() + { + return RequestStringBuilder::create() + ->appendSuper(parent::toPKIRequestString()) + ->append("paymentId", $this->getPaymentId()) + ->append("conversationData", $this->getConversationData()) + ->getRequestString(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/DeleteCardRequest.php b/iyzipay/src/Iyzipay/Request/DeleteCardRequest.php new file mode 100644 index 0000000..8dabd73 --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/DeleteCardRequest.php @@ -0,0 +1,50 @@ +cardUserKey; + } + + public function setCardUserKey($cardUserKey) + { + $this->cardUserKey = $cardUserKey; + } + + public function getCardToken() + { + return $this->cardToken; + } + + public function setCardToken($cardToken) + { + $this->cardToken = $cardToken; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->add("cardUserKey", $this->getCardUserKey()) + ->add("cardToken", $this->getCardToken()) + ->getObject(); + } + + public function toPKIRequestString() + { + return RequestStringBuilder::create() + ->appendSuper(parent::toPKIRequestString()) + ->append("cardUserKey", $this->getCardUserKey()) + ->append("cardToken", $this->getCardToken()) + ->getRequestString(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/Iyzilink/IyziLinkSaveProductRequest.php b/iyzipay/src/Iyzipay/Request/Iyzilink/IyziLinkSaveProductRequest.php new file mode 100644 index 0000000..8c824ed --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/Iyzilink/IyziLinkSaveProductRequest.php @@ -0,0 +1,148 @@ +name; + } + + public function setName($name) + { + $this->name = $name; + } + + public function getDescription() + { + return $this->description; + } + + public function setDescription($description) + { + $this->description = $description; + } + + public function getBase64EncodedImage() + { + return $this->base64EncodedImage; + } + + public function setBase64EncodedImage($base64EncodedImage) + { + $this->base64EncodedImage = $base64EncodedImage; + } + + public function getPrice() + { + return $this->price; + } + + public function setPrice($price) + { + $this->price = $price; + } + + public function getCurrency() + { + return $this->currency; + } + + public function setCurrency($currency) + { + $this->currency = $currency; + } + + public function getAddressIgnorable() + { + return $this->addressIgnorable; + } + + public function setAddressIgnorable($addressIgnorable) + { + $this->addressIgnorable = $addressIgnorable; + } + + public function getSoldLimit() + { + return $this->soldLimit; + } + + public function setSoldLimit($soldLimit) + { + $this->soldLimit = $soldLimit; + } + + public function getInstallmentRequested() + { + return $this->installmentRequested; + } + + public function setInstallmentRequest($installmentRequested) + { + $this->installmentRequested = $installmentRequested; + } + + public function getToken() + { + return $this->token; + } + + public function setToken($token) + { + $this->token = $token; + } + + public function getUrl() + { + return $this->url; + } + + public function setUrl($url) + { + $this->url = $url; + } + + public function getImageUrl() + { + return $this->imageUrl; + } + + public function setImageUrl($imageUrl) + { + $this->imageUrl = $imageUrl; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->addPrice("price", $this->getPrice()) + ->add("name", $this->getName()) + ->add("description", $this->getDescription()) + ->add("encodedImageFile", $this->getBase64EncodedImage()) + ->add("currencyCode", $this->getCurrency()) + ->add("addressIgnorable", $this->getAddressIgnorable()) + ->add("soldLimit", $this->getSoldLimit()) + ->add("installmentRequested", $this->getInstallmentRequested()) + ->add("token", $this->getToken()) + ->add("url", $this->getUrl()) + ->add("imageUrl", $this->getImageUrl()) + ->getObject(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/PagininRequest.php b/iyzipay/src/Iyzipay/Request/PagininRequest.php new file mode 100644 index 0000000..67d8647 --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/PagininRequest.php @@ -0,0 +1,41 @@ +page; + } + + public function setPage($page) + { + $this->page = $page; + } + + public function getCount() + { + return $this->count; + } + + public function setCount($count) + { + $this->count = $count; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->add("page", $this->getPage()) + ->add("count", $this->getCount()) + ->getObject(); + } +} diff --git a/iyzipay/src/Iyzipay/Request/ReportingPaymentDetailRequest.php b/iyzipay/src/Iyzipay/Request/ReportingPaymentDetailRequest.php new file mode 100644 index 0000000..2c238d0 --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/ReportingPaymentDetailRequest.php @@ -0,0 +1,28 @@ +paymentConversationId; + } + + public function setPaymentConversationId($paymentConversationId) + { + $this->paymentConversationId = $paymentConversationId; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->add("paymentConversationId", $this->getPaymentConversationId()) + ->getObject(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/ReportingPaymentTransactionRequest.php b/iyzipay/src/Iyzipay/Request/ReportingPaymentTransactionRequest.php new file mode 100644 index 0000000..8bcceb1 --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/ReportingPaymentTransactionRequest.php @@ -0,0 +1,40 @@ +transactionDate; + } + + public function setTransactionDate($transactionDate) + { + $this->transactionDate = $transactionDate; + } + + public function getPage() + { + return $this->page; + } + + public function setPage($page) + { + $this->page = $page; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->add("transactionDate", $this->getTransactionDate()) + ->add("page", $this->getPage()) + ->getObject(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/RetrieveApmRequest.php b/iyzipay/src/Iyzipay/Request/RetrieveApmRequest.php new file mode 100644 index 0000000..e731bdc --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/RetrieveApmRequest.php @@ -0,0 +1,37 @@ +paymentId; + } + + public function setPaymentId($paymentId) + { + $this->paymentId = $paymentId; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->add("paymentId", $this->getPaymentId()) + ->getObject(); + } + + public function toPKIRequestString() + { + return RequestStringBuilder::create() + ->appendSuper(parent::toPKIRequestString()) + ->append("paymentId", $this->getPaymentId()) + ->getRequestString(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/RetrieveBinNumberRequest.php b/iyzipay/src/Iyzipay/Request/RetrieveBinNumberRequest.php new file mode 100644 index 0000000..b3db568 --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/RetrieveBinNumberRequest.php @@ -0,0 +1,37 @@ +binNumber; + } + + public function setBinNumber($binNumber) + { + $this->binNumber = $binNumber; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->add("binNumber", $this->getBinNumber()) + ->getObject(); + } + + public function toPKIRequestString() + { + return RequestStringBuilder::create() + ->appendSuper(parent::toPKIRequestString()) + ->append("binNumber", $this->getBinNumber()) + ->getRequestString(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/RetrieveBkmRequest.php b/iyzipay/src/Iyzipay/Request/RetrieveBkmRequest.php new file mode 100644 index 0000000..94c1b8c --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/RetrieveBkmRequest.php @@ -0,0 +1,37 @@ +token; + } + + public function setToken($token) + { + $this->token = $token; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->add("token", $this->getToken()) + ->getObject(); + } + + public function toPKIRequestString() + { + return RequestStringBuilder::create() + ->appendSuper(parent::toPKIRequestString()) + ->append("token", $this->getToken()) + ->getRequestString(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/RetrieveCardListRequest.php b/iyzipay/src/Iyzipay/Request/RetrieveCardListRequest.php new file mode 100644 index 0000000..d1fc231 --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/RetrieveCardListRequest.php @@ -0,0 +1,37 @@ +cardUserKey; + } + + public function setCardUserKey($cardUserKey) + { + $this->cardUserKey = $cardUserKey; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->add("cardUserKey", $this->getCardUserKey()) + ->getObject(); + } + + public function toPKIRequestString() + { + return RequestStringBuilder::create() + ->appendSuper(parent::toPKIRequestString()) + ->append("cardUserKey", $this->getCardUserKey()) + ->getRequestString(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/RetrieveCheckoutFormRequest.php b/iyzipay/src/Iyzipay/Request/RetrieveCheckoutFormRequest.php new file mode 100644 index 0000000..d62681f --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/RetrieveCheckoutFormRequest.php @@ -0,0 +1,37 @@ +token; + } + + public function setToken($token) + { + $this->token = $token; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->add("token", $this->getToken()) + ->getObject(); + } + + public function toPKIRequestString() + { + return RequestStringBuilder::create() + ->appendSuper(parent::toPKIRequestString()) + ->append("token", $this->getToken()) + ->getRequestString(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/RetrieveInstallmentInfoRequest.php b/iyzipay/src/Iyzipay/Request/RetrieveInstallmentInfoRequest.php new file mode 100644 index 0000000..6991c52 --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/RetrieveInstallmentInfoRequest.php @@ -0,0 +1,63 @@ +binNumber; + } + + public function setBinNumber($binNumber) + { + $this->binNumber = $binNumber; + } + + public function getPrice() + { + return $this->price; + } + + public function setPrice($price) + { + $this->price = $price; + } + + public function getCurrency() + { + return $this->currency; + } + + public function setCurrency($currency) + { + $this->currency = $currency; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->add("binNumber", $this->getBinNumber()) + ->addPrice("price", $this->getPrice()) + ->add("currency", $this->getCurrency()) + ->getObject(); + } + + public function toPKIRequestString() + { + return RequestStringBuilder::create() + ->appendSuper(parent::toPKIRequestString()) + ->append("binNumber", $this->getBinNumber()) + ->appendPrice("price", $this->getPrice()) + ->append("currency", $this->getCurrency()) + ->getRequestString(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/RetrieveIyziupFormRequest.php b/iyzipay/src/Iyzipay/Request/RetrieveIyziupFormRequest.php new file mode 100644 index 0000000..05c4f70 --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/RetrieveIyziupFormRequest.php @@ -0,0 +1,37 @@ +token; + } + + public function setToken($token) + { + $this->token = $token; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->add("token", $this->getToken()) + ->getObject(); + } + + public function toPKIRequestString() + { + return RequestStringBuilder::create() + ->appendSuper(parent::toPKIRequestString()) + ->append("token", $this->getToken()) + ->getRequestString(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/RetrievePayWithIyzicoRequest.php b/iyzipay/src/Iyzipay/Request/RetrievePayWithIyzicoRequest.php new file mode 100755 index 0000000..17f95a5 --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/RetrievePayWithIyzicoRequest.php @@ -0,0 +1,37 @@ +token; + } + + public function setToken($token) + { + $this->token = $token; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->add("token", $this->getToken()) + ->getObject(); + } + + public function toPKIRequestString() + { + return RequestStringBuilder::create() + ->appendSuper(parent::toPKIRequestString()) + ->append("token", $this->getToken()) + ->getRequestString(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/RetrievePaymentRequest.php b/iyzipay/src/Iyzipay/Request/RetrievePaymentRequest.php new file mode 100644 index 0000000..e5982fd --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/RetrievePaymentRequest.php @@ -0,0 +1,50 @@ +paymentId; + } + + public function setPaymentId($paymentId) + { + $this->paymentId = $paymentId; + } + + public function getPaymentConversationId() + { + return $this->paymentConversationId; + } + + public function setPaymentConversationId($paymentConversationId) + { + $this->paymentConversationId = $paymentConversationId; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->add("paymentId", $this->getPaymentId()) + ->add("paymentConversationId", $this->getPaymentConversationId()) + ->getObject(); + } + + public function toPKIRequestString() + { + return RequestStringBuilder::create() + ->appendSuper(parent::toPKIRequestString()) + ->append("paymentId", $this->getPaymentId()) + ->append("paymentConversationId", $this->getPaymentConversationId()) + ->getRequestString(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/RetrieveProtectedOverleyScriptRequest.php b/iyzipay/src/Iyzipay/Request/RetrieveProtectedOverleyScriptRequest.php new file mode 100644 index 0000000..92f8460 --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/RetrieveProtectedOverleyScriptRequest.php @@ -0,0 +1,37 @@ +position; + } + + public function setPosition($position) + { + $this->position = $position; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->add("position", $this->getPosition()) + ->getObject(); + } + + public function toPKIRequestString() + { + return RequestStringBuilder::create() + ->appendSuper(parent::toPKIRequestString()) + ->append("position", $this->getPosition()) + ->getRequestString(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/RetrieveSubMerchantRequest.php b/iyzipay/src/Iyzipay/Request/RetrieveSubMerchantRequest.php new file mode 100644 index 0000000..c71a9d6 --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/RetrieveSubMerchantRequest.php @@ -0,0 +1,37 @@ +subMerchantExternalId; + } + + public function setSubMerchantExternalId($subMerchantExternalId) + { + $this->subMerchantExternalId = $subMerchantExternalId; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->add("subMerchantExternalId", $this->getSubMerchantExternalId()) + ->getObject(); + } + + public function toPKIRequestString() + { + return RequestStringBuilder::create() + ->appendSuper(parent::toPKIRequestString()) + ->append("subMerchantExternalId", $this->getSubMerchantExternalId()) + ->getRequestString(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/RetrieveTransactionsRequest.php b/iyzipay/src/Iyzipay/Request/RetrieveTransactionsRequest.php new file mode 100644 index 0000000..1b71289 --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/RetrieveTransactionsRequest.php @@ -0,0 +1,37 @@ +date; + } + + public function setDate($date) + { + $this->date = $date; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->add("date", $this->getDate()) + ->getObject(); + } + + public function toPKIRequestString() + { + return RequestStringBuilder::create() + ->appendSuper(parent::toPKIRequestString()) + ->append("date", $this->getDate()) + ->getRequestString(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/SubMerchantPaymentItemUpdateRequest.php b/iyzipay/src/Iyzipay/Request/SubMerchantPaymentItemUpdateRequest.php new file mode 100644 index 0000000..3f1e6b5 --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/SubMerchantPaymentItemUpdateRequest.php @@ -0,0 +1,66 @@ +subMerchantKey; + } + + public function setSubMerchantKey($subMerchantKey) + { + $this->subMerchantKey = $subMerchantKey; + } + + public function getPaymentTransactionId() + { + return $this->paymentTransactionId; + } + + public function setPaymentTransactionId($paymentTransactionId) + { + $this->paymentTransactionId = $paymentTransactionId; + } + + public function getSubMerchantPrice() + { + return $this->subMerchantPrice; + } + + public function setSubMerchantPrice($subMerchantPrice) + { + $this->subMerchantPrice = $subMerchantPrice; + } + + + public function getJsonObject() + { + + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->add("subMerchantKey", $this->getSubMerchantKey()) + ->add("paymentTransactionId", $this->getPaymentTransactionId()) + ->addPrice("subMerchantPrice", $this->getSubMerchantPrice()) + ->getObject(); + } + + public function toPKIRequestString() + { + return RequestStringBuilder::create() + ->appendSuper(parent::toPKIRequestString()) + ->append("subMerchantKey", $this->getSubMerchantKey()) + ->append("paymentTransactionId", $this->getPaymentTransactionId()) + ->append("subMerchantPrice", $this->getSubMerchantPrice()) + ->getRequestString(); + } +} diff --git a/iyzipay/src/Iyzipay/Request/Subscription/RetrieveSubscriptionCreateCheckoutFormRequest.php b/iyzipay/src/Iyzipay/Request/Subscription/RetrieveSubscriptionCreateCheckoutFormRequest.php new file mode 100644 index 0000000..bf53535 --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/Subscription/RetrieveSubscriptionCreateCheckoutFormRequest.php @@ -0,0 +1,28 @@ +checkoutFormToken; + } + + public function setCheckoutFormToken($checkoutFormToken) + { + $this->checkoutFormToken = $checkoutFormToken; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->getObject(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionActivateRequest.php b/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionActivateRequest.php new file mode 100644 index 0000000..77656d9 --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionActivateRequest.php @@ -0,0 +1,32 @@ +subscriptionReferenceCode = $subscriptionReferenceCode; + } + + public function getSubscriptionReferenceCode() + { + return $this->subscriptionReferenceCode; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->add("subscriptionReferenceCode", $this->getSubscriptionReferenceCode()) + ->add("locale", $this->getLocale()) + ->add("conversationId", $this->getConversationId()) + ->getObject(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionCancelRequest.php b/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionCancelRequest.php new file mode 100644 index 0000000..7d118f9 --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionCancelRequest.php @@ -0,0 +1,32 @@ +subscriptionReferenceCode = $subscriptionReferenceCode; + } + + public function getSubscriptionReferenceCode() + { + return $this->subscriptionReferenceCode; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->add("subscriptionReferenceCode", $this->getSubscriptionReferenceCode()) + ->add("locale", $this->getLocale()) + ->add("conversationId", $this->getConversationId()) + ->getObject(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionCardUpdateRequest.php b/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionCardUpdateRequest.php new file mode 100644 index 0000000..8facaf1 --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionCardUpdateRequest.php @@ -0,0 +1,43 @@ +callbackUrl; + } + + public function setCallbackUrl($callbackUrl) + { + $this->callbackUrl = $callbackUrl; + } + + public function getCustomerReferenceCode() + { + return $this->customerReferenceCode ; + } + + public function setCustomerReferenceCode($customerReferenceCode) + { + $this->customerReferenceCode = $customerReferenceCode; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->add("locale", $this->getLocale()) + ->add("conversationId", $this->getConversationId()) + ->add("callbackUrl", $this->getCallbackUrl()) + ->add("customerReferenceCode", $this->getCustomerReferenceCode()) + ->getObject(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionCardUpdateWithSubscriptionReferenceCodeRequest.php b/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionCardUpdateWithSubscriptionReferenceCodeRequest.php new file mode 100644 index 0000000..c798c3f --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionCardUpdateWithSubscriptionReferenceCodeRequest.php @@ -0,0 +1,43 @@ +callbackUrl; + } + + public function setCallbackUrl($callbackUrl) + { + $this->callbackUrl = $callbackUrl; + } + + public function getSubscriptionReferenceCode() + { + return $this->subscriptionReferenceCode ; + } + + public function setSubscriptionReferenceCode($subscriptionReferenceCode) + { + $this->subscriptionReferenceCode = $subscriptionReferenceCode; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->add("locale", $this->getLocale()) + ->add("conversationId", $this->getConversationId()) + ->add("callbackUrl", $this->getCallbackUrl()) + ->add("subscriptionReferenceCode", $this->getSubscriptionReferenceCode()) + ->getObject(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionCreateCheckoutFormRequest.php b/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionCreateCheckoutFormRequest.php new file mode 100644 index 0000000..236cf99 --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionCreateCheckoutFormRequest.php @@ -0,0 +1,75 @@ +customer = new Customer(); + } + + public function getCustomer() + { + return $this->customer; + } + + public function setCustomer(Customer $customer) + { + $this->customer = $customer; + } + + public function getCallbackUrl() + { + return $this->callbackUrl; + } + + public function setCallbackUrl($callbackUrl) + { + $this->callbackUrl = $callbackUrl; + } + public function getPricingPlanReferenceCode() + { + return $this->pricingPlanReferenceCode; + } + + public function setPricingPlanReferenceCode($pricingPlanReferenceCode) + { + $this->pricingPlanReferenceCode = $pricingPlanReferenceCode; + } + + public function getSubscriptionInitialStatus() + { + return $this->subscriptionInitialStatus; + } + + public function setSubscriptionInitialStatus($subscriptionInitialStatus) + { + $this->subscriptionInitialStatus = $subscriptionInitialStatus; + } + + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->add("locale", $this->getLocale()) + ->add("conversationId", $this->getConversationId()) + ->add("callbackUrl", $this->getCallbackUrl()) + ->add("pricingPlanReferenceCode", $this->getPricingPlanReferenceCode()) + ->add("subscriptionInitialStatus", $this->getSubscriptionInitialStatus()) + ->add("customer", + $this->getCustomer()->getJsonObject($locale = null,$conversationId= null, $customerReferenceCode = null) + ) + ->getObject(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionCreateCustomerRequest.php b/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionCreateCustomerRequest.php new file mode 100644 index 0000000..647f939 --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionCreateCustomerRequest.php @@ -0,0 +1,34 @@ +customer = new Customer(); + } + + public function getCustomer() + { + return $this->customer; + } + + public function setCustomer(Customer $customer) + { + $this->customer = $customer; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject($this->getCustomer()->getJsonObject($this->getLocale(),$this->getConversationId())) + ->getObject(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionCreatePricingPlanRequest.php b/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionCreatePricingPlanRequest.php new file mode 100644 index 0000000..5428115 --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionCreatePricingPlanRequest.php @@ -0,0 +1,124 @@ +name; + } + + public function setName($name) + { + $this->name = $name; + } + + public function getProductReferenceCode() + { + return $this->productReferenceCode; + } + + public function setProductReferenceCode($productReferenceCode) + { + $this->productReferenceCode = $productReferenceCode; + } + + public function getPrice() + { + return $this->price; + } + + public function SetPrice($price) + { + $this->price = $price; + } + + public function getCurrencyCode() + { + return $this->currencyCode; + } + + public function setCurrencyCode($currencyCode) + { + $this->currencyCode = $currencyCode; + } + + public function getPaymentInterval() + { + return $this->paymentInterval; + } + + public function setPaymentInterval($paymentInterval) + { + $this->paymentInterval = $paymentInterval; + } + + public function getPaymentIntervalCount() + { + return $this->paymentIntervalCount; + } + + public function setPaymentIntervalCount($paymentIntervalCount) + { + $this->paymentIntervalCount = $paymentIntervalCount; + } + public function getTrialPeriodDays () + { + return $this->trialPeriodDays ; + } + + public function setTrialPeriodDays ($trialPeriodDays) + { + $this->trialPeriodDays = $trialPeriodDays; + } + public function getPlanPaymentType() + { + return $this->planPaymentType; + } + + public function setPlanPaymentType($planPaymentType) + { + $this->planPaymentType = $planPaymentType; + } + public function setRecurrenceCount($recurrenceCount) + { + $this->recurrenceCount = $recurrenceCount; + } + public function getRecurrenceCount() + { + return $this->recurrenceCount; + } + + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->add("productReferenceCode", $this->getProductReferenceCode()) + ->add("name", $this->getName()) + ->add("price", $this->getPrice()) + ->add("currencyCode", $this->getCurrencyCode()) + ->add("paymentInterval", $this->getPaymentInterval()) + ->add("paymentIntervalCount", $this->getPaymentIntervalCount()) + ->add("trialPeriodDays", $this->getTrialPeriodDays()) + ->add("planPaymentType", $this->getPlanPaymentType()) + ->add("recurrenceCount", $this->getRecurrenceCount()) + ->add("locale", $this->getLocale()) + ->add("conversationId", $this->getConversationId()) + ->getObject(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionCreateProductRequest.php b/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionCreateProductRequest.php new file mode 100644 index 0000000..cadfdc3 --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionCreateProductRequest.php @@ -0,0 +1,42 @@ +name; + } + + public function setName($name) + { + $this->name = $name; + } + + public function getDescription() + { + return $this->description; + } + + public function setDescription($description) + { + $this->description = $description; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->add("name", $this->getName()) + ->add("description", $this->getDescription()) + ->add("locale", $this->getLocale()) + ->add("conversationId", $this->getConversationId()) + ->getObject(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionCreateRequest.php b/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionCreateRequest.php new file mode 100644 index 0000000..278a7a4 --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionCreateRequest.php @@ -0,0 +1,76 @@ +customer = new Customer(); + } + + public function getCustomer() + { + return $this->customer; + } + + public function setCustomer(Customer $customer) + { + $this->customer = $customer; + } + + public function getPaymentCard() + { + return $this->paymentCard; + } + + public function setPaymentCard($paymentCard) + { + $this->paymentCard = $paymentCard; + } + + public function getPricingPlanReferenceCode() + { + return $this->pricingPlanReferenceCode; + } + + public function setPricingPlanReferenceCode($pricingPlanReferenceCode) + { + $this->pricingPlanReferenceCode = $pricingPlanReferenceCode; + } + + public function getSubscriptionInitialStatus() + { + return $this->subscriptionInitialStatus; + } + + public function setSubscriptionInitialStatus($subscriptionInitialStatus) + { + $this->subscriptionInitialStatus = $subscriptionInitialStatus; + } + + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->add("locale", $this->getLocale()) + ->add("conversationId", $this->getConversationId()) + ->add("pricingPlanReferenceCode", $this->getPricingPlanReferenceCode()) + ->add("subscriptionInitialStatus", $this->getSubscriptionInitialStatus()) + ->add("paymentCard", $this->getPaymentCard()) + ->add("customer", + $this->getCustomer()->getJsonObject($locale = null,$conversationId= null, $customerReferenceCode = null) + ) + ->getObject(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionCreateWithCustomerRequest.php b/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionCreateWithCustomerRequest.php new file mode 100644 index 0000000..be0d127 --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionCreateWithCustomerRequest.php @@ -0,0 +1,57 @@ +customerReferenceCode; + } + + public function setCustomerReferenceCode($customerReferenceCode) + { + $this->customerReferenceCode = $customerReferenceCode; + } + + public function getPricingPlanReferenceCode() + { + return $this->pricingPlanReferenceCode; + } + + public function setPricingPlanReferenceCode($pricingPlanReferenceCode) + { + $this->pricingPlanReferenceCode = $pricingPlanReferenceCode; + } + + public function getSubscriptionInitialStatus() + { + return $this->subscriptionInitialStatus; + } + + public function setSubscriptionInitialStatus($subscriptionInitialStatus) + { + $this->subscriptionInitialStatus = $subscriptionInitialStatus; + } + + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->add("locale", $this->getLocale()) + ->add("conversationId", $this->getConversationId()) + ->add("pricingPlanReferenceCode", $this->getPricingPlanReferenceCode()) + ->add("subscriptionInitialStatus", $this->getSubscriptionInitialStatus()) + ->add("customerReferenceCode", $this->getCustomerReferenceCode()) + ->getObject(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionDeletePricingPlanRequest.php b/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionDeletePricingPlanRequest.php new file mode 100644 index 0000000..e928be3 --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionDeletePricingPlanRequest.php @@ -0,0 +1,30 @@ +pricingPlanReferenceCode; + } + + public function setPricingPlanReferenceCode($pricingPlanReferenceCode) + { + $this->pricingPlanReferenceCode= $pricingPlanReferenceCode; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->add("locale", $this->getLocale()) + ->add("conversationId", $this->getConversationId()) + ->add("pricingPlanReferenceCode", $this->getPricingPlanReferenceCode()) + ->getObject(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionDeleteProductRequest.php b/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionDeleteProductRequest.php new file mode 100644 index 0000000..8acee0e --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionDeleteProductRequest.php @@ -0,0 +1,31 @@ +productReferenceCode; + } + + public function setProductReferenceCode($productReferenceCode) + { + $this->productReferenceCode = $productReferenceCode; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->add("locale", $this->getLocale()) + ->add("conversationId", $this->getConversationId()) + ->add("productReferenceCode", $this->getProductReferenceCode()) + ->getObject(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionDetailsRequest.php b/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionDetailsRequest.php new file mode 100644 index 0000000..cf1cabf --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionDetailsRequest.php @@ -0,0 +1,26 @@ +subscriptionReferenceCode; + } + + public function setSubscriptionReferenceCode($subscriptionReferenceCode) + { + $this->subscriptionReferenceCode = $subscriptionReferenceCode; + } + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->getObject(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionListCustomersRequest.php b/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionListCustomersRequest.php new file mode 100644 index 0000000..85d903a --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionListCustomersRequest.php @@ -0,0 +1,40 @@ +page; + } + + public function setPage($page) + { + $this->page = $page; + } + + public function getCount() + { + return $this->count; + } + + public function setCount($count) + { + $this->count = $count; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->getObject(); + } + +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionListPricingPlanRequest.php b/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionListPricingPlanRequest.php new file mode 100644 index 0000000..a9be18a --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionListPricingPlanRequest.php @@ -0,0 +1,51 @@ +page; + } + + public function setProductReferenceCode($productReferenceCode) + { + $this->productReferenceCode = $productReferenceCode; + } + + public function getProductReferenceCode() + { + return $this->productReferenceCode; + } + + public function setPage($page) + { + $this->page = $page; + } + + public function getCount() + { + return $this->count; + } + + public function setCount($count) + { + $this->count = $count; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->getObject(); + } + +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionListProductsRequest.php b/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionListProductsRequest.php new file mode 100644 index 0000000..65abe52 --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionListProductsRequest.php @@ -0,0 +1,40 @@ +page; + } + + public function setPage($page) + { + $this->page = $page; + } + + public function getCount() + { + return $this->count; + } + + public function setCount($count) + { + $this->count = $count; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->getObject(); + } + +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionRetrieveCustomerRequest.php b/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionRetrieveCustomerRequest.php new file mode 100644 index 0000000..589b7e0 --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionRetrieveCustomerRequest.php @@ -0,0 +1,30 @@ +customerReferenceCode; + } + + public function setCustomerReferenceCode($customerReferenceCode) + { + $this->customerReferenceCode = $customerReferenceCode; + } + + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->getObject(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionRetrievePricingPlanRequest.php b/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionRetrievePricingPlanRequest.php new file mode 100644 index 0000000..7552d1a --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionRetrievePricingPlanRequest.php @@ -0,0 +1,31 @@ +pricingPlanReferenceCode; + } + + public function setPricingPlanReferenceCode($pricingPlanReferenceCode) + { + $this->pricingPlanReferenceCode = $pricingPlanReferenceCode; + } + + + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->getObject(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionRetrieveProductRequest.php b/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionRetrieveProductRequest.php new file mode 100644 index 0000000..18ed7ca --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionRetrieveProductRequest.php @@ -0,0 +1,28 @@ +productReferenceCode; + } + + public function setProductReferenceCode($productReferenceCode) + { + $this->productReferenceCode = $productReferenceCode; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->getObject(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionRetryRequest.php b/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionRetryRequest.php new file mode 100644 index 0000000..abc6abd --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionRetryRequest.php @@ -0,0 +1,32 @@ +referenceCode = $referenceCode; + } + + public function getReferenceCode() + { + return $this->referenceCode; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->add("referenceCode", $this->getReferenceCode()) + ->add("locale", $this->getLocale()) + ->add("conversationId", $this->getConversationId()) + ->getObject(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionSearchRequest.php b/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionSearchRequest.php new file mode 100644 index 0000000..658b915 --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionSearchRequest.php @@ -0,0 +1,99 @@ +page; + } + public function setPage($page) + { + return $this->page = $page; + } + public function getCount() + { + return $this->count; + } + public function setCount($count) + { + return $this->count = $count; + } + public function getSubscriptionReferenceCode() + { + return $this->subscriptionReferenceCode; + } + public function setSubscriptionReferenceCode($subscriptionReferenceCode) + { + return $this->subscriptionReferenceCode = $subscriptionReferenceCode; + } + public function getParentReferenceCode() + { + return $this->parentReferenceCode; + } + public function setParentReferenceCode($parentReferenceCode) + { + return $this->parentReferenceCode = $parentReferenceCode; + } + public function getCustomerReferenceCode() + { + return $this->customerReferenceCode; + } + public function setCustomerReferenceCode($customerReferenceCode) + { + return $this->customerReferenceCode = $customerReferenceCode; + } + public function getPricingPlanReferenceCode() + { + return $this->pricingPlanReferenceCode; + } + public function setPricingPlanReferenceCode($pricingPlanReferenceCode) + { + return $this->pricingPlanReferenceCode = $pricingPlanReferenceCode; + } + public function getSubscriptionStatus() + { + return $this->subscriptionStatus; + } + public function setSubscriptionStatus($subscriptionStatus) + { + return $this->subscriptionStatus = $subscriptionStatus; + } + public function getStartDate() + { + return $this->startDate; + } + public function setStartDate($startDate) + { + return $this->startDate = $startDate; + } + public function getEndDate() + { + return $this->endDate; + } + public function setEndDate($endDate) + { + return $this->endDate = $endDate; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->getObject(); + } +} diff --git a/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionUpdateCustomerRequest.php b/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionUpdateCustomerRequest.php new file mode 100644 index 0000000..d0b7619 --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionUpdateCustomerRequest.php @@ -0,0 +1,43 @@ +customer = new Customer(); + } + + public function getCustomerReferenceCode() + { + return $this->customerReferenceCode; + } + + public function setCustomerReferenceCode($customerReferenceCode) + { + $this->customerReferenceCode = $customerReferenceCode; + } + public function getCustomer() + { + return $this->customer; + } + + public function setCustomer(Customer $customer) + { + $this->customer = $customer; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject($this->getCustomer()->getJsonObject($this->getLocale(),$this->getConversationId(),$this->getCustomerReferenceCode())) + ->getObject(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionUpdatePricingPlanRequest.php b/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionUpdatePricingPlanRequest.php new file mode 100644 index 0000000..235dfe7 --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionUpdatePricingPlanRequest.php @@ -0,0 +1,55 @@ +name; + } + + public function setName($name) + { + $this->name = $name; + } + + public function getPricingPlanReferenceCode() + { + return $this->pricingPlanReferenceCode; + } + + public function setPricingPlanReferenceCode($pricingPlanReferenceCode) + { + $this->pricingPlanReferenceCode = $pricingPlanReferenceCode; + } + + public function getTrialPeriodDays () + { + return $this->trialPeriodDays ; + } + + public function setTrialPeriodDays ($trialPeriodDays) + { + $this->trialPeriodDays = $trialPeriodDays; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->add("locale", $this->getLocale()) + ->add("conversationId", $this->getConversationId()) + ->add("pricingPlanReferenceCode", $this->getPricingPlanReferenceCode()) + ->add("name", $this->getName()) + ->add("trialPeriodDays", $this->getTrialPeriodDays()) + ->getObject(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionUpdateProductRequest.php b/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionUpdateProductRequest.php new file mode 100644 index 0000000..0a26234 --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionUpdateProductRequest.php @@ -0,0 +1,55 @@ +name; + } + + public function setName($name) + { + $this->name = $name; + } + + public function getDescription() + { + return $this->description; + } + + public function setDescription($description) + { + $this->description = $description; + } + + public function getProductReferenceCode() + { + return $this->productReferenceCode; + } + + public function setProductReferenceCode($productReferenceCode) + { + $this->productReferenceCode = $productReferenceCode; + } + + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->add("locale", $this->getLocale()) + ->add("conversationId", $this->getConversationId()) + ->add("name", $this->getName()) + ->add("description", $this->getDescription()) + ->add("productReferenceCode", $this->getProductReferenceCode()) + ->getObject(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionUpgradeRequest.php b/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionUpgradeRequest.php new file mode 100644 index 0000000..2fe644e --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/Subscription/SubscriptionUpgradeRequest.php @@ -0,0 +1,79 @@ +subscriptionReferenceCode = $subscriptionReferenceCode; + } + + public function getSubscriptionReferenceCode() + { + return $this->subscriptionReferenceCode; + } + + public function setNewPricingPlanReferenceCode($newPricingPlanReferenceCode) + { + $this->newPricingPlanReferenceCode = $newPricingPlanReferenceCode; + } + + public function getNewPricingPlanReferenceCode() + { + return $this->newPricingPlanReferenceCode; + } + + public function setUpgradePeriod($upgradePeriod) + { + $this->upgradePeriod= $upgradePeriod; + } + + public function getUpgradePeriod() + { + return $this->upgradePeriod; + } + + public function setUseTrial($useTrial) + { + $this->useTrial= $useTrial; + } + + public function getUseTrial() + { + return $this->useTrial; + } + + public function setResetRecurrenceCount($resetRecurrenceCount) + { + $this->resetRecurrenceCount= $resetRecurrenceCount; + } + + public function getResetRecurrenceCount() + { + return $this->resetRecurrenceCount; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->add("locale", $this->getLocale()) + ->add("conversationId", $this->getConversationId()) + ->add("subscriptionReferenceCode", $this->getSubscriptionReferenceCode()) + ->add("newPricingPlanReferenceCode", $this->getNewPricingPlanReferenceCode()) + ->add("upgradePeriod", $this->getUpgradePeriod()) + ->add("useTrial", $this->getUseTrial()) + ->add("resetRecurrenceCount", $this->getResetRecurrenceCount()) + ->getObject(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/UCSInitializeRequest.php b/iyzipay/src/Iyzipay/Request/UCSInitializeRequest.php new file mode 100644 index 0000000..f3a0d72 --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/UCSInitializeRequest.php @@ -0,0 +1,40 @@ +gsmNumber; + } + + public function setGsmNumber($gsmNumber) + { + $this->gsmNumber = $gsmNumber; + } + + public function getEmail() + { + return $this->email; + } + + public function setEmail($email) + { + $this->email= $email; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->add("email", $this->getEmail()) + ->add("gsmNumber", $this->getGsmNumber()) + ->getObject(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/Request/UpdateSubMerchantRequest.php b/iyzipay/src/Iyzipay/Request/UpdateSubMerchantRequest.php new file mode 100644 index 0000000..01dfaf0 --- /dev/null +++ b/iyzipay/src/Iyzipay/Request/UpdateSubMerchantRequest.php @@ -0,0 +1,206 @@ +name; + } + + public function setName($name) + { + $this->name = $name; + } + + public function getEmail() + { + return $this->email; + } + + public function setEmail($email) + { + $this->email = $email; + } + + public function getGsmNumber() + { + return $this->gsmNumber; + } + + public function setGsmNumber($gsmNumber) + { + $this->gsmNumber = $gsmNumber; + } + + public function getAddress() + { + return $this->address; + } + + public function setAddress($address) + { + $this->address = $address; + } + + public function getIban() + { + return $this->iban; + } + + public function setIban($iban) + { + $this->iban = $iban; + } + + public function getTaxOffice() + { + return $this->taxOffice; + } + + public function setTaxOffice($taxOffice) + { + $this->taxOffice = $taxOffice; + } + + public function getContactName() + { + return $this->contactName; + } + + public function setContactName($contactName) + { + $this->contactName = $contactName; + } + + public function getContactSurname() + { + return $this->contactSurname; + } + + public function setContactSurname($contactSurname) + { + $this->contactSurname = $contactSurname; + } + + public function getLegalCompanyTitle() + { + return $this->legalCompanyTitle; + } + + public function setLegalCompanyTitle($legalCompanyTitle) + { + $this->legalCompanyTitle = $legalCompanyTitle; + } + + public function getSwiftCode() + { + return $this->swiftCode; + } + + public function setSwiftCode($swiftCode) + { + $this->swiftCode = $swiftCode; + } + + public function getCurrency() + { + return $this->currency; + } + + public function setCurrency($currency) + { + $this->currency = $currency; + } + + public function getIdentityNumber() + { + return $this->identityNumber; + } + + public function setIdentityNumber($identityNumber) + { + $this->identityNumber = $identityNumber; + } + + public function getTaxNumber() + { + return $this->taxNumber; + } + + public function setTaxNumber($taxNumber) + { + $this->taxNumber = $taxNumber; + } + + public function getSubMerchantKey() + { + return $this->subMerchantKey; + } + + public function setSubMerchantKey($subMerchantKey) + { + $this->subMerchantKey = $subMerchantKey; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->add("name", $this->getName()) + ->add("email", $this->getEmail()) + ->add("gsmNumber", $this->getGsmNumber()) + ->add("address", $this->getAddress()) + ->add("iban", $this->getIban()) + ->add("taxOffice", $this->getTaxOffice()) + ->add("contactName", $this->getContactName()) + ->add("contactSurname", $this->getContactSurname()) + ->add("legalCompanyTitle", $this->getLegalCompanyTitle()) + ->add("swiftCode", $this->getSwiftCode()) + ->add("currency", $this->getCurrency()) + ->add("subMerchantKey", $this->getSubMerchantKey()) + ->add("identityNumber", $this->getIdentityNumber()) + ->add("taxNumber", $this->getTaxNumber()) + ->getObject(); + } + + public function toPKIRequestString() + { + return RequestStringBuilder::create() + ->appendSuper(parent::toPKIRequestString()) + ->append("name", $this->getName()) + ->append("email", $this->getEmail()) + ->append("gsmNumber", $this->getGsmNumber()) + ->append("address", $this->getAddress()) + ->append("iban", $this->getIban()) + ->append("taxOffice", $this->getTaxOffice()) + ->append("contactName", $this->getContactName()) + ->append("contactSurname", $this->getContactSurname()) + ->append("legalCompanyTitle", $this->getLegalCompanyTitle()) + ->append("swiftCode", $this->getSwiftCode()) + ->append("currency", $this->getCurrency()) + ->append("subMerchantKey", $this->getSubMerchantKey()) + ->append("identityNumber", $this->getIdentityNumber()) + ->append("taxNumber", $this->getTaxNumber()) + ->getRequestString(); + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/RequestFormatter.php b/iyzipay/src/Iyzipay/RequestFormatter.php new file mode 100644 index 0000000..ac13123 --- /dev/null +++ b/iyzipay/src/Iyzipay/RequestFormatter.php @@ -0,0 +1,26 @@ +requestString = $requestString; + } + + public static function create() + { + return new RequestStringBuilder(""); + } + + /** + * @param $superRequestString + * @return RequestStringBuilder + */ + public function appendSuper($superRequestString) + { + if (isset($superRequestString)) { + $superRequestString = substr($superRequestString, 1); + $superRequestString = substr($superRequestString, 0, -1); + + if (strlen($superRequestString) > 0) { + $this->requestString = $this->requestString . $superRequestString . ","; + } + } + return $this; + } + + /** + * @param $key + * @param $value + * @return RequestStringBuilder + */ + public function append($key, $value = null) + { + if (isset($value)) { + if ($value instanceof RequestStringConvertible) { + $this->appendKeyValue($key, $value->toPKIRequestString()); + } else { + $this->appendKeyValue($key, $value); + } + } + return $this; + } + + /** + * @param $key + * @param $value + * @return RequestStringBuilder + */ + public function appendPrice($key, $value = null) + { + if (isset($value)) { + $this->appendKeyValue($key, RequestFormatter::formatPrice($value)); + } + return $this; + } + + /** + * @param $key + * @param array $array + * @return RequestStringBuilder + */ + public function appendArray($key, array $array = null) + { + if (isset($array)) { + $appendedValue = ""; + foreach ($array as $value) { + if ($value instanceof RequestStringConvertible) { + $appendedValue = $appendedValue . $value->toPKIRequestString(); + } else { + $appendedValue = $appendedValue . $value; + } + $appendedValue = $appendedValue . ", "; + } + $this->appendKeyValueArray($key, $appendedValue); + } + return $this; + } + + /** + * @param $key + * @param $value + * @return RequestStringBuilder + */ + private function appendKeyValue($key, $value) + { + if (isset($value)) { + $this->requestString = $this->requestString . $key . "=" . $value . ","; + } + return $this; + } + + /** + * @param $key + * @param $value + * @return RequestStringBuilder + */ + private function appendKeyValueArray($key, $value) + { + if (isset($value)) { + $value = substr($value, 0, -2); + $this->requestString = $this->requestString . $key . "=[" . $value . "],"; + } + return $this; + } + + /** + * @return RequestStringBuilder + */ + private function appendPrefix() + { + $this->requestString = "[" . $this->requestString . "]"; + return $this; + } + + /** + * @return RequestStringBuilder + */ + private function removeTrailingComma() + { + $this->requestString = substr($this->requestString, 0, -1); + return $this; + } + + public function getRequestString() + { + $this->removeTrailingComma(); + $this->appendPrefix(); + return $this->requestString; + } + + public static function requestToStringQuery(Request $request, $type = null) + { + + $stringQuery = false; + + if($request->getConversationId()) { + $stringQuery = "?conversationId=" . $request->getConversationId(); + } + + if($request->getLocale()) { + $stringQuery .= "&locale=" . $request->getLocale(); + } + + if($type == 'defaultParams' ) { + if($request->getConversationId()) { + $stringQuery = "?conversationId=" . $request->getConversationId(); + $stringQuery .= ($request->getLocale()) ? ("&locale=" . $request->getLocale()) : ''; + }else{ + $stringQuery = ($request->getLocale()) ? ("?locale=" . $request->getLocale()) : ''; + } + } + + if($type == 'reporting') { + if($request->getPaymentConversationId()) { + $stringQuery .= "?paymentConversationId=" . $request->getPaymentConversationId(); + } + } + + if($type == 'reportingTransaction') { + + if($request->getTransactionDate()) { + $stringQuery .= "&transactionDate=" . $request->getTransactionDate(); + } + if ($request->getPage()) { + $stringQuery .= "&page=" . $request->getPage(); + } + } + + if($type == 'subscriptionItems' ) { + if ($request->getPage()) { + $stringQuery = "?page=" . $request->getPage(); + } + if ($request->getCount()) { + $stringQuery .= "&count=" . $request->getCount(); + } + if($request->getConversationId()) { + $stringQuery .= "&conversationId=" . $request->getConversationId(); + } + if($request->getLocale()) { + $stringQuery .= "&locale=" . $request->getLocale(); + } + } + + if($type == 'searchSubscription') { + if($request->getPage()){ + $stringQuery = "?page=".$request->getPage(); + } + if($request->getCount()){ + $stringQuery .= "&count=".$request->getCount(); + } + if($request->getSubscriptionReferenceCode()){ + $stringQuery .= "&subscriptionReferenceCode=".$request->getSubscriptionReferenceCode(); + } + if($request->getParentReferenceCode()){ + $stringQuery .= "&parentReferenceCode=".$request->getParentReferenceCode(); + } + if($request->getCustomerReferenceCode()){ + $stringQuery .= "&customerReferenceCode=".$request->getCustomerReferenceCode(); + } + if($request->getPricingPlanReferenceCode()){ + $stringQuery .= "&pricingPlanReferenceCode=".$request->getPricingPlanReferenceCode(); + } + if($request->getSubscriptionStatus()){ + $stringQuery .= "&subscriptionStatus=".$request->getSubscriptionStatus(); + } + if($request->getStartDate()){ + $stringQuery .= "&startDate=".$request->getStartDate(); + } + if($request->getEndDate()){ + $stringQuery .= "&endDate=".$request->getEndDate(); + } + if($request->getConversationId()) { + $stringQuery .= "&conversationId=" . $request->getConversationId(); + } + if($request->getLocale()) { + $stringQuery .= "&locale=" . $request->getLocale(); + } + } + + if($type == 'pages') { + if ($request->getPage()) { + $stringQuery .= "&page=" . $request->getPage(); + } + if ($request->getCount()) { + $stringQuery .= "&count=" . $request->getCount(); + } + } + + return $stringQuery; + } +} \ No newline at end of file diff --git a/iyzipay/src/Iyzipay/RequestStringConvertible.php b/iyzipay/src/Iyzipay/RequestStringConvertible.php new file mode 100644 index 0000000..b72da3f --- /dev/null +++ b/iyzipay/src/Iyzipay/RequestStringConvertible.php @@ -0,0 +1,8 @@ +. + +/** + * Strings for component 'enrol_iyzicopayment', language 'en'. + * + * @package enrol_iyzicopayment + * @copyright 2019 Dualcube Team + * @copyright 2021 Made by Sense + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +$string['assignrole'] = 'Assign role'; +$string['secretkey'] = 'iyzico Secret Key'; +$string['publishablekey'] = 'iyzico API Key'; +$string['sandboxmode'] = 'iyzico Sandbox Mode'; +$string['sandboxmode_desc'] = 'Use iyzico Sandbox Mode for debugging'; +$string['secretkey_desc'] = 'The API Secret Key of iyzico account'; +$string['publishablekey_desc'] = 'The API Key of iyzico account'; +$string['cost'] = 'Enrol cost'; +$string['costerror'] = 'The enrolment cost is not numeric'; +$string['costorkey'] = 'Please choose one of the following methods of enrolment.'; +$string['currency'] = 'Currency'; +$string['defaultrole'] = 'Default role assignment'; +$string['defaultrole_desc'] = 'Select role which should be assigned to users during iyzico enrolments'; +$string['enrolenddate'] = 'End date'; +$string['enrolenddate_help'] = 'If enabled, users can be enrolled until this date only.'; +$string['enrolenddaterror'] = 'Enrolment end date cannot be earlier than start date'; +$string['enrolperiod'] = 'Enrolment duration'; +$string['enrolperiod_desc'] = 'Default length of time that the enrolment is valid. If set to zero, the enrolment duration will be unlimited by default.'; +$string['enrolperiod_help'] = 'Length of time that the enrolment is valid, starting with the moment the user is enrolled. If disabled, the enrolment duration will be unlimited.'; +$string['enrolstartdate'] = 'Start date'; +$string['enrolstartdate_help'] = 'If enabled, users can be enrolled from this date onward only.'; +$string['expiredaction'] = 'Enrolment expiration action'; +$string['expiredaction_help'] = 'Select action to carry out when user enrolment expires. Please note that some user data and settings are purged from course during course unenrolment.'; +$string['mailadmins'] = 'Notify admin'; +$string['mailstudents'] = 'Notify students'; +$string['mailteachers'] = 'Notify teachers'; +$string['messageprovider:iyzico_enrolment'] = 'iyzico enrolment messages'; +$string['nocost'] = 'There is no cost associated with enrolling in this course!'; +$string['iyzico:config'] = 'Configure iyzico enrol instances'; +$string['iyzico:manage'] = 'Manage enrolled users'; +$string['iyzico:unenrol'] = 'Unenrol users from course'; +$string['iyzico:unenrolself'] = 'Unenrol self from the course'; +$string['iyzicoaccepted'] = 'iyzico payments accepted'; +$string['pluginname'] = 'iyzico Payment'; +$string['pluginname_desc'] = 'The iyzipay module allows you to set up paid courses. If the cost for any course is zero, then students are not asked to pay for entry. There is a site-wide cost that you set here as a default for the whole site and then a course setting that you can set for each course individually. The course cost overrides the site cost.'; +$string['sendpaymentbutton'] = 'Send payment via iyzico'; +$string['status'] = 'Allow iyzico enrolments'; +$string['status_desc'] = 'Allow users to use iyzico to enrol into a course by default.'; +$string['unenrolselfconfirm'] = 'Do you really want to unenrol yourself from course "{$a}"?'; +$string['messageprovider:iyzicopayment_enrolment'] = 'Message Provider'; + +$string['maxenrolled'] = 'Max enrolled users'; +$string['maxenrolled_help'] = 'Specifies the maximum number of users that can iyzicopayment enrol. 0 means no limit.'; +$string['maxenrolledreached'] = 'Maximum number of users allowed to iyzicopayment-enrol was already reached.'; + +$string['canntenrol'] = 'Enrolment is disabled or inactive'; +$string['iyzicopayment:config'] = 'Configure iyzicopayment'; +$string['iyzicopayment:manage'] = 'Manage iyzicopayment'; +$string['iyzicopayment:unenrol'] = 'Unenrol iyzicopayment'; +$string['iyzicopayment:unenrolself'] = 'Unenrolself iyzicopayment'; + +$string['charge_description1'] = "create customer for email receipt"; +$string['charge_description2'] = 'Charge for Course Enrolment Cost.'; + +$string['iyzico_sorry'] = "Sorry, you can not use the script that way."; +$string['newcost'] = 'New Cost'; +$string['couponcode'] = 'Coupon Code'; +$string['applycode'] = 'Apply Code'; +$string['invalidcouponcode'] = 'Invalid Coupon Code'; +$string['invalidcouponcodevalue'] = 'Coupon Code {$a} is not valid!'; +$string['enrol'] = 'Enrol'; diff --git a/lib.php b/lib.php new file mode 100644 index 0000000..ab82d28 --- /dev/null +++ b/lib.php @@ -0,0 +1,471 @@ +. + +/** + * iyzico enrolment plugin. + * + * This plugin allows you to set up paid courses. + * + * @package enrol_iyzicopayment + * @copyright 2019 Dualcube Team + * @copyright 2021 Made by Sense + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +/** + * iyzico enrolment plugin implementation. + * @copyright 2019 Dualcube Team + * @copyright 2021 Made by Sense + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +class enrol_iyzicopayment_plugin extends enrol_plugin +{ + /** + * Lists all currencies available for plugin. + * @return $currencies + */ + public function get_currencies() + { + // See https://github.com/iyzico/iyzipay-php/blob/master/src/Iyzipay/Model/Currency.php + $codes = array("TRY", "EUR", "USD", "GBP", "IRR", "NOK", "RUB", "CHF"); + $currencies = array(); + foreach ($codes as $c) { + $currencies[$c] = new lang_string($c, 'core_currencies'); + } + + return $currencies; + } + + /** + * Returns optional enrolment information icons. + * + * This is used in course list for quick overview of enrolment options. + * + * We are not using single instance parameter because sometimes + * we might want to prevent icon repetition when multiple instances + * of one type exist. One instance may also produce several icons. + * + * @param array $instances all enrol instances of this type in one course + * @return array of pix_icon + */ + public function get_info_icons(array $instances) + { + $found = false; + foreach ($instances as $instance) { + if ($instance->enrolstartdate != 0 && $instance->enrolstartdate > time()) { + continue; + } + if ($instance->enrolenddate != 0 && $instance->enrolenddate < time()) { + continue; + } + $found = true; + break; + } + if ($found) { + return array(new pix_icon('icon', get_string('pluginname', 'enrol_iyzicopayment'), 'enrol_iyzicopayment')); + } + return array(); + } + /** + * Lists all protected user roles. + * @return bool(true or false) + */ + public function roles_protected() + { + // Users with role assign cap may tweak the roles later. + return false; + } + /** + * Defines if user can be unenrolled. + * @param stdClass $instance of the plugin + * @return bool(true or false) + */ + public function allow_unenrol(stdClass $instance) + { + // Users with unenrol cap may unenrol other users manually - requires enrol/iyzico:unenrol. + return true; + } + /** + * Defines if user can be managed from admin. + * @param stdClass $instance of the plugin + * @return bool(true or false) + */ + public function allow_manage(stdClass $instance) + { + // Users with manage cap may tweak period and status - requires enrol/iyzico:manage. + return true; + } + /** + * Defines if 'enrol me' link will be shown on course page. + * @param stdClass $instance of the plugin + * @return bool(true or false) + */ + public function show_enrolme_link(stdClass $instance) + { + return ($instance->status == ENROL_INSTANCE_ENABLED); + } + + /** + * Sets up navigation entries. + * + * @param navigation_node $instancesnode + * @param stdClass $instance + * @return void + */ + public function add_course_navigation($instancesnode, stdClass $instance) + { + if ($instance->enrol !== 'iyzicopayment') { + throw new coding_exception('Invalid enrol instance type!'); + } + + $context = context_course::instance($instance->courseid); + if (has_capability('enrol/iyzicopayment:config', $context)) { + $managelink = new moodle_url( + '/enrol/iyzicopayment/edit.php', + array('courseid' => $instance->courseid, 'id' => $instance->id) + ); + $instancesnode->add($this->get_instance_name($instance), $managelink, navigation_node::TYPE_SETTING); + } + } + + /** + * Returns edit icons for the page with list of instances + * @param stdClass $instance + * @return array + */ + public function get_action_icons(stdClass $instance) + { + global $OUTPUT; + + if ($instance->enrol !== 'iyzicopayment') { + throw new coding_exception('invalid enrol instance!'); + } + $context = context_course::instance($instance->courseid); + + $icons = array(); + + if (has_capability('enrol/iyzicopayment:config', $context)) { + $editlink = new moodle_url( + "/enrol/iyzicopayment/edit.php", + array('courseid' => $instance->courseid, 'id' => $instance->id) + ); + $icons[] = $OUTPUT->action_icon($editlink, new pix_icon( + 't/edit', + get_string('edit'), + 'core', + array('class' => 'iconsmall') + )); + } + + return $icons; + } + + /** + * Returns link to page which may be used to add new instance of enrolment plugin in course. + * @param int $courseid + * @return moodle_url page url + */ + public function get_newinstance_link($courseid) + { + $context = context_course::instance($courseid, MUST_EXIST); + + if (!has_capability('moodle/course:enrolconfig', $context) or !has_capability('enrol/iyzicopayment:config', $context)) { + return null; + } + + // Multiple instances supported - different cost for different roles. + return new moodle_url('/enrol/iyzicopayment/edit.php', array('courseid' => $courseid)); + } + + /** + * Creates course enrol form, checks if form submitted + * and enrols user if necessary. It can also redirect. + * + * @param stdClass $instance + * @return string html text, usually a form in a text box + */ + public function enrol_page_hook(stdClass $instance) + { + global $CFG, $USER, $OUTPUT, $PAGE, $DB; + + $enrolstatus = $this->can_iyzicopayment_enrol($instance); + + if (!$enrolstatus) { + return get_string('maxenrolledreached', 'enrol_iyzicopayment'); + } + + ob_start(); + + if ($DB->record_exists('user_enrolments', array('userid' => $USER->id, 'enrolid' => $instance->id))) { + return ob_get_clean(); + } + + if ($instance->enrolstartdate != 0 && $instance->enrolstartdate > time()) { + return ob_get_clean(); + } + + if ($instance->enrolenddate != 0 && $instance->enrolenddate < time()) { + return ob_get_clean(); + } + + $course = $DB->get_record('course', array('id' => $instance->courseid)); + $context = context_course::instance($course->id); + + $shortname = format_string($course->shortname, true, array('context' => $context)); + $strloginto = get_string("loginto", "", $shortname); + $strcourses = get_string("courses"); + + // Pass $view=true to filter hidden caps if the user cannot see them. + if ($users = get_users_by_capability( + $context, + 'moodle/course:update', + 'u.*', + 'u.id ASC', + '', + '', + '', + '', + false, + true + )) { + $users = sort_by_roleassignment_authority($users, $context); + $teacher = array_shift($users); + } else { + $teacher = false; + } + $publishablekey = $this->get_config('publishablekey'); + if ((float) $instance->cost <= 0) { + $cost = (float) $this->get_config('cost'); + } else { + $cost = (float) $instance->cost; + } + + if (abs($cost) < 0.01) { // No cost, other enrolment methods (instances) should be used. + echo '

' . get_string('nocost', 'enrol_iyzicopayment') . '

'; + } else { + + // Calculate localised and "." cost, make sure we send iyzico the same value, + // please note iyzico expects amount with 2 decimal places and "." separator. + $localisedcost = format_float($cost, 2, true); + $cost = format_float($cost, 2, false); + + if (isguestuser()) { // Force login only for guest user, not real users with guest role. + if (empty($CFG->loginhttps)) { + $wwwroot = $CFG->wwwroot; + } else { + // This actually is not so secure ;-), 'cause we're + // in unencrypted connection... + $wwwroot = str_replace("http://", "https://", $CFG->wwwroot); + } + echo '

' . get_string('paymentrequired') . '

'; + echo '

' . get_string('cost') . ": $instance->currency $localisedcost" . '

'; + echo '

' . get_string('loginsite') . '

'; + echo '
'; + } else { + // Sanitise some fields before building the iyzico form. + $coursefullname = format_string($course->fullname, true, array('context' => $context)); + $courseshortname = $shortname; + $userfullname = fullname($USER); + $userid = $USER->id; + $userfirstname = $USER->firstname; + $userlastname = $USER->lastname; + $useraddress = $USER->address; + $usercity = $USER->city; + $instancename = $this->get_instance_name($instance); + + include($CFG->dirroot . '/enrol/iyzicopayment/enrol.php'); + } + } + + return $OUTPUT->box(ob_get_clean()); + } + + + /** + * Creates can iyzicopayament enrol. + * + * @param stdClass $instance + * @return string html text, usually a form in a text box + */ + public function can_iyzicopayment_enrol(stdClass $instance) + { + global $CFG, $DB, $OUTPUT, $USER; + + if ($instance->customint3 > 0) { + // Max enrol limit specified. + $count = $DB->count_records('user_enrolments', array('enrolid' => $instance->id)); + + if ($count >= $instance->customint3) { + // Bad luck, no more iyzicopayment enrolments here. + return false; + } + } + return true; + } + + + + /** + * Returns localised name of enrol instance + * + * @param stdClass $instance (null is accepted too) + * @return string + */ + public function get_instance_name($instance) + { + global $DB; + + if (empty($instance->name)) { + if (!empty($instance->roleid) and $role = $DB->get_record('role', array('id' => $instance->roleid))) { + $role = ' (' . role_get_name($role, context_course::instance($instance->courseid, IGNORE_MISSING)) . ')'; + } else { + $role = ''; + } + $enrol = $this->get_name(); + return get_string('pluginname', 'enrol_' . $enrol) . $role; + } else { + return format_string($instance->name); + } + } + + + /** + * Restore instance and map settings. + * + * @param restore_enrolments_structure_step $step + * @param stdClass $data + * @param stdClass $course + * @param int $oldid + */ + public function restore_instance(restore_enrolments_structure_step $step, stdClass $data, $course, $oldid) + { + global $DB; + if ($step->get_task()->get_target() == backup::TARGET_NEW_COURSE) { + $merge = false; + } else { + $merge = array( + 'courseid' => $data->courseid, + 'enrol' => $this->get_name(), + 'roleid' => $data->roleid, + 'cost' => $data->cost, + 'currency' => $data->currency, + + ); + } + if ($merge and $instances = $DB->get_records('enrol', $merge, 'id')) { + $instance = reset($instances); + $instanceid = $instance->id; + } else { + $instanceid = $this->add_instance($course, (array)$data); + } + $step->set_mapping('enrol', $oldid, $instanceid); + } + + /** + * Restore user enrolment. + * + * @param restore_enrolments_structure_step $step + * @param stdClass $data + * @param stdClass $instance + * @param int $userid + * @param int $oldinstancestatus + */ + public function restore_user_enrolment(restore_enrolments_structure_step $step, $data, $instance, $userid, $oldinstancestatus) + { + $this->enrol_user($instance, $userid, null, $data->timestart, $data->timeend, $data->status); + } + + /** + * Gets an array of the user enrolment actions + * + * @param course_enrolment_manager $manager + * @param stdClass $ue A user enrolment object + * @return array An array of user_enrolment_actions + */ + public function get_user_enrolment_actions(course_enrolment_manager $manager, $ue) + { + $actions = array(); + $context = $manager->get_context(); + $instance = $ue->enrolmentinstance; + $params = $manager->get_moodlepage()->url->params(); + $params['ue'] = $ue->id; + if ($this->allow_unenrol($instance) && has_capability("enrol/iyzicopayment:unenrol", $context)) { + $url = new moodle_url('/enrol/unenroluser.php', $params); + $actions[] = new user_enrolment_action( + new pix_icon('t/delete', ''), + get_string('unenrol', 'enrol'), + $url, + array('class' => 'unenrollink', 'rel' => $ue->id) + ); + } + if ($this->allow_manage($instance) && has_capability("enrol/iyzicopayment:manage", $context)) { + $url = new moodle_url('/enrol/editenrolment.php', $params); + $actions[] = new user_enrolment_action( + new pix_icon('t/edit', ''), + get_string('edit'), + $url, + array('class' => 'editenrollink', 'rel' => $ue->id) + ); + } + return $actions; + } + /** + * Set up cron for the plugin (if any). + * + */ + public function cron() + { + $trace = new text_progress_trace(); + $this->process_expirations($trace); + } + + /** + * Execute synchronisation. + * @param progress_trace $trace + * @return int exit code, 0 means ok + */ + public function sync(progress_trace $trace) + { + $this->process_expirations($trace); + return 0; + } + + /** + * Is it possible to delete enrol instance via standard UI? + * + * @param stdClass $instance + * @return bool + */ + public function can_delete_instance($instance) + { + $context = context_course::instance($instance->courseid); + return has_capability('enrol/iyzicopayment:config', $context); + } + + /** + * Is it possible to hide/show enrol instance via standard UI? + * + * @param stdClass $instance + * @return bool + */ + public function can_hide_show_instance($instance) + { + $context = context_course::instance($instance->courseid); + return has_capability('enrol/iyzicopayment:config', $context); + } +} diff --git a/log b/log new file mode 100644 index 0000000..e69de29 diff --git a/pix/icon.gif b/pix/icon.gif new file mode 100644 index 0000000..bf4a95d Binary files /dev/null and b/pix/icon.gif differ diff --git a/pix/icon.png b/pix/icon.png new file mode 100644 index 0000000..63390bc Binary files /dev/null and b/pix/icon.png differ diff --git a/readme.txt b/readme.txt new file mode 100644 index 0000000..a6a8bd6 --- /dev/null +++ b/readme.txt @@ -0,0 +1,5 @@ +Moodle iyzico Payment Enrolment Plugins +Developed by Made by Sense + +This plugin allows registered users to pay course enrolment cost via iyzico and enrol to course. +Base of this plugin forked from stripepayment plugin and implemented iyzico payment form. \ No newline at end of file diff --git a/settings.php b/settings.php new file mode 100644 index 0000000..4a2aebd --- /dev/null +++ b/settings.php @@ -0,0 +1,158 @@ +. + +/** + * Stript enrolments plugin settings and presets. + * + * @package enrol_iyzicopayment + * @copyright 2019 Dualcube Team + * @copyright 2021 Made by Sense + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +if (is_siteadmin()) { + + $settings->add(new admin_setting_heading( + 'enrol_iyzicopayment_settings', + '', + get_string('pluginname_desc', 'enrol_iyzicopayment') + )); + + $settings->add(new admin_setting_configtext( + 'enrol_iyzicopayment/publishablekey', + get_string('publishablekey', 'enrol_iyzicopayment'), + get_string('publishablekey_desc', 'enrol_iyzicopayment'), + '', + PARAM_TEXT + )); + $settings->add(new admin_setting_configtext( + 'enrol_iyzicopayment/secretkey', + get_string('secretkey', 'enrol_iyzicopayment'), + get_string('secretkey_desc', 'enrol_iyzicopayment'), + '', + PARAM_TEXT + )); + + $settings->add(new admin_setting_configcheckbox( + 'enrol_iyzicopayment/sandboxmode', + get_string('sandboxmode', 'enrol_iyzicopayment'), + get_string('sandboxmode_desc', 'enrol_iyzicopayment'), + 0 + )); + + $settings->add(new admin_setting_configcheckbox( + 'enrol_iyzicopayment/mailstudents', + get_string('mailstudents', 'enrol_iyzicopayment'), + '', + 0 + )); + + $settings->add(new admin_setting_configcheckbox( + 'enrol_iyzicopayment/mailteachers', + get_string('mailteachers', 'enrol_iyzicopayment'), + '', + 0 + )); + + $settings->add(new admin_setting_configcheckbox( + 'enrol_iyzicopayment/mailadmins', + get_string('mailadmins', 'enrol_iyzicopayment'), + '', + 0 + )); + + // Note: let's reuse the ext sync constants and strings here, internally it is very similar, + // it describes what should happen when users are not supposed to be enrolled any more. + $options = array( + ENROL_EXT_REMOVED_KEEP => get_string('extremovedkeep', 'enrol'), + ENROL_EXT_REMOVED_SUSPENDNOROLES => get_string('extremovedsuspendnoroles', 'enrol'), + ENROL_EXT_REMOVED_UNENROL => get_string('extremovedunenrol', 'enrol'), + ); + $settings->add(new admin_setting_configselect( + 'enrol_iyzicopayment/expiredaction', + get_string('expiredaction', 'enrol_iyzicopayment'), + get_string('expiredaction_help', 'enrol_iyzicopayment'), + ENROL_EXT_REMOVED_SUSPENDNOROLES, + $options + )); + + // Enrol instance defaults. + $settings->add(new admin_setting_heading( + 'enrol_iyzicopayment_defaults', + get_string('enrolinstancedefaults', 'admin'), + get_string('enrolinstancedefaults_desc', 'admin') + )); + + $options = array( + ENROL_INSTANCE_ENABLED => get_string('yes'), + ENROL_INSTANCE_DISABLED => get_string('no') + ); + $settings->add(new admin_setting_configselect( + 'enrol_iyzicopayment/status', + get_string('status', 'enrol_iyzicopayment'), + get_string('status_desc', 'enrol_iyzicopayment'), + ENROL_INSTANCE_DISABLED, + $options + )); + + $settings->add(new admin_setting_configtext( + 'enrol_iyzicopayment/cost', + get_string('cost', 'enrol_iyzicopayment'), + '', + 0, + PARAM_FLOAT, + 4 + )); + + $iyzicocurrencies = enrol_get_plugin('iyzicopayment')->get_currencies(); + $settings->add(new admin_setting_configselect( + 'enrol_iyzicopayment/currency', + get_string('currency', 'enrol_iyzicopayment'), + '', + 'TRY', + $iyzicocurrencies + )); + + $settings->add(new admin_setting_configtext( + 'enrol_iyzicopayment/maxenrolled', + get_string('maxenrolled', 'enrol_iyzicopayment'), + get_string('maxenrolled_help', 'enrol_iyzicopayment'), + 0, + PARAM_INT + )); + + if (!during_initial_install()) { + $options = get_default_enrol_roles(context_system::instance()); + $student = get_archetype_roles('student'); + $student = reset($student); + $settings->add(new admin_setting_configselect( + 'enrol_iyzicopayment/roleid', + get_string('defaultrole', 'enrol_iyzicopayment'), + get_string('defaultrole_desc', 'enrol_iyzicopayment'), + $student->id, + $options + )); + } + + $settings->add(new admin_setting_configduration( + 'enrol_iyzicopayment/enrolperiod', + get_string('enrolperiod', 'enrol_iyzicopayment'), + get_string('enrolperiod_desc', 'enrol_iyzicopayment'), + 0 + )); +} diff --git a/thirdpartylibs.xml b/thirdpartylibs.xml new file mode 100644 index 0000000..649b3b0 --- /dev/null +++ b/thirdpartylibs.xml @@ -0,0 +1,8 @@ + + + + iyzipay + iyzipay-php + MIT + + \ No newline at end of file diff --git a/unenrolself.php b/unenrolself.php new file mode 100644 index 0000000..ec56b7e --- /dev/null +++ b/unenrolself.php @@ -0,0 +1,61 @@ +. + +/** + * iyzico enrolment plugin - support for user self unenrolment. + * + * @package enrol_iyzicopayment + * @copyright 2019 Dualcube Team + * @copyright 2021 Made by Sense + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +require('../../config.php'); + +$enrolid = required_param('enrolid', PARAM_INT); +$confirm = optional_param('confirm', 0, PARAM_BOOL); +$instance = $DB->get_record('enrol', array('id' => $enrolid, 'enrol' => 'iyzicopayment'), '*', MUST_EXIST); +$course = $DB->get_record('course', array('id' => $instance->courseid), '*', MUST_EXIST); +$context = context_course::instance($course->id, MUST_EXIST); + +require_login(); +if (!is_enrolled($context)) { + redirect(new moodle_url('/')); +} +require_login($course); + +$plugin = enrol_get_plugin('iyzicopayment'); + +// Security defined inside following function. +if (!$plugin->get_unenrolself_link($instance)) { + redirect(new moodle_url('/course/view.php', array('id' => $course->id))); +} + +$PAGE->set_url('/enrol/iyzicopayment/unenrolself.php', array('enrolid' => $instance->id)); +$PAGE->set_title($plugin->get_instance_name($instance)); + +if ($confirm and confirm_sesskey()) { + $plugin->unenrol_user($instance, $USER->id); + + redirect(new moodle_url('/index.php')); +} + +echo $OUTPUT->header(); +$yesurl = new moodle_url($PAGE->url, array('confirm' => 1, 'sesskey' => sesskey())); +$nourl = new moodle_url('/course/view.php', array('id' => $course->id)); +$message = get_string('unenrolselfconfirm', 'enrol_iyzicopayment', format_string($course->fullname)); +echo $OUTPUT->confirm($message, $yesurl, $nourl); +echo $OUTPUT->footer(); diff --git a/version.php b/version.php new file mode 100644 index 0000000..f007376 --- /dev/null +++ b/version.php @@ -0,0 +1,33 @@ +. + +/** + * iyzico enrolment plugin version specification. + * + * @package enrol_iyzicopayment + * @copyright 2019 Dualcube Team + * @copyright 2021 Made by Sense + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$plugin->version = 2021011404; // The current plugin version (Date: YYYYMMDDXX). +$plugin->requires = 2013051401; // Requires this Moodle version. +$plugin->component = 'enrol_iyzicopayment'; // Full name of the plugin (used for diagnostics). +$plugin->maturity = MATURITY_STABLE; +$plugin->release = '1.0 (Build: 2021011404)'; +$plugin->cron = 60;