Skip to content

Latest commit

 

History

History
506 lines (390 loc) · 31.1 KB

File metadata and controls

506 lines (390 loc) · 31.1 KB

DigitalWallets.Sessions

Overview

Available Operations

googlePay

Create a session for use with Google Pay.

Example Usage

package hello.world;

import com.gr4vy.sdk.Gr4vy;
import com.gr4vy.sdk.models.components.GooglePaySessionRequest;
import com.gr4vy.sdk.models.errors.*;
import com.gr4vy.sdk.models.operations.CreateGooglePayDigitalWalletSessionResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws Exception {

        Gr4vy sdk = Gr4vy.builder()
                .merchantAccountId("default")
                .bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
            .build();

        CreateGooglePayDigitalWalletSessionResponse res = sdk.digitalWallets().sessions().googlePay()
                .googlePaySessionRequest(GooglePaySessionRequest.builder()
                    .originDomain("example.com")
                    .build())
                .call();

        if (res.googlePaySession().isPresent()) {
            System.out.println(res.googlePaySession().get());
        }
    }
}

Parameters

Parameter Type Required Description
merchantAccountId JsonNullable<String> The ID of the merchant account to use for this request.
googlePaySessionRequest GooglePaySessionRequest ✔️ N/A

Response

CreateGooglePayDigitalWalletSessionResponse

Errors

Error Type Status Code Content Type
models/errors/Error400 400 application/json
models/errors/Error401 401 application/json
models/errors/Error403 403 application/json
models/errors/Error404 404 application/json
models/errors/Error405 405 application/json
models/errors/Error409 409 application/json
models/errors/HTTPValidationError 422 application/json
models/errors/Error425 425 application/json
models/errors/Error429 429 application/json
models/errors/Error500 500 application/json
models/errors/Error502 502 application/json
models/errors/Error504 504 application/json
models/errors/APIException 4XX, 5XX */*

applePay

Create a session for use with Apple Pay.

Example Usage

package hello.world;

import com.gr4vy.sdk.Gr4vy;
import com.gr4vy.sdk.models.components.ApplePaySessionRequest;
import com.gr4vy.sdk.models.errors.*;
import com.gr4vy.sdk.models.operations.CreateApplePayDigitalWalletSessionResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws Exception {

        Gr4vy sdk = Gr4vy.builder()
                .merchantAccountId("default")
                .bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
            .build();

        CreateApplePayDigitalWalletSessionResponse res = sdk.digitalWallets().sessions().applePay()
                .applePaySessionRequest(ApplePaySessionRequest.builder()
                    .validationUrl("https://apple-pay-gateway-cert.apple.com")
                    .domainName("example.com")
                    .build())
                .call();

        if (res.applePaySession().isPresent()) {
            System.out.println(res.applePaySession().get());
        }
    }
}

Parameters

Parameter Type Required Description
merchantAccountId JsonNullable<String> The ID of the merchant account to use for this request.
applePaySessionRequest ApplePaySessionRequest ✔️ N/A

Response

CreateApplePayDigitalWalletSessionResponse

Errors

Error Type Status Code Content Type
models/errors/Error400 400 application/json
models/errors/Error401 401 application/json
models/errors/Error403 403 application/json
models/errors/Error404 404 application/json
models/errors/Error405 405 application/json
models/errors/Error409 409 application/json
models/errors/HTTPValidationError 422 application/json
models/errors/Error425 425 application/json
models/errors/Error429 429 application/json
models/errors/Error500 500 application/json
models/errors/Error502 502 application/json
models/errors/Error504 504 application/json
models/errors/APIException 4XX, 5XX */*

pazeMobileSessionCreate

Create a mobile session for use with Paze.

Example Usage

package hello.world;

import com.gr4vy.sdk.Gr4vy;
import com.gr4vy.sdk.models.components.*;
import com.gr4vy.sdk.models.errors.*;
import com.gr4vy.sdk.models.operations.CreatePazeMobileSessionResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws Exception {

        Gr4vy sdk = Gr4vy.builder()
                .merchantAccountId("<id>")
                .bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
            .build();

        CreatePazeMobileSessionResponse res = sdk.digitalWallets().sessions().pazeMobileSessionCreate()
                .pazeMobileSessionCreateRequest(PazeMobileSessionCreateRequest.builder()
                    .client(PazeClient.builder()
                        .id("0UVAS9Y03YNJ39XXYIN313F4DZNCjIGmqs4Iw32EPnZV0800o")
                        .build())
                    .sessionId("24e4dbb9-4f5e-43e8-8375-e9fd45650bc9")
                    .accessToken("<value>")
                    .callbackURLScheme("Gr4vyCallback")
                    .intent(Intent.EXPRESS_CHECKOUT)
                    .build())
                .call();

        if (res.pazeMobileSessionCreate().isPresent()) {
            System.out.println(res.pazeMobileSessionCreate().get());
        }
    }
}

