• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

The "client_reference_id" argument is not passed

phpstripe-payments


PHP Snippet 1:

class CheckoutController < ApplicationController

PHP Snippet 2:

cart = Cart.find(params[:id])
session = Stripe::Checkout::Session.create({
    payment_method_types: ['card'],
    line_items: [{
        description: "Your product description",
        name: "Name",
        amount: 1999,
        currency: 'eur',
        quantity: 1,
    }],
    
    client_reference_id: cart.id,
    mode: 'payment',
    success_url: root_url,
    cancel_url: root_url,
})

redirect_to session.url, allow_other_host: true

Related Snippets

Increase value by 1 on button click

Target class controller does not exist - Laravel 8

Merge column values from two arrays to form an indexed array of associative arrays

Undefined Array Key error when uploading image on php

Laravel insert dynamic input values with radio button

Reducing authentication calls on external API (Laravel 5.6)

Whats the point of running Laravel with the command 'php artisan serve'?

Form Validation and Submission to database

How to keep value of selected value after form submission?

Webscraping Symfony/Panther: Can't get HTML

Override default Auth routes in Laravel 7

image source not readable

Doctrine ORM: Excluding Records Based on Values of Nested Relationships

"Mixed content blocked" when running an HTTP AJAX operation in an HTTPS page

Only on Firefox "Loading failed for the <script> with source"

About Contact Privacy policy Terms and conditions