Giter Club home page Giter Club logo

instamojo-php's Issues

Rename the class file name

It's not working on the linux server. Case sensitivity issue.
Rename the file instamojo-php/src/instamojo.php to instamojo-php/src/Instamojo.php

Composer support

Problem Definition:

  1. Could not use the package manager composer for installing dependencies.

Solution:

  1. It will greatly help to have a support for composer.

object(Instamojo\Instamojo)#3 (0) { }

$api = Instamojo\Instamojo::init('app',[
"client_id" => 'XXX',
"client_secret" => 'XXX',
],true);

why is $api is empty, can someone help 

i have removed the client_id and client_secret for security pupose

The magic method Instamojo\Instamojo::__wakeup() must have public visibility

i am trying to integrate in laravel 9 ,php version 8.1.0.
i have installed the wrapper through composer require instamojo/instamojo-php
then in controller
public function pay(Request $request){

 $api = new \Instamojo\Instamojo(
        config('services.instamojo.api_key'),
        config('services.instamojo.auth_token'),
        config('services.instamojo.url')
    );

try {
    $response = $api->paymentRequestCreate(array(
        "purpose" => "FIFA 16",
        "amount" => $request->amount,
        "buyer_name" => "$request->name",
        "send_email" => true,
        "email" => "$request->email",
        "phone" => "$request->mobile_number",
        "redirect_url" => "http://127.0.0.1:8000/pay-success"
        ));
        
        header('Location: ' . $response['longurl']);
        exit();
}catch (Exception $e) {
    print('Error: ' . $e->getMessage());
}

}

after the running the project getting error : The magic method Instamojo\Instamojo::__wakeup() must have public visibility
Screenshot_1

404 Not Found

I am calling getPaymentDetails api for which the payment id not exists.
$response = $api->getPaymentDetails([payment id]);
Instead of giving error in response it is giving laravel error.
instamojo

So, I am not able to handle this error. How can I handle this error and continue to execute next code script.

Raise an exception for cURL error.

Lots of people face cURL connection error (60) and are not able to figure it out why the API is not working, we need to raise this explicitly.

Array to String conversion - Instamojo.php line no. 298

Hello, I am using it with Laravel and while running the code. Create payment request is successful but when i check the payment status, it returns

Array to String Conversion

Debugging more , I found it is line no. 298 in instamojo.php

Could you please check, what am i doing wrong.

Issue with exception handling

I am trying to call the createPaymentRequest function with an amount less than 9 INR, instead of giving a proper error message, it's giving an arbitrary error message "Invalid request" Kindly fix it. getting the same issue with other errors like invalid phone, invalid email, etc.
On the below line of code, we are getting the correct error message in $response_obj variable but in the exception which we are getting in the try/catch block, it's a wrong error message.

$message = isset($response_obj['reason']) ? $response_obj['reason'] :$message;

PHP 8 issues

The Library is not working with latest PHP. It returns multiple errors due to the compatibilty.
First I faced init function arguments with default param retunred errror. Then wakeup function public error. If we make this code compatible with PHP 8 this all errors will go i guess

getGatewayOrder error = no Route matched with those values

Hello

I am receiving the error in getGatewayOrder(orderid) method.

"Error: no Route matched with those values"

here is my code
try {
$response = $api->getGatewayOrder($order_id);
print_r(json_encode($response));
}
catch (Exception $e) {
print('Error: ' . $e->getMessage());
}

http_build_query is buggy in php 5.3.1

The http_build_query used to generate URL-encoded query string in instamojo/instamojo-php/src/instamojo.php does not use default separator ('&').

$options[CURLOPT_POSTFIELDS] = http_build_query($data);
This causes problem while sending post data request.

Replacing the above line with the following solves the problem temporarily

$options[CURLOPT_POSTFIELDS] = http_build_query($data, "", "&");
Reference

Multiple SDK which supports PHP 5.3.0 or later, pass the other 2 parameters as well.

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.