私はショッピングカートを持っています。
ユーザーの支払い後に生成されるJSON文字列を送信したいとします。PHPページまたはメールでJSON文字列をデータベースにインポートする
var ProcessOrder = {
// Called when order is successful via PayPal
success : function(order, transactionId){
$.info('Payment Success. TransactionID: ' + transactionId);
$.info('Order Data = ' + JSON.stringify(order));
Ti.UI.createAlertDialog({
title : config.PAYMENT_SUCCESS_MESSAGE.TITLE,
message : config.PAYMENT_SUCCESS_MESSAGE.MESSAGE
}).show();
},
// Called when order was cancelled by user during PayPal flow
cancelled : function(order){
$.info('Payment Canceled');
},
// Called if an error occurs during PayPal transaction
failed : function(order, errorCode, errorMessage){
$.info('Payment Error');
$.info('errorCode: ' + errorCode);
$.info('errorMessage: ' + errorMessage);
alert(errorMessage);
}
};
注文後に生成される文字列は、この次のとおりです:
私は、このファイルの.js持っ
$.info('Payment Success. TransactionID: ' + transactionId);
$.info('Order Data = ' + JSON.stringify(order));
をご注文の詳細が含まれています。
私は送信する内容を知るためにメールなどで送信したいですか? ありがとうございます。
このコード:私は、データベースにこのデータを保存したり、電子メールを送信したい
[INFO] Payment Success. TransactionID: AP-1YH922698A186825K
[INFO] Order Data = [{"itemID":"003","name":"Product","itemCount":1,"itemPrice":"2.50","totalPrice":2.5,"options":""}]
:
$.info('Payment Success. TransactionID: ' + transactionId);
$.info('Order Data = ' + JSON.stringify(order));
はJSON 2つの文字列を生成します。
質問が理解できません。あなたはそれを言い換えることができますか? – naresh
私の悪い英語を許してください。 このコード: $ .info( 'Payment Success。TransactionID:' + transactionId); $ .info( 'Order Data =' + JSON.stringify(order)); は、JSONの2つの文字列を生成します。 [INFO] Payment Success。 [itemID]: "003"、 "name": "Product Large"、 "itemCount":1、 "itemPrice": "2.50"、 "totalPrice":トランザクションID:AP-1YH922698A186825K [INFO] 2.5、 "options": ""}] このデータをデータベースに保存するか、メールを送信します。 –