One Click Credit Card Payments

One click credit card payments can be used to allow customers to make online purchases with a single click, using previously entered payment information to complete the purchase. The amount for a one click transaction is variable. A Merchant can apply for one click payments feature, only if he/she has already been approved for credit cards.

First One Click Transaction

In order to setup one click credit card payments, the merchant has to perform a first one click transaction. The first one click transaction is created with the one_click_type set to first. It is like a regular credit card transaction in which the customer(card holder) needs to visit the URL supplied in the returned payment_url field and authenticate themselves on the 3D secure page.

Example first one click order request:

POST /v1/orders/ HTTP/1.1
Authorization: Basic aHVudGVyMjo=
Content-Type: application/json

{
  "merchant_order_id": "1",
  "amount": 1000,
  "currency": "EUR",
  "description": "Credit card order - First one click",
  "transactions": [
    {
      "payment_method": "credit-card",
      "payment_method_details":
      {
        "one_click_type":"first"
      }
    }
  ]
}

Returnspayment_url in response.

{
  "amount": 1000,
  "client": {
    "user_agent": "Testing API"
  },
  "created": "2017-11-27T11:35:50.993789+00:00",
  "currency": "EUR",
  "description": "Credit card order - First one click",
  "id": "29735aa4-3fab-4614-8714-102f46c30d1e",
  "last_transaction_added": "2017-11-27T11:35:51.302595+00:00",
  "merchant_id": "69c489e0-570d-43d6-a362-4b3e92131e15",
  "merchant_order_id": "1",
  "modified": "2017-11-27T11:35:51.701733+00:00",
  "project_id": "3b279187-0454-455c-8f5f-85a37f77de8b",
  "status": "new",
  "transactions": [
    {
      "amount": 1000,
      "balance": "internal",
      "created": "2017-11-27T11:35:51.302595+00:00",
      "credit_debit": "credit",
      "currency": "EUR",
      "description": "Credit card order - First one click",
      "expiration_period": "PT30M",
      "id": "ea45e77e-1fc0-4ac2-9ea6-9c55f66d4b86",
      "merchant_id": "69c489e0-570d-43d6-a362-4b3e92131e15",
      "modified": "2017-11-27T11:35:51.617659+00:00",
      "order_id": "29735aa4-3fab-4614-8714-102f46c30d1e",
      "payment_method": "credit-card",
      "payment_method_details": {
        "one_click_type": "first"
      },
      "payment_url": "api.online.emspay.eu/pay/29735aa4-3fab-4614-8714-102f46c30d1e/?payment_method=credit-card",
      "product_type": "corpnl",
      "project_id": "3b279187-0454-455c-8f5f-85a37f77de8b",
      "status": "new"
    }
  ]
}

Once the customer completes the first one click payment, the merchant can obtain the vault_token to be used for the actual one click transactions by sending a HTTP GET request to /orders/<order_id>/. This is the vault_token to be used for all the subsequent actual one click transactions for this customer.

Example - Getting details of a first one click order:

GET /v1/orders/29735aa4-3fab-4614-8714-102f46c30d1e/ HTTP/1.1
Authorization: Basic aHVudGVyMjo=

Response contains vault_token within transaction’s payment_method_details:

{
  "amount": 1000,
  "client": {
    "user_agent": "Testing API"
  },
  "completed": "2017-11-27T11:37:33.531069+00:00",
  "created": "2017-11-27T11:35:50.993789+00:00",
  "currency": "EUR",
  "customer": {
    "country": "NL",
    "ip_address": "127.0.0.1"
  },
  "description": "Credit card order - First one click",
  "id": "29735aa4-3fab-4614-8714-102f46c30d1e",
  "last_transaction_added": "2017-11-27T11:35:51.302595+00:00",
  "merchant_id": "69c489e0-570d-43d6-a362-4b3e92131e15",
  "merchant_order_id": "1",
  "modified": "2017-11-27T11:37:33.551461+00:00",
  "project_id": "3b279187-0454-455c-8f5f-85a37f77de8b",
  "status": "completed",
  "transactions": [
    {
      "amount": 1000,
      "balance": "internal",
      "completed": "2017-11-27T11:37:32.792540+00:00",
      "created": "2017-11-27T11:35:51.302595+00:00",
      "credit_debit": "credit",
      "currency": "EUR",
      "description": "Credit card order - First one click",
      "expiration_period": "PT30M",
      "id": "ea45e77e-1fc0-4ac2-9ea6-9c55f66d4b86",
      "merchant_id": "69c489e0-570d-43d6-a362-4b3e92131e15",
      "modified": "2017-11-27T11:37:32.799023+00:00",
      "msc_amount": 200,
      "msc_calculation_type": "blended",
      "msc_currency": "EUR",
      "order_id": "29735aa4-3fab-4614-8714-102f46c30d1e",
      "payment_method": "credit-card",
      "payment_method_brand": "visa",
      "payment_method_details": {
        "card_expiry": "012020",
        "cardholder_name": "Cardholder name",
        "liability_shift": true,
        "one_click_type": "first",
        "truncated_pan": "************0002",
        "vault_token": "e72f7733-9e41-4fc3-968a-9d6b52081ddf"
      },
      "product_type": "corpnl",
      "project_id": "3b279187-0454-455c-8f5f-85a37f77de8b",
      "status": "completed"
    }
  ]
}

