Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Implement limited functionality for Split pay/split refund and linked account transfers #12

Merged
merged 25 commits into from
Dec 12, 2017

Conversation

PayLeaseBrian
Copy link
Contributor

@PayLeaseBrian PayLeaseBrian commented Jun 23, 2017

This PR implements some basic functionality related to linked merchant accounts and split pay. Specifically, it:

  • enables Split Pay for DirectDebit ACH & EFT Purchase
  • enables Split Pay for CardPayments Authorization and Settlement requests
  • enables Split Refund for CardPayments settlement refund requests
  • creates AccountManagement service in the SDK with limited functionality:
    • monitor
    • transferCredit
    • transferDebit

I added a number of unit tests for my new code. So, phpunit is now listed as a dev-only dependency.

composer.json Outdated
@@ -1,6 +1,5 @@
{
"name": "paysafegroup/paysafe_sdk_php",
"version": "1.0.1",
Copy link
Contributor Author

@PayLeaseBrian PayLeaseBrian Jun 23, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not include a specific version in composer.json, as I didn't want to potentially conflict with the release/tag name. Related: 2ba031d#commitcomment-22631188

@@ -15,12 +14,17 @@

],
"require": {
"php": ">=5.3.0",
"php": ">=5.6",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe any of my changes in the actual SDK code that requires 5.6. However, I believe the PHPUnit tests I added do. Perhaps that requirement would be better served w/ a require-dev. Although, Paysafe may wish to consider dropping official support for 5.3 since PHP doesn't even release security updates for that version anymore.

$classPath = strtolower(str_replace("\\", DIRECTORY_SEPARATOR, $className));
// lc first will make the P in the Paysafe root namespace lower case
// the remainder of the path/file should match case of the namespace/class
$classPath = str_replace("\\", DIRECTORY_SEPARATOR, lcfirst($className));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is the minor autoloader change I mentioned, with comments explaining. This change was inspired by this: #11 (comment)

@PayLeaseBrian PayLeaseBrian changed the title Implement Split pay for Credit Card auth/settle Implement Split pay for Credit Card auth/settle; DirectDebit ach & eft Jun 26, 2017
{
$this->expectException(PHPUnit_Framework_Error::class);
$this->expectExceptionMessage('Undefined variable: return');
/*
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note, this and a few other tests make reference to #13

PayLeaseBrian and others added 7 commits August 2, 2017 08:09
Adding a new service to the SDK for Account Management. This commit
includes the functions ping, transferCredit, and transferDebit. Transfer
functions can be used to move money between PaySafe master and
sub-accounts. The ping function can be used to determine if the
Account Management service is available.
@PayLeaseBrian PayLeaseBrian changed the title Implement Split pay for Credit Card auth/settle; DirectDebit ach & eft Implement limited functionality for Split pay and linked account transfers Sep 1, 2017
@PayLeaseBrian PayLeaseBrian changed the title Implement limited functionality for Split pay and linked account transfers Implement limited functionality for Split pay/split refund and linked account transfers Nov 30, 2017
@francoisneron francoisneron merged commit 8e1771b into paysafegroup:master Dec 12, 2017
@PayLeaseBrian PayLeaseBrian deleted the split-pay branch December 27, 2017 23:52
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants