From 8ca60b836609af3741cbcf3dcbae81527ab8f184 Mon Sep 17 00:00:00 2001 From: 94cstyles Date: Sat, 2 Sep 2017 17:38:36 +0800 Subject: [PATCH] js,android: convert timeStamp to string (#279) --- index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 8e58036..9dc0287 100644 --- a/index.js +++ b/index.js @@ -1,6 +1,6 @@ 'use strict'; -import { DeviceEventEmitter, NativeModules } from 'react-native'; +import { DeviceEventEmitter, NativeModules, Platform } from 'react-native'; import { EventEmitter } from 'events'; let isAppRegistered = false; @@ -267,6 +267,10 @@ export function pay(data) { correct('noncestr', 'nonceStr'); correct('partnerid', 'partnerId'); correct('timestamp', 'timeStamp'); + + // FIXME(94cstyles) + // Android requires the type of the timeStamp field to be a string + if (Platform.OS === 'android') data.timeStamp = String(data.timeStamp) return new Promise((resolve, reject) => { WeChat.pay(data, result => {