Parameters

Parameter Type Required Description
merchantAccountId JsonNullable<String> The ID of the merchant account to use for this request.
pazeMobileSessionCreateRequest PazeMobileSessionCreateRequest ✔️ N/A

Response

CreatePazeMobileSessionResponse

Errors

Error Type Status Code Content Type
models/errors/Error400 400 application/json
models/errors/Error401 401 application/json
models/errors/Error403 403 application/json
models/errors/Error404 404 application/json
models/errors/Error405 405 application/json
models/errors/Error409 409 application/json
models/errors/HTTPValidationError 422 application/json
models/errors/Error425 425 application/json
models/errors/Error429 429 application/json
models/errors/Error500 500 application/json
models/errors/Error502 502 application/json
models/errors/Error504 504 application/json
models/errors/APIException 4XX, 5XX */*

paze

Create a session for use with Paze.

Example Usage

package hello.world;

import com.gr4vy.sdk.Gr4vy;
import com.gr4vy.sdk.models.components.*;
import com.gr4vy.sdk.models.errors.*;
import com.gr4vy.sdk.models.operations.CreatePazeDigitalWalletSessionResponse;
import com.gr4vy.sdk.models.operations.ResponseCreatePazeDigitalWalletSession;
import java.lang.Exception;
import java.lang.Object;

public class Application {

    public static void main(String[] args) throws Exception {

        Gr4vy sdk = Gr4vy.builder()
                .merchantAccountId("<id>")
                .bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
            .build();

        CreatePazeDigitalWalletSessionResponse res = sdk.digitalWallets().sessions().paze()
                .pazeSessionRequest(PazeSessionRequest.builder()
                    .build())
                .call();

        if (res.responseCreatePazeDigitalWalletSession().isPresent()) {
            ResponseCreatePazeDigitalWalletSession unionValue = res.responseCreatePazeDigitalWalletSession().get();
            Object raw = unionValue.value();
            if (raw instanceof PazeWebSession) {
                PazeWebSession pazeWebSessionValue = (PazeWebSession) raw;
                // Handle pazeWebSession variant
            } else if (raw instanceof PazeMobileSession) {
                PazeMobileSession pazeMobileSessionValue = (PazeMobileSession) raw;
                // Handle pazeMobileSession variant
            } else {
                // Unknown or unsupported variant
            }
        }
    }
}

Parameters

Parameter Type Required Description
merchantAccountId JsonNullable<String> The ID of the merchant account to use for this request.
pazeSessionRequest PazeSessionRequest ✔️ N/A

Response

CreatePazeDigitalWalletSessionResponse

Errors

Error Type Status Code Content Type
models/errors/Error400 400 application/json
models/errors/Error401 401 application/json
models/errors/Error403 403 application/json
models/errors/Error404 404 application/json
models/errors/Error405 405 application/json
models/errors/Error409 409 application/json
models/errors/HTTPValidationError 422 application/json
models/errors/Error425 425 application/json
models/errors/Error429 429 application/json
models/errors/Error500 500 application/json
models/errors/Error502 502 application/json
models/errors/Error504 504 application/json
models/errors/APIException 4XX, 5XX */*

pazeMobileSessionReview

Review a Paze checkout session and retrieve the selected card, consumer, and shipping address details.

Example Usage

package hello.world;

import com.gr4vy.sdk.Gr4vy;
import com.gr4vy.sdk.models.components.PazeSessionReviewRequest;
import com.gr4vy.sdk.models.errors.*;
import com.gr4vy.sdk.models.operations.ReviewPazeMobileSessionResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws Exception {

        Gr4vy sdk = Gr4vy.builder()
                .merchantAccountId("<id>")
                .bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
            .build();

        ReviewPazeMobileSessionResponse res = sdk.digitalWallets().sessions().pazeMobileSessionReview()
                .pazeSessionReviewRequest(PazeSessionReviewRequest.builder()
                    .sessionId("7c1cba03-d20e-4a3f-9d77-e5dc23a39ac2")
                    .code("eyJhdWQiOm51bGwsImtpZCI6IjE3...")
                    .accessToken("eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...")
                    .build())
                .call();

        if (res.pazeSessionReview().isPresent()) {
            System.out.println(res.pazeSessionReview().get());
        }
    }
}

Parameters

