개요
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
Google 월렛 패스 API는 파트너가 회전 바코드를 Google 월렛에 저장할 수 있는 기능을 제공합니다. 이러한 바코드는 짧은 시간 동안만 유효하므로 바코드 스크린샷 위험을 줄이기 위한 추가 보안을 제공합니다. 바코드는 파트너가 보안 비밀 키를 제공하는 RFC 6238에 따라 기기에서 생성됩니다. 하지만 파트너가 바코드를 직접 생성하고자 하는 경우 Google은 바코드를 Google에 일괄 업로드할 수 있는 API를 제공합니다. 그러면 이러한 바코드가 사용자의 휴대전화로 전달되어 회전 바코드처럼 작동하며 잠시 표시됩니다. Google에서는 이 솔루션을 파트너가 생성한 회전 바코드라고 합니다.
파트너가 생성한 회전 바코드 API
파트너가 생성한 회전 바코드는 동일한 RotatingBarcode 객체를 사용하여 생성됩니다. 유형만 필요하지만 시작용 바코드 세트 (약 10분 분량)를 만들어 initialRotatingBarcodeValues
로 전송하는 것이 좋습니다. 파트너는 항상 사용자에게 유효한 바코드가 준비되어 있는지 확인해야 하며 initialRotatingBarcodeValues
는 후속 일괄 업로드 호출을 비동기식으로 허용합니다.
rotatingBarcode {
initialRotatingBarcodeValues: object (RotatingBarcodeValues),
type: enum (BarcodeType),
}
필드 |
설명 |
initialRotatingBarcodeValues |
object (RotatingBarcodeValues)
바코드에 인코딩할 값입니다. 값을 하나 이상 입력해야 합니다. 이러한 초기 바코드는 사용자가 처음 패스를 획득한 시점과 후속 일괄 업로드 호출이 이루어지는 시점 사이의 공백을 메우기 위한 것입니다.
|
type |
enum (BarcodeType)
필수 항목입니다. 이 바코드의 유형입니다.
사용 가능한 값:
|
RotatingBarcodeValues
필드 |
설명 |
startDateTime |
string
첫 번째 바코드의 유효 기간이 시작되는 날짜/시간입니다. 바코드는 periodMillis 를 사용하여 회전됩니다.
오프셋이 있는 ISO 8601 확장 형식 날짜/시간입니다.
|
values[] |
string
바코드에 인코딩할 값입니다. 값을 하나 이상 입력해야 합니다.
값의 최대 개수는 없지만 요청 본문의 크기는 5MB를 초과할 수 없습니다.
|
periodMillis |
number
각 바코드가 유효한 시간입니다.
|
바코드 값 일괄 업데이트
RotatingBarcode 객체가 생성된 후 사용자의 패스가 만료될 때까지 매일 하루치의 바코드를 업로드하는 것이 좋습니다. 다음 REST API 엔드포인트를 사용하여 이 작업을 실행할 수 있습니다.
메서드: transitobject.uploadrotatingbarcodevalues
지정된 객체 ID로 참조되는 대중교통 객체에 회전 바코드 값을 업로드합니다.
HTTP 요청
POST
https://walletobjects.googleapis.com/upload/walletobjects/v1/transitObject/{resourc
eId}/uploadRotatingBarcodeValues
경로 매개변수
매개변수 |
설명 |
resourceId |
string
객체의 고유 식별자입니다.
|
요청 본문
요청 본문 (5MB를 초과할 수 없음)에는 RotatingBarcodeValues 인스턴스가 포함됩니다.
메서드: transitobject.downloadrotatingbarcodevalues
지정된 객체 ID로 참조되는 대중교통 객체의 회전 바코드 값을 다운로드합니다. 파트너가 최신 일괄 처리를 확인하려는 경우에 유용합니다.
HTTP 요청
GET
https://walletobjects.googleapis.com/walletobjects/v1/transitObject/{resourceId}/do
wnloadRotatingBarcodeValues?alt=media
경로 매개변수
매개변수 |
설명 |
resourceId |
string
객체의 고유 식별자입니다.
|
대체 메커니즘
다른 면에서는 유효한 RotatingBarcode에 표시할 유효한 바코드가 없는 경우 (아직 업로드되지 않았거나 현재 사용 중인 모든 바코드가 사용된 경우) 사용자에게 오류 메시지가 표시됩니다.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2024-11-30(UTC)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2024-11-30(UTC)"],[[["Google Wallet now supports Partner-Generated Rotating Barcodes for enhanced security, allowing partners to generate and upload time-limited barcodes directly."],["Partners can integrate Rotating Barcodes using the `rotatingBarcode` object within the Google Wallet Passes API, specifying the barcode type and initial values."],["The API provides methods for batch uploading (`transitobject.uploadrotatingbarcodevalues`) and downloading (`transitobject.downloadrotatingbarcodevalues`) barcode values for ongoing updates."],["To ensure continuous barcode availability, it is recommended to upload a day's worth of barcodes daily until a user's pass expires, utilizing the `initialRotatingBarcodeValues` for a smooth initial experience."],["If a Rotating Barcode lacks valid values, an error message will be displayed to the user, highlighting the importance of timely barcode updates."]]],["The Google Wallet Passes API enables partners to use Partner-Generated Rotating Barcodes, enhancing security by having barcodes valid for a short time. Partners can define a `RotatingBarcode` object specifying the barcode `type` and `initialRotatingBarcodeValues`. They then batch upload barcode values using the `transitobject.uploadrotatingbarcodevalues` API endpoint and should upload a day's worth of barcodes each day. Barcode values can be downloaded via `transitobject.downloadrotatingbarcodevalues` for verification. If no valid barcodes are available, an error message is shown.\n"]]