php Dockerfile para probarunainstalaciónlimpiadel SDK de MercadoPago para php,requiere crear un

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php Dockerfile para probarunainstalaciónlimpiadel SDK de MercadoPago para php,requiere crear un相关的知识,希望对你有一定的参考价值。

docker build -t mp_php_1x -f php.dockerfile .
FROM phpdockerio/base

RUN apt-get update
RUN apt-get -y install apt-utils
RUN apt-get -y install locales

# PHP installation section
RUN apt-get install -y curl 

RUN apt-get update \
    && apt-get -y --no-install-recommends install php5-fpm \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*

RUN php -v

RUN apt-get -y install php5-curl

# Composer installation section
RUN apt-get update && \
    apt-get install -y --no-install-recommends git zip
RUN curl --silent --show-error https://getcomposer.org/installer | php

# Mercado Pago SDK installation section
RUN php composer.phar require "mercadopago/dx-php:1.1.8"

WORKDIR /scripts
docker run --rm --name mp_php_1x_env  -v $(pwd)/script/:/scripts -it mp_php_1x /bin/bash
<?php

    require '/vendor/autoload.php';

    # AccessToken
    MercadoPago\SDK::setAccessToken("YOUR_ACCESS_TOKEN"); 

    # Or Live Credentiales
    # MercadoPago\SDK::setClientId("YOUR_CLIENT_ID");
    # MercadoPago\SDK::setClientSecret("YOUR_CLIENT_SECRET");

    # Your snippet goes here

    $payment = new MercadoPago\Payment();

    $payment->transaction_amount = 141;
    $payment->token = "YOUR_CARD_TOKEN";
    $payment->description = "Ergonomic Silk Shirt";
    $payment->installments = 1;
    $payment->payment_method_id = "visa";
    $payment->payer = array(
      "email" => "larue.nienow@hotmail.com"
    );

    $payment->save();
    
    echo "hola mundo";

?>

以上是关于php Dockerfile para probarunainstalaciónlimpiadel SDK de MercadoPago para php,requiere crear un的主要内容,如果未能解决你的问题,请参考以下文章

php array de timezones para php

html php value para javascript

PHP codigo para postgresql

PHP crear slugs para titulos

PHP可变参数

PHP-可变参数