OR_CCREU_03 error occurs when a string is used for the amount. Google Pay requires the amount to be in a double format, so you need to convert it accordingly.
GooglePayButton(
paymentConfigurationAsset: 'gpay.json', // Path to your payment configuration JSON file
paymentItems: _paymentItems,
style: GooglePayButtonStyle.black,
type: GooglePayButtonType.pay,
margin: const EdgeInsets.only(top: 15.0),
onPaymentResult: onGooglePayResult,
loadingIndicator: const Center(
child: CircularProgressIndicator(),
),
),
{
"provider": "stripe",
"apiVersion": 2,
"apiVersionMinor": 0,
"allowedPaymentMethods": [
{
"type": "CARD",
"parameters": {
"allowedAuthMethods": ["PAN_ONLY", "CRYPTOGRAM_3DS"],
"allowedCardNetworks": ["AMEX", "DISCOVER", "JCB", "MASTERCARD",
"VISA"]
},
"tokenizationSpecification": {
"type": "PAYMENT_GATEWAY",
"parameters": {
"gateway": "stripe",
"stripe:version": "2020-08-27",
"stripe:publishableKey": "YOUR_PUBLISHABLE_KEY"
}
}
}
],
"merchantInfo": {
"merchantId": "BCR2DN6TZLJ2JN4", // Replace with your actual Merchant ID
"merchantName": "Example Merchant"
},
"transactionInfo": {
"totalPriceStatus": "FINAL",
"totalPriceLabel": "Total",
// "totalPrice": "10", // replace with double
"totalPrice":double.parse(amount.toString()),
"currencyCode": "USD",
"countryCode": "US"
}
}
Conclusion: This is how you can resolve the OR_CCREU_03 problem in your code.
Other Articles:
Need a Flutter expert for mobile app development? Looking to build Android or iOS apps with Flutter? Let us transform your ideas into powerful, feature-rich apps effortlessly. If you’re facing challenges with your Flutter app, we’re here to resolve them quickly and efficiently. Contact us today at contact@researchthinker.com and share your requirements!. Thank you on behalf of ResearchThinker.