ProvisionalVirtualCard
and VirtualCard
.ProvisionalVirtualCard
is a card that is currently being provisioned. This will typically exist in 3 different states: PROVISIONING
, COMPLETED
, and FAILED
. It also contains a property card
which contains the provisioned card, when it has COMPLETED
. This type is transitory and should only be used for determining whether a card is provisioning, or has failed provisioning. Accessing provisioned cards should be done using methods that return Card
types.VirtualCard
is a card that has successfully finished provisioning. This is the card type that represents virtual cards.CLOSED
state under the following circumstances:owners
property of any virtual cards owned by that Sudo will be removed. Such cards are called orphan cards and can be identified by looking for cards with no Sudo owner in the owners
property. Sudo owners are identified as owners with issuer
of value sudoplatform.sudoservice
.provisionVirtualCard
method.ownershipProofToken
is required as part of the input. This ties together the Sudo and virtual card such that the Sudo becomes the owner of the virtual card. Use the getOwnershipProof
method on the SudoProfilesClient
in the Sudo Profiles SDK in order to obtain an ownershipProofToken
. See the Sudo section for more information.fundingSourceId
is another required input parameter and is used to associate the virtual card with a funding source used to fund that particular virtual card.cardHolder
, billingAddress
, and metadata
are indicative of the user's information that they wish to be associated with the card.cardHolder
is the name that will appear on the card and is needed to perform transactions.billingAddress
is an optional property that the user can provide. If this is left undefined/nil/null
, the billingAddress
will be set by the platform itself.metadata
is a JSON object that contain application specific information about each virtual card. Examples of such information include an alias for the virtual card to help the user remember why they created it or perhaps a color for the virtual card to be rendered in by the application.currency
is the three character ISO 4217 alphabetic currency code of the currency in which the virtual card is to be denominated.provisionVirtualCard
method initiates the process of provisioning a virtual card and will return a ProvisionalCard
on completion. During this process the ProvisionalCard
traverses between a PROVISIONING
and COMPLETED
state.getProvisionalCard
is used to poll for state changes of a card during its provisioning cycle. Once the ProvisionalCard
has reached a COMPLETED
state, the fully provisioned card can be accessed via the card
property on the card (or via get/list of virtual cards).keyNamespace
property used when initializing a DefaultSudoVirtualCardsClient
(for more info, see here).provisionCardWithInput
method optionally takes observer
parameter. To check the provisioning state after calling this API, calls to getVirtualCards(withLimit:)
can be used, however the recommended way is to use a ProvisionCardObservable
.ProvisionCardObservable
is a protocol that facilitates the ability to track the state changes of a card during its provisioning cycle. This observer is required if expecting to gain access to the card once it has finished provisioning. Alternatively, you could also query a list of the user's cards to see if it has finished provisioning.provisionVirtualCard
method initiates the process of provisioning a virtual card and will return a ProvisionalVirtualCard
on completion. During this process the ProvisionalVirtualCard
traverses between a PROVISIONING
and COMPLETED
state.getProvisionalVirtualCard
is used to poll for state changes of a card during its provisioning cycle. Once the ProvisionalVirtualCard
has reached a COMPLETED
state, the fully provisioned card can be accessed.updateVirtualCard
method is used to do this.UpdateVirtualCardInput
:cardHolder
metadata
billingAddress
alias
alias
property is deprecated and replaced by the more general metadata
property. To record an alias
property for a card, set an alias
property in the metadata
JSON object.SingleAPIResult
type is returned from this method call which contains the status of the update operation. Two possible statuses can be returned:alias
to 'Banking'
and the cardHolder
to 'J Smith'
then the API should be called like so:metadata
property is a single attribute and all metadata properties must be specified on each update.null
, defined
, or undefined
for either updatable property. Supplying undefined
will perform no update, supplying null
will remove the value on the service (setting it to null
), and supplying defined
will update the content of the property. For example, if you have a card (userCard
) that has the following properties:alias
to "Banking"
, and billingAddress
to null
, call the update API:userCard
) that has the following properties:alias
to "Banking"
, then the API should be called like so:cancelVirtualCard
method by passing in the id
of an existing virtual card object.id
will always yield the same result.CLOSED
state and remain accessible via retrieval methods. Closed cards remain available so that transaction history can be retained and so that refunds that happen after the card is closed can be shown.CLOSED
, it cannot be reactivated - a new virtual card will need to be provisioned.SingleAPIResult
type is returned from this method call which contains the status of the cancellation operation. Two possible statuses can be returned:id
, use the getVirtualCard
method. This method will return the record if it exists.ListVirtualCardsResult
with a status
and depending on the status, a list of matching items
and a nextToken
to support pagination. If no results matching the input are found, the result will contain empty items. There can be three possible statuses returned:listVirtualCards
method.