dbxapp 4.1.3
CMS, Shop, Workflows und modulare Geschäftsanwendungen
Loading...
Searching...
No Matches
payment_validation_test.php File Reference

Go to the source code of this file.

Variables

 $fail
 $order
 $paypalResult
 $paypal = new dbxShopPayPal()
 try
catch(Throwable $e) $badPayPal = $paypalResult
 $badPayPal ['purchase_units'][0]['payments']['captures'][0]['amount']['value'] = '19.90'
catch(RuntimeException $e) $amazonResult
 $amazon = new dbxShopAmazonPay()
 if ( $status !=='completed') $fail( 'Amazon-Pay-Status wurde falsch normalisiert.'
catch(Throwable $e) $badAmazon = $amazonResult
 $badAmazon ['merchantMetadata']['merchantReferenceId'] = 'ANDERE-BESTELLUNG'
catch(RuntimeException $e) $paypalSource = file_get_contents(dirname(__DIR__) . '/include/dbxShopPayPal.class.php')
 $amazonSource = file_get_contents(dirname(__DIR__) . '/include/dbxShopAmazonPay.class.php')
 if (strpos((string) $paypalSource, 'PayPal-Request-Id:dbx-')===false||strpos((string) $amazonSource, "'checkout|' . (string)(\$order['order_no'] ?? '')")===false)

Variable Documentation

◆ $amazon

$amazon = new dbxShopAmazonPay()

Definition at line 61 of file payment_validation_test.php.

◆ $amazonResult

catch (RuntimeException $e) $amazonResult
Initial value:
= array(
'_http_status' => 200,
'checkoutSessionId' => 'AMAZON-SESSION-1',
'statusDetails' => array('state' => 'Completed'),
'merchantMetadata' => array('merchantReferenceId' => 'S-SECURITY-1'),
'paymentDetails' => array(
'chargeAmount' => array('amount' => '119.90', 'currencyCode' => 'EUR'),
),
)

Definition at line 51 of file payment_validation_test.php.

◆ $amazonSource

$amazonSource = file_get_contents(dirname(__DIR__) . '/include/dbxShopAmazonPay.class.php')

Definition at line 79 of file payment_validation_test.php.

◆ $badAmazon [1/2]

$badAmazon[ 'merchantMetadata'][ 'merchantReferenceId'] = 'ANDERE-BESTELLUNG'

Definition at line 70 of file payment_validation_test.php.

◆ $badAmazon [2/2]

catch (Throwable $e) $badAmazon = $amazonResult

Definition at line 69 of file payment_validation_test.php.

◆ $badPayPal [1/2]

$badPayPal[ 'purchase_units'][0][ 'payments'][ 'captures'][0][ 'amount'][ 'value'] = '19.90'

Definition at line 43 of file payment_validation_test.php.

◆ $badPayPal [2/2]

catch (Throwable $e) $badPayPal = $paypalResult

Definition at line 42 of file payment_validation_test.php.

◆ $fail

$fail
Initial value:
= static function (string $message, int $code): void {
fwrite(STDERR, "FAIL: $message\n");
exit($code);
}
exit
Definition index.php:146

Definition at line 9 of file payment_validation_test.php.

◆ $order

◆ $paypal

$paypal = new dbxShopPayPal()

Definition at line 35 of file payment_validation_test.php.

◆ $paypalResult

$paypalResult
Initial value:
= array(
'id' => 'PAYPAL-ORDER-1',
'status' => 'COMPLETED',
'purchase_units' => array(array(
'reference_id' => 'S-SECURITY-1',
'invoice_id' => 'S-SECURITY-1',
'payments' => array('captures' => array(array(
'id' => 'CAPTURE-1',
'status' => 'COMPLETED',
'amount' => array('value' => '119.90', 'currency_code' => 'EUR'),
))),
)),
)

Definition at line 21 of file payment_validation_test.php.

◆ $paypalSource

catch (RuntimeException $e) $paypalSource = file_get_contents(dirname(__DIR__) . '/include/dbxShopPayPal.class.php')

Definition at line 78 of file payment_validation_test.php.

◆ if [1/2]

if($status !=='completed') $fail('Amazon-Pay-Status wurde falsch normalisiert.' ( $status ! = = 'completed')

Definition at line 64 of file payment_validation_test.php.

◆ if [2/2]

if(strpos((string) $paypalSource, 'PayPal-Request-Id:dbx-')===false||strpos((string) $amazonSource, "'checkout|' . (string)(\$order['order_no'] ?? '')")===false) ( strpos((string) $paypalSource, 'PayPal-Request-Id:dbx-') = == false || strpos((string)$amazonSource, "'checkout|' . (string)(\$order['order_no'] ?? '')") === false)

Definition at line 80 of file payment_validation_test.php.

◆ try

try
Initial value:
{
$paypal->validateCapture($paypalResult, $order, 'PAYPAL-ORDER-1')

Definition at line 36 of file payment_validation_test.php.