static::
assertJson($body);
$content =
json_decode($body, true, 512, \JSON_THROW_ON_ERROR
);
static::
assertArrayHasKey('source',
$content);
static::
assertSame([ 'url' =>
$this->shopUrl,
'shopId' =>
$this->shopIdProvider->
getShopId(),
'appVersion' => '1.0.0',
],
$content['source'
]);
static::
assertArrayHasKey('refund',
$content);
static::
assertIsArray($content['refund'
]);
$this->
assertRefundState(OrderTransactionCaptureRefundStates::STATE_COMPLETED,
$refundId);
} public function testItFailsOnErrorResponse(): void
{ $paymentMethodId =
$this->
getPaymentMethodId('refundable'
);
$orderId =
$this->
createOrder($paymentMethodId);
$transactionId =
$this->
createTransaction($orderId,
$paymentMethodId);
$captureId =
$this->
createCapture($transactionId);
$refundId =
$this->
createRefund($captureId);
$salesChannelContext =
$this->
getSalesChannelContext($paymentMethodId);