Giropay

Parameters for giropay Payments

giropay and paydirekt were merged under the brand giropay.

Important remark: For a giropay payment the shipping address in the Checkout is mandatory. Be aware the underscores "_" are not supported in the merchantReference of the order / payment.

Structure redirectPaymentMethodSpecificInput

paymentProductId

990

requiresApproval

boolean

  • true = the payment requires approval before the funds will be captured using the Approve payment or Capture payment API
  • false = the payment does not require approval, and the funds will be captured automatically
redirectionData.returnUrl

The URL that the customer is redirected to after the payment flow has finished.

Example

Simple example for a giropay payment via Commerce Platform

  • Creating a checkout (here in one step, creating in multiple steps possible)
  • Creating an order for the entire checkout (partial orders also possible), payment is initialized automatically
  • Initialization of deliver to capture the amount of the order (partial deliver also possible)

Create CommerceCase with Checkout

Creating a Commerce Case with the initial Checkout including a reference, information about the customer and the items in the shopping cart.

POST Commerce Case
Request
/v1/{merchantId}/commerce-cases
{
    "merchantReference": "commerce-case-paydirekt-1",
    "customer": {
        "billingAddress": {
            "city": "Musterstadt",
            "countryCode": "DE",
            "houseNumber": "1",
            "street": "Musterstraße",
            "zip": "12345"
        },
        "merchantCustomerId": "Kunde1234",
        "contactDetails": {
            "emailAddress": "max@mustermann.de",
            "phoneNumber": "+1234567890"
        },
        "personalInformation": {
            "gender": "MALE",
            "name": {
                "firstName": "Max",
                "surname": "Mustermann"
            }
        }
    },
    "checkout": {
        "references": {
            "merchantReference": "paydirekt-001"
        },
        "shipping": {     
            "address": {
                "additionalInfo": "floor 9",
                "city": "Musterstadt",
                "countryCode": "DE",
                "houseNumber": "1",
                "street": "Musterstraße",
                "zip": "12345",                    
                "name": {
                    "firstName": "Max",
                    "surname": "Mustermann"
                }
            }
        },       
        "shoppingCart": {
            "items": [
                {
                    "invoiceData": {
                        "description": "giropay cap"
                    },
                    "orderLineDetails": {
                        "productCode": "XYZ01",
                        "productPrice": 999,
                        "productType": "GOODS",
                        "quantity": 2,
                        "taxAmount": 19
                    }
                }
            ]
        }
    }
}

Response
{
    "commerceCaseId": "29006ab1-2ee0-4407-ab11-70a577ee2f54",
    "checkoutId": "5a0f59ad-7a0f-45d5-9137-8d4c96295d6d",
    "shoppingCart": {
        "items": [
            {
                "invoiceData": {
                    "description": "giropay cap"
                },
                "orderLineDetails": {
                    "id": "4b676fae-5517-4007-b79b-ec77f9c2c5a8",
                    "productCode": "XYZ01",
                    "productPrice": 999,
                    "productType": "GOODS",
                    "quantity": 2,
                    "taxAmount": 19
                }
            }
        ]
    }
}

Order with giropay payment

Creating an order for the complete checkout with data for a giropay payment.

POST Order

Request
/v1/{merchantId}/commerce-cases/{commerceCaseId}/checkout/{checkoutId}/order
{
    "orderType": "FULL",
    "orderReferences": {
        "descriptor": "paydirekt payment",
        "merchantReference": "Order-1234521244"
    },
    "paymentMethodSpecificInput": {
        "redirectPaymentMethodSpecificInput": {
            "requiresApproval": true,
            "paymentProductId": 990,
            "redirectionData": {
                "returnUrl": "return.url"
            }
        },   
        "paymentChannel": "ECOMMERCE"
    }
}

