Note: Only business accounts have the ability to accept card payments.
With Moov, you can build a flow for accepting card payments. Some examples of when card acceptance is useful:
An e-commerce platform that allows buyers and sellers to transact
A software-as-a-service (SaaS) platform connecting service providers with clients
A utility or subscription based company looking to allow their customers different payment options
Below, we provide instructions on how to implement card acceptance with Moov. The examples provided apply to both a merchant taking payments from customers through a checkout flow, or a platform collecting card payments payments directly from a customer.
This guide covers using Moov Drops or Moov.js to onboard accounts and link cards. If you’re just getting started, refer to our guide on how to install and authenticate Moov.js.
With Moov, all transfers represent the movement of money from a source to a destination. In the card acceptance scenario, the source is a cardholder and the destination can be you or a merchant on your platform.
You and/or your merchants’ accounts will need the collect-fundscapability as shown below. These accounts will need to be verified and undergo underwriting.
Use the API directly via each of the following curl commands, or use the Moov Dashboard to complete the following steps:
// create Moov instance with generated token
constmoov=newMoov(credentialsObject);// create Moov account, likely on form submit
moov.accounts.create({accountType:"business",profile:{business:{}},capabilities:["transfers","send-funds"]}).then((account)=>{console.log(account);}).catch((err)=>{console.error(err);});// Generate a new token server-side with the accountID and update the token within your frontend app. You can chain methods together
moov.setToken("new-token");// add a representative to account
moov.accounts.representatives.create({accountID:"newly-created-accountID",representative:{}});// link a bank account
moov.accounts.bankAccounts.link({accountID:"newly-created-accountID",bankAccount:{holderName:"Name",holderType:"business",accountNumber:"0004321567000",routingNumber:"123456789",bankAccountType:"checking"}}).then((bankAccount)=>{// kick off micro-deposit verification
moov.accounts.bankAccounts.startMicroDepositVerification({accountID,bankAccountID});});// Later, verify micro-deposits
moov.accounts.bankAccounts.completeMicroDepositVerification({accountID,bankAccountID,[12,45]});// Asychronously, the ach-debit-fund payment method will be created from this verified bank account. If you want to move funds out of the Moov wallet, this bank account can be the destination of a wallet-to-bank transfer.
// create Moov instance with generated token
constmoov=Moov(token);// create Moov account, likely on form submit
moov.accounts.create({accountType:"business",profile:{business:{}},capabilities:["transfers","collect-funds"]}).then((account)=>{console.log(account);}).catch((err)=>{console.error(err);});// Generate a new token server-side with the accountID and update the token within your frontend app. You can chain methods together
moov.setToken("new-token");// add a representative to account
moov.accounts.representatives.create({accountID:"newly-created-accountID",representative:{}});// link a bank account
moov.accounts.bankAccounts.link({accountID:"newly-created-accountID",bankAccount:{holderName:"Name",holderType:"business",accountNumber:"0004321567000",routingNumber:"123456789",bankAccountType:"checking"}}).then((bankAccount)=>{// kick off micro-deposit verification
moov.accounts.bankAccounts.startMicroDepositVerification({accountID,bankAccountID});});// Later, verify micro-deposits
moov.accounts.bankAccounts.completeMicroDepositVerification({accountID,bankAccountID,[12,45]});// Asychronously, the ach-debit-fund payment method will be created from this verified bank account. If you want to move funds out of the Moov wallet, this bank account can be the destination of a wallet-to-bank transfer.
// Onboarding Moov Drop
constonboarding=document.querySelector("moov-onboarding");// After generating a token, set it on the onboarding element
onboarding.token="some-generated-token";// Include your own accountID which can be found in the Moov Dashboard
onboarding.facilitatorAccountID="your-account-id";// Transfers and collect-funds capabilities are needed for this flow
onboarding.capabilities=["transfers","collect-funds"];// Funding will occur with a bank account
onboarding.paymentMethodTypes=["bankAccount"];// Verify bank account with microdeposits
onboarding.microDeposits=true;// Follow the Onboarding Moov Drops and Plaid guides if linking bank accounts using Plaid
// Open the onboarding flow when ready
onboarding.open=true;
You can create cardholder accounts by providing their full name and a valid phone number or email address. In a checkout scenario, you can create these accounts when the customer is prompted to pay. When you create accounts for your cardholders, they will automatically receive the transferscapability.
// Onboarding Moov Drop
constonboarding=document.querySelector("moov-onboarding");// After generating a token, set it on the onboarding element
onboarding.token="some-generated-token";// Include your own accountID which can be found in the Moov Dashboard
onboarding.facilitatorAccountID="your-account-id";// Transfers capability needed for this flow
onboarding.capabilities=["transfers"];// Funding will occur with a card
onboarding.paymentMethodTypes=["card"];// Open the onboarding flow when ready
onboarding.open=true;
You can use the pre-built card link Drop in an HTML document as shown below. Once the information has been submitted via the Drop, Moov verifies the card details with card networks. You will not be responsible for storing or handling any of the card data, since all PII goes directly to Moov.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<moov-card-linkclass="card-link"></moov-card-link><script>letmoovCardLink=document.querySelector("moov-card-link");moovCardLink.accountID="accountID";moovCardLink.oauthToken="oauthToken";moovCardLink.onSuccess=(card)=>{console.log("Card linked");// now show a success screen
}moovCardLink.onError=(error)=>{console.log("Error linking card");// now show an error screen
}// call submit when button is pressed
moovCardLink.submit();</script>
If you have submitted an attestation of PCI compliance to Moov, you also have the option to link cards directly through the API. If you opt for this method, you will be responsible for storing and handling card data.
constmoov=newMoov(credentialsObject);constcard=awaitmoov.cards.link("accountID",{"cardNumber":"string","expiration":{"month":"01","year":"21",},"cardCvv":"0123","holderName":"Jules Jackson","billingAddress":{"addressLine1":"123 Main Street","addressLine2":"Apt 302","city":"Boulder","stateOrProvince":"CO","postalCode":"80301","country":"US"}});
The customer’s card will be the source of funds, so we’ll need the card-payment payment method from their account. You can obtain the paymentmethodID from the payment methods GETendpoint. The sourceID should be the cardID from the cards GETendpoint.
Since the merchant’s wallet will be the destination of the funds, we will need the moov-wallet payment method. You can obtain the paymentmethodID using the payment methods GETendpoint and finding the moov-wallet payment method associated with the merchant account.
To submit the card payment, create a transfer from the cardholder (source) to the merchant (destination).
// Authenticate
import{Moov}from'@moovio/node';constmoov=newMoov({accountID:"YOUR-MOOV-ACCOUNT-ID",publicKey:"PUBLIC-KEY",secretKey:"PRIVATE-KEY",domain:"YOUR-DOMAIN"});// Server side Node SDK example
try{consttransfer={source:{paymentMethodID:"customer's card-payment payment method"},destination:{paymentMethodID:"merchant's moov-wallet payment method"},amount:{value:3000,// $30.00
currency:"USD"},description:"Card payment example"};const{transferID}=moov.transfers.create(transfer);}catch(err){// ...
}
Card-based payments first settle in a Moov wallet. The funds can later be moved to an external bank account through a wallet-to-bank transfer.
tip
When you include the X-Wait-For header in the request, you will get a synchronous response that includes full transfer and rail-specific details from the payment network. This is useful for when a user is clicking a button to make a payment and needs a synchronous response so they can get confirmation that it worked. If you omit the X-Wait-For header, you will get an asynchronous response that only includes the transferID and the timestamp for when the transfer was created.
If you receive a 202 response from creating a transfer, do not consider the transfer as successful or failed. Instead, you should wait for the webhook notification to determine the status of the transfer, or subsequently look up the transfer status using the transferID. Read more on our transfer responses guide.
After submitting the card payment, you may also want to: