This a Drupal Commerce payment module and integrates with New Zealand's DPS Account 2 Account Hosted payment system.
There is currently not module that integrates with the account 2 account payment system.

Project page
https://drupal.org/sandbox/garethhallnz/2199835

Git
git clone --branch master garethhallnz@git.drupal.org:sandbox/garethhallnz/2199835.git

Other patches and reviews.
https://drupal.org/node/1927650
https://drupal.org/node/1496254
https://drupal.org/node/1810636
https://drupal.org/node/2066533

Reviews of other projects
https://drupal.org/comment/8603941#comment-8603941
https://drupal.org/comment/8603999#comment-8603999
https://drupal.org/comment/8604025#comment-8604025

CommentFileSizeAuthor
#15 coder-results.txt2.12 KBklausi

Comments

PA robot’s picture

Status: Needs review » Needs work

There are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxgarethhallnz2199835git

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

garethhallnz’s picture

Status: Needs work » Needs review

Errors found by Pareview fixed

malovanets’s picture

Status: Needs review » Needs work

Hi

The main point: It would be nice to have some test merchant credentials attached to the issue.

What about the code:

1) No more than 1 whitespace required after the key when declaring an array. I agree that it looks fancy but it is not a drupal coding style practice.

$items['commerce_dps_account_to_account_pxpay/fprn'] = array(
    'page callback'   => 'commerce_dps_account_to_account_process_fprn',
    'page arguments'  => array(),
    'access callback' => TRUE,
    'type'            => MENU_CALLBACK,
  );

2) When you are declaring an XML string you should probably avoid hardcoding the tags in the php or at least duplicating htmlspecialchars() for each tag.

3) commerce_dps_account_to_account.module line 24

'page arguments' => array(),

are you sure you need to declare an empty array if the callback does not receive any arguments?

garethhallnz’s picture

Status: Needs work » Needs review

Hi

Thank you for your feedback and reviewing the module.

1) Whitespace removed

2) That seems a bit messy? What is Drupal's preferred way of doing this?
I Google around a bit but could not find anything solid.
Would simpleXML be an acceptable alternative?

3) Removed page arguments

1) and 3) have been pushed up with git and will tackle point 2) based on you recommendation.

Sorry I can't provide test merchant credentials.

Directly from the merchant provider.

A2A can not be implemented on a Developer account as we have to use an actual bank account number for A2A transactions,

It can only be implemented on a live payment gateway.

The above said I will send you the live credentials for testing via your contact form on your profile.

xurizaemon’s picture

Gareth, if you'd rather keep the DPS functionality together, I'm open to this module being included in Commerce DPS. If so then feel free to add it via #2100685: Account 2 Account integration.

Does A2A really use the PxPay XML? commerce_dps_pxpay.inc and commerce_dps_account_to_account.inc are mostly identical (I haven't checked if you're using those functions in the main module).

Looks like A2A may be missing some DPS improvements (eg special handling for currencies without cents, eg JPY) and I see commerce_dps_*_currencies() has been modified - do you think there's benefit to sharing those improvements by having them in a commerce_dps.inc instead of in two modules?

garethhallnz’s picture

Assigned: Unassigned » garethhallnz
Status: Needs review » Needs work

As mentioned on the other issue https://drupal.org/node/2100685 I am happy for an integration effort.

Yes I know it's crazy but the A2A is pretty much the same as PxPay.

I am aware that it's missing some of the currency improvements but as is based on NZ bank transfers I am not sure the impact is enough to warrant any action just yet.

For the time being I think the modules should be separate so other users can reap the benefits now rather than wait another 6 months till we can work out the integration with PxPay.

At the moment I am looking at refactoring the xml to use simpleXML as that will be a bit cleaner and less verbose.

garethhallnz’s picture

Just checked the A2A documentation and it does not support any currencies other that NZD

garethhallnz’s picture

Assigned: garethhallnz » Unassigned
Status: Needs work » Needs review

Ready for testing again :)

Covered of the final item refactored to use simplexml

garethhallnz’s picture

Issue summary: View changes
garethhallnz’s picture

Issue summary: View changes
garethhallnz’s picture

Issue summary: View changes
Issue tags: +PAreview: review bonus
klausi’s picture

Status: Needs review » Postponed (maintainer needs more info)

I agree that this should go into the existing module. Module duplication and fragmentation is a huge problem on drupal.org and we prefer collaboration over competition. So let's get this into the existing module, looks like the maintainer is eager to support you.

