Last active
January 24, 2018 14:01
-
-
Save murilohns/456d9cdcaa5b5948b3514302b2d70331 to your computer and use it in GitHub Desktop.
create transaction 2017-08-28
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require("pagarme-php/Pagarme.php"); | |
PagarMe::setApiKey("SUA_CHAVE_DE_API"); | |
$transaction = new PagarMe_Transaction(array( | |
"amount"=> 21000, | |
"card_number"=> "4111111111111111", | |
"card_cvv"=> "123", | |
"card_expiration_month"=> "09", | |
"card_expiration_year"=> "22", | |
"card_holder_name"=> "Morpheus Fishburne", | |
"customer"=> array( | |
"external_id"=> "#3311", | |
"name"=> "Morpheus Fishburne", | |
"type"=> "individual", | |
"country"=> "br", | |
"email"=> "[email protected]", | |
"documents"=> array( | |
array( | |
"type"=> "cpf", | |
"number"=> "00000000000" | |
) | |
), | |
"phone_numbers"=> array("+5511999998888", "+5511888889999"), | |
"birthday"=> "1965-01-01" | |
), | |
"billing"=> array( | |
"name"=> "Trinity Moss", | |
"address"=> array( | |
"country"=> "br", | |
"state"=> "sp", | |
"city"=> "Cotia", | |
"neighborhood"=> "Rio Cotia", | |
"street"=> "Rua Matrix", | |
"street_number"=> "9999", | |
"zipcode"=> "06714360" | |
) | |
), | |
"shipping"=> array( | |
"name"=> "Neo Reeves", | |
"fee"=> 1000, | |
"delivery_date"=> "2000-12-21", | |
"expedited"=> true, | |
"address"=> array( | |
"country"=> "br", | |
"state"=> "sp", | |
"city"=> "Cotia", | |
"neighborhood"=> "Rio Cotia", | |
"street"=> "Rua Matrix", | |
"street_number"=> "9999", | |
"zipcode"=> "06714360" | |
) | |
), | |
"items"=> array( | |
array( | |
"id"=> "r123", | |
"title"=> "Red pill", | |
"unit_price"=> 10000, | |
"quantity"=> 1, | |
"tangible"=> true | |
), | |
array( | |
"id"=> "b123", | |
"title"=> "Blue pill", | |
"unit_price"=> 10000, | |
"quantity"=> 1, | |
"tangible"=> true | |
) | |
) | |
)); | |
$transaction->charge(); | |
print_r($transaction); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment