application/libraries/Stripe.php
/*
     * Transfer fund from main stripe account to custom account (connected account)
     * This is done when admin wants to keep a commission(some % of amount) from a payemnt and pay remaning amount to customer
     * Note: Transfer from connected account to its attached bank account will be done automatically (via Stripe Payout)
     */
Transfer fund from main stripe account to custom account (connected account)
This is done when admin wants to keep a commission(some % of amount) from a payemnt and pay remaning amount to customer
Note: Transfer from connected account to its attached bank account will be done automatically (via Stripe Payout)
Transfer fund from main stripe account to custom account ( connected account ) This is done when admin wants to keep a commission ( some % of amount ) from a payemnt and pay remaning amount to customer Note : Transfer from connected account to its attached bank account will be done automatically ( via Stripe Payout )
function stripe_to_custom_account_transfer($acc_id, $amount, $currency='usd'){
        $amount = round(($amount*100),2); 
        try{
            $transfer = \Stripe\Transfer::create( array(
                "amount" => $amount,
                "currency" => $currency,
                "destination" => $acc_id,
            ));
            if(empty($transfer)){
                return array('status'=>false,'message'=>'Something went wrong');
            }
            return array('status'=>true, 'message'=>'Funds transfered successfully', 'data'=>$transfer); 
        }catch (Exception $e) {
            $message = $e->getMessage();
            return array('status'=>false,'message'=>$message);
        }
    }
function stripe_to_custom_account_transfer ( $ acc_id , $ amount , $ currency = 'usd' ) { $ amount = round ( ( $ amount * 100 ) , 2 ) ; try { $ transfer = \ Stripe \ Transfer :: create ( array ( " amount " => $ amount , " currency " => $ currency , " destination " => $ acc_id , ) ) ; if ( empty ( $ transfer ) ) { return array ( 'status' => false , 'message' => 'Something went wrong' ) ; } return array ( 'status' => true , 'message' => 'Funds transfered successfully' , 'data' => $ transfer ) ; } catch ( Exception $ e ) { $ message = $ e -> getMessage ( ) ; return array ( 'status' => false , 'message' => $ message ) ; } }
Transfer fund from main stripe account to custom account (connected account)
 This is done when admin wants to keep a commission(some % of amount) from a payemnt and pay remaning amount to customer
 Note: Transfer from connected account to its attached bank account will be done automatically (via Stripe Payout)
Transfer fund from main stripe account to custom account ( connected account ) This is done when admin wants to keep a commission ( some % of amount ) from a payemnt and pay remaning amount to customer Note : Transfer from connected account to its attached bank account will be done automatically ( via Stripe Payout )
//convert to cents //success