6

I build Intents Extension and I'm handling INSendMoneyIntent and I'm saying:

Send 25€ to John Smith

response after app confrimation

Here's your <Your_App> payment for US$25.00. Do you want to send it?

Intent contains proper currency iso 3 code - EUR, so why siri displays wrong currency in payment confirmation?

returning intent

INSendPaymentIntentResponse *reponse = [[INSendPaymentIntentResponse alloc] initWithCode:INSendPaymentIntentResponseCodeReady userActivity:userActivity];
completion(reponse);
rmaddy
  • 314,917
  • 42
  • 532
  • 579
user3292998
  • 209
  • 1
  • 8
  • plz, show some code? – Shoaib Aug 24 '16 at 11:50
  • addded, but seriously, there is no way that this is code fault, it's rather configuration problem? – user3292998 Aug 24 '16 at 11:55
  • With iOS 10 still in beta, you're probably better off [reporting this as a bug to Apple](https://bugreport.apple.com/) directly. And maybe posting in their beta forum. – Sixten Otto Aug 24 '16 at 15:39
  • Also, Welcome to Stack Overflow. (May I suggest setting a real username? Other users might be more inclined to answer. It's a small thing, but makes a huge difference.) – Moshe Aug 24 '16 at 15:44
  • Did you solve the issue? @user3292998 – Reem Oct 20 '16 at 07:53
  • yes, my app is in AppStore now ;) you can try to send money with Azimo ;D – user3292998 Oct 20 '16 at 13:05
  • @user3292998 could you please show how you fixed it? The accepted answer says you need to add paymentRecord, I do add a record but the confirmation is still always in US$ – Reem Oct 24 '16 at 14:17

2 Answers2

7

You need to add a paymentRecord to your response in

(void)confirmSendPayment:(INSendPaymentIntent *)intent

like so:

INSendPaymentIntentResponse *response = [[INSendPaymentIntentResponse alloc] initWithCode:INSendPaymentIntentResponseCodeReady userActivity:userActivity];
response.paymentRecord = [[INPaymentRecord alloc] initWithPayee:intent.payee payer:nil currencyAmount:intent.currencyAmount paymentMethod:nil note:intent.note status:INPaymentStatusPending];
completion(response);
julius
  • 86
  • 1
1

Agree with Julius' answer but it doesn't show where to set the currency. You can create a method

- (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;

}

And then from the delegate method you just slot the paymentrecord assignment between your above two statements:

    INSendPaymentIntentResponse *response = [[INSendPaymentIntentResponse alloc] initWithCode:INSendPaymentIntentResponseCodeSuccess userActivity:nil];

    **response.paymentRecord = [self getPaymentRecord:intent];**

    completion(response);
ildsarria
  • 281
  • 3
  • 10
  • probably you are wrong, instance of intent is passed from `confirmSendPayment`, so basically all you need to do is set currency in `confirmSendPayment` – user3292998 Oct 19 '16 at 15:27