ThinkingMan

ThinkingMan

Member Since 1 Year Ago

Experience Points 5,590
Experience Level 2

4,410 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed 40
Lessons
Completed
Best Reply Awards 0
Best Reply
Awards
  • Start Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • Chatty Cathy Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

16 Jun
1 day ago

ThinkingMan started a new conversation Add Sub-domains To Forge Sites Deployed On AWS

I am using Forge to deploy a Laravel App from Git to an AWS Server for mydomain.com. I want to be able to deploy multiple instances of my app to the same AWS server for various reasons (e.g. Testing). When I deploy via Forge to the server I will get directories like app1.mydomain.com, app2,mydomain,com, etc... How do I setup the Route 53 records to point to these domains?

08 Jun
1 week ago

ThinkingMan left a reply on Forge AWS EC2 Elastic IP Ssh Connection

@CRONIX - So it's rather easy to get an Elastic IP in place and use with Forge? I have an AWS instance running and a site deployed now. What will I need to do to make sure nothing breaks once I assign the Elastic IP in the AWS console?

ThinkingMan started a new conversation Security Best Practices On Forge Deployments

My app is coming together so I want to start securing my server that was provisioned by Forge. I have removed the phpinfo and redirected the IP to my domain but that is about it. I am hosting with AWS.

Looking for general best practices to lock things down. I am also seeking PCI references if anyone has perspective there but that is really a secondary exercise at this point.

Thanks in advance!

07 Jun
1 week ago

ThinkingMan left a reply on Tokenmismatchexception With Script

Let's just say I am still learning... :)

This was the fix

headers: { 'X-CSRF-TOKEN' : '{{ csrf_token() }}' },

The controller has a post so will fix the one type. Thanks guys!

ThinkingMan started a new conversation Tokenmismatchexception With Script

I have read many threads and tested all that I could but am not at the end of my rope. Tried resetting cookies, clearing cache, setting CSRF on the views, looked at the configs and just cannot figure out why I am getting a mismatch when running the script below. I thought that maybe it had to do with the session storage path since I am using Spark but that seems to be correct (app\storage\framework\sessions). Just lost!

`@section('script') $(function() { $('#mr-test-connection').on('click' , function () { var connection_btn = $(this); connection_btn.children('span').removeClass('hide'); connection_btn.children('span').addClass('fa-spin'); connection_btn.attr('disabled' , 'disabled');

            var van = $('#pos_wan_address');
            ip = van.val();
            db_name = $('#db_name').val();
            pos_mysql_un = $('#pos_mysql_un').val();
            pos_mysql_pw = $('#pos_mysql_pw').val();
            data = {'pos_wan_address' : ip , 'pos_mysql_un': pos_mysql_un , 'pos_mysql_pw':pos_mysql_pw , 'db_name':db_name};

            $.ajax({
                url: "{!! route('admin.merchants.test-connection') !!}",
                data: data,
                headers: { 'X-XSRF-TOKEN' : '{{\Illuminate\Support\Facades\Crypt::encrypt(csrf_token())}}' },
                error: function() {

                },
                success: function(data) {

                    connection_btn.children('span').addClass('hide');

                    if (data.alert_type)
                        toastr["success"](data.message);
                    else
                        toastr["error"](data.message);

                    connection_btn.removeAttr('disabled');
                },
                type: 'POST'
            });

        });

        $('#reset-pass').on('click' , function (e) {

            var reset_email_btn = $(this);

            reset_email_btn.children('span').removeClass('hide');
            reset_email_btn.children('span').addClass('fa-spin');

            merchant_email = "{{$merchant->email}}";
            var action = $(this).attr('data-url');
            $.ajax({
                url: action,
                data: {'email': merchant_email},
                success: function(data) {
                    reset_email_btn.children('span').addClass('hide');
                    reset_email_btn.children('span').removeClass('fa-spin');
                    if (data.alert_type == 'success')
                        toastr.success(data.message , 'Message');
                    else
                        toastr.error(data.message , 'Message');

                },
                type: 'get'
            });
        })
    });

</script>

@endsection()`

03 May
1 month ago

ThinkingMan left a reply on PEST Library Anyone?

Update - It seems Composer was able to install. But if anyone has tips then that's appreciated too. :)

02 May
1 month ago

ThinkingMan started a new conversation PEST Library Anyone?

I am trying to incorporate a payment client (https://github.com/CardConnect/php-cardconnect-api) and it states that I need to use the Pest library (https://github.com/educoder/pest) and place in sub directory of "pest".

Does anyone have experience with pest in Laravel?

If not, can anyone offer guidance on where to stuff this? Under Vendors?

25 Apr
1 month ago

ThinkingMan left a reply on Alternate Payment Gateway To Stripe And Braintree?

@CRONIX - This is where I am headed now. i.e. Check out extending Cashier and if too much effort then build my own. Thanks again!

ThinkingMan left a reply on Alternate Payment Gateway To Stripe And Braintree?

Thanks Cronix. The gateway that the client wants to use has the *same rebilling set of capabilities so I understand there is some overhead but also feel the gateway handles the lions share of those other significant complexities. I knew there was going to be a lot of work but was curious if anyone had tackled this in Spark or becuase of the refactoring just simply handled through a standard Laravel build.

Appreciate the response.

ThinkingMan started a new conversation Alternate Payment Gateway To Stripe And Braintree?

Hi,

I am just wondering if anyone has ever added a different Gateway to Spark. I have a client who sells credit card services and wants to use a specific gateway so any feedback and insight is appreciated.

Thanks, Mike

03 Mar
3 months ago

ThinkingMan started a new conversation Team Structure Clarification

I am a little confused on Laravel Teams and need to validate if it supports the following use case:

My platform will have a business entity and that entity will have an owner then users underneath the entity. I want to bill the business entity and allow the owner to add users. The users should not have their own billing fee but rather be incorporated under the overall business entity tenant.

Teams seems like it kind of handles this but rather than having 1 team and many users under it, there would be a bunch of users that are associated with one or more teams and in that model, would negate my ability to enforce roles and permissions under the business entities team.

I have not found a ton of resources on teams outside the Spark site help hence the question.

27 Jan
4 months ago

ThinkingMan left a reply on Does Anyone Know Is Nova Works With Spark?

@STOCKHOLM - Thanks @stockholm but a basic question. Does the Spatie permission enforce across Nova and non-Nova views? Does it enforce at the Nova Resource level or Controller level?

26 Jan
4 months ago

ThinkingMan started a new conversation Does Anyone Know Is Nova Works With Spark?

Before I invest any time on this one, just looking for someone to confirm if Nova will play nice with Spark. Thanks!

07 Jan
5 months ago

ThinkingMan left a reply on Traditional Users & Roles In Spark (Not Team Billing)

@ashbakernz and @cronix one follow-up on this one. The reason I was going down this path is because I don't know if team billing is really what I need. So that is still a bit of a question in my mind. Essentially I want to have someone sign up for an account (call them the Owner) and then add users (call them the Employee) which can access that account but are not account owners which can access things like billing. Team Billing didnt really seem to fit this model exactly but can it be adapted to fit?

04 Jan
5 months ago

ThinkingMan started a new conversation Traditional Users & Roles In Spark (Not Team Billing)

I am wondering if anyone has added traditional Users & Roles constructs to Spark and if so, did you use any packages like those mentioned here https://laravel-news.com/two-best-roles-permissions-packages.

I have a Spark Project that is coming together nicely and foresee the need to have users with lower permissions underneath the main registered user (i.e. the user that would be created from the main Spark Auth). I have built users and roles on straight Laravel builds but not Spark so looking for a best practice approach and suggestion to avoid any pitfalls. At this stage and based on my current requirements, I think building my own will be easiest.

Thanks in advance!

31 Dec
5 months ago

ThinkingMan left a reply on Get Count Of Rows By Date Greater Than Today

And just a posted code solution that worked for anyone else who may read this:

public function show()
    {
        $ID = auth()->user()->id;
        $date = Carbon::today()->toDateString();
        $today = Carbon::today();

        $userorders = DB::table('order_headers')->where('user_id', $ID);
        $ordercount = $userorders->where('status', 'active')->count();

        $usertickets = DB::table('ticketit')->where('user_id', $ID);
        $ticketcount = $usertickets->where('status_id', '1')->count();

        $modified_date = Carbon::today()->addDay(5);
        
        $userorderstoday = DB::table('order_headers')->where('user_id', $ID);
        $deliveriesToday = $userorderstoday->whereDate('delivery_date', '=', $today)->count();
        
        $deliveryOrders = $userorders->where('delivery_date','>',$today)->where('delivery_date','<', $modified_date->endOfDay())->count();

        return view('home', ['date' =>$date, 'ordercount' => $ordercount, 'deliveryOrders' => $deliveryOrders, 'modified_date' =>$modified_date, 'ticketcount' => $ticketcount, 'deliveriesToday' => $deliveriesToday]);
    }

ThinkingMan left a reply on Get Count Of Rows By Date Greater Than Today

Thanks @vilfago for the confirmation on what I suspected. i.e. My approach was wrong and too simple. I also looked at implementing something like this https://code.i-harness.com/en/q/13a60c3 and will look at this from a different angle.

ThinkingMan left a reply on Get Count Of Rows By Date Greater Than Today

Laravel Spark version 5.0.1

It's a date field, not timestamp

ThinkingMan left a reply on Get Count Of Rows By Date Greater Than Today

@vilfago the whereDate method is not found in the class. Here is what I am using. Do I need to add something?

namespace App\Http\Controllers;
use Illuminate\Support\Facades\DB;
use Illuminate\Http\Request;
use Carbon\Carbon;
use Illuminate\Support\Facades\View;

ThinkingMan left a reply on Get Count Of Rows By Date Greater Than Today

Getting 0 on both deliveriesToday and allDeliveries with now().

ThinkingMan started a new conversation Get Count Of Rows By Date Greater Than Today

This seems like an easy one but maybe I am looking at the problem too simplistically. All I want to do is produce the count of 'delivery_date' days which have a 'delivery_date' greater than today. The $allDeliveries just produces a 0. If I addDays to today then I will get the delivery count for that day. So it is reading the data so my query is the problem.

    public function show()
    {
        $ID = auth()->user()->id;
        $date = Carbon::today()->toDateString();
        $today = Carbon::today();

        $userorders = DB::table('order_headers')->where('user_id', $ID);
        $ordercount = $userorders->where('status', 'active')->count();

        $usertickets = DB::table('ticketit')->where('user_id', $ID);
        $ticketcount = $usertickets->where('status_id', '1')->count();

        $today->modify('+5 days');
        $modified_date = $today->format('Y-m-d');

        $userorderstoday = DB::table('order_headers')->where('user_id', $ID);
        $deliveriesToday = $userorderstoday->where('delivery_date', '=', $today)->count();
        $allDeliveries = $userorderstoday->where('delivery_date', '>', $today)->count();

        return view('home', ['date' =>$date, 'ordercount' => $ordercount, 'allDeliveries' => $allDeliveries, 'modified_date' =>$modified_date, 'ticketcount' => $ticketcount, 'deliveriesToday' => $deliveriesToday]);
    }

You can ignore the $modified_date as I am just temporarily using to show output in my view,

Thanks in advance - Noob...

30 Dec
5 months ago

ThinkingMan started a new conversation Eloquent Query Return To View Breaks After 3 In Array

I am not sure if the title is exactly correct but I have a query in my controller which performs a count on 3 data fields from two tables and is then supposed to return them to a dashboard view. I can get this to work when I have two of the three results post to the view but when I send all three to the view I get an error "Undefined variable: ordercounttoday (View: C:\xampp\htdocs\ecosystem\resources\views\home.blade.php)"

Here is the function in the controller

 public function show()
    {
        $ID = auth()->user()->id;

        $userorders = DB::table('order_headers')->where('user_id', $ID);
        $ordercount = $userorders->where('status', 'active')->count();

        $usertickets = DB::table('ticketit')->where('user_id', $ID);
        $ticketcount = $usertickets->where('status_id', '1')->count();

        $userorderstoday = DB::table('order_headers')->where('user_id', $ID);
        $ordercounttoday = $userorderstoday->where('delivery_date', '=',date('Y-m-d'))->count();


        return view('home', ['ordercount' => $ordercount], ['ticketcount' => $ticketcount], ['ordercounttoday' => $ordercounttoday]);
    }

Here is the view

@extends('layouts.default')
@section('title',  'Home' )

@section('content')
<div class="row">
    <div class="col-lg-12">
        <h1 class="page-header">Dashboard</h1>
    </div>
    <!-- /.col-lg-12 -->
</div>
<!-- /.row -->
<div class="row">
    <div class="col-lg-3 col-md-6">
        <div class="panel panel-yellow">
            <div class="panel-heading">
                <div class="row">
                    <div class="col-xs-3">
                        <i class="fa fa-shopping-cart fa-5x"></i>
                    </div>
                    <div class="col-xs-9 text-right">
                        <div class="huge">{{$ordercount}}</div>
                        <div><a href="/deliveries">Active Orders</a> </div>
                    </div>
                </div>
            </div>
            <a href="/deliveries">
                <div class="panel-footer">
                    <span class="pull-left">View Details</span>
                    <span class="pull-right"><i class="fa fa-arrow-circle-right"></i></span>
                    <div class="clearfix"></div>
                </div>
            </a>
        </div>
    </div>
    <div class="col-lg-3 col-md-6">
        <div class="panel panel-green">
            <div class="panel-heading">
                <div class="row">
                    <div class="col-xs-3">
                        <i class="fa fa-truck fa-5x"></i>
                    </div>
                    <div class="col-xs-9 text-right">
                        <div class="huge">{{$ordercounttoday}}</div>
                        <div>Today's Deliveries!</div>
                    </div>
                </div>
            </div>
            <a href="#">
                <div class="panel-footer">
                    <span class="pull-left">View Details</span>
                    <span class="pull-right"><i class="fa fa-arrow-circle-right"></i></span>
                    <div class="clearfix"></div>
                </div>
            </a>
        </div>
    </div>
    <div class="col-lg-3 col-md-6">
        <div class="panel panel-red">
            <div class="panel-heading">
                <div class="row">
                    <div class="col-xs-3">
                        <i class="fa fa-support fa-5x"></i>
                    </div>
                    <div class="col-xs-9 text-right">
                        <div class="huge">{{$ticketcount}}</div>
                        <div><a href="/tickets">Support Tickets</a> </div>
                    </div>
                </div>
            </div>
            <a href="/tickets">
                <div class="panel-footer">
                    <span class="pull-left">View Details</span>
                    <span class="pull-right"><i class="fa fa-arrow-circle-right"></i></span>
                    <div class="clearfix"></div>
                </div>
            </a>
        </div>
    </div>
    <div class="col-lg-3 col-md-6">
        <div class="panel panel-green">
            <div class="panel-heading">
                <div class="row">
                    <a class="twitter-timeline" data-width="230" data-height="300" data-theme="light" href="https://twitter.com/MichaelJ_Duncan">Spyglass Retail Tweets</a> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

                </div>
            </div>
            <a href="https://twitter.com/MichaelJ_Duncan">
                <div class="panel-footer">
                    <span class="pull-left">View Details</span>
                    <span class="pull-right"><i class="fa fa-arrow-circle-right"></i></span>
                    <div class="clearfix"></div>
                </div>
            </a>
        </div>
    </div>


</div>
@endsection

19 Dec
5 months ago

ThinkingMan left a reply on CRSF Checked Before Auth

@froind Can you confirm that your last response to paste addCookieToResponse to the VerifyCsrfToken.php file worked? If so, could you show it in the updated file?

10 Nov
7 months ago

ThinkingMan left a reply on How To Determine Installed Version Of Spark?

php artisan spark:version is the command. Figured it out watching a Spark vid.

ThinkingMan left a reply on How To Determine Installed Version Of Spark?

@VIEZEL - But is there a command to determine what version of Spark is installed on my project or where is that file?

ThinkingMan started a new conversation How To Determine Installed Version Of Spark?

Does the Spark version match the version of Laravel or is there a way to determine the version?

17 Oct
8 months ago

ThinkingMan left a reply on AWS Deployed App - Viewing The Site?

Just had to set the DNS in AWS then update DNS on my registrar

ThinkingMan started a new conversation AWS Deployed App - Viewing The Site?

I just deployed an app via Forge to an AWS instance that was provisioned by Forge. I go to my AWS console and see the IP address as 11.22.33.44 but when I enter that public address in a browser I get the PHP info only and not the site. What did I miss in the setup? (I have VPC DNS=Yes).

20 Sep
8 months ago

ThinkingMan left a reply on Guzzle To POST To External Hosted Payment Page?

@Snapey Do you think the form_params could actually prevent the redirect?

11 Sep
9 months ago

ThinkingMan left a reply on Guzzle To POST To External Hosted Payment Page?

Here is the challenge, with Redirects = Yes I see the external form embedded in my view yielding a browser URL with http://donate.devel/churchpay/2 (not what I need).

Instead I would have expected the redirect to send me to the First Data page with the proper post detail ultimately with a URL like this https://demo.globalgatewaye4.firstdata.com/check_cookie?ant=a6372e2161cea20cd2035bf2313b41bc&merchant=HCO-KW-EN-279&order=f04701f1845f3542d593a614243d950c7797b56b535c5c324859f679c2284882&purch=5135798&t=1

The funny thing is that the link above is generated when I have redirects = to false. But the app stops at the view which states "You are being redirected."

ThinkingMan left a reply on Guzzle To POST To External Hosted Payment Page?

So I set the redirects = to false and now get a view in my app that states "You are being redirected." with that text being a hyperlink to the correct hosted page, but it never actually redirects to the First Data page. Here is the current function. What is missing?

public function PostFDMSdata($id)
    {
            $datetime = Carbon::now("UTC");
            $x_login = "JUW-MD-KW-972";
            $transaction_key = SomeKeyHere;
            $x_fp_sequence = rand(1000, 100000) + 123456;
            $hmac_data = $x_login . "^" . $x_fp_sequence . "^" . $datetime . "^" . "5.00" . "^" . "USD";
            $x_fp_hash = hash_hmac('MD5', $hmac_data, $transaction_key);

            $client= new Client(['cookies' => true]);
            $response = $client ->post(
                'https://demo.globalgatewaye4.firstdata.com/pay',
                array(
                    'allow_redirects' => false,
                    'form_params' => array(
                        'x_login' => $x_login,
                        'transaction_key' => $transaction_key,
                        'x_amount' => '5.00',
                        'x_fp_sequence' => $x_fp_sequence,
                        'x_fp_timestamp' => $datetime,
                        'x_fp_hash' => $x_fp_hash,
                        'x_currency_code' => 'USD',
                        'x_recurring_billing_amount' => '9.02',
                        'x_recurring_billing' => 'TRUE',
                        'x_recurring_billing_id' => 'MB-MD-KW-25-2323',
                        'x_recurring_billing_start_date' => '2018-09-08',
                        'x_recurring_billing_end_date' => '2035-01-31',
                        'x_show_form' => 'PAYMENT_FORM'
                    )
                )

                );

            var_dump($response->getBody()->__toString());

    }

10 Sep
9 months ago

ThinkingMan left a reply on Guzzle To POST To External Hosted Payment Page?

Read up on the Guzzle docs and found this section on Cookies http://docs.guzzlephp.org/en/stable/quickstart.html#cookies. Able to answer that question on my own.

Now I just need to figure out how to get the First Data page to show and not my own. So after the user clicks the pay button they should redirect to the hosted payment page but that is not happening. It still has my app in the URL. I will read Guzzle's redirect section further. It stated that it should redirect by default but that doesn't seem to be the case or possibly I am not understanding the function of a Guzzle redirect.

ThinkingMan left a reply on Guzzle To POST To External Hosted Payment Page?

Gentlemen - First a big thanks for helping the noob. I seem to be getting more detail from the page now. Not sure if I am making the proper handshake. Should I use something other than var_dump? I am getting a "need to enable cookies page" which is a false negative since they are properly enabled on my browser. Thinking it is more with the handoff.

ThinkingMan left a reply on Guzzle To POST To External Hosted Payment Page?

I have updated my Guzzle post to the following just to see what comes out. The method to var dump is wrong but I did it just to see what gets returned. The good news is I am at least trying to post to the First Data hosted page. Can anyone offer the correct step

   public function PostFDMSdata($id)
    {
            $datetime = Carbon::now("UTC");
            $x_login = "JUW-MD-KW-972";
            $transaction_key = "SomeKeyHere";
            $hmac_data = $x_login . "^" . 195701 . "^" . $datetime . "^" . "5.00" . "^" . "USD";
            $x_fp_hash = hash_hmac('MD5', $hmac_data, $transaction_key);

            $client= new Client();
            $response = $client ->post(
                'https://demo.globalgatewaye4.firstdata.com/pay',
                array(
                    'form_params' => array(
                        '$x_login' => $x_login,
                        '$transaction_key' => $transaction_key,
                        '$x_amount' => '9.01',
                        '$x_fp_sequence' => 'rand(1000, 100000) + 123456',
                        '$x_fp_timestamp' => $datetime,
                        '$x_fp_hash' => $x_fp_hash,
                        '$x_currency_code' => 'USD',
                        '$x_recurring_billing_amount' => '9.02',
                        '$x_recurring_billing' => 'TRUE',
                        '$x_recurring_billing_id' => 'MB-MD-KW-25-2323',
                        '$x_recurring_billing_start_date' => '2018-09-08',
                        '$x_recurring_billing_end_date' => '2035-01-31'
                    )
                )

                );

            var_dump($response->getBody()->__toString());

    }

So after this I get an error page inside my own app from the First Data site. If this worked properly then I should have been shown the https://demo.globalgatewaye4.firstdata.com/pay site with the proper info passed over. What are the correct methods?

08 Sep
9 months ago

ThinkingMan left a reply on Guzzle To POST To External Hosted Payment Page?

I know this isn't exactly correct but this is what I am trying right now just to prove out things. Ideas?

public function PostFDMSdata($id) { $client= new Client(); $client ->post( 'https://demo.globalgatewaye4.firstdata.com/pay', array( 'form_params' => array( '$x_login' => 'JUW-MD-KW-972', '$transaction_key' => 'SomeKeyHere', '$x_amount' => '9.01', '$x_fp_sequence' => 'rand(1000, 100000) + 123456', '$x_fp_timestamp' => 'time()', '$x_fp_hash' => 'ThisHasToBeCalculated', '$x_currency_code' => 'USD', '$x_recurring_billing_amount' => '9.02', '$x_recurring_billing' => 'TRUE', '$x_recurring_billing_id' => 'MB-MD-KW-25-2323', '$x_recurring_billing_start_date' => '2018-09-08', '$x_recurring_billing_end_date' => '2035-01-31' ) )

            );

    dd($client);
}

ThinkingMan left a reply on Guzzle To POST To External Hosted Payment Page?

The Payeezy gateway is expecting this information:

ThinkingMan left a reply on Guzzle To POST To External Hosted Payment Page?

The Payeezy gateway is expecting this information:

Payment Pages: Sample PHP Payment Form label { display: block; margin: 5px 0px; color: #AAA; } input { display: block; } input[type=submit] { margin-top: 20px; }

Processing Please Wait...

ThinkingMan started a new conversation Guzzle To POST To External Hosted Payment Page?

I started down a road of using procedural PHP with Laravel to sent a POST to a FirstData Payeezy hosted payment page. (They have sample code here https://support.payeezy.com/hc/en-us/articles/204011429-Sample-Code-Creating-a-Pay-Button-to-use-with-a-Hosted-Payment-Page) But after feedback from this audience (thanks!) and more research I landed on the potential of using Guzzle. So I am wondering if the audience thinks this is a viable approach.

Here is why I need to use the FirstData Payeezy Hosted Page. (1) The client requires that processor (2) the Payeezy gateway handles the recurring payments (3) the gateway supports check processing (4) removes the app from PCI scope. So many reasons to go with this hosted payment page.

The added challenge with my app is that I will have multiple churches connect from the app (i.e. multi tenant) and thus I need to grab the Payeezy credentials from each church and hand those unique credentials over through the POST call. I can make this happen with a standard HTML & PHP setup but I have chosen to use Laravel for all of it's benefits.

So again, would Guzzle be an approach? The Payeezy gateway is expecting this information:

Payment Pages: Sample PHP Payment Form label { display: block; margin: 5px 0px; color: #AAA; } input { display: block; } input[type=submit] { margin-top: 20px; }

Processing Please Wait...

18 Aug
9 months ago

ThinkingMan left a reply on Send Data From Blade Form View To External POST

@jlrdw thanks for being constructive. Unfortunately I have to use what this church has provided. So will try to keep it simple.

ThinkingMan left a reply on Send Data From Blade Form View To External POST

@jlrdw because First Data is required by the church.

ThinkingMan left a reply on Send Data From Blade Form View To External POST

Yeah, thats what I thought he meant.

I guess I will just ask for an approach with laravel. I will take it from there.

ThinkingMan left a reply on Send Data From Blade Form View To External POST

Thank you in advance everyone. I apologize for simple questions. I do have the HTML and PHP working much like @jlrdw has posted. Works no issue. But I am storing the values for the Church pay pages and some other variables that are needed for posting. I am building this in Laravel because the church can sign up members for historical reasons. That said here is the code thus far:

Here is the Church List/Profile Page

Donations Site - Church List Page

Donations

This will be the church list.

@if($churches)
    @foreach($churches as $church)
        <div class="card" style="width:400px">
            <img class="card-img-bottom" src="\storage\users\default.png" style="width:25%;" alt="Church image">
            <div class="card-body">
                <h4 class="card-title">{{$church->church_name}}</h4>
                <p class="card-text">{{$church->id}}</p>
                <p class="card-text">{{$church->user->name}}</p>
                <a href="{{route('profile',[$church->id])}}" class="btn btn-primary">Church Page</a>

                <form action="{{route('donate',[$church->id])}}" method="post">
                    <input class="form-control" type="text" placeholder="Name">
                    <input class="form-control" type="text" placeholder="Address 1">
                    <input class="form-control" type="text" placeholder="Address 2">
                    <input class="form-control" type="text" placeholder="Address 3">
                    <input class="form-control" type="text" placeholder="City">
                    <input class="form-control" type="text" placeholder="State">
                    <input class="form-control" type="text" placeholder="Zip">
                    <input class="form-control" name="x_amount" value="" placeholder="Payment Amount $" type="text">
                    <br>
                    <a href="{{route('donate',[$church->id])}}" class="btn btn-primary">Donate Route</a>
                    
                </form>

            </div>
            <br>
        </div>
        <br>
    @endforeach
@endif
</div>

Here is my Route

Route::get('churchpay/{id}', '[email protected]')->name('donate');

Here is the Church controller

public function donate($id)
{
    //
    $churches = Church::findOrFail($id);

    return view('churches.churchpay', compact('churches'));
}

Here is the Churchpay view (with detail to post to the Payeezy external site)

Church Donation Page label { display: block; margin: 5px 0px; color: #AAA; } input { display: block; } input[type=submit] { margin-top: 20px; }

{!! Form::model($churches, ['method'=>'GET', 'action'=>['[email protected]', $churches->id], 'files'=>true]) !!}
<div class="card card-body">
    <div class="card-body">
        <h1>Please wait for the secure donation page...</h1>
        <h4 class="card-title">{{$churches->church_name}}</h4>
    </div>
</div>
<br>
<?php
$x_login = "HCO-KW-EN-279"; // Take from Payment Page ID in Payment Pages interface
$transaction_key = "ioSB4gSXyyYiaS23BXc1"; // Take from Payment Pages configuration interface
$x_amount = $_POST["x_amount"];
$x_currency_code = "USD"; // Needs to agree with the currency of the payment page
$x_recurring_billing = "TRUE";
$x_recurring_billing_id = "MB-KW-EN-25-7722";
$x_recurring_billing_amount = "8.89";
$x_recurring_billing_start_date = "2018-08-01";
$x_recurring_billing_end_date = "2035-01-31";
srand(time()); // initialize random generator for x_fp_sequence
$x_fp_sequence = rand(1000, 100000) + 123456;
$x_fp_timestamp = time(); // needs to be in UTC. Make sure webserver produces UTC

// The values that contribute to x_fp_hash
$hmac_data = $x_login . "^" . $x_fp_sequence . "^" . $x_fp_timestamp . "^" . $x_amount . "^" . $x_currency_code;
$x_fp_hash = hash_hmac('MD5', $hmac_data, $transaction_key);

echo ('<input name="x_login" value="' . $x_login . '" type="hidden">' );
echo ('<input name="x_amount" value="' . $x_amount . '" type="hidden">' );
echo ('<input name="x_fp_sequence" value="' . $x_fp_sequence . '" type="hidden">' );
echo ('<input name="x_fp_timestamp" value="' . $x_fp_timestamp . '" type="hidden">' );
echo ('<input name="x_fp_hash" value="' . $x_fp_hash . '" size="50" type="hidden">' );
echo ('<input name="x_currency_code" value="' . $x_currency_code . '" type="hidden">');
echo ('<input name="x_recurring_billing_amount" value="' . $x_recurring_billing_amount . '" type="hidden">' );
echo ('<input name="x_recurring_billing" value="' . $x_recurring_billing . '" type="hidden">');
echo ('<input name="x_recurring_billing_id" value="' . $x_recurring_billing_id . '" type="hidden">');
echo ('<input name="x_recurring_billing_start_date" value="' . $x_recurring_billing_start_date . '" type="hidden">');
echo ('<input name="x_recurring_billing_end_date" value="' . $x_recurring_billing_end_date . '" type="hidden">');

// create parameters input in html
foreach ($_POST as $a => $b) {
    echo "<input type='hidden' name='".htmlentities($a)."' value='".htmlentities($b)."'>";
}

?>

<input type="hidden" name="x_show_form" value="PAYMENT_FORM"/>
document.myForm.submit();

ThinkingMan left a reply on Send Data From Blade Form View To External POST

The form on my site is allowed to post to the variables on the hosted payment page. As mentioned, I have this working with straight HTML and PHP. It is the pass in the Laravel MVC that I am trying to resolve. Obviously I am doing something wrong in Laravel. Will post some more code to illustrate. Thanks

ThinkingMan left a reply on Send Data From Blade Form View To External POST

Is anyone able to see my posts? I am wondering only because I am having issues accessing and a couple of my posts have not been replied to at all.

ThinkingMan started a new conversation Send Data From Blade Form View To External POST

I am creating a simple donation form for my local church and have decided to integrate to Payeezy. So essentially church members will go to the church profile page, fill in their name, address and the amount they want to donate. This can send via POST to the Payeezy hosted page. (Sample code here https://support.payeezy.com/hc/en-us/articles/204011429-Sample-Code-Creating-a-Pay-Button-to-use-with-a-Hosted-Payment-Page)

I have this working in a non-Laravel HTML form. I think my problem is something with routing as I cannot pass the form field data to the First Data hosted page. It doesnt know the value that I entered on the form. I have hard coded all fields except the $x_amount listed below. This amount is filled in on the Church Profile Laravel Blade form then I call the route to the Payeezy POST form and am trying to pass the amount over. But the amount never passes. It just comes back with the error and the variable id.

So what am I doing wrong in trying to send via the POST? Since this is not posting in my application I wasnt using the POST methods in Laravel, just trying to hand over to the Payeezy page.

<?php
$x_login = "HARD CODED FOR NOW"; // Take from Payment Page ID in Payment Pages interface
$transaction_key = "HARD CODED FOR NOW"; // Take from Payment Pages configuration interface
$x_amount = $_POST["x_amount"];
$x_currency_code = "USD"; // Needs to agree with the currency of the payment page
$x_recurring_billing = "TRUE";
$x_recurring_billing_id = "HARD CODED FOR NOW";
$x_recurring_billing_amount = "HARD CODED FOR NOW";
$x_recurring_billing_start_date = "HARD CODED FOR NOW";
$x_recurring_billing_end_date = "HARD CODED FOR NOW";
srand(time()); // initialize random generator for x_fp_sequence
$x_fp_sequence = rand(1000, 100000) + 123456;
$x_fp_timestamp = time(); // needs to be in UTC. Make sure webserver produces UTC
29 Jun
11 months ago

ThinkingMan started a new conversation Payment Gateway Integrations - Other Than Stripe Or Braintree?

Does anyone know of Payment Gateway integrations that work with First Data Merchant Services? Looking for any (current) projects out there that may work with a gateway other than Stripe or Braintree. My client is specifically looking for a gateway that supports FDMS. Thanks