Actual One Click Transaction

After the first one click credit card transaction, it is possible for the merchant to perform the actual one click credit card transactions on-demand. The actual one click transaction is created with the one_click_type set to one-click along with the vault_token set to the value obtained after the first one click transaction creation.

Please note that it is mandatory to request the CVC/CVV code from the shopper. The merchant needs to include the CVC/CVV code in the request to perform the actual one click transaction.

The actual one click transaction will be initiated instantly and completed without any additional shopper intervention. It will not contain payment_url the response.

Example one click order request:

POST /v1/orders/ HTTP/1.1
Authorization: Basic aHVudGVyMjo=
Content-Type: application/json

{
  "merchant_order_id": "2",
  "amount": 2000,
  "currency": "EUR",
  "description": "Credit card order - Actual one click",
  "transactions": [
    {
      "payment_method": "credit-card",
      "payment_method_details": {
        "one_click_type": "one-click",
        "vault_token":"e72f7733-9e41-4fc3-968a-9d6b52081ddf",
					"cvc": "011"
      }
    }
  ]
}

Returns response

{
  "amount": 2000,
  "client": {
    "user_agent": "Testing API"
  },
  "completed": "2017-11-27T11:39:20.951227+00:00",
  "created": "2017-11-27T11:39:18.604203+00:00",
  "currency": "EUR",
  "description": "Credit card order - Actual one click",
  "id": "6c0baedb-db17-4759-a4ea-5434d8b07b94",
  "last_transaction_added": "2017-11-27T11:39:18.833541+00:00",
  "merchant_id": "69c489e0-570d-43d6-a362-4b3e92131e15",
  "merchant_order_id": "2",
  "modified": "2017-11-27T11:39:20.956731+00:00",
  "project_id": "3b279187-0454-455c-8f5f-85a37f77de8b",
  "status": "completed",
  "transactions": [
    {
      "amount": 2000,
      "balance": "internal",
      "completed": "2017-11-27T11:39:20.944902+00:00",
      "created": "2017-11-27T11:39:18.833541+00:00",
      "credit_debit": "credit",
      "currency": "EUR",
      "description": "Credit card order - Actual one click",
      "expiration_period": "PT30M",
      "id": "5bb55709-cdaf-4a44-af9c-1421709f6671",
      "merchant_id": "69c489e0-570d-43d6-a362-4b3e92131e15",
      "modified": "2017-11-27T11:39:20.999919+00:00",
      "msc_amount": 500,
      "msc_calculation_type": "blended",
      "msc_currency": "EUR",
      "order_id": "6c0baedb-db17-4759-a4ea-5434d8b07b94",
      "payment_method": "credit-card",
      "payment_method_brand": "visa",
      "payment_method_details": {
        "card_expiry": "012020",
        "cardholder_name": "Cardholder name",
        "first_authorised_transaction_id": "ea45e77e-1fc0-4ac2-9ea6-9c55f66d4b86",
        "liability_shift": false,
        "one_click_type": "one-click",
        "truncated_pan": "************0002",
        "vault_token": "e72f7733-9e41-4fc3-968a-9d6b52081ddf"
      },
      "product_type": "corpnl",
      "project_id": "3b279187-0454-455c-8f5f-85a37f77de8b",
      "status": "completed"
    }
  ]
}