Skip to content

Instantly share code, notes, and snippets.

@geekcom
Created October 2, 2018 20:47
Show Gist options
  • Save geekcom/59fb1a15dd5441d05e9befce82f8a037 to your computer and use it in GitHub Desktop.
Save geekcom/59fb1a15dd5441d05e9befce82f8a037 to your computer and use it in GitHub Desktop.
CreditCardPaymentTes
<?php
namespace Test;
use PHPUnit\Framework\TestCase;
class CreditCardPaymentTest extends TestCase
{
/**
* @dataProvider creditCardDataProvider
*/
public function testPassedDataToPagSeguroCreditCardtObject($expected, $data)
{
$this->assertEquals($expected, $data);
}
/**
* @return array
*/
public function creditCardDataProvider()
{
return [
'currency' => [
['currency' => 'BRL'],
['currency' => 'BRL']
],
'extraAmount' => [
['extraAmount' => 0.0],
['extraAmount' => 0.0]
],
'items' => [
[
'items' => [
'id' => 2,
'description' => 'Hummingbird printed sweater',
'quantity' => 1,
'amount' => 35.9,
'weight' => 0.0,
'shippingCost' => null],
],
[
'items' => [
'id' => 2,
'description' => 'Hummingbird printed sweater',
'quantity' => 1,
'amount' => 35.9,
'weight' => 0.0,
'shippingCost' => null
],
]
],
'mode' => [
['mode' => 'default'],
['mode' => 'default']
],
'nUrl' => [
['nUrl' => null],
['nUrl' => null]
],
'parameter' => [
['parameter' => null],
['parameter' => null]
],
'receiverEmail' => [
['receiverEmail' => '[email protected]'],
['receiverEmail' => '[email protected]']
],
'sender' => [
[
'sender' => [
'ip' => '127.0.0.1',
'hash' => '33e7e5f42c006452c14a85827eae3c4227a2237793bfb208f6939760900f2270',
'name' => 'Sender',
'email' => '[email protected]',
'phone' => [
'type' => null,
'areaCode' => '11',
'number' => '32245678',
],
'documents' => [
'type' => 'CPF',
'identifier' => '49381639000',
],
],
],
[
'sender' => [
'ip' => '127.0.0.1',
'hash' => '33e7e5f42c006452c14a85827eae3c4227a2237793bfb208f6939760900f2270',
'name' => 'Sender',
'email' => '[email protected]',
'phone' => [
'type' => null,
'areaCode' => '11',
'number' => '32245678',
],
'documents' => [
'type' => 'CPF',
'identifier' => '49381639000',
],
],
],
],
'holder' => [
[
'holder' => [
'name' => 'Sender',
'birthDate' => '01/01/1980',
'documents' => [
'type' => 'CPF',
'identifier' => '49381639000',
],
'phone' => [
'type' => null,
'areaCode' => '11',
'number' => '32245678',
],
],
],
[
'holder' => [
'name' => 'Sender',
'birthDate' => '01/01/1980',
'documents' => [
'type' => 'CPF',
'identifier' => '49381639000',
],
'phone' => [
'type' => null,
'areaCode' => '11',
'number' => '32245678',
],
],
],
],
'shipping' => [
[
'shipping' => [
'address' => [
'street' => 'Avenida Vicenza',
'number' => 'S/N',
'complement' => '',
'district' => 'Rua Nova',
'postalCode' => '44057300',
'city' => 'Sao Paulo',
'state' => 'SP',
'country' => 'BR',
],
'type' => [
'type' => 3,
],
'cost' => [
'cost' => 8.75,
],
'addressRequired' => null,
],
],
[
'shipping' => [
'address' => [
'street' => 'Avenida Vicenza',
'number' => 'S/N',
'complement' => '',
'district' => 'Rua Nova',
'postalCode' => '44057300',
'city' => 'Sao Paulo',
'state' => 'SP',
'country' => 'BR',
],
'type' => [
'type' => 3,
],
'cost' => [
'cost' => 8.75,
],
'addressRequired' => null,
],
]
],
'billing' => [
[
'billing' => [
'address' => [
'street' => 'Avenida Vicenza',
'number' => 'S/N',
'complement' => '',
'district' => 'Rua Nova',
'postalCode' => '44057300',
'city' => 'Sao Paulo',
'state' => 'SP',
'country' => 'BR',
],
],
],
[
'billing' => [
'address' => [
'street' => 'Avenida Vicenza',
'number' => 'S/N',
'complement' => '',
'district' => 'Rua Nova',
'postalCode' => '44057300',
'city' => 'Sao Paulo',
'state' => 'SP',
'country' => 'BR',
],
],
]
],
'installment' => [
[
'installment' => [
'installment' => [
'quantity' => '4',
'value' => 32.55,
'noInterestInstallmentQuantity' => null,
],
],
],
[
'installment' => [
'installment' => [
'quantity' => '4',
'value' => 32.55,
'noInterestInstallmentQuantity' => null,
],
],
]
],
'reference' => [
['reference' => 'V5FyDV9u'],
['reference' => 'V5FyDV9u']
],
'rUrl' => [
['rUrl' => null],
['rUrl' => null]
],
'token' => [
['token' => '6ab7546531dc469eb5b8b47d3e5b3d76'],
['token' => '6ab7546531dc469eb5b8b47d3e5b3d76']
]
];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment