omise / omise-php

Omise PHP library
https://docs.opn.ooo
MIT License
67 stars 41 forks source link

Not receiving webhook for charges #120

Closed eNzyOfficial closed 5 years ago

eNzyOfficial commented 5 years ago

I'm trying to receive a webhook once a user has completed a payment using 3D secure but for some reason Omise isn't picking it up as event or isn't sending out the webhook request. Not sure if it's a problem with my configuration or Omise itself?

$charge = OmiseCharge::create([
            'amount' => $package->price(),
            'currency' => 'usd',
            'capture' => false,
            'customer' => $user->getAttribute('omise_customer_id'),
            'card' => $user->getAttribute('omise_card_id'),
            'ip' => $request->ip(),
            'return_uri' => secure_url('/dashboard'),
        ], config('omise.public_key'), config('omise.secret_key'));

I am setting capture to false and a return_uri and receiving back an authorize_uri, however navigating to said url, while it does redirect me back to the correct return_uri, it doesn't send out a webhook request. (I have tried this on the live mode yet, only test mode)

If you could point me in the right direction, that'd be great. Thanks

guzzilar commented 5 years ago

@eNzyOfficial Hi, I see you closed this ticket. The issue has been solved already? Feel free to let us know if you still need any help. : )

eNzyOfficial commented 5 years ago

Yes thanks, I contacted support, they said it could not be enabled manually and had to be done by Omise so all resolved. One thing I have noticed though, after visiting the authorize_uri in test mode, it does not get marked as paid, is this intentional?

guzzilar commented 5 years ago

@eNzyOfficial Yes, it is an expected behaviour. As you set 'capture' => false from the code above when you create a new charge so it does only 'authorized a card but not auto capture'.