Create a Payment

Through this API you can ask Wirecard to charge an order. To do this, you must submit payment information.

❗️

ATTENTION

1. You must encrypt your credit card data before sending it to Wirecard. If you have a PCI certificate, you can send the data without encryption to us.

2. The number,expirationMonth,expirationYear and cvc attributes will only be used in case your site has PCI certification. Otherwise, you should use the hash attribute and encrypt the credit card data..

3. Upon the recommendation of the credit card companies, the pre-authorized payment capture must be taken within 5 days. If this period is exceeded, Wirecard will automatically cancel the payment.

🚧

IMPORTANT

There are three possibilities to pay by credit card:

1. If your site has a PCI certification, you can use the attributes with the card data: number, expirationMonth, expirationYear and cvc.

2. If your site does not have PCI security certification then you must make the payment by encrypting the card data and using the hash attribute. Learn more about credit card encryption in our documentation.

3. If your customer already has a card saved on the system you can retrieve this data and make the sale using only the id attribute. This attribute refers to the card identifier code and you should receive it whenever you use the store: true attribute on a credit card transaction. Example of id: CRC-9RR409BRJVIN.

👍

TIP

For use device.fingerprint, we recommend libraries based on Canvas Fingerprints. A good recommendation for a free and open-source service is the ClientJS..

Credit card numbers for testing

In the table below Wirecard provides fictitious card numbers to make test purchases.

Brand

Number

Expiration

CVC

Mastercard

5555666677778884

05/2022

123

Visa

4012001037141112

05/2022

123

Amex

376449047333005

05/2022

1234

Elo

6362970000457013

05/2022

123

Diners

36490102462661

05/2022

123

Hiper

6370950000000005

05/2022

123

Hipercard

6062825624254001

05/2022

123

Credit Card Payment Flowchart

See below the flow of the payment process on the Wirecard and its reflection on the status of the order .

Status interaction to payment and order on Wirecard.Status interaction to payment and order on Wirecard.

Status interaction to payment and order on Wirecard.

Banking Billet payment Flowchart

Below the flow of the payment process via ticket and its interaction with the status of the order.

Flowchart of a transaction by banking billet.Flowchart of a transaction by banking billet.

Flowchart of a transaction by banking billet.

Online Debit Payment Flowchart

See below an outline of the online debit payment process.

Flowchart of a payment made by online debit.Flowchart of a payment made by online debit.

Flowchart of a payment made by online debit.

Recovering canceled payment

In order for you to try to recover your canceled payments in a simple way, Wirecard has created cancellation ratings, based on the responses we receive from banks. This rating is a way to help you understand the reason for each cancellation and at the same time guide you in how to handle each case.

You'll have the sort information for canceled payments on the payment creation response, on GET request, and on payment webhooks.

Example of cancellation classification:

{
[...]
  "cancellationDetails": {
    "cancelledBy": "ACQUIRER",
    "description": "Politica do banco emissor",
    "code": "3"
  }
[...]
}

Complete JSON sample with sort data:

{
  "id": "PAY-4DTXRX7KJYP2",
  "status": "CANCELLED",
  "installmentCount": 1,
  "amount": {
    "refunds": 0,
    "fees": 46,
    "liquid": 54,
    "currency": "BRL",
    "total": 100
  },
  "fees": [
    {
      "type": "TRANSACTION",
      "amount": 46
    }
  ],
  "cancellationDetails": {
    "cancelledBy": "ACQUIRER",
    "description": "Politica do banco emissor",
    "code": "3"
  },
  "fundingInstrument": {
    "creditCard": {
      "id": "CRC-L7VZM4B7U68E",
      "brand": "HIPER",
      "first6": "637095",
      "last4": "0005",
      "holder": {
        "birthdate": "30/12/1988",
        "taxDocument": {
          "type": "CPF",
          "number": "22222222222"
        },
        "fullname": "Credit card holder name"
      }
    },
    "method": "CREDIT_CARD"
  },
  "events": [
    {
      "createdAt": "2015-12-07T20:39:39-0200",
      "type": "PAYMENT.CANCELLED"
    },
    {
      "createdAt": "2015-12-07T20:39:37-0200",
      "type": "PAYMENT.CREATED"
    }
  ],
  "_links": {
    "order": {
      "title": "ORD-M05KJCELI74N",
      "href": "https://api.moip.com.br/v2/orders/ORD-M05KJCELI74N"
    },
    "self": {
      "href": "https://api.moip.com.br/v2/payments/PAY-4DTXRX7KJYP2"
    }
  },
  "createdAt": "2015-12-07T20:39:37-0200",
  "updatedAt": "2015-12-07T20:39:39-0200"
}

🚧

IMPORTANT

To maintain a conversion view per order, always use the same order to create a new payment. In this scenario where your payment has been canceled, make a new payment request on the previously used request with data from another credit card, or if you prefer to offer the banking billet as an alternative form of payment.

Identifying your brand on invoice

This helps that your transactions from being canceled by buyers because they do not remember or do not recognize the charge on their credit card statement.

In order to avoid this kind of situation, we offer you the functionality of " Invoice Name " or as we call it statementDescriptor. With this field, you have the 13 character layout that can be used to indicate your mark on your buyer's credit card bill so that he remembers the store, his brand and what that payment refers to on his invoice.

You only need to pass this information with the desired name when creating a credit card payment on Wirecard. See the JSON sample below.

{
[...]
  "statementDescriptor": "my-store.com",
[...]
}

Exemplo completo de JSON com nome na fatura.

{
  "installmentCount": 1,
  "statementDescriptor": "my-store.com",
  "fundingInstrument": {
    "method": "CREDIT_CARD",
    "creditCard": {
      "hash": "2n9vykIkGX5tegvdl+ow5ngPxP3ItAkp9tc1tzuMTeAuF457uN99CJIG386RD/iV5JPjwr9uCgr0XNYraMulcNJnys2b+A2pl7VcNmO83N5YBkViG+mo9SSCXMcBYBIcGotInur49DpKwylMbMFFWWYFsO/pq8e+zAe6g7dOLcKwkGlVrNL1PKepWxd5ldt44yPZhMeG82eiLxbnXrkAtcY19Phjlg7GIhCj3hjxSYi0Y6iUtLYmTpsVQIs93myH7LLU30gZ88xRMAYbmshi7fc8clfDkLbUPcCCDDYwe6ltFYX1J0YA/TT87Amj9filRlTzLuU9qvKHlXpq2Q/H",
      "holder": {
        "fullname": "Credit card holder name",
        "birthdate": "1980-01-02",
        "taxDocument": {
          "type": "CPF",
          "number": "12345679891"
        },
        "phone": {
          "countryCode": "55",
          "areaCode": "11",
          "number": "25112511"
        }
      }
    }
  }
}

🚧

IMPORTANT

The name on the invoice is only available for credit card payments on the Visa and MasterCard flags.

Language