Skip to content

Latest commit

 

History

History
211 lines (159 loc) · 12.5 KB

File metadata and controls

211 lines (159 loc) · 12.5 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 */*

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 */*