Giropay

Giropay service

Giropay is an Internet payment System in Germany, based on online banking. Introduced in February 2006, this payment method allows customers to buy securely on the Internet using direct online transfers from their bank account.

Giropay is the official online banking implementation of the German banks.

How to integrate Giropay

dfb6ef1-giropay.png

Execute a Giropay call

Executing a Giropay transaction is a three step process:

Step 1:

POST https://api.unzer.com/v1/types/giropay/

Body: {}
// heidelpayUI
var unzer= new Unzer('s-pub-xxxxxxxxxx');

// Giropay
var Giropay = heidelpayInstance.Giropay()

// Create resource
Giropay.createResource()
  .then(function (data) {
    console.log("Giropay Resource: ", data)
    })
{
  "id": "s-gro-biqupm9wuk8y",
  "method": "giropay",
  "recurring": false,
  "geoLocation": {
    "clientIp": "115.77.189.143",
    "countryCode": "VN"
  }
}

By using the request, a resource is created and the resource id (e.g. s-gir-23ashaor54) is returned.

Step 2 - Creating a payment and charge it After creating the types resources, it is possible to create a charge request.

POST https://api.unzer.com/v1/payments/charges
   
Body:
{
       "amount":       "12.4500",                                    
       "currency":     "EUR",
       "returnUrl":    "https://www.unzer.com",
       "resources": {
           "typeId":        "s-gro-svyymybtwafu",
       }
}

The result will be a pending charge with a redirectUrl.

// UnzerAPI - response example

{
    "id":               "s-chg-1",
    "isSuccess":        false,
    "isPending":        true,
    "isError":          false,
    "redirectUrl":      "https://payment.unzer.com/giropay/3849234023942354935353405234320423",
    ...
}

Step 3 - Forwarding customer to redirectUrl You need to send the customer to the redirectUrl where he will be forwarded to the Giropay payment page. After successful payment or cancelation, the customer will be redirected back to the returnUrl you specified in the charge call.

After the customer is redirected back to the returnUrl, you should check the status of the payment by getting the payment id.

// UnzerAPI - fetch final result

GET https://api.unzer.com/v1/payments/<id>/charges/<id>

{
    "id":                "s-chg-1",
    "isSuccess":   true,
    "isPending":   false,
    "isError":     false,
    "redirectUrl": "",
     ...
}