Skip to content

Latest commit

 

History

History
467 lines (335 loc) · 29.1 KB

File metadata and controls

467 lines (335 loc) · 29.1 KB

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.

  • getMetadata - Look up metadata for a card without linking it to a Moov account.

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 /card-metadata.read 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

package hello.world;

import io.moov.sdk.Moov;
import io.moov.sdk.models.components.*;
import io.moov.sdk.models.errors.*;
import io.moov.sdk.models.operations.LinkCardResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws GenericError, DuplicateCardError, LinkCardError, Exception {

        Moov sdk = Moov.builder()
                .security(Security.builder()
                    .username("")
                    .password("")
                    .build())
            .build();

        LinkCardResponse res = sdk.cards().link()
                .xWaitFor(LinkCardWaitFor.PAYMENT_METHOD)
                .accountID("5593e46f-7936-474b-a52b-96f1da46867b")
                .linkCard(LinkCard.builder()
                    .cardNumber("4111111111111111")
                    .cardCvv("123")
                    .expiration(CardExpiration.builder()
                        .month("01")
                        .year("21")
                        .build())
                    .billingAddress(CardAddress.builder()
                        .postalCode("80301")
                        .build())
                    .holderName("Jules Jackson")
                    .build())
                .call();

        if (res.card().isPresent()) {
            System.out.println(res.card().get());
        }
    }
}

Parameters

Parameter Type Required Description Example
xWaitFor Optional<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
accountID String ✔️ N/A
linkCard LinkCard ✔️ N/A {
"cardNumber": "4111111111111111",
"cardCvv": "123",
"expiration": {
"month": "01",
"year": "21"
},
"holderName": "Jules Jackson",
"billingAddress": {
"postalCode": "80301"
}
}

Response

LinkCardResponse

Errors

Error Type Status Code Content Type
models/errors/GenericError 400 application/json
models/errors/DuplicateCardError 409 application/json
models/errors/LinkCardError 422 application/json
models/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

package hello.world;

import io.moov.sdk.Moov;
import io.moov.sdk.models.components.Security;
import io.moov.sdk.models.operations.ListCardsResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws Exception {

        Moov sdk = Moov.builder()
                .security(Security.builder()
                    .username("")
                    .password("")
                    .build())
            .build();

        ListCardsResponse res = sdk.cards().list()
                .accountID("b902712f-8ab9-47ba-b39f-5ccfbcac528c")
                .call();

        if (res.cards().isPresent()) {
            System.out.println(res.cards().get());
        }
    }
}

Parameters

Parameter Type Required Description
accountID String ✔️ N/A

Response

ListCardsResponse

Errors

Error Type Status Code Content Type
models/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

package hello.world;

import io.moov.sdk.Moov;
import io.moov.sdk.models.components.Security;
import io.moov.sdk.models.operations.GetCardResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws Exception {

        Moov sdk = Moov.builder()
                .security(Security.builder()
                    .username("")
                    .password("")
                    .build())
            .build();

        GetCardResponse res = sdk.cards().get()
                .accountID("1f590cf9-4db9-4241-8818-30f9c26362e8")
                .cardID("01234567-89ab-cdef-0123-456789abcdef")
                .call();

        if (res.card().isPresent()) {
            System.out.println(res.card().get());
        }
    }
}

Parameters

Parameter Type Required Description Example
accountID String ✔️ N/A
cardID String ✔️ N/A 01234567-89ab-cdef-0123-456789abcdef

Response

GetCardResponse

Errors

Error Type Status Code Content Type
models/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

package hello.world;

import io.moov.sdk.Moov;
import io.moov.sdk.models.components.Security;
import io.moov.sdk.models.components.UpdateCard;
import io.moov.sdk.models.errors.GenericError;
import io.moov.sdk.models.errors.UpdateCardError;
import io.moov.sdk.models.operations.UpdateCardResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws GenericError, UpdateCardError, Exception {

        Moov sdk = Moov.builder()
                .security(Security.builder()
                    .username("")
                    .password("")
                    .build())
            .build();

        UpdateCardResponse res = sdk.cards().update()
                .accountID("7104688e-8434-482e-9556-4784be3ad3fe")
                .cardID("01234567-89ab-cdef-0123-456789abcdef")
                .updateCard(UpdateCard.builder()
                    .cardCvv("456")
                    .build())
                .call();

        if (res.card().isPresent()) {
            System.out.println(res.card().get());
        }
    }
}

Parameters

Parameter Type Required Description Example
accountID String ✔️ N/A
cardID String ✔️ N/A 01234567-89ab-cdef-0123-456789abcdef
updateCard UpdateCard ✔️ N/A {
"cardCvv": "456"
}

Response

UpdateCardResponse

Errors

Error Type Status Code Content Type
models/errors/GenericError 400, 409 application/json
models/errors/UpdateCardError 422 application/json
models/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

package hello.world;

import io.moov.sdk.Moov;
import io.moov.sdk.models.components.Security;
import io.moov.sdk.models.errors.GenericError;
import io.moov.sdk.models.operations.DisableCardResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws GenericError, Exception {

        Moov sdk = Moov.builder()
                .security(Security.builder()
                    .username("")
                    .password("")
                    .build())
            .build();

        DisableCardResponse res = sdk.cards().disable()
                .accountID("bbd12cb2-58f4-46e5-861d-1e6c4617c0c2")
                .cardID("01234567-89ab-cdef-0123-456789abcdef")
                .call();

        // handle response
    }
}

Parameters

Parameter Type Required Description Example
accountID String ✔️ N/A
cardID String ✔️ N/A 01234567-89ab-cdef-0123-456789abcdef

Response

DisableCardResponse

Errors

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

getMetadata

Look up metadata for a card without linking it to a Moov account.

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 /card-metadata.read scope.

Example Usage

package hello.world;

import io.moov.sdk.Moov;
import io.moov.sdk.models.components.CardMetadataRequest;
import io.moov.sdk.models.components.Security;
import io.moov.sdk.models.errors.CardMetadataRequestError;
import io.moov.sdk.models.errors.GenericError;
import io.moov.sdk.models.operations.GetCardMetadataResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws GenericError, CardMetadataRequestError, Exception {

        Moov sdk = Moov.builder()
                .security(Security.builder()
                    .username("")
                    .password("")
                    .build())
            .build();

        CardMetadataRequest req = CardMetadataRequest.builder()
                .cardNumber("4111111111111111")
                .build();

        GetCardMetadataResponse res = sdk.cards().getMetadata()
                .request(req)
                .call();

        if (res.cardMetadata().isPresent()) {
            System.out.println(res.cardMetadata().get());
        }
    }
}

Parameters

Parameter Type Required Description
request CardMetadataRequest ✔️ The request object to use for the request.

Response

GetCardMetadataResponse

Errors

Error Type Status Code Content Type
models/errors/GenericError 400, 409 application/json
models/errors/CardMetadataRequestError 422 application/json
models/errors/APIException 4XX, 5XX */*