React NativeにてAmazon Payのウィジェットを実装しようとしています。
しかし、amazon からReact NativeへのSDK及び実装方法の解説が見当たりません。
amazon-pay-react を使用してみましたが以下の画像のようにエラーが出力されます。
このエラーはreact-nativeにwindow.documentがないためだと思われます。
React nativeでAmazon Payを実装する良い方法はないでしょうか。
よろしくお願いします。
import React, { Component } from 'react';
import { Text, View } from 'react-native';
import AmazonPay from 'amazon-pay-react';
export default class HelloWorldApp extends Component {
render() {
return (
<View style={{ flex: 1, justifyContent: "center", alignItems: "center" }}>
<AmazonPay
clientId='your-cliendId'
sellerId='your-sellerId'
agreementType={'BillingAgreement'}
scope='profile payments:widget'
btnType='PwA'
btnColor='Gold'
btnSize='medium'
onConsentChange={(hasConsent) => ...handle}
handleBillingAgreementId={(billingAgreementId) => ...handle}
billingAgreementId={this.state.billingAgreementId}
useAmazonAddressBook={true}
/>
</View>
);
}
}