Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search pay #7

Open
wants to merge 32 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
205d52b
inicio
logico-mp Jul 28, 2021
466598f
s
logico-mp Sep 20, 2021
22f516b
creacion register_pay
romgabriel Sep 24, 2021
3308885
Merge pull request #1 from lucianotv12/register_pay
logico-mp Sep 24, 2021
5d78f86
correccion silent pay GR
romgabriel Sep 28, 2021
1faa7c5
subir solo token
romgabriel Oct 1, 2021
6b403db
solo token gr
romgabriel Oct 1, 2021
43bdca2
Merge pull request #2 from lucianotv12/silent-pay
romgabriel Oct 1, 2021
97c061f
pago en un clic
romgabriel Oct 1, 2021
fdb2601
Merge pull request #3 from lucianotv12/silent-pay
romgabriel Oct 1, 2021
d45656a
update pay
romgabriel Oct 4, 2021
ed3fd35
Merge pull request #4 from lucianotv12/silent-pay
logico-mp Oct 4, 2021
95479ca
funcion
romgabriel Oct 5, 2021
787bd37
Merge pull request #5 from lucianotv12/silent-pay
logico-mp Oct 5, 2021
3012b50
s
logico-mp Oct 7, 2021
ca9f020
creacion cancel Pay
romgabriel Oct 12, 2021
6bee771
s
logico-mp Oct 14, 2021
6e313ac
Update createSilentPay.php
klein994 Oct 15, 2021
b1bd4eb
s
logico-mp Oct 15, 2021
a04361a
s
logico-mp Oct 15, 2021
a40f512
Create cancelPay.php
romgabriel Oct 18, 2021
362666d
Merge branch 'master' of https://github.com/lucianotv12/lyra
romgabriel Oct 18, 2021
93b17fb
refund
romgabriel Oct 20, 2021
34423d7
Merge branch 'master' into silent-pay
romgabriel Oct 20, 2021
bd70ed4
Merge pull request #7 from lucianotv12/silent-pay
logico-mp Oct 20, 2021
416de61
require
romgabriel Oct 20, 2021
8e5446c
Merge pull request #8 from lucianotv12/silent-pay
logico-mp Oct 20, 2021
91aad32
correccion mail
romgabriel Oct 20, 2021
d357eaa
Merge pull request #9 from lucianotv12/silent-pay
logico-mp Oct 20, 2021
81f0c59
cuotas silent pay
romgabriel Nov 2, 2021
d79262e
update cancel pay
logico-mp Jan 24, 2022
b3fe419
search_pay
romgabriel Jan 24, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,10 @@
.DS_Store
www/tests
sync.sh
/nbproject/private/
.idea/lyra.iml
.idea/misc.xml
.idea/modules.xml
.idea/php.xml
.idea/vcs.xml
.idea/workspace.xml
7 changes: 7 additions & 0 deletions nbproject/project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
include.path=${php.global.include.path}
php.version=PHP_73
source.encoding=UTF-8
src.dir=.
tags.asp=false
tags.short=false
web.root=.
9 changes: 9 additions & 0 deletions nbproject/project.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.php.project</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/php-project/1">
<name>lyra</name>
</data>
</configuration>
</project>
47 changes: 47 additions & 0 deletions www/PagoUnClic.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?php
/**
* I initialize the PHP SDK
*/
require_once __DIR__ . '/vendor/autoload.php';
require_once __DIR__ . '/keys.php';
require_once __DIR__ . '/helpers.php';
/**
* Initialize the SDK
* see keys.php
*/
$client = new Lyra\Client();
$total = number_format($total_final, 2, '', '');
$token = $payToken;
//$total = $total . 0000;
if (isset($_GET['requestObject'])) {
$store = json_decode($_GET['requestObject']);
} else {
$store = array( "amount" => $total,
"currency" => "ARS",
"paymentMethodToken"=> $token
);
}



/**
* I create a formToken
*/

$response = $client->post("V4/Charge/CreatePayment", $store);

//* I check if there are some errors */
if ($response['status'] != 'SUCCESS') {
/* an error occurs */
$error = $response['answer'];
header("Content-Type", "application/json");
header('HTTP/1.1 500 Internal Server Error');
echo '{"error": "' . $error['errorCode'] . '", "_type": "DemoError" }';
die();
}

/* everything is fine, I extract the formToken */
$Token = $response["answer"]["paymentMethodToken"];
//header("Content-Type", "application/json");
//echo '{"formToken": "' . $formToken . '"", "_type": "DemoFormToken" }';

48 changes: 48 additions & 0 deletions www/SearchPay.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php
/**
* I initialize the PHP SDK
*/
require_once __DIR__ . '/vendor/autoload.php';
require __DIR__ . '/keys.php';
require_once __DIR__ . '/helpers.php';
/**
* Initialize the SDK
* see keys.php
*/

$client = new Lyra\Client();
//$total = number_format($total_final, 2, '', '');
$token = $payToken;
//$total = $total . 0000;
if (isset($_GET['requestObject'])) {
$store = json_decode($_GET['requestObject']);
} else {
$store = array(
"paymentMethodToken"=> $token,
);
}

//print_r($store);

/**
* I create a formToken
*/

$response = $client->post("V4/Token/Get", $store);

//* I check if there are some errors */
if ($response['status'] != 'SUCCESS') {
/* an error occurs */
$error = $response['answer'];
header("Content-Type", "application/json");
header('HTTP/1.1 500 Internal Server Error');
echo '{"error": "' . $error['errorCode'] . '", "_type": "DemoError" }';
die();
}

/* everything is fine, I extract the formToken */
$Token = $response["answer"]["paymentMethodToken"];

//header("Content-Type", "application/json");
//echo '{"formToken": "' . $formToken . '"", "_type": "DemoFormToken" }';

45 changes: 45 additions & 0 deletions www/cancelPay.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php
/**
* I initialize the PHP SDK
*/
require_once __DIR__ . '/vendor/autoload.php';
require __DIR__ . '/keys.php';
require_once __DIR__ . '/helpers.php';
/**
* Initialize the SDK
* see keys.php
*/
$client = new Lyra\Client();


//$total = $total . 0000;
if (isset($_GET['requestObject'])) {
$store = json_decode($_GET['requestObject']);
} else {
$store = array( "amount" => $total,
"currency" => "$currency",
"uuid" => $uuid
);
}

/**
* I create a formToken
*/

$responseCancel = $client->post("V4/Transaction/CancelOrRefund", $store);

//* I check if there are some errors */
if ($responseCancel['status'] != 'SUCCESS') {
/* an error occurs */
// $error = $responseCancel['answer'];
// header("Content-Type", "application/json");
// header('HTTP/1.1 500 Internal Server Error');
// echo '{"error": "' . $error['errorCode'] . '", "_type": "DemoError" }';
// die();
}

/* everything is fine, I extract the formToken */
//$formToken = $responseCancel["answer"]["formToken"];
//header("Content-Type", "application/json");
//echo '{"formToken": "' . $formToken . '"", "_type": "DemoFormToken" }';

71 changes: 71 additions & 0 deletions www/createRegisterPay.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<?php
/**
* I initialize the PHP SDK
*/
require_once __DIR__ . '/vendor/autoload.php';
require_once __DIR__ . '/keys.php';
require_once __DIR__ . '/helpers.php';
/**
* Initialize the SDK
* see keys.php
*/
function create_pagos(string $tipoForm, float $monto, $compra, string $token = null) {
$client = new Lyra\Client();

$total = number_format($monto, 2, '', '');
$paytoken = $token;

if (isset($_GET['requestObject'])) {
$store = json_decode($_GET['requestObject']);
} else {
switch ($tipoForm){
case "REGISTER_PAY":
$store = array( "amount" => $total,
"formAction" => "REGISTER_PAY",
"currency" => "ARS",
"orderId" => uniqid($compra->get_id()),
"customer" => array(
"email" => $compra->get_idUser()->get_email()

));
break;

case "SILENT":
$store = array( "amount" => $total,
"currency" => "ARS",
"paymentMethodToken"=> $paytoken,
"formAction" => "SILENT",
"orderId" => uniqid($compra->get_id()),
"customer" => array(
"email" => $compra->get_idUser()->get_email(),
"reference"=> "12345678"
)
);
break;
}

}

$response = $client->post("V4/Charge/CreatePayment", $store);

//* I check if there are some errors */
if ($response['status'] != 'SUCCESS') {
/* an error occurs */
$error = $response['answer'];
header("Content-Type", "application/json");
header('HTTP/1.1 500 Internal Server Error');
echo '{"error": "' . $error['errorCode'] . '", "_type": "DemoError" }';
die();
}

/* everything is fine, I extract the formToken */
$formToken = $response["answer"]["formToken"];
//header("Content-Type", "application/json");
//echo '{"formToken": "' . $formToken . '"", "_type": "DemoFormToken" }';

}





54 changes: 54 additions & 0 deletions www/createSilentPay.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?php
/**
* I initialize the PHP SDK
*/
require_once __DIR__ . '/vendor/autoload.php';
require __DIR__ . '/keys.php';
require_once __DIR__ . '/helpers.php';
/**
* Initialize the SDK
* see keys.php
*/

$client = new Lyra\Client();
$total = number_format($total_final, 2, '', '');
$token = $payToken;
//$total = $total . 0000;
if (isset($_GET['requestObject'])) {
$store = json_decode($_GET['requestObject']);
} else {
$store = array( "amount" => $total,
"currency" => "ARS",
"paymentMethodToken"=> $token,
"formAction" => "SILENT",

"transactionOptions"=> array(
"cardOptions"=> array("installmentNumber"=> $silent_cuotas)
)
);
}

//print_r($store);

/**
* I create a formToken
*/

$responseSlient = $client->post("V4/Charge/CreatePayment", $store);

//* I check if there are some errors */
if ($responseSlient['status'] != 'SUCCESS') {
/* an error occurs */
$error = $responseSlient['answer'];
header("Content-Type", "application/json");
header('HTTP/1.1 500 Internal Server Error');
echo '{"error": "' . $error['errorCode'] . '", "_type": "DemoError" }';
die();
}

/* everything is fine, I extract the formToken */
$Token = $responseSlient["answer"]["paymentMethodToken"];

//header("Content-Type", "application/json");
//echo '{"formToken": "' . $formToken . '"", "_type": "DemoFormToken" }';

21 changes: 12 additions & 9 deletions www/createToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,24 @@
*/
require_once __DIR__ . '/vendor/autoload.php';
require_once __DIR__ . '/keys.php';

require_once __DIR__ . '/helpers.php';
/**
* Initialize the SDK
* see keys.php
*/
$client = new Lyra\Client();

$total = number_format($total_final, 2, '', '');
//$total = $total . 0000;
if (isset($_GET['requestObject'])) {
$store = json_decode($_GET['requestObject']);
} else {
$store = array( "amount" => 250,
"currency" => "EUR",
"orderId" => uniqid("MyOrderId"),
$store = array( "amount" => $total,
"formAction" => "REGISTER_PAY",
"currency" => "ARS",
"orderId" => uniqid($compra->get_id()),
"customer" => array(
"email" => "[email protected]"
));
"email" => $_usuario->get_email())
);
}

/**
Expand All @@ -40,5 +42,6 @@

/* everything is fine, I extract the formToken */
$formToken = $response["answer"]["formToken"];
header("Content-Type", "application/json");
echo '{"formToken": "' . $formToken . '"", "_type": "DemoFormToken" }';

//header("Content-Type", "application/json");
//echo '{"formToken": "' . $formToken . '"", "_type": "DemoFormToken" }';
23 changes: 18 additions & 5 deletions www/keys.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,25 @@
*/

/* Username, password and endpoint used for server to server web-service calls */
Lyra\Client::setDefaultUsername("69876357");
Lyra\Client::setDefaultPassword("testpassword_DEMOPRIVATEKEY23G4475zXZQ2UA5x7M");
Lyra\Client::setDefaultEndpoint("https://api.payzen.eu");
//Lyra\Client::setDefaultUsername("31916241");
//Lyra\Client::setDefaultPassword("testpassword_KmsHiyWyJEaMBn5sO2gLdxYyVjMZKPBSaDDSuOrMuXikD");
//Lyra\Client::setDefaultEndpoint("https://api.payzen.lat/");
//
///* publicKey and used by the javascript client */
//Lyra\Client::setDefaultPublicKey("31916241:testpassword_KmsHiyWyJEaMBn5sO2gLdxYyVjMZKPBSaDDSuOrMuXikD");
//
///* SHA256 key */
////sha1(31916241:testpassword_KmsHiyWyJEaMBn5sO2gLdxYyVjMZKPBSaDDSuOrMuXikD)
Lyra\Client::setDefaultSHA256Key($claveSHA256);

/* Username, password and endpoint used for server to server web-service calls */
Lyra\Client::setDefaultUsername($shopID);
Lyra\Client::setDefaultPassword($clave);
Lyra\Client::setDefaultEndpoint($endPoint);
//Lyra\Client::setDefaultEndpoint("https://static.payzen.lat");

/* publicKey and used by the javascript client */
Lyra\Client::setDefaultPublicKey("69876357:testpublickey_DEMOPUBLICKEY95me92597fd28tGD4r5");
Lyra\Client::setDefaultPublicKey($publicKey);

/* SHA256 key */
Lyra\Client::setDefaultSHA256Key("38453613e7f44dc58732bad3dca2bca3");
Lyra\Client::setDefaultSHA256Key($claveSHA256);
Loading