• 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

Input and output values for php into the browser?

Fatal error: Trait 'LaminasDbAdapterLaminasDbAdapterAdapterInterface' not found in /var/www/vendor/laminas/laminas-db/src/Adapter/Adapter.php

PHP's array_map including keys

How to disable only_full_group_by option in Laravel

CodeIgniter force_download is not working

How to show a popup modal in codeIgniter?

Best way to scrolldown onpageload

Laravel 5 session not persisting after user is logged in

How to remove Deprecated SymfonyComponentDebugDebugClassLoader?

Required field only if another field has a value, must be empty otherwise

AJAX call fails with SyntaxError: Unexpected end of JSON input

Boolean assignment operators in PHP

How to execute sql code based on fetch array

Smarty if isset

Navigation idle on content download

About Contact Privacy policy Terms and conditions