Jump to content

Feature Request - Add bank account details under General Settings


alexm
 Share

Recommended Posts

Hey @kongondo hope all is well. Here's a little feature request that I think may tie in nicely, especially for those using PaymentInvoice as an option.

A fieldset for Bank Account Details that would store Bank Name, Sort Code and Account Number. This could then be automatically displayed on invoices, which is more or less a necessity to have on invoice if you are offering people to check out using Invoice as the payment option.

??

  • Like 1
Link to comment
Share on other sites

Hey @alexm,

On 5/31/2023 at 11:54 AM, alexm said:

Here's a little feature request that I think may tie in nicely, especially for those using PaymentInvoice as an option.

A fieldset for Bank Account Details that would store Bank Name, Sort Code and Account Number.

Cool idea. Given that people will have different needs on what extra information to capture for invoice payments (or indeed other payments or just general customer info), I am inclined to let devs implement this per their needs. The implementation would be similar to the custom fields example in demo-2. Thus:

  • Display inputs for bank details in your checkout form. If only accepting invoice payments, always show the fields and make them required. If accepting other payment options, toggle-show the bank details inputs (e.g. using Alpine.js) 
  • In ready.php listen to PadloperProcessOrder::orderSaved as shown here in demo-2. Use that to save capture and save your bank details. Save those to some field(s) you have added to the template padloper-order. You have several choices here, e.g. multiple text fields, or a repeater matrix or a multiplier text field, etc. You could even get away with a single textarea since this is not a field you will need to query in the frontend. If user continues to shop after the first checkout attempt, you can use $order-your_bank_details_field to show them the bank details they entered when they first attempted checkout. It would be best to check if there is a valid Padloper session before doing this. Perhaps best just to let them re-enter the bank details though.
  • To display the bank details in the backend, there are several places you can hook into in the single order view depending on where you want to display the info.
  • To show the bank details on the invoice, copy /site/modules/Padloper/templates/invoice-content-html.php to /site/templates/padloper/invoice-content-html.php and edit per your needs. This template will receive the Page $order. That will give you access to $order-your_bank_details_field.

Would this work for you? Lemme know.

  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...

@kongondo sorry about my long overdue response. I think there might be some confusion, unless I'm having a bit of a moment. When the customer buys from the store I wouldn't need to get their bank details, but they would need to have the store's bank details to make the payment to the store. Therefore there would be no need to have the ability to collect the customers bank details at checkout as they won't need paying. However the invoice template in general, whether it be that the customer checked out via 'invoice' payment or 'stripe' etc would probably be advisable to include the stores bank details for receiving payments. Hence, I would think that most people will want the ability to add their store's bank details on the store configuration so they can be displayed on invoices sent/or printed via the system so customers can make bank transfer payments.

For no I have hard coded it ??

  • Like 1
Link to comment
Share on other sites

54 minutes ago, alexm said:

I think there might be some confusion, unless I'm having a bit of a moment.

@alexm. Sorry, my bad! I get you now. I'll add this to the settings together with your other idea about a 'from email address'. I'll make a variable, $storeDetails or something like that available to invoice-content-html.php. This will give you access to the bank details saved in the store config. Do you need more than these three pieces of info?

Quote

Bank Name, Sort Code and Account Number

Cheers.

  • Thanks 1
Link to comment
Share on other sites

  • 11 months later...

@kongondo Hey mate, what did you end up calling the variable for getting the store deets in the invoices in the end? Just trying wanting to grab the bank details from General settings you seeeee

Link to comment
Share on other sites

Hi @alexm,

<?php

namespace ProcessWire;

/** @var WireData $shopBankDetails */
$shopBankDetails = $padloper->getShopBankDetails();
$shopBankDetails->bankName;
$shopBankDetails->bankSortCode;
$shopBankDetails->bankAccountNumber;
$shopBankDetails->bankIBAN;
$shopBankDetails->bankBIC;
// @note: same as BIC
$shopBankDetails->bankSWIFTCode;

 

  • Thanks 1
Link to comment
Share on other sites

Thanks @kongondo! That's bloomin' marvellous ??

Just a thought... Sorry.... Haha. Would it be possible to add another property called 'bankAccountName' as sometimes it will ask for the business account name when people go to pay?

What say you?

  • Like 1
Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...