同意朱利叶斯的回答,但它没有显示在哪里设置货币。您可以创建一个方法
- (INPaymentRecord *) getPaymentRecord:(INSendPaymentIntent *)intent
{
INCurrencyAmount *currAmount = [[INCurrencyAmount alloc] initWithAmount: intent.currencyAmount currencyCode:@"ZAR"];
INPaymentMethod *paymentMethod = [[INPaymentMethod alloc] initWithType:INPaymentMethodTypeCredit name:@"" identificationHint:@"" icon:nil];
INPaymentRecord *paymentRecord = [[INPaymentRecord alloc] initWithPayee:nil payer:nil currencyAmount: intent.currencyAmount paymentMethod:paymentMethod note:nil status:INPaymentStatusCompleted ];
return paymentRecord;
}
然后从委托方法中,您只需在上述两个语句之间插入 paymentrecord 分配:
INSendPaymentIntentResponse *response = [[INSendPaymentIntentResponse alloc] initWithCode:INSendPaymentIntentResponseCodeSuccess userActivity:nil];
**response.paymentRecord = [self getPaymentRecord:intent];**
completion(response);