PHP code example of ipagdevs / ipag-sdk-php

1. Go to this page and download the library: Download ipagdevs/ipag-sdk-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ipagdevs / ipag-sdk-php example snippets


$ipagClient = new \Ipag\Sdk\Core\IpagClient(
    'apiID',
    'apiKey',
    IpagEnvironment::SANDBOX
);

$paymentTransaction = new \Ipag\Sdk\Model\PaymentTransaction(
    [
        'amount' => 100,
        'callback_url' => 'https://ipag-sdk.requestcatcher.com/callback',
        'order_id' => '12345679',
        'payment' => [
            'type' => Ipag\Sdk\Core\Enums\PaymentTypes::CARD,
            'method' => Ipag\Sdk\Core\Enums\Cards::VISA,
            'installments' => 4,
            'card' => [
                'holder' => 'Bruce Wayne',
                'number' => '4111 1111 1111 1111',
                'expiry_month' => '01',
                'expiry_year' => '2025',
                'cvv' => '123'
            ]
        ],
        'customer' => [
            'name' => 'Bruce Wayne',
            'cpf_cnpj' => '490.558.550-30'
        ]
    ]
);

$paymentTransaction = (new \Ipag\Sdk\Model\PaymentTransaction())
    ->setAmount(100)
    ->setOrderId('123456')
    ->setCallbackUrl('https://ipag-sdk.requestcatcher.com/callback')
    ->setAntifraud(
        (new \Ipag\Sdk\Model\PaymentAntifraud())
            ->setFingerprint('123')
            ->setProvider('anti')
    )
    ->setPayment(
        (new \Ipag\Sdk\Model\Payment())
            ->setType(Ipag\Sdk\Core\Enums\PaymentTypes::CARD)
            ->setMethod(Ipag\Sdk\Core\Enums\Cards::VISA)
            ->setCard(
                (new \Ipag\Sdk\Model\PaymentCard())
                    ->setHolder('Bruce Wayne')
                    ->setNumber('4111 1111 1111 1111')
                    ->setCvv('123')
            )
    )
    ->setCustomer(
        (new \Ipag\Sdk\Model\Customer())
            ->setName('Bruce Wayne')
            ->setCpfCnpj('490.558.550-30')
            ->setBillingAddress(
                (new \Ipag\Sdk\Model\Address())
                    ->setStreet('Avenida Principal')
            )
            ->setShippingAddress(
                (new \Ipag\Sdk\Model\Address())
                    ->setStreet('Avenida Principal')
            )
    )
    ->setProducts([
        (new \Ipag\Sdk\Model\Product())
            ->setName('Smart TV LG 55 4K UHD'),
    ])
    ->addProduct(
        (new \Ipag\Sdk\Model\Product())
            ->setName('LED Android TV 4K UHD LED')
    )
    ->setSubscription(
        (new \Ipag\Sdk\Model\PaymentSubscription())
            ->setFrequency(1)
            ->setTrial(
                (new \Ipag\Sdk\Model\Trial())
                    ->setAmount(100)
            )
    )
    ->setSplitRules([
        (new \Ipag\Sdk\Model\PaymentSplitRules())
            ->setSellerId('[email protected]')
            ->setAmount(15),
    ])
    ->addSplitRules(
        (new \Ipag\Sdk\Model\PaymentSplitRules())
            ->setSellerId('[email protected]')
            ->setPercentage(20.0)
    );

$responsePayment = $ipagClient->payment()->create($paymentTransaction);

$responsePayment = $ipagClient->payment()->getById($transactionId);

$responsePayment = $ipagClient->payment()->getByUuid($transactionUuid);

$responsePayment = $ipagClient->payment()->getByUuid($transactionTid);

$responsePayment = $ipagClient->payment()->getByUuid($orderId);

$responsePayment = $ipagClient->payment()->captureById($transactionId, $amount);

$responsePayment = $ipagClient->payment()->captureByUuid($transactionUuid, $amount);

$responsePayment = $ipagClient->payment()->captureByUuid($transactionTid, $amount);

$responsePayment = $ipagClient->payment()->captureByUuid($orderId, $amount);

$responsePayment = $ipagClient->payment()->cancelById($transactionId, $amount);

$responsePayment = $ipagClient->payment()->cancelByUuid($transactionUuid, $amount);

$responsePayment = $ipagClient->payment()->cancelByUuid($transactionTid, $amount);

$responsePayment = $ipagClient->payment()->cancelByUuid($orderId, $amount);

$customer = new \Ipag\Sdk\Model\Customer([
    'name' => 'Bruce Wayne',
    'email' => '[email protected]',
    'cpf_cnpj' => '490.558.550-30',
    'phone' => '(22) 2222-33333',
    'business_name' => 'Wayne Enterprises',
    'birthdate' => '1987-02-19',
    'address' => [
        'street' => 'Avenida Principal',
        'number' => '12345',
        'district' => 'São Paulo',
        'city' => 'São Paulo',
        'state' => 'SP',
        'zipcode' => '01310-000'
    ]
]);

$customer = new \Ipag\Sdk\Model\Customer()
    ->setName('Bruce Wayne')
    ->setEmail('[email protected]')
    ->setCpfCnpj('490.558.550-30')
    ->setPhone('(22) 2222-33333')
    ->setBusinessName('Wayne Enterprises')
    ->setAddress(
        new \Ipag\Sdk\Model\Address()
            ->setStreet('Avenida Paulista')
            ->setNumber('12345')
            ->setDistrict('São Paulo')
            ->setCity('São Paulo')
            ->setState('SP')
            ->setZipcode('01310-000')
);

$responseCustomer = $ipagClient->customer()->create($customer);

$responseCustomer = $ipagClient->customer()->update($customer, $customerId);

$responseCustomer = $ipagClient->customer()->get($customerId);

$responseCustomer = $ipagClient->customer()->list([
    'name' => 'wayne'
]);

$responseCustomer = $ipagClient->customer()->delete($customerId);

$subscriptionPlan = new \Ipag\Sdk\Model\SubscriptionPlan([
    'name' => 'PLANO GOLD',
    'description' => 'Plano Gold com até 4 treinos por semana',
    'amount' => 100,
    'frequency' => Ipag\Sdk\Core\Enums\Interval::MONTHLY,
    'interval' => 1,
    'cycles' => 0,
    'best_day' => true,
    'pro_rated_charge' => true,
    'grace_period' => 0,
    'callback_url' => 'https://ipag-sdk.requestcatcher.com/callback',
    'installments' => 1,
    'trial' => [
        'amount' => 0,
        'cycles' => 0
    ]
]);

$subscriptionPlan = new \Ipag\Sdk\Model\SubscriptionPlan()
    ->setName("PLANO GOLD")
    ->setDescription("Plano Gold com até 4 treinos por semana")
    ->setAmount(100)
    ->setFrequency(Ipag\Sdk\Core\Enums\Interval::MONTHLY)
    ->setInterval(1)
    ->setCycles(0)
    ->setBestDay(true)
    ->setProRatedCharge(true)
    ->setGracePeriod(0)
    ->setCallbackUrl("https://ipag-sdk.requestcatcher.com/callback")
    ->setInstallments(1)
    ->setTrial(
        new \Ipag\Sdk\Model\Trial()
            ->setAmount(0)
            ->setCycles(0)
);

$responseSubscriptionPlan = $ipagClient->subscriptionPlan()->create($subscriptionPlan);

$responseSubscriptionPlan = $ipagClient->subscriptionPlan()->update($subscriptionPlan, $subscriptionPlanId);

$responseSubscriptionPlan = $ipagClient->subscriptionPlan()->get($subscriptionPlanId);

$responseSubscriptionPlan = $ipagClient->subscriptionPlan()->list([
    'name' => 'GOLD',
]);

$ipagClient->subscriptionPlan()->delete($subscriptionPlanId);

$subscription = new \Ipag\Sdk\Model\Subscription([
    'is_active' => true,
    'profile_id' => 'SUB_01',
    'plan_id' => 1,
    'customer_id' => 100001,
    'starting_date' => '2021-07-11',
    'closing_date' => '2021-08-11',
    'callback_url' => 'https://ipag-sdk.requestcatcher.com/callback',
    'creditcard_token' => '123'
]);


