- list - Retrieve a list of payment methods associated with a Moov account. Read our payment methods guide to learn more.
To access this endpoint using an access token
you'll need to specify the /accounts/{accountID}/payment-methods.read scope.
- get - Get the specified payment method associated with a Moov account. Read our payment methods guide to learn more.
To access this endpoint using an access token
you'll need to specify the /accounts/{accountID}/payment-methods.read scope.
Retrieve a list of payment methods associated with a Moov account. Read our payment methods guide to learn more.
To access this endpoint using an access token
you'll need to specify the /accounts/{accountID}/payment-methods.read scope.
package hello.world;
import io.moov.sdk.Moov;
import io.moov.sdk.models.components.Security;
import io.moov.sdk.models.operations.ListPaymentMethodsResponse;
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();
ListPaymentMethodsResponse res = sdk.paymentMethods().list()
.accountID("f5503781-dfe4-4bcd-9487-5b5fe2b4d53b")
.call();
if (res.paymentMethods().isPresent()) {
System.out.println(res.paymentMethods().get());
}
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
accountID |
String | ✔️ | N/A |
sourceID |
Optional<String> | ➖ | Optional parameter to filter the account's payment methods by source ID. A source ID can be a walletID, cardID, or bankAccountID. |
paymentMethodType |
Optional<PaymentMethodType> | ➖ | Optional parameter to filter the account's payment methods by payment method type. |
| Error Type | Status Code | Content Type |
|---|---|---|
| models/errors/APIException | 4XX, 5XX | */* |
Get the specified payment method associated with a Moov account. Read our payment methods guide to learn more.
To access this endpoint using an access token
you'll need to specify the /accounts/{accountID}/payment-methods.read scope.
package hello.world;
import io.moov.sdk.Moov;
import io.moov.sdk.models.components.PaymentMethod;
import io.moov.sdk.models.components.Security;
import io.moov.sdk.models.operations.GetPaymentMethodResponse;
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();
GetPaymentMethodResponse res = sdk.paymentMethods().get()
.accountID("56878537-30b0-48ee-9c54-07ab3a8b243d")
.paymentMethodID("aa740bf3-4c5f-459b-9370-4f7d4bea382b")
.call();
if (res.paymentMethod().isPresent()) {
PaymentMethod unionValue = res.paymentMethod().get();
switch (unionValue.paymentMethodType()) {
case "moov-wallet":
// Handle moov-wallet discriminator variant
break;
case "ach-debit-fund":
// Handle ach-debit-fund discriminator variant
break;
case "ach-debit-collect":
// Handle ach-debit-collect discriminator variant
break;
case "ach-credit-standard":
// Handle ach-credit-standard discriminator variant
break;
case "ach-credit-same-day":
// Handle ach-credit-same-day discriminator variant
break;
case "rtp-credit":
// Handle rtp-credit discriminator variant
break;
case "card-payment":
// Handle card-payment discriminator variant
break;
case "push-to-card":
// Handle push-to-card discriminator variant
break;
case "pull-from-card":
// Handle pull-from-card discriminator variant
break;
case "apple-pay":
// Handle apple-pay discriminator variant
break;
case "card-present-payment":
// Handle card-present-payment discriminator variant
break;
case "instant-bank-credit":
// Handle instant-bank-credit discriminator variant
break;
case "push-to-apple-pay":
// Handle push-to-apple-pay discriminator variant
break;
case "pull-from-apple-pay":
// Handle pull-from-apple-pay discriminator variant
break;
case "google-pay":
// Handle google-pay discriminator variant
break;
case "push-to-google-pay":
// Handle push-to-google-pay discriminator variant
break;
case "pull-from-google-pay":
// Handle pull-from-google-pay discriminator variant
break;
case "wire-credit":
// Handle wire-credit discriminator variant
break;
default:
// Handle unknown discriminator variant
}
}
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
accountID |
String | ✔️ | N/A |
paymentMethodID |
String | ✔️ | N/A |
| Error Type | Status Code | Content Type |
|---|---|---|
| models/errors/APIException | 4XX, 5XX | */* |