Google Pay
설정 방법
헤드리스 체크아웃을 사용하여 Google Pay를 통한 결제를 수락하는 방법:
- 추가 필드 표시를 위한
show_fields이벤트의 처리를 추가합니다.
Copy
- typescript
1headlessCheckout.form.onNextAction((nextAction) => {
2 switch (nextAction.type) {
3 case 'show_fields':
4 this.handleShowFieldsAction(nextAction);
5 }
6});
- 추가 필드를 표시하려면 결제 UI의 HTML 마크업에
psdk-payment-form구성 요소를 추가합니다.
Copy
- html
1<psdk-payment-form></psdk-payment-form>
2<psdk-submit-button text="Pay" />
- Google Pay를 통해 결제하는 버튼 표시를 위한 이벤트 처리를 추가합니다.
Copy
- typescript
1headlessCheckout.form.onNextAction((nextAction) => {
2 switch (nextAction.type) {
3 ...
4 case 'special_button': {
5 if (nextAction.data.buttonName === 'google-pay') {
6 showGoogleButton = true;
7 }
8 }
9 }
10});
- 결제 UI의 HTML 마크업에 Google Pay 버튼의 구성 요소를 추가합니다.
Copy
- html
1@if (showGoogleButton) {
2 <psdk-google-pay-button></psdk-google-pay-button>
3}
원클릭 결제
사용자는 원클릭 결제를 통해 지원 장치에서 친숙하고 안정적인 본래의 결제 방식인 Google Pay로 결제할 수 있습니다. 원클릭 결제를 구성하려면 아래에 제시된 바와 같이 SDK 초기화 스크립트를 업데이트하십시오.
Copy
- typescript
1const config: InitialOptions = {
2 isWebview: false,
3 theme: 'default',
4 language: parameters.language,
5 isGooglePayInstantFlowEnabled: true
6};
7
8await headlessCheckout.init(config);
이 기사가 도움이 되었나요?
의견을 보내 주셔서 감사드립니다!
메시지를 검토한 후 사용자 경험 향상에 사용하겠습니다.오자 또는 기타 텍스트 오류를 찾으셨나요? 텍스트를 선택하고 컨트롤+엔터를 누르세요.