Laravel paypal payment package , help you process credit card payment using paypal api

Overview

Important :The use of the PayPal REST /payments APIs to accept credit card payments is restricted by paypal and they recomand to use Braintree Direct if you want to accept credit card payments.

Update: I may re-create the package to use Braintree in future but with no deadline. You can also use the braintree/braintree_php library.

Note :

If you're going to use this package with Laravel 4, make sure to require the Laravel 4 branch:

"require": {
    "anouar/paypalpayment": "dev-l4"
}

laravel-paypalpayment

Build Status

laravel-paypalpayment is a simple package that helps you to process direct credit card payments, stored credit card payments and PayPal account payments with your Laravel 4/5 projects using PayPal REST API SDK.

Donation :

donate a cup of 😊 : Click here to lend your support to: github and make a donation at pledgie.com !

Watch a Quick Demo

Installation

Install this package through Composer. To your composer.json file:

=3.0" } ">
"require": {
    "anouar/paypalpayment": ">=3.0"
}

Next, run composer update.

Add the service provider to config/app.php (app/config/app.php for Laravel 4), in the providers array.

'providers' => array(
    // ...

    Anouar\Paypalpayment\PaypalpaymentServiceProvider::class,
)

Then add an alias under aliases array.

'aliases' => array(
    // ...

    'Paypalpayment'   => Anouar\Paypalpayment\Facades\PaypalPayment::class,
)

Finaly Pulish the package configuration by running this CMD

php artisan vendor:publish --provider="Anouar\Paypalpayment\PaypalpaymentServiceProvider"

Configuration

Under config/paypal_payment.php configuration file set your paypal client_id and client_secert keys

Samples

Note: If you are not fan of using facade calls, you can resove the paypal payment service like so app('paypalpayment') then assign it to a property.

1-Using credit card as paypent method

Create new controller PaypalPaymentController:

setLine2("Niagara Falls") ->setCity("Niagara Falls") ->setState("NY") ->setPostalCode("14305") ->setCountryCode("US") ->setPhone("716-298-1822") ->setRecipientName("Jhone"); // ### CreditCard $card = Paypalpayment::creditCard(); $card->setType("visa") ->setNumber("4758411877817150") ->setExpireMonth("05") ->setExpireYear("2019") ->setCvv2("456") ->setFirstName("Joe") ->setLastName("Shopper"); // ### FundingInstrument // A resource representing a Payer's funding instrument. // Use a Payer ID (A unique identifier of the payer generated // and provided by the facilitator. This is required when // creating or using a tokenized funding instrument) // and the `CreditCardDetails` $fi = Paypalpayment::fundingInstrument(); $fi->setCreditCard($card); // ### Payer // A resource representing a Payer that funds a payment // Use the List of `FundingInstrument` and the Payment Method // as 'credit_card' $payer = Paypalpayment::payer(); $payer->setPaymentMethod("credit_card") ->setFundingInstruments([$fi]); $item1 = Paypalpayment::item(); $item1->setName('Ground Coffee 40 oz') ->setDescription('Ground Coffee 40 oz') ->setCurrency('USD') ->setQuantity(1) ->setTax(0.3) ->setPrice(7.50); $item2 = Paypalpayment::item(); $item2->setName('Granola bars') ->setDescription('Granola Bars with Peanuts') ->setCurrency('USD') ->setQuantity(5) ->setTax(0.2) ->setPrice(2); $itemList = Paypalpayment::itemList(); $itemList->setItems([$item1,$item2]) ->setShippingAddress($shippingAddress); $details = Paypalpayment::details(); $details->setShipping("1.2") ->setTax("1.3") //total of items prices ->setSubtotal("17.5"); //Payment Amount $amount = Paypalpayment::amount(); $amount->setCurrency("USD") // the total is $17.8 = (16 + 0.6) * 1 ( of quantity) + 1.2 ( of Shipping). ->setTotal("20") ->setDetails($details); // ### Transaction // A transaction defines the contract of a // payment - what is the payment for and who // is fulfilling it. Transaction is created with // a `Payee` and `Amount` types $transaction = Paypalpayment::transaction(); $transaction->setAmount($amount) ->setItemList($itemList) ->setDescription("Payment description") ->setInvoiceNumber(uniqid()); // ### Payment // A Payment Resource; create one using // the above types and intent as 'sale' $payment = Paypalpayment::payment(); $payment->setIntent("sale") ->setPayer($payer) ->setTransactions([$transaction]); try { // ### Create Payment // Create a payment by posting to the APIService // using a valid ApiContext // The return object contains the status; $payment->create(Paypalpayment::apiContext()); } catch (\PPConnectionException $ex) { return response()->json(["error" => $ex->getMessage()], 400); } return response()->json([$payment->toArray()], 200); } } ">
use Paypalpayment;
class PaypalPaymentController extends BaseController {

    /*
    * Process payment using credit card
    */
    public function paywithCreditCard()
    {
        // ### Address
        // Base Address object used as shipping or billing
        // address in a payment. [Optional]
        $shippingAddress = Paypalpayment::shippingAddress();
        $shippingAddress->setLine1("3909 Witmer Road")
            ->setLine2("Niagara Falls")
            ->setCity("Niagara Falls")
            ->setState("NY")
            ->setPostalCode("14305")
            ->setCountryCode("US")
            ->setPhone("716-298-1822")
            ->setRecipientName("Jhone");

        // ### CreditCard
        $card = Paypalpayment::creditCard();
        $card->setType("visa")
            ->setNumber("4758411877817150")
            ->setExpireMonth("05")
            ->setExpireYear("2019")
            ->setCvv2("456")
            ->setFirstName("Joe")
            ->setLastName("Shopper");

        // ### FundingInstrument
        // A resource representing a Payer's funding instrument.
        // Use a Payer ID (A unique identifier of the payer generated
        // and provided by the facilitator. This is required when
        // creating or using a tokenized funding instrument)
        // and the `CreditCardDetails`
        $fi = Paypalpayment::fundingInstrument();
        $fi->setCreditCard($card);

        // ### Payer
        // A resource representing a Payer that funds a payment
        // Use the List of `FundingInstrument` and the Payment Method
        // as 'credit_card'
        $payer = Paypalpayment::payer();
        $payer->setPaymentMethod("credit_card")
            ->setFundingInstruments([$fi]);

        $item1 = Paypalpayment::item();
        $item1->setName('Ground Coffee 40 oz')
                ->setDescription('Ground Coffee 40 oz')
                ->setCurrency('USD')
                ->setQuantity(1)
                ->setTax(0.3)
                ->setPrice(7.50);

        $item2 = Paypalpayment::item();
        $item2->setName('Granola bars')
                ->setDescription('Granola Bars with Peanuts')
                ->setCurrency('USD')
                ->setQuantity(5)
                ->setTax(0.2)
                ->setPrice(2);


        $itemList = Paypalpayment::itemList();
        $itemList->setItems([$item1,$item2])
            ->setShippingAddress($shippingAddress);


        $details = Paypalpayment::details();
        $details->setShipping("1.2")
                ->setTax("1.3")
                //total of items prices
                ->setSubtotal("17.5");

        //Payment Amount
        $amount = Paypalpayment::amount();
        $amount->setCurrency("USD")
                // the total is $17.8 = (16 + 0.6) * 1 ( of quantity) + 1.2 ( of Shipping).
                ->setTotal("20")
                ->setDetails($details);

        // ### Transaction
        // A transaction defines the contract of a
        // payment - what is the payment for and who
        // is fulfilling it. Transaction is created with
        // a `Payee` and `Amount` types

        $transaction = Paypalpayment::transaction();
        $transaction->setAmount($amount)
            ->setItemList($itemList)
            ->setDescription("Payment description")
            ->setInvoiceNumber(uniqid());

        // ### Payment
        // A Payment Resource; create one using
        // the above types and intent as 'sale'

        $payment = Paypalpayment::payment();

        $payment->setIntent("sale")
            ->setPayer($payer)
            ->setTransactions([$transaction]);

        try {
            // ### Create Payment
            // Create a payment by posting to the APIService
            // using a valid ApiContext
            // The return object contains the status;
            $payment->create(Paypalpayment::apiContext());
        } catch (\PPConnectionException $ex) {
            return response()->json(["error" => $ex->getMessage()], 400);
        }

        return response()->json([$payment->toArray()], 200);
    }
     
}

