Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Add payouts #8

Merged
merged 20 commits into from
Aug 12, 2024
Merged

Add payouts #8

merged 20 commits into from
Aug 12, 2024

Conversation

olssonm
Copy link
Owner

@olssonm olssonm commented Aug 9, 2024

This PR enables payouts via the Swish API (see #7).

Might require a major semver update depending on how the certificates and signing processes are handled.

@vinkla
Copy link
Contributor

vinkla commented Aug 10, 2024

Great work Marcus 🔥

I highly recommend releasing this under a branch alias if possible, then we can test it out and fix any quirks before releasing a new stable version.

@olssonm
Copy link
Owner Author

olssonm commented Aug 10, 2024

@vinkla Yep, will do – and/or possible publish a pre-release. Still a few quirks to iron out, will ping when something is available to test.

@olssonm
Copy link
Owner Author

olssonm commented Aug 10, 2024

@vinkla You should now be able to require the development-branch with:

"repositories": [
        {
            "type": "vcs",
            "url": "git@github.com:olssonm/swish-php.git"
        }
    ],

And running composer require olssonm/swish-php:dev-dev/payouts

@vinkla
Copy link
Contributor

vinkla commented Aug 11, 2024

Thanks! I'll test this as soon as possible.

@@ -5,6 +5,8 @@
'client' => env('SWISH_CLIENT_CERTIFICATE_PATH'),
'password' => env('SWISH_CLIENT_CERTIFICATE_PASSWORD'),
'root' => env('SWISH_ROOT_CERTIFICATE_PATH', true),
'signing' => env('SWISH_SIGNING_CERTIFICATE_PATH', null), // Optional, used for payouts
Copy link
Contributor

@vinkla vinkla Aug 12, 2024

Choose a reason for hiding this comment

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

I suggest wrapping these in a storage_path helper function or providing an example of how to add these in the .env file.

Copy link
Owner Author

Choose a reason for hiding this comment

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

@vinkla Yes, should be clarified that it's the full/absolute path of the file that is needed. Using storage_path is not optimal as the certificates might be stores outside of Laravel and/or the .env-file might be used by multiple apps in the same environment with different storage paths.

@@ -5,6 +5,8 @@
'client' => env('SWISH_CLIENT_CERTIFICATE_PATH'),
'password' => env('SWISH_CLIENT_CERTIFICATE_PASSWORD'),
'root' => env('SWISH_ROOT_CERTIFICATE_PATH', true),
'signing' => env('SWISH_SIGNING_CERTIFICATE_PATH', null), // Optional, used for payouts
'signing_password' => env('SWISH_SIGNING_CERTIFICATE_PASSWORD', null), // Optional, used for payouts
],
'endpoint' => \Olssonm\Swish\Client::PRODUCTION_ENDPOINT,
Copy link
Contributor

Choose a reason for hiding this comment

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

@olssonm what do you think about adding this as a environment variable as well?

Suggested change
'endpoint' => \Olssonm\Swish\Client::PRODUCTION_ENDPOINT,
'endpoint' => env('SWISH_URL', \Olssonm\Swish\Client::PRODUCTION_ENDPOINT),

Copy link
Owner Author

Choose a reason for hiding this comment

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

@vinkla Good call, definitely! Will add it in a separate PR soon, as Swish now also provides a staging environment that will be added as a constant.

Copy link
Contributor

@vinkla vinkla left a comment

Choose a reason for hiding this comment

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

Great work! The test API appears to be functioning as expected 🙌

@vinkla vinkla mentioned this pull request Aug 12, 2024
@olssonm olssonm merged commit efa179c into main Aug 12, 2024
20 checks passed
@vinkla vinkla mentioned this pull request Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants