Skip to content

Latest commit

 

History

History
67 lines (47 loc) · 1.9 KB

File metadata and controls

67 lines (47 loc) · 1.9 KB

Elements

Accept payment methods from around the globe with a single secure, embeddable UI component. For more information, please read the Elements Documentation

$elementsController = $client->getElementsController();

Class Name

ElementsController

Transaction Intention

Elements uses a TransactionIntention object to represent your intent to collect payment from a customer, tracking charge attempts and payment state changes throughout the process.

function transactionIntention(V1ElementsTransactionIntentionRequest $body): ResponseTransactionIntention

Parameters

Parameter Type Tags Description
body V1ElementsTransactionIntentionRequest Body, Required -

Response Type

ResponseTransactionIntention

Example Usage

$body = new Models\V1ElementsTransactionIntentionRequest();

$result = $elementsController->transactionIntention($body);

Example Response (as JSON)

{
  "type": "TransactionIntention",
  "data": {
    "action": "sale",
    "methods": [
      {
        "type": "cc",
        "product_transaction_id": "11e95f8ec39de8fbdb0a4f1a"
      }
    ],
    "location_id": "11e95f8ec39de8fbdb0a4f1a",
    "contact_id": "11e95f8ec39de8fbdb0a4f1a",
    "ach_sec_code": "WEB",
    "client_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
  }
}

Errors

HTTP Status Code Error Description Exception Class
401 Unauthorized Response401tokenException
412 Precondition Failed Response412Exception