SlimPay Developer Center

  • REST API
  • File Transfer
  • Resources
  • Overview
  • Use Case Guides
  • Reference
  • Browser
 
Getting Started
  • Choosing the right HTTP client
  • Get an access token
  • Retrieving URLs
  • Where to next?
Enroll your customers
  • Checkout Integration Types
  • SlimPay Checkout
  • Checkout Api
  • Setting Up SlimCollect
  • Import an Existing Mandate
  • Add a Document Signature
Collect payments
  • Add a First Payment
  • Collect Payments by Direct Debit
Webhook
  • Configuration
  • Notification
  • Security
Monitor activity
  • Handle Payment Issues
  • Refund Payments
  • Update the Payment Method

Update the Payment Method

Please note

This guide does not cover the basics of API authentication or the format of requests and responses. Please review these sections if you are unfamiliar with these concepts.

After setting up a payment method, the subscriber (your customer) may want to:

Update the bank account

You can update and change the bank account that is associated with an existing mandate and direct debit plan. This is done by following the same steps taken to set up a direct debit, but this time setting the action property of the signMandate order item to amendBankAccount instead of sign:

$rel = new Hal\CustomRel('https://api.slimpay.net/alps#create-orders');
$follow = new Http\Follow($rel, 'POST', null, new Http\JsonBody(
[
    'started' => true,
    'locale' => null,
    'creditor' => [
        'reference' => 'yourCreditorReference'
    ],
    'subscriber' => [
        'reference' => 'yourSubscriberReference'
    ],
    'items' => [
        [
            'type' => 'signMandate',
            'action' => 'amendBankAccount',
            'mandate' => [
                'reference' => 'theMandateReference'
            ]
        ]
    ]
]
));
$order = $hapiClient->sendFollow($follow);
$orderReference = $order->getState()['reference'];

You will then have to display the Checkout to the user (with a redirect link or iframe) so they can provide their new IBAN.

If you already have the IBAN at hand and don’t need it from the customer, you can update the bank account directly using the API rather than the Checkout. This is done by retrieving the relevant customer’s mandate (using the get-mandates relation), then updating the IBAN associated with that mandate using the update-bank-account relation:

// Retrieve the mandate
$rel = new Hal\CustomRel('https://api.slimpay.net/alps#get-mandates');
$follow = new Http\Follow($rel, 'GET', [
    'creditorReference' => 'yourCreditorReference',
    'reference' => 'theMandateReference'
]);
$mandate = $hapiClient->sendFollow($follow);

// Update the bank account
$rel = new Hal\CustomRel('https://api.slimpay.net/alps#update-bank-account');
$follow = new Http\Follow($rel, 'POST', null, new Http\JsonBody([
    'iban' => 'theNewIban'
]));
$bankAccount = $hapiClient->sendFollow($follow, $mandate);

In both of the above cases, after the bank account details have been updated, the mandate reference itself remains the same.

Please note: if the new bank account belongs to a different person, you have to set up a new direct debit plan for this new customer, which requires them to sign a new mandate.

 
SlimPay
  • Developer Center
  • Help Center
  • Website
  • REST API
    • Overview
    • Guides
    • Reference
    • Browser
    • Clients
  • File Transfer
    • Overview
    • Checkout
    • Payments
    • Payments Issues
    • Account Reporting
  • Resources
    • FAQ
    • IBANs