Documentation

WooRedsysAPIWS
in package

WooRedsysAPIWS class Handles encryption and communication with Redsys payment gateway via Web Services.

Table of Contents

Properties

$vars_pay  : array<string|int, mixed>
Holds the payment variables.

Methods

base64_url_decode()  : string
Decode base64 URL-safe format to original data.
base64_url_encode()  : string
Encode data to base64 URL-safe format.
create_merchant_signature_host_to_host()  : string
Create the merchant signature for host-to-host communication.
create_merchant_signature_response_host_to_host()  : string
Create the merchant signature for host-to-host response communication.
decode_base64()  : string
Decode base64 data.
encode_base64()  : string
Encode data to base64 format.
encrypt_3des()  : string
Encrypt data using 3DES.
get_order()  : string
Extract the order number from the provided data.
get_parameter()  : mixed|null
Get a parameter value.
get_tag_content()  : string
Get the content of a specific tag from the provided data.
mac256()  : string
Create HMAC SHA256 signature.
set_parameter()  : mixed
Set a parameter for the payment.

Properties

$vars_pay

Holds the payment variables.

private array<string|int, mixed> $vars_pay = array()

Methods

base64_url_decode()

Decode base64 URL-safe format to original data.

public base64_url_decode(string $input) : string
Parameters
$input : string

The encoded data.

Return values
string

The decoded data.

base64_url_encode()

Encode data to base64 URL-safe format.

public base64_url_encode(string $input) : string
Parameters
$input : string

The input data.

Return values
string

The encoded data.

create_merchant_signature_host_to_host()

Create the merchant signature for host-to-host communication.

public create_merchant_signature_host_to_host(string $key, string $ent) : string
Parameters
$key : string

The base64 encoded key.

$ent : string

The data for signature creation.

Return values
string

The base64 encoded signature.

create_merchant_signature_response_host_to_host()

Create the merchant signature for host-to-host response communication.

public create_merchant_signature_response_host_to_host(string $key, string $datos, string $num_pedido) : string
Parameters
$key : string

The base64 encoded key.

$datos : string

The data for signature creation.

$num_pedido : string

The order number.

Return values
string

The base64 encoded signature.

decode_base64()

Decode base64 data.

public decode_base64(string $data) : string
Parameters
$data : string

The encoded data.

Return values
string

The decoded data.

encode_base64()

Encode data to base64 format.

public encode_base64(string $data) : string
Parameters
$data : string

The input data.

Return values
string

The base64 encoded data.

encrypt_3des()

Encrypt data using 3DES.

public encrypt_3des(string $message, string $key) : string
Parameters
$message : string

The message to encrypt.

$key : string

The key used for encryption.

Return values
string

The encrypted message.

get_order()

Extract the order number from the provided data.

public get_order(string $datos) : string
Parameters
$datos : string

The data containing the order information.

Return values
string

The order number.

get_parameter()

Get a parameter value.

public get_parameter(string $key) : mixed|null
Parameters
$key : string

The parameter key.

Return values
mixed|null

The parameter value or null if not set.

get_tag_content()

Get the content of a specific tag from the provided data.

public get_tag_content(string $datos, string $tag) : string
Parameters
$datos : string

The data containing the tag.

$tag : string

The tag to retrieve the content from.

Return values
string

The content inside the tag.

mac256()

Create HMAC SHA256 signature.

public mac256(string $ent, string $key) : string
Parameters
$ent : string

The string to hash.

$key : string

The key used for the hash.

Return values
string

The resulting hash.

set_parameter()

Set a parameter for the payment.

public set_parameter(string $key, mixed $value) : mixed
Parameters
$key : string

The parameter key.

$value : mixed

The parameter value.


        
On this page

Search results