Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Nov 04 12:45
    kinglozzer closed #63
  • Nov 04 12:43
    kinglozzer closed #171
  • Nov 04 12:43
    kinglozzer commented #171
  • Nov 04 12:41
    kinglozzer closed #233
  • Nov 04 12:41
    kinglozzer commented #233
  • Nov 04 12:37

    kinglozzer on 3

    Fix travis builds Merge pull request #235 from bi… (compare)

  • Nov 04 12:37
    kinglozzer closed #235
  • Nov 04 10:59
    kinglozzer synchronize #235
  • Nov 04 10:10
    kinglozzer synchronize #235
  • Nov 04 10:01
    kinglozzer synchronize #235
  • Nov 04 09:58
    kinglozzer opened #235
  • Nov 04 09:57
    kinglozzer converted_to_draft #233
  • Nov 04 09:43
    kinglozzer edited #233
  • Nov 04 09:38

    kinglozzer on master

    Update branch alias to 4.x-dev (compare)

  • Nov 04 09:32

    kinglozzer on 3

    (compare)

  • Nov 03 17:37
    kinglozzer commented #233
  • Nov 03 17:36
    kinglozzer synchronize #233
  • Nov 03 17:23
    kinglozzer synchronize #233
  • Nov 03 16:23
    kinglozzer synchronize #233
  • Nov 03 15:50
    kinglozzer synchronize #233
Morven Lewis-Everley
@mlewis-everley
so I am adding some more exception types
and throwing exceptions from the functions, then catching them in the action
does that sound ok?
Roman Schmid
@bummzack
@mlewis-everley hmm I'd like to avoid that if possible
let me have a look
why do you need to throw the exceptions? Can't you just return null there and output an error in case the return value is null?
Morven Lewis-Everley
@mlewis-everley
Well you were outputting two different error codes (403 and 404)
Roman Schmid
@bummzack
yes
403 if the intent is invalid
404 if the payment can't be processed or doesn't exist
Morven Lewis-Everley
@mlewis-everley
so just returning null isn't enough to determine what error code to return?
Also, what's wrong with exceptions?
Roman Schmid
@bummzack
It makes the codebase bigger for a problem that can easily be solved with a slightly different architecture
these exceptions aren't being used anywhere else
just to handle stuff between a few protected methods doesn't warrant separate exception classes imho
Morven Lewis-Everley
@mlewis-everley
I don't really see how I can return one of two different error codes based on just returning null from a function?
Roman Schmid
@bummzack
then don't nest the functions? eg. getServiceResponse gets the intent via getPaymentIntent. The latter is the one that should have it's own error handling
you can get the intent, check its return value and respond with an error if it's null
then pass it on to the getServiceResponse method if it's valid
I can give it a go if you want… not sure what's needed that I can push to your pr though
Morven Lewis-Everley
@mlewis-everley
Well, I can revert it back, I don't really see how you are going to reduce the duplication in codebase
Roman Schmid
@bummzack
I'll try to add to your PR in a sec.
Roman Schmid
@bummzack
Lol, i pushed to the wrong repo
oh well, it's merged now :)
Roman Schmid
@bummzack
@mlewis-everley I cleaned up the code a bit. I hope it's understandable. Let me know if you disagree or if I overlooked something
And for the next PR, it would be great if you created a separate branch first… that way I won't be pushing to the main repo again by accident :D
Morven Lewis-Everley
@mlewis-everley
@bummzack Just had a look, code looks fine, was trying to read the docs but we are having power cuts due to snow (because we live in the south of the UK and are incapable of holding up to a few inches)
Briar Woodhead
@beeonlinenz
Anyone familiar with Silvershop-Stripe https://github.com/markguinn/silvershop-stripe (or is @markguinn about? :)). Attempting to implement it as an AuthorizeService so the payment can be captured when the order is confirmed, but payment is still getting taken..
Roman Schmid
@bummzack
@beeonlinenz I think that should also work with authorized payments. Did you set the payment config accordingly? Eg. use_authorize: true?
Briar Woodhead
@beeonlinenz
@bummzack I expected it to be as simple as that - and then completely overthought it. That was all that was needed - THANK YOU!! :)
Mikael Norrgård
@MikaelNorrgard_twitter
Hi. I'm quite new to SilverStripe and now I'm trying to make a Silvershop project with the Omnipaymodule. Somehow I get "Server Error" when I'm trying to checkout using the "Proceed to payment" button. I am using Silvershop-Core-2.0 and the Silverstripe-Omnipay-2.0 modules because I don't have the newest Silverstripe version. What do you think are the problem? I just need to get some orders to the admininterface now to start with so some dummyorders could be a good start too. How do I make some dummyorders to the admininterface?
Roman Schmid
@bummzack
Server error usually means an error in php. You should check your error log or enable dev-mode to see what the error message is
most likely you're missing a payment gateway?
You could add the dummy or manual gateway to test…
eg. composer require omnipay/manual
Then you'd also have to add the gateway to Payment.allowed_gateways in your config.
See this documentation for an extensive writeup what you can/should configure: https://github.com/silverstripe/silverstripe-omnipay/blob/2/docs/en/Configuration.md
Mikael Norrgård
@MikaelNorrgard_twitter
Thank you for the fast answer. I will try them out and see if I get some orders in the admininterface. It's hard to know how things work in the beginning. So there is no payment gateway there already when you download the shop and omnipay module?
Roman Schmid
@bummzack
no, there's no payment gateway installed by default. We can't know what you're going to need :)
Mikael Norrgård
@MikaelNorrgard_twitter

Yeah that't true of course. :) So to use the dummy or manual gateway I just have to run the "composer require omnipay/manual (or /dummy) command and then add the text under here in a payment.yml file in mysite/_config/payment.yml?

Name: payment


YAML configuration for SilverStripe

See http://doc.silverstripe.org/framework/en/topics/configuration

Caution: Indentation through two spaces, not tabs

Payment:
allowed_gateways:

  • 'Dummy'
  • 'Manual'
Roman Schmid
@bummzack
Yeah, then you'd also need to run dev/build so that your configuration gets picked up
Mikael Norrgård
@MikaelNorrgard_twitter
Somehow I still get the same Server Error after I changed the config file and run the dev/build but now I get it when I press the "proceed to checkout" button. Can't find anything about it in the error log. I tried to download a new Silvershop-Core-2.0 and Silverstripe-Omnipay-2.0 module and the same thing happened.
Roman Schmid
@bummzack
what do you mean with download ? You did install with composer, right?
Mikael Norrgård
@MikaelNorrgard_twitter
I went to github and downloaded the zip files for the two modules and unpacked them in the root for the silverstripe project. I tried to run the composer installation commands too but nothing happened.
Roman Schmid
@bummzack
@MikaelNorrgard_twitter Sadly, it's not that simple. If you download the modules there, you just get the module without any dependencies. Resolving all the dependencies is exactly what packet-managers such like composer are built for. I strongy suggest you install composer on your machine and use it to install the modules. See here for instructions: https://getcomposer.org/download/
Morven Lewis-Everley
@mlewis-everley
@MikaelNorrgard_twitter If you are using the dummy gateway, make sure you read https://github.com/silverstripe/silverstripe-omnipay/blob/master/docs/en/TestPayments.md
Otherwise you might end up with a test form with no fields
Mikael Norrgård
@MikaelNorrgard_twitter

I was told it could be possible to do it that way but I guess that was wrong then. :) I installed silverstripe with some help some time ago and have only used the same project to practise until now.

Now I have got the two modules installed in the correct folder with composer but sadly it still don't work. But I guess it's something wrong with the database or something else now. It's not easy to learn new things. I had some brainfreeze before and installed the projects to the wrong folder. :D

Sander Hagenaars
@sanderha
@MikaelNorrgard_twitter By the way these lessons are very good for learning SilverStripe https://www.silverstripe.org/learn/lessons/v3/ :-)
Mikael Norrgård
@MikaelNorrgard_twitter
Thanks for the help. I did some progress today and now the project is up and running and the "Manual" payment gateway is working. :)