# Generate transaction

```php
SimPay::payment()->generate()
    ->amount(15.00)
    // rest of fields are optional
    ->returns(
        new \SimPay\Laravel\Dto\ReturnData(
            'successUrl',
            'failedUrl',
        ),
    )
    ->billing(
        new \SimPay\Laravel\Dto\Payment\CustomerFullData(
            'First name',
            'Surname',
            'Street',
            'House number',
            'Flat',
            'City',
            'Region',
            'Post Code',
            'Country code',
            'Company',
        )
    )
    ->shipping(
        new \SimPay\Laravel\Dto\Payment\CustomerFullData(
            'First name',
            'Surname',
            'Street',
            'House number',
            'Flat',
            'City',
            'Region',
            'Post Code',
            'Country code',
            'Company',
        )
    )
    ->customer(
        new \SimPay\Laravel\Dto\Payment\CustomerData(
            'Name',
            'Email',
            'IP address',
            'Country Code (eg. PL, US, CY, GB)',
        )
    )
    ->antifraud(
        new \SimPay\Laravel\Dto\Payment\AntiFraudData(
            'UserAgent',
            'SteamID64',
            'Minecraft player username',
            'Minecraft player uuid',
            'systemID (mandatory for Recurrent Payments)',
        )
    )
    ->control('Control Data (for your integration, ex. your id from database)')
    ->description('Transaction Description')
    ->currency('Currency Code (default: PLN)')
    ->cart([
        new \SimPay\Laravel\Dto\Payment\CartItemData(
            name: 'Test product',
            quantity: 1,
            price: 5,
            procuder: 'Test producer',
            category: 'T-Shirts',
            code: 'TSHRT01' 
        ),
    ])
    ->referer('REFERRAL CODE')
    // one of
        ->directChannel('blik')
        // or
        ->channels(['blik', 'paysafecard', 'velo', 'blik-paylater', 'paypo'])
        // or
        ->channelTypes(new \SimPay\Laravel\Dto\Payment\ChannelTypeData(
            blik: true, // BLIK, BLIK Pay Later
            transfer: true, // Polish banks
            cards: true, // Credit cards
            ewallets: true, // Google Pay / Apple Pay  
            paypal: true, 
            paysafe: true, // PaysafeCard, Skrill
            latam: true, // Latin America payments
            postponed: false, // PayPo
        ))
    // make() is required to create payment.
    ->make();
```

Response will be [TransactionGeneratedResponse](/simpay-laravel/global-responses/transactiongeneratedresponse.md).\
\
If you want to use directChannel please see <https://docs.simpay.pl/payment/methods> to see available channels.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://simpaypl.gitbook.io/simpay-laravel/payments/transactions/generate-transaction.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