2-Using Express Checkout as payment method

setLine2("Niagara Falls") ->setCity("Niagara Falls") ->setState("NY") ->setPostalCode("14305") ->setCountryCode("US") ->setPhone("716-298-1822") ->setRecipientName("Jhone"); // ### Payer // A resource representing a Payer that funds a payment // Use the List of `FundingInstrument` and the Payment Method // as 'credit_card' $payer = Paypalpayment::payer(); $payer->setPaymentMethod("paypal"); $item1 = Paypalpayment::item(); $item1->setName('Ground Coffee 40 oz') ->setDescription('Ground Coffee 40 oz') ->setCurrency('USD') ->setQuantity(1) ->setTax(0.3) ->setPrice(7.50); $item2 = Paypalpayment::item(); $item2->setName('Granola bars') ->setDescription('Granola Bars with Peanuts') ->setCurrency('USD') ->setQuantity(5) ->setTax(0.2) ->setPrice(2); $itemList = Paypalpayment::itemList(); $itemList->setItems([$item1,$item2]) ->setShippingAddress($shippingAddress); $details = Paypalpayment::details(); $details->setShipping("1.2") ->setTax("1.3") //total of items prices ->setSubtotal("17.5"); //Payment Amount $amount = Paypalpayment::amount(); $amount->setCurrency("USD") // the total is $17.8 = (16 + 0.6) * 1 ( of quantity) + 1.2 ( of Shipping). ->setTotal("20") ->setDetails($details); // ### Transaction // A transaction defines the contract of a // payment - what is the payment for and who // is fulfilling it. Transaction is created with // a `Payee` and `Amount` types $transaction = Paypalpayment::transaction(); $transaction->setAmount($amount) ->setItemList($itemList) ->setDescription("Payment description") ->setInvoiceNumber(uniqid()); // ### Payment // A Payment Resource; create one using // the above types and intent as 'sale' $redirectUrls = Paypalpayment::redirectUrls(); $redirectUrls->setReturnUrl(url("/payments/success")) ->setCancelUrl(url("/payments/fails")); $payment = Paypalpayment::payment(); $payment->setIntent("sale") ->setPayer($payer) ->setRedirectUrls($redirectUrls) ->setTransactions([$transaction]); try { // ### Create Payment // Create a payment by posting to the APIService // using a valid ApiContext // The return object contains the status; $payment->create(Paypalpayment::apiContext()); } catch (\PPConnectionException $ex) { return response()->json(["error" => $ex->getMessage()], 400); } return response()->json([$payment->toArray(), 'approval_url' => $payment->getApprovalLink()], 200); } ">
    /*
    * Process payment with express checkout
    */
    public function paywithPaypal()
    {
        // ### Address
        // Base Address object used as shipping or billing
        // address in a payment. [Optional]
        $shippingAddress= Paypalpayment::shippingAddress();
        $shippingAddress->setLine1("3909 Witmer Road")
            ->setLine2("Niagara Falls")
            ->setCity("Niagara Falls")
            ->setState("NY")
            ->setPostalCode("14305")
            ->setCountryCode("US")
            ->setPhone("716-298-1822")
            ->setRecipientName("Jhone");

        // ### Payer
        // A resource representing a Payer that funds a payment
        // Use the List of `FundingInstrument` and the Payment Method
        // as 'credit_card'
        $payer = Paypalpayment::payer();
        $payer->setPaymentMethod("paypal");

        $item1 = Paypalpayment::item();
        $item1->setName('Ground Coffee 40 oz')
                ->setDescription('Ground Coffee 40 oz')
                ->setCurrency('USD')
                ->setQuantity(1)
                ->setTax(0.3)
                ->setPrice(7.50);

        $item2 = Paypalpayment::item();
        $item2->setName('Granola bars')
                ->setDescription('Granola Bars with Peanuts')
                ->setCurrency('USD')
                ->setQuantity(5)
                ->setTax(0.2)
                ->setPrice(2);


        $itemList = Paypalpayment::itemList();
        $itemList->setItems([$item1,$item2])
            ->setShippingAddress($shippingAddress);


        $details = Paypalpayment::details();
        $details->setShipping("1.2")
                ->setTax("1.3")
                //total of items prices
                ->setSubtotal("17.5");

        //Payment Amount
        $amount = Paypalpayment::amount();
        $amount->setCurrency("USD")
                // the total is $17.8 = (16 + 0.6) * 1 ( of quantity) + 1.2 ( of Shipping).
                ->setTotal("20")
                ->setDetails($details);

        // ### Transaction
        // A transaction defines the contract of a
        // payment - what is the payment for and who
        // is fulfilling it. Transaction is created with
        // a `Payee` and `Amount` types

        $transaction = Paypalpayment::transaction();
        $transaction->setAmount($amount)
            ->setItemList($itemList)
            ->setDescription("Payment description")
            ->setInvoiceNumber(uniqid());

        // ### Payment
        // A Payment Resource; create one using
        // the above types and intent as 'sale'

        $redirectUrls = Paypalpayment::redirectUrls();
        $redirectUrls->setReturnUrl(url("/payments/success"))
            ->setCancelUrl(url("/payments/fails"));

        $payment = Paypalpayment::payment();

        $payment->setIntent("sale")
            ->setPayer($payer)
            ->setRedirectUrls($redirectUrls)
            ->setTransactions([$transaction]);

        try {
            // ### Create Payment
            // Create a payment by posting to the APIService
            // using a valid ApiContext
            // The return object contains the status;
            $payment->create(Paypalpayment::apiContext());
        } catch (\PPConnectionException $ex) {
            return response()->json(["error" => $ex->getMessage()], 400);
        }

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

3-List Payment

Add the index() function to the PaypalPaymentController Controller

    /*
        Use this call to get a list of payments. 
        url:payment/
    */
    public function index()
    {

        $payments = Paypalpayment::getAll(['count' => 1, 'start_index' => 0], Paypalpayment::apiContext());
        
        return response()->json([$payments->toArray()], 200);

    }

4-Get Payment details

Add the show() function to the PaypalPaymentController Controller

    /*
        Use this call to get details about payments that have not completed, 
        such as payments that are created and approved, or if a payment has failed.
        url:payment/PAY-3B7201824D767003LKHZSVOA
    */

    public function show($payment_id)
    {
       $payment = Paypalpayment::getById($payment_id, Paypalpayment::apiContext());
        
        return response()->json([$payment->toArray()], 200);
    }

Under the (routes.php for previous versions) or web.php file and register your routing.

Conclusion

Please feel free to report issues and open any PRs that you thinks will help to improve the package.

Comments
  • Got Http response code 401 when accessing https://api.sandbox.paypal.com/v1/oauth2/token. Retried 0 times

    Got Http response code 401 when accessing https://api.sandbox.paypal.com/v1/oauth2/token. Retried 0 times

    Copied the example code to test, client id and secret are fine but i get this error

    Got Http response code 401 when accessing https://api.sandbox.paypal.com/v1/oauth2/token. Retried 0 times

    opened by LeventeNagy 18
  • Error directly after install.

    Error directly after install.

    when I try to run any command or access any page I get this: screen shot 2013-10-22 at 3 03 07 pm console error: HP Fatal error: Call to undefined method Anouar\Paypalpayment\Facades\PaypalPayment::isDeferred() in /Users/gages/laravel/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php on line 94

    {{
       "error":{
          "type":"Symfony\\Component\\Debug\\Exception\\FatalErrorException",
          "message":"Call to undefined method Anouar\\Paypalpayment\\Facades\\PaypalPayment::isDeferred()",
          "file":"\/Users\/joeolivas\/Desktop\/gages\/butterfly-laravel\/vendor\/laravel\/framework\/src\/Illuminate\/Foundation\/ProviderRepository.php",
          "line":94
       }
    }
    

    I have tried with and without a controller file, same error, breaking laravel as an entirety.

    opened by justgage 16
  • Catching PayPal PHP API 400 errors on localhost:8000

    Catching PayPal PHP API 400 errors on localhost:8000

    The package works great! and I am taking payments perfectly! I am struggling to catch and redirect when incorrect details e.g. bank card details are entered by a user. The Laravel application just throws a 400 error.

    What I am wanting to do is catch the errors and redirect back and notify the user.

    The code below is where I make a request:

    try {
        // ### Create Payment
        // Create a payment by posting to the APIService
        // using a valid ApiContext
        // The return object contains the status;
    
        $payment->create($this->_apiContext);
    
    } catch (\PPConnectionException $ex) {
        return Redirect::back()->withErrors([$ex->getMessage() . PHP_EOL]);
    }
    
    dd($payment);
    

    When a successful payment is made I get a nice return object that I can reference and action accordingly, when there is an issue like a 400 error it kills the application completely and DOES NOT catch and redirect the errors back to the user.

    The error code messages are:

    PayPalConnectionException in PayPalHttpConnection.php
    Got Http response code 400 when accessing 
    https://api.sandbox.paypal.com/v1/payments/payment.
    

    Has anyone faced similar issues ?

    I know when the application isn't in dev mode I can have error pages specifically to catch certain error codes. But I really want to catch errors and redirect back to the form with notifications for the user.

    Thanks in advance to any wizard who can help.

    opened by nickbluestone98 14
  • Use Laravel Config

    Use Laravel Config

    Hi,

    I know we can merge the config directly from the controller. But, would be nice if we can update the config via Laravel config instead of ini file. My suggestion is added a config file that can be publish to the config folder, maybe.

    opened by gravitano 12
  • using paypal method

    using paypal method

    Sorry i've some trouble to post the issue. However using paypal method I've modified the create controller in this way:

    public function create()
    {
            $payer = Paypalpayment::Payer();
            $payer->setPayment_method("paypal");
    
            $amount = Paypalpayment:: Amount();
            $amount->setCurrency("USD");
            $amount->setTotal("1.00");
    
            $transaction = Paypalpayment:: Transaction();
            $transaction->setAmount($amount);
            $transaction->setDescription("This is the payment description.");
    
            $paymentId = '1234';
            $PayerID = '[email protected]';
    
            $payment = Paypalpayment:: Payment();
            $payment->setIntent("sale");
            $payment->setPayer($payer);
            $payment->setTransactions(array($transaction));
    
            $payment->get($paymentId, $this->_apiContext);
        $execution = Paypalpayment::PaymentExecution();
            $execution->setPayer_id($PayerID);
    
            //Execute the payment
           $payment->execute($execution,$this->_apiContext);
    }
    

    And this is the error:

    PayPal \ Exception \ PPConnectionException

    Got Http response code 404 when accessing https://api.sandbox.paypal.com/v1/payments/payment/1234. Retried 0 times.

    PaymentId is 1234 only for test, what is the problem? The $_ClientId and $_ClientSecret are correctly setted.

    And another question, how can i redirect to my site after payment?

    Thankyou very much

    opened by lucabro81 11
  • PayPalResourceModel.php line 45: Invalid argument supplied for foreach()

    PayPalResourceModel.php line 45: Invalid argument supplied for foreach()

    at this point $approvalUrl = $payment->getApprovalLink(); i am getting the error. Here is my response when i am using the

    paypal payment method

    i am not getting response on status or not a url to redirect a user to to complete paypal method, help me around here. Here is the response i got:

    Payment {#401
      -_propMap: array:4 [
        "intent" => "sale"
        "payer" => Payer {#388
          -_propMap: array:1 [
            "payment_method" => "paypal"
          ]
        }
        "redirect_urls" => RedirectUrls {#400
          -_propMap: array:2 [
            "return_url" => "http://localhost:8000/callback?success=true"
            "cancel_url" => "http://localhost:8000/callback?success=false"
          ]
        }
        "transactions" => array:1 [
          0 => Transaction {#399
            -_propMap: array:4 [
              "amount" => Amount {#397
                -_propMap: array:3 [
                  "currency" => "USD"
                  "total" => "20"
                  "details" => Details {#398
                    -_propMap: array:3 [
                      "shipping" => "1.20"
                      "tax" => "1.30"
                      "subtotal" => "17.50"
                    ]
                  }
                ]
              }
              "item_list" => ItemList {#396
                -_propMap: array:1 [
                  "items" => array:2 [
                    0 => Item {#389
                      -_propMap: array:6 [
                        "name" => "Ground Coffee 40 oz"
                        "description" => "Ground Coffee 40 oz"
                        "currency" => "USD"
                        "quantity" => 1
                        "tax" => "0.30"
                        "price" => "7.50"
                      ]
                    }
                    1 => Item {#395
                      -_propMap: array:6 [
                        "name" => "Granola bars"
                        "description" => "Granola Bars with Peanuts"
                        "currency" => "USD"
                        "quantity" => 5
                        "tax" => "0.20"
                        "price" => "2"
                      ]
                    }
                  ]
                ]
              }
              "description" => "Payment description"
              "invoice_number" => "58c9081941ba4"
            ]
          }
        ]
      ]
    }
    
    opened by thomas-tewelde 8
  • Array to string conversion during OAuth

    Array to string conversion during OAuth

    Got this little error while trying to get payment details by id:

    [2014-12-19 11:53:27] production.ERROR: exception 'ErrorException' with message 'Array to string conversion' in /home/glissand/domains/ebooks.glissando.pl/vendor/paypal/rest-api-sdk-php/lib/PayPal/Auth/OAuthTokenCredential.php:185
    

    rest-api-sdk-php have newer version, maybe it could resolve the problem?

    opened by jakoss 8
  • live mode not working

    live mode not working

    Even when i am setting mode to live like below its redirecting to https://www.sandbox.paypal.com

    $this->_apiContext->setConfig(array( 'mode' => 'live', 'http.ConnectionTimeOut' => 30, 'log.LogEnabled' => true, 'log.FileName' => DIR.'/../PayPal.log', 'log.LogLevel' => 'FINE' ));

    how to make it redirect to https://www.paypal.com and not https://www.sandbox.paypal.com?

    opened by abhitheawesomecoder 7
  • Amount Details

    Amount Details

    I have this code, but i want to define de amount details, but the response of the api is the code 400. Help me please.

    $payer = Paypalpayment::Payer(); $payer->setPayment_method("paypal");

                $item = Paypalpayment::Item();
                $item->setQuantity("1");
                $item->setName("Servicio nubeGAN");
                $item->setPrice($inputs['precio']);
                $item->setCurrency("MXN");
    
                $item_list = Paypalpayment::ItemList();
                $item_list->setItems(array($item));
    
                $amount = Paypalpayment::Amount();
                $amount->setCurrency("MXN");
                $amount->setTotal($inputs['precio']);
    
                $transaction = Paypalpayment::Transaction();
                $transaction->setAmount($amount);
                $transaction->setItem_list($item_list);
                $transaction->setDescription("Pago para adquirir el Servicio nubeGAN");
    
                $baseUrl = Request::root();
                $redirectUrls = Paypalpayment:: RedirectUrls();
                $redirectUrls->setReturn_url($baseUrl.'/paypal/ejecutar');
                $redirectUrls->setCancel_url($baseUrl);
    
                $payment = Paypalpayment:: Payment();
                $payment->setIntent("sale");
                $payment->setRedirectUrls($redirectUrls);
                $payment->setPayer($payer);
                $payment->setTransactions(array($transaction));
    
                $response = $payment->create($this->_apiContext);
                $this->_paymentId = $response->id;
                $redirectUrl = $response->links[1]->href;
    
    opened by rogerburgosaps 7
  • Error after switching to live!

    Error after switching to live!

    Please help! Everything works great on sandbox, but when I changed endpoint to "https://api.paypal.com" and changed ClientId and ClientSecret, I get an error, I also tried to set mode manually as @s201236215H mentioned. Doesn't work for me.

    ErrorException in PayPalResourceModel.php line 44: Invalid argument supplied for foreach()

    in PayPalResourceModel.php line 44 at HandleExceptions->handleError(2, 'Invalid argument supplied for foreach()', '/var/www/html/pentestcloud/vendor/paypal/rest-api-sdk-php/lib/PayPal/Common/PayPalResourceModel.php', 44, array('rel' => 'approval_url')) in PayPalResourceModel.php line 44 at PayPalResourceModel->getLink('approval_url') in Payment.php line 545 at Payment->getApprovalLink() in HomeController.php line 207 at HomeController->subscribePlan('basic')

    opened by LukaSikic 6
  • Update composer.json for Laravel 4

    Update composer.json for Laravel 4

    Upgrade paypal sdk version to prevent Method PayPal\Api\Sale::getTransactionFee() does not exist error. See more https://github.com/xroot/laravel-paypalpayment/issues/52 and https://github.com/paypal/PayPal-PHP-SDK/issues/255

    opened by d0d0 6
  • How to override configuration in controller?

    How to override configuration in controller?

    I am looking for an overriding PayPal configuration in a controller. I am saving PayPal credentials in a database and at the time of payment, I want to pass it for the configuration.

    Is it possible to do this?

    opened by dhara15101991 0
  • Dynamic methods should not be called staticaly

    Dynamic methods should not be called staticaly

    In the example methods, PaypalPayment methods are called staticaly but methods are defined as dynamic in the class. I modified paywithCreditCard() and paywithPaypal() methods to create new instance of PayPaylPayment class first, then I made methods to call dynamicaly. Anyway I don't think it's the best way how to solve it (at least beacase it has its own ServiceProvider called automaticaly by laravel service providers in boostrap). Any suggestions how to solve this correctly?

    opened by AlterwebStudio 0
  • Discount Issues, very big problem

    Discount Issues, very big problem

    Hi I am web programmer , I am using your nice paypal package. I am getting one problem in discount. The problem how to use a discount coupon code. I apply it manually the discount coupon code. But when adding the discounted amount it throws an error of difference in subtotal and total amount. I am stuck here , please help me as soon as possible. How I use a coupon code discount.

    Thanks.

    opened by mutahir-shah 0
Releases(3.0)
Owner
Anouar Absslm
Anouar Absslm
A PayPal IPN client for Laravel.

PayPal IPN for Laravel 4 This package allows for the painless creation of a PayPal IPN listener in the Laravel 4 framework. Installation PayPal IPN fo

Logical Grape 35 Jul 8, 2021
Laravel plugin for processing payments through PayPal. Can be used separately.

Laravel PayPal Documentation Usage Support Documentation The documentation for the package can be viewed by clicking the following link: https://srmkl

Raza Mehdi 844 Dec 28, 2022
A PHP package to simplify using DPO Payment API in your application.

DPO (Direct Pay Online) PHP Package The best DPO php package, simple Ever This is the package that will help you add DPO Payment API to your PHP Appli

Zepson Technologies 3 Nov 8, 2022
Enable Standard PayPal for WooCommerce

Enable Standard PayPal for WooCommerce Contributors: vikcheema Donate link: https://paypal.me/SukhwantCheema Tags: woocommerce, payment gateway, paypa

Vik Cheema 2 Sep 9, 2021
StrongShop 是一款免费开源的跨境电商商城网站。基于 PHP Laravel6 框架开发,遵循 BSD-3-Clause 开源协议,免费商用。支持多语言,多货币,多种国际配送方式。PayPal 支付,国际信用卡支付。PC Web 端和移动端自适应。

跨境电商独立站的理想选择之一 StrongShop 简介 StrongShop 是一款免费开源的跨境电商商城网站。 StrongShop 是基于 PHP Laravel 框架开发的一款 Web 商城系统。 开发缘起是公司的一套跨境商城系统,原先公司使用的系统是基于 Ecshop 二次开发的,后来因为

OpenStrong 38 Dec 9, 2022
Paypal module for Thelia ecommerce solution

PayPal I) Install notes II) Configure your PayPal account III) Module options payments I) Installation Composer WARNING : A console access is required

null 8 Nov 22, 2022
The Laravel eCommerce Mollie Payment Gateway allows the merchants to integrate Mollie payment gateway to their bagisto Store.

The Laravel eCommerce Mollie Payment Gateway allows the merchants to integrate Mollie payment gateway to their bagisto Store.

Bagisto 2 May 31, 2022
PHP payment library to easily integrate Baltic banklinks (supports old and new iPizza protocol), E-commerce gateaway (Estcard, Nets Estonia), Liisi Payment Link and Pocopay.

PHP Payment library PHP payment library to easily integrate Baltic banklinks, E-commerce gateaway (Estcard, Nets Estonia), Liizi Payment Link and Poco

Rene Korss 34 Apr 27, 2022
Plugin for Woocommerce that enables Visanet's Cybersource payment gateway as a payment method in your website checkout

Plugin for Woocommerce that enables Visanet's Cybersource payment gateway as a payment method in your website checkout

tipi(code) 2 Mar 8, 2022
Payu payment gateway for bagisto laravel ecommerce open source platform

Bagisto Payu Payment Gateway Payu is a popular payment gateway in india. This package provides a additional strong help for the user to use the payu p

Saju G 3 Dec 14, 2021
An eCommerce website is an online store where you can buy or sell products online. An eCommerce offers a professional online store builder that helps you launch your eCommerce business quickly and successfully.

An eCOMMERCE-SITE An eCommerce website is an online store where you can buy or sell products online. An eCommerce offers a professional online store b

UTTKARSH PARMAR 2 Aug 8, 2022
An E-Commerce package for Laravel with Grafite CMS. Take control of your content and how you sell it! Products, subscriptions, shipping, downloading and more!

Grafite Commerce Grafite has archived this project and no longer supports or develops its code. We recommend using only as a source of ideas for your

Grafite Inc 45 Jun 8, 2021
A framework agnostic, multi-gateway payment processing library for PHP 5.6+

Omnipay An easy to use, consistent payment processing library for PHP Omnipay is a payment processing library for PHP. It has been designed based on i

The League of Extraordinary Packages 5.7k Jan 4, 2023
Cardano Mercury Payment Gateway for WooCommerce

Cardano Mercury for WooCommerce Simple, reliable plugin to accept Cardano (Ada) payments for goods and services in WooCommerce. Version: 1.0 Tags: woo

null 25 Aug 3, 2022
stripe payment

CodeIgniter 4 Application Starter What is CodeIgniter? CodeIgniter is a PHP full-stack web framework that is light, fast, flexible and secure. More in

aminxs 3 Jul 29, 2021
Binance Smart Chain - BNB Payment Gateway

BSC Pay (Simple BNB Payment Gateway) I like to use Binance Smart Chain, do you? You can use my simple payment gateway if you need to get paid with BSC

null 18 Dec 19, 2022
QPay Moodle payment gateway plugin

QPay Moodle payment gateway plugin The plugin allows a site to connect to QPay. This plugin was developed by Smotana thanks to funding from Aspire Edu

Matus Faro 2 Dec 31, 2021
Sharkpay is a system to provide a full order/payment eco-system for your project.

sharkpay sharkpay is a PHP library which aims to provide a full order/payment eco-system for your projects. A form of plug-in & ready to go for E-Comm

Dominic Poppe 2 Jan 6, 2022
Adds a new report to the WooCommerce analytics section about used payment methods.

Payment Methods Report for WooCommerce This is an extension to WooCommerce Analytics that will display a new report on the usage of configured payment

Martin Rehberger 1 Jan 15, 2022