Skip to content

Latest commit

 

History

History
391 lines (272 loc) · 74.5 KB

README.md

File metadata and controls

391 lines (272 loc) · 74.5 KB

Cards

(cards)

Overview

Available Operations

  • link - Link a card to an existing Moov account.

Read our accept card payments guide to learn more.

Only use this endpoint if you have provided Moov with a copy of your PCI attestation of compliance.

During card linking, the provided data will be verified by submitting a $0 authorization (account verification) request. If merchantAccountID is provided, the authorization request will contain that account's statement descriptor and address. Otherwise, the platform account's profile will be used. If no statement descriptor has been set, the authorization will use the account's name instead.

It is strongly recommended that callers include the X-Wait-For header, set to payment-method, if the newly linked card is intended to be used right away. If this header is not included, the caller will need to poll the List Payment Methods endpoint to wait for the new payment methods to be available for use.

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/cards.write scope.

  • list - List all the active cards associated with a Moov account.

Read our accept card payments guide to learn more.

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/cards.read scope.

  • get - Fetch a specific card associated with a Moov account.

Read our accept card payments guide to learn more.

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/cards.read scope.

  • update - Update a linked card and/or resubmit it for verification.

If a value is provided for CVV, a new verification ($0 authorization) will be submitted for the card. Updating the expiration date or address will update the information stored on file for the card but will not be verified.

Read our accept card payments guide to learn more.

Only use this endpoint if you have provided Moov with a copy of your PCI attestation of compliance.

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/cards.write scope.

  • disable - Disables a card associated with a Moov account.

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/cards.write scope.

link

Link a card to an existing Moov account.

Read our accept card payments guide to learn more.

Only use this endpoint if you have provided Moov with a copy of your PCI attestation of compliance.

During card linking, the provided data will be verified by submitting a $0 authorization (account verification) request. If merchantAccountID is provided, the authorization request will contain that account's statement descriptor and address. Otherwise, the platform account's profile will be used. If no statement descriptor has been set, the authorization will use the account's name instead.

It is strongly recommended that callers include the X-Wait-For header, set to payment-method, if the newly linked card is intended to be used right away. If this header is not included, the caller will need to poll the List Payment Methods endpoint to wait for the new payment methods to be available for use.

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/cards.write scope.

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Moov\MoovPhp;
use Moov\MoovPhp\Models\Components;

$sdk = MoovPhp\Moov::builder()
    ->setSecurity(
        new Components\Security(
            username: '',
            password: '',
        )
    )
    ->build();

$linkCard = new Components\LinkCard(
    cardNumber: '4111111111111111',
    cardCvv: '123',
    expiration: new Components\CardExpiration(
        month: '01',
        year: '21',
    ),
    holderName: 'Jules Jackson',
    billingAddress: new Components\CardAddress(
        postalCode: '80301',
    ),
);

$response = $sdk->cards->link(
    accountID: '60ffc839-a919-48ea-a18a-26cccee05743',
    linkCard: $linkCard,
    xMoovVersion: 'v2024.01.00',
    xWaitFor: Components\LinkCardWaitFor::PaymentMethod

);

if ($response->card !== null) {
    // handle response
}

Parameters

Parameter Type Required Description Example
accountID string ✔️ N/A
linkCard Components\LinkCard ✔️ N/A {
"cardNumber": "4111111111111111",
"cardCvv": "123",
"expiration": {
"month": "01",
"year": "21"
},
"holderName": "Jules Jackson",
"billingAddress": {
"postalCode": "80301"
}
}
xMoovVersion ?string Specify an API version.

API versioning follows the format vYYYY.QQ.BB, where
- YYYY is the year
- QQ is the two-digit month for the first month of the quarter (e.g., 01, 04, 07, 10)
- BB is the build number, starting at .01, for subsequent builds in the same quarter.
- For example, v2024.01.00 is the initial release of the first quarter of 2024.

The latest version represents the most recent development state. It may include breaking changes and should be treated as a beta release.
xWaitFor ?Components\LinkCardWaitFor Optional header to wait for certain events, such as the creation of a payment method, to occur before returning a response.

When this header is set to payment-method, the response will include any payment methods that were created for the newly
linked card in the paymentMethods field. Otherwise, the paymentMethods field will be omitted from the response.
payment-method

Response

?Operations\LinkCardResponse

Errors

Error Type Status Code Content Type
Errors\GenericError 400, 409 application/json
Errors\LinkCardError 422 application/json
Errors\APIException 4XX, 5XX */*

list

List all the active cards associated with a Moov account.

Read our accept card payments guide to learn more.

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/cards.read scope.

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Moov\MoovPhp;
use Moov\MoovPhp\Models\Components;

$sdk = MoovPhp\Moov::builder()
    ->setSecurity(
        new Components\Security(
            username: '',
            password: '',
        )
    )
    ->build();



$response = $sdk->cards->list(
    accountID: 'c8a232aa-0b11-4b8a-b005-71e9e705d0e6',
    xMoovVersion: 'v2024.01.00'

);

if ($response->cards !== null) {
    // handle response
}

Parameters

Parameter Type Required Description
accountID string ✔️ N/A
xMoovVersion ?string Specify an API version.

API versioning follows the format vYYYY.QQ.BB, where
- YYYY is the year
- QQ is the two-digit month for the first month of the quarter (e.g., 01, 04, 07, 10)
- BB is the build number, starting at .01, for subsequent builds in the same quarter.
- For example, v2024.01.00 is the initial release of the first quarter of 2024.

The latest version represents the most recent development state. It may include breaking changes and should be treated as a beta release.

Response

?Operations\ListCardsResponse

Errors

Error Type Status Code Content Type
Errors\APIException 4XX, 5XX */*

