這是我如何創建PayPal付款。貝寶Rest信用卡付款方式
var apiContext = GetApiContext(clientId, clientSecret);
CreditCard creditCard = new CreditCard();
creditCard.number = "4877274905927862";
creditCard.type = "visa";
creditCard.expire_month = 11;
creditCard.expire_year = 2018;
creditCard.cvv2 = "874";
creditCard.first_name = firstName;
creditCard.last_name = lastName;
Amount amount = new Amount();
amount.total = "7.47";
amount.currency = "USD";
Transaction transaction = new Transaction();
transaction.amount = amount;
transaction.description = "This is the payment transaction description.";
List<Transaction> transactions = new List<Transaction>();
transactions.Add(transaction);
FundingInstrument fundingInstrument = new FundingInstrument();
fundingInstrument.credit_card = creditCard;
List<FundingInstrument> fundingInstruments = new List<FundingInstrument>();
fundingInstruments.Add(fundingInstrument);
Payer payer = new Payer();
payer.funding_instruments = fundingInstruments;
payer.payment_method = "credit_card";
Payment payment = new Payment();
payment.intent = "sale";
payment.payer = payer;
payment.transactions = transactions;
Payment createdPayment = payment.Create(apiContext);
對於payment.execute我需要支付Id和計費用戶標識。但付款人ID變爲空 你能告訴我,我怎樣才能得到付款人ID?我錯過了什麼嗎?
假設我明白了你的問題,上面是'信用卡'銷售'請求,你應該已經從'Create'得到了結果。 IINM'Execute'用於'paypal'付款。 – EdSF
謝謝。 @EdsF – Tonny