$subscription = new \Ipag\Sdk\Model\Subscription()
    ->setIsActive(true)
    ->setProfileId('SUB_001')
    ->setPlanId(1)
    ->setCustomerId(100001)
    ->setStartingDate('2021-07-11')
    ->setClosingDate('2021-08-11')
    ->setCallbackUrl('https://ipag-sdk.requestcatcher.com/callback')
    ->setCreditcardToken('123');


$responseSubscription = $ipagClient->subscription()->create($subscription);

$responseSubscription = $ipagClient->subscription()->update($subscription, $subscriptionId);

$responseSubscription = $ipagClient->subscription()->get($subscriptionId);

$responseSubscription = $ipagClient->subscription()->list([
    'is_active' => true,
]);

$responseSubscription = $ipagClient->subscription()->unlinkToken($subscriptionId);

$responseSubscription = $ipagClient->subscription()->payOffInstallment($subscriptionId, $invoiceNumber);

$responseSubscription = $ipagClient->subscription()->scheduleInstallmentPayment($subscriptionId, $invoiceNumber);

$responseTransaction = $ipagClient->transaction()->get($transactionId);

$responseTransaction = $ipagClient->transaction()->list([
    'order' => 'desc',
    'from_date' => '2023-08-29'
]);

$responseTransaction = $client->transaction()->releaseReceivables($sellerId, $transactionId);

$token = new \Ipag\Sdk\Model\Token([
    'card' => [
        'holderName' => 'Bruce Wayne',
        'number' => '4111 1111 1111 1111',
        'expiryMonth' => '01',
        'expiryYear' => '2025',
        'cvv' => '123'
    ],
    'holder' => [
        'name' => 'Bruce Wayne',
        'cpfCnpj' => '490.558.550-30',
        'mobilePhone' => '(22) 2222-33333',
        'birthdate' => '1987-02-19',
        'address' => [
                'street' => 'Avenida Principal',
                'number' => '12345',
                'complement' => 'Sala 02',
                'district' => 'São Paulo',
                'city' => 'São Paulo',
                'state' => 'SP',
                'zipcode' => '01310-000'
            ]
    ]
]);

$token = (new \Ipag\Sdk\Model\Token())
    ->setCard(
        (new \Ipag\Sdk\Model\Card())
            ->setHolderName('Bruce Wayne')
            ->setNumber('4111 1111 1111 1111')
            ->setExpiryMonth('01')
            ->setExpiryYear('2025')
            ->setCvv('123')
    )
    ->setHolder(
        (new \Ipag\Sdk\Model\Holder())
            ->setName('Bruce Wayne')
            ->setCpfCnpj('490.558.550-30')
            ->setMobilePhone('(22) 2222-33333')
            ->setBirthdate('1987-02-19')
            ->setAddress(
                new \Ipag\Sdk\Model\Address()
                    ->setStreet('Avenida Principal')
            )
    );

$responseToken = $ipagClient->token()->create($token);

$responseToken = $ipagClient->token()->get($tokenValue);

$charge = new \Ipag\Sdk\Model\Charge([
    'amount' => 100,
    'description' => 'Cobrança referente a negociação de débito pendente na Empresa X',
    'due_date' => '2020-10-30',
    'frequency' => 1,
    'interval' => Ipag\Sdk\Core\Enums\Interval::MONTH,
    'type' => 'charge',
    'last_charge_date' => '2020-10-30',
    'callback_url' => 'https://ipag-sdk.requestcatcher.com/callback',
    'auto_debit' => false,
    'installments' => 12,
    'is_active' => true,
    'products' => [1, 2, 3],
    'customer' => [
        'name' => 'Bruce Wayne',
    ],
    'checkout_settings' => [
        'max_installments' => 12,
    ]
]);

$charge = (new \Ipag\Sdk\Model\Charge())
    ->setAmount(100)
    ->setDescription('Cobrança referente a negociação de débito pendente na Empresa X')
    ->setDueDate('2020-10-30')
    ->setFrequency(1)
    ->setInterval(Ipag\Sdk\Core\Enums\Interval::MONTH)
    ->setType('charge')
    ->setLastChargeDate('2020-10-30')
    ->setCallbackUrl('https://ipag-sdk.requestcatcher.com/callback')
    ->setAutoDebit(false)
    ->setInstallments(12)
    ->setIsActive(true)
    ->setProducts([1, 2, 3])
    ->setCustomer(
        (new \Ipag\Sdk\Model\Customer())
            ->setName('Bruce Wayne')
    )
    ->setCheckoutSettings(
        (new \Ipag\Sdk\Model\CheckoutSettings())
            ->setMaxInstallments(12)
    );

$responseCharge = $ipagClient->charge()->create($charge);

$responseCharge = $ipagClient->charge()->update($charge, $chargeId);

$responseCharge = $ipagClient->charge()->get($chargeId);

$responseCharge = $ipagClient->charge()->list([
    'is_active' => false,
]);

$establishment = new \Ipag\Sdk\Model\Establishment([
    'name' => 'Bruce Wayne',
    'email' => '[email protected]',
    'login' => 'wayne1',
    'password' => 'bat123',
    'document' => '490.558.550-30',
    'phone' => '(22) 2222-33333',
    'address' =>
        [
            'street' => 'Avenida Principal',
        ],
    'owner' => [
        'name' => 'Bruce Wayne',
    ],
    'bank' => [
        'code' => '999'
    ]
]);

$establishment = (new \Ipag\Sdk\Model\Establishment())
    ->setName('Bruce Wayne')
    ->setEmail('[email protected]')
    ->setLogin('wayne1')
    ->setPassword('bat123')
    ->setPhone('(22) 2222-33333')
    ->setDocument('490.558.550-30')
    ->setAddress(new \Ipag\Sdk\Model\Address())
    ->setOwner(new \Ipag\Sdk\Model\Owner())
    ->setBank(new \Ipag\Sdk\Model\Bank());

$responseEstablishment = $ipagClient->establishment()->create($establishment);

$responseEstablishment = $ipagClient->establishment()->update($establishment, $establishmentTid);

$responseEstablishment = $ipagClient->establishment()->get($establishmentTid);

$responseEstablishment = $ipagClient->establishment()->list();

$responseTransactions = $ipagClient->establishment()->transaction()->list();

$responseTransactions = $ipagClient->establishment()->transaction()->listByEstablishment($establishmentTid);

$responseTransactions = $ipagClient->establishment()->transaction()->getByEstablishment($establishmentTid, $transactionTid);

$paymentMethod = new \Ipag\Sdk\Model\PaymentMethod([
    'acquirer' => 'stone',
    'priority' => 100,
    'environment' => 'test',
    'capture' => true,
    'retry' => true,
    'credentials' =>
        (
            (new Ipag\Sdk\Support\Credentials\PaymentMethods\StoneCredentials())
                ->setStoneCode('xxxxx')
                ->setStoneSak('xxxxxx')
        )->jsonSerialize(),
]);

$responseConfig = $ipagClient
    ->establishment()
    ->paymentMethods()
    ->config($paymentMethod, $establishmentTid);

$antifraud = new \Ipag\Sdk\Model\Antifraud(
    [
        'provider' => (
            new Ipag\Sdk\Support\Provider\Antifraudes\RedShieldProvider([
                'token' => 'xxxxxxxx',
                'entityId' => 'xxxxxxxx',
                'channelId' => 'xxxxxxxx',
                'serviceId' => 'xxxxxxxx'
            ])
        )->jsonSerialize(),
        'settings' => [
            'enable' => true,
            'environment' => 'test',
            'consult_mode' => 'auto',
            'capture_on_approval' => false,
            'cancel_on_refused' => true,
            'review_score_threshold' => 0.8
        ]
    ]
);

$responseConfig = $ipagClient
    ->establishment()
    ->antifraud()
    ->config($antifraud, $establishmentTid);

$splitRules = new \Ipag\Sdk\Model\SplitRules([
    'receiver_id' => '1000000',
    'percentage' => 10.00
]);

$splitRules = (new \Ipag\Sdk\Model\SplitRules())
    ->setReceiverId('1000000')
    ->setPercentage(10);

$responseSplitRules = $ipagClient->splitRules()->create($splitRules, $transactionId);

