Class Gateway
Pagarme Gateway
Example:
// Create a gateway for the Pagarme Gateway // (routes to GatewayFactory::create) $gateway = Omnipay::create('Pagarme'); // Initialise the gateway $gateway->initialize(array( 'apiKey' => 'MyApiKey', )); // Create a credit card object // This card can be used for testing. $card = new CreditCard(array( 'firstName' => 'Example', 'lastName' => 'Customer', 'number' => '4242424242424242', 'expiryMonth' => '01', 'expiryYear' => '2020', 'cvv' => '123', 'email' => 'customer@example.com', 'address1' => 'Street name, Street number, Neighborhood', 'address2' => 'address complementary', 'postcode' => '05443100', 'phone' => '19 3242 8855', 'holder_document_number' => '214.278.589-40', )); // Do an authorize transaction on the gateway $transaction = $gateway->authorize(array( 'amount' => '10.00', 'soft_descriptor' => 'test', 'payment_method' => 'credit_card', 'card' => $card, 'metadata' => array( 'product_id' => 'ID1111', 'invoice_id' => 'IV2222', ), )); $response = $transaction->send(); if ($response->isSuccessful()) { echo "Authorize transaction was successful!\n"; $sale_id = $response->getTransactionReference(); $customer_id = $response->getCustomerReference(); $card_id = $response->getCardReference(); echo "Transaction reference = " . $sale_id . "\n"; }
Test modes:
Pagarme accounts have test-mode API keys as well as live-mode API keys. Data created with test-mode credentials will never hit the credit card networks and will never cost anyone money.
Unlike some gateways, there is no test mode endpoint separate to the live mode endpoint, the Pagarme API endpoint is the same for test and for live.
Setting the testMode flag on this gateway has no effect. To use test mode just use your test mode API key.
Authentication:
Authentication is by means of a single secret API key set as the apiKey parameter when creating the gateway object.
- Omnipay\Common\AbstractGateway
- Omnipay\Pagarme\Gateway
Namespace: Omnipay\Pagarme
See: \Omnipay\Common\AbstractGateway
See:
Link: https://docs.pagar.me/
Located at Gateway.php
See: \Omnipay\Common\AbstractGateway
See:
Omnipay\Pagarme\Message\AbstractRequest
Link: https://docs.pagar.me/
Located at Gateway.php
Methods summary
public
|
|
public
array
|
|
public
string
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|