SK Payment Transaction Wrappers - Dart
SK Payment Transaction Wrappers - Dart
part 'sk_payment_transaction_wrappers.g.dart';
/// Triggered when any transactions are removed from the payment queue.
void removedTransactions({List<SKPaymentTransactionWrapper> transactions});
/// Triggered when payment queue has finished sending restored transactions.
void paymentQueueRestoreCompletedTransactionsFinished();
/// Triggered when a user initiates an in-app purchase from App Store.
///
/// Return `true` to continue the transaction in your app. If you have
/// multiple [SKTransactionObserverWrapper]s, the transaction will continue if
/// any [SKTransactionObserverWrapper] returns `true`. Return `false` to defer
/// or cancel the transaction. For example, you may need to defer a
/// transaction if the user is in the middle of onboarding. You can also
/// continue the transaction later by calling [addPayment] with the
/// `payment` param from this method.
bool shouldAddStorePayment(
{SKPaymentWrapper payment, SKProductWrapper product});
}
/// The transaction is in the queue but pending external action. Wait for
/// another callback to get the final state.
///
/// You should update your UI to indicate that you are waiting for the
/// transaction to update to another state.
@JsonValue(4)
deferred,
}
/// The payment that has been created and added to the payment queue which
/// generated this transaction.
final SKPaymentWrapper payment;
@override
bool operator ==(Object other) {
if (identical(other, this)) {
return true;
}
if (other.runtimeType != runtimeType) {
return false;
}
final SKPaymentTransactionWrapper typedOther = other;
return typedOther.payment == payment &&
typedOther.transactionState == transactionState &&
typedOther.originalTransaction == originalTransaction &&
typedOther.transactionTimeStamp == transactionTimeStamp &&
typedOther.transactionIdentifier == transactionIdentifier &&
typedOther.error == error;
}
@override
int get hashCode => hashValues(
this.payment,
this.transactionState,
this.originalTransaction,
this.transactionTimeStamp,
this.transactionIdentifier,
this.error);
@override
String toString() => _$SKPaymentTransactionWrapperToJson(this).toString();
}