accountNew
Registers a new Account for the calling user
Creates a new Fiserv Account, storing the card details for use later.
/PaymentServices/CreditCard/Account/{paymentProvider}
Usage and SDK Samples
curl -X POST \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
"https://api.dev.spenda.co/api/PaymentServices/CreditCard/Account/{paymentProvider}" \
-d ''
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.AccountsApi;
import java.io.File;
import java.util.*;
public class AccountsApiExample {
public static void main(String[] args) {
// Create an instance of the API class
AccountsApi apiInstance = new AccountsApi();
String paymentProvider = paymentProvider_example; // String | Identifier of the Payment Services Provider the account belongs to
NewFiservAccountRequest newFiservAccountRequest = {"cardholderName":"string","cardType":"string","cardNumber":"string","expiry":"string","ccv":"string","isSingleUse":true,"friendlyName":"string","merchantTenantGlobalID":"string"}; // NewFiservAccountRequest |
try {
newFiservAccountResponse result = apiInstance.accountNew(paymentProvider, newFiservAccountRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AccountsApi#accountNew");
e.printStackTrace();
}
}
}
import 'package:openapi/api.dart';
final api_instance = DefaultApi();
final String paymentProvider = new String(); // String | Identifier of the Payment Services Provider the account belongs to
final NewFiservAccountRequest newFiservAccountRequest = new NewFiservAccountRequest(); // NewFiservAccountRequest |
try {
final result = await api_instance.accountNew(paymentProvider, newFiservAccountRequest);
print(result);
} catch (e) {
print('Exception when calling DefaultApi->accountNew: $e\n');
}
import org.openapitools.client.api.AccountsApi;
public class AccountsApiExample {
public static void main(String[] args) {
AccountsApi apiInstance = new AccountsApi();
String paymentProvider = paymentProvider_example; // String | Identifier of the Payment Services Provider the account belongs to
NewFiservAccountRequest newFiservAccountRequest = {"cardholderName":"string","cardType":"string","cardNumber":"string","expiry":"string","ccv":"string","isSingleUse":true,"friendlyName":"string","merchantTenantGlobalID":"string"}; // NewFiservAccountRequest |
try {
newFiservAccountResponse result = apiInstance.accountNew(paymentProvider, newFiservAccountRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AccountsApi#accountNew");
e.printStackTrace();
}
}
}
// Create an instance of the API class
AccountsApi *apiInstance = [[AccountsApi alloc] init];
String *paymentProvider = paymentProvider_example; // Identifier of the Payment Services Provider the account belongs to (default to null)
NewFiservAccountRequest *newFiservAccountRequest = {"cardholderName":"string","cardType":"string","cardNumber":"string","expiry":"string","ccv":"string","isSingleUse":true,"friendlyName":"string","merchantTenantGlobalID":"string"}; // (optional)
// Registers a new Account for the calling user
[apiInstance accountNewWith:paymentProvider
newFiservAccountRequest:newFiservAccountRequest
completionHandler: ^(newFiservAccountResponse output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var SpendaServicesFiserv = require('spenda_services_fiserv');
// Create an instance of the API class
var api = new SpendaServicesFiserv.AccountsApi()
var paymentProvider = paymentProvider_example; // {String} Identifier of the Payment Services Provider the account belongs to
var opts = {
'newFiservAccountRequest': {"cardholderName":"string","cardType":"string","cardNumber":"string","expiry":"string","ccv":"string","isSingleUse":true,"friendlyName":"string","merchantTenantGlobalID":"string"} // {NewFiservAccountRequest}
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.accountNew(paymentProvider, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class accountNewExample
{
public void main()
{
// Create an instance of the API class
var apiInstance = new AccountsApi();
var paymentProvider = paymentProvider_example; // String | Identifier of the Payment Services Provider the account belongs to (default to null)
var newFiservAccountRequest = new NewFiservAccountRequest(); // NewFiservAccountRequest | (optional)
try {
// Registers a new Account for the calling user
newFiservAccountResponse result = apiInstance.accountNew(paymentProvider, newFiservAccountRequest);
Debug.WriteLine(result);
} catch (Exception e) {
Debug.Print("Exception when calling AccountsApi.accountNew: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\AccountsApi();
$paymentProvider = paymentProvider_example; // String | Identifier of the Payment Services Provider the account belongs to
$newFiservAccountRequest = {"cardholderName":"string","cardType":"string","cardNumber":"string","expiry":"string","ccv":"string","isSingleUse":true,"friendlyName":"string","merchantTenantGlobalID":"string"}; // NewFiservAccountRequest |
try {
$result = $api_instance->accountNew($paymentProvider, $newFiservAccountRequest);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling AccountsApi->accountNew: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::AccountsApi;
# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::AccountsApi->new();
my $paymentProvider = paymentProvider_example; # String | Identifier of the Payment Services Provider the account belongs to
my $newFiservAccountRequest = WWW::OPenAPIClient::Object::NewFiservAccountRequest->new(); # NewFiservAccountRequest |
eval {
my $result = $api_instance->accountNew(paymentProvider => $paymentProvider, newFiservAccountRequest => $newFiservAccountRequest);
print Dumper($result);
};
if ($@) {
warn "Exception when calling AccountsApi->accountNew: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint
# Create an instance of the API class
api_instance = openapi_client.AccountsApi()
paymentProvider = paymentProvider_example # String | Identifier of the Payment Services Provider the account belongs to (default to null)
newFiservAccountRequest = {"cardholderName":"string","cardType":"string","cardNumber":"string","expiry":"string","ccv":"string","isSingleUse":true,"friendlyName":"string","merchantTenantGlobalID":"string"} # NewFiservAccountRequest | (optional)
try:
# Registers a new Account for the calling user
api_response = api_instance.account_new(paymentProvider, newFiservAccountRequest=newFiservAccountRequest)
pprint(api_response)
except ApiException as e:
print("Exception when calling AccountsApi->accountNew: %s\n" % e)
extern crate AccountsApi;
pub fn main() {
let paymentProvider = paymentProvider_example; // String
let newFiservAccountRequest = {"cardholderName":"string","cardType":"string","cardNumber":"string","expiry":"string","ccv":"string","isSingleUse":true,"friendlyName":"string","merchantTenantGlobalID":"string"}; // NewFiservAccountRequest
let mut context = AccountsApi::Context::default();
let result = client.accountNew(paymentProvider, newFiservAccountRequest, &context).wait();
println!("{:?}", result);
}
Scopes
Parameters
Path parameters
| Name | Description |
|---|---|
| paymentProvider* |
String
Identifier of the Payment Services Provider the account belongs to
Required
|
Body parameters
| Name | Description |
|---|---|
| newFiservAccountRequest |