Overview
  • Namespace
  • Class

Namespaces

  • Omnipay
    • Pagarme
      • Message

Classes

  • AbstractRequest
  • AuthorizeRequest
  • CaptureRequest
  • CreateCardRequest
  • CreateCustomerRequest
  • InstallmentsRequest
  • PurchaseRequest
  • RefundRequest
  • Response
  • VoidRequest

Class CreateCardRequest

Pagarme Create Credit Card Request

Whenever you make a request through the Pagarme's API the cardholder information is stored, so that in future, you can use this information to new charges, or implementing features like one-click-buy.

Either a card object or card_id is required. Otherwise, you must provide a card_hash, like the ones returned by Pagarme.js.

The customer_id is optional.

// Create a credit card object
  // This card can be used for testing.
  $new_card = new CreditCard(array(
              'firstName'    => 'Example',
              'lastName'     => 'Customer',
              'number'       => '5555555555554444',
              'expiryMonth'  => '01',
              'expiryYear'   => '2020',
              'cvv'          => '456',
  ));

  // Do a create card transaction on the gateway
  $response = $gateway->createCard(array(
      'card'              => $new_card,
      'customerReference' => $customer_id,
  ))->send();
  if ($response->isSuccessful()) {
      echo "Gateway createCard was successful.\n";
      // Find the card ID
      $card_id = $response->getCardReference();
      echo "Card ID = " . $card_id . "\n";
  }
Omnipay\Common\Message\AbstractRequest
Extended by Omnipay\Pagarme\Message\AbstractRequest
Extended by Omnipay\Pagarme\Message\CreateCardRequest
Namespace: Omnipay\Pagarme\Message
Link: https://docs.pagar.me/api/?shell#cartes
Located at Message/CreateCardRequest.php

Methods summary

public
# getData( )
public
# getEndpoint( )

Overrides

Omnipay\Pagarme\Message\AbstractRequest::getEndpoint

Methods inherited from Omnipay\Pagarme\Message\AbstractRequest

createResponse(), extractAddress(), extractDddPhone(), getApiKey(), getCard(), getCardData(), getCardHash(), getCustomer(), getCustomerData(), getCustomerReference(), getHttpMethod(), getMetadata(), insertApiKeyToData(), sendData(), setApiKey(), setCard(), setCardHash(), setCustomer(), setCustomerReference(), setMetadata()

Properties summary

Properties inherited from Omnipay\Pagarme\Message\AbstractRequest

$endpoint

API documentation generated by ApiGen