Code Monkey home page Code Monkey logo

paytabs-with-laravel's People

Contributors

baselrabia avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

paytabs-with-laravel's Issues

error

Undefined property: stdClass::$response_code (500 Internal Server Error) error showing in paytabscontroller.php..please assist the same...code below

public function index(Request $request)
{

    $validator = Validator::make($request->all(), [ //Validator
      
        'supplier_id'		=> 	'nullable',
    ]);


    $pt = Paytabs::getInstance(); //the instance through the register service provider singleton

    //$result = Paytabs::getInstance()->create_pay_page(array(
    $result =$pt->create_pay_page(array(
        //Customer's Personal Information
        'cc_first_name' => "john",          //This will be prefilled as Credit Card First Name
        'cc_last_name' => "Doe",            //This will be prefilled as Credit Card Last Name
        'cc_phone_number' => "00973",
        'phone_number' => "33333333",
        'email' => "[email protected]",
        'supplier_id' => $request['supplier_id'],
        

        //Customer's Billing Address (All fields are mandatory)
        //When the country is selected as USA or CANADA, the state field should contain a String of 2 characters containing the ISO state code otherwise the payments may be rejected.
        //For other countries, the state can be a string of up to 32 characters.
        'billing_address' => "manama bahrain",
        'city' => "manama",
        'state' => "manama",
        'postal_code' => "00973",
        'country' => "BHR",

        //Customer's Shipping Address (All fields are mandatory)
        'address_shipping' => "Juffair bahrain",
        'city_shipping' => "manama",
        'state_shipping' => "manama",
        'postal_code_shipping' => "00973",
        'country_shipping' => "BHR",

        //Product Information
        "products_per_title" => "Product1 || Product 2 || Product 4",   //Product title of the product. If multiple products then add “||” separator
        'quantity' => "1 || 1 || 1",                                    //Quantity of products. If multiple products then add “||” separator
        'unit_price' => "2 || 2 || 6",                                  //Unit price of the product. If multiple products then add “||” separator.
        "other_charges" => "99.00",                                     //Additional charges. e.g.: shipping charges, taxes, VAT, etc.
        'amount' => "101.00",                                          //Amount of the products and other charges, it should be equal to: amount = (sum of all products’ (unit_price * quantity)) + other_charges
        'discount' => "1",                                                //Discount of the transaction. The Total amount of the invoice will be= amount - discount

        //Invoice Information
        'title' => "John Doe",               // Customer's Name on the invoice
        "reference_no" => "1231231",        //Invoice reference number in your system

    )); 
if ($result->response_code == 4012) {
        return redirect($result->payment_url);
    }
    if ($result->response_code == 4094) {
        return $result->details;
    }

    return $result->result;
}

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.