Iyzipay\Model\Refund::create PHP Метод

create() публичный статический Метод

public static create ( CreateRefundRequest $request, Options $options )
$request Iyzipay\Request\CreateRefundRequest
$options Iyzipay\Options
    public static function create(CreateRefundRequest $request, Options $options)
    {
        $rawResult = parent::httpClient()->post($options->getBaseUrl() . "/payment/refund", parent::getHttpHeaders($request, $options), $request->toJsonString());
        return RefundMapper::create($rawResult)->jsonDecode()->mapRefund(new Refund());
    }

Usage Example

Пример #1
0
<?php

require_once 'config.php';
# create request class
$request = new \Iyzipay\Request\CreateRefundRequest();
$request->setLocale(\Iyzipay\Model\Locale::TR);
$request->setConversationId("123456789");
$request->setPaymentTransactionId("1");
$request->setPrice("0.5");
$request->setCurrency(\Iyzipay\Model\Currency::TL);
$request->setIp("85.34.78.112");
# make request
$refund = \Iyzipay\Model\Refund::create($request, Config::options());
# print result
print_r($refund);
Refund