【发布时间】:2015-07-17 16:39:53
【问题描述】:
这就是我创建 PayPal 付款的方式。
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 为空 你能告诉我,我怎样才能得到付款人ID?我错过了什么吗?
【问题讨论】:
-
假设我理解了你的问题,以上是
credit cardsale请求,你应该已经从Create得到了结果。 IINMExecute用于paypal付款。
标签: c# asp.net paypal paypal-sandbox