Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix meta data in IOS and android #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ const allConfigurations = {
shipping: shipping,
allowedCadTypes:AllowedCadTypes.ALL,
paymentitems: paymentitems,
paymenMetaData: { a: 'a meta', b: 'b meta' },
paymentMetadata: { a: 'a meta', b: 'b meta' },
applePayMerchantID: 'applePayMerchantID',
authorizeAction: { timeInHours: 10, time: 10, type: 'CAPTURE' },
cardHolderName: 'Card Holder NAME',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ private void configureSDKSession(HashMap<String, Object> sessionParameters, RNGo
sdkSession.setPaymentDescription(sessionParameters.get("paymentDescription").toString()); // ** Optional **

// Payment Extra Info
sdkSession.setPaymentMetadata(DeserializationUtil.getMetaData(sessionParameters.get("paymenMetaData")));// **Optional** you can pass empty array hashmap//
sdkSession.setPaymentMetadata(DeserializationUtil.getMetaData(sessionParameters.get("paymentMetadata")));// **Optional** you can pass empty array hashmap//

// Payment Reference
sdkSession.setPaymentReference(DeserializationUtil.getReference(sessionParameters.get("paymentReference"))); // **Optional**you can pass null
Expand Down
7 changes: 7 additions & 0 deletions ios/Classes/Bridge.swift
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,13 @@ extension Bridge: SessionDataSource {
return paymentReferenceItems
}
return nil
}
public var paymentMetadata: Metadata? {
if let paymentMetadataString:[String: Any] = argsSessionParameters?["paymentMetadata"] as? [String: Any] {
let paymentMetadataItems:Metadata = try! Metadata.init(dictionary: paymentMetadataString)
return paymentMetadataItems
}
return nil
}
public var receiptSettings: Receipt? {
if let receiptSettingsString:String = argsSessionParameters?["receiptSettings"] as? String {
Expand Down