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();ElementsController
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| Parameter | Type | Tags | Description |
|---|---|---|---|
body |
V1ElementsTransactionIntentionRequest |
Body, Required | - |
$body = new Models\V1ElementsTransactionIntentionRequest();
$result = $elementsController->transactionIntention($body);{
"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"
}
}| HTTP Status Code | Error Description | Exception Class |
|---|---|---|
| 401 | Unauthorized | Response401tokenException |
| 412 | Precondition Failed | Response412Exception |