If that fails for whatever reason please get back to us and set this back to "needs review".

garethhallnz’s picture

Status: Postponed (maintainer needs more info) » Needs work

Hi Klausi, thank you for your time.

I am not sure I agree. This module might share some of the code from the commerce_dps but that's because both gateways have similar processes.

It's not duplication they integrate with different gateways.
commerce_dps handles hosted credit card transactions
this module handles account to account bank transfer payments

It's not competition, as mentioned above they integrate with different systems. They are not competing modules.

Collaboration, I have already contributed to the commerce_dps module and I will continue to do so.

I agree with both of you, yes these module should be combined (long term) and I will collaborate with xurizaemon but it's going to take a long time as there will be significant refactoring. Before refactoring for A2A we'll also have to look at PxFusion and PxPay and make sure our refactoring take those implementations into account.

Truthfully I don't see us getting anywhere near an integration release in the next 6 months.

With the above in mind, for the foreseeable future it would be better to keep these modules separate until such time that I and xurizaemon can work on the logistics to merge these projects.

Once done I will be happy to deprecate my module.

Not releasing this module only disadvantages anyone needing this module. The worst thing that could happen is for someone else to start writing another A2A module.

Please reconsider releasing this module.

garethhallnz’s picture

Status: Needs work » Needs review
klausi’s picture

Assigned: Unassigned » patrickd
Status: Needs review » Reviewed & tested by the community
Issue tags: -PAreview: review bonus
StatusFileSize
new2.12 KB

Ok, but I think you should document the related module on your project page?

Review of the 7.x-1.x branch:

This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.

manual review:

  1. commerce_dps_account_to_account_process_fprn(): instead of invoking drupal_not_found() you can simply return the constant MENU_NOT_FOUND.
  2. "drupal_alter('commerce_dps_account_to_account_merchant_reference', $reference, $order, $settings);": Hooks that are provided by a module should be documented in MODULENAME.api.php, see http://drupal.org/node/161085#api_php

But otherwise looks RTBC to me. Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.

Assigning to patrickd as he might have time to take a final look at this.

xurizaemon’s picture

Gareth, I don't concur with your estimate of integration taking six months - I've already said that I'm happy to commit the code here to Commerce DPS. Adding this to the existing module has no conflicts AFAICT, except README.txt which I *think* is manageable ;)

This could be committed today (or last week, or whenever) and any code merging can be done down the track. That seems simplest, but it's your contribution and you're welcome to do with it what you prefer - the community benefits either way.

garethhallnz’s picture

Sorry Chris but just adding the code here to your DPS module is a half baked solution and I don't like contributing work like this.

I prefer doing it properly even with a D8 version in mind. I was thinking we should write a DPS payment class with an interface that each submodule implements. That way when D8 comes along we only need to deal with minimal routing and hook changes.

With the above in mind it will take awhile, it's a simple fact; we are both pretty busy people and even the current issues on commerce_dps take awhile to turn around let alone such a major overhaul.

6 months is more than realistic.

garethhallnz’s picture

Fixed issues noted in #15

patrickd’s picture

Status: Reviewed & tested by the community » Fixed

sorry, saw this too late

As I haven't touched PHP or Drupal in the last couple months I don't think it's a good idea to let me decide on anything like this ;)

I'll make an exception here because your code looks well written and well documented and .. because if klausi says it's ready he's usually right.

One thing catched my eye though:

here you do that
drupal_alter('commerce_dps_account_to_account_merchant_reference', $reference, $order, $settings);

and in commerce_dps_account_to_account.api.php you describe it like that:
function hook_commerce_dps_account_to_account_merchant_reference($reference, $order, $settings) {

but I am pretty sure that it's actually like that:
function hook_commerce_dps_account_to_account_merchant_reference_alter($reference, $order, $settings) {

Maybe take another look at the drupal_alter() api documentation:
https://api.drupal.org/api/drupal/includes%21module.inc/function/drupal_...

you should really test whether your hooks work the way you intended them to work before releasing this! ;)

beside that everything looks pretty solid, therefore

Thanks for your contribution, garethhallnz!

I updated your account so you can promote this to a full project and also create new projects as either a sandbox or a "full" project.

Here are some recommended readings to help with excellent maintainership:

You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and stay involved!

Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

Thanks to the dedicated reviewer(s) as well.

garethhallnz’s picture

Status: Fixed » Closed (fixed)

Thanks guys

Chris Ill be in touch soon and we can start working on integration with commerce_dps