Coder Social home page Coder Social logo

Comments (5)

luigel avatar luigel commented on August 16, 2024

Can you post a snippet of your code?

Also try importing

use Luigel\Paymongo\Facades\Paymongo; 

instead of

use Luigel\Paymongo\Paymongo;

from laravel-paymongo.

sironronron avatar sironronron commented on August 16, 2024

Im already importing

use Luigel\Paymongo\Facades\Paymongo

and tried

use Luigel\Paymongo\Paymongo;

Here's the code

public function handle()
    {

        $payment = Paymongo::payment()->create([
            'amount' => 55900,
            'currency' => 'PHP',
            'description' => 'Testing payment',
            'statement_descriptor' => 'Test Paymongo',
            'source' => [
                'id' => 'src_AvX628NWYoG1WmrJespGgLTt',
                'type' => 'source.chargeable'
            ]
        ]);

        logger($payment);

        return response()
            ->json([
                'successfulPayment' => $payment
            ], 200);
    }

from laravel-paymongo.

luigel avatar luigel commented on August 16, 2024

@sironronron I'm using laravel-paymongo v1.1.1. What version are you using?

Everything is working on my side. And you need to edit the amount. It should be a double type not integer. And also in the source parameter. The type should be source.

This is my snippet of a sample payment using source.

    $payment = Paymongo::payment()->create([
        'amount' => 100.00,
        'currency' => 'PHP',
        'description' => 'Testing payment',
        'statement_descriptor' => 'Test Paymongo',
        'source' => [
            'id' => 'src_61pBVCExTt5LxFj9N7kBs8L5',
            'type' => 'source'
        ]
    ]);

from laravel-paymongo.

sironronron avatar sironronron commented on August 16, 2024

I'm also using laravel-paymongo v1.1.1. Should I re-install it?

Thanks. Changed it.

from laravel-paymongo.

sironronron avatar sironronron commented on August 16, 2024

Re-installed it and now using laravel-paymongo v1.1.2.

Thanks.

from laravel-paymongo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.