пошаговая интеграция платежного шлюза braintree с PHP

Я новичок в интеграции Braintree с PHP, я искал в Интернете, я не могу найти правильный вариант для реализации на моем сайте.

Может ли кто-нибудь помочь в интеграции Braintree для моего сайта с пошаговыми инструкциями, включая создание песочницы.

Заранее спасибо.

-2

Решение

<?php
require_once 'lib/Braintree.php';
Braintree_Configuration::environment('sandbox'); /* this is sandbox or production */
Braintree_Configuration::merchantId('Your ID');
Braintree_Configuration::publicKey('Your Public Key');
Braintree_Configuration::privateKey('Your Private key');

$result = Braintree_Transaction::sale(array(
'amount' => $amount,
'orderId' => 'Your Order ID' , /* It should be unique */
'creditCard' => array(
'number' =>  '41111111111111111',
'expirationDate' => '07/16',
'cardholderName' => 'NAME',
)
));

if ($result->success) {
/* your success condition */
}else if ($result->transaction) {
$msg .= "Error processing transaction:<br>" ;
$msg .="\n  code: " . $result->transaction->processorResponseCode ;
$msg .="\n  text: " . $result->transaction->processorResponseText ;
echo $msg ;
}
1

Другие решения

Других решений пока нет …

По вопросам рекламы ammmcru@yandex.ru
Adblock
detector