@@ -399,28 +399,28 @@ Output:
399399
400400#### Introduction <a name =" introduction-jwe " ></a >
401401
402- The core methods responsible for payload encryption and decryption are ` encryptPayload ` and ` decryptPayload ` in the ` JWEEncryption ` class.
402+ The core methods responsible for payload encryption and decryption are ` encryptPayload ` and ` decryptPayload ` in the ` JweEncryption ` class.
403403
404404* ` encryptPayload ` usage:
405405``` php
406406use Mastercard\Developer\Encryption;
407407// …
408- $encryptedRequestPayload = JWEEncryption ::encryptPayload($requestPayload, $config);
408+ $encryptedRequestPayload = JweEncryption ::encryptPayload($requestPayload, $config);
409409```
410410
411411* ` decryptPayload ` usage:
412412``` php
413413use Mastercard\Developer\Encryption;
414414// …
415- $responsePayload = JWEEncryption ::decryptPayload($encryptedResponsePayload, $config);
415+ $responsePayload = JweEncryption ::decryptPayload($encryptedResponsePayload, $config);
416416```
417417
418418#### Configuring the JWE Encryption <a name =" configuring-the-JWE-encryption " ></a >
419- Use the ` JWEEncryptionConfigBuilder ` to create ` JWEEncryptionConfig ` instances. Example:
419+ Use the ` JweEncryptionConfigBuilder ` to create ` JweEncryptionConfig ` instances. Example:
420420``` php
421421use Mastercard\Developer\Encryption;
422422// …
423- $config = FieldLevelEncryptionConfigBuilder::aFieldLevelEncryptionConfig ()
423+ $config = JweEncryptionConfigBuilder::aJweEncryptionConfig ()
424424 ->withEncryptionCertificate($encryptionCertificate)
425425 ->withDecryptionKey($decryptionKey)
426426 ->withEncryptionPath('$.path.to.foo', '$.path.to.encryptedFoo')
@@ -436,7 +436,7 @@ See also:
436436
437437#### Performing Encryption <a name =" performing-encryption-jwe " ></a >
438438
439- Call ` JWEEncryption ::encryptPayload` with a JSON request payload and a ` JWEEncryptionConfig ` instance.
439+ Call ` JweEncryption ::encryptPayload` with a JSON request payload and a ` JweEncryptionConfig ` instance.
440440
441441Example using the configuration [ above] ( #configuring-the-JWE-encryption ) :
442442``` php
@@ -452,7 +452,7 @@ $payload = '{
452452 }
453453 }
454454}';
455- $encryptedPayload = JWEEncryption ::encryptPayload($payload, $config);
455+ $encryptedPayload = JweEncryption ::encryptPayload($payload, $config);
456456echo (json_encode(json_decode($encryptedPayload), JSON_PRETTY_PRINT));
457457```
458458
@@ -470,7 +470,7 @@ Output:
470470
471471#### Performing Decryption <a name =" performing-decryption-jwe " ></a >
472472
473- Call ` JWEEncryption ::decryptPayload` with a JSON response payload and a ` JWEEncryptionConfig ` instance.
473+ Call ` JweEncryption ::decryptPayload` with a JSON response payload and a ` JweEncryptionConfig ` instance.
474474
475475Example using the configuration [ above] ( #configuring-the-JWE-encryption ) :
476476``` php
@@ -485,7 +485,7 @@ $encryptedPayload = '{
485485 }
486486 }
487487}';
488- $payload = JWEEncryption ::decryptPayload($encryptedPayload, $config);
488+ $payload = JweEncryption ::decryptPayload($encryptedPayload, $config);
489489echo (json_encode(json_decode($payload), JSON_PRETTY_PRINT));
490490```
491491
@@ -510,7 +510,7 @@ Entire payloads can be encrypted using the '$' operator as encryption path:
510510``` php
511511use Mastercard\Developer\Encryption;
512512// …
513- $config = JWEConfigBuilder::aFieldLevelEncryptionConfig ()
513+ $config = JweConfigBuilder::aJweEncryptionConfig ()
514514 ->withEncryptionCertificate(encryptionCertificate)
515515 ->withEncryptionPath('$', '$')
516516 ->withEncryptedValueFieldName("encryptedValue")
@@ -526,7 +526,7 @@ $payload = '{
526526 "sensitiveField1": "sensitiveValue1",
527527 "sensitiveField2": "sensitiveValue2"
528528}';
529- $encryptedPayload = JWEEncryption ::encryptPayload($payload, $config);
529+ $encryptedPayload = JweEncryption ::encryptPayload($payload, $config);
530530echo (json_encode(json_decode($encryptedPayload), JSON_PRETTY_PRINT));
531531```
532532
@@ -544,7 +544,7 @@ Entire payloads can be decrypted using the '$' operator as decryption path:
544544``` php
545545use Mastercard\Developer\Encryption;
546546// …
547- $config = JWEEncryptionConfigBuilder::aFieldLevelEncryptionConfig ()
547+ $config = JweEncryptionConfigBuilder::aJweEncryptionConfig ()
548548 ->withDecryptionKey(decryptionKey)
549549 ->withDecryptionPath('$', '$')
550550 ->withEncryptedValueFieldName("encryptedValue")
@@ -634,12 +634,12 @@ use Mastercard\Developer\Interceptors\PsrHttpMessageEncryptionInterceptor;
634634
635635$stack = new GuzzleHttp\HandlerStack();
636636$stack->setHandler(new GuzzleHttp\Handler\CurlHandler());
637- $jweEncryptionConfig = JWEEncryptionConfigBuilder::aJWEEncryptionConfig ()
637+ $JweEncryptionConfig = JweEncryptionConfigBuilder::aJweEncryptionConfig ()
638638 // …
639639 ->build();
640- $jweEncryptionInterceptor = new PsrHttpMessageEncryptionInterceptor($jweEncryptionConfig );
641- $stack->push(GuzzleHttp\Middleware::mapRequest([$jweEncryptionInterceptor , 'interceptRequest']));
642- $stack->push(GuzzleHttp\Middleware::mapResponse([$jweEncryptionInterceptor , 'interceptResponse']));
640+ $JweEncryptionInterceptor = new PsrHttpMessageEncryptionInterceptor($JweEncryptionConfig );
641+ $stack->push(GuzzleHttp\Middleware::mapRequest([$JweEncryptionInterceptor , 'interceptRequest']));
642+ $stack->push(GuzzleHttp\Middleware::mapResponse([$JweEncryptionInterceptor , 'interceptResponse']));
643643$stack->push(GuzzleHttp\Middleware::mapRequest([new PsrHttpMessageSigner($consumerKey, $signingKey), 'sign']));
644644$options = ['handler' => $stack];
645645$client = new GuzzleHttp\Client($options);
0 commit comments