About · Requirements · Installation · Upgrade · Usage · Support · Contribute
GraphQL is a query language for APIs. It describes the data your API exposes, lets a client ask for exactly what it needs and nothing more, and makes it easier to evolve the API over time.
This module exposes Buckaroo's payment methods through Magento's GraphQL API, so a headless or single-page storefront can list the available methods, set one on the cart, place the order and check the payment status.
Important
The Buckaroo Magento 2 plugin is required. This module extends it and cannot be used on its own — install and configure the payments plugin first.
It is also a prerequisite for the Hyvä React Checkout module, which relies on these GraphQL endpoints.
Full module documentation on docs.buckaroo.io
| Requirement | Supported versions |
|---|---|
| Buckaroo Magento 2 plugin | 2.7 or higher (use module 1.1.x with plugin 1.x) |
Magento, PHP and Composer requirements come from the main plugin. You also need a Buckaroo account — don't have one yet? Request an account.
Run the following commands from your Magento 2 root folder:
composer require buckaroo/magento2graphql
php bin/magento module:enable Buckaroo_Magento2Graphql
php bin/magento setup:upgrade
php bin/magento cache:flushcomposer update buckaroo/magento2graphql
php bin/magento setup:upgrade
php bin/magento cache:flushTip
Always test an upgrade on a staging environment first.
Payment methods are enabled and configured in the main plugin, under Stores → Configuration → Sales → Buckaroo in the Magento admin. This module only exposes them; it has no settings of its own.
Each method comes back with its Buckaroo-specific extra data under buckaroo_additional:
query {
cart(cart_id: "{ CART_ID }") {
available_payment_methods {
code
title
buckaroo_additional {
key
values {
name
code
img
}
value
}
}
}
}Placing an order takes three steps, which can be combined into one mutation:
- Set the payment method on the cart with the standard
setPaymentMethodOnCart, passing any method-specific fields underbuckaroo_additional. - Set the return URL with
setBuckarooReturnUrl, so the payment engine knows where to send the customer after the payment completes, is cancelled or fails. - Call the standard
placeOrder, which returns the redirect URL.
mutation doBuckarooPayment(
$cartId: String!
$returnUrl: String!
$methodCode: String!
) {
setPaymentMethodOnCart(
input: {
cart_id: $cartId
payment_method: {
code: $methodCode
buckaroo_additional: { buckaroo_magento2_ideal: {} }
}
}
) {
cart {
items {
product {
name
sku
}
}
}
}
setBuckarooReturnUrl(input: { return_url: $returnUrl, cart_id: $cartId }) {
success
}
placeOrder(input: { cart_id: $cartId }) {
order {
order_number
buckaroo_additional {
redirect
transaction_id
data {
key
value
}
}
}
}
}Store the returned transaction_id, then redirect the customer to the redirect URL to complete the payment.
Note
iDEAL no longer requires an issuer, so buckaroo_magento2_ideal can be left empty. The customer picks their bank on the redirect page.
SEPA Direct Debit example
SEPA Direct Debit needs the mandate details passed as additional fields:
mutation doSepaPayment($cartId: String!, $returnUrl: String!) {
setPaymentMethodOnCart(
input: {
cart_id: $cartId
payment_method: {
code: "buckaroo_magento2_sepadirectdebit"
buckaroo_additional: {
buckaroo_magento2_sepadirectdebit: {
customer_iban: "NL13TEST0123456789"
customer_bic: "TESTNL2A"
customer_account_name: "Test Account Holder"
}
}
}
}
) {
cart {
selected_payment_method {
code
}
}
}
setBuckarooReturnUrl(input: { return_url: $returnUrl, cart_id: $cartId }) {
success
}
placeOrder(input: { cart_id: $cartId }) {
order {
order_number
buckaroo_additional {
transaction_id
}
}
}
}Once the customer is redirected back, query the status with the stored transaction_id:
mutation {
buckarooPaymentTransactionStatus(input: { transaction_id: "E397CF4C24E64AA299F45246F9906F45" }) {
payment_status
status_code
}
}For dynamic values, use variables instead:
mutation checkPaymentStatus($input: BuckarooPaymentTransactionStatusInput!) {
buckarooPaymentTransactionStatus(input: $input) {
payment_status
status_code
}
}{
"input": {
"transaction_id": "E397CF4C24E64AA299F45246F9906F45"
}
}Having trouble? Work through this list before reaching out:
- Confirm the main plugin is installed and active, and that the method works in a standard Magento checkout.
- Confirm you are on the latest release of both this module and the main plugin.
- Check that the method code and the
buckaroo_additionalkey match, for examplebuckaroo_magento2_idealfor codebuckaroo_magento2_ideal. - Flush the cache after installing or upgrading.
Still stuck? Contact us and include your Magento version, main plugin version, this module's version, the query or mutation you sent and the response you received.
- Bug reports and feature requests: open an issue
- Technical support: support@buckaroo.nl
- Phone: +31 (0)30 711 50 50
- Gateway status: status.buckaroo.io
We really appreciate it when developers help improve the Buckaroo plugins. Please read our Contribution Guidelines before opening a pull request, and target the main branch.
Found a security issue? Please report it privately to support@buckaroo.nl instead of opening a public issue.
We follow semantic versioning (MAJOR.MINOR.PATCH):
- MAJOR — breaking changes that require additional testing and caution.
- MINOR — new functionality with limited impact.
- PATCH — bug fixes and hotfixes only.
This module is open source software licensed under the MIT license.
Made with care by Buckaroo.
This document is subject to change; typos and language errors are possible.