我正在使用React,直到现在,paypal express按钮仍然很好。快速按钮打开结帐窗口,但没有购物车或总金额显示,点击继续按钮后,我被重定向到摘要paypal页面。
我可以在帐户中查看交易,但尚未完成。有人有过这个问题吗?右边的paypal示例工作正常,所以我认为问题是我的,但系统工作了大约六个月没有问题。
import React from 'react';
import ReactDOM from 'react-dom';
import paypal from 'paypal-checkout';
payment(data, actions) {
return actions.payment.create({
transactions: [
{
amount: { total: this.state.totalFee, currency: 'USD' }
}
]
});
}
onAuthorize(data, actions) {
return actions.payment.execute().then(function(paymentData) {
// Show a success page to the buyer
});
}
...
render() {
let PayPalButton = paypal.Button.driver('react', { React, ReactDOM });
return (
<div className = "col-sm-3 text-right">
{
this.state.env !== undefined ?
<PayPalButton
commit={ true }
env={ this.state.env }
client={ this.state.client }
payment={ (data, actions) => this.payment(data, actions) }
onAuthorize={ (data, actions) => this.onAuthorize(data, actions) }
/>
:
''
}
</div>
);