hellomars

Experience

960

0 Best Reply Awards

  • Member Since 1 Year Ago
  • 2 Lessons Completed
  • 0 Favorites

5th May, 2018

hellomars left a reply on Suddenly Home Redirects To Settings#/subscription • 4 months ago

I've found it! The trial_ends_at date entry somehow was messed up. When I copy pasted another entry everything was right again. Cronix thanks for helping out.

4th May, 2018

hellomars left a reply on Suddenly Home Redirects To Settings#/subscription • 4 months ago

btw I appreciate your time Cronix, i don't think it's an easy thing. So if we can't figure I'll do a complete migrate:refresh and have my test user redo their things.

hellomars left a reply on Suddenly Home Redirects To Settings#/subscription • 4 months ago

Well, I have some other tables in which I stored some identifiers in every row. I changed the column date field so that it could hold much more data. So now all identifiers that were stored in single rows are now stored in a single row. To get this implemented, I did a migrate:refresh and after that I specifically imported the users table to have the convenience of having the logins back.

hellomars left a reply on Suddenly Home Redirects To Settings#/subscription • 4 months ago

Yes, I've checked those. Both tables are completely empty. I actually had one subscription for one user (myself) and the other user didn't. However, both users experienced the same problem (redirecting to settings/subscriptions).

hellomars left a reply on Suddenly Home Redirects To Settings#/subscription • 4 months ago

Hi Cronix, yes they are able to login successfully and all other pages work but as soon as they go to the /home route, they are reroutes to the settings/subscription page. I think the subscription has changed but can't figure it out where to locate it in the database?

3rd May, 2018

hellomars left a reply on Suddenly Home Redirects To Settings#/subscription • 4 months ago

Well, I exported the users table in MySql and re-imported it after I did a migrate:refresh. So at first everything seemed fine with respect to users logging in but I just found out about this new "feature"...

hellomars left a reply on Suddenly Home Redirects To Settings#/subscription • 4 months ago

And even more annoying as I just found out, it only affects existing users that I imported. New users are not affected. So it definitely has something to do with the MySQL import.

hellomars started a new conversation Suddenly Home Redirects To Settings#/subscription • 4 months ago

Dear Sparkers,

A very annoying just surfaced. I did some database tweaking, migrated it and manually imported the user table together with some other tables.

Suddenly the home page of my laravel spark won't display properly. It automatically goes to the settings#/subscription page.

The routes are still intact but are the HomeController is not used at all. I've cleared all caches but still the same. No errors in the log. Anyone have an idea how to solve this?

6th March, 2018

hellomars left a reply on Kiosk - Impersonating A User - How To Check? • 6 months ago

And I found it! I looked through the Spark code for impersonating and went from there.

If you check like this:

''' if(Session::has('spark:impersonator')){ // do stuff }'''

It checks if you are in impersonator mode. Can also be used in blade views, very very nice.

hellomars started a new conversation Kiosk - Impersonating A User - How To Check? • 6 months ago

Dear sparkers,

I would like to have some customized blade pages that show more info when the admin is looking at the pages via the impersonating option in Kiosk. Is that possible? Is there a method that can check if the admin is impersonating the user instead of the actual user being logged in?

30th January, 2018

hellomars left a reply on Can't Update Cashier In Order To Update Stripe-php In Order To Install Laravel-shield • 7 months ago

Thanks Martin, that is a very good suggestion. I am now trying to get the code to work within my Spark environment. This piece of code is proving difficult:

$event = \Stripe\Webhook::constructEvent($payload, $sig_header, $endpoint_secret

I can find it back in the official repos: https://github.com/stripe/stripe-php/search?utf8=%E2%9C%93&q=constructEvent&type= but I guess the Spark installation uses an outdated Stripe package.

Since I am having difficulty getting the package updated, I will try to get all the necessary files in.... it's a bit of a hack....

29th January, 2018

hellomars started a new conversation Can't Update Cashier In Order To Update Stripe-php In Order To Install Laravel-shield • 7 months ago

Dear Sparkers,

A while ago, I tried to install a shield package to verify the origin of Stripe webhooks:

https://laracasts.com/discuss/channels/spark/middleware-to-protect-against-unverified-webhooks-from-3rd-party-services-fails-to-install?page=1#reply-382098

Since then, I didn't really look into it until now. I tried to update the Stripe-php but that package was linked tot Cashier 7.0.1. So I tried to update Cashier since there are about 12 updates since 7.0.1 but that gives me a ton of conflicts

Using version ^7.0 for laravel/cashier
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - The requested package stripe/stripe-php (locked at v3.23.0, required as ^5.9) is satisfiable by stripe/stripe-php[v3.23.0] but these conflict with your requirements or minimum-stability.
  Problem 2
    - laravel/cashier v7.0.11 requires dompdf/dompdf ^0.8.0 -> satisfiable by dompdf/dompdf[v0.8.0, v0.8.1, v0.8.2].
    - laravel/cashier v7.0.12 requires dompdf/dompdf ^0.8.0 -> satisfiable by dompdf/dompdf[v0.8.0, v0.8.1, v0.8.2].
    - laravel/cashier v7.0.13 requires dompdf/dompdf ^0.8.0 -> satisfiable by dompdf/dompdf[v0.8.0, v0.8.1, v0.8.2].
    - laravel/cashier v7.0.1 requires stripe/stripe-php ~3.0 -> satisfiable by stripe/stripe-php[v3.0.0, v3.1.0, v3.10.0, v3.10.1, v3.11.0, v3.12.0, v3.12.1, v3.13.0, v3.14.0, v3.14.1, v3.14.2, v3.14.3, v3.15.0, v3.16.0, v3.17.0, v3.17.1, v3.18.0, v3.19.0, v3.2.0, v3.20.0, v3.21.0, v3.22.0, v3.23.0, v3.3.0, v3.4.0, v3.5.0, v3.6.0, v3.7.0, v3.7.1, v3.8.0, v3.9.0, v3.9.1, v3.9.2] but these conflict with your requirements or minimum-stability.
    - laravel/cashier v7.0.9 requires stripe/stripe-php ~4.0 -> satisfiable by stripe/stripe-php[v4.0.0, v4.0.1, v4.1.0, v4.1.1, v4.10.0, v4.11.0, v4.12.0, v4.13.0, v4.2.0, v4.3.0, v4.4.0, v4.4.1, v4.4.2, v4.5.0, v4.5.1, v4.6.0, v4.7.0, v4.8.0, v4.8.1, v4.9.0, v4.9.1] but these conflict with your requirements or minimum-stability.
    - laravel/cashier v7.0.8 requires stripe/stripe-php ~4.0 -> satisfiable by stripe/stripe-php[v4.0.0, v4.0.1, v4.1.0, v4.1.1, v4.10.0, v4.11.0, v4.12.0, v4.13.0, v4.2.0, v4.3.0, v4.4.0, v4.4.1, v4.4.2, v4.5.0, v4.5.1, v4.6.0, v4.7.0, v4.8.0, v4.8.1, v4.9.0, v4.9.1] but these conflict with your requirements or minimum-stability.
    - laravel/cashier v7.0.7 requires stripe/stripe-php ~4.0 -> satisfiable by stripe/stripe-php[v4.0.0, v4.0.1, v4.1.0, v4.1.1, v4.10.0, v4.11.0, v4.12.0, v4.13.0, v4.2.0, v4.3.0, v4.4.0, v4.4.1, v4.4.2, v4.5.0, v4.5.1, v4.6.0, v4.7.0, v4.8.0, v4.8.1, v4.9.0, v4.9.1] but these conflict with your requirements or minimum-stability.
    - laravel/cashier v7.0.6 requires stripe/stripe-php ~4.0 -> satisfiable by stripe/stripe-php[v4.0.0, v4.0.1, v4.1.0, v4.1.1, v4.10.0, v4.11.0, v4.12.0, v4.13.0, v4.2.0, v4.3.0, v4.4.0, v4.4.1, v4.4.2, v4.5.0, v4.5.1, v4.6.0, v4.7.0, v4.8.0, v4.8.1, v4.9.0, v4.9.1] but these conflict with your requirements or minimum-stability.
    - laravel/cashier v7.0.5 requires stripe/stripe-php ~4.0 -> satisfiable by stripe/stripe-php[v4.0.0, v4.0.1, v4.1.0, v4.1.1, v4.10.0, v4.11.0, v4.12.0, v4.13.0, v4.2.0, v4.3.0, v4.4.0, v4.4.1, v4.4.2, v4.5.0, v4.5.1, v4.6.0, v4.7.0, v4.8.0, v4.8.1, v4.9.0, v4.9.1] but these conflict with your requirements or minimum-stability.
    - laravel/cashier v7.0.4 requires stripe/stripe-php ~3.0 -> satisfiable by stripe/stripe-php[v3.0.0, v3.1.0, v3.10.0, v3.10.1, v3.11.0, v3.12.0, v3.12.1, v3.13.0, v3.14.0, v3.14.1, v3.14.2, v3.14.3, v3.15.0, v3.16.0, v3.17.0, v3.17.1, v3.18.0, v3.19.0, v3.2.0, v3.20.0, v3.21.0, v3.22.0, v3.23.0, v3.3.0, v3.4.0, v3.5.0, v3.6.0, v3.7.0, v3.7.1, v3.8.0, v3.9.0, v3.9.1, v3.9.2] but these conflict with your requirements or minimum-stability.
    - laravel/cashier v7.0.3 requires stripe/stripe-php ~3.0 -> satisfiable by stripe/stripe-php[v3.0.0, v3.1.0, v3.10.0, v3.10.1, v3.11.0, v3.12.0, v3.12.1, v3.13.0, v3.14.0, v3.14.1, v3.14.2, v3.14.3, v3.15.0, v3.16.0, v3.17.0, v3.17.1, v3.18.0, v3.19.0, v3.2.0, v3.20.0, v3.21.0, v3.22.0, v3.23.0, v3.3.0, v3.4.0, v3.5.0, v3.6.0, v3.7.0, v3.7.1, v3.8.0, v3.9.0, v3.9.1, v3.9.2] but these conflict with your requirements or minimum-stability.
    - laravel/cashier v7.0.2 requires stripe/stripe-php ~3.0 -> satisfiable by stripe/stripe-php[v3.0.0, v3.1.0, v3.10.0, v3.10.1, v3.11.0, v3.12.0, v3.12.1, v3.13.0, v3.14.0, v3.14.1, v3.14.2, v3.14.3, v3.15.0, v3.16.0, v3.17.0, v3.17.1, v3.18.0, v3.19.0, v3.2.0, v3.20.0, v3.21.0, v3.22.0, v3.23.0, v3.3.0, v3.4.0, v3.5.0, v3.6.0, v3.7.0, v3.7.1, v3.8.0, v3.9.0, v3.9.1, v3.9.2] but these conflict with your requirements or minimum-stability.
    - dompdf/dompdf v0.8.2 requires ext-gd * -> the requested PHP extension gd is missing from your system.
    - dompdf/dompdf v0.8.1 requires ext-gd * -> the requested PHP extension gd is missing from your system.
    - dompdf/dompdf v0.8.0 requires ext-gd * -> the requested PHP extension gd is missing from your system.
    - laravel/cashier v7.0.10 requires stripe/stripe-php ~4.0 -> satisfiable by stripe/stripe-php[v4.0.0, v4.0.1, v4.1.0, v4.1.1, v4.10.0, v4.11.0, v4.12.0, v4.13.0, v4.2.0, v4.3.0, v4.4.0, v4.4.1, v4.4.2, v4.5.0, v4.5.1, v4.6.0, v4.7.0, v4.8.0, v4.8.1, v4.9.0, v4.9.1] but these conflict with your requirements or minimum-stability.
    - laravel/cashier v7.0.1 requires stripe/stripe-php ~3.0 -> satisfiable by stripe/stripe-php[v3.0.0, v3.1.0, v3.10.0, v3.10.1, v3.11.0, v3.12.0, v3.12.1, v3.13.0, v3.14.0, v3.14.1, v3.14.2, v3.14.3, v3.15.0, v3.16.0, v3.17.0, v3.17.1, v3.18.0, v3.19.0, v3.2.0, v3.20.0, v3.21.0, v3.22.0, v3.23.0, v3.3.0, v3.4.0, v3.5.0, v3.6.0, v3.7.0, v3.7.1, v3.8.0, v3.9.0, v3.9.1, v3.9.2] but these conflict with your requirements or minimum-stability.
    - laravel/cashier v7.0.0 requires stripe/stripe-php ~3.0 -> satisfiable by stripe/stripe-php[v3.0.0, v3.1.0, v3.10.0, v3.10.1, v3.11.0, v3.12.0, v3.12.1, v3.13.0, v3.14.0, v3.14.1, v3.14.2, v3.14.3, v3.15.0, v3.16.0, v3.17.0, v3.17.1, v3.18.0, v3.19.0, v3.2.0, v3.20.0, v3.21.0, v3.22.0, v3.23.0, v3.3.0, v3.4.0, v3.5.0, v3.6.0, v3.7.0, v3.7.1, v3.8.0, v3.9.0, v3.9.1, v3.9.2] but these conflict with your requirements or minimum-stability.
    - laravel/cashier v7.0.1 requires stripe/stripe-php ~3.0 -> satisfiable by stripe/stripe-php[v3.0.0, v3.1.0, v3.10.0, v3.10.1, v3.11.0, v3.12.0, v3.12.1, v3.13.0, v3.14.0, v3.14.1, v3.14.2, v3.14.3, v3.15.0, v3.16.0, v3.17.0, v3.17.1, v3.18.0, v3.19.0, v3.2.0, v3.20.0, v3.21.0, v3.22.0, v3.23.0, v3.3.0, v3.4.0, v3.5.0, v3.6.0, v3.7.0, v3.7.1, v3.8.0, v3.9.0, v3.9.1, v3.9.2] but these conflict with your requirements or minimum-stability.
    - Installation request for laravel/cashier ^7.0 -> satisfiable by laravel/cashier[v7.0.0, v7.0.1, v7.0.10, v7.0.11, v7.0.12, v7.0.13, v7.0.2, v7.0.3, v7.0.4, v7.0.5, v7.0.6, v7.0.7, v7.0.8, v7.0.9].

  To enable extensions, verify that they are enabled in your .ini files:```

So I am wondering, is it even possible to update all of this without breaking the whole Spark functionality? I am running the latest v5.0.1 Spark with Laravel 5.5

Thanks 

1st December, 2017

hellomars left a reply on Trying To Deploy Spark To AWS Elastic Beanstalk... Having Issues... • 9 months ago

I installed Spark on AWS BeanStalk by just zipping the complete running folder on my dev machine (including vendor folder) and uploading it. I will probably use the same IAM for standard EC2 instances.

30th November, 2017

hellomars left a reply on Middleware To Protect Against Unverified Webhooks From 3rd Party Services Fails To Install • 9 months ago

Hi Bobby,

Thanks for the info. I am using the newest version of Spark so that should be fine. I could try to ask for the newest stripe-php but i am quite afraid to break the whole delicate Spark installation. I have everything running in a vagrant instance, perhaps I should try to make another one.

I am a bit suprised that Spark is using such an old version of the stripe package.

29th November, 2017

hellomars started a new conversation Middleware To Protect Against Unverified Webhooks From 3rd Party Services Fails To Install • 9 months ago

Dear Sparkers,

I tried to install the laravel-shield package (http://laravel-shield.com/service/stripe) to protect the Stripe webhook. After composer require laravel-shield/stripe I get the following:

Using version ^1.0 for laravel-shield/stripe
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

 Problem 1
   - Installation request for laravel-shield/stripe ^1.0 -> satisfiable by laravel-shield/stripe[v1.0.0].
   - Conclusion: remove stripe/stripe-php v3.23.0
   - Conclusion: don't install stripe/stripe-php v3.23.0
   - laravel-shield/stripe v1.0.0 requires stripe/stripe-php ^5.3 -> satisfiable by stripe/stripe-php[v5.3.0, v5.4.0, v5.5.0, v5.5.1, v5.6.0, v5.7.0].
   - Can only install one of: stripe/stripe-php[v5.3.0, v3.23.0].
   - Can only install one of: stripe/stripe-php[v5.4.0, v3.23.0].
   - Can only install one of: stripe/stripe-php[v5.5.0, v3.23.0].
   - Can only install one of: stripe/stripe-php[v5.5.1, v3.23.0].
   - Can only install one of: stripe/stripe-php[v5.6.0, v3.23.0].
   - Can only install one of: stripe/stripe-php[v5.7.0, v3.23.0].
   - Installation request for stripe/stripe-php (locked at v3.23.0) -> satisfiable by stripe/stripe-php[v3.23.0].


Installation failed, reverting ./composer.json to its original content.

So it seems like the stripe/stripe-php within the Spark installation is quite old? Since there already is a 5.7.0 version available (https://packagist.org/packages/stripe/stripe-php). Has anyone else been successfull installing this package using Spark?

25th October, 2017

hellomars started a new conversation Put Method Yields HTTP 405 (method Not Allowed) But Works In Postman (HTTP 500)... • 10 months ago

Dear Sparkers,

I have created an addition to the profile settings page in Spark. The vue code:

Vue.component('update-mail-settings', {
   props: ['user'],

   data() {
       return {
           form: new SparkForm({
               type: ''
           })
       };
   },

   mounted() {
       this.form.mailsettings = this.user.mailsettings;
   },

   methods: {
       update() {
           Spark.put('update-mail-settings', this.form)
               .then(response => {
                   Bus.$emit('updateUser');
               });
       }
   }
});

I've created a route:

Route::put('/update-mail-settings', '[email protected]');

and the Controller to handle the request. I disabled CSRF checking and as can be seen in the code beneath, also the auth middleware:

class SettingsController extends Controller
{
  
  public function __construct(){
    //$this->middleware('auth');
  }
  
  public function updateMailSettings(Request $request)
  {
    $request->user()->forceFill([
      'mailsettings' => $request->mailsettings
      ])->save();
      
      return Redirect::back()->with('success', 'Successfully updated mailsettings');
    }
  }

I didn't show the blade with radio buttons but that doesn't seem like the source of the error. Interestingly, when I monitor the requests in my Nginx log files I see a 405 error if I click on the update button on the website but if I use Postman, it yields a 500 code (after which it fails since it cannot assign the mailsettings variable --> "Call to a member function forceFill() on null")

Anyone have any idea?

hellomars left a reply on Adding Profile Fields To Settings Page • 10 months ago

I found the answer!

data() {
  return {
   form: new SparkForm({
       type: ''    <-  this can now be v-modeled to "form.type"
   })
 };
},

23rd October, 2017

hellomars started a new conversation Adding Profile Fields To Settings Page • 10 months ago

Dear Sparkers,

I tried to stay away from the Vue components of Spark as much as possible but I discovered I had to implement a certain mail settings so I can't hold it much longer.

Luckily the Spark documentation contains a small cookbook for adding profile fields: https://spark.laravel.com/docs/4.0/adding-profile-fields

Most parts are within my (limited PHP) comfort zone:

First the blade php:

<form class="form-horizontal" role="form">
       <div class="form-group" :class="{'has-error': form.errors.has('mail-settings')}">
         <label class="col-md-4 control-label">Mail settings</label>

         <div class="col-md-6">
           <label class="radio-inline"><input type="radio" value="profile" v-model="form.type" name="profile">Profile</label>
           <label class="radio-inline"><input type="radio" value="website" v-model="form.type" name="website">Website</label>
           <label class="radio-inline"><input type="radio" value="combined" v-model="form.type" name="combined">Combined</label>

           <span class="help-block" v-show="form.errors.has('mail-settings')">
             @{{ form.errors.get('mail-settings') }}
           </span>
         </div>
       </div>

Which is integrated :

<!-- Update Mail settings -->
      @include('settings.profile.update-mail-settings')

So as can be seen in the previous code block, I wish to store the result of 3 radio buttons. However the linked Vue js file is giving my headaches:

Vue.component('update-mail-settings', {
   props: ['user'],

   data() {
       return {
           form: new SparkForm({
               profile: ''
               website: ''
               combined: ''
           })
       };
   },

   mounted() {
       this.form.mailsettings = this.user.mailsettings;
   },

   methods: {
       update() {
           Spark.put('/settings/profile/mail-settings', this.form)
               .then(response => {
                   Bus.$emit('updateUser');
               });
       }
   }
});

But how on earth do I integrate the radio buttons in the SparkForm? Suggestions are most welcome.

5th October, 2017

hellomars left a reply on How Do I Save Laravel.log To Amazon AWS S3? • 11 months ago

Martinbean, that is an excellent suggestion as well, I will definitely look into that as well!

hellomars left a reply on How Do I Save Laravel.log To Amazon AWS S3? • 11 months ago

Hi Dry7, interesting. So instead of having it saved directly, it saves it every hour. This way, I could also modify the output name. I think this feature is worthwhile investigating. I'll wait for a couple of days and if no other (maybe better?) option is available, I'll mark your answer as the best!

hellomars started a new conversation How Do I Save Laravel.log To Amazon AWS S3? • 11 months ago

Dear users,

I would like to save my laravel.log to S3. I have created a bucket on S3 and able to read and save a sample text file on S3 using Tinker.

I've changed the local storage line in config\filesystems.php from:

'default' => env('FILESYSTEM_DRIVER', 'local'),

to

 'default' => env('FILESYSTEM_CLOUD', 's3'),

But I still get a new log file in the local storage folder.... Who knows how to get this into S3?

4th October, 2017

hellomars left a reply on Laravel Spark - CSRF Token Mismatch On POST Requests To /api/* • 11 months ago

I also use the API calls for Laravel 5.5 and Spark 5 but my API exceptions piece of code looks like:

''' protected $except = [ 'api/*', ]; '''

So without the / before api

3rd October, 2017

hellomars started a new conversation Create/Send Spark Invoice For Single Payment Does A Faulty Redirect • 11 months ago

Dear sparkers,

I wanted to create invoices for single payments and after some Googling, I found out I can use some Spark code to perform this:

''' \Stripe\Stripe::setApiKey(\Illuminate\Support\Facades\Config::get('services.stripe.secret')); $invoice_item = \Stripe\InvoiceItem::create([ 'customer' => $user->stripe_id, 'amount' => $new_credits, 'currency' => 'usd', 'description' => 'Single Charge' ]);

$invoice = \Stripe\Invoice::create([
  'customer' => $user->stripe_id
]);

$invoice = \Stripe\Invoice::retrieve($invoice->id);
$charge = $invoice->pay();

'''

The $charge variable is a boolean, so I use that to check to see if the payment went ok:

''' if ($charge) { $this->sendInvoiceNotification($user, $invoice); return Redirect::to('credits/cc')->with('success', 'Successfully obtained ' . $new_credits . ' credits'); } '''

However, when I specifically call the sendInvoiceNotification method (which I also borrowed from Spark...) everything seems fine except for the fact the Redirect to /credits/cc is not performed and a GET request to the route that brought us in this method (except using a POST). So the last Redirect line is never reached..

This is the sendInvoiceNotification method I borrowed:

''' function sendInvoiceNotification($billable, $invoice){

$emailView = 'spark::settings.invoices.emails.invoice';

$invoiceData = Spark::invoiceDataFor($billable);

$data = compact('billable', 'invoice', 'invoiceData');

Mail::send($emailView, $data, function ($message) use ($billable, $invoice, $invoiceData) {
  $this->buildInvoiceMessage($message, $billable, $invoice, $invoiceData);
});

}

function buildInvoiceMessage($message, $billable, $invoice, array $invoiceData) { $localInvoice = $billable->localInvoices()->where('provider_id', $invoice->id)->firstOrFail(); $invoiceData['id'] = $localInvoice->id; $message->to($billable->email, $billable->name) ->subject($invoiceData['product'].' Invoice') ->attachData($invoice->pdf($invoiceData), 'invoice.pdf');

} '''

Anyone any idea? I can comment out the sendInvoiceNotification and the invoice is still saved in the db but no pdf is mailed to the user...

13th September, 2017

hellomars left a reply on After Subscribing, Only The Cancel Button. After Cancelling No Subcription Options • 1 year ago

Allright, I tried it again by copying everything one for one, in a different order as compared to my previous attempts. I found a stupid error in my User.php object. Interestingly, it wasn't a real problem during other functionalities of the tool but seemed only to be an issue when having a subscription.

Interestingly, the error does not point in the direction of the problem at all. Although I really like the functionalities of Spark, I do see it as a black box that I don't want to tinker with. In addition, it sure makes me appreciate a full blown IDE (like Netbeans when programming in Java) ... so many stupid errors happen that would've been picked up... anyway, case closed.

hellomars started a new conversation After Subscribing, Only The Cancel Button. After Cancelling No Subcription Options • 1 year ago

Dear sparkers,

I've had an issue with Spark and Laravel 5.4 which I thought could be fixed after updating to 5.5. The problem is that after subscribing to a plan only the CANCEL button is available. No options to start another plan. If I press the CANCEL button, the whole subscription page is empty. If I press F12, i have the following 2 errors:

app.js:42273 [Vue warn]: Error in render function: "TypeError: Cannot read property 'name' of undefined"

found in

---> <SparkResumeSubscription>
      <SparkSubscription>
        <SparkSettings>
          <Root>

warn @ app.js:42273
app.js:42360 TypeError: Cannot read property 'name' of undefined
   at Proxy.render (eval at createFunction (app.js:51714), <anonymous>:2:35887)
   at VueComponent.Vue._render (app.js:45981)
   at VueComponent.updateComponent (app.js:44369)
   at Watcher.get (app.js:44710)
   at new Watcher (app.js:44699)
   at mountComponent (app.js:44373)
   at VueComponent.Vue$3.$mount (app.js:49763)
   at VueComponent.Vue$3.$mount (app.js:51953)
   at init (app.js:45352)
   at createComponent (app.js:46994)

To see if it persists in Laravel 5.5 & Spark, I first created a vanilla Spark website and added the Stripe credentials. I fixed the subscription plan ids to the ones from Stripe and everything worked fine. I could start a subscription, cancel it and resume after cancelling.

I next tried to incrementally copy my files to the new page. I tried to test as soon as I implemented a small update. However, some of the single copy actions required quite a lot of downstream copy actions. After a while, I stumbled across the same problem as before. So I am running out of options.

Anyone else have an idea how to tackle this?

Thanks in advance,

6th September, 2017

hellomars left a reply on Uncaught ReferenceError: Spark Is Not Defined • 1 year ago

Thanks Cronix, you were absolutely right. I began copying all of the necessary files and found a duplicated code block containing references to js files that was not placed correctly. I'll also wait updating my Spark application until the final version will arrive.

hellomars left a reply on Uncaught ReferenceError: Spark Is Not Defined • 1 year ago

For sake of completedness, if I checkout a vanilla spark test app I can register and everything works perfect.

hellomars started a new conversation Uncaught ReferenceError: Spark Is Not Defined • 1 year ago

Hi Spark users,

I've been developing my Laravel app for some time now and decided to merge everything into Spark. I quickly realized my limited PHP/JS background was not really compatible with Spark so I tried to touch the Spark code as little as possible in order to keep things working and just use the goodies of Spark (stripe integration, user notifications etc etc.

Anyway, I think I broke it. I can open my page but can't get the drop down user menu. Chrome informs me about the following error:

Uncaught ReferenceError: Spark is not defined at Object.module.exports.el (app.js:24333) at webpack_require (app.js:20) at Object. (app.js:18567) at webpack_require (app.js:20) at Object. (app.js:51833) at webpack_require (app.js:20) at app.js:66 at app.js:69

I am using a Ubuntu installation that I build using vagrant, everything seemed to work fine. Since I wanted to update to Laravel 5.5 anyway, I decided to checkout a new Spark project and integrate all my code. After some hurdles I got it to work, but again, the same error. It's probably something very trivial, so I apologize in advance ....

Hope someone recognizes the problem...

5th September, 2017

hellomars left a reply on Spark Pay Per Use System • 1 year ago

I am currently using the following approach: users register their credit card using Stripe (or Braintree) in the settings page. Next, they can start subscriptions that will generate credits every month. Or, they can use single charges to get a certain amount of credits based on the amount of money they pay.

1st September, 2017

hellomars left a reply on [Stripe] How Do I Check If A Creditcard Is Attached? • 1 year ago

Hi Cronix, indeed the last four digits are stored but will it also be active? I guess I could always an exception and show this to the user.

hellomars left a reply on [Stripe] How Do I Check If A Creditcard Is Attached? • 1 year ago

Hi Cronix, you are right, a strip_id is indeed added to the subscription table. Out of curiosity, I deleted the creditcard on the stripe dashboard for a particular user. The stripe_id was still there (which makes sense, the consumer is still available) but the credit card fields were not empty on the Spark side. Not a very realistic scenario, but I also couldn't remove my credit card info on the Spark side.

hellomars started a new conversation [Stripe] How Do I Check If A Creditcard Is Attached? • 1 year ago

Hi spark (or cashier) developers,

I am playing around with a Spark setup and Stripe and most of the stuff is working quite well. I can add an credit card as well as start subscriptions. However, I also want users to be able to pay single payments. If a credit card has been entered, the $user->charge(100); command works perfect. However, in my single payment view I would like to know if a user has any active credit cards so that I can display a message if they are not available. Is there a way of checking this?

Thanks in advance for your reply

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.