Vraag? Stuur ons een bericht

+31 6 26 52 78 57

Wij verwerken online betalingen sinds 2006

Payment Methods

In this guide you will find information about the payment methods that PayPro supports.

PayPro supports a wide selection of payment methods. The API gives you access to these payment methods, which allow you to create your own payment method selection forms.
Futher, all payment creation API calls allow you to pre-select payment methods for even better user experiences.

List of Payment Methods

Below you will find a list of all supported payment methods.

Name Code API Calls Note
Afterpay afterpay/giro create_payment
create_product_payment
Requires to be enabled. See Guide for more information.
Bancontact bancontact/mistercash create_payment
create_product_payment
iDEAL – ABN AMRO ideal/ABNANL2A create_payment
create_product_payment
iDEAL – ASN Bank ideal/ASNBNL21 create_payment
create_product_payment
iDEAL – bunq ideal/BUNQNL2A create_payment
create_product_payment
iDEAL – ING ideal/INGBNL2A create_payment
create_product_payment
iDEAL – Knab ideal/KNABNL2H create_payment
create_product_payment
iDEAL – Moneyou ideal/MOYONL21 create_payment
create_product_payment
iDEAL – Rabobank ideal/RABONL2U create_payment
create_product_payment
iDEAL – RegioBank ideal/RBRBNL21 create_payment
create_product_payment
iDEAL – SNS Bank ideal/SNSBNL2A create_payment
create_product_payment
iDEAL – Triodos Bank ideal/TRIONL2U create_payment
create_product_payment
iDEAL – van Lanschot ideal/FVLBNL22 create_payment
create_product_payment
Mastercard creditcard/mastercard create_payment
create_product_payment
Requires to be enabled. See Guide for more information.
PayPal paypal/direct create_payment
create_product_payment
PayPal (recurring) paypal/recurring create_product_payment
Only used when creating recurring payments or subscriptions.
SEPA Bank Transfer banktransfer/sepa create_payment
create_product_payment
SEPA Direct Debit directdebit/sepa-once create_payment
create_product_payment
SEPA Recurring Debits directdebit/sepa-recurring create_product_payment
Only used when creating recurring payments or subscriptions.
Sofort (digital) sofort/digital create_product_payment
Used when selling digital products.
Sofort (physical) sofort/physical create_product_payment
Used when selling physical products.
Visa creditcard/visa create_product_payment
Requires to be enabled. See Guide for more information.

Getting payment methods

If you want to create your own payment form and you want to let your customers choose the payment method, you need a list of pay methods you want to support.

You could hardcode this, but a better way would be to get the payment methods from the API. This ensures any changes (for instance a new iDEAL bank) will also be reflected on your payment form.

You can do this with the get_all_pay_methods API command.

This API command returns a full list of payment methods for you to use.

# First we create a client object with our API key.
client = PayPro::Client.new('YOUR_API_KEY')
# We use the `get_all_pay_methods` command.
client.command = 'get_all_pay_methods'
# Execute the command and store the response.
response = client.execute
<?
// First we create a client object with our API key.
$client = new \PayPro\Client('YOUR_API_KEY');
// We use the `get_all_pay_methods` command.
$client->setCommand('get_all_pay_methods');
// Execute the command and store the response.
$response = $client->execute();
# First we create a client object with our API key.
client = Client('YOUR_API_KEY')
# We use the `get_all_pay_methods` command.
client.setCommand('get_all_pay_methods')
# Execute the command and store the response.
response = client.execute()

The API will respond with a JSON object. The response will contain these fields

