Product Cards
Embed products in your own user interface
A product card is a simple view that easily allows users to find and buy products within the
existing structure of your app. It displays the product name, image, description, cost, and a buy
button that initiates a purchase. The SDK fetches up-to-date product information from our API and
populates the view.
Add a product card to your app
These are views that take a search term as input. To embed a product card into your app:
- Objective-C
CGRect rect = CGRectMake(0, 0, 320, 80);
NSString *searchTerm = @"ninja cats";
PPCProductCardView *productCardView = [PayPalCommerce productCardViewWithFrame:rect
searchTerm:searchTerm
completion:^(BOOL success, NSError *error) {
}];
[self.view addSubview:productCardView];- Objective-C
CGRect rect = CGRectMake(0, 0, 320, 80);
NSString *productGroupID = @""; //use one of your product group IDs
PPCProductCardView *productCardView = [PayPalCommerce productCardViewWithFrame:rect
productGroupID:productGroupID
completion:^(BOOL success, NSError *error) {
}];
[self.view addSubview:productCardView];Purchase flow from a product card in a content-based app
You can render a product view within your own app, which allows your users to initiate a purchase.
Display and purchase a product from your app with your own UI
You can also display product information and initiate a purchase using your own UI by fetching a
PPCProduct object and executing a purchase on it per some user action.
- Objective-C
[PayPalCommerce fetchProductWithGroupID:@""
completion:^(PPCProduct *product, NSError *error){
//display something notifying what they're buying
}];- Objective-C
[PayPalCommerce purchaseProduct:product];