js,android: convert timeStamp to string (#279)

This commit is contained in:
94cstyles
2017-09-02 17:38:36 +08:00
committed by Yazhong Liu
parent 701205c5d0
commit 8ca60b8366

View File

@@ -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 => {