{
  "data": {
    "afterpay": {
      "order": 8,
      "methods": [
        {
          "order": 1,
          "name": "Afterpay",
          "id": "afterpay/giro"
        }
      ],
      "description": "Afterpay"
    },
    "banktransfer": {
      "order": 5,
      "methods": [
        {
          "order": 1,
          "name": "SEPA Overboeking",
          "id": "banktransfer/sepa"
        }
      ],
      "description": "SEPA Overboeking"
    },
    "paypal": {
      "order": 2,
      "methods": [
        {
          "order": 1,
          "name": "PayPal",
          "id": "paypal/direct"
        },
        {
          "order": 2,
          "name": "PayPal",
          "id": "paypal/recurring"
        }
      ],
      "description": "PayPal"
    },
    "directdebit": {
      "order": 4,
      "methods": [
        {
          "order": 1,
          "name": "SEPA Eenmalige Machtiging",
          "id": "directdebit/sepa-once"
        },
        {
          "order": 2,
          "name": "Sign2pay",
          "id": "directdebit/sign2pay"
        },
        {
          "order": 3,
          "name": "SEPA Doorlopende Machtiging",
          "id": "directdebit/sepa-recurring"
        }
      ],
      "description": "SEPA Incasso"
    },
    "sofort": {
      "order": 7,
      "methods": [
        {
          "order": 1,
          "name": "Sofort",
          "id": "sofort/digital"
        },
        {
          "order": 2,
          "name": "Sofort",
          "id": "sofort/physical"
        }
      ],
      "description": "Sofort"
    },
    "bancontact": {
      "order": 3,
      "methods": [
        {
          "order": 1,
          "name": "Bancontact/MrCash",
          "id": "bancontact/mrcash"
        }
      ],
      "description": "Bancontact/MrCash"
    },
    "creditcard": {
      "order": 6,
      "methods": [
        {
          "order": 1,
          "name": "Visa",
          "id": "creditcard/visa"
        },
        {
          "order": 2,
          "name": "Mastercard",
          "id": "creditcard/mastercard"
        }
      ],
      "description": "Creditcard"
    },
    "ideal": {
      "order": 1,
      "methods": [
        {
          "order": 1,
          "name": "Rabobank",
          "id": "ideal/RABONL2U"
        },
        {
          "order": 2,
          "name": "ING",
          "id": "ideal/INGBNL2A"
        },
        {
          "order": 3,
          "name": "ABN AMRO",
          "id": "ideal/ABNANL2A"
        },
        {
          "order": 4,
          "name": "SNS Bank",
          "id": "ideal/SNSBNL2A"
        },
        {
          "order": 5,
          "name": "RegioBank",
          "id": "ideal/RBRBNL21"
        },
        {
          "order": 6,
          "name": "ASN Bank",
          "id": "ideal/ASNBNL21"
        },
        {
          "order": 7,
          "name": "Knab",
          "id": "ideal/KNABNL2H"
        },
        {
          "order": 8,
          "name": "Triodos Bank",
          "id": "ideal/TRIONL2U"
        },
        {
          "order": 9,
          "name": "van Lanschot",
          "id": "ideal/FVLBNL22"
        },
        {
          "order": 10,
          "name": "Bunq",
          "id": "ideal/BUNQNL2A"
        }
      ],
      "description": "iDEAL"
    }
  },
  "total": 8
}

You can also get payment methods for specific product. This API call will only return the payment methods that are activated for this product.

For this you use the get_pay_methods command.

# First we create a client object with our API key.
client = PayPro::Client.new('YOUR_API_KEY')
# We use the `get_all_pay_methods` command.
client.command = 'get_all_pay_methods'
# Set the product_id parameter.
client.setParam('product_id', 12345)
# Execute the command and store the response.
response = client.execute
<?
// First we create a client object with our API key.
$client = new \PayPro\Client('YOUR_API_KEY');
// We use the `get_pay_methods` command.
$client->setCommand('get_pay_methods');
// Set the product_id parameter.
$client->setParam('product_id', 12345);
// Execute the command and store the response.
$response = $client->execute();
# First we create a client object with our API key.
client = Client('YOUR_API_KEY')
# We use the `get_all_pay_methods` command.
client.setCommand('get_all_pay_methods')
# Set the product_id parameter.
client.setParam('product_id', 12345)
# Execute the command and store the response.
response = client.execute()

The response format will be the same as with a get_all_pay_methods command.

Using payment methods

Normally, when you create payments and do not supply a pay_method parameter, the customer will be redirected to a PayPro payment page. On this page, the customer can choose what payment method he wants to use.

Depending on the situation, this might not be what you want and you already know the payment method before creating the payment. The create_payment and create_product_payment allow a parameter pay_method to solve this. You can use the payment methods listed earlier in this parameter.

For instance, if you want to sent the customer to Bancontact you can do the following.

# First we create a client object with our API key.
client = PayPro::Client.new('YOUR_API_KEY')

# We use the `create_payment` command.
client.command = 'create_payment'

# Set the create_payment parameters.
client.params = {
  # The parameters `amount` and `consumer_email` are required for a `create_payment` command.
  amount: 500,
  consumer_email: 'test@paypro.nl',

  # Set the payment method to Bancontact
  pay_method: 'bancontact/mistercash'
}

# Execute the command and store the response.
response = client.execute
<?
// First we create a client object with our API key.
$client = new \PayPro\Client('YOUR_API_KEY');

// We use the `create_payment` command.
$client->setCommand('create_payment');

// Set the product_id parameter.
$client->setParams([
  // The parameters `amount` and `consumer_email` are required for a `create_payment` command.
  "amount" => 500,
  "consumer_email" => "test@paypro.nl",

  // Set the payment method to Bancontact
  "pay_method" => "bancontact/mistercash"
]);

// Execute the command and store the response.
$response = $client->execute();
# First we create a client object with our API key.
client = PayPro('YOUR_API_KEY')

# We use the `create_payment` command.
client.setCommand('create_payment')

# Set the create_payment parameters.
client.setParams({
    # The parameters `amount` and `consumer_email` are required for a `create_payment` command.
    'amount': 500,
    'consumer_email': 'test@paypro.nl',

    # Set the payment method to Bancontact
    'pay_method': 'bancontact/mistercash'
})

# Execute the command and store the response.
response = client.execute()

When you redirect the customer to the payment_url, it will be redirected to Bancontact and won’t see the PayPro payment page.

Guidelines

These are some guidelines when using payment methods.

Caching get_all_pay_methods result

When using the get_all_pay_methods it is good practice to cache the results. The payment methods won’t change often enough to do an API command each time a customer gets on your payment page. It also helps speeding up your payment form which is good for the conversion rate.

We recommend caching the result for 24 hours.

Postbacks

API Reference

Support

Would you like additional support or do you have questions? Contact us.