#monesh_sahu

1 messages · Page 1 of 1 (latest)

scenic ventureBOT
lethal oxide
#

👋 happy to help

#

what do you need exactly?

noble arrow
#

com.stripe.android.core.exception.PermissionException: Only Stripe Connect platforms can work with other accounts. If you specified a client_id parameter, make sure it's correct. If you need to setup a Stripe Connect platform,

#

getting this error in android

lethal oxide
#

could you share the code please?

noble arrow
#

<?php

namespace App\Http\Controllers\V1\API;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Stripe\PaymentIntent;
use Stripe\Stripe;

require_once '../vendor/autoload.php';

class StripeController extends Controller
{

protected $stripe;
public function __construct()
{
    $this->stripe = \Stripe\Stripe::setApiKey(env("STRIPE_SECRET_KEY"));
}

public function createIntent(Request $request)
{
    header('Content-Type: application/json');

    $params = [
        'price' => $request->input('price'),
    ];
    
    try {
        
        // Create a PaymentIntent with amount and currency
        $paymentIntent = \Stripe\PaymentIntent::create([
            'amount' => $params['price']*100,
            'currency' => 'USD',
            'automatic_payment_methods' => [
                'enabled' => true,
            ],
        ]);

        $output = [
            'clientSecret' => $paymentIntent->client_secret,
        ];
        return response()->json($output);
    } catch (Error $e) {
        http_response_code(500);
        return response()->json(['error' => $e->getMessage()]);
    }
}

public function paymentSuccess(Request $request)
{
    // 
}

public function failedPayment(Request $request)
{
    // 
}

}

#

this is my controller looks like

lethal oxide
#

let me take a look

noble arrow
#

ok

#

req_otTBVCBsOfu0Cn

lethal oxide
#

taking a look

#

the code on your PHP end is working fine

#

the problem is in the mobile

#

could you share that code please?

noble arrow
#

yes wait i will share