• 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

Get WooCommerce products from specific category

How to use PHPCBF to fix one issue at a time?

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'posts.post' doesn't exist

Laravel Displaying image from database

PHP Array split string and Integers

Passing PHP JSON to Javascript: echo json_encode vs echo json declaration

Inserting Country Selection into MySQL PHP [duplicate]

Laravel 4 Redirect::back() not going to previous page (refreshing current page)

PHP Form Not Inserting

Issue with laravel eloquent model property

Cannot connect to own websocket server when on secured domain

How to increase the PHP upload limits [duplicate]

VichUploaderBundle error "Expected argument of type "File", "NULL" given" when submitting the form without selecting any file

javascript html popup window

Chunk and transpose a flat array into rows with a specific number of columns

About Contact Privacy policy Terms and conditions