$responseSplitRules = $ipagClient->splitRules()->get($splitRuleId, $transactionId);

$responseSplitRules = $ipagClient->splitRules()->list($transactionId);

$responseSplitRules = $ipagClient->splitRules()->delete($splitRuleId, $transactionId);

$seller = new \Ipag\Sdk\Model\Seller([
    'login' => 'jimgordon',
    'password' => 'jim123',
    'name' => 'Jim Gordon',
    'cpf_cnpj' => '168.853.290-02',
    'email' => '[email protected]',
    'phone' => '(11) 3333-44444',
    'description' => '',
    'address' => [
        'street' => 'Avenida Principal',
        'number' => '12345',
        'district' => 'São Paulo',
        'city' => 'São Paulo',
        'state' => 'SP',
        'zipcode' => '01310-000'
    ],
    'owner' => [
        'name' => 'Bruce Wayne',
        'email' => '[email protected]',
        'cpf' => '490.558.550-30',
        'phone' => '(22) 2222-33333',
        'birthdate' => '1987-02-19',
    ],
    'bank' => [
        'code' => '999',
        'agency' => '1234',
        'account' => '54321',
        'type' => 'checkings',
        'external_id' => '1',
    ]
]);

$seller = (new \Ipag\Sdk\Model\Seller())
    ->setLogin('jimgordon')
    ->setPassword('jim123')
    ->setName('Jim Gordon')
    ->setCpfCnpj('168.853.290-02')
    ->setEmail('[email protected]')
    ->setPhone('(11) 3333-44444')
    ->setDescription('')
    ->setAddress(
        (new \Ipag\Sdk\Model\Address())
            ->setStreet('Avenida Principal')
    )
    ->setOwner(
        (new \Ipag\Sdk\Model\Owner())
            ->setName('Bruce Wayne')
    )
    ->setBank(
        (new \Ipag\Sdk\Model\Bank())
            ->setCode('999')
    );

$responseSeller = $ipagClient->seller()->create($seller);

$responseSeller = $ipagClient->seller()->update($seller, $sellerId);

$responseSeller = $ipagClient->seller()->get($sellerId);

$responseSellers = $ipagClient->seller()->list();

$responseTransfers = $ipagClient->transfer()->list();

$responseTransfers = $ipagClient->transfer()->get($transferId);

$responseTransfers = $ipagClient->transfer()->seller()->list();

$responseTransfers = $ipagClient->transfer()->seller()->get($transferId);

$responseTransfers = $ipagClient->transfer()->future()->list();

$responseTransfers = $ipagClient->transfer()->future()->listBySellerId($sellerId);

$responseTransfers = $ipagClient->transfer()->future()->listBySellerCpfCnpj($sellerCpf);

$paymentLink = new \Ipag\Sdk\Model\PaymentLink([
    'externalCode' => '131',
    'amount' => 0,
    'description' => 'LINK DE PAGAMENTO SUPER BACANA',
    'expireAt' => '2020-12-30 23:00:00',
    'buttons' => [
        'enable' => false,
    ],
    'checkout_settings' => [
        'max_installments' => 12,
    ],
]);

$paymentLink = (new \Ipag\Sdk\Model\PaymentLink())
    ->setExternalCode('131')
    ->setAmount(0)
    ->setDescription('LINK DE PAGAMENTO SUPER BACANA')
    ->setExpireAt('2020-12-30 23:00:00')
    ->setButtons(
        (new \Ipag\Sdk\Model\Buttons())
            ->setEnable(false)
    )
    ->setCheckoutSettings(
        (new \Ipag\Sdk\Model\CheckoutSettings())
            ->setMaxInstallments(12)
    );

$responsePaymentLink = $ipagClient->paymentLinks()->create($paymentLink);

$responsePaymentLink = $ipagClient->paymentLinks()->getById($paymentLinkId);

$responsePaymentLink = $ipagClient->paymentLinks()->getByExternalCode($externalCode);

$webhook = new \Ipag\Sdk\Model\Webhook([
    'http_method' => 'POST',
    'url' => 'https://ipag-sdk.requestcatcher.com/webhook',
    'description' => 'Webhook para receber notificações de atualização das transações',
    'actions' => [
        \Ipag\Sdk\Core\Enums\Webhooks::PAYMENT_LINK_PAYMENT_SUCCEEDED,
        \Ipag\Sdk\Core\Enums\Webhooks::PAYMENT_LINK_PAYMENT_FAILED,
    ]
]);

$webhook = (new \Ipag\Sdk\Model\Webhook())
    ->setHttpMethod('POST')
    ->setUrl('https://ipag-sdk.requestcatcher.com/webhook')
    ->setDescription('Webhook para receber notificações de atualização das transações')
    ->setActions([
        \Ipag\Sdk\Core\Enums\Webhooks::PAYMENT_LINK_PAYMENT_SUCCEEDED,
        \Ipag\Sdk\Core\Enums\Webhooks::PAYMENT_LINK_PAYMENT_FAILED,
    ]);

$responseWebhook = $ipagClient->webhook()->create($webhook);

$responseWebhook = $ipagClient->webhook()->get($webhookId);

$responseWebhook = $ipagClient->webhook()->list();

$ok = $ipagClient->webhook()->delete($webhookId);

$checkout = new \Ipag\Sdk\Model\Checkout([
    'customer' => [
        'name' => 'Bruce Wayne',
        'tax_receipt' => '490.558.550-30',
        'email' => '[email protected]',
        'phone' => '(22) 2222-33333',
        'birthdate' => '1987-02-19',
        'address' => [
            'street' => 'Avenida Principal',
            'number' => '12345',
            'district' => 'São Paulo',
            'city' => 'São Paulo',
            'state' => 'SP',
            'zipcode' => '01310-000'
        ]
    ],
    'installment_setting' => [
        'max_installments' => 12,
        'min_installment_value' => 5,
        'interest' => 0,
        'interest_free_installments' => 12
    ],
    'order' => [
        'order_id' => '100001',
        'amount' => '15.00',
        'return_url' => 'https://ipag-sdk.requestcatcher.com/callback',
        'return_type' => 'json'
    ],
    'products' => [
        [
            'name' => 'Smart TV LG 55 4K UHD',
            'unit_price' => 5000,
            'quantity' => 1,
            'sku' => 'LG123',
            'description' => 'Experiência cristalina em 4K.'
        ],
        [
            'name' => 'LED Android TV 4K UHD LED',
            'unit_price' => 5000,
            'quantity' => 1,
            'sku' => 'SAM123',
            'description' => 'Android TV de 126 cm (50).'
        ],
    ],
    'split_rules' => [
        [
            'receiver' => 'qwertyuiopasdfghjklzxcvbnm123456',
            'percentage' => '50',
            'charge_processing_fee' => true,
        ],
        [
            'receiver' => '654321mnbvcxzlkjhgfdsapoiuytrewq',
            'percentage' => '20'
        ]
    ],
    'sellerId' => '100014',
    'expires_in' => 60,
]);

$checkout = (new \Ipag\Sdk\Model\Checkout())
    ->setCustomer(
        (new \Ipag\Sdk\Model\Customer())
            ->setName('Bruce Wayne')
    )
    ->setInstallmentSetting(
        (new \Ipag\Sdk\Model\InstallmentSetting())
            ->setMaxInstallments(12)
    )
    ->setOrder(
        (new \Ipag\Sdk\Model\Order())
            ->setOrderId('1000001')
    )
    ->addProduct(
        (new \Ipag\Sdk\Model\Product())
            ->setName('Smart TV LG 55 4K UHD')
    )
    ->addProduct(
        (new \Ipag\Sdk\Model\Product())
            ->setName('Smart TV 50" UHD 4K')
    )
    ->addSplitRule(
        (new \Ipag\Sdk\Model\SplitRules())
            ->setReceiverId('1000000')
    )
    ->addSplitRule(
        (new \Ipag\Sdk\Model\SplitRules())
            ->setReceiverId('1000001')
    )
    ->setSellerId('100014')
    ->setExpiresIn(60);

$responseCheckout = $ipagClient->checkout()->create($checkout);

$voucher = new \Ipag\Sdk\Model\Voucher([
    'order' => [
        'order_id' => '100015',
        'amount' => 100,
        'created_at' => '2020-08-04 21:45:10',
        'callback_url' => 'https://ipag-sdk.requestcatcher.com/callback'
    ],
    'seller' => [
        'cpf_cnpj' => '168.853.290-02',
    ],
    'customer' => [
        'name' => 'Jim Gordon',
        'cpf_cnpj' => '168.853.290-02',
        'email' => '[email protected]',
        'phone' => '(11) 3333-44444',
        'birthdate' => '1990-10-10',
        'address' => [
            'street' => 'Avenida Principal',
            'number' => '12345',
            'district' => 'São Paulo',
            'city' => 'São Paulo',
            'state' => 'SP',
            'zipcode' => '01310-000'
        ]
    ]
]);

$voucher = (new \Ipag\Sdk\Model\Voucher())
    ->setOrder(
        (new \Ipag\Sdk\Model\Order())
            ->setOrderId(
                '1000001'
            )
    )
    ->setSeller(
        (new \Ipag\Sdk\Model\Seller())
            ->setCpfCnpj(
                '168.853.290-02'
            )
    )
    ->setCustomer(
        (new \Ipag\Sdk\Model\Customer())
            ->setName(
                'Jim Gordon'
            )
            ->setAddress(
                (new \Ipag\Sdk\Model\Address())
                    ->setStreet('Avenida Principal')
            )
    );
php
$responseVoucher = $ipagClient->voucher()->create($voucher);
php
$clearSaleCredentials = (new \Ipag\Sdk\Support\Credentials\Antifraudes\ClearSaleCredentials())
    ->setName('XXXXX')
    ->setPassword('XXXXXXXX');
php
$kondutoCredentials = (new \Ipag\Sdk\Support\Credentials\Antifraudes\KondutoCredentials())
    ->setApiKey('XXXXX')
    ->setPublicKey('XXXXXXXX');
php
$redShieldCredentials = (new \Ipag\Sdk\Support\Credentials\Antifraudes\RedShieldCredentials())
    ->setToken('XXXXX')
    ->setEntityId('XXX')
    ->setChannelId('XXXXX')
    ->setServiceId('XX');
php
$adiqCredentials = (new \Ipag\Sdk\Support\Credentials\PaymentMethods\AdiqCredentials())
    ->setClientId('XXXXX')
    ->setClientSecret('XXXXXXXX');
php
$binCredentials = (new \Ipag\Sdk\Support\Credentials\PaymentMethods\BinCredentials())
    ->setStoreIdSubscription('XXXXX')
    ->setStoreId('XXXXXXXX');
php
$cieloCredentials = (new \Ipag\Sdk\Support\Credentials\PaymentMethods\CieloCredentials())
    ->setMerchantId('XXXXX')
    ->setMerchantKey('XXXXXXXX');
php
$getnetCredentials = (new \Ipag\Sdk\Support\Credentials\PaymentMethods\GetnetCredentials())
    ->setEstablishmentNumber('XXX')
    ->setKey('XXXXXXXX')
    ->setUser('XXX')
    ->setPassword('XXXXX');
php
$globalPaymentsCredentials = (new \Ipag\Sdk\Support\Credentials\PaymentMethods\GlobalPaymentsCredentials())
    ->setTerminal('XXXXX')
    ->setMerchantId('XXX')
    ->setMerchantKey('XXXXXXXX');
php
$redeCredentials = (new \Ipag\Sdk\Support\Credentials\PaymentMethods\RedeCredentials())
    ->setEredeKey('XXXXXXXX')
    ->setPv('XXXXX');
php
$sipagCredentials = (new \Ipag\Sdk\Support\Credentials\PaymentMethods\SipagCredentials())
    ->setStoreIdSubscription('XXXXXXXX')
    ->setStoreId('XXXXX');
php
$stoneCredentials = (new \Ipag\Sdk\Support\Credentials\PaymentMethods\StoneCredentials())
    ->setStoneCode('XXXXX')
    ->setStoneSak('XXXXXXXX');
php
$zoopCredentials = (new \Ipag\Sdk\Support\Credentials\PaymentMethods\ZoopCredentials())
    ->setMarketplaceId('XXX')
    ->setPublishableKey('XXXXXXXX')
    ->setSellerId('XXXXX');