-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some questions (HELP 😭 ) #23
Comments
Check your JS console, do you get any errors? Also, did you set the https://github.com/OFFLINE-GmbH/oc-cashier-plugin/blob/master/components/StripeElementsForm.php#L44 |
The JS error is because I am not passing the cost of the subscription I think, but I am not sure where should I define it. |
Do you have any other plugins installed? The code that generates the error does not look related to this plugin (if you search the repo there is no |
Do you have a Check your page source if you can see this code (once the placeholder is added to the layout): |
Alright, then start debugging. Add some console.logs or use your brower's script debugger. Check to see if the |
So everything seems to be working as expected, but for some reason the iframe is invisible. Please check that no browser extension is removing the frame. Also disable any CSS styles that might interfere with the iframe. According to your screenshot above everything is working fine |
You're right, my css is not working properly with the iframe. I disabled my css and now I can put the credit card, expiration date and zip code, but when I hit the pay with card button, it returns an empty array, I am using a test credit card from https://stripe.com/docs/testing#regulatory-cards |
Also I am wondering, how to specify the subscription price? I mean in Stripe Dashboard I set up a product (which is a subscription) but I'm confused about how to set it up with the plugin, also there are some special things the website that needs extra payment, for example, subscribed users can download anything but special songs if they want those special songs they have to single pay for them. |
AFAIK you set that on Stripe's end by creating a product. As for how to assign it to a user, check out Laravel Cashier's docs (this plugin is just a wrapper around it): The code from the docs could be executed in the
You can easily check if a user has a subscription by calling
Single charges are supported by Cashier as well: https://laravel.com/docs/8.x/billing#single-charges |
Thank you, I am working on what you said. Why the Is the subscription needed component validating that the payment was successful? Because I created a subscription with pending payment, and I was allowed to navigate to a restricted area. |
I think I have to modify this event offline.cashier::subscription.check but I am not pretty sure how to specify that only return true with succesful payments. How can I access to the payment error, so I can tell the user what happened? |
IIRC this is used if the user has cancelled the subscription. Empty = the subscription is active and not cancelled.
We simply redirect the call to Cashier's https://github.com/OFFLINE-GmbH/oc-cashier-plugin/blob/master/components/NeedsSubscription.php#L48
You can use the webhook events to react to failed payments: For example: Event::listen('offline.cashier::stripe.webhook.invoice.payment_failed', function ($payload, $request) {
$subscription = $payload['data']['object']['subscription'];
try {
$user = User::fromSubscriptionId($subscription);
// Do something with $user
} catch (\Exception $e) {
// do nothing.
}
logger()->error('Payment failed', compact('user', 'payload'));
}); |
Hi,
So, I have a project with a deadline for this next monday 😆 and I haven't integrated stripe yet. I think this plugin accomplishes all I need but I am having some difficulties trying to set it up properly.
When I try to use the stripeElementsForm component, I am getting this:
Am I missing a CSS or something like that?
Also, is just a credit card field enough to get a subscription? I thought I would need something like this:
Would it be possible to get in touch with you through slack, telegram, discord, or any channel where I could bother you a bit with some questions? This is a rush and I'd love to have some quick answers (I swear I won't bother you a lot).
NOTE: I have already set up the raindlab user plugin and all that. Now I need to allow those users to pay a monthly subscription, if they are not subscribed they will be redirected to a payment page.
Please, Help 😭
The text was updated successfully, but these errors were encountered: