{"title":"Start Alipay and WeChat Pay transactions","category":"default","creationDate":1776961627,"content":"<h2>Class<\/h2>\n<table style=\"width:100%;\"><colgroup><col style=\"width: 4%\"><col style=\"width: 95%\"><\/colgroup><thead><tr class=\"header\"><th>Name<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td>\n<p><code>MerchantPed<\/code><\/p>\n<\/td><td>\n<p>Extends\u00a0 <code>AdyenPed<\/code>.\u00a0 Class used to implement all PIN entry device (PED) functionality.<\/p>\n<\/td><\/tr><\/tbody><\/table>\n<h2 id=\"special-tender-parameter\">Special tender parameter<\/h2>\n<table>\n<thead>\n<tr>\n<th>Name<\/th>\n<th>Type<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>specialTender<\/code><\/td>\n<td>SpecialTender<\/td>\n<td>Holds tender attributes.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Use the SpecialTenderBuilder to create the SpecialTender object:<\/p>\n<pre><code class=\"language-java\">SpecialTender.SpecialTenderBuilder(merchantAccount,\n                merchantReference,\n                \"payment\",\n                \"alipay\",\n                currency,\n                amount)\n                .tenderOptions(tenderOptions)\n                .specialOptions(specialOptions)\n                .build();\u00a0<\/code><\/pre>\n<h2 id=\"use-put-to-set-special-options\">Use put to set special options<\/h2>\n<table><colgroup><col style=\"width: 24%\"><col style=\"width: 75%\"><\/colgroup><thead><tr class=\"header\"><th>Name<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td>\n<p><code>specialOptions.put<\/code><\/p>\n<\/td><td>\n<p>Allows you to add a special option as a key value pair.<\/p>\n<\/td><\/tr><\/tbody><\/table>\n<p>Add special options parameters to the\u00a0<code>specialTender<\/code>\u00a0using the\u00a0<code>specialOptions.put<\/code>\u00a0method.\u00a0<\/p>\n<table style=\"width:100%;\"><colgroup><col style=\"width: 13%\"><col style=\"width: 5%\"><col style=\"width: 8%\"><col style=\"width: 71%\"><\/colgroup><thead><tr class=\"header\"><th>Name<\/th><th>Type<\/th><th>Required<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td>\n<p><code>cardNumber\u00a0<\/code><\/p>\n<\/td><td>\n<p>String<\/p>\n<\/td><td>\n<p><img title=\"-x-\" alt=\"-x-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/x.png\" \/><\/p>\n<\/td><td>\n<p>The scanned number from the wallet app (to be provided only for <a href=\"\/point-of-sale\/qr-code-wallets\">Flow 3: Cash register scans Shopper barcode<\/a>)<\/p>\n<\/td><\/tr><tr><td>\n<p><code>forceEntryMode<\/code><\/p>\n<\/td><td>\n<p>String<\/p>\n<\/td><td>\n<p><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/p>\n<\/td><td>\n<p>The entry mode for the transaction. In this case, use the value \"Keyed\".<\/p>\n<\/td><\/tr><\/tbody><\/table>\n<pre><code class=\"language-java\">specialOptions.put(\"cardNumber\", \"60362821657200117610\");<\/code><\/pre>\n<h2 id=\"instantiate-special-tender-options\">Instantiate special tender options<\/h2>\n<table>\n<thead>\n<tr>\n<th>Name<\/th>\n<th>Type<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>specialOptions<\/code><\/td>\n<td>SpecialOptions<\/td>\n<td>Holds tender attributes.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3 id=\"parameters\">Parameters<\/h3>\n<table style=\"width:100%;\"><colgroup><col style=\"width: 16%\"><col style=\"width: 6%\"><col style=\"width: 8%\"><col style=\"width: 68%\"><\/colgroup><thead><tr class=\"header\"><th>Name<\/th><th>Type<\/th><th>Required<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td>\n<p><code>transactionType<\/code><\/p>\n<\/td><td>\n<p>String<\/p>\n<\/td><td>\n<p><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/p>\n<\/td><td>\n<p>Type of transaction. <code>TransactionType<\/code> takes the following value:<ul><li markdown=\"1\">payment<\/li><\/ul><\/p>\n<\/td><\/tr><tr><td>\n<p><code>paymentMethodType<\/code><\/p>\n<\/td><td>\n<p>String<\/p>\n<\/td><td>\n<p><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/p>\n<\/td><td>\n<p>The type of payment method, in this case wallets. <code>PaymentMethodType<\/code> takes the following values:<ul><li markdown=\"1\"><ul><li>Pass <span translate=\"no\"><strong>\"alipay\"<\/strong><\/span> for an Alipay transaction.<\/li><li markdown=\"1\">Pass <span translate=\"no\"><strong>\"wechatpay_pos\"<\/strong><\/span> for WeChat Pay transaction.<\/li><\/ul><\/li><\/ul><\/p>\n<\/td><\/tr><tr><td>\n<p><code>shopperReference<\/code><\/p>\n<\/td><td>\n<p>String<\/p>\n<\/td><td>\n<p><img title=\"-x-\" alt=\"-x-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/x.png\" \/><\/p>\n<\/td><td>\n<p>Shopper identification (used for omnichannel digital customer recognition).<\/p>\n<\/td><\/tr><tr><td>\n<p><code>shopperEmail<\/code><\/p>\n<\/td><td>\n<p>String<\/p>\n<\/td><td>\n<p><img title=\"-x-\" alt=\"-x-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/x.png\" \/><\/p>\n<\/td><td>\n<p>Shopper identification (used for omnichannel digital customer recognition).<\/p>\n<\/td><\/tr><tr><td>\n<p><code>merchantAccount<\/code><\/p>\n<\/td><td>\n<p>String<\/p>\n<\/td><td>\n<p><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/p>\n<\/td><td>\n<p>The transaction reference provided by the Merchant (reported in the plataforma de pagamentos da Adyen).<\/p>\n<\/td><\/tr><tr><td>\n<p><code>merchantReference<\/code><\/p>\n<\/td><td>\n<p>String<\/p>\n<\/td><td>\n<p><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/p>\n<\/td><td>\n<p>The transaction reference provided by the Merchant (reported in the plataforma de pagamentos da Adyen).<\/p>\n<\/td><\/tr><tr><td>\n<p><code>currency<\/code><\/p>\n<\/td><td>\n<p>long<\/p>\n<\/td><td>\n<p><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/p>\n<\/td><td>\n<p>The transaction currency.<\/p>\n<\/td><\/tr><tr><td>\n<p><code>amount<\/code><\/p>\n<\/td><td>\n<p>String<\/p>\n<\/td><td>\n<p><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/p>\n<\/td><td>\n<p>The transaction amount in minor units (100 is 1.00 with EUR). The Amount field should be a strong typed field with a string for currency code and a number (long) for the minor digits value (similar to the current API (of the terminal)).<\/p>\n<\/td><\/tr><tr><td>\n<p><code>specialOptions<\/code><\/p>\n<\/td><td>\n<p>SpecialTenderOptions<\/p>\n<\/td><td>\n<p><img title=\"-x-\" alt=\"-x-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/x.png\" \/><\/p>\n<\/td><td>\n<p>Holds tender attributes.<ul><li markdown=\"1\">cardNumber\u00a0<\/li><li markdown=\"1\">forceEntryMode<\/li><\/ul><\/p>\n<\/td><\/tr><tr><td>\n<p><code>handleReceipt<\/code><\/p>\n<\/td><td>\n<p>Boolean<\/p>\n<\/td><td>\n<p><img title=\"-x-\" alt=\"-x-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/x.png\" \/><\/p>\n<\/td><td>\n<p>Specifies that the POS handles and prints receipts. If omitted, it is required that the PED prints the receipt. If there is no printer unit, the transaction will fail.<\/p>\n<\/td><\/tr><\/tbody><\/table>\n<p>Instantiate\u00a0<code>specialOptions<\/code>\u00a0by assigning it to the result of the SpecialTender getter<code>\u00a0specialtender.getSpecialOptions()<\/code><\/p>\n<pre><code class=\"language-java\">SpecialOptions specialOptions = specialTender.getSpecialOptions();<\/code><\/pre>\n<h2 id=\"call-the-method\">Call the method<\/h2>\n<table style=\"width:100%;\"><colgroup><col style=\"width: 6%\"><col style=\"width: 93%\"><\/colgroup><thead><tr class=\"header\"><th>Name<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td>\n<p><code>runSpecialTenderSync<\/code><\/p>\n<\/td><td>\n<p>Creates a tender using a number of attributes.<\/p>\n<\/td><\/tr><\/tbody><\/table>\n<pre><code class=\"language-java\">ped.runSpecialTenderSync(specialTender);<\/code><\/pre>\n<h2 id=\"determine-the-current-and-final-tender-state\">Determine the current and final tender state<\/h2>\n<p>Adyen provides a method to determine the current, or final, tender state. For more information, see\u00a0<a href=\"\/pt\/point-of-sale\/classic-library-deprecation\/classic-library-integrations\/java-native-interface-integration\/key-steps-jni\/process-a-basic-transaction-jni\/determine-the-current-and-final-tender-state-jni\">Determine the current and final tender state - JNI<\/a>.<\/p>\n<h2 id=\"callbacks\">Callbacks<\/h2>\n<table>\n<thead>\n<tr>\n<th>Name<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><a href=\"\/pt\/point-of-sale\/classic-library-deprecation\/classic-library-integrations\/java-native-interface-integration\/key-steps-jni\/process-a-basic-transaction-jni\/handle-progress-events-jni\">\n  <code>progressCallback<\/code>\n<\/a><\/td>\n<td>Reports the progress on a running tender<\/td>\n<\/tr>\n<tr>\n<td><a href=\"\/pt\/point-of-sale\/classic-library-deprecation\/classic-library-integrations\/java-native-interface-integration\/key-steps-jni\/process-a-basic-transaction-jni\/handle-the-print-receipt-callback-jni\">\n  <code>tenderPrintReceiptCallback<\/code>\n<\/a><\/td>\n<td>Returns the receipt for printing, and requests that the POS confirms it has received the receipt.<\/td>\n<\/tr>\n<tr>\n<td><a href=\"\/pt\/point-of-sale\/classic-library-deprecation\/classic-library-integrations\/java-native-interface-integration\/key-steps-jni\/process-a-basic-transaction-jni\/handle-the-final-state-callback-jni\">\n  <code>finalCallback<\/code>\n<\/a><\/td>\n<td>When the system finishes processing the tender, it triggers the final state callback.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>","url":"https:\/\/docs.adyen.com\/pt\/point-of-sale\/classic-library-deprecation\/classic-library-integrations\/java-native-interface-integration\/extras-jni\/start-alipay-and-wechat-pay-transactions-jni","articleFields":{"id":"34116795","type":"page","_expandable":{"operations":""},"status":"current","last_edit_on":"01-05-2019 11:48"},"algolia":{"url":"https:\/\/docs.adyen.com\/pt\/point-of-sale\/classic-library-deprecation\/classic-library-integrations\/java-native-interface-integration\/extras-jni\/start-alipay-and-wechat-pay-transactions-jni","title":"Start Alipay and WeChat Pay transactions","content":"Class\nNameDescription\nMerchantPed\n\nExtends\u00a0 AdyenPed.\u00a0 Class used to implement all PIN entry device (PED) functionality.\n\nSpecial tender parameter\n\n\n\nName\nType\nDescription\n\n\n\n\nspecialTender\nSpecialTender\nHolds tender attributes.\n\n\n\nUse the SpecialTenderBuilder to create the SpecialTender object:\nSpecialTender.SpecialTenderBuilder(merchantAccount,\n                merchantReference,\n                \"payment\",\n                \"alipay\",\n                currency,\n                amount)\n                .tenderOptions(tenderOptions)\n                .specialOptions(specialOptions)\n                .build();\u00a0\nUse put to set special options\nNameDescription\nspecialOptions.put\n\nAllows you to add a special option as a key value pair.\n\nAdd special options parameters to the\u00a0specialTender\u00a0using the\u00a0specialOptions.put\u00a0method.\u00a0\nNameTypeRequiredDescription\ncardNumber\u00a0\n\nString\n\n\n\nThe scanned number from the wallet app (to be provided only for Flow 3: Cash register scans Shopper barcode)\n\nforceEntryMode\n\nString\n\n\n\nThe entry mode for the transaction. In this case, use the value \"Keyed\".\n\nspecialOptions.put(\"cardNumber\", \"60362821657200117610\");\nInstantiate special tender options\n\n\n\nName\nType\nDescription\n\n\n\n\nspecialOptions\nSpecialOptions\nHolds tender attributes.\n\n\n\nParameters\nNameTypeRequiredDescription\ntransactionType\n\nString\n\n\n\nType of transaction. TransactionType takes the following value:payment\n\npaymentMethodType\n\nString\n\n\n\nThe type of payment method, in this case wallets. PaymentMethodType takes the following values:Pass \"alipay\" for an Alipay transaction.Pass \"wechatpay_pos\" for WeChat Pay transaction.\n\nshopperReference\n\nString\n\n\n\nShopper identification (used for omnichannel digital customer recognition).\n\nshopperEmail\n\nString\n\n\n\nShopper identification (used for omnichannel digital customer recognition).\n\nmerchantAccount\n\nString\n\n\n\nThe transaction reference provided by the Merchant (reported in the plataforma de pagamentos da Adyen).\n\nmerchantReference\n\nString\n\n\n\nThe transaction reference provided by the Merchant (reported in the plataforma de pagamentos da Adyen).\n\ncurrency\n\nlong\n\n\n\nThe transaction currency.\n\namount\n\nString\n\n\n\nThe transaction amount in minor units (100 is 1.00 with EUR). The Amount field should be a strong typed field with a string for currency code and a number (long) for the minor digits value (similar to the current API (of the terminal)).\n\nspecialOptions\n\nSpecialTenderOptions\n\n\n\nHolds tender attributes.cardNumber\u00a0forceEntryMode\n\nhandleReceipt\n\nBoolean\n\n\n\nSpecifies that the POS handles and prints receipts. If omitted, it is required that the PED prints the receipt. If there is no printer unit, the transaction will fail.\n\nInstantiate\u00a0specialOptions\u00a0by assigning it to the result of the SpecialTender getter\u00a0specialtender.getSpecialOptions()\nSpecialOptions specialOptions = specialTender.getSpecialOptions();\nCall the method\nNameDescription\nrunSpecialTenderSync\n\nCreates a tender using a number of attributes.\n\nped.runSpecialTenderSync(specialTender);\nDetermine the current and final tender state\nAdyen provides a method to determine the current, or final, tender state. For more information, see\u00a0Determine the current and final tender state - JNI.\nCallbacks\n\n\n\nName\nDescription\n\n\n\n\n\n  progressCallback\n\nReports the progress on a running tender\n\n\n\n  tenderPrintReceiptCallback\n\nReturns the receipt for printing, and requests that the POS confirms it has received the receipt.\n\n\n\n  finalCallback\n\nWhen the system finishes processing the tender, it triggers the final state callback.\n\n\n","type":"page","locale":"pt","boost":14,"hierarchy":{"lvl0":"Home","lvl1":"Terminais","lvl2":"Deprecation of classic libraries","lvl3":"Library integrations","lvl4":"Java Native Interface integration","lvl5":"Extras","lvl6":"Start Alipay and WeChat Pay transactions"},"hierarchy_url":{"lvl0":"https:\/\/docs.adyen.com\/pt","lvl1":"https:\/\/docs.adyen.com\/pt\/point-of-sale","lvl2":"https:\/\/docs.adyen.com\/pt\/point-of-sale\/classic-library-deprecation","lvl3":"https:\/\/docs.adyen.com\/pt\/point-of-sale\/classic-library-deprecation\/classic-library-integrations","lvl4":"https:\/\/docs.adyen.com\/pt\/point-of-sale\/classic-library-deprecation\/classic-library-integrations\/java-native-interface-integration","lvl5":"https:\/\/docs.adyen.com\/pt\/point-of-sale\/classic-library-deprecation\/classic-library-integrations\/java-native-interface-integration\/extras-jni","lvl6":"\/pt\/point-of-sale\/classic-library-deprecation\/classic-library-integrations\/java-native-interface-integration\/extras-jni\/start-alipay-and-wechat-pay-transactions-jni"},"levels":7,"category":"In-person payments","category_color":"green","tags":["Start","Alipay","WeChat","transactions"]}}
