带有消息“ transaction_amount属性”的“ MercadoPagoException”不能为null

时间:2018-08-23 09:21:13

标签: php arrays mercadopago

我遇到错误

我想实现支付网关,但错误很像:

  

非法的字符串偏移量“代码”

     

非法字符串偏移量'description'

     

带有消息“ transaction_amount属性”的“ MercadoPagoException”不能为空

这是我的数组

$preference_data = array(
        "items" => array(
            array(
                "id" => "Code",
                "title" => $rest['name'],
                "currency_id" => "USD",
                "picture_url" =>"https://www.mercadopago.com/org-img/MP3/home/logomp3.gif",
                "description" => "Description",
                "category_id" => "Category",
                "quantity" => 1,
                "unit_price" => intval($total_price)
            )
        ),
        "payer" => array(
            "name" => "APRO".$a[0],
            "surname" => $a[1],
            "email" => "test_user_44825516@testuser.com",
            "date_created" => "2014-07-28T09:50:37.521-04:00",
            "phone" => array(
                "area_code" => "11",
                "number" => "4444-4444"
            ),
            "identification" => array(
                "type" => "DNI",
                "number" => "12345678"
            ),
            "address" => array(
                "street_name" => "Street",
                "street_number" => 123,
                "zip_code" => "1430"
            )
        ),
        "back_urls" => array(
            "success" => "http://localhost/duncan_fooddelivery/api/success.php",
            "failure" => "http://www.failure.com",
            "pending" => "http://www.pending.com"
        ),
        "auto_return" => "approved",
        "payment_methods" => array(
            "excluded_payment_methods" => array(
                array(
                    "id" => "amex",
                )
            ),
            "excluded_payment_types" => array(
                array(
                    "id" => "ticket"
                )
            ),
            "installments" => 24,
            "default_payment_method_id" => null,
            "default_installments" => null,
        ),
        "shipments" => array(
            "receiver_address" => array(
                "zip_code" => "1430",
                "street_number"=> 123,
                "street_name"=> "Street",
                "floor"=> 4,
                "apartment"=> "C"
            )
        ),
        "token" => array (
            "card_id" => NULL,
            "card_number_length" => 16,
            "cardholder" => array (
              "identification" => array (
                "number" => "11111111",
                "type" => "DNI",
              ),
              "name" => "APROARPAN BAJPAI",
            ),
            "creation_date" => NULL,
            "due_date" => NULL,
            "esc" => NULL,
            "expiration_month" => 6,
            "expiration_year" => 2022,
            "first_six_digits" => "450995",
            "id" => "ad56c2e6cb4a2b17c18e632139366a7e",
            "last_four_digits" => "3704",
            "last_modified_date" => NULL,
            "luhn_validation" => "true",
            "public_key" => "TEST-1a0ffe62-165f-4e7b-b501-df15741b6d87",
            "security_code_length" => 3,
            "status" => "active",
            "trunc_card_number" => NULL,
            "used_date" => NULL,
          ),
        "transaction_amount" => 60,
        "notification_url" => "https://www.your-site.com/ipn",
        "external_reference" => "Reference_1234",
        "expires" => false,
        "expiration_date_from" => null,
        "expiration_date_to" => null,
    );

我正在传递“ transaction_amount” => 60,但仍然收到相同的错误。

请帮助我,我从5小时开始搜索。

谢谢。

0 个答案:

没有答案