Parameter Type Required Description
merchantAccountId JsonNullable<String> The ID of the merchant account to use for this request.
pazeSessionReviewRequest PazeSessionReviewRequest ✔️ N/A

Response

ReviewPazeMobileSessionResponse

Errors

Error Type Status Code Content Type
models/errors/Error400 400 application/json
models/errors/Error401 401 application/json
models/errors/Error403 403 application/json
models/errors/Error404 404 application/json
models/errors/Error405 405 application/json
models/errors/Error409 409 application/json
models/errors/HTTPValidationError 422 application/json
models/errors/Error425 425 application/json
models/errors/Error429 429 application/json
models/errors/Error500 500 application/json
models/errors/Error502 502 application/json
models/errors/Error504 504 application/json
models/errors/APIException 4XX, 5XX */*

pazeMobileSessionComplete

Complete a Paze checkout session and retrieve the secure payload required to settle the payment.

Example Usage

package hello.world;

import com.gr4vy.sdk.Gr4vy;
import com.gr4vy.sdk.models.components.PazeSessionCompleteRequest;
import com.gr4vy.sdk.models.components.PazeSessionCompleteRequestTransactiontype;
import com.gr4vy.sdk.models.errors.*;
import com.gr4vy.sdk.models.operations.CompletePazeMobileSessionResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws Exception {

        Gr4vy sdk = Gr4vy.builder()
                .merchantAccountId("<id>")
                .bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
            .build();

        CompletePazeMobileSessionResponse res = sdk.digitalWallets().sessions().pazeMobileSessionComplete()
                .pazeSessionCompleteRequest(PazeSessionCompleteRequest.builder()
                    .sessionId("7c1cba03-d20e-4a3f-9d77-e5dc23a39ac2")
                    .code("eyJhdWQiOm51bGwsImtpZCI6IjE3...")
                    .accessToken("eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...")
                    .transactionType(PazeSessionCompleteRequestTransactiontype.PURCHASE)
                    .build())
                .call();

        if (res.pazeSessionComplete().isPresent()) {
            System.out.println(res.pazeSessionComplete().get());
        }
    }
}

Parameters

Parameter Type Required Description
merchantAccountId JsonNullable<String> The ID of the merchant account to use for this request.
pazeSessionCompleteRequest PazeSessionCompleteRequest ✔️ N/A

Response

CompletePazeMobileSessionResponse

Errors

Error Type Status Code Content Type
models/errors/Error400 400 application/json
models/errors/Error401 401 application/json
models/errors/Error403 403 application/json
models/errors/Error404 404 application/json
models/errors/Error405 405 application/json
models/errors/Error409 409 application/json
models/errors/HTTPValidationError 422 application/json
models/errors/Error425 425 application/json
models/errors/Error429 429 application/json
models/errors/Error500 500 application/json
models/errors/Error502 502 application/json
models/errors/Error504 504 application/json
models/errors/APIException 4XX, 5XX */*

clickToPay

Create a session for use with Click to Pay.

Example Usage

package hello.world;

import com.gr4vy.sdk.Gr4vy;
import com.gr4vy.sdk.models.components.ClickToPaySessionRequest;
import com.gr4vy.sdk.models.errors.*;
import com.gr4vy.sdk.models.operations.CreateClickToPayDigitalWalletSessionResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws Exception {

        Gr4vy sdk = Gr4vy.builder()
                .bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
            .build();

        ClickToPaySessionRequest req = ClickToPaySessionRequest.builder()
                .checkoutSessionId("4137b1cf-39ac-42a8-bad6-1c680d5dab6b")
                .build();

        CreateClickToPayDigitalWalletSessionResponse res = sdk.digitalWallets().sessions().clickToPay()
                .request(req)
                .call();

        if (res.clickToPaySession().isPresent()) {
            System.out.println(res.clickToPaySession().get());
        }
    }
}

Parameters

Parameter Type Required Description
request ClickToPaySessionRequest ✔️ The request object to use for the request.

Response

CreateClickToPayDigitalWalletSessionResponse

Errors

Error Type Status Code Content Type
models/errors/Error400 400 application/json
models/errors/Error401 401 application/json
models/errors/Error403 403 application/json
models/errors/Error404 404 application/json
models/errors/Error405 405 application/json
models/errors/Error409 409 application/json
models/errors/HTTPValidationError 422 application/json
models/errors/Error425 425 application/json
models/errors/Error429 429 application/json
models/errors/Error500 500 application/json
models/errors/Error502 502 application/json
models/errors/Error504 504 application/json
models/errors/APIException 4XX, 5XX */*