protected function validateCoupon($validator, Request $request)
    {
        try {
            $coupon = StripeCoupon::retrieve(
                $request->coupon, ['api_key' => config('services.stripe.secret')]
            );

            if ($coupon && $coupon->valid) {
                return;
            }
        } catch (Exception $e) {
            //
        }

        $validator->errors()->add('coupon', 'The provided coupon code is invalid.');
    }
protected function validateCoupon($validator, Request $request)
    {
        try {
            $coupon = StripeCoupon::retrieve(
                $request->coupon, ['api_key' => config('services.stripe.secret')]
            );

            if ($coupon && $coupon->valid) {
                return;
            }
        } catch (Exception $e) {
            //
        }

        $validator->errors()->add('coupon', 'The provided coupon code is invalid.');
    }
protected function validateCoupon ( $ validator , Request $ request ) { try { $ coupon = StripeCoupon :: retrieve ( $ request -> coupon , [ 'api_key' => config ( 'services.stripe.secret' ) ] ) ; if ( $ coupon && $ coupon -> valid ) { return ; } } catch ( Exception $ e ) { // } $ validator -> errors ( ) -> add ( 'coupon' , 'The provided coupon code is invalid.' ) ; }
Validate that the provided coupon actually exists on Stripe.

@param  \Illuminate\Validation\Validator  $validator
@param  \Illuminate\Http\Request  $request
@return void
Validate that the provided coupon actually exists on Stripe .