get

Fetch a specific card associated with a Moov account.

Read our accept card payments guide to learn more.

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/cards.read scope.

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Moov\MoovPhp;
use Moov\MoovPhp\Models\Components;

$sdk = MoovPhp\Moov::builder()
    ->setSecurity(
        new Components\Security(
            username: '',
            password: '',
        )
    )
    ->build();



$response = $sdk->cards->get(
    accountID: 'b888f774-3e7c-4135-a18c-6b985523c4bc',
    cardID: '01234567-89ab-cdef-0123-456789abcdef',
    xMoovVersion: 'v2024.01.00'

);

if ($response->card !== null) {
    // handle response
}

Parameters

Parameter Type Required Description Example
accountID string ✔️ N/A
cardID string ✔️ N/A 01234567-89ab-cdef-0123-456789abcdef
xMoovVersion ?string Specify an API version.

API versioning follows the format vYYYY.QQ.BB, where
- YYYY is the year
- QQ is the two-digit month for the first month of the quarter (e.g., 01, 04, 07, 10)
- BB is the build number, starting at .01, for subsequent builds in the same quarter.
- For example, v2024.01.00 is the initial release of the first quarter of 2024.

The latest version represents the most recent development state. It may include breaking changes and should be treated as a beta release.

Response

?Operations\GetCardResponse

Errors

Error Type Status Code Content Type
Errors\APIException 4XX, 5XX */*

update

Update a linked card and/or resubmit it for verification.

If a value is provided for CVV, a new verification ($0 authorization) will be submitted for the card. Updating the expiration date or address will update the information stored on file for the card but will not be verified.

Read our accept card payments guide to learn more.

Only use this endpoint if you have provided Moov with a copy of your PCI attestation of compliance.

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/cards.write scope.

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Moov\MoovPhp;
use Moov\MoovPhp\Models\Components;

$sdk = MoovPhp\Moov::builder()
    ->setSecurity(
        new Components\Security(
            username: '',
            password: '',
        )
    )
    ->build();

$updateCard = new Components\UpdateCard(
    cardCvv: '456',
);

$response = $sdk->cards->update(
    accountID: 'd95fa7f0-e743-42ce-b47c-b60cc78135dd',
    cardID: '01234567-89ab-cdef-0123-456789abcdef',
    updateCard: $updateCard,
    xMoovVersion: 'v2024.01.00'

);

if ($response->card !== null) {
    // handle response
}

Parameters

Parameter Type Required Description Example
accountID string ✔️ N/A
cardID string ✔️ N/A 01234567-89ab-cdef-0123-456789abcdef
updateCard Components\UpdateCard ✔️ N/A {
"cardCvv": "456"
}
xMoovVersion ?string Specify an API version.

API versioning follows the format vYYYY.QQ.BB, where
- YYYY is the year
- QQ is the two-digit month for the first month of the quarter (e.g., 01, 04, 07, 10)
- BB is the build number, starting at .01, for subsequent builds in the same quarter.
- For example, v2024.01.00 is the initial release of the first quarter of 2024.

The latest version represents the most recent development state. It may include breaking changes and should be treated as a beta release.

Response

?Operations\UpdateCardResponse

Errors

Error Type Status Code Content Type
Errors\GenericError 400, 409 application/json
Errors\UpdateCardError 422 application/json
Errors\APIException 4XX, 5XX */*

disable

Disables a card associated with a Moov account.

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/cards.write scope.

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Moov\MoovPhp;
use Moov\MoovPhp\Models\Components;

$sdk = MoovPhp\Moov::builder()
    ->setSecurity(
        new Components\Security(
            username: '',
            password: '',
        )
    )
    ->build();



$response = $sdk->cards->disable(
    accountID: 'cd7cd1ce-90cc-444b-ac3e-badb79be277f',
    cardID: '01234567-89ab-cdef-0123-456789abcdef',
    xMoovVersion: 'v2024.01.00'

);

if ($response->statusCode === 200) {
    // handle response
}

Parameters

Parameter Type Required Description Example
accountID string ✔️ N/A
cardID string ✔️ N/A 01234567-89ab-cdef-0123-456789abcdef
xMoovVersion ?string Specify an API version.

API versioning follows the format vYYYY.QQ.BB, where
- YYYY is the year
- QQ is the two-digit month for the first month of the quarter (e.g., 01, 04, 07, 10)
- BB is the build number, starting at .01, for subsequent builds in the same quarter.
- For example, v2024.01.00 is the initial release of the first quarter of 2024.

The latest version represents the most recent development state. It may include breaking changes and should be treated as a beta release.

Response

?Operations\DisableCardResponse

Errors

Error Type Status Code Content Type
Errors\GenericError 400, 409 application/json
Errors\APIException 4XX, 5XX */*