Response
{
    "createPaymentResponse": {
        "merchantAction": {
            "actionType": "REDIRECT",
            "redirectData": {
                "redirectURL": "https://sandbox.paydirekt.de/checkout/?p=bd220dcb-73da-44ea-9f24-bd79882c6209#/checkout/bd220dcb-73da-44ea-9f24-bd79882c6209"
            }
        },
        "payment": {
            "paymentOutput": {
                "amountOfMoney": {
                    "amount": 1998,
                    "currencyCode": "EUR"
                },
                "references": {
                    "merchantReference": "Order-1234521244"
                },
                "paymentMethod": "redirect",
                "redirectPaymentMethodSpecificOutput": {
                    "paymentProductId": 990
                }
            },
            "status": "REDIRECTED",
            "statusOutput": {
                "isCancellable": false,
                "statusCategory": "PENDING_PAYMENT",
                "isAuthorized": false,
                "isRefundable": false
            },
            "id": "PP2AAD9B9UAW8BBD"
        },
        "paymentExecutionId": "20582832-9ddb-4bf1-b3bb-7b814a940e6e"
    },
    "shoppingCart": {
        "items": [
            {
                "invoiceData": {
                    "description": "giropay cap"
                },
                "orderLineDetails": {
                    "id": "4b676fae-5517-4007-b79b-ec77f9c2c5a8",
                    "productCode": "XYZ01",
                    "productPrice": 999,
                    "productType": "GOODS",
                    "quantity": 2,
                    "taxAmount": 19,
                    "status": [
                        {
                            "lineItemStatus": "WAITING_FOR_PAYMENT",
                            "quantity": 2
                        }
                    ]
                }
            }
        ]
    }
}

Webhook after successful confirmation on giropay portal by end customer

You can identify the corresponding transaction by the field createPaymentResponse.payment.id in the order response. The status PENDING_CAPTURE shows that the amount is authorized and the payment gateway is waiting for a capture.

Webhook
{
    "apiVersion": "v1",
    "created": "2023-11-14T17:25:08.015645739+00:00",
    "id": "4d56dfef-073a-4100-835b-3d32e8bdb255",
    "merchantId": "P1_18323_2013224",
    "payment": {
        "paymentOutput": {
            "amountOfMoney": {
                "amount": 1998,
                "currencyCode": "EUR"
            },
            "references": {
                "merchantReference": "Order-1234521244"
            },
            "redirectPaymentMethodSpecificOutput": {
                "paymentProductId": 990
            },
            "paymentMethod": "redirect"
        },
        "status": "PENDING_CAPTURE",
        "statusOutput": {
            "isCancellable": true,
            "statusCategory": "PENDING_MERCHANT",
            "isAuthorized": true,
            "isRefundable": false
        },
        "id": "PP2AAD9B9UAW8BBD"
    },
    "type": "payment.pending_capture"
}
Deliver

Full Deliver to capture the complete order amount.

POST Deliver
Request
/v1/{merchantId}/commerce-cases/{commerceCaseId}/checkout/{checkoutId}/deliver
{
    "deliverType": "FULL",
    "isFinal": true
}

Response
{
    "capturePaymentResponse": {
        "captureOutput": {
            "amountOfMoney": {
                "amount": 1998,
                "currencyCode": "EUR"
            },
            "references": {
                "merchantReference": "Order-1234521244"
            },
            "paymentMethod": "redirect"
        },
        "status": "CAPTURED",
        "id": "PP2AAD9B9UAW8BBD"
    },
    "shoppingCart": {
        "items": [
            {
                "invoiceData": {
                    "description": "giropay cap"
                },
                "orderLineDetails": {
                    "id": "4b676fae-5517-4007-b79b-ec77f9c2c5a8",
                    "productCode": "XYZ01",
                    "productPrice": 999,
                    "productType": "GOODS",
                    "quantity": 2,
                    "taxAmount": 19,
                    "status": [
                        {
                            "lineItemStatus": "DELIVERED",
                            "quantity": 2
                        }
                    ]
                }
            }
        ]
    }
}

Webhook after successful Deliver

The payment gateway informs you via webhook about the successful capture.

Webhook
{
    "apiVersion": "v1",
    "created": "2023-11-14T17:25:17.996829148+00:00",
    "id": "74e4fe0e-ee75-4c02-9b80-a3e3df8140d4",
    "merchantId": "P1_18323_2013224",
    "payment": {
        "paymentOutput": {
            "amountOfMoney": {
                "amount": 1998,
                "currencyCode": "EUR"
            },
            "references": {
                "merchantReference": "Order-1234521244"
            },
            "redirectPaymentMethodSpecificOutput": {
                "paymentProductId": 990
            },
            "paymentMethod": "redirect"
        },
        "status": "CAPTURED",
        "statusOutput": {
            "isCancellable": false,
            "statusCategory": "COMPLETED",
            "isAuthorized": true,
            "isRefundable": true
        },
        "id": "PP2AAD9B9UAW8BBD"
    },
    "type": "payment.captured"
}