Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- try{
- $s_amount = $input['total_payment'];
- $percent = ($s_amount * 29)/1000;
- $total1 = $percent+0.3;
- $total = $s_amount + $total1;
- $admin_amount = $guard->hourly_rate * $input['billing_hours'];
- $charge = Stripe::charges()->create([
- 'customer' => $cust_id->stripe_customer_id,
- 'currency' => 'USD',
- 'amount' => $total,
- 'application_fee' => $admin_amount,
- 'destination' => $guard->stripe_bank_account_id,
- ]);
- }
- catch(\Stripe\Error\Card $e) {
- return Response::json(array('success'=>'0','errortype'=>$e->getErrorType(), 'msg'=>$e->getMessage()),200);
- } catch (\Stripe\Error\RateLimit $e) {
- return Response::json(array('success'=>'0','errortype'=>$e->getErrorType(), 'msg'=>$e->getMessage()),200);
- } catch (\Stripe\Error\InvalidRequest $e) {
- return Response::json(array('success'=>'0','errortype'=>$e->getErrorType(), 'msg'=>$e->getMessage()),200);
- } catch (\Stripe\Error\Authentication $e) {
- return Response::json(array('success'=>'0','errortype'=>$e->getErrorType(), 'msg'=>$e->getMessage()),200);
- } catch (\Stripe\Error\ApiConnection $e) {
- return Response::json(array('success'=>'0','errortype'=>$e->getErrorType(), 'msg'=>$e->getMessage()),200);
- } catch (\Stripe\Error\Base $e) {
- return Response::json(array('success'=>'0','errortype'=>$e->getErrorType(), 'msg'=>$e->getMessage()),200);
- } catch (Exception $e) {
- return Response::json(array('success'=>'0','errortype'=>0, 'msg'=>$e->getMessage()),200);
- }
Add Comment
Please, Sign In to add comment