You can create, modify, delete, and specify which processor accounts you want to use via the QorCommerce API. This allows e.g. online marketplaces to cater to multiple customers with one single QorCommerce account.
To facilitate payments, you may need to have an account with the payment provider you want to use. But for select processors, QorCommerce already provides an account so that you don't need to open your own.
Each processor has different account properties. For instance, while TSYS requires an account number and a token, Vantive asks you for a Vantiv account number, user ID and password. On the API, each Processor Account object always has a unique account_id
and optional parameters
. The object_id
is the QouCommerce-specific unique ID that you need to reference in your API calls.
A TSYS account, for example, would look like this:
{
"object_id":"b741b99f95e841639b54272834bc478c",
"object_owner": "api@qorcommerce.io",
"processor": "tsys",
"account_id": "321123",
"parameters": {
"token": "789987"
},
"test": false,
"active": true
}
The Processor Account object can be created (POST), modified or de-activated (PUT), or retrieved (GET). You can also list (GET) all activate accounts. Here's how you create a processor account:
curl https://api.qorcommerce.io/v2/processor_accounts/ \
-H "Authorization: QorToken <PRIVATE_TOKEN>" \
-d processor="TSYS" \
-d account_id="<YOUR-TSYS-ACCOUNT-NUMBER>" \
-d parameters='{ "token": "<YOUR-TSYS-TOKEN>"}'
TSYS_account = Qor::ProcessorAccount.create(
:processor => 'TSYS',
:account_id => '<YOUR-TSYS-ACCOUNT-NUMBER>',
:parameters => {:meter => '<YOUR-TSYS-TOKEN>'},
:test => true,
:active => true)
TSYS_account = Qor.ProcessorAccount.create(
processor = 'TSYS',
account_id = '<YOUR-TSYS-ACCOUNT-NUMBER>',
parameters = {"meter" : '<YOUR-TSYS-TOKEN>'},
test = True,
active = True)
$TSYS_account = Qor_ProcessorAccount::create(array(
'processor' => 'TSYS',
'account_id' => '<YOUR-TSYS-ACCOUNT-NUMBER>',
'parameters' => array('meter' => '<YOUR-TSYS-TOKEN>'),
'test' => true,
'active' => true
));
Qor.ProcessorAccount.create({
"processor":"TSYS",
"account_id":"<YOUR-TSYS-ACCOUNT-NUMBER>",
"parameters":{"meter":"<YOUR-TSYS-TOKEN>"},
"test":true,
"active":true
}, function(err, account) {
// asynchronously called
});
HashMap accountMap = new HashMap();
accountMap.put("processor", "TSYS");
accountMap.put("account_id", "<YOUR-TSYS-ACCOUNT-NUMBER>");
accountMap.put("parameters", new HashMap() {
{
put("token", "<YOUR-TSYS-TOKEN>");
}
});
accountMap.put("test", Boolean.TRUE);
accountMap.put("active", Boolean.TRUE);
CarrierAccount TSYS_account = CarrierAccount.create(accountMap);
Hashtable accountTable = new Hashtable ();
accountTable.Add ("processor", "TSYS");
accountTable.Add ("account_id", "<YOUR-TSYS-ACCOUNT-NUMBER>");
accountTable.Add ("parameters", new Hashtable(){
{"meter":"<YOUR-TSYS-TOKEN>"}
});
accountTable.Add ("test", true);
accountTable.Add ("active", true);
CarrierAccount TSYSAccount = resource.CreateCarrierAccount(accountTable)
Each processor account can be set to test mode. In test mode, you will never be charged anything - no tarsnaction fees, no gateway fee or any other charge. However you also can't use the settlement or collect any funds. Some processors also only return dummy values in test mode, e.g. the same AUTH Code or always a transaction status of "PENDING".
You can specify which processor accounts you want to use on a per-payment basis by passing in each account's object_id
in the payment's processor_account
field. If you don't specify which accounts to use, QorCommerce will use all your first active accounts for this payment.
curl https://api.qorcommerce.io/v2/processor-accounts/ \
-H "Authorization: QorToken <PRIVATE_TOKEN>" \
-d object_purpose="PURCHASE" \
-d merchant="d799c2679e644279b59fe661ac8fa488" \
-d customer="42236bcf36214f62bcc6d7f12f02a849" \
-d amount="1.00" \
-d processor_account="b741b99f95e841639b54272834bc478c"
payment = Qor::Payment.create(
:object_purpose => 'NEW',
:merchant => merchant,
:customer => customer,
:amount => amount,
:processor_accounts => "b741b99f95e841639b54272834bc478c")
payment = qor.Payment.create(
object_purpose= 'NEW',
merchant= merchant,
customer= customer,
amount= amount,
processor_accounts= 'b741b99f95e841639b54272834bc478c')
$payment = Qor_Payment::create(array(
'object_purpose'=> 'NEW',
'merchant'=> $merchant,
'customer'=> $customer,
'amount'=> $amount,
'processor_account' => 'b741b99f95e841639b54272834bc478c'
));
qor.payment.create({
"object_purpose": "NEW",
"merchant": merchant,
"customer": customer,
"amount": amount,
"processor_account": "358965dbcde54115828cfd992f2a1665"
}, function(err, shipment) {
// asynchronously called
console.log(payment)
});
Map paymentMap = new HashMap();
paymentMap.put("object_purpose", "NEW");
paymentMap.put("merchant", merchantMap);
paymentMap.put("customer", customerMap);
paymentMap.put("amount", amountMap);
paymentMap.put("processor_accounts", new String[]{"b741b99f95e841639b54272834bc478c"});
Payment payment = Payment.create(PaymentMap);
qorcommerce.payment.create({
"object_purpose": "NEW",
"merchant": merchant,
"customer": customer,
"amount": amount,
"procssor_account": "b741b99f95e841639b54272834bc478c"})
You can filter processor accounts by processor
and account_id
:
curl https://api.qorcommerce.io/v2/processor_accounts/?processor=TSYS \
-H "Authorization: QorToken <PRIVATE_TOKEN>" \
Qor::ProcessorAccount.all(:processor => "TSYS")
qor.ProcessorAccount.all(processor="TSYS")
Qor_ProcessorAccount::all(array('processor'=> 'TSYS'))
// not yet supported.
// not yet supported